From d7e489f80a82a0dc5974df1e780d7a908129bab4 Mon Sep 17 00:00:00 2001 From: beveloper Date: Wed, 23 Oct 2002 13:45:47 +0000 Subject: [PATCH] modified to provider better R5 compatibility git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1615 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/drivers/Drivers.h | 84 ++++++++++++++++++++++++++++++- headers/os/drivers/KernelExport.h | 3 +- headers/os/interface/StringItem.h | 3 +- headers/os/kernel/OS.h | 9 ++-- headers/os/net/socket.h | 2 +- headers/os/storage/Mime.h | 4 ++ headers/os/storage/Path.h | 3 +- 7 files changed, 100 insertions(+), 8 deletions(-) diff --git a/headers/os/drivers/Drivers.h b/headers/os/drivers/Drivers.h index 279f8df9bd..dfbd837fed 100644 --- a/headers/os/drivers/Drivers.h +++ b/headers/os/drivers/Drivers.h @@ -1,14 +1,20 @@ #ifndef _DRIVERS_DRIVERS_H #define _DRIVERS_DRIVERS_H +#include #include -#include #include +#include /* --- these hooks are how the kernel accesses the device --- */ +// XXX hack, this is also in private/kernel/defines.h +#ifndef SYS_MAX_PATH_LEN + #define SYS_MAX_PATH_LEN 512 +#endif + struct selectsync; typedef struct selectsync selectsync; @@ -150,4 +156,80 @@ enum { B_DEVICE_OP_CODES_END = 9999 /* end of Be-defined contol id's */ }; +/* --- + geometry structure for the B_GET_GEOMETRY opcode +--- */ + +typedef struct { + uint32 bytes_per_sector; /* sector size in bytes */ + uint32 sectors_per_track; /* # sectors per track */ + uint32 cylinder_count; /* # cylinders */ + uint32 head_count; /* # heads */ + uchar device_type; /* type */ + bool removable; /* non-zero if removable */ + bool read_only; /* non-zero if read only */ + bool write_once; /* non-zero if write-once */ +} device_geometry; + + +/* --- + Be-defined device types returned by B_GET_GEOMETRY. Use these if it makes + sense for your device. +--- */ + +enum { + B_DISK = 0, /* Hard disks, floppy disks, etc. */ + B_TAPE, /* Tape drives */ + B_PRINTER, /* Printers */ + B_CPU, /* CPU devices */ + B_WORM, /* Write-once, read-many devives */ + B_CD, /* CD ROMS */ + B_SCANNER, /* Scanners */ + B_OPTICAL, /* Optical devices */ + B_JUKEBOX, /* Jukeboxes */ + B_NETWORK /* Network devices */ +}; + + +/* --- + partition_info structure used by B_GET_PARTITION_INFO and B_SET_PARTITION +--- */ + +typedef struct { + off_t offset; /* offset (in bytes) */ + off_t size; /* size (in bytes) */ + int32 logical_block_size; /* logical block size of partition */ + int32 session; /* id of session */ + int32 partition; /* id of partition */ + char device[256]; /* path to the physical device */ +} partition_info; + +/* --- + driver_path structure returned by the B_GET_DRIVER_FOR_DEVICE +--- */ + +typedef char driver_path[256]; + + +/* --- + open_device_iterator structure used by the B_GET_NEXT_OPEN_DEVICE opcode +--- */ + +typedef struct { + uint32 cookie; /* must be set to 0 before iterating */ + char device[256]; /* device path */ +} open_device_iterator; + + +/* --- + icon structure for the B_GET_ICON opcode +--- */ + +typedef struct { + int32 icon_size; /* icon size requested */ + void *icon_data; /* where to put 'em (usually BBitmap->Bits()) */ +} device_icon; + + + #endif /* _DRIVERS_DRIVERS_H */ diff --git a/headers/os/drivers/KernelExport.h b/headers/os/drivers/KernelExport.h index beae6d0382..593a6ffa98 100644 --- a/headers/os/drivers/KernelExport.h +++ b/headers/os/drivers/KernelExport.h @@ -25,7 +25,7 @@ extern "C" { --- */ extern _IMPEXP_KERNEL thread_id spawn_kernel_thread ( - thread_entry function, + thread_func function, const char *thread_name, long priority, void *arg @@ -241,6 +241,7 @@ extern _IMPEXP_KERNEL int register_kernel_daemon(void (*func)(void *, int), vo extern _IMPEXP_KERNEL int unregister_kernel_daemon(void (*func)(void *, int), void *arg); extern _IMPEXP_KERNEL void call_all_cpus(void (*f)(void*, int), void* cookie); +extern _IMPEXP_KERNEL int load_driver_symbols(const char *driver_name); #ifdef __cplusplus } diff --git a/headers/os/interface/StringItem.h b/headers/os/interface/StringItem.h index 3760e86456..e5c8eb14b4 100644 --- a/headers/os/interface/StringItem.h +++ b/headers/os/interface/StringItem.h @@ -27,7 +27,7 @@ class BStringItem : public BListItem public: BStringItem(const char* text, uint32 outlineLevel = 0, bool expanded = true) ; BStringItem(BMessage* data) ; -virtual ~MyStringItem() ; +virtual ~BStringItem() ; static BArchivable *Instantiate(BMessage* data); virtual status_t Archive(BMessage* data, bool deep = true) const ; @@ -53,3 +53,4 @@ private: #endif #endif /* _STRING_ITEM_H */ + \ No newline at end of file diff --git a/headers/os/kernel/OS.h b/headers/os/kernel/OS.h index 2db32221e9..9273e66471 100644 --- a/headers/os/kernel/OS.h +++ b/headers/os/kernel/OS.h @@ -6,12 +6,13 @@ #ifndef _OS_H #define _OS_H -#include +//#include // ToDo: has to be included here, but does currently causes compiler errors // (redefinitions in ktypes.h (bigtime_t), and arch/x86/types.h (int8, ...)) -//#include +#include +#include // ToDo: is automatically included by SupportDefs.h, so that one can be removed later -#include +//#include #ifdef __cplusplus @@ -258,6 +259,8 @@ typedef struct { #define B_MIN_PRIORITY B_IDLE_PRIORITY #define B_MAX_PRIORITY B_REAL_TIME_PRIORITY +#define B_SYSTEM_TIMEBASE 0 + typedef int32 (*thread_func) (void *); // the equivalent thread_entry has been removed (deprecated) diff --git a/headers/os/net/socket.h b/headers/os/net/socket.h index 274c0a58a2..094411148e 100644 --- a/headers/os/net/socket.h +++ b/headers/os/net/socket.h @@ -2,7 +2,7 @@ #define _NET_SOCKET_H #include -#include /* in_addr, sockaddr_in */ +#include /* in_addr, sockaddr_in */ #include /* sockaddr */ #include diff --git a/headers/os/storage/Mime.h b/headers/os/storage/Mime.h index 4c608455c6..5eaf3d5ee8 100644 --- a/headers/os/storage/Mime.h +++ b/headers/os/storage/Mime.h @@ -9,6 +9,10 @@ #ifndef _MIME_H #define _MIME_H +#ifndef _BE_BUILD_H +#include +#endif +#include #include #include diff --git a/headers/os/storage/Path.h b/headers/os/storage/Path.h index 888ea0d5f4..e3ba9f1e87 100644 --- a/headers/os/storage/Path.h +++ b/headers/os/storage/Path.h @@ -11,7 +11,8 @@ #define _PATH_H #include -#include +#include +#include /* for convenience, as in R5 */ #ifdef USE_OPENBEOS_NAMESPACE namespace OpenBeOS {