2002-07-09 12:24:59 +00:00
|
|
|
/*
|
2015-04-21 18:49:37 +02:00
|
|
|
* Copyright 2004-2015, Haiku, Inc. All rights reserved.
|
2004-12-14 16:06:34 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
|
*/
|
2008-05-14 03:55:16 +00:00
|
|
|
#ifndef _SYSTEM_SYSCALLS_H
|
|
|
|
|
#define _SYSTEM_SYSCALLS_H
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2004-07-02 01:51:56 +00:00
|
|
|
|
2005-12-07 23:11:02 +00:00
|
|
|
#include <arch_config.h>
|
2009-07-21 22:18:39 +00:00
|
|
|
#include <DiskDeviceDefs.h>
|
2015-10-26 13:43:44 -04:00
|
|
|
#include <elf_private.h>
|
2003-01-12 16:17:09 +00:00
|
|
|
#include <image.h>
|
2016-04-27 01:56:42 +02:00
|
|
|
#include <image_defs.h>
|
2005-12-07 23:11:02 +00:00
|
|
|
#include <OS.h>
|
2004-10-29 01:27:44 +00:00
|
|
|
|
2005-11-07 16:07:25 +00:00
|
|
|
#include <signal.h>
|
2008-04-11 04:12:23 +00:00
|
|
|
#include <sys/socket.h>
|
2004-12-14 16:06:34 +00:00
|
|
|
|
2002-07-09 12:24:59 +00:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-07-29 00:34:44 +00:00
|
|
|
struct attr_info;
|
2005-11-07 16:07:25 +00:00
|
|
|
struct dirent;
|
2023-07-26 16:51:38 -04:00
|
|
|
struct event_wait_info;
|
2006-01-17 01:29:18 +00:00
|
|
|
struct fd_info;
|
2005-11-07 16:07:25 +00:00
|
|
|
struct fd_set;
|
|
|
|
|
struct fs_info;
|
|
|
|
|
struct iovec;
|
2025-04-01 23:19:53 +02:00
|
|
|
struct loadavg;
|
2008-09-11 15:03:01 +00:00
|
|
|
struct msqid_ds;
|
2008-04-11 04:12:23 +00:00
|
|
|
struct net_stat;
|
2005-11-07 16:07:25 +00:00
|
|
|
struct pollfd;
|
2004-07-02 01:51:56 +00:00
|
|
|
struct rlimit;
|
2008-09-03 15:10:44 +00:00
|
|
|
struct scheduling_analysis;
|
2008-06-19 00:05:01 +00:00
|
|
|
struct _sem_t;
|
2008-07-29 12:03:41 +00:00
|
|
|
struct sembuf;
|
|
|
|
|
union semun;
|
2009-04-18 17:35:28 +00:00
|
|
|
struct sigaction;
|
2011-06-12 00:00:23 +00:00
|
|
|
struct signal_frame_data;
|
2009-04-18 17:35:28 +00:00
|
|
|
struct stat;
|
|
|
|
|
struct system_profiler_parameters;
|
2011-06-12 00:00:23 +00:00
|
|
|
struct user_timer_info;
|
2005-11-07 16:07:25 +00:00
|
|
|
|
|
|
|
|
struct disk_device_job_progress_info;
|
|
|
|
|
struct partitionable_space_data;
|
2008-05-09 01:32:36 +00:00
|
|
|
struct thread_creation_attributes;
|
2005-11-07 16:07:25 +00:00
|
|
|
struct user_disk_device_data;
|
|
|
|
|
struct user_disk_device_job_info;
|
|
|
|
|
struct user_disk_system_info;
|
2004-07-02 01:51:56 +00:00
|
|
|
|
2004-08-28 20:29:35 +00:00
|
|
|
// This marks the beginning of the syscalls prototypes for gensyscallinfos.
|
|
|
|
|
// NOTE:
|
|
|
|
|
// * Nothing but those prototypes may live here.
|
|
|
|
|
// * The arguments of the functions must be named to be processed properly.
|
2004-11-25 21:18:54 +00:00
|
|
|
|
2004-08-28 20:29:35 +00:00
|
|
|
#ifdef GEN_SYSCALL_INFOS_PROCESSING
|
2009-11-26 16:59:46 +00:00
|
|
|
# define __NO_RETURN
|
|
|
|
|
# pragma syscalls begin
|
|
|
|
|
#else
|
|
|
|
|
# define __NO_RETURN __attribute__((noreturn))
|
2004-08-28 20:29:35 +00:00
|
|
|
#endif
|
2004-07-02 01:51:56 +00:00
|
|
|
|
2007-02-04 21:08:35 +00:00
|
|
|
extern int _kern_is_computer_on(void);
|
2004-12-14 17:09:06 +00:00
|
|
|
extern status_t _kern_generic_syscall(const char *subsystem, uint32 function,
|
2004-12-14 15:46:53 +00:00
|
|
|
void *buffer, size_t bufferSize);
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2004-03-03 00:52:47 +00:00
|
|
|
extern int _kern_getrlimit(int resource, struct rlimit * rlp);
|
|
|
|
|
extern int _kern_setrlimit(int resource, const struct rlimit * rlp);
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2004-11-25 17:57:37 +00:00
|
|
|
extern status_t _kern_shutdown(bool reboot);
|
2008-07-29 12:03:41 +00:00
|
|
|
extern status_t _kern_get_safemode_option(const char *parameter,
|
|
|
|
|
char *buffer, size_t *_bufferSize);
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2007-10-02 19:47:31 +00:00
|
|
|
extern ssize_t _kern_wait_for_objects(object_wait_info* infos, int numInfos,
|
|
|
|
|
uint32 flags, bigtime_t timeout);
|
|
|
|
|
|
2023-07-26 16:51:38 -04:00
|
|
|
extern int _kern_event_queue_create(int openFlags);
|
|
|
|
|
extern status_t _kern_event_queue_select(int queue,
|
|
|
|
|
struct event_wait_info* userInfos, int numInfos);
|
|
|
|
|
extern ssize_t _kern_event_queue_wait(int queue, struct event_wait_info* infos,
|
|
|
|
|
int numInfos, uint32 flags, bigtime_t timeout);
|
|
|
|
|
|
2010-04-11 16:07:39 +00:00
|
|
|
/* user mutex functions */
|
|
|
|
|
extern status_t _kern_mutex_lock(int32* mutex, const char* name,
|
|
|
|
|
uint32 flags, bigtime_t timeout);
|
2023-06-06 23:30:15 -04:00
|
|
|
extern status_t _kern_mutex_unblock(int32* mutex, uint32 flags);
|
2023-06-13 12:43:00 -04:00
|
|
|
extern status_t _kern_mutex_switch_lock(int32* fromMutex, uint32 fromFlags,
|
2024-09-16 15:36:12 -04:00
|
|
|
int32* toMutex, const char* name, uint32 toFlags,
|
2023-06-13 12:43:00 -04:00
|
|
|
bigtime_t timeout);
|
2015-05-11 21:14:52 +01:00
|
|
|
extern status_t _kern_mutex_sem_acquire(int32* sem, const char* name,
|
|
|
|
|
uint32 flags, bigtime_t timeout);
|
2023-07-25 16:26:22 -04:00
|
|
|
extern status_t _kern_mutex_sem_release(int32* sem, uint32 flags);
|
2010-04-11 16:07:39 +00:00
|
|
|
|
2002-07-09 12:24:59 +00:00
|
|
|
/* sem functions */
|
2004-12-14 16:06:34 +00:00
|
|
|
extern sem_id _kern_create_sem(int count, const char *name);
|
|
|
|
|
extern status_t _kern_delete_sem(sem_id id);
|
2005-03-17 22:35:00 +00:00
|
|
|
extern status_t _kern_switch_sem(sem_id releaseSem, sem_id id);
|
2008-07-29 12:03:41 +00:00
|
|
|
extern status_t _kern_switch_sem_etc(sem_id releaseSem, sem_id id,
|
|
|
|
|
uint32 count, uint32 flags, bigtime_t timeout);
|
2004-12-14 16:06:34 +00:00
|
|
|
extern status_t _kern_acquire_sem(sem_id id);
|
2008-07-29 12:03:41 +00:00
|
|
|
extern status_t _kern_acquire_sem_etc(sem_id id, uint32 count, uint32 flags,
|
|
|
|
|
bigtime_t timeout);
|
2004-12-14 16:06:34 +00:00
|
|
|
extern status_t _kern_release_sem(sem_id id);
|
|
|
|
|
extern status_t _kern_release_sem_etc(sem_id id, uint32 count, uint32 flags);
|
|
|
|
|
extern status_t _kern_get_sem_count(sem_id id, int32* thread_count);
|
2008-07-29 12:03:41 +00:00
|
|
|
extern status_t _kern_get_sem_info(sem_id semaphore, struct sem_info *info,
|
|
|
|
|
size_t size);
|
2006-01-08 15:34:09 +00:00
|
|
|
extern status_t _kern_get_next_sem_info(team_id team, int32 *cookie,
|
2004-12-14 16:06:34 +00:00
|
|
|
struct sem_info *info, size_t size);
|
|
|
|
|
extern status_t _kern_set_sem_owner(sem_id id, team_id proc);
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2008-05-06 03:39:36 +00:00
|
|
|
/* POSIX realtime sem syscalls */
|
2008-05-08 01:39:49 +00:00
|
|
|
extern status_t _kern_realtime_sem_open(const char* name,
|
|
|
|
|
int openFlagsOrShared, mode_t mode, uint32 semCount,
|
2008-06-19 00:05:01 +00:00
|
|
|
struct _sem_t* userSem, struct _sem_t** _usedUserSem);
|
2008-05-06 03:39:36 +00:00
|
|
|
extern status_t _kern_realtime_sem_close(sem_id semID,
|
2008-06-19 00:05:01 +00:00
|
|
|
struct _sem_t** _deleteUserSem);
|
2008-05-06 03:39:36 +00:00
|
|
|
extern status_t _kern_realtime_sem_unlink(const char* name);
|
|
|
|
|
|
|
|
|
|
extern status_t _kern_realtime_sem_get_value(sem_id semID, int* value);
|
|
|
|
|
extern status_t _kern_realtime_sem_post(sem_id semID);
|
2022-02-16 20:29:11 +01:00
|
|
|
extern status_t _kern_realtime_sem_wait(sem_id semID, uint32 flags,
|
|
|
|
|
bigtime_t timeout);
|
2008-05-06 03:39:36 +00:00
|
|
|
|
2008-07-29 12:03:41 +00:00
|
|
|
/* POSIX XSI semaphore syscalls */
|
|
|
|
|
extern int _kern_xsi_semget(key_t key, int numSems, int flags);
|
|
|
|
|
extern int _kern_xsi_semctl(int semID, int semNumber, int command,
|
|
|
|
|
union semun* args);
|
|
|
|
|
extern status_t _kern_xsi_semop(int semID, struct sembuf *semOps,
|
|
|
|
|
size_t numSemOps);
|
2004-03-03 00:52:47 +00:00
|
|
|
|
2008-09-11 15:03:01 +00:00
|
|
|
/* POSIX XSI message queue syscalls */
|
|
|
|
|
extern int _kern_xsi_msgctl(int messageQueueID, int command,
|
|
|
|
|
struct msqid_ds *buffer);
|
|
|
|
|
extern int _kern_xsi_msgget(key_t key, int messageQueueFlags);
|
|
|
|
|
extern ssize_t _kern_xsi_msgrcv(int messageQueueID, void *messagePointer,
|
|
|
|
|
size_t messageSize, long messageType, int messageFlags);
|
|
|
|
|
extern int _kern_xsi_msgsnd(int messageQueueID,
|
|
|
|
|
const void *messagePointer, size_t messageSize,
|
|
|
|
|
int messageFlags);
|
|
|
|
|
|
2008-07-29 12:03:41 +00:00
|
|
|
/* team & thread syscalls */
|
2008-06-24 03:37:07 +00:00
|
|
|
extern thread_id _kern_load_image(const char* const* flatArgs,
|
|
|
|
|
size_t flatArgsSize, int32 argCount, int32 envCount,
|
|
|
|
|
int32 priority, uint32 flags, port_id errorPort,
|
|
|
|
|
uint32 errorToken);
|
2009-11-26 16:59:46 +00:00
|
|
|
extern void __NO_RETURN _kern_exit_team(status_t returnValue);
|
2004-03-03 00:52:47 +00:00
|
|
|
extern status_t _kern_kill_team(team_id team);
|
|
|
|
|
extern team_id _kern_get_current_team();
|
2004-08-28 20:29:35 +00:00
|
|
|
extern status_t _kern_wait_for_team(team_id team, status_t *_returnCode);
|
2011-06-12 00:00:23 +00:00
|
|
|
extern pid_t _kern_wait_for_child(thread_id child, uint32 flags,
|
2017-10-10 17:20:46 +02:00
|
|
|
siginfo_t* info, team_usage_info* usageInfo);
|
2008-06-24 03:37:07 +00:00
|
|
|
extern status_t _kern_exec(const char *path, const char* const* flatArgs,
|
2011-01-02 19:12:19 +00:00
|
|
|
size_t flatArgsSize, int32 argCount, int32 envCount,
|
|
|
|
|
mode_t umask);
|
2004-09-15 15:42:02 +00:00
|
|
|
extern thread_id _kern_fork(void);
|
2004-10-14 14:31:31 +00:00
|
|
|
extern pid_t _kern_process_info(pid_t process, int32 which);
|
|
|
|
|
extern pid_t _kern_setpgid(pid_t process, pid_t group);
|
|
|
|
|
extern pid_t _kern_setsid(void);
|
2008-03-30 05:59:54 +00:00
|
|
|
extern status_t _kern_change_root(const char *path);
|
2004-08-28 20:29:35 +00:00
|
|
|
|
2008-05-09 01:32:36 +00:00
|
|
|
extern thread_id _kern_spawn_thread(
|
|
|
|
|
struct thread_creation_attributes* attributes);
|
2004-03-03 00:52:47 +00:00
|
|
|
extern thread_id _kern_find_thread(const char *name);
|
|
|
|
|
extern status_t _kern_suspend_thread(thread_id thread);
|
|
|
|
|
extern status_t _kern_resume_thread(thread_id thread);
|
2004-05-24 12:12:58 +00:00
|
|
|
extern status_t _kern_rename_thread(thread_id thread, const char *newName);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_set_thread_priority(thread_id thread,
|
|
|
|
|
int32 newPriority);
|
2004-03-03 00:52:47 +00:00
|
|
|
extern status_t _kern_kill_thread(thread_id thread);
|
|
|
|
|
extern void _kern_exit_thread(status_t returnValue);
|
2011-06-12 00:00:23 +00:00
|
|
|
extern status_t _kern_cancel_thread(thread_id threadID,
|
|
|
|
|
void (*cancelFunction)(int));
|
2006-01-31 02:29:02 +00:00
|
|
|
extern void _kern_thread_yield(void);
|
2022-03-11 23:49:53 +00:00
|
|
|
extern status_t _kern_wait_for_thread_etc(thread_id thread, uint32 flags,
|
|
|
|
|
bigtime_t timeout, status_t *_returnCode);
|
2004-03-03 00:52:47 +00:00
|
|
|
extern bool _kern_has_data(thread_id thread);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_send_data(thread_id thread, int32 code,
|
|
|
|
|
const void *buffer, size_t bufferSize);
|
|
|
|
|
extern int32 _kern_receive_data(thread_id *_sender, void *buffer,
|
|
|
|
|
size_t bufferSize);
|
2011-06-12 00:00:23 +00:00
|
|
|
extern int64 _kern_restore_signal_frame(
|
|
|
|
|
struct signal_frame_data* signalFrameData);
|
2004-03-03 00:52:47 +00:00
|
|
|
|
|
|
|
|
extern status_t _kern_get_thread_info(thread_id id, thread_info *info);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_get_next_thread_info(team_id team, int32 *cookie,
|
|
|
|
|
thread_info *info);
|
2023-05-16 11:34:47 +10:00
|
|
|
extern status_t _kern_get_team_info(team_id id, team_info *info,
|
|
|
|
|
size_t size);
|
|
|
|
|
extern status_t _kern_get_next_team_info(int32 *cookie, team_info *info,
|
|
|
|
|
size_t size);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_get_team_usage_info(team_id team, int32 who,
|
|
|
|
|
team_usage_info *info, size_t size);
|
2010-11-16 19:42:08 +00:00
|
|
|
extern status_t _kern_get_extended_team_info(team_id teamID, uint32 flags,
|
|
|
|
|
void* buffer, size_t size, size_t* _sizeNeeded);
|
2023-08-21 11:26:11 +02:00
|
|
|
extern int _kern_get_cpu();
|
2024-05-22 18:05:09 +02:00
|
|
|
extern status_t _kern_get_thread_affinity(thread_id id, void* userMask, size_t size);
|
|
|
|
|
extern status_t _kern_set_thread_affinity(thread_id id, const void* userMask, size_t size);
|
2002-08-04 02:04:37 +00:00
|
|
|
|
2010-12-16 17:01:23 +00:00
|
|
|
extern status_t _kern_start_watching_system(int32 object, uint32 flags,
|
2010-12-16 01:49:52 +00:00
|
|
|
port_id port, int32 token);
|
2010-12-16 17:01:23 +00:00
|
|
|
extern status_t _kern_stop_watching_system(int32 object, uint32 flags,
|
2010-12-16 01:49:52 +00:00
|
|
|
port_id port, int32 token);
|
|
|
|
|
|
2008-05-12 13:53:56 +00:00
|
|
|
extern status_t _kern_block_thread(uint32 flags, bigtime_t timeout);
|
|
|
|
|
extern status_t _kern_unblock_thread(thread_id thread, status_t status);
|
|
|
|
|
extern status_t _kern_unblock_threads(thread_id* threads, uint32 count,
|
|
|
|
|
status_t status);
|
|
|
|
|
|
2010-04-11 20:40:58 +00:00
|
|
|
extern bigtime_t _kern_estimate_max_scheduling_latency(thread_id thread);
|
|
|
|
|
|
2013-11-20 23:32:40 +01:00
|
|
|
extern status_t _kern_set_scheduler_mode(int32 mode);
|
|
|
|
|
extern int32 _kern_get_scheduler_mode(void);
|
2025-04-01 23:19:53 +02:00
|
|
|
extern status_t _kern_get_loadavg(struct loadavg* info, size_t size);
|
2013-11-20 23:32:40 +01:00
|
|
|
|
2008-03-11 17:12:02 +00:00
|
|
|
// user/group functions
|
2025-06-12 13:08:57 +02:00
|
|
|
extern status_t _kern_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
|
|
|
|
|
extern status_t _kern_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
|
|
|
|
|
extern status_t _kern_setresgid(gid_t rgid, gid_t egid, gid_t sgid,
|
2008-03-11 17:12:02 +00:00
|
|
|
bool setAllIfPrivileged);
|
2025-06-12 13:08:57 +02:00
|
|
|
extern status_t _kern_setresuid(uid_t ruid, uid_t euid, uid_t suid,
|
2008-03-11 17:12:02 +00:00
|
|
|
bool setAllIfPrivileged);
|
2008-03-30 00:08:13 +00:00
|
|
|
extern ssize_t _kern_getgroups(int groupCount, gid_t* groupList);
|
|
|
|
|
extern status_t _kern_setgroups(int groupCount, const gid_t* groupList);
|
2008-03-11 17:12:02 +00:00
|
|
|
|
2004-09-01 12:02:26 +00:00
|
|
|
// signal functions
|
2011-06-12 00:00:23 +00:00
|
|
|
extern status_t _kern_send_signal(int32 id, uint32 signal,
|
|
|
|
|
const union sigval* userValue, uint32 flags);
|
|
|
|
|
extern status_t _kern_set_signal_mask(int how, const sigset_t *set,
|
2007-08-16 18:01:47 +00:00
|
|
|
sigset_t *oldSet);
|
|
|
|
|
extern status_t _kern_sigaction(int sig, const struct sigaction *action,
|
|
|
|
|
struct sigaction *oldAction);
|
2011-06-12 00:00:23 +00:00
|
|
|
extern status_t _kern_sigwait(const sigset_t *set, siginfo_t *info,
|
|
|
|
|
uint32 flags, bigtime_t timeout);
|
2007-08-16 18:01:47 +00:00
|
|
|
extern status_t _kern_sigsuspend(const sigset_t *mask);
|
|
|
|
|
extern status_t _kern_sigpending(sigset_t *set);
|
|
|
|
|
extern status_t _kern_set_signal_stack(const stack_t *newStack,
|
|
|
|
|
stack_t *oldStack);
|
2002-10-23 17:31:10 +00:00
|
|
|
|
2003-01-12 16:17:09 +00:00
|
|
|
// image functions
|
2016-04-27 01:56:42 +02:00
|
|
|
extern image_id _kern_register_image(extended_image_info *info,
|
|
|
|
|
size_t size);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_unregister_image(image_id id);
|
2005-03-12 14:58:39 +00:00
|
|
|
extern void _kern_image_relocated(image_id id);
|
|
|
|
|
extern void _kern_loading_app_failed(status_t error);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_get_image_info(image_id id, image_info *info,
|
|
|
|
|
size_t size);
|
|
|
|
|
extern status_t _kern_get_next_image_info(team_id team, int32 *cookie,
|
|
|
|
|
image_info *info, size_t size);
|
2008-09-22 11:13:38 +00:00
|
|
|
extern status_t _kern_read_kernel_image_symbols(image_id id,
|
2012-08-07 20:20:42 +01:00
|
|
|
elf_sym* symbolTable, int32* _symbolCount,
|
2008-09-22 11:13:38 +00:00
|
|
|
char* stringTable, size_t* _stringTableSize,
|
|
|
|
|
addr_t* _imageDelta);
|
2004-07-02 01:51:56 +00:00
|
|
|
|
|
|
|
|
// VFS functions
|
2005-10-17 14:01:04 +00:00
|
|
|
extern dev_t _kern_mount(const char *path, const char *device,
|
2009-06-19 08:23:11 +00:00
|
|
|
const char *fs_name, uint32 flags, const char *args,
|
|
|
|
|
size_t argsLength);
|
2004-11-29 22:42:01 +00:00
|
|
|
extern status_t _kern_unmount(const char *path, uint32 flags);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_read_fs_info(dev_t device, struct fs_info *info);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_write_fs_info(dev_t device, const struct fs_info *info,
|
|
|
|
|
int mask);
|
2004-07-07 16:07:25 +00:00
|
|
|
extern dev_t _kern_next_device(int32 *_cookie);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_sync(void);
|
2004-08-28 20:29:35 +00:00
|
|
|
extern status_t _kern_entry_ref_to_path(dev_t device, ino_t inode,
|
|
|
|
|
const char *leaf, char *userPath, size_t pathLength);
|
2008-02-08 03:06:14 +00:00
|
|
|
extern status_t _kern_normalize_path(const char* userPath,
|
|
|
|
|
bool traverseLink, char* buffer);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern int _kern_open_entry_ref(dev_t device, ino_t inode,
|
|
|
|
|
const char *name, int openMode, int perms);
|
|
|
|
|
extern int _kern_open(int fd, const char *path, int openMode,
|
|
|
|
|
int perms);
|
|
|
|
|
extern int _kern_open_dir_entry_ref(dev_t device, ino_t inode,
|
|
|
|
|
const char *name);
|
2004-08-28 20:29:35 +00:00
|
|
|
extern int _kern_open_dir(int fd, const char *path);
|
|
|
|
|
extern int _kern_open_parent_dir(int fd, char *name,
|
|
|
|
|
size_t nameLength);
|
2012-07-21 14:33:27 +01:00
|
|
|
extern status_t _kern_fcntl(int fd, int op, size_t argument);
|
2024-10-25 18:29:32 +02:00
|
|
|
extern status_t _kern_fsync(int fd, bool dataOnly);
|
2008-02-03 15:37:31 +00:00
|
|
|
extern status_t _kern_flock(int fd, int op);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern off_t _kern_seek(int fd, off_t pos, int seekType);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_create_dir_entry_ref(dev_t device, ino_t inode,
|
|
|
|
|
const char *name, int perms);
|
2004-08-28 20:29:35 +00:00
|
|
|
extern status_t _kern_create_dir(int fd, const char *path, int perms);
|
2006-01-25 11:12:21 +00:00
|
|
|
extern status_t _kern_remove_dir(int fd, const char *path);
|
2005-04-06 16:07:10 +00:00
|
|
|
extern status_t _kern_read_link(int fd, const char *path, char *buffer,
|
|
|
|
|
size_t *_bufferSize);
|
2004-08-28 20:29:35 +00:00
|
|
|
extern status_t _kern_create_symlink(int fd, const char *path,
|
|
|
|
|
const char *toPath, int mode);
|
2009-11-26 16:30:16 +00:00
|
|
|
extern status_t _kern_create_link(int pathFD, const char *path, int toFD,
|
|
|
|
|
const char *toPath, bool traverseLeafLink);
|
2004-08-28 20:29:35 +00:00
|
|
|
extern status_t _kern_unlink(int fd, const char *path);
|
|
|
|
|
extern status_t _kern_rename(int oldDir, const char *oldpath, int newDir,
|
|
|
|
|
const char *newpath);
|
2009-11-26 16:17:17 +00:00
|
|
|
extern status_t _kern_create_fifo(int fd, const char *path, mode_t perms);
|
2024-10-30 15:15:52 +01:00
|
|
|
extern status_t _kern_create_pipe(int *fds, int flags);
|
2009-11-26 16:17:17 +00:00
|
|
|
extern status_t _kern_access(int fd, const char *path, int mode,
|
|
|
|
|
bool effectiveUserGroup);
|
2005-11-07 16:07:25 +00:00
|
|
|
extern ssize_t _kern_select(int numfds, struct fd_set *readSet,
|
|
|
|
|
struct fd_set *writeSet, struct fd_set *errorSet,
|
2004-07-02 01:51:56 +00:00
|
|
|
bigtime_t timeout, const sigset_t *sigMask);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern ssize_t _kern_poll(struct pollfd *fds, int numFDs,
|
2021-06-18 20:01:13 +02:00
|
|
|
bigtime_t timeout, const sigset_t *sigMask);
|
2009-07-29 00:34:44 +00:00
|
|
|
|
2011-08-10 21:08:00 +00:00
|
|
|
extern int _kern_open_attr_dir(int fd, const char *path,
|
|
|
|
|
bool traverseLeafLink);
|
2009-07-29 00:34:44 +00:00
|
|
|
extern ssize_t _kern_read_attr(int fd, const char *attribute, off_t pos,
|
|
|
|
|
void *buffer, size_t readBytes);
|
|
|
|
|
extern ssize_t _kern_write_attr(int fd, const char *attribute, uint32 type,
|
|
|
|
|
off_t pos, const void *buffer, size_t readBytes);
|
|
|
|
|
extern status_t _kern_stat_attr(int fd, const char *attribute,
|
|
|
|
|
struct attr_info *attrInfo);
|
|
|
|
|
extern int _kern_open_attr(int fd, const char* path, const char *name,
|
|
|
|
|
uint32 type, int openMode);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_remove_attr(int fd, const char *name);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_rename_attr(int fromFile, const char *fromName,
|
|
|
|
|
int toFile, const char *toName);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern int _kern_open_index_dir(dev_t device);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_create_index(dev_t device, const char *name,
|
|
|
|
|
uint32 type, uint32 flags);
|
|
|
|
|
extern status_t _kern_read_index_stat(dev_t device, const char *name,
|
|
|
|
|
struct stat *stat);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_remove_index(dev_t device, const char *name);
|
|
|
|
|
extern status_t _kern_getcwd(char *buffer, size_t size);
|
|
|
|
|
extern status_t _kern_setcwd(int fd, const char *path);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern int _kern_open_query(dev_t device, const char *query,
|
|
|
|
|
size_t queryLength, uint32 flags, port_id port,
|
|
|
|
|
int32 token);
|
2004-07-02 01:51:56 +00:00
|
|
|
|
|
|
|
|
// file descriptor functions
|
2009-06-19 08:23:11 +00:00
|
|
|
extern ssize_t _kern_read(int fd, off_t pos, void *buffer,
|
|
|
|
|
size_t bufferSize);
|
|
|
|
|
extern ssize_t _kern_readv(int fd, off_t pos, const struct iovec *vecs,
|
|
|
|
|
size_t count);
|
|
|
|
|
extern ssize_t _kern_write(int fd, off_t pos, const void *buffer,
|
|
|
|
|
size_t bufferSize);
|
2005-11-07 16:07:25 +00:00
|
|
|
extern ssize_t _kern_writev(int fd, off_t pos, const struct iovec *vecs,
|
|
|
|
|
size_t count);
|
2010-05-24 21:04:22 +00:00
|
|
|
extern status_t _kern_ioctl(int fd, uint32 cmd, void *data, size_t length);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern ssize_t _kern_read_dir(int fd, struct dirent *buffer,
|
|
|
|
|
size_t bufferSize, uint32 maxCount);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_rewind_dir(int fd);
|
2004-08-28 20:29:35 +00:00
|
|
|
extern status_t _kern_read_stat(int fd, const char *path, bool traverseLink,
|
|
|
|
|
struct stat *stat, size_t statSize);
|
|
|
|
|
extern status_t _kern_write_stat(int fd, const char *path,
|
|
|
|
|
bool traverseLink, const struct stat *stat,
|
|
|
|
|
size_t statSize, int statMask);
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_close(int fd);
|
|
|
|
|
extern int _kern_dup(int fd);
|
2024-10-30 15:38:41 +01:00
|
|
|
extern int _kern_dup2(int ofd, int nfd, int flags);
|
2004-08-28 20:29:35 +00:00
|
|
|
extern status_t _kern_lock_node(int fd);
|
|
|
|
|
extern status_t _kern_unlock_node(int fd);
|
2006-01-17 01:29:18 +00:00
|
|
|
extern status_t _kern_get_next_fd_info(team_id team, uint32 *_cookie,
|
|
|
|
|
struct fd_info *info, size_t infoSize);
|
2020-11-05 20:16:42 +01:00
|
|
|
extern status_t _kern_preallocate(int fd, off_t offset, off_t length);
|
2025-06-08 14:13:27 +02:00
|
|
|
extern status_t _kern_close_range(u_int minFd, u_int maxFd, int flags);
|
2003-01-12 16:17:09 +00:00
|
|
|
|
2008-04-11 04:12:23 +00:00
|
|
|
// socket functions
|
|
|
|
|
extern int _kern_socket(int family, int type, int protocol);
|
|
|
|
|
extern status_t _kern_bind(int socket, const struct sockaddr *address,
|
|
|
|
|
socklen_t addressLength);
|
|
|
|
|
extern status_t _kern_shutdown_socket(int socket, int how);
|
|
|
|
|
extern status_t _kern_connect(int socket, const struct sockaddr *address,
|
|
|
|
|
socklen_t addressLength);
|
|
|
|
|
extern status_t _kern_listen(int socket, int backlog);
|
|
|
|
|
extern int _kern_accept(int socket, struct sockaddr *address,
|
2024-10-30 16:25:28 +01:00
|
|
|
socklen_t *_addressLength, int flags);
|
2008-04-11 04:12:23 +00:00
|
|
|
extern ssize_t _kern_recv(int socket, void *data, size_t length,
|
|
|
|
|
int flags);
|
|
|
|
|
extern ssize_t _kern_recvfrom(int socket, void *data, size_t length,
|
|
|
|
|
int flags, struct sockaddr *address,
|
|
|
|
|
socklen_t *_addressLength);
|
|
|
|
|
extern ssize_t _kern_recvmsg(int socket, struct msghdr *message,
|
|
|
|
|
int flags);
|
|
|
|
|
extern ssize_t _kern_send(int socket, const void *data, size_t length,
|
|
|
|
|
int flags);
|
|
|
|
|
extern ssize_t _kern_sendto(int socket, const void *data, size_t length,
|
|
|
|
|
int flags, const struct sockaddr *address,
|
|
|
|
|
socklen_t addressLength);
|
|
|
|
|
extern ssize_t _kern_sendmsg(int socket, const struct msghdr *message,
|
|
|
|
|
int flags);
|
|
|
|
|
extern status_t _kern_getsockopt(int socket, int level, int option,
|
|
|
|
|
void *value, socklen_t *_length);
|
|
|
|
|
extern status_t _kern_setsockopt(int socket, int level, int option,
|
|
|
|
|
const void *value, socklen_t length);
|
|
|
|
|
extern status_t _kern_getpeername(int socket, struct sockaddr *address,
|
|
|
|
|
socklen_t *_addressLength);
|
|
|
|
|
extern status_t _kern_getsockname(int socket, struct sockaddr *address,
|
|
|
|
|
socklen_t *_addressLength);
|
|
|
|
|
extern int _kern_sockatmark(int socket);
|
|
|
|
|
extern status_t _kern_socketpair(int family, int type, int protocol,
|
|
|
|
|
int *socketVector);
|
|
|
|
|
extern status_t _kern_get_next_socket_stat(int family, uint32 *cookie,
|
|
|
|
|
struct net_stat *stat);
|
|
|
|
|
|
2003-01-18 14:04:22 +00:00
|
|
|
// node monitor functions
|
2004-07-02 01:51:56 +00:00
|
|
|
extern status_t _kern_stop_notifying(port_id port, uint32 token);
|
|
|
|
|
extern status_t _kern_start_watching(dev_t device, ino_t node, uint32 flags,
|
|
|
|
|
port_id port, uint32 token);
|
2007-08-01 14:48:44 +00:00
|
|
|
extern status_t _kern_stop_watching(dev_t device, ino_t node, port_id port,
|
|
|
|
|
uint32 token);
|
2003-01-18 14:04:22 +00:00
|
|
|
|
2003-10-28 13:30:10 +00:00
|
|
|
// time functions
|
2011-06-12 00:00:23 +00:00
|
|
|
extern status_t _kern_set_real_time_clock(bigtime_t time);
|
2010-08-16 22:01:28 +00:00
|
|
|
extern status_t _kern_set_timezone(int32 timezoneOffset, const char *name,
|
|
|
|
|
size_t nameLength);
|
|
|
|
|
extern status_t _kern_get_timezone(int32 *_timezoneOffset, char *name,
|
|
|
|
|
size_t nameLength);
|
2010-08-03 17:47:26 +00:00
|
|
|
extern status_t _kern_set_real_time_clock_is_gmt(bool isGMT);
|
|
|
|
|
extern status_t _kern_get_real_time_clock_is_gmt(bool *_isGMT);
|
2003-10-28 13:30:10 +00:00
|
|
|
|
2011-06-12 00:00:23 +00:00
|
|
|
extern status_t _kern_get_clock(clockid_t clockID, bigtime_t* _time);
|
|
|
|
|
extern status_t _kern_set_clock(clockid_t clockID, bigtime_t time);
|
2024-12-13 17:15:55 +01:00
|
|
|
extern status_t _kern_get_cpuclockid(thread_id id, int32 which, clockid_t* _clockID);
|
2011-06-12 00:00:23 +00:00
|
|
|
|
2004-11-25 17:57:37 +00:00
|
|
|
extern bigtime_t _kern_system_time();
|
2011-06-12 00:00:23 +00:00
|
|
|
extern status_t _kern_snooze_etc(bigtime_t time, int timebase, int32 flags,
|
|
|
|
|
bigtime_t* _remainingTime);
|
|
|
|
|
|
|
|
|
|
extern int32 _kern_create_timer(clockid_t clockID, thread_id threadID,
|
|
|
|
|
uint32 flags, const struct sigevent* event,
|
|
|
|
|
const struct thread_creation_attributes*
|
|
|
|
|
threadAttributes);
|
|
|
|
|
extern status_t _kern_delete_timer(int32 timerID, thread_id threadID);
|
|
|
|
|
extern status_t _kern_get_timer(int32 timerID, thread_id threadID,
|
|
|
|
|
struct user_timer_info* info);
|
|
|
|
|
extern status_t _kern_set_timer(int32 timerID, thread_id threadID,
|
|
|
|
|
bigtime_t startTime, bigtime_t interval, uint32 flags,
|
|
|
|
|
struct user_timer_info* oldInfo);
|
2004-11-25 17:57:37 +00:00
|
|
|
|
2003-01-12 16:17:09 +00:00
|
|
|
// area functions
|
2009-06-19 08:23:11 +00:00
|
|
|
extern area_id _kern_create_area(const char *name, void **address,
|
|
|
|
|
uint32 addressSpec, size_t size, uint32 lock,
|
|
|
|
|
uint32 protection);
|
2004-12-14 15:46:53 +00:00
|
|
|
extern status_t _kern_delete_area(area_id area);
|
|
|
|
|
extern area_id _kern_area_for(void *address);
|
|
|
|
|
extern area_id _kern_find_area(const char *name);
|
|
|
|
|
extern status_t _kern_get_area_info(area_id area, area_info *info);
|
2012-07-29 09:31:14 +01:00
|
|
|
extern status_t _kern_get_next_area_info(team_id team, ssize_t *cookie,
|
2009-06-19 08:23:11 +00:00
|
|
|
area_info *info);
|
2004-12-14 15:46:53 +00:00
|
|
|
extern status_t _kern_resize_area(area_id area, size_t newSize);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern area_id _kern_transfer_area(area_id area, void **_address,
|
|
|
|
|
uint32 addressSpec, team_id target);
|
|
|
|
|
extern status_t _kern_set_area_protection(area_id area,
|
|
|
|
|
uint32 newProtection);
|
|
|
|
|
extern area_id _kern_clone_area(const char *name, void **_address,
|
|
|
|
|
uint32 addressSpec, uint32 protection,
|
|
|
|
|
area_id sourceArea);
|
2009-06-19 11:09:21 +00:00
|
|
|
extern status_t _kern_reserve_address_range(addr_t* _address,
|
2009-06-19 08:23:11 +00:00
|
|
|
uint32 addressSpec, addr_t size);
|
2009-06-19 11:09:21 +00:00
|
|
|
extern status_t _kern_unreserve_address_range(addr_t address, addr_t size);
|
2004-12-14 15:46:53 +00:00
|
|
|
|
2008-04-13 22:52:11 +00:00
|
|
|
extern area_id _kern_map_file(const char *name, void **address,
|
2010-05-01 19:47:39 +00:00
|
|
|
uint32 addressSpec, size_t size, uint32 protection,
|
|
|
|
|
uint32 mapping, bool unmapAddressRange, int fd,
|
2009-06-19 08:23:11 +00:00
|
|
|
off_t offset);
|
2008-08-08 01:00:06 +00:00
|
|
|
extern status_t _kern_unmap_memory(void *address, size_t size);
|
|
|
|
|
extern status_t _kern_set_memory_protection(void *address, size_t size,
|
2010-05-01 19:47:39 +00:00
|
|
|
uint32 protection);
|
2008-08-08 01:00:06 +00:00
|
|
|
extern status_t _kern_sync_memory(void *address, size_t size, int flags);
|
|
|
|
|
extern status_t _kern_memory_advice(void *address, size_t size,
|
2010-05-01 19:47:39 +00:00
|
|
|
uint32 advice);
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2011-08-10 21:08:00 +00:00
|
|
|
extern status_t _kern_get_memory_properties(team_id teamID,
|
|
|
|
|
const void *address, uint32* _protected, uint32* _lock);
|
2011-06-12 20:17:14 +00:00
|
|
|
|
2019-12-14 19:24:38 +08:00
|
|
|
extern status_t _kern_mlock(const void* address, size_t size);
|
|
|
|
|
extern status_t _kern_munlock(const void* address, size_t size);
|
|
|
|
|
|
2002-07-09 12:24:59 +00:00
|
|
|
/* kernel port functions */
|
2004-12-14 15:46:53 +00:00
|
|
|
extern port_id _kern_create_port(int32 queue_length, const char *name);
|
|
|
|
|
extern status_t _kern_close_port(port_id id);
|
|
|
|
|
extern status_t _kern_delete_port(port_id id);
|
|
|
|
|
extern port_id _kern_find_port(const char *port_name);
|
|
|
|
|
extern status_t _kern_get_port_info(port_id id, struct port_info *info);
|
2015-04-10 14:57:04 +02:00
|
|
|
extern status_t _kern_get_next_port_info(team_id team, int32 *cookie,
|
2009-06-19 08:23:11 +00:00
|
|
|
struct port_info *info);
|
|
|
|
|
extern ssize_t _kern_port_buffer_size_etc(port_id port, uint32 flags,
|
|
|
|
|
bigtime_t timeout);
|
2004-12-14 15:46:53 +00:00
|
|
|
extern int32 _kern_port_count(port_id port);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern ssize_t _kern_read_port_etc(port_id port, int32 *msgCode,
|
|
|
|
|
void *msgBuffer, size_t bufferSize, uint32 flags,
|
|
|
|
|
bigtime_t timeout);
|
2004-12-14 15:46:53 +00:00
|
|
|
extern status_t _kern_set_port_owner(port_id port, team_id team);
|
2009-06-19 08:23:11 +00:00
|
|
|
extern status_t _kern_write_port_etc(port_id port, int32 msgCode,
|
|
|
|
|
const void *msgBuffer, size_t bufferSize, uint32 flags,
|
|
|
|
|
bigtime_t timeout);
|
2005-11-07 16:07:25 +00:00
|
|
|
extern status_t _kern_writev_port_etc(port_id id, int32 msgCode,
|
|
|
|
|
const struct iovec *msgVecs, size_t vecCount,
|
|
|
|
|
size_t bufferSize, uint32 flags, bigtime_t timeout);
|
2008-04-17 17:46:02 +00:00
|
|
|
extern status_t _kern_get_port_message_info_etc(port_id port,
|
|
|
|
|
port_message_info *info, size_t infoSize, uint32 flags,
|
|
|
|
|
bigtime_t timeout);
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2005-02-10 02:55:02 +00:00
|
|
|
// debug support functions
|
2009-07-30 12:35:42 +00:00
|
|
|
extern status_t _kern_kernel_debugger(const char *message);
|
2015-04-21 18:49:37 +02:00
|
|
|
extern void _kern_register_syslog_daemon(port_id port);
|
2005-02-10 02:55:02 +00:00
|
|
|
extern void _kern_debugger(const char *message);
|
|
|
|
|
extern int _kern_disable_debugger(int state);
|
|
|
|
|
|
|
|
|
|
extern status_t _kern_install_default_debugger(port_id debuggerPort);
|
|
|
|
|
extern port_id _kern_install_team_debugger(team_id team,
|
|
|
|
|
port_id debuggerPort);
|
|
|
|
|
extern status_t _kern_remove_team_debugger(team_id team);
|
|
|
|
|
extern status_t _kern_debug_thread(thread_id thread);
|
2005-03-09 22:46:31 +00:00
|
|
|
extern void _kern_wait_for_debugger(void);
|
2005-02-10 02:55:02 +00:00
|
|
|
|
2007-03-20 16:20:13 +00:00
|
|
|
extern status_t _kern_set_debugger_breakpoint(void *address, uint32 type,
|
|
|
|
|
int32 length, bool watchpoint);
|
|
|
|
|
extern status_t _kern_clear_debugger_breakpoint(void *address,
|
|
|
|
|
bool watchpoint);
|
2005-02-10 02:55:02 +00:00
|
|
|
|
2009-04-18 17:35:28 +00:00
|
|
|
extern status_t _kern_system_profiler_start(
|
|
|
|
|
struct system_profiler_parameters* parameters);
|
2009-04-23 13:47:52 +00:00
|
|
|
extern status_t _kern_system_profiler_next_buffer(size_t bytesRead,
|
|
|
|
|
uint64* _droppedEvents);
|
2009-04-11 22:20:51 +00:00
|
|
|
extern status_t _kern_system_profiler_stop();
|
2009-07-17 16:21:06 +00:00
|
|
|
extern status_t _kern_system_profiler_recorded(
|
|
|
|
|
struct system_profiler_parameters* parameters);
|
2009-04-11 22:20:51 +00:00
|
|
|
|
2003-08-21 23:02:00 +00:00
|
|
|
/* atomic_* ops (needed for CPUs that don't support them directly) */
|
2004-08-28 20:29:35 +00:00
|
|
|
#ifdef ATOMIC_FUNCS_ARE_SYSCALLS
|
2014-02-15 11:36:17 +01:00
|
|
|
extern void _kern_atomic_set(int32 *value, int32 newValue);
|
|
|
|
|
extern int32 _kern_atomic_get_and_set(int32 *value, int32 newValue);
|
|
|
|
|
extern int32 _kern_atomic_test_and_set(int32 *value, int32 newValue,
|
2009-06-19 08:23:11 +00:00
|
|
|
int32 testAgainst);
|
2014-02-15 11:36:17 +01:00
|
|
|
extern int32 _kern_atomic_add(int32 *value, int32 addValue);
|
|
|
|
|
extern int32 _kern_atomic_and(int32 *value, int32 andValue);
|
|
|
|
|
extern int32 _kern_atomic_or(int32 *value, int32 orValue);
|
|
|
|
|
extern int32 _kern_atomic_get(int32 *value);
|
2004-08-28 20:29:35 +00:00
|
|
|
#endif // ATOMIC_FUNCS_ARE_SYSCALLS
|
|
|
|
|
|
|
|
|
|
#ifdef ATOMIC64_FUNCS_ARE_SYSCALLS
|
2014-02-15 11:36:17 +01:00
|
|
|
extern void _kern_atomic_set64(int64 *value, int64 newValue);
|
|
|
|
|
extern int64 _kern_atomic_get_and_set64(int64 *value, int64 newValue);
|
|
|
|
|
extern int64 _kern_atomic_test_and_set64(int64 *value, int64 newValue,
|
2009-06-19 08:23:11 +00:00
|
|
|
int64 testAgainst);
|
2014-02-15 11:36:17 +01:00
|
|
|
extern int64 _kern_atomic_add64(int64 *value, int64 addValue);
|
|
|
|
|
extern int64 _kern_atomic_and64(int64 *value, int64 andValue);
|
|
|
|
|
extern int64 _kern_atomic_or64(int64 *value, int64 orValue);
|
|
|
|
|
extern int64 _kern_atomic_get64(int64 *value);
|
2004-08-28 20:29:35 +00:00
|
|
|
#endif // ATOMIC64_FUNCS_ARE_SYSCALLS
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2004-04-21 22:46:35 +00:00
|
|
|
/* System informations */
|
2013-12-16 03:58:43 +01:00
|
|
|
extern status_t _kern_get_system_info(system_info* info);
|
|
|
|
|
extern status_t _kern_get_cpu_info(uint32 firstCPU, uint32 cpuCount,
|
|
|
|
|
cpu_info* info);
|
|
|
|
|
extern status_t _kern_get_cpu_topology_info(
|
|
|
|
|
cpu_topology_node_info* topologyInfos,
|
|
|
|
|
uint32* topologyInfoCount);
|
|
|
|
|
|
2008-09-03 15:10:44 +00:00
|
|
|
extern status_t _kern_analyze_scheduling(bigtime_t from, bigtime_t until,
|
|
|
|
|
void* buffer, size_t size,
|
|
|
|
|
struct scheduling_analysis* analysis);
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2005-05-29 20:23:00 +00:00
|
|
|
/* Debug output */
|
2004-12-14 16:06:34 +00:00
|
|
|
extern void _kern_debug_output(const char *message);
|
2008-01-21 15:10:05 +00:00
|
|
|
extern void _kern_ktrace_output(const char *message);
|
2005-05-29 20:23:00 +00:00
|
|
|
extern status_t _kern_frame_buffer_update(addr_t baseAddress, int32 width,
|
|
|
|
|
int32 height, int32 depth, int32 bytesPerRow);
|
2003-11-13 22:07:36 +00:00
|
|
|
|
2005-01-24 01:22:51 +00:00
|
|
|
/* messaging service */
|
|
|
|
|
extern area_id _kern_register_messaging_service(sem_id lockingSem,
|
|
|
|
|
sem_id counterSem);
|
|
|
|
|
extern status_t _kern_unregister_messaging_service();
|
|
|
|
|
|
2009-06-19 08:23:11 +00:00
|
|
|
extern void _kern_clear_caches(void *address, size_t length,
|
|
|
|
|
uint32 flags);
|
2006-02-01 16:09:05 +00:00
|
|
|
extern bool _kern_cpu_enabled(int32 cpu);
|
|
|
|
|
extern status_t _kern_set_cpu_enabled(int32 cpu, bool enabled);
|
2005-03-17 17:06:56 +00:00
|
|
|
|
2019-03-30 16:54:01 -04:00
|
|
|
#if defined(__i386__) || defined(__x86_64__)
|
2004-12-01 03:54:23 +00:00
|
|
|
// our only x86 only syscall
|
2004-12-14 16:06:34 +00:00
|
|
|
extern status_t _kern_get_cpuid(cpuid_info *info, uint32 eax, uint32 cpu);
|
2004-12-01 03:54:23 +00:00
|
|
|
#endif
|
|
|
|
|
|
2004-10-29 01:27:44 +00:00
|
|
|
|
2004-12-14 17:05:56 +00:00
|
|
|
/* Disk Device Manager syscalls */
|
2004-10-29 01:27:44 +00:00
|
|
|
|
|
|
|
|
// iterating, retrieving device/partition data
|
2008-10-13 21:51:43 +00:00
|
|
|
extern partition_id _kern_get_next_disk_device_id(int32 *cookie,
|
|
|
|
|
size_t *neededSize);
|
|
|
|
|
extern partition_id _kern_find_disk_device(const char *filename,
|
|
|
|
|
size_t *neededSize);
|
|
|
|
|
extern partition_id _kern_find_partition(const char *filename,
|
|
|
|
|
size_t *neededSize);
|
|
|
|
|
extern partition_id _kern_find_file_disk_device(const char *filename,
|
|
|
|
|
size_t *neededSize);
|
2007-11-01 23:36:21 +00:00
|
|
|
extern status_t _kern_get_disk_device_data(partition_id deviceID,
|
|
|
|
|
bool deviceOnly, struct user_disk_device_data *buffer,
|
2004-12-14 17:05:56 +00:00
|
|
|
size_t bufferSize, size_t *neededSize);
|
|
|
|
|
extern partition_id _kern_register_file_device(const char *filename);
|
|
|
|
|
extern status_t _kern_unregister_file_device(partition_id deviceID,
|
|
|
|
|
const char *filename);
|
2004-10-29 01:27:44 +00:00
|
|
|
// Only a valid deviceID or filename need to be passed. The other one
|
|
|
|
|
// is -1/NULL. If both is given only filename is ignored.
|
2008-10-13 21:51:43 +00:00
|
|
|
extern status_t _kern_get_file_disk_device_path(partition_id id,
|
|
|
|
|
char* buffer, size_t bufferSize);
|
2004-10-29 01:27:44 +00:00
|
|
|
|
|
|
|
|
// disk systems
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_get_disk_system_info(disk_system_id id,
|
2005-11-07 16:07:25 +00:00
|
|
|
struct user_disk_system_info *info);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_get_next_disk_system_info(int32 *cookie,
|
2005-11-07 16:07:25 +00:00
|
|
|
struct user_disk_system_info *info);
|
|
|
|
|
extern status_t _kern_find_disk_system(const char *name,
|
|
|
|
|
struct user_disk_system_info *info);
|
2004-10-29 01:27:44 +00:00
|
|
|
|
|
|
|
|
// disk device modification
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_defragment_partition(partition_id partitionID,
|
2007-10-31 21:16:22 +00:00
|
|
|
int32* changeCounter);
|
|
|
|
|
extern status_t _kern_repair_partition(partition_id partitionID,
|
|
|
|
|
int32* changeCounter, bool checkOnly);
|
|
|
|
|
extern status_t _kern_resize_partition(partition_id partitionID,
|
|
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
|
int32* childChangeCounter, off_t size,
|
|
|
|
|
off_t contentSize);
|
|
|
|
|
extern status_t _kern_move_partition(partition_id partitionID,
|
|
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
|
int32* childChangeCounter, off_t newOffset,
|
|
|
|
|
partition_id* descendantIDs,
|
|
|
|
|
int32* descendantChangeCounters, int32 descendantCount);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_set_partition_name(partition_id partitionID,
|
2007-10-31 21:16:22 +00:00
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
|
int32* childChangeCounter, const char* name);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_set_partition_content_name(partition_id partitionID,
|
2007-10-31 21:16:22 +00:00
|
|
|
int32* changeCounter, const char* name);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_set_partition_type(partition_id partitionID,
|
2007-10-31 21:16:22 +00:00
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
|
int32* childChangeCounter, const char* type);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_set_partition_parameters(partition_id partitionID,
|
2007-10-31 21:16:22 +00:00
|
|
|
int32* changeCounter, partition_id childID,
|
2009-07-26 17:27:27 +00:00
|
|
|
int32* childChangeCounter, const char* parameters);
|
2007-10-31 21:16:22 +00:00
|
|
|
extern status_t _kern_set_partition_content_parameters(
|
|
|
|
|
partition_id partitionID, int32* changeCounter,
|
2009-07-26 17:27:27 +00:00
|
|
|
const char* parameters);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_initialize_partition(partition_id partitionID,
|
2007-10-31 21:16:22 +00:00
|
|
|
int32* changeCounter, const char* diskSystemName,
|
2009-07-26 17:27:27 +00:00
|
|
|
const char* name, const char* parameters);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_uninitialize_partition(partition_id partitionID,
|
2016-12-23 18:19:01 +13:00
|
|
|
int32* changeCounter, partition_id parentID,
|
|
|
|
|
int32* parentChangeCounter);
|
2004-12-14 17:05:56 +00:00
|
|
|
extern status_t _kern_create_child_partition(partition_id partitionID,
|
2007-10-31 21:16:22 +00:00
|
|
|
int32* changeCounter, off_t offset, off_t size,
|
|
|
|
|
const char* type, const char* name,
|
2009-07-26 17:27:27 +00:00
|
|
|
const char* parameters, partition_id* childID,
|
|
|
|
|
int32* childChangeCounter);
|
2007-10-31 21:16:22 +00:00
|
|
|
extern status_t _kern_delete_child_partition(partition_id partitionID,
|
|
|
|
|
int32* changeCounter, partition_id childID,
|
|
|
|
|
int32 childChangeCounter);
|
2004-10-29 01:27:44 +00:00
|
|
|
|
2009-03-18 08:55:49 +00:00
|
|
|
// disk change notification
|
|
|
|
|
extern status_t _kern_start_watching_disks(uint32 eventMask, port_id port,
|
|
|
|
|
int32 token);
|
|
|
|
|
extern status_t _kern_stop_watching_disks(port_id port, int32 token);
|
2004-10-29 01:27:44 +00:00
|
|
|
|
|
|
|
|
|
2004-08-28 20:29:35 +00:00
|
|
|
// The end mark for gensyscallinfos.
|
|
|
|
|
#ifdef GEN_SYSCALL_INFOS_PROCESSING
|
|
|
|
|
#pragma syscalls end
|
|
|
|
|
#endif
|
2002-07-09 12:24:59 +00:00
|
|
|
|
2009-11-26 16:59:46 +00:00
|
|
|
#undef __NO_RETURN
|
|
|
|
|
|
2002-07-09 12:24:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-05-14 03:55:16 +00:00
|
|
|
#endif /* _SYSTEM_SYSCALLS_H */
|