diff --git a/src/kernel/core/arch/x86/arch_int.c b/src/kernel/core/arch/x86/arch_int.c index 07f80ab090..cd0c9fbaef 100755 --- a/src/kernel/core/arch/x86/arch_int.c +++ b/src/kernel/core/arch/x86/arch_int.c @@ -178,7 +178,7 @@ void i386_handle_trap(struct int_frame frame) // get the old interrupt enable/disable state and restore to that if(frame.flags & 0x200) { // dprintf("page_fault: enabling interrupts\n"); - int_enable_interrupts(); + enable_interrupts(); } ret = vm_page_fault(cr2, frame.eip, (frame.error_code & 0x2) != 0, @@ -243,11 +243,11 @@ void i386_handle_trap(struct int_frame frame) } if (ret == B_INVOKE_SCHEDULER) { - int state = int_disable_interrupts(); + int state = disable_interrupts(); GRAB_THREAD_LOCK(); thread_resched(); RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); } if(frame.cs == USER_CODE_SEG || frame.vector == 99) { diff --git a/src/kernel/core/arch/x86/arch_selector.c b/src/kernel/core/arch/x86/arch_selector.c index d47eea1673..d942a46940 100644 --- a/src/kernel/core/arch/x86/arch_selector.c +++ b/src/kernel/core/arch/x86/arch_selector.c @@ -7,6 +7,7 @@ #include #include #include +#include #include @@ -37,7 +38,7 @@ selector_id i386_selector_add( selector_type type ) selector_id id = 0; unsigned i; - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock( &spinlock ); for ( i = 0; i < ENTRIES; i++ ) @@ -54,7 +55,7 @@ selector_id i386_selector_add( selector_type type ) } release_spinlock( &spinlock ); - int_restore_interrupts( state ); + restore_interrupts( state ); if ( id ) { asm("lgdt %0;" diff --git a/src/kernel/core/arch/x86/arch_smp.c b/src/kernel/core/arch/x86/arch_smp.c index 988c0293af..ae0694d030 100755 --- a/src/kernel/core/arch/x86/arch_smp.c +++ b/src/kernel/core/arch/x86/arch_smp.c @@ -105,22 +105,18 @@ int arch_smp_init(kernel_args *ka) void arch_smp_send_broadcast_ici(void) { int config; - int state; - - state = int_disable_interrupts(); + int state = disable_interrupts(); config = apic_read(APIC_ICR1) & APIC_ICR1_WRITE_MASK; apic_write(APIC_ICR1, config | 0xfd | APIC_ICR1_DELMODE_FIXED | APIC_ICR1_DESTMODE_PHYS | APIC_ICR1_DEST_ALL_BUT_SELF); - int_restore_interrupts(state); + restore_interrupts(state); } void arch_smp_send_ici(int target_cpu) { int config; - int state; - - state = int_disable_interrupts(); + int state = disable_interrupts(); config = apic_read(APIC_ICR2) & APIC_ICR2_MASK; apic_write(APIC_ICR2, config | cpu_apic_id[target_cpu] << 24); @@ -128,7 +124,7 @@ void arch_smp_send_ici(int target_cpu) config = apic_read(APIC_ICR1) & APIC_ICR1_WRITE_MASK; apic_write(APIC_ICR1, config | 0xfd | APIC_ICR1_DELMODE_FIXED | APIC_ICR1_DESTMODE_PHYS | APIC_ICR1_DEST_FIELD); - int_restore_interrupts(state); + restore_interrupts(state); } void arch_smp_ack_interrupt(void) @@ -153,7 +149,7 @@ int arch_smp_set_apic_timer(bigtime_t relative_timeout) // calculation should be ok, since it's going to be 64-bit ticks = ((relative_timeout * apic_timer_tics_per_sec) / 1000000); - state = int_disable_interrupts(); + state = disable_interrupts(); config = apic_read(APIC_LVTT) | APIC_LVTT_M; // mask the timer apic_write(APIC_LVTT, config); @@ -165,7 +161,7 @@ int arch_smp_set_apic_timer(bigtime_t relative_timeout) apic_write(APIC_ICRT, ticks); // start it up - int_restore_interrupts(state); + restore_interrupts(state); return 0; } @@ -178,14 +174,14 @@ int arch_smp_clear_apic_timer(void) if(apic == NULL) return -1; - state = int_disable_interrupts(); + state = disable_interrupts(); config = apic_read(APIC_LVTT) | APIC_LVTT_M; // mask the timer apic_write(APIC_LVTT, config); apic_write(APIC_ICRT, 0); // zero out the timer - int_restore_interrupts(state); + restore_interrupts(state); return 0; } diff --git a/src/kernel/core/arch/x86/arch_thread.c b/src/kernel/core/arch/x86/arch_thread.c index 1d32127c96..de5e090458 100755 --- a/src/kernel/core/arch/x86/arch_thread.c +++ b/src/kernel/core/arch/x86/arch_thread.c @@ -155,7 +155,7 @@ void arch_thread_enter_uspace(addr entry, void *args, addr ustack_top) // make sure the fpu is in a good state asm("fninit"); - int_disable_interrupts(); + disable_interrupts(); i386_set_kstack(thread_get_current_thread()->kernel_stack_base + KSTACK_SIZE); 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 9edaf014a8..c80e2fa7a7 100755 --- a/src/kernel/core/arch/x86/arch_vm_translation_map.c +++ b/src/kernel/core/arch/x86/arch_vm_translation_map.c @@ -93,17 +93,16 @@ static void init_ptentry(ptentry *e) static void _update_all_pgdirs(int index, pdentry e) { - unsigned int state; vm_translation_map *entry; + unsigned int state = disable_interrupts(); - state = int_disable_interrupts(); acquire_spinlock(&tmap_list_lock); for(entry = tmap_list; entry != NULL; entry = entry->next) entry->arch_data->pgdir_virt[index] = e; release_spinlock(&tmap_list_lock); - int_restore_interrupts(state); + restore_interrupts(state); } static int lock_tmap(vm_translation_map *map) @@ -141,7 +140,7 @@ static void destroy_tmap(vm_translation_map *map) return; // remove it from the tmap list - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&tmap_list_lock); entry = tmap_list; @@ -159,7 +158,7 @@ static void destroy_tmap(vm_translation_map *map) } release_spinlock(&tmap_list_lock); - int_restore_interrupts(state); + restore_interrupts(state); if(map->arch_data->pgdir_virt != NULL) { @@ -412,7 +411,7 @@ static void flush_tmap(vm_translation_map *map) if(map->arch_data->num_invalidate_pages <= 0) return; - state = int_disable_interrupts(); + state = disable_interrupts(); if(map->arch_data->num_invalidate_pages > PAGE_INVALIDATE_CACHE_SIZE) { // invalidate all pages // dprintf("flush_tmap: %d pages to invalidate, doing global invalidation\n", map->arch_data->num_invalidate_pages); @@ -425,7 +424,7 @@ static void flush_tmap(vm_translation_map *map) map->arch_data->num_invalidate_pages, 0, NULL, SMP_MSG_FLAG_SYNC); } map->arch_data->num_invalidate_pages = 0; - int_restore_interrupts(state); + restore_interrupts(state); } static int map_iospace_chunk(addr va, addr pa) @@ -450,11 +449,11 @@ static int map_iospace_chunk(addr va, addr pa) pt[i].present = 1; } - state = int_disable_interrupts(); + state = disable_interrupts(); arch_cpu_invalidate_TLB_range(va, va + (IOSPACE_CHUNK_SIZE - PAGE_SIZE)); smp_send_broadcast_ici(SMP_MSG_INVL_PAGE_RANGE, va, va + (IOSPACE_CHUNK_SIZE - PAGE_SIZE), 0, NULL, SMP_MSG_FLAG_SYNC); - int_restore_interrupts(state); + restore_interrupts(state); return 0; } @@ -613,7 +612,7 @@ dprintf("vm_translation_map_create\n"); // insert this new map into the map list { - int state = int_disable_interrupts(); + int state = disable_interrupts(); acquire_spinlock(&tmap_list_lock); // copy the top portion of the pgdir from the current one @@ -624,7 +623,7 @@ dprintf("vm_translation_map_create\n"); tmap_list = new_map; release_spinlock(&tmap_list_lock); - int_restore_interrupts(state); + restore_interrupts(state); } return 0; diff --git a/src/kernel/core/cbuf.c b/src/kernel/core/cbuf.c index 026e1ad073..0b6325569f 100644 --- a/src/kernel/core/cbuf.c +++ b/src/kernel/core/cbuf.c @@ -53,7 +53,7 @@ static void *_cbuf_alloc(size_t *size) // dprintf("cbuf_alloc: asked to allocate size %d\n", *size); - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&cbuf_lowlevel_spinlock); // scan through the allocation bitmap, looking for the first free block @@ -85,7 +85,7 @@ static void *_cbuf_alloc(size_t *size) } release_spinlock(&cbuf_lowlevel_spinlock); - int_restore_interrupts(state); + restore_interrupts(state); return buf; } @@ -162,14 +162,14 @@ void cbuf_free_chain_noblock(cbuf *buf) head = buf; _clear_chain(head, &last); - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&noblock_spin); last->next = cbuf_free_noblock_list; cbuf_free_noblock_list = head; release_spinlock(&noblock_spin); - int_restore_interrupts(state); + restore_interrupts(state); } void cbuf_free_chain(cbuf *buf) @@ -246,14 +246,14 @@ cbuf *cbuf_get_chain_noblock(size_t len) size_t chain_len = 0; int state; - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&noblock_spin); while(chain_len < len) { if(cbuf_free_noblock_list == NULL) { dprintf("cbuf_get_chain_noblock: not enough cbufs\n"); release_spinlock(&noblock_spin); - int_restore_interrupts(state); + restore_interrupts(state); if(chain != NULL) cbuf_free_chain_noblock(chain); @@ -271,7 +271,7 @@ cbuf *cbuf_get_chain_noblock(size_t len) chain_len += chain->len; } release_spinlock(&noblock_spin); - int_restore_interrupts(state); + restore_interrupts(state); // now we have a chain, fixup the first and last entry chain->total_len = len; diff --git a/src/kernel/core/debug.c b/src/kernel/core/debug.c index ed6c68ac4a..869b4d0df7 100644 --- a/src/kernel/core/debug.c +++ b/src/kernel/core/debug.c @@ -198,7 +198,7 @@ static void kernel_debugger_loop() int argc; struct debugger_command *cmd; - int_disable_interrupts(); + disable_interrupts(); dprintf("kernel debugger on cpu %d\n", smp_get_current_cpu()); debugger_on_cpu = smp_get_current_cpu(); @@ -248,7 +248,7 @@ int panic(const char *fmt, ...) dbg_set_serial_debug(true); - state = int_disable_interrupts(); + state = disable_interrupts(); va_start(args, fmt); ret = vsprintf(temp, fmt, args); @@ -266,7 +266,7 @@ int panic(const char *fmt, ...) kernel_debugger(NULL); - int_restore_interrupts(state); + restore_interrupts(state); return ret; } @@ -289,7 +289,7 @@ int dprintf(const char *fmt, ...) char dbg_putch(char c) { char ret; - int flags = int_disable_interrupts(); + int flags = disable_interrupts(); acquire_spinlock(&dbg_spinlock); if(serial_debug_on) @@ -298,21 +298,21 @@ char dbg_putch(char c) ret = c; release_spinlock(&dbg_spinlock); - int_restore_interrupts(flags); + restore_interrupts(flags); return ret; } void dbg_puts(const char *s) { - int flags = int_disable_interrupts(); + int flags = disable_interrupts(); acquire_spinlock(&dbg_spinlock); if(serial_debug_on) arch_dbg_con_puts(s); release_spinlock(&dbg_spinlock); - int_restore_interrupts(flags); + restore_interrupts(flags); } int add_debugger_command(const char * name, int (*func)(int, char **), const char * desc) @@ -328,14 +328,14 @@ int add_debugger_command(const char * name, int (*func)(int, char **), const cha cmd->name = name; cmd->description = desc; - flags = int_disable_interrupts(); + flags = disable_interrupts(); acquire_spinlock(&dbg_spinlock); cmd->next = commands; commands = cmd; release_spinlock(&dbg_spinlock); - int_restore_interrupts(flags); + restore_interrupts(flags); return B_NO_ERROR; } @@ -346,7 +346,7 @@ int remove_debugger_command(const char * name, int (*func)(int, char **)) struct debugger_command *cmd; struct debugger_command *prev; - flags = int_disable_interrupts(); + flags = disable_interrupts(); acquire_spinlock(&dbg_spinlock); prev = NULL; @@ -367,7 +367,7 @@ int remove_debugger_command(const char * name, int (*func)(int, char **)) }; release_spinlock(&dbg_spinlock); - int_restore_interrupts(flags); + restore_interrupts(flags); if (cmd) { kfree(cmd); diff --git a/src/kernel/core/int.c b/src/kernel/core/int.c index 8ffd7b78a5..049fb07c36 100644 --- a/src/kernel/core/int.c +++ b/src/kernel/core/int.c @@ -82,11 +82,11 @@ long install_interrupt_handler(long vector, interrupt_handler handler, /* Disable the interrupts, get the spinlock for this irq only * and then insert the handler */ - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&io_vectors[vector].vector_lock); insque(io, &io_vectors[vector].handler_list); release_spinlock(&io_vectors[vector].vector_lock); - int_restore_interrupts(state); + restore_interrupts(state); return 0; } @@ -124,7 +124,7 @@ long remove_interrupt_handler(long vector, interrupt_handler handler, long rv = EINVAL; /* lock the structures down so it is not modified while we search */ - int state = int_disable_interrupts(); + int state = disable_interrupts(); acquire_spinlock(&io_vectors[vector].vector_lock); /* loop through the available handlers and try to find a match. @@ -147,7 +147,7 @@ long remove_interrupt_handler(long vector, interrupt_handler handler, * the value rv */ release_spinlock(&io_vectors[vector].vector_lock); - int_restore_interrupts(state); + restore_interrupts(state); return rv; } diff --git a/src/kernel/core/main.c b/src/kernel/core/main.c index 522519e549..bfe693b4ff 100644 --- a/src/kernel/core/main.c +++ b/src/kernel/core/main.c @@ -101,7 +101,7 @@ int _start(kernel_args *oldka, int cpu_num) // this is run per cpu for each AP processor after they've been set loose thread_init_percpu(cpu_num); } - int_enable_interrupts(); + enable_interrupts(); dprintf("main: done... begin idle loop on cpu %d\n", cpu_num); for(;;) diff --git a/src/kernel/core/port.c b/src/kernel/core/port.c index 43867cd008..12d5d9df09 100644 --- a/src/kernel/core/port.c +++ b/src/kernel/core/port.c @@ -215,7 +215,7 @@ create_port(int32 queue_length, const char *name) } owner = proc_get_current_proc_id(); - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LIST_LOCK(); // find the first empty spot @@ -262,7 +262,7 @@ create_port(int32 queue_length, const char *name) kfree(q); out: - int_restore_interrupts(state); + restore_interrupts(state); return retval; } @@ -280,12 +280,12 @@ close_port(port_id id) slot = id % MAX_PORTS; // walk through the sem list, trying to match name - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); if (ports[slot].id != id) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); return B_BAD_PORT_ID; } @@ -293,7 +293,7 @@ close_port(port_id id) ports[slot].closed = true; RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); return B_NO_ERROR; } @@ -317,12 +317,12 @@ delete_port(port_id id) slot = id % MAX_PORTS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); if(ports[slot].id != id) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("delete_port: invalid port_id %d\n", id); return B_BAD_PORT_ID; } @@ -337,7 +337,7 @@ delete_port(port_id id) ports[slot].name = NULL; RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); // delete the cbuf's that are left in the queue (if any) for (i=0; itotal_count = ports[slot].total_count; RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); // from our port_entry return B_NO_ERROR; @@ -453,7 +453,7 @@ _get_next_port_info(team_id proc, int32 *cookie, struct port_info *info, } // spinlock - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LIST_LOCK(); info->port = -1; // used as found flag @@ -477,7 +477,7 @@ _get_next_port_info(team_id proc, int32 *cookie, struct port_info *info, slot++; } RELEASE_PORT_LIST_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if (info->port == -1) return B_BAD_PORT_ID; @@ -509,17 +509,17 @@ port_buffer_size_etc(port_id id, slot = id % MAX_PORTS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); if(ports[slot].id != id) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("get_port_info: invalid port_id %d\n", id); return B_BAD_PORT_ID; } RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); // block if no message, // if TIMEOUT flag set, block with timeout @@ -574,12 +574,12 @@ port_count(port_id id) slot = id % MAX_PORTS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); if(ports[slot].id != id) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("port_count: invalid port_id %d\n", id); return B_BAD_PORT_ID; } @@ -590,7 +590,7 @@ port_count(port_id id) count = 0; RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); // return count of messages (sem_count) return count; @@ -638,12 +638,12 @@ read_port_etc(port_id id, slot = id % MAX_PORTS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); if(ports[slot].id != id) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("read_port_etc: invalid port_id %d\n", id); return B_BAD_PORT_ID; } @@ -652,7 +652,7 @@ read_port_etc(port_id id, // unlock port && enable ints/ RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); // XXX -> possible race condition if port gets deleted (->sem deleted too), therefore // sem_id is cached in local variable up here @@ -679,7 +679,7 @@ read_port_etc(port_id id, return res; } - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); t = ports[slot].tail; @@ -702,7 +702,7 @@ read_port_etc(port_id id, cached_semid = ports[slot].write_sem; RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); // copy message *msg_code = code; @@ -739,12 +739,12 @@ set_port_owner(port_id id, proc_id proc) slot = id % MAX_PORTS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); if(ports[slot].id != id) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("set_port_owner: invalid port_id %d\n", id); return B_BAD_PORT_ID; } @@ -754,7 +754,7 @@ set_port_owner(port_id id, proc_id proc) // unlock port RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); return B_NO_ERROR; } @@ -799,19 +799,19 @@ write_port_etc(port_id id, if (buffer_size > PORT_MAX_MESSAGE_SIZE) return EINVAL; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); if(ports[slot].id != id) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("write_port_etc: invalid port_id %d\n", id); return B_BAD_PORT_ID; } if (ports[slot].closed) { RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("write_port_etc: port %d closed\n", id); return B_BAD_PORT_ID; } @@ -820,7 +820,7 @@ write_port_etc(port_id id, cached_semid = ports[slot].write_sem; RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); // XXX -> possible race condition if port gets deleted (->sem deleted too), // and queue is full therefore sem_id is cached in local variable up here @@ -866,7 +866,7 @@ write_port_etc(port_id id, } // attach copied message to queue - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LOCK(ports[slot]); h = ports[slot].head; @@ -884,7 +884,7 @@ write_port_etc(port_id id, cached_semid = ports[slot].read_sem; RELEASE_PORT_LOCK(ports[slot]); - int_restore_interrupts(state); + restore_interrupts(state); get_sem_count(ports[slot].read_sem, &c1); get_sem_count(ports[slot].write_sem, &c2); @@ -906,7 +906,7 @@ int delete_owned_ports(proc_id owner) if(ports_active == false) return B_BAD_PORT_ID; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PORT_LIST_LOCK(); for(i=0; iblocked_sem_id % MAX_SEMS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LOCK(sems[slot]); // dprintf("sem_timeout: called on 0x%x sem %d, tid %d\n", to, to->sem_id, to->thread_id); @@ -315,7 +315,7 @@ static int sem_timeout(timer *data) } RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); return B_INVOKE_SCHEDULER; } @@ -341,7 +341,7 @@ int acquire_sem_etc(sem_id id, int count, int flags, bigtime_t timeout) if (count <= 0) return EINVAL; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LOCK(sems[slot]); if (sems[slot].id != id) { @@ -426,14 +426,14 @@ int acquire_sem_etc(sem_id id, int count, int flags, bigtime_t timeout) } } - int_restore_interrupts(state); + restore_interrupts(state); return t->sem_errcode; } err: RELEASE_SEM_LOCK(sems[slot]); - int_restore_interrupts(state); + restore_interrupts(state); return err; } @@ -459,7 +459,7 @@ int release_sem_etc(sem_id id, int count, int flags) if (count <= 0) return EINVAL; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LOCK(sems[slot]); if (sems[slot].id != id) { @@ -514,7 +514,7 @@ int release_sem_etc(sem_id id, int count, int flags) err: RELEASE_SEM_LOCK(sems[slot]); outnolock: - int_restore_interrupts(state); + restore_interrupts(state); return err; } @@ -533,12 +533,12 @@ int get_sem_count(sem_id id, int32* thread_count) slot = id % MAX_SEMS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LOCK(sems[slot]); if (sems[slot].id != id) { RELEASE_SEM_LOCK(sems[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("sem_get_count: invalid sem_id %d\n", id); return B_BAD_SEM_ID; } @@ -546,7 +546,7 @@ int get_sem_count(sem_id id, int32* thread_count) *thread_count = sems[slot].count; RELEASE_SEM_LOCK(sems[slot]); - int_restore_interrupts(state); + restore_interrupts(state); return B_NO_ERROR; } @@ -565,12 +565,12 @@ int _get_sem_info(sem_id id, struct sem_info *info, size_t sz) slot = id % MAX_SEMS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LOCK(sems[slot]); if (sems[slot].id != id) { RELEASE_SEM_LOCK(sems[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("get_sem_info: invalid sem_id %d\n", id); return B_BAD_SEM_ID; } @@ -582,7 +582,7 @@ int _get_sem_info(sem_id id, struct sem_info *info, size_t sz) info->latest_holder = sems[slot].q.head->id; // XXX not sure if this is correct RELEASE_SEM_LOCK(sems[slot]); - int_restore_interrupts(state); + restore_interrupts(state); return B_NO_ERROR; } @@ -611,7 +611,7 @@ int _get_next_sem_info(proc_id proc, uint32 *cookie, struct sem_info *info, size return B_BAD_SEM_ID; } // spinlock - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LIST_LOCK(); while (slot < MAX_SEMS) { @@ -633,7 +633,7 @@ int _get_next_sem_info(proc_id proc, uint32 *cookie, struct sem_info *info, size slot++; } RELEASE_SEM_LIST_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if (slot == MAX_SEMS) return B_BAD_SEM_ID; @@ -659,12 +659,12 @@ int set_sem_owner(sem_id id, proc_id proc) slot = id % MAX_SEMS; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LOCK(sems[slot]); if (sems[slot].id != id) { RELEASE_SEM_LOCK(sems[slot]); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("set_sem_owner: invalid sem_id %d\n", id); return B_BAD_SEM_ID; } @@ -672,7 +672,7 @@ int set_sem_owner(sem_id id, proc_id proc) sems[slot].owner = proc; RELEASE_SEM_LOCK(sems[slot]); - int_restore_interrupts(state); + restore_interrupts(state); return B_NO_ERROR; } @@ -754,7 +754,7 @@ int sem_delete_owned_sems(proc_id owner) if (owner < 0) return B_BAD_SEM_ID; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_SEM_LIST_LOCK(); for (i=0; i 1) { int curr_cpu = smp_get_current_cpu(); - if(int_is_interrupts_enabled()) + if(are_interrupts_enabled()) panic("acquire_spinlock: attempt to acquire lock %p with interrupts enabled\n", lock); while(1) { while(*lock != 0) @@ -104,14 +104,14 @@ static int find_free_message(struct smp_msg **msg) retry: while(free_msg_count <= 0) ; - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&free_msg_spinlock); if(free_msg_count <= 0) { // someone grabbed one while we were getting the lock, // go back to waiting for it release_spinlock(&free_msg_spinlock); - int_restore_interrupts(state); + restore_interrupts(state); goto retry; } @@ -278,7 +278,7 @@ static int smp_process_pending_ici(int curr_cpu) // special case for the halt message // we otherwise wouldn't have gotten the opportunity to clean up if(halt) { - int_disable_interrupts(); + disable_interrupts(); for(;;); } @@ -316,7 +316,7 @@ void smp_send_ici(int target_cpu, int message, unsigned long data, unsigned long curr_cpu = smp_get_current_cpu(); if(target_cpu == curr_cpu) { return_free_message(msg); - int_restore_interrupts(state); + restore_interrupts(state); return; // nope, cant do that } @@ -349,7 +349,7 @@ void smp_send_ici(int target_cpu, int message, unsigned long data, unsigned long return_free_message(msg); } - int_restore_interrupts(state); + restore_interrupts(state); } } @@ -404,7 +404,7 @@ void smp_send_broadcast_ici(int message, unsigned long data, unsigned long data2 return_free_message(msg); } - int_restore_interrupts(state); + restore_interrupts(state); } // dprintf("smp_send_broadcast_ici: done\n"); } diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c index a046d7c1cc..627d849c35 100644 --- a/src/kernel/core/thread.c +++ b/src/kernel/core/thread.c @@ -306,11 +306,11 @@ static struct thread *create_thread_struct(const char *name) struct thread *t; int state; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_dequeue(&dead_q); RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if(t == NULL) { t = (struct thread *)kmalloc(sizeof(struct thread)); @@ -414,7 +414,7 @@ static thread_id _create_thread(const char *name, proc_id pid, addr entry, void t->state = THREAD_STATE_BIRTH; t->next_state = THREAD_STATE_SUSPENDED; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); // insert into global list @@ -435,7 +435,7 @@ static thread_id _create_thread(const char *name, proc_id pid, addr entry, void hash_remove(thread_hash, t); RELEASE_THREAD_LOCK(); } - int_restore_interrupts(state); + restore_interrupts(state); if(abort) { delete_thread_struct(t); return ERR_TASK_PROC_DELETED; @@ -526,7 +526,7 @@ int thread_suspend_thread(thread_id id) int retval; bool global_resched = false; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_get_current_thread(); @@ -551,7 +551,7 @@ int thread_suspend_thread(thread_id id) } RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if(global_resched) { smp_send_broadcast_ici(SMP_MSG_RESCHEDULE, 0, 0, 0, NULL, SMP_MSG_FLAG_SYNC); @@ -566,7 +566,7 @@ int thread_resume_thread(thread_id id) struct thread *t; int retval; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_get_thread_struct_locked(id); @@ -581,7 +581,7 @@ int thread_resume_thread(thread_id id) } RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); return retval; } @@ -604,7 +604,7 @@ int thread_set_priority(thread_id id, int priority) t->priority = priority; retval = B_NO_ERROR; } else { - int state = int_disable_interrupts(); + int state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_get_thread_struct_locked(id); @@ -623,7 +623,7 @@ int thread_set_priority(thread_id id, int priority) } RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); } return retval; @@ -868,7 +868,7 @@ static int get_death_stack(void) acquire_sem(death_stack_sem); // grap the thread lock, find a free spot and release - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); bit = death_stack_bitmap; bit = (~bit)&~((~bit)-1); @@ -907,7 +907,7 @@ static void put_death_stack_and_reschedule(unsigned int index) if(!(death_stack_bitmap & (1 << index))) panic("put_death_stack: passed invalid stack index %d\n", index); - int_disable_interrupts(); + disable_interrupts(); GRAB_THREAD_LOCK(); death_stack_bitmap &= ~(1 << index); @@ -1047,21 +1047,21 @@ void thread_start_threading(void) // XXX may not be the best place for this // invalidate all of the other processors' TLB caches - state = int_disable_interrupts(); + state = disable_interrupts(); arch_cpu_global_TLB_invalidate(); smp_send_broadcast_ici(SMP_MSG_GLOBAL_INVL_PAGE, 0, 0, 0, NULL, SMP_MSG_FLAG_SYNC); - int_restore_interrupts(state); + restore_interrupts(state); // start the other processors smp_send_broadcast_ici(SMP_MSG_RESCHEDULE, 0, 0, 0, NULL, SMP_MSG_FLAG_ASYNC); - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); thread_resched(); RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); } int user_thread_snooze(bigtime_t time) @@ -1087,7 +1087,7 @@ static void thread_entry(void) // simulates the thread spinlock release that would occur if the thread had been // rescheded from. The resched didn't happen because the thread is new. RELEASE_THREAD_LOCK(); - int_enable_interrupts(); // this essentially simulates a return-from-interrupt + enable_interrupts(); // this essentially simulates a return-from-interrupt } // used to pass messages between thread_exit and thread_exit2 @@ -1107,7 +1107,7 @@ static void thread_exit2(void *_args) memcpy(&args, _args, sizeof(struct thread_exit_args)); // restore the interrupts - int_restore_interrupts(args.int_state); + restore_interrupts(args.int_state); // dprintf("thread_exit2, running on death stack 0x%lx\n", args.t->kernel_stack_base); @@ -1118,7 +1118,7 @@ static void thread_exit2(void *_args) // dprintf("thread_exit2: removing thread 0x%x from global lists\n", args.t->id); // remove this thread from all of the global lists - int_disable_interrupts(); + disable_interrupts(); GRAB_PROC_LOCK(); remove_thread_from_proc(kernel_proc, args.t); RELEASE_PROC_LOCK(); @@ -1160,7 +1160,7 @@ void thread_exit(int retcode) if(p != kernel_proc) { // remove this thread from the current process and add it to the kernel // put the thread into the kernel proc until it dies - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); remove_thread_from_proc(p, t); insert_thread_into_proc(kernel_proc, t); @@ -1173,7 +1173,7 @@ void thread_exit(int retcode) RELEASE_PROC_LOCK(); // swap address spaces, to make sure we're running on the kernel's pgdir vm_aspace_swap(kernel_proc->kaspace); - int_restore_interrupts(state); + restore_interrupts(state); // dprintf("thread_exit: thread 0x%x now a kernel thread!\n", t->id); } @@ -1186,7 +1186,7 @@ void thread_exit(int retcode) // XXX this can be optimized. There's got to be a better solution. struct thread *temp_thread; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); // we can safely walk the list because of the lock. no new threads can be created // because of the PROC_STATE_DEATH flag on the process @@ -1197,7 +1197,7 @@ void thread_exit(int retcode) temp_thread = next; } RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); // Now wait for all of the threads to die // XXX block on a semaphore @@ -1230,7 +1230,7 @@ void thread_exit(int retcode) args.death_stack = death_stack; // disable the interrupts. Must remain disabled until the kernel stack pointer can be officially switched - args.int_state = int_disable_interrupts(); + args.int_state = disable_interrupts(); // set the new kernel stack officially to the death stack, wont be really switched until // the next function is called. This bookkeeping must be done now before a context switch @@ -1253,7 +1253,7 @@ static int _thread_kill_thread(thread_id id, bool wait_on) // dprintf("_thread_kill_thread: id %d, wait_on %d\n", id, wait_on); - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_get_thread_struct_locked(id); @@ -1272,7 +1272,7 @@ static int _thread_kill_thread(thread_id id, bool wait_on) } RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if(rc < 0) return rc; @@ -1321,7 +1321,7 @@ int thread_wait_on_thread(thread_id id, int *retcode) struct thread *t; int rc; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_get_thread_struct_locked(id); @@ -1332,7 +1332,7 @@ int thread_wait_on_thread(thread_id id, int *retcode) } RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); rc = acquire_sem(sem); @@ -1341,14 +1341,14 @@ int thread_wait_on_thread(thread_id id, int *retcode) rc = B_NO_ERROR; if (retcode) { - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_get_current_thread(); dprintf("thread_wait_on_thread: thread %d got return code 0x%x\n", t->id, t->sem_deleted_retcode); *retcode = t->sem_deleted_retcode; RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); } } @@ -1380,7 +1380,7 @@ int proc_wait_on_proc(proc_id id, int *retcode) thread_id tid; int state; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); p = proc_get_proc_struct_locked(id); if(p && p->main_thread) { @@ -1389,7 +1389,7 @@ int proc_wait_on_proc(proc_id id, int *retcode) tid = ERR_INVALID_HANDLE; } RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if(tid < 0) return tid; @@ -1402,13 +1402,13 @@ struct thread *thread_get_thread_struct(thread_id id) struct thread *t; int state; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); t = thread_get_thread_struct_locked(id); RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); return t; } @@ -1428,13 +1428,13 @@ static struct proc *proc_get_proc_struct(proc_id id) struct proc *p; int state; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); p = proc_get_proc_struct_locked(id); RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); return p; } @@ -1770,11 +1770,11 @@ proc_id proc_create_proc(const char *path, const char *name, char **args, int ar pid = p->id; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); hash_insert(proc_hash, p); RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); // copy the args over pargs = (struct proc_arg *)kmalloc(sizeof(struct proc_arg)); @@ -1831,11 +1831,11 @@ err2: kfree(pargs); err1: // remove the proc structure from the proc hash table and delete the proc structure - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); hash_remove(proc_hash, p); RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); delete_proc_struct(p); //err: return err; @@ -1901,7 +1901,7 @@ int user_proc_get_table(struct proc_info *pbuf, size_t len) if((addr)pbuf >= KERNEL_BASE && (addr)pbuf <= KERNEL_TOP) return ERR_VM_BAD_USER_MEMORY; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); hash_open(proc_hash, &i); @@ -1917,7 +1917,7 @@ int user_proc_get_table(struct proc_info *pbuf, size_t len) hash_close(proc_hash, &i, false); RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if (count < max) return count; @@ -1934,7 +1934,7 @@ int proc_kill_proc(proc_id id) thread_id tid = -1; int retval = 0; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); p = proc_get_proc_struct_locked(id); @@ -1945,7 +1945,7 @@ int proc_kill_proc(proc_id id) } RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); if(retval < 0) return retval; @@ -1991,7 +1991,7 @@ static void _check_for_thread_sigs(struct thread *t, int state) t->pending_signals &= ~SIG_KILL; RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); thread_exit(0); // never gets to here } @@ -2014,7 +2014,7 @@ void thread_atkernel_entry(void) t = thread_get_current_thread(); - state = int_disable_interrupts(); + state = disable_interrupts(); // track user time now = system_time(); @@ -2028,7 +2028,7 @@ void thread_atkernel_entry(void) _check_for_thread_sigs(t, state); RELEASE_THREAD_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); } // called when a thread exits kernel space to user space @@ -2042,7 +2042,7 @@ void thread_atkernel_exit(void) t = thread_get_current_thread(); - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_THREAD_LOCK(); _check_for_thread_sigs(t, state); @@ -2056,7 +2056,7 @@ void thread_atkernel_exit(void) t->kernel_time += now - t->last_time; t->last_time = now; - int_restore_interrupts(state); + restore_interrupts(state); } int user_getrlimit(int resource, struct rlimit * urlp) @@ -2183,7 +2183,7 @@ int sys_setenv(const char *name, const char *value, int overwrite) if (strlen(name) + strlen(value) + 1 >= SYS_THREAD_STRING_LENGTH_MAX) return -1; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); strcpy(var, name); @@ -2241,7 +2241,7 @@ int sys_setenv(const char *name, const char *value, int overwrite) dprintf("sys_setenv: variable set.\n"); RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); return rc; } @@ -2283,7 +2283,7 @@ int sys_getenv(const char *name, char **value) int len = strlen(name); int rc = -1; - state = int_disable_interrupts(); + state = disable_interrupts(); GRAB_PROC_LOCK(); envp = (char **)thread_get_current_thread()->proc->user_env_base; @@ -2299,7 +2299,7 @@ int sys_getenv(const char *name, char **value) } RELEASE_PROC_LOCK(); - int_restore_interrupts(state); + restore_interrupts(state); return rc; } diff --git a/src/kernel/core/timer.c b/src/kernel/core/timer.c index 0c0bcf8d1c..1b434dfc16 100644 --- a/src/kernel/core/timer.c +++ b/src/kernel/core/timer.c @@ -132,7 +132,7 @@ status_t add_timer(timer *t, timer_hook hook, bigtime_t period, int32 flags) t->hook = hook; t->flags = flags; - state = int_disable_interrupts(); + state = disable_interrupts(); curr_cpu = smp_get_current_cpu(); acquire_spinlock(&timer_spinlock[curr_cpu]); @@ -144,7 +144,7 @@ status_t add_timer(timer *t, timer_hook hook, bigtime_t period, int32 flags) arch_timer_set_hardware_timer(sched_time - curr_time); release_spinlock(&timer_spinlock[curr_cpu]); - int_restore_interrupts(state); + restore_interrupts(state); return B_OK; } @@ -201,7 +201,7 @@ bool cancel_timer(timer *event) // if (event->sched_time == 0) // return 0; // it's not scheduled - state = int_disable_interrupts(); + state = disable_interrupts(); curr_cpu = smp_get_current_cpu(); // walk through all of the cpu's timer queues @@ -237,7 +237,7 @@ done: if (foundit) release_spinlock(&timer_spinlock[cpu]); - int_restore_interrupts(state); + restore_interrupts(state); if (foundit && ((bigtime_t)event->entry.key < system_time())) return true; diff --git a/src/kernel/core/vm/vm.c b/src/kernel/core/vm/vm.c index b94608df10..4b21251e03 100755 --- a/src/kernel/core/vm/vm.c +++ b/src/kernel/core/vm/vm.c @@ -361,12 +361,12 @@ static int map_backing_store(vm_address_space *aspace, vm_store *store, off_t commitment = (store->ops->commit)(store, offset + size); // Commit through to the new end if(commitment < offset + size) { // Uh oh - didn't work if(cache->temporary) { // If this is a temporary cache, Check to see if we ran out of space and return error. - int state = int_disable_interrupts(); + int state = disable_interrupts(); acquire_spinlock(&max_commit_lock); if (max_commit - old_store_commitment + commitment < offset + size) { release_spinlock(&max_commit_lock); - int_restore_interrupts(state); + restore_interrupts(state); mutex_unlock(&cache_ref->lock); err = ERR_VM_WOULD_OVERCOMMIT; goto err1a; @@ -375,7 +375,7 @@ static int map_backing_store(vm_address_space *aspace, vm_store *store, max_commit += (commitment - old_store_commitment) - (offset + size - cache->virtual_size); cache->virtual_size = offset + size; release_spinlock(&max_commit_lock); - int_restore_interrupts(state); + restore_interrupts(state); } else { mutex_unlock(&cache_ref->lock); err = ENOMEM; @@ -2158,11 +2158,11 @@ void vm_increase_max_commit(addr delta) // dprintf("vm_increase_max_commit: delta 0x%x\n", delta); - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&max_commit_lock); max_commit += delta; release_spinlock(&max_commit_lock); - int_restore_interrupts(state); + restore_interrupts(state); } int user_memcpy(void *to, const void *from, size_t size) diff --git a/src/kernel/core/vm/vm_cache.c b/src/kernel/core/vm/vm_cache.c index 9b6dbe5e91..8367c99ace 100755 --- a/src/kernel/core/vm/vm_cache.c +++ b/src/kernel/core/vm/vm_cache.c @@ -150,13 +150,13 @@ void vm_cache_release_ref(vm_cache_ref *cache_ref) page = page->cache_next; // remove it from the hash table - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_cache_table_lock); hash_remove(page_cache_table, old_page); release_spinlock(&page_cache_table_lock); - int_restore_interrupts(state); + restore_interrupts(state); // dprintf("vm_cache_release_ref: freeing page 0x%x\n", old_page->ppn); vm_page_set_state(old_page, PAGE_STATE_FREE); @@ -187,13 +187,13 @@ vm_page *vm_cache_lookup_page(vm_cache_ref *cache_ref, off_t offset) key.offset = offset; key.ref = cache_ref; - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_cache_table_lock); page = hash_lookup(page_cache_table, &key); release_spinlock(&page_cache_table_lock); - int_restore_interrupts(state); + restore_interrupts(state); return page; } @@ -215,13 +215,13 @@ void vm_cache_insert_page(vm_cache_ref *cache_ref, vm_page *page, off_t offset) page->cache_ref = cache_ref; - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_cache_table_lock); hash_insert(page_cache_table, page); release_spinlock(&page_cache_table_lock); - int_restore_interrupts(state); + restore_interrupts(state); } @@ -231,13 +231,13 @@ void vm_cache_remove_page(vm_cache_ref *cache_ref, vm_page *page) // dprintf("vm_cache_remove_page: cache 0x%x, page 0x%x\n", cache_ref, page); - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_cache_table_lock); hash_remove(page_cache_table, page); release_spinlock(&page_cache_table_lock); - int_restore_interrupts(state); + restore_interrupts(state); if(cache_ref->cache->page_list == page) { if(page->cache_next != NULL) diff --git a/src/kernel/core/vm/vm_page.c b/src/kernel/core/vm/vm_page.c index d777a1aa32..4ca1df347b 100755 --- a/src/kernel/core/vm/vm_page.c +++ b/src/kernel/core/vm/vm_page.c @@ -117,25 +117,25 @@ static int pageout_daemon() dprintf("here\n"); - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_lock); page = dequeue_page(&page_modified_queue); page->state = PAGE_STATE_BUSY; vm_cache_acquire_ref(page->cache_ref, true); release_spinlock(&page_lock); - int_restore_interrupts(state); + restore_interrupts(state); dprintf("got page %p\n", page); if(page->cache_ref->cache->temporary && !trimming_cycle) { // unless we're in the trimming cycle, dont write out pages // that back anonymous stores - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_lock); enqueue_page(&page_modified_queue, page); page->state = PAGE_STATE_MODIFIED; release_spinlock(&page_lock); - int_restore_interrupts(state); + restore_interrupts(state); vm_cache_release_ref(page->cache_ref); continue; } @@ -163,7 +163,7 @@ static int pageout_daemon() vm_put_physical_page((addr)vecs->vec[0].iov_base); - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_lock); if(page->ref_count > 0) { page->state = PAGE_STATE_ACTIVE; @@ -172,7 +172,7 @@ static int pageout_daemon() } enqueue_page(&page_active_queue, page); release_spinlock(&page_lock); - int_restore_interrupts(state); + restore_interrupts(state); vm_cache_release_ref(page->cache_ref); } @@ -291,7 +291,7 @@ static int page_scrubber(void *unused) thread_snooze(100000); // 100ms if(page_free_queue.count > 0) { - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_lock); for(i=0; ippn * PAGE_SIZE); } - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_lock); for(i=0; ippn * PAGE_SIZE); @@ -497,7 +497,7 @@ vm_page *vm_page_allocate_page_run(int page_state, addr len) start = 0; - state = int_disable_interrupts(); + state = disable_interrupts(); acquire_spinlock(&page_lock); for(;;) { @@ -528,7 +528,7 @@ vm_page *vm_page_allocate_page_run(int page_state, addr len) } } release_spinlock(&page_lock); - int_restore_interrupts(state); + restore_interrupts(state); return first_page; } @@ -599,13 +599,13 @@ static int vm_page_set_state_nolock(vm_page *page, int page_state) int vm_page_set_state(vm_page *page, int page_state) { int err; - int state = int_disable_interrupts(); + int state = disable_interrupts(); acquire_spinlock(&page_lock); err = vm_page_set_state_nolock(page, page_state); release_spinlock(&page_lock); - int_restore_interrupts(state); + restore_interrupts(state); return err; }