From bd185b4117e06c1674c4d214abc3917acedc560d Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 1 Dec 2009 17:06:26 +0000 Subject: [PATCH] *.c -> *.cpp git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34417 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../userlandfs/server/haiku/Jamfile | 4 +- src/system/boot/arch/x86/Jamfile | 2 +- src/system/boot/loader/Jamfile | 4 +- src/system/boot/platform/openfirmware/Jamfile | 4 +- src/system/kernel/Jamfile | 8 +-- src/system/kernel/arch/arm/Jamfile | 2 +- .../kernel/arch/arm/{uart.c => uart.cpp} | 0 src/system/kernel/arch/m68k/Jamfile | 4 +- .../m68k/{arch_atomic.c => arch_atomic.cpp} | 0 .../arch/m68k/{arch_smp.c => arch_smp.cpp} | 0 .../arch/mips/{arch_cpu.c => arch_cpu.cpp} | 0 ...rch_dbg_console.c => arch_dbg_console.cpp} | 0 .../mips/{arch_debug.c => arch_debug.cpp} | 0 .../mips/{arch_faults.c => arch_faults.cpp} | 0 .../arch/mips/{arch_int.c => arch_int.cpp} | 0 .../arch/mips/{arch_pmap.c => arch_pmap.cpp} | 0 .../arch/mips/{arch_smp.c => arch_smp.cpp} | 0 .../mips/{arch_thread.c => arch_thread.cpp} | 0 .../mips/{arch_timer.c => arch_timer.cpp} | 0 .../arch/mips/{arch_vm.c => arch_vm.cpp} | 0 src/system/kernel/arch/mipsel/Jamfile | 6 +-- .../mipsel/{arch_atomic.c => arch_atomic.cpp} | 0 .../arch/mipsel/{arch_smp.c => arch_smp.cpp} | 0 .../mipsel/{arch_thread.c => arch_thread.cpp} | 0 src/system/kernel/arch/ppc/Jamfile | 2 +- .../ppc/{arch_atomic.c => arch_atomic.cpp} | 0 src/system/kernel/arch/x86/Jamfile | 20 ++++---- ...debug_console.c => arch_debug_console.cpp} | 0 .../arch/x86/{arch_elf.c => arch_elf.cpp} | 0 .../{arch_platform.c => arch_platform.cpp} | 0 ..._time_clock.c => arch_real_time_clock.cpp} | 0 .../{arch_selector.c => arch_selector.cpp} | 0 .../arch/x86/{arch_smp.c => arch_smp.cpp} | 2 +- ...rch_system_info.c => arch_system_info.cpp} | 4 +- .../arch/x86/{arch_timer.c => arch_timer.cpp} | 0 .../x86/timers/{x86_apic.c => x86_apic.cpp} | 0 .../x86/timers/{x86_pit.c => x86_pit.cpp} | 0 src/system/kernel/{cpu.c => cpu.cpp} | 0 src/system/kernel/{int.c => int.cpp} | 0 src/system/kernel/lib/Jamfile | 4 +- .../lib/{kernel_errno.c => kernel_errno.cpp} | 0 ...{kernel_vsprintf.c => kernel_vsprintf.cpp} | 0 .../kernel/platform/openfirmware/Jamfile | 2 +- .../{openfirmware.c => openfirmware.cpp} | 40 +++++++-------- ...{real_time_clock.c => real_time_clock.cpp} | 0 .../kernel/{shutdown.c => shutdown.cpp} | 0 src/system/kernel/util/Jamfile | 6 +-- src/system/kernel/util/{khash.c => khash.cpp} | 0 src/system/kernel/util/{list.c => list.cpp} | 0 src/system/kernel/util/misc.c | 50 ------------------- src/system/kernel/util/{queue.c => queue.cpp} | 8 +-- src/system/runtime_loader/Jamfile | 4 +- 52 files changed, 63 insertions(+), 113 deletions(-) rename src/system/kernel/arch/arm/{uart.c => uart.cpp} (100%) rename src/system/kernel/arch/m68k/{arch_atomic.c => arch_atomic.cpp} (100%) rename src/system/kernel/arch/m68k/{arch_smp.c => arch_smp.cpp} (100%) rename src/system/kernel/arch/mips/{arch_cpu.c => arch_cpu.cpp} (100%) rename src/system/kernel/arch/mips/{arch_dbg_console.c => arch_dbg_console.cpp} (100%) rename src/system/kernel/arch/mips/{arch_debug.c => arch_debug.cpp} (100%) rename src/system/kernel/arch/mips/{arch_faults.c => arch_faults.cpp} (100%) rename src/system/kernel/arch/mips/{arch_int.c => arch_int.cpp} (100%) rename src/system/kernel/arch/mips/{arch_pmap.c => arch_pmap.cpp} (100%) rename src/system/kernel/arch/mips/{arch_smp.c => arch_smp.cpp} (100%) rename src/system/kernel/arch/mips/{arch_thread.c => arch_thread.cpp} (100%) rename src/system/kernel/arch/mips/{arch_timer.c => arch_timer.cpp} (100%) rename src/system/kernel/arch/mips/{arch_vm.c => arch_vm.cpp} (100%) rename src/system/kernel/arch/mipsel/{arch_atomic.c => arch_atomic.cpp} (100%) rename src/system/kernel/arch/mipsel/{arch_smp.c => arch_smp.cpp} (100%) rename src/system/kernel/arch/mipsel/{arch_thread.c => arch_thread.cpp} (100%) rename src/system/kernel/arch/ppc/{arch_atomic.c => arch_atomic.cpp} (100%) rename src/system/kernel/arch/x86/{arch_debug_console.c => arch_debug_console.cpp} (100%) rename src/system/kernel/arch/x86/{arch_elf.c => arch_elf.cpp} (100%) rename src/system/kernel/arch/x86/{arch_platform.c => arch_platform.cpp} (100%) rename src/system/kernel/arch/x86/{arch_real_time_clock.c => arch_real_time_clock.cpp} (100%) rename src/system/kernel/arch/x86/{arch_selector.c => arch_selector.cpp} (100%) rename src/system/kernel/arch/x86/{arch_smp.c => arch_smp.cpp} (99%) rename src/system/kernel/arch/x86/{arch_system_info.c => arch_system_info.cpp} (98%) rename src/system/kernel/arch/x86/{arch_timer.c => arch_timer.cpp} (100%) rename src/system/kernel/arch/x86/timers/{x86_apic.c => x86_apic.cpp} (100%) rename src/system/kernel/arch/x86/timers/{x86_pit.c => x86_pit.cpp} (100%) rename src/system/kernel/{cpu.c => cpu.cpp} (100%) rename src/system/kernel/{int.c => int.cpp} (100%) rename src/system/kernel/lib/{kernel_errno.c => kernel_errno.cpp} (100%) rename src/system/kernel/lib/{kernel_vsprintf.c => kernel_vsprintf.cpp} (100%) rename src/system/kernel/platform/openfirmware/{openfirmware.c => openfirmware.cpp} (96%) rename src/system/kernel/{real_time_clock.c => real_time_clock.cpp} (100%) rename src/system/kernel/{shutdown.c => shutdown.cpp} (100%) rename src/system/kernel/util/{khash.c => khash.cpp} (100%) rename src/system/kernel/util/{list.c => list.cpp} (100%) delete mode 100644 src/system/kernel/util/misc.c rename src/system/kernel/util/{queue.c => queue.cpp} (92%) diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/Jamfile b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/Jamfile index 34d23413e6..a70075a9c1 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/Jamfile +++ b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/Jamfile @@ -36,7 +36,7 @@ SharedLibrary libuserlandfs_haiku_kernel.so # kernel block_cache.cpp file_map.cpp - khash.c + khash.cpp Notifications.cpp Referenceable.cpp @@ -67,7 +67,7 @@ SEARCH on [ FGristFiles ] = [ FDirName $(HAIKU_TOP) src system kernel cache ] ; SEARCH on [ FGristFiles - khash.c + khash.cpp ] = [ FDirName $(HAIKU_TOP) src system kernel util ] ; SEARCH on [ FGristFiles diff --git a/src/system/boot/arch/x86/Jamfile b/src/system/boot/arch/x86/Jamfile index 8d02a54913..7315dc73fe 100644 --- a/src/system/boot/arch/x86/Jamfile +++ b/src/system/boot/arch/x86/Jamfile @@ -3,7 +3,7 @@ SubDir HAIKU_TOP src system boot arch x86 ; DEFINES += _BOOT_MODE ; local kernelArchSources = - arch_elf.c + arch_elf.cpp ; local kernelArchObjects = diff --git a/src/system/boot/loader/Jamfile b/src/system/boot/loader/Jamfile index b1e67e44cf..10b505f01a 100644 --- a/src/system/boot/loader/Jamfile +++ b/src/system/boot/loader/Jamfile @@ -68,7 +68,7 @@ KernelStaticLibrary boot_loader : # utils kernel_cpp.cpp KMessage.cpp - list.c + list.cpp safemode_settings.cpp : -fno-pic @@ -89,7 +89,7 @@ KernelStaticLibrary boot_partitions : ; # Tell Jam where to find the utility sources -SEARCH on [ FGristFiles kernel_cpp.cpp list.c ] +SEARCH on [ FGristFiles kernel_cpp.cpp list.cpp ] = [ FDirName $(HAIKU_TOP) src system kernel util ] ; SEARCH on [ FGristFiles KMessage.cpp ] diff --git a/src/system/boot/platform/openfirmware/Jamfile b/src/system/boot/platform/openfirmware/Jamfile index d7f8f30b26..00c2b6d702 100644 --- a/src/system/boot/platform/openfirmware/Jamfile +++ b/src/system/boot/platform/openfirmware/Jamfile @@ -16,7 +16,7 @@ KernelMergeObject boot_platform_openfirmware.o : support.cpp video.cpp - openfirmware.c + openfirmware.cpp openfirmware_devices.cpp # generic @@ -27,7 +27,7 @@ KernelMergeObject boot_platform_openfirmware.o : SEARCH on [ FGristFiles text_menu.cpp ] = [ FDirName $(HAIKU_TOP) src system boot platform generic ] ; -SEARCH on [ FGristFiles openfirmware.c openfirmware_devices.cpp ] +SEARCH on [ FGristFiles openfirmware.cpp openfirmware_devices.cpp ] = [ FDirName $(HAIKU_TOP) src system kernel platform openfirmware ] ; SubInclude HAIKU_TOP src system boot platform openfirmware arch ; diff --git a/src/system/kernel/Jamfile b/src/system/kernel/Jamfile index 9b41cb3da3..f0267702f6 100644 --- a/src/system/kernel/Jamfile +++ b/src/system/kernel/Jamfile @@ -26,11 +26,11 @@ KernelMergeObject kernel_core.o : boot_splash.cpp commpage.cpp condition_variable.cpp - cpu.c + cpu.cpp elf.cpp heap.cpp image.cpp - int.c + int.cpp kernel_daemon.cpp linkhack.c listeners.cpp @@ -40,9 +40,9 @@ KernelMergeObject kernel_core.o : module.cpp Notifications.cpp port.cpp - real_time_clock.c + real_time_clock.cpp sem.cpp - shutdown.c + shutdown.cpp signal.cpp system_info.cpp smp.cpp diff --git a/src/system/kernel/arch/arm/Jamfile b/src/system/kernel/arch/arm/Jamfile index 9d71d35567..f2dd39c3c3 100644 --- a/src/system/kernel/arch/arm/Jamfile +++ b/src/system/kernel/arch/arm/Jamfile @@ -28,7 +28,7 @@ KernelMergeObject kernel_arch_arm.o : arch_vm.cpp arch_vm_translation_map.cpp arch_asm.S - uart.c + uart.cpp generic_vm_physical_page_mapper.cpp generic_vm_physical_page_ops.cpp # diff --git a/src/system/kernel/arch/arm/uart.c b/src/system/kernel/arch/arm/uart.cpp similarity index 100% rename from src/system/kernel/arch/arm/uart.c rename to src/system/kernel/arch/arm/uart.cpp diff --git a/src/system/kernel/arch/m68k/Jamfile b/src/system/kernel/arch/m68k/Jamfile index b8d4d801b0..5fe2d2a83f 100644 --- a/src/system/kernel/arch/m68k/Jamfile +++ b/src/system/kernel/arch/m68k/Jamfile @@ -26,7 +26,7 @@ KernelMergeObject arch_m68k_060.o : ; KernelMergeObject kernel_arch_m68k.o : - arch_atomic.c + arch_atomic.cpp arch_commpage.cpp arch_cpu.cpp arch_cpu_asm.S @@ -37,7 +37,7 @@ KernelMergeObject kernel_arch_m68k.o : arch_int.cpp arch_platform.cpp arch_real_time_clock.cpp - arch_smp.c + arch_smp.cpp arch_system_info.cpp arch_thread.cpp arch_timer.cpp diff --git a/src/system/kernel/arch/m68k/arch_atomic.c b/src/system/kernel/arch/m68k/arch_atomic.cpp similarity index 100% rename from src/system/kernel/arch/m68k/arch_atomic.c rename to src/system/kernel/arch/m68k/arch_atomic.cpp diff --git a/src/system/kernel/arch/m68k/arch_smp.c b/src/system/kernel/arch/m68k/arch_smp.cpp similarity index 100% rename from src/system/kernel/arch/m68k/arch_smp.c rename to src/system/kernel/arch/m68k/arch_smp.cpp diff --git a/src/system/kernel/arch/mips/arch_cpu.c b/src/system/kernel/arch/mips/arch_cpu.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_cpu.c rename to src/system/kernel/arch/mips/arch_cpu.cpp diff --git a/src/system/kernel/arch/mips/arch_dbg_console.c b/src/system/kernel/arch/mips/arch_dbg_console.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_dbg_console.c rename to src/system/kernel/arch/mips/arch_dbg_console.cpp diff --git a/src/system/kernel/arch/mips/arch_debug.c b/src/system/kernel/arch/mips/arch_debug.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_debug.c rename to src/system/kernel/arch/mips/arch_debug.cpp diff --git a/src/system/kernel/arch/mips/arch_faults.c b/src/system/kernel/arch/mips/arch_faults.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_faults.c rename to src/system/kernel/arch/mips/arch_faults.cpp diff --git a/src/system/kernel/arch/mips/arch_int.c b/src/system/kernel/arch/mips/arch_int.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_int.c rename to src/system/kernel/arch/mips/arch_int.cpp diff --git a/src/system/kernel/arch/mips/arch_pmap.c b/src/system/kernel/arch/mips/arch_pmap.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_pmap.c rename to src/system/kernel/arch/mips/arch_pmap.cpp diff --git a/src/system/kernel/arch/mips/arch_smp.c b/src/system/kernel/arch/mips/arch_smp.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_smp.c rename to src/system/kernel/arch/mips/arch_smp.cpp diff --git a/src/system/kernel/arch/mips/arch_thread.c b/src/system/kernel/arch/mips/arch_thread.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_thread.c rename to src/system/kernel/arch/mips/arch_thread.cpp diff --git a/src/system/kernel/arch/mips/arch_timer.c b/src/system/kernel/arch/mips/arch_timer.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_timer.c rename to src/system/kernel/arch/mips/arch_timer.cpp diff --git a/src/system/kernel/arch/mips/arch_vm.c b/src/system/kernel/arch/mips/arch_vm.cpp similarity index 100% rename from src/system/kernel/arch/mips/arch_vm.c rename to src/system/kernel/arch/mips/arch_vm.cpp diff --git a/src/system/kernel/arch/mipsel/Jamfile b/src/system/kernel/arch/mipsel/Jamfile index 30c4659faf..112b5f292f 100644 --- a/src/system/kernel/arch/mipsel/Jamfile +++ b/src/system/kernel/arch/mipsel/Jamfile @@ -8,7 +8,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; KernelMergeObject kernel_arch_mipsel.o : arch_asm.S - arch_atomic.c + arch_atomic.cpp arch_commpage.cpp arch_cpu.cpp arch_debug_console.cpp @@ -18,9 +18,9 @@ KernelMergeObject kernel_arch_mipsel.o : arch_int.cpp arch_platform.cpp arch_real_time_clock.cpp - arch_smp.c + arch_smp.cpp arch_system_info.cpp - arch_thread.c + arch_thread.cpp arch_timer.cpp arch_user_debugger.cpp arch_vm.cpp diff --git a/src/system/kernel/arch/mipsel/arch_atomic.c b/src/system/kernel/arch/mipsel/arch_atomic.cpp similarity index 100% rename from src/system/kernel/arch/mipsel/arch_atomic.c rename to src/system/kernel/arch/mipsel/arch_atomic.cpp diff --git a/src/system/kernel/arch/mipsel/arch_smp.c b/src/system/kernel/arch/mipsel/arch_smp.cpp similarity index 100% rename from src/system/kernel/arch/mipsel/arch_smp.c rename to src/system/kernel/arch/mipsel/arch_smp.cpp diff --git a/src/system/kernel/arch/mipsel/arch_thread.c b/src/system/kernel/arch/mipsel/arch_thread.cpp similarity index 100% rename from src/system/kernel/arch/mipsel/arch_thread.c rename to src/system/kernel/arch/mipsel/arch_thread.cpp diff --git a/src/system/kernel/arch/ppc/Jamfile b/src/system/kernel/arch/ppc/Jamfile index c8fe948471..4d93b998ce 100644 --- a/src/system/kernel/arch/ppc/Jamfile +++ b/src/system/kernel/arch/ppc/Jamfile @@ -6,7 +6,7 @@ UsePrivateKernelHeaders ; SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; KernelMergeObject kernel_arch_ppc.o : - arch_atomic.c + arch_atomic.cpp arch_commpage.cpp arch_cpu.cpp arch_cpu_asm.S diff --git a/src/system/kernel/arch/ppc/arch_atomic.c b/src/system/kernel/arch/ppc/arch_atomic.cpp similarity index 100% rename from src/system/kernel/arch/ppc/arch_atomic.c rename to src/system/kernel/arch/ppc/arch_atomic.cpp diff --git a/src/system/kernel/arch/x86/Jamfile b/src/system/kernel/arch/x86/Jamfile index 362fe96261..635f88a2f4 100644 --- a/src/system/kernel/arch/x86/Jamfile +++ b/src/system/kernel/arch/x86/Jamfile @@ -14,20 +14,20 @@ KernelMergeObject kernel_arch_x86.o : arch_commpage.cpp arch_cpu.cpp arch_debug.cpp - arch_debug_console.c - arch_elf.c + arch_debug_console.cpp + arch_elf.cpp arch_int.cpp - arch_platform.c -# arch_selector.c - arch_real_time_clock.c - arch_smp.c + arch_platform.cpp +# arch_selector.cpp + arch_real_time_clock.cpp + arch_smp.cpp arch_thread.cpp - arch_timer.c + arch_timer.cpp arch_vm.cpp arch_vm_translation_map.cpp arch_x86.S arch_interrupts.S - arch_system_info.c + arch_system_info.cpp arch_user_debugger.cpp apm.cpp bios.cpp @@ -37,9 +37,9 @@ KernelMergeObject kernel_arch_x86.o : x86_physical_page_mapper.cpp x86_physical_page_mapper_large_memory.cpp - x86_pit.c - x86_apic.c + x86_apic.cpp x86_hpet.cpp + x86_pit.cpp : $(TARGET_KERNEL_PIC_CCFLAGS) ; diff --git a/src/system/kernel/arch/x86/arch_debug_console.c b/src/system/kernel/arch/x86/arch_debug_console.cpp similarity index 100% rename from src/system/kernel/arch/x86/arch_debug_console.c rename to src/system/kernel/arch/x86/arch_debug_console.cpp diff --git a/src/system/kernel/arch/x86/arch_elf.c b/src/system/kernel/arch/x86/arch_elf.cpp similarity index 100% rename from src/system/kernel/arch/x86/arch_elf.c rename to src/system/kernel/arch/x86/arch_elf.cpp diff --git a/src/system/kernel/arch/x86/arch_platform.c b/src/system/kernel/arch/x86/arch_platform.cpp similarity index 100% rename from src/system/kernel/arch/x86/arch_platform.c rename to src/system/kernel/arch/x86/arch_platform.cpp diff --git a/src/system/kernel/arch/x86/arch_real_time_clock.c b/src/system/kernel/arch/x86/arch_real_time_clock.cpp similarity index 100% rename from src/system/kernel/arch/x86/arch_real_time_clock.c rename to src/system/kernel/arch/x86/arch_real_time_clock.cpp diff --git a/src/system/kernel/arch/x86/arch_selector.c b/src/system/kernel/arch/x86/arch_selector.cpp similarity index 100% rename from src/system/kernel/arch/x86/arch_selector.c rename to src/system/kernel/arch/x86/arch_selector.cpp diff --git a/src/system/kernel/arch/x86/arch_smp.c b/src/system/kernel/arch/x86/arch_smp.cpp similarity index 99% rename from src/system/kernel/arch/x86/arch_smp.c rename to src/system/kernel/arch/x86/arch_smp.cpp index 9cc10d0ca8..0cdca121c1 100644 --- a/src/system/kernel/arch/x86/arch_smp.c +++ b/src/system/kernel/arch/x86/arch_smp.cpp @@ -42,7 +42,7 @@ static uint32 sCPUOSIds[B_MAX_CPU_COUNT]; static uint32 sAPICVersions[B_MAX_CPU_COUNT]; extern bool gUsingIOAPIC; -extern void init_sse(void); +extern "C" void init_sse(void); static uint32 apic_read(uint32 offset) diff --git a/src/system/kernel/arch/x86/arch_system_info.c b/src/system/kernel/arch/x86/arch_system_info.cpp similarity index 98% rename from src/system/kernel/arch/x86/arch_system_info.c rename to src/system/kernel/arch/x86/arch_system_info.cpp index 51b3a97fd9..5fe4d8c7ba 100644 --- a/src/system/kernel/arch/x86/arch_system_info.c +++ b/src/system/kernel/arch/x86/arch_system_info.cpp @@ -62,7 +62,7 @@ get_cpuid(cpuid_info *info, uint32 eaxRegister, uint32 forCPU) status_t arch_get_system_info(system_info *info, size_t size) { - info->cpu_type = sCpuType; + info->cpu_type = (cpu_types)sCpuType; info->cpu_revision = sCpuRevision; // - various cpu_info @@ -148,7 +148,7 @@ _user_get_cpuid(cpuid_info *userInfo, uint32 eaxRegister, uint32 cpuNum) { cpuid_info info; status_t status; - + if (!IS_USER_ADDRESS(userInfo)) return B_BAD_ADDRESS; diff --git a/src/system/kernel/arch/x86/arch_timer.c b/src/system/kernel/arch/x86/arch_timer.cpp similarity index 100% rename from src/system/kernel/arch/x86/arch_timer.c rename to src/system/kernel/arch/x86/arch_timer.cpp diff --git a/src/system/kernel/arch/x86/timers/x86_apic.c b/src/system/kernel/arch/x86/timers/x86_apic.cpp similarity index 100% rename from src/system/kernel/arch/x86/timers/x86_apic.c rename to src/system/kernel/arch/x86/timers/x86_apic.cpp diff --git a/src/system/kernel/arch/x86/timers/x86_pit.c b/src/system/kernel/arch/x86/timers/x86_pit.cpp similarity index 100% rename from src/system/kernel/arch/x86/timers/x86_pit.c rename to src/system/kernel/arch/x86/timers/x86_pit.cpp diff --git a/src/system/kernel/cpu.c b/src/system/kernel/cpu.cpp similarity index 100% rename from src/system/kernel/cpu.c rename to src/system/kernel/cpu.cpp diff --git a/src/system/kernel/int.c b/src/system/kernel/int.cpp similarity index 100% rename from src/system/kernel/int.c rename to src/system/kernel/int.cpp diff --git a/src/system/kernel/lib/Jamfile b/src/system/kernel/lib/Jamfile index 2c3f948317..68edb7aa03 100644 --- a/src/system/kernel/lib/Jamfile +++ b/src/system/kernel/lib/Jamfile @@ -35,7 +35,7 @@ SEARCH_SOURCE += [ FDirName $(posixSources) unistd ] ; KernelMergeObject kernel_lib_posix.o : # main - kernel_errno.c + kernel_errno.cpp dirent.c fcntl.cpp poll.c @@ -44,7 +44,7 @@ KernelMergeObject kernel_lib_posix.o : ctype.c localeconv.c # stdio (this subdir) - kernel_vsprintf.c + kernel_vsprintf.cpp # stdlib abs.c atoi.c diff --git a/src/system/kernel/lib/kernel_errno.c b/src/system/kernel/lib/kernel_errno.cpp similarity index 100% rename from src/system/kernel/lib/kernel_errno.c rename to src/system/kernel/lib/kernel_errno.cpp diff --git a/src/system/kernel/lib/kernel_vsprintf.c b/src/system/kernel/lib/kernel_vsprintf.cpp similarity index 100% rename from src/system/kernel/lib/kernel_vsprintf.c rename to src/system/kernel/lib/kernel_vsprintf.cpp diff --git a/src/system/kernel/platform/openfirmware/Jamfile b/src/system/kernel/platform/openfirmware/Jamfile index c594a2b8b4..5ed257c9de 100644 --- a/src/system/kernel/platform/openfirmware/Jamfile +++ b/src/system/kernel/platform/openfirmware/Jamfile @@ -4,6 +4,6 @@ SubDirCcFlags $(TARGET_KERNEL_PIC_CCFLAGS) ; SubDirC++Flags $(TARGET_KERNEL_PIC_CCFLAGS) ; KernelMergeObject kernel_platform_openfirmware.o : - openfirmware.c + openfirmware.cpp openfirmware_devices.cpp ; diff --git a/src/system/kernel/platform/openfirmware/openfirmware.c b/src/system/kernel/platform/openfirmware/openfirmware.cpp similarity index 96% rename from src/system/kernel/platform/openfirmware/openfirmware.c rename to src/system/kernel/platform/openfirmware/openfirmware.cpp index f30c1a3308..8c0f7e06e5 100644 --- a/src/system/kernel/platform/openfirmware/openfirmware.c +++ b/src/system/kernel/platform/openfirmware/openfirmware.cpp @@ -9,7 +9,7 @@ // OpenFirmware entry function -static int (*gCallOpenFirmware)(void *) = 0; +static int (*gCallOpenFirmware)(void *) = 0; int gChosen; @@ -50,13 +50,13 @@ of_call_client_function(const char *method, int numArgs, int numReturns, ...) // clear return values args.args[i] = NULL; } - + if (gCallOpenFirmware(&args) == OF_FAILED) return OF_FAILED; if (numReturns > 0) { // copy return values over to the provided location - + for (i = numArgs; i < numArgs + numReturns; i++) { void **store = va_arg(list, void **); if (store) @@ -106,7 +106,7 @@ of_interpret(const char *command, int numArgs, int numReturns, ...) if (numReturns > 0) { // copy return values over to the provided location - + for (i = numArgs + 1; i < numArgs + 1 + numReturns; i++) { void **store = va_arg(list, void **); if (store) @@ -157,7 +157,7 @@ of_call_method(int handle, const char *method, int numArgs, int numReturns, ...) if (numReturns > 0) { // copy return values over to the provided location - + for (i = numArgs + 1; i < numArgs + 1 + numReturns; i++) { void **store = va_arg(list, void **); if (store) @@ -170,7 +170,7 @@ of_call_method(int handle, const char *method, int numArgs, int numReturns, ...) } -int +int of_finddevice(const char *device) { struct { @@ -271,7 +271,7 @@ of_instance_to_path(int instance, char *pathBuffer, int bufferSize) } -int +int of_instance_to_package(int instance) { struct { @@ -289,7 +289,7 @@ of_instance_to_package(int instance) } -int +int of_getprop(int package, const char *property, void *buffer, int bufferSize) { struct { @@ -310,7 +310,7 @@ of_getprop(int package, const char *property, void *buffer, int bufferSize) } -int +int of_setprop(int package, const char *property, const void *buffer, int bufferSize) { struct { @@ -393,7 +393,7 @@ of_package_to_path(int package, char *pathBuffer, int bufferSize) // I/O functions -int +int of_open(const char *nodeName) { struct { @@ -425,7 +425,7 @@ of_close(int handle) } -int +int of_read(int handle, void *buffer, int bufferSize) { struct { @@ -445,7 +445,7 @@ of_read(int handle, void *buffer, int bufferSize) } -int +int of_write(int handle, const void *buffer, int bufferSize) { struct { @@ -465,7 +465,7 @@ of_write(int handle, const void *buffer, int bufferSize) } -int +int of_seek(int handle, long long pos) { struct { @@ -488,32 +488,32 @@ of_seek(int handle, long long pos) int -of_release(void *virtual, int size) +of_release(void *virtualAddress, int size) { struct { const char *name; int num_args; int num_returns; - void *virtual; + void *virtualAddress; int size; - } args = {"release", 2, 0, virtual, size}; - + } args = {"release", 2, 0, virtualAddress, size}; + return gCallOpenFirmware(&args); } void * -of_claim(void *virtual, int size, int align) +of_claim(void *virtualAddress, int size, int align) { struct { const char *name; int num_args; int num_returns; - void *virtual; + void *virtualAddress; int size; int align; void *address; - } args = {"claim", 3, 1, virtual, size, align}; + } args = {"claim", 3, 1, virtualAddress, size, align}; if (gCallOpenFirmware(&args) == OF_FAILED) return NULL; diff --git a/src/system/kernel/real_time_clock.c b/src/system/kernel/real_time_clock.cpp similarity index 100% rename from src/system/kernel/real_time_clock.c rename to src/system/kernel/real_time_clock.cpp diff --git a/src/system/kernel/shutdown.c b/src/system/kernel/shutdown.cpp similarity index 100% rename from src/system/kernel/shutdown.c rename to src/system/kernel/shutdown.cpp diff --git a/src/system/kernel/util/Jamfile b/src/system/kernel/util/Jamfile index 50ba41b36e..ea99997063 100644 --- a/src/system/kernel/util/Jamfile +++ b/src/system/kernel/util/Jamfile @@ -5,9 +5,9 @@ UsePrivateHeaders [ FDirName kernel util ] ; KernelMergeObject kernel_util.o : AVLTreeMap.cpp kernel_cpp.cpp - khash.c - list.c - queue.c + khash.cpp + list.cpp + queue.cpp ring_buffer.cpp RadixBitmap.cpp diff --git a/src/system/kernel/util/khash.c b/src/system/kernel/util/khash.cpp similarity index 100% rename from src/system/kernel/util/khash.c rename to src/system/kernel/util/khash.cpp diff --git a/src/system/kernel/util/list.c b/src/system/kernel/util/list.cpp similarity index 100% rename from src/system/kernel/util/list.c rename to src/system/kernel/util/list.cpp diff --git a/src/system/kernel/util/misc.c b/src/system/kernel/util/misc.c deleted file mode 100644 index 7b3b2ccd7a..0000000000 --- a/src/system/kernel/util/misc.c +++ /dev/null @@ -1,50 +0,0 @@ -/* This includes some functions that were part of the net piece */ - -/* -** Copyright 2001, Travis Geiselbrecht. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ -#include -#include - -/* XXX - keep the compiler happy. */ -uint16 ones_sum16(uint32 sum, const void *_buf, int len); -uint16 cksum16(void *_buf, int len); -uint16 cksum16_2(void *buf1, int len1, void *buf2, int len2); - -uint16 ones_sum16(uint32 sum, const void *_buf, int len) -{ - const uint16 *buf = _buf; - - while(len >= 2) { - sum += *buf++; - if(sum & 0x80000000) - sum = (sum & 0xffff) + (sum >> 16); - len -= 2; - } - - if (len) { - uint8 temp[2]; - temp[0] = *(uint8 *) buf; - temp[1] = 0; - sum += *(uint16 *) temp; - } - - while(sum >> 16) - sum = (sum & 0xffff) + (sum >> 16); - - return sum; -} - -uint16 cksum16(void *_buf, int len) -{ - return ~ones_sum16(0, _buf, len); -} - -uint16 cksum16_2(void *buf1, int len1, void *buf2, int len2) -{ - uint32 sum; - - sum = ones_sum16(0, buf1, len1); - return ~ones_sum16(sum, buf2, len2); -} diff --git a/src/system/kernel/util/queue.c b/src/system/kernel/util/queue.cpp similarity index 92% rename from src/system/kernel/util/queue.c rename to src/system/kernel/util/queue.cpp index a7eea8e587..81dab5e2ab 100644 --- a/src/system/kernel/util/queue.c +++ b/src/system/kernel/util/queue.cpp @@ -43,7 +43,7 @@ queue_remove_item(queue *_q, void *e) if (last) last->next = temp->next; else - q->head = temp->next; + q->head = (queue_element*)temp->next; if (q->tail == temp) q->tail = last; @@ -51,7 +51,7 @@ queue_remove_item(queue *_q, void *e) return 0; } last = temp; - temp = temp->next; + temp = (queue_element*)temp->next; } return -1; @@ -85,7 +85,7 @@ queue_dequeue(queue *_q) elem = q->head; if (q->head != NULL) - q->head = q->head->next; + q->head = (queue_element*)q->head->next; if (q->tail == elem) q->tail = NULL; @@ -113,7 +113,7 @@ fixed_queue_init(fixed_queue *q, int size) if (size <= 0) return EINVAL; - q->table = malloc(size * sizeof(void *)); + q->table = (void**)malloc(size * sizeof(void *)); if (!q->table) return ENOMEM; q->head = 0; diff --git a/src/system/runtime_loader/Jamfile b/src/system/runtime_loader/Jamfile index 11ba7940cd..9bb0fe6b13 100644 --- a/src/system/runtime_loader/Jamfile +++ b/src/system/runtime_loader/Jamfile @@ -20,7 +20,7 @@ AddResources runtime_loader : runtime_loader.rdef ; # needed for "runtime_loader" only StaticLibrary libruntime_loader.a : - kernel_vsprintf.c + kernel_vsprintf.cpp kernel_cpp.cpp KMessage.cpp : @@ -62,7 +62,7 @@ StaticLibrary libruntime_loader.a : SEARCH on [ FGristFiles kernel_cpp.cpp ] = [ FDirName $(HAIKU_TOP) src system kernel util ] ; -SEARCH on [ FGristFiles kernel_vsprintf.c ] +SEARCH on [ FGristFiles kernel_vsprintf.cpp ] = [ FDirName $(HAIKU_TOP) src system kernel lib ] ; SEARCH on [ FGristFiles KMessage.cpp ] = [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;