diff --git a/src/kernel/core/arch/x86/arch_cpu.c b/src/kernel/core/arch/x86/arch_cpu.c index 9ad5a359aa..d7caf55379 100755 --- a/src/kernel/core/arch/x86/arch_cpu.c +++ b/src/kernel/core/arch/x86/arch_cpu.c @@ -48,13 +48,13 @@ int arch_cpu_init2(kernel_args *ka) tss = kmalloc(sizeof(struct tss *) * ka->num_cpus); if(tss == NULL) { panic("arch_cpu_init2: could not allocate buffer for tss pointers\n"); - return ERR_NO_MEMORY; + return ENOMEM; } tss_loaded = kmalloc(sizeof(int) * ka->num_cpus); if(tss == NULL) { panic("arch_cpu_init2: could not allocate buffer for tss booleans\n"); - return ERR_NO_MEMORY; + return ENOMEM; } memset(tss_loaded, 0, sizeof(int) * ka->num_cpus); @@ -66,7 +66,7 @@ int arch_cpu_init2(kernel_args *ka) REGION_ADDR_ANY_ADDRESS, PAGE_SIZE, REGION_WIRING_WIRED, LOCK_RW|LOCK_KERNEL); if(rid < 0) { panic("arch_cpu_init2: unable to create region for tss\n"); - return ERR_NO_MEMORY; + return ENOMEM; } memset(tss[i], 0, sizeof(struct tss)); diff --git a/src/kernel/core/arch/x86/arch_int.c b/src/kernel/core/arch/x86/arch_int.c index d1ba319fee..07f0fa8157 100755 --- a/src/kernel/core/arch/x86/arch_int.c +++ b/src/kernel/core/arch/x86/arch_int.c @@ -223,7 +223,7 @@ void i386_handle_trap(struct int_frame frame) } } else { // want to pass too many args into the system - retcode = ERR_INVALID_ARGS; + retcode = EINVAL; } frame.eax = retcode & 0xffffffff; frame.edx = retcode >> 32; diff --git a/src/kernel/core/arch/x86/arch_vm.c b/src/kernel/core/arch/x86/arch_vm.c index deaf004f91..3ee784ff53 100755 --- a/src/kernel/core/arch/x86/arch_vm.c +++ b/src/kernel/core/arch/x86/arch_vm.c @@ -48,7 +48,7 @@ int arch_vm_init_endvm(kernel_args *ka) REGION_ADDR_ANY_ADDRESS, 0xa0000, LOCK_RW|LOCK_KERNEL, 0x0); if(id < 0) { panic("arch_vm_init_endvm: unable to map dma region\n"); - return ERR_NO_MEMORY; + return ENOMEM; } return 0; } diff --git a/src/kernel/core/arch/x86/arch_vm_translation_map.c b/src/kernel/core/arch/x86/arch_vm_translation_map.c index f1f917d26b..c53aa7dd5b 100755 --- a/src/kernel/core/arch/x86/arch_vm_translation_map.c +++ b/src/kernel/core/arch/x86/arch_vm_translation_map.c @@ -505,7 +505,7 @@ restart: if(flags == PHYSICAL_PAGE_NO_WAIT) { // punt back to the caller and let them handle this mutex_unlock(&iospace_mutex); - return ERR_NO_MEMORY; + return ENOMEM; } else { mutex_unlock(&iospace_mutex); acquire_sem(iospace_full_sem); @@ -574,18 +574,18 @@ static vm_translation_map_ops tmap_ops = { int vm_translation_map_create(vm_translation_map *new_map, bool kernel) { if(new_map == NULL) - return ERR_INVALID_ARGS; + return EINVAL; dprintf("vm_translation_map_create\n"); // initialize the new object new_map->ops = &tmap_ops; new_map->map_count = 0; if(recursive_lock_create(&new_map->lock) < 0) - return ERR_NO_MEMORY; + return ENOMEM; new_map->arch_data = (vm_translation_map_arch_info *)kmalloc(sizeof(vm_translation_map_arch_info)); if(new_map == NULL) - return ERR_NO_MEMORY; + return ENOMEM; new_map->arch_data->num_invalidate_pages = 0; @@ -595,7 +595,7 @@ dprintf("vm_translation_map_create\n"); new_map->arch_data->pgdir_virt = kmalloc(PAGE_SIZE); if(new_map->arch_data->pgdir_virt == NULL) { kfree(new_map->arch_data); - return ERR_NO_MEMORY; + return ENOMEM; } if(((addr)new_map->arch_data->pgdir_virt % PAGE_SIZE) != 0) panic("vm_translation_map_create: malloced pgdir and found it wasn't aligned!\n");