*.c -> *.cpp

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34417 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-12-01 17:06:26 +00:00
parent 8de72f9d58
commit bd185b4117
52 changed files with 63 additions and 113 deletions
@@ -36,7 +36,7 @@ SharedLibrary libuserlandfs_haiku_kernel.so
# kernel # kernel
block_cache.cpp block_cache.cpp
file_map.cpp file_map.cpp
khash.c khash.cpp
Notifications.cpp Notifications.cpp
Referenceable.cpp Referenceable.cpp
@@ -67,7 +67,7 @@ SEARCH on [ FGristFiles
] = [ FDirName $(HAIKU_TOP) src system kernel cache ] ; ] = [ FDirName $(HAIKU_TOP) src system kernel cache ] ;
SEARCH on [ FGristFiles SEARCH on [ FGristFiles
khash.c khash.cpp
] = [ FDirName $(HAIKU_TOP) src system kernel util ] ; ] = [ FDirName $(HAIKU_TOP) src system kernel util ] ;
SEARCH on [ FGristFiles SEARCH on [ FGristFiles
+1 -1
View File
@@ -3,7 +3,7 @@ SubDir HAIKU_TOP src system boot arch x86 ;
DEFINES += _BOOT_MODE ; DEFINES += _BOOT_MODE ;
local kernelArchSources = local kernelArchSources =
arch_elf.c arch_elf.cpp
; ;
local kernelArchObjects = local kernelArchObjects =
+2 -2
View File
@@ -68,7 +68,7 @@ KernelStaticLibrary boot_loader :
# utils # utils
kernel_cpp.cpp kernel_cpp.cpp
KMessage.cpp KMessage.cpp
list.c list.cpp
safemode_settings.cpp safemode_settings.cpp
: -fno-pic : -fno-pic
@@ -89,7 +89,7 @@ KernelStaticLibrary boot_partitions :
; ;
# Tell Jam where to find the utility sources # 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 ] ; = [ FDirName $(HAIKU_TOP) src system kernel util ] ;
SEARCH on [ FGristFiles KMessage.cpp ] SEARCH on [ FGristFiles KMessage.cpp ]
@@ -16,7 +16,7 @@ KernelMergeObject boot_platform_openfirmware.o :
support.cpp support.cpp
video.cpp video.cpp
openfirmware.c openfirmware.cpp
openfirmware_devices.cpp openfirmware_devices.cpp
# generic # generic
@@ -27,7 +27,7 @@ KernelMergeObject boot_platform_openfirmware.o :
SEARCH on [ FGristFiles text_menu.cpp ] SEARCH on [ FGristFiles text_menu.cpp ]
= [ FDirName $(HAIKU_TOP) src system boot platform generic ] ; = [ 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 ] ; = [ FDirName $(HAIKU_TOP) src system kernel platform openfirmware ] ;
SubInclude HAIKU_TOP src system boot platform openfirmware arch ; SubInclude HAIKU_TOP src system boot platform openfirmware arch ;
+4 -4
View File
@@ -26,11 +26,11 @@ KernelMergeObject kernel_core.o :
boot_splash.cpp boot_splash.cpp
commpage.cpp commpage.cpp
condition_variable.cpp condition_variable.cpp
cpu.c cpu.cpp
elf.cpp elf.cpp
heap.cpp heap.cpp
image.cpp image.cpp
int.c int.cpp
kernel_daemon.cpp kernel_daemon.cpp
linkhack.c linkhack.c
listeners.cpp listeners.cpp
@@ -40,9 +40,9 @@ KernelMergeObject kernel_core.o :
module.cpp module.cpp
Notifications.cpp Notifications.cpp
port.cpp port.cpp
real_time_clock.c real_time_clock.cpp
sem.cpp sem.cpp
shutdown.c shutdown.cpp
signal.cpp signal.cpp
system_info.cpp system_info.cpp
smp.cpp smp.cpp
+1 -1
View File
@@ -28,7 +28,7 @@ KernelMergeObject kernel_arch_arm.o :
arch_vm.cpp arch_vm.cpp
arch_vm_translation_map.cpp arch_vm_translation_map.cpp
arch_asm.S arch_asm.S
uart.c uart.cpp
generic_vm_physical_page_mapper.cpp generic_vm_physical_page_mapper.cpp
generic_vm_physical_page_ops.cpp generic_vm_physical_page_ops.cpp
# #
+2 -2
View File
@@ -26,7 +26,7 @@ KernelMergeObject arch_m68k_060.o :
; ;
KernelMergeObject kernel_arch_m68k.o : KernelMergeObject kernel_arch_m68k.o :
arch_atomic.c arch_atomic.cpp
arch_commpage.cpp arch_commpage.cpp
arch_cpu.cpp arch_cpu.cpp
arch_cpu_asm.S arch_cpu_asm.S
@@ -37,7 +37,7 @@ KernelMergeObject kernel_arch_m68k.o :
arch_int.cpp arch_int.cpp
arch_platform.cpp arch_platform.cpp
arch_real_time_clock.cpp arch_real_time_clock.cpp
arch_smp.c arch_smp.cpp
arch_system_info.cpp arch_system_info.cpp
arch_thread.cpp arch_thread.cpp
arch_timer.cpp arch_timer.cpp
+3 -3
View File
@@ -8,7 +8,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
KernelMergeObject kernel_arch_mipsel.o : KernelMergeObject kernel_arch_mipsel.o :
arch_asm.S arch_asm.S
arch_atomic.c arch_atomic.cpp
arch_commpage.cpp arch_commpage.cpp
arch_cpu.cpp arch_cpu.cpp
arch_debug_console.cpp arch_debug_console.cpp
@@ -18,9 +18,9 @@ KernelMergeObject kernel_arch_mipsel.o :
arch_int.cpp arch_int.cpp
arch_platform.cpp arch_platform.cpp
arch_real_time_clock.cpp arch_real_time_clock.cpp
arch_smp.c arch_smp.cpp
arch_system_info.cpp arch_system_info.cpp
arch_thread.c arch_thread.cpp
arch_timer.cpp arch_timer.cpp
arch_user_debugger.cpp arch_user_debugger.cpp
arch_vm.cpp arch_vm.cpp
+1 -1
View File
@@ -6,7 +6,7 @@ UsePrivateKernelHeaders ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
KernelMergeObject kernel_arch_ppc.o : KernelMergeObject kernel_arch_ppc.o :
arch_atomic.c arch_atomic.cpp
arch_commpage.cpp arch_commpage.cpp
arch_cpu.cpp arch_cpu.cpp
arch_cpu_asm.S arch_cpu_asm.S
+10 -10
View File
@@ -14,20 +14,20 @@ KernelMergeObject kernel_arch_x86.o :
arch_commpage.cpp arch_commpage.cpp
arch_cpu.cpp arch_cpu.cpp
arch_debug.cpp arch_debug.cpp
arch_debug_console.c arch_debug_console.cpp
arch_elf.c arch_elf.cpp
arch_int.cpp arch_int.cpp
arch_platform.c arch_platform.cpp
# arch_selector.c # arch_selector.cpp
arch_real_time_clock.c arch_real_time_clock.cpp
arch_smp.c arch_smp.cpp
arch_thread.cpp arch_thread.cpp
arch_timer.c arch_timer.cpp
arch_vm.cpp arch_vm.cpp
arch_vm_translation_map.cpp arch_vm_translation_map.cpp
arch_x86.S arch_x86.S
arch_interrupts.S arch_interrupts.S
arch_system_info.c arch_system_info.cpp
arch_user_debugger.cpp arch_user_debugger.cpp
apm.cpp apm.cpp
bios.cpp bios.cpp
@@ -37,9 +37,9 @@ KernelMergeObject kernel_arch_x86.o :
x86_physical_page_mapper.cpp x86_physical_page_mapper.cpp
x86_physical_page_mapper_large_memory.cpp x86_physical_page_mapper_large_memory.cpp
x86_pit.c x86_apic.cpp
x86_apic.c
x86_hpet.cpp x86_hpet.cpp
x86_pit.cpp
: :
$(TARGET_KERNEL_PIC_CCFLAGS) $(TARGET_KERNEL_PIC_CCFLAGS)
; ;
@@ -42,7 +42,7 @@ static uint32 sCPUOSIds[B_MAX_CPU_COUNT];
static uint32 sAPICVersions[B_MAX_CPU_COUNT]; static uint32 sAPICVersions[B_MAX_CPU_COUNT];
extern bool gUsingIOAPIC; extern bool gUsingIOAPIC;
extern void init_sse(void); extern "C" void init_sse(void);
static uint32 static uint32
apic_read(uint32 offset) apic_read(uint32 offset)
@@ -62,7 +62,7 @@ get_cpuid(cpuid_info *info, uint32 eaxRegister, uint32 forCPU)
status_t status_t
arch_get_system_info(system_info *info, size_t size) arch_get_system_info(system_info *info, size_t size)
{ {
info->cpu_type = sCpuType; info->cpu_type = (cpu_types)sCpuType;
info->cpu_revision = sCpuRevision; info->cpu_revision = sCpuRevision;
// - various cpu_info // - various cpu_info
@@ -148,7 +148,7 @@ _user_get_cpuid(cpuid_info *userInfo, uint32 eaxRegister, uint32 cpuNum)
{ {
cpuid_info info; cpuid_info info;
status_t status; status_t status;
if (!IS_USER_ADDRESS(userInfo)) if (!IS_USER_ADDRESS(userInfo))
return B_BAD_ADDRESS; return B_BAD_ADDRESS;
+2 -2
View File
@@ -35,7 +35,7 @@ SEARCH_SOURCE += [ FDirName $(posixSources) unistd ] ;
KernelMergeObject kernel_lib_posix.o : KernelMergeObject kernel_lib_posix.o :
# main # main
kernel_errno.c kernel_errno.cpp
dirent.c dirent.c
fcntl.cpp fcntl.cpp
poll.c poll.c
@@ -44,7 +44,7 @@ KernelMergeObject kernel_lib_posix.o :
ctype.c ctype.c
localeconv.c localeconv.c
# stdio (this subdir) # stdio (this subdir)
kernel_vsprintf.c kernel_vsprintf.cpp
# stdlib # stdlib
abs.c abs.c
atoi.c atoi.c
@@ -4,6 +4,6 @@ SubDirCcFlags $(TARGET_KERNEL_PIC_CCFLAGS) ;
SubDirC++Flags $(TARGET_KERNEL_PIC_CCFLAGS) ; SubDirC++Flags $(TARGET_KERNEL_PIC_CCFLAGS) ;
KernelMergeObject kernel_platform_openfirmware.o : KernelMergeObject kernel_platform_openfirmware.o :
openfirmware.c openfirmware.cpp
openfirmware_devices.cpp openfirmware_devices.cpp
; ;
@@ -9,7 +9,7 @@
// OpenFirmware entry function // OpenFirmware entry function
static int (*gCallOpenFirmware)(void *) = 0; static int (*gCallOpenFirmware)(void *) = 0;
int gChosen; int gChosen;
@@ -50,13 +50,13 @@ of_call_client_function(const char *method, int numArgs, int numReturns, ...)
// clear return values // clear return values
args.args[i] = NULL; args.args[i] = NULL;
} }
if (gCallOpenFirmware(&args) == OF_FAILED) if (gCallOpenFirmware(&args) == OF_FAILED)
return OF_FAILED; return OF_FAILED;
if (numReturns > 0) { if (numReturns > 0) {
// copy return values over to the provided location // copy return values over to the provided location
for (i = numArgs; i < numArgs + numReturns; i++) { for (i = numArgs; i < numArgs + numReturns; i++) {
void **store = va_arg(list, void **); void **store = va_arg(list, void **);
if (store) if (store)
@@ -106,7 +106,7 @@ of_interpret(const char *command, int numArgs, int numReturns, ...)
if (numReturns > 0) { if (numReturns > 0) {
// copy return values over to the provided location // copy return values over to the provided location
for (i = numArgs + 1; i < numArgs + 1 + numReturns; i++) { for (i = numArgs + 1; i < numArgs + 1 + numReturns; i++) {
void **store = va_arg(list, void **); void **store = va_arg(list, void **);
if (store) if (store)
@@ -157,7 +157,7 @@ of_call_method(int handle, const char *method, int numArgs, int numReturns, ...)
if (numReturns > 0) { if (numReturns > 0) {
// copy return values over to the provided location // copy return values over to the provided location
for (i = numArgs + 1; i < numArgs + 1 + numReturns; i++) { for (i = numArgs + 1; i < numArgs + 1 + numReturns; i++) {
void **store = va_arg(list, void **); void **store = va_arg(list, void **);
if (store) 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) of_finddevice(const char *device)
{ {
struct { struct {
@@ -271,7 +271,7 @@ of_instance_to_path(int instance, char *pathBuffer, int bufferSize)
} }
int int
of_instance_to_package(int instance) of_instance_to_package(int instance)
{ {
struct { struct {
@@ -289,7 +289,7 @@ of_instance_to_package(int instance)
} }
int int
of_getprop(int package, const char *property, void *buffer, int bufferSize) of_getprop(int package, const char *property, void *buffer, int bufferSize)
{ {
struct { 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) of_setprop(int package, const char *property, const void *buffer, int bufferSize)
{ {
struct { struct {
@@ -393,7 +393,7 @@ of_package_to_path(int package, char *pathBuffer, int bufferSize)
// I/O functions // I/O functions
int int
of_open(const char *nodeName) of_open(const char *nodeName)
{ {
struct { struct {
@@ -425,7 +425,7 @@ of_close(int handle)
} }
int int
of_read(int handle, void *buffer, int bufferSize) of_read(int handle, void *buffer, int bufferSize)
{ {
struct { struct {
@@ -445,7 +445,7 @@ of_read(int handle, void *buffer, int bufferSize)
} }
int int
of_write(int handle, const void *buffer, int bufferSize) of_write(int handle, const void *buffer, int bufferSize)
{ {
struct { struct {
@@ -465,7 +465,7 @@ of_write(int handle, const void *buffer, int bufferSize)
} }
int int
of_seek(int handle, long long pos) of_seek(int handle, long long pos)
{ {
struct { struct {
@@ -488,32 +488,32 @@ of_seek(int handle, long long pos)
int int
of_release(void *virtual, int size) of_release(void *virtualAddress, int size)
{ {
struct { struct {
const char *name; const char *name;
int num_args; int num_args;
int num_returns; int num_returns;
void *virtual; void *virtualAddress;
int size; int size;
} args = {"release", 2, 0, virtual, size}; } args = {"release", 2, 0, virtualAddress, size};
return gCallOpenFirmware(&args); return gCallOpenFirmware(&args);
} }
void * void *
of_claim(void *virtual, int size, int align) of_claim(void *virtualAddress, int size, int align)
{ {
struct { struct {
const char *name; const char *name;
int num_args; int num_args;
int num_returns; int num_returns;
void *virtual; void *virtualAddress;
int size; int size;
int align; int align;
void *address; void *address;
} args = {"claim", 3, 1, virtual, size, align}; } args = {"claim", 3, 1, virtualAddress, size, align};
if (gCallOpenFirmware(&args) == OF_FAILED) if (gCallOpenFirmware(&args) == OF_FAILED)
return NULL; return NULL;
+3 -3
View File
@@ -5,9 +5,9 @@ UsePrivateHeaders [ FDirName kernel util ] ;
KernelMergeObject kernel_util.o : KernelMergeObject kernel_util.o :
AVLTreeMap.cpp AVLTreeMap.cpp
kernel_cpp.cpp kernel_cpp.cpp
khash.c khash.cpp
list.c list.cpp
queue.c queue.cpp
ring_buffer.cpp ring_buffer.cpp
RadixBitmap.cpp RadixBitmap.cpp
-50
View File
@@ -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 <ktypes.h>
#include <debug.h>
/* 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);
}
@@ -43,7 +43,7 @@ queue_remove_item(queue *_q, void *e)
if (last) if (last)
last->next = temp->next; last->next = temp->next;
else else
q->head = temp->next; q->head = (queue_element*)temp->next;
if (q->tail == temp) if (q->tail == temp)
q->tail = last; q->tail = last;
@@ -51,7 +51,7 @@ queue_remove_item(queue *_q, void *e)
return 0; return 0;
} }
last = temp; last = temp;
temp = temp->next; temp = (queue_element*)temp->next;
} }
return -1; return -1;
@@ -85,7 +85,7 @@ queue_dequeue(queue *_q)
elem = q->head; elem = q->head;
if (q->head != NULL) if (q->head != NULL)
q->head = q->head->next; q->head = (queue_element*)q->head->next;
if (q->tail == elem) if (q->tail == elem)
q->tail = NULL; q->tail = NULL;
@@ -113,7 +113,7 @@ fixed_queue_init(fixed_queue *q, int size)
if (size <= 0) if (size <= 0)
return EINVAL; return EINVAL;
q->table = malloc(size * sizeof(void *)); q->table = (void**)malloc(size * sizeof(void *));
if (!q->table) if (!q->table)
return ENOMEM; return ENOMEM;
q->head = 0; q->head = 0;
+2 -2
View File
@@ -20,7 +20,7 @@ AddResources runtime_loader : runtime_loader.rdef ;
# needed for "runtime_loader" only # needed for "runtime_loader" only
StaticLibrary libruntime_loader.a : StaticLibrary libruntime_loader.a :
kernel_vsprintf.c kernel_vsprintf.cpp
kernel_cpp.cpp kernel_cpp.cpp
KMessage.cpp KMessage.cpp
: :
@@ -62,7 +62,7 @@ StaticLibrary libruntime_loader.a :
SEARCH on [ FGristFiles kernel_cpp.cpp ] SEARCH on [ FGristFiles kernel_cpp.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel util ] ; = [ 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 ] ; = [ FDirName $(HAIKU_TOP) src system kernel lib ] ;
SEARCH on [ FGristFiles KMessage.cpp ] SEARCH on [ FGristFiles KMessage.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel messaging ] ; = [ FDirName $(HAIKU_TOP) src system kernel messaging ] ;