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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user