diff --git a/src/system/kernel/arch/x86/arch_int.c b/src/system/kernel/arch/x86/arch_int.c index 9d1a57051b..c612ec6960 100644 --- a/src/system/kernel/arch/x86/arch_int.c +++ b/src/system/kernel/arch/x86/arch_int.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001, Travis Geiselbrecht. All rights reserved. @@ -225,6 +225,12 @@ pic_init(void) // determine which interrupts are level or edge triggered +#if 0 + // should set everything possible to level triggered + out8(PIC_MASTER_TRIGGER_MODE, 0xf8); + out8(PIC_SLAVE_TRIGGER_MODE, 0xde); +#endif + sLevelTriggeredInterrupts = in8(PIC_MASTER_TRIGGER_MODE) | (in8(PIC_SLAVE_TRIGGER_MODE) << 8); @@ -453,7 +459,7 @@ page_fault_exception(struct iframe* frame) if (kernelDebugger) { // if this thread has a fault handler, we're allowed to be here - if (thread && thread->fault_handler != NULL) { + if (thread && thread->fault_handler != 0) { frame->eip = thread->fault_handler; return; } diff --git a/src/system/kernel/arch/x86/arch_thread.cpp b/src/system/kernel/arch/x86/arch_thread.cpp index aa4f4abaae..3b4f5c003f 100644 --- a/src/system/kernel/arch/x86/arch_thread.cpp +++ b/src/system/kernel/arch/x86/arch_thread.cpp @@ -353,7 +353,7 @@ arch_thread_context_switch(struct thread *from, struct thread *to) // set TLS GDT entry to the current thread - since this action is // dependent on the current CPU, we have to do it here - if (to->user_local_storage != NULL) + if (to->user_local_storage != 0) set_tls_context(to); newPageDirectory = (addr_t)x86_next_page_directory(from, to); diff --git a/src/system/kernel/debug/frame_buffer_console.cpp b/src/system/kernel/debug/frame_buffer_console.cpp index 527d0c4e7b..957d4f2f4c 100644 --- a/src/system/kernel/debug/frame_buffer_console.cpp +++ b/src/system/kernel/debug/frame_buffer_console.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2005-2008, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -381,7 +381,7 @@ frame_buffer_update(addr_t baseAddress, int32 width, int32 height, int32 depth, bool frame_buffer_console_available(void) { - return sConsole.frame_buffer != NULL; + return sConsole.frame_buffer != 0; } @@ -425,8 +425,7 @@ frame_buffer_console_init_post_modules(kernel_args *args) { mutex_init(&sConsole.lock, "console_lock"); - // TODO: enable MTRR in VESA mode! - if (sConsole.frame_buffer == NULL) + if (sConsole.frame_buffer == 0) return B_OK; // try to set frame buffer memory to write combined @@ -447,7 +446,7 @@ _user_frame_buffer_update(addr_t baseAddress, int32 width, int32 height, if (geteuid() != 0) return B_NOT_ALLOWED; - if (IS_USER_ADDRESS(baseAddress) && baseAddress != NULL) + if (IS_USER_ADDRESS(baseAddress) && baseAddress != 0) return B_BAD_ADDRESS; return frame_buffer_update(baseAddress, width, height, depth, bytesPerRow); diff --git a/src/system/kernel/module.cpp b/src/system/kernel/module.cpp index eb9f3ff8fc..3cba5ed399 100644 --- a/src/system/kernel/module.cpp +++ b/src/system/kernel/module.cpp @@ -1262,7 +1262,7 @@ get_next_loaded_module_name(uint32 *_cookie, char *buffer, size_t *_bufferSize) { if (sModulesHash == NULL) { dprintf("get_next_loaded_module_name() called too early!\n"); - return NULL; + return B_ERROR; } //TRACE(("get_next_loaded_module_name(\"%s\")\n", buffer)); diff --git a/src/system/kernel/signal.cpp b/src/system/kernel/signal.cpp index ff0582f73c..6aa3ab28f6 100644 --- a/src/system/kernel/signal.cpp +++ b/src/system/kernel/signal.cpp @@ -724,7 +724,7 @@ sigaction_etc(thread_id threadID, int signal, const struct sigaction *act, // remove pending signal if it should now be ignored atomic_and(&thread->sig_pending, ~SIGNAL_TO_MASK(signal)); } else if (act && act->sa_handler == SIG_DFL - && (SIGNAL_TO_MASK(signal) & DEFAULT_IGNORE_SIGNALS) != NULL) { + && (SIGNAL_TO_MASK(signal) & DEFAULT_IGNORE_SIGNALS) != 0) { // remove pending signal for those signals whose default // action is to ignore them atomic_and(&thread->sig_pending, ~SIGNAL_TO_MASK(signal)); diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index a105ef0343..68b4fd55f5 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -1434,7 +1434,7 @@ vm_create_anonymous_area(team_id team, const char *name, void **address, AddressSpaceWriteLocker locker; status_t status = locker.SetTo(team); - if (status != NULL) + if (status != B_OK) return status; vm_address_space *addressSpace = locker.AddressSpace(); @@ -2837,7 +2837,7 @@ dump_cache_tree(int argc, char **argv) } addr_t address = strtoul(argv[1], NULL, 0); - if (address == NULL) + if (address == 0) return 0; vm_cache *cache = (vm_cache *)address; @@ -2923,7 +2923,7 @@ dump_cache(int argc, char **argv) } addr_t address = strtoul(argv[i], NULL, 0); - if (address == NULL) + if (address == 0) return 0; cache = (vm_cache *)address;