From 4e3c12c0afa8bb6c5f314e5bc305cc5b6c835a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 23 Sep 2002 02:36:51 +0000 Subject: [PATCH] Moved to . Removed dependencies on arch/x86/types.h - this file is not really used anymore, now. Might prevent compiling on Windows, though. Replaced "int" with "int32" for the id types. Removed some stuff from ktypes.h because it didn't belong there. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1120 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/arch/x86/selector.h | 2 - headers/private/kernel/arch/x86/types.h | 4 +- headers/private/kernel/atomic.h | 1 - headers/private/kernel/elf32.h | 2 +- headers/private/kernel/kernel.h | 4 +- headers/private/kernel/kmodule.h | 15 ++++++++ headers/private/kernel/ksyscalls.h | 2 +- headers/private/kernel/ktypes.h | 45 ++++++++-------------- headers/private/kernel/module.h | 40 ------------------- 9 files changed, 37 insertions(+), 78 deletions(-) create mode 100644 headers/private/kernel/kmodule.h delete mode 100755 headers/private/kernel/module.h diff --git a/headers/private/kernel/arch/x86/selector.h b/headers/private/kernel/arch/x86/selector.h index a17e85340d..8dee724517 100644 --- a/headers/private/kernel/arch/x86/selector.h +++ b/headers/private/kernel/arch/x86/selector.h @@ -5,8 +5,6 @@ #ifndef _KERNEL_ARCH_x86_SELECTOR_H #define _KERNEL_ARCH_x86_SELECTOR_H -#include - typedef uint32 selector_id; typedef uint64 selector_type; diff --git a/headers/private/kernel/arch/x86/types.h b/headers/private/kernel/arch/x86/types.h index f7df3fc1ce..c70a4ecf3c 100755 --- a/headers/private/kernel/arch/x86/types.h +++ b/headers/private/kernel/arch/x86/types.h @@ -13,8 +13,8 @@ typedef __int64 int64; #endif -typedef unsigned int uint32; -typedef int int32; +typedef unsigned long uint32; +typedef long int32; typedef unsigned short uint16; typedef short int16; typedef unsigned char uint8; diff --git a/headers/private/kernel/atomic.h b/headers/private/kernel/atomic.h index b9cd18162a..7629ac25b7 100755 --- a/headers/private/kernel/atomic.h +++ b/headers/private/kernel/atomic.h @@ -2,7 +2,6 @@ #define _KERNEL_ATOMIC_H #include -typedef volatile int vint32; //XXX misplaced here /** * @file kernel/atomic.h diff --git a/headers/private/kernel/elf32.h b/headers/private/kernel/elf32.h index ae38814f3c..4568d56729 100755 --- a/headers/private/kernel/elf32.h +++ b/headers/private/kernel/elf32.h @@ -5,7 +5,7 @@ #ifndef _ELF32_H #define _ELF32_H -#include +#include typedef uint32 Elf32_Addr; typedef uint16 Elf32_Half; diff --git a/headers/private/kernel/kernel.h b/headers/private/kernel/kernel.h index 8663f08c4d..68f54c5d50 100644 --- a/headers/private/kernel/kernel.h +++ b/headers/private/kernel/kernel.h @@ -44,8 +44,8 @@ extern "C" { #define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1)) #define ROUNDOWN(a, b) (((a) / (b)) * (b)) -#define min(a, b) ((a) < (b) ? (a) : (b)) -#define max(a, b) ((a) > (b) ? (a) : (b)) +//#define min(a, b) ((a) < (b) ? (a) : (b)) +//#define max(a, b) ((a) > (b) ? (a) : (b)) /** return the offset of member 'm' within type 't' */ #define offsetof(t, m) ((size_t)&(((t *)0)->m)) diff --git a/headers/private/kernel/kmodule.h b/headers/private/kernel/kmodule.h new file mode 100644 index 0000000000..1e00cddc1d --- /dev/null +++ b/headers/private/kernel/kmodule.h @@ -0,0 +1,15 @@ +/* +** Copyright 2001-2002, Thomas Kurschel. All rights reserved. +** Distributed under the terms of the NewOS License. +*/ + +#ifndef _KERNEL_MODULE_H +#define _KERNEL_MODULE_H + +#include +#include +#include + +extern status_t module_init(kernel_args *ka, module_info **sys_module_headers); + +#endif /* _KRENEL_MODULE_H */ diff --git a/headers/private/kernel/ksyscalls.h b/headers/private/kernel/ksyscalls.h index f837a6f14f..1c028d81b7 100755 --- a/headers/private/kernel/ksyscalls.h +++ b/headers/private/kernel/ksyscalls.h @@ -3,7 +3,7 @@ ** Distributed under the terms of the NewOS License. */ -#include +#include #ifndef _KERNEL_SYSCALLS_H #define _KERNEL_SYSCALLS_H diff --git a/headers/private/kernel/ktypes.h b/headers/private/kernel/ktypes.h index f3209c6885..68d66c4ce2 100755 --- a/headers/private/kernel/ktypes.h +++ b/headers/private/kernel/ktypes.h @@ -9,17 +9,18 @@ extern "C" { #endif -#include +//#include +#include typedef uint16 mode_t; typedef int pid_t; -typedef int thread_id; -typedef int region_id; -typedef int aspace_id; -typedef int team_id; -typedef int sem_id; -typedef int port_id; -typedef int image_id; +typedef int32 thread_id; +typedef int32 region_id; +typedef int32 aspace_id; +typedef int32 team_id; +typedef int32 sem_id; +typedef int32 port_id; +typedef int32 image_id; typedef uint32 dev_t; typedef uint64 ino_t; typedef uint64 vnode_id; @@ -27,29 +28,13 @@ typedef uint32 fs_id; typedef uint16 nlink_t; typedef uint32 uid_t; typedef uint32 gid_t; -typedef int32 status_t; +//typedef int32 status_t; -#ifdef _OBOS_TIME_T_ -typedef _OBOS_TIME_T_ time_t; -#undef _OBOS_TIME_T_ -#endif /* _OBOS_TIME_T_ */ - -typedef int64 bigtime_t; - #ifndef NULL #define NULL 0 #endif -#ifndef __cplusplus - -#define false 0 -#define true 1 - -typedef int bool; - -#endif - /* * XXX serious hack that doesn't really solve the problem. * As of right now, some versions of the toolchain expect size_t to @@ -72,10 +57,12 @@ typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; -typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; +//typedef unsigned char uchar; +//typedef unsigned short ushort; +//typedef unsigned int uint; +//typedef unsigned long ulong; + +typedef unsigned long addr; // Handled in arch_ktypes.h diff --git a/headers/private/kernel/module.h b/headers/private/kernel/module.h deleted file mode 100755 index 3a70601e06..0000000000 --- a/headers/private/kernel/module.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -** Copyright 2001-2002, Thomas Kurschel. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ - -#ifndef _KERNEL_MODULE_H -#define _KERNEL_MODULE_H - -#include -#include - -typedef struct module_info module_info; - -struct module_info { - const char *name; - uint32 flags; - int32 (*std_ops)(int32, ...); -}; - -// boot init -// XXX this is very private, so move it away -extern int module_init( kernel_args *ka, module_info **sys_module_headers ); - -/* Be Module Compatability... */ - -#define B_MODULE_INIT 1 -#define B_MODULE_UNINIT 2 -#define B_KEEP_LOADED 0x00000001 - -int get_module(const char *path, module_info **vec); -int put_module(const char *path); - -int get_next_loaded_module_name(uint32 *cookie, char *buf, size_t *bufsize); -void *open_module_list(const char *prefix); -int read_next_module_name(void *cookie, char *buf, size_t *bufsize); -int close_module_list(void *cookie); - -extern module_info *modules[]; - -#endif /* _|KRENEL_MODULE_H */