Change int into status_t, and other changes for better BeOS type compatiblitly.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@975 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper
2002-09-03 02:19:22 +00:00
parent 35931182a2
commit 90abd04b34
16 changed files with 292 additions and 233 deletions
+21 -21
View File
@@ -163,20 +163,20 @@ typedef struct port_info {
port_id create_port(int32, const char *);
port_id find_port(const char *);
int read_port(port_id, int32 *, void *, size_t);
int read_port_etc(port_id, int32 *, void *, size_t, uint32, bigtime_t);
int write_port(port_id, int32, const void *, size_t);
int write_port_etc(port_id, int32, const void *, size_t, uint32, bigtime_t);
int close_port(port_id port);
int delete_port(port_id port);
status_t read_port(port_id, int32 *, void *, size_t);
status_t read_port_etc(port_id, int32 *, void *, size_t, uint32, bigtime_t);
status_t write_port(port_id, int32, const void *, size_t);
status_t write_port_etc(port_id, int32, const void *, size_t, uint32, bigtime_t);
status_t close_port(port_id port);
status_t delete_port(port_id port);
ssize_t port_buffer_size(port_id);
ssize_t port_buffer_size_etc(port_id, uint32, bigtime_t);
ssize_t port_count(port_id);
int set_port_owner(port_id, team_id);
status_t set_port_owner(port_id, team_id);
int _get_port_info(port_id, port_info *, size_t);
int _get_next_port_info(team_id, int32 *, port_info *, size_t);
status_t _get_port_info(port_id, port_info *, size_t);
status_t _get_next_port_info(team_id, int32 *, port_info *, size_t);
#define get_port_info(port, info) \
_get_port_info((port), (info), sizeof(*(info)))
@@ -206,18 +206,18 @@ typedef struct sem_info {
thread_id latest_holder;
} sem_info;
sem_id create_sem_etc(int count, const char *name, team_id owner);
sem_id create_sem(int count, const char *name);
int delete_sem(sem_id id);
int delete_sem_etc(sem_id id, int return_code);
int acquire_sem(sem_id id);
int acquire_sem_etc(sem_id id, int count, int flags, bigtime_t timeout);
int release_sem(sem_id id);
int release_sem_etc(sem_id id, int count, int flags);
int get_sem_count(sem_id id, int32* thread_count);
int _get_sem_info(sem_id id, struct sem_info *info, size_t);
int _get_next_sem_info(team_id team, uint32 *cookie, struct sem_info *info, size_t);
int set_sem_owner(sem_id id, team_id team);
sem_id create_sem_etc(int32 count, const char *name, team_id owner); /* not public BeOS */
sem_id create_sem(int32 count, const char *name);
status_t delete_sem(sem_id id);
status_t delete_sem_etc(sem_id id, status_t return_code); /* not public BeOS */
status_t acquire_sem(sem_id id);
status_t acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout);
status_t release_sem(sem_id id);
status_t release_sem_etc(sem_id id, int32 count, uint32 flags);
status_t get_sem_count(sem_id id, int32* thread_count);
status_t _get_sem_info(sem_id id, struct sem_info *info, size_t);
status_t _get_next_sem_info(team_id team, int32 *cookie, struct sem_info *info, size_t);
status_t set_sem_owner(sem_id id, team_id team);
#define get_sem_info(sem, info) \
_get_sem_info((sem), (info), sizeof(*(info)))
+24 -13
View File
@@ -1,6 +1,9 @@
#ifndef _KERNEL_ATOMIC_H
#define _KERNEL_ATOMIC_H
#include <ktypes.h>
typedef volatile int vint32; //XXX misplaced here
/**
* @file kernel/atomic.h
* @brief Prototypes for kernel and user versions of atomic
@@ -17,37 +20,41 @@
extern "C" {
#endif
/* XXX - atomic_set is defined as using a volatile as this stops a
* compiler warning, but is there any reason why they shouldn't all
* be so defined? They were in arch/cpu.h...
/* atomic_add(), atomic_and(), atomic_or() must
* match the definitions in SupportDefs.h
*/
/**
* Perform an atomic addition.
* @param val Pointer to an integer
* @param incr The increment to add (may be -ve)
* @note Returns value of val before addition
*/
int atomic_add(int *val, int incr);
int32 atomic_add(vint32 *val, int32 incr);
/**
* Atomic and operation
* @param val Pointer to an integer
* @param incr The increment to add (may be -ve)
* @note Returns value of val before addition
*/
int atomic_and(int *val, int incr);
int32 atomic_and(vint32 *val, int32 incr);
/**
* Atomic or operation
* @param val Pointer to an integer
* @param incr The increment to add (may be -ve)
* @note Returns value of val before addition
*/
int atomic_or(int *val, int incr);
int atomic_set(volatile int *val, int set_to);
int32 atomic_or(vint32 *val, int32 incr);
int32 atomic_set(vint32 *val, int32 set_to);
/* Compare the value of val with test_val. If they
* are equal then set the value of 'val' to
* 'set_to'
*/
int test_and_set(int *val, int set_to, int test_val);
int32 test_and_set(vint32 *val, int32 set_to, int32 test_val);
/**
* Atomic add (user version)
@@ -55,29 +62,33 @@ int test_and_set(int *val, int set_to, int test_val);
* @param incr The increment to add (may be -ve)
* @note Returns value of val before addition
*/
int user_atomic_add(int *val, int incr);
int32 user_atomic_add(vint32 *val, int32 incr);
/**
* Atomic and (user version)
* @param val Pointer to an integer
* @param incr The increment to add (may be -ve)
* @note Returns value of val before addition
*/
int user_atomic_and(int *val, int incr);
int32 user_atomic_and(vint32 *val, int32 incr);
/**
* Atomic or (user version)
* @param val Pointer to an integer
* @param incr The increment to add (may be -ve)
* @note Returns value of val before addition
*/
int user_atomic_or(int *val, int incr);
int user_atomic_set(int *val, int set_to);
int32 user_atomic_or(vint32 *val, int32 incr);
int32 user_atomic_set(vint32 *val, int32 set_to);
/* Compare the value of val with test_val. If they
* are equal then set the value of 'val' to
* 'set_to'
* @note This is the user version and should not be used within
* the kernel.
*/
int user_test_and_set(int *val, int set_to, int test_val);
int32 user_test_and_set(vint32 *val, int32 set_to, int32 test_val);
#ifdef __cplusplus
}
+1 -1
View File
@@ -5,6 +5,6 @@
#ifndef _NEWOS_KERNEL_FS_BOOTFS_H
#define _NEWOS_KERNEL_FS_BOOTFS_H
int bootstrap_bootfs(void);
status_t bootstrap_bootfs(void);
#endif
+2 -2
View File
@@ -8,9 +8,9 @@
#include <vfs.h>
#include <Drivers.h>
int bootstrap_devfs(void);
status_t bootstrap_devfs(void);
/* api drivers will use to publish devices */
int devfs_publish_device(const char *path, void *ident, device_hooks *calls);
status_t devfs_publish_device(const char *path, void *ident, device_hooks *calls);
#endif /* _DEVFS_H */
+10 -10
View File
@@ -11,7 +11,7 @@
#define PORT_FLAG_USE_USER_MEMCPY 0x80000000
int port_init(kernel_args *ka);
status_t port_init(kernel_args *ka);
int delete_owned_ports(team_id owner);
// temp: test
@@ -20,25 +20,25 @@ int port_test_thread_func(void* arg);
// user-level API
port_id user_create_port(int32 queue_length, const char *name);
int user_close_port(port_id id);
int user_delete_port(port_id id);
status_t user_close_port(port_id id);
status_t user_delete_port(port_id id);
port_id user_find_port(const char *port_name);
int user_get_port_info(port_id id, struct port_info *info);
int user_get_next_port_info(team_id team,
uint32 *cookie,
status_t user_get_port_info(port_id id, struct port_info *info);
status_t user_get_next_port_info(team_id team,
int32 *cookie,
struct port_info *info);
ssize_t user_port_buffer_size_etc(port_id port,
uint32 flags,
bigtime_t timeout);
int32 user_port_count(port_id port);
ssize_t user_read_port_etc(port_id port,
ssize_t user_port_count(port_id port);
status_t user_read_port_etc(port_id port,
int32 *msg_code,
void *msg_buffer,
size_t buffer_size,
uint32 flags,
bigtime_t timeout);
int user_set_port_owner(port_id port, team_id team);
int user_write_port_etc(port_id port,
status_t user_set_port_owner(port_id port, team_id team);
status_t user_write_port_etc(port_id port,
int32 msg_code,
void *msg_buffer,
size_t buffer_size,
+1 -1
View File
@@ -5,6 +5,6 @@
#ifndef _NEWOS_KERNEL_FS_ROOTFS_H
#define _NEWOS_KERNEL_FS_ROOTFS_H
int bootstrap_rootfs(void);
status_t bootstrap_rootfs(void);
#endif
+14 -14
View File
@@ -15,22 +15,22 @@
/* #ifdef _KERNEL_ */
sem_id user_create_sem(int count, const char *name);
int user_delete_sem(sem_id id);
int user_delete_sem_etc(sem_id id, int return_code);
int user_acquire_sem(sem_id id);
int user_acquire_sem_etc(sem_id id, int count, int flags, bigtime_t timeout);
int user_release_sem(sem_id id);
int user_release_sem_etc(sem_id id, int count, int flags);
int user_get_sem_count(sem_id id, int32* thread_count);
int user_get_sem_info(sem_id, struct sem_info *, size_t);
int user_get_next_sem_info(team_id, uint32 *, struct sem_info *, size_t);
int user_set_sem_owner(sem_id id, team_id team);
sem_id user_create_sem(int32 count, const char *name);
status_t user_delete_sem(sem_id id);
status_t user_delete_sem_etc(sem_id id, status_t return_code);
status_t user_acquire_sem(sem_id id);
status_t user_acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout);
status_t user_release_sem(sem_id id);
status_t user_release_sem_etc(sem_id id, int32 count, uint32 flags);
status_t user_get_sem_count(sem_id id, int32* thread_count);
status_t user_get_sem_info(sem_id, struct sem_info *, size_t);
status_t user_get_next_sem_info(team_id, int32 *, struct sem_info *, size_t);
status_t user_set_sem_owner(sem_id id, team_id team);
int sem_init(kernel_args *ka);
int sem_delete_owned_sems(team_id owner);
int sem_interrupt_thread(struct thread *t);
status_t sem_init(kernel_args *ka);
int sem_delete_owned_sems(team_id owner);
status_t sem_interrupt_thread(struct thread *t);
/* #endif */
#endif /* _KERNEL_SEM_H */