Removed some no longer needed files.
Added new libroot_init (same as libc/nulibc_init.c before). Updated the Jamfile for the new architecture. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1384 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f7a056e53c
commit
d98c8e6e59
@ -1,3 +1,11 @@
|
||||
SubDir OBOS_TOP src kernel libroot ;
|
||||
|
||||
KernelObjects libroot.c : -fPIC -DPIC ;
|
||||
KernelObjects
|
||||
<$(SOURCE_GRIST)>libroot_init.c
|
||||
<$(SOURCE_GRIST)>syscalls.S
|
||||
:
|
||||
-fPIC -DPIC
|
||||
;
|
||||
|
||||
SubInclude OBOS_TOP src kernel libroot os ;
|
||||
SubInclude OBOS_TOP src kernel libroot posix ;
|
||||
|
@ -1,250 +0,0 @@
|
||||
#include <OS.h>
|
||||
#include <libroot.h>
|
||||
#include <Errors.h>
|
||||
#include <vm_types.h>
|
||||
#include <syscalls.h>
|
||||
|
||||
// Names don't match, but basic function does. Little work needed on addr_spec.
|
||||
area_id create_area(const char *name, void **start_addr, uint32 addr_spec, size_t size, uint32 lock, uint32 protection)
|
||||
{ return sys_vm_create_anonymous_region(name,start_addr,addr_spec,size,lock,protection); }
|
||||
|
||||
// Not 100% sure about the REGION_PRIVATE_MAP
|
||||
area_id clone_area(const char *name, void **dest_addr, uint32 addr_spec, uint32 protection, area_id source)
|
||||
{ return sys_vm_clone_region(name,dest_addr, addr_spec,source, REGION_PRIVATE_MAP,protection); }
|
||||
|
||||
// TO DO - add a syscall interface
|
||||
area_id find_area(const char *name)
|
||||
{ return sys_find_region_by_name(name);}
|
||||
|
||||
// TO DO
|
||||
area_id area_for(void *addr);
|
||||
|
||||
// This is ok.
|
||||
status_t delete_area(area_id id)
|
||||
{ return sys_vm_delete_region(id);}
|
||||
|
||||
// TO DO
|
||||
status_t resize_area(area_id id, size_t new_size);
|
||||
// TO DO
|
||||
status_t set_area_protection(area_id id, uint32 new_protection);
|
||||
|
||||
// TO DO - convert region_info in VM land to area_info...
|
||||
status_t _get_area_info(area_id id, area_info *ainfo, size_t size)
|
||||
{
|
||||
if (size < sizeof(ainfo))
|
||||
return B_ERROR;
|
||||
else
|
||||
return sys_vm_get_region_info(id, (void *)ainfo);
|
||||
}
|
||||
|
||||
// TO DO
|
||||
status_t _get_next_area_info(team_id team, int32 *cookie, area_info *ainfo, size_t size);
|
||||
|
||||
|
||||
// OK
|
||||
port_id create_port(int32 capacity, const char *name)
|
||||
{ return sys_port_create(capacity,name); }
|
||||
|
||||
// OK
|
||||
port_id find_port(const char *name)
|
||||
{ return sys_port_find(name); }
|
||||
|
||||
// OK
|
||||
status_t write_port(port_id port, int32 code, const void *buf, size_t buf_size)
|
||||
{ return sys_port_write(port, code, buf, buf_size); }
|
||||
|
||||
// OK
|
||||
status_t read_port(port_id port, int32 *code, void *buf, size_t buf_size)
|
||||
{ return sys_port_read(port,code,buf,buf_size); }
|
||||
|
||||
// Alter flags (?)
|
||||
status_t write_port_etc(port_id port, int32 code, const void *buf, size_t buf_size, uint32 flags, bigtime_t timeout)
|
||||
{ return sys_port_write_etc(port,code,buf,buf_size,flags,timeout); }
|
||||
|
||||
// Alter flags (?)
|
||||
status_t read_port_etc(port_id port, int32 *code, void *buf, size_t buf_size, uint32 flags, bigtime_t timeout)
|
||||
{ return sys_port_read_etc(port,code,buf,buf_size,flags,timeout); }
|
||||
|
||||
// OK
|
||||
ssize_t port_buffer_size(port_id port) { return sys_port_buffer_size(port); }
|
||||
|
||||
// Change the flags?
|
||||
ssize_t port_buffer_size_etc(port_id port, uint32 flags, bigtime_t timeout) { return sys_port_buffer_size_etc(port,flags,timeout); }
|
||||
|
||||
// OK
|
||||
ssize_t port_count(port_id port)
|
||||
{ return sys_port_count(port); }
|
||||
|
||||
// OK
|
||||
status_t set_port_owner(port_id port, team_id team)
|
||||
{ return sys_port_set_owner(port, team); }
|
||||
|
||||
// OK
|
||||
status_t close_port(port_id port) { return sys_port_close(port); }
|
||||
|
||||
// OK
|
||||
status_t delete_port(port_id port) { return sys_port_delete(port); }
|
||||
|
||||
// OK - this works and is necessary for bin compatability.
|
||||
status_t _get_next_port_info(team_id team, int32 *cookie, port_info *info, size_t size)
|
||||
{ return sys_port_get_next_port_info(team,cookie,info); }
|
||||
|
||||
// OK
|
||||
//status_t get_next_port_info (team_id team, int32 *cookie, port_info *info )
|
||||
//{ return sys_port_get_next_port_info(team, cookie, info); }
|
||||
|
||||
// OK
|
||||
//status_t get_port_info(port_id port, port_info *info )
|
||||
//{ return sys_port_get_info(port,info); }
|
||||
|
||||
// OK - this works and is necessary for bin compatability.
|
||||
status_t _get_port_info(port_id port, port_info *info, size_t size) { return sys_port_get_info(port,info); }
|
||||
|
||||
// OK
|
||||
sem_id create_sem(int32 count, const char *name)
|
||||
{ return sys_create_sem(count,name); }
|
||||
|
||||
// OK
|
||||
status_t delete_sem(sem_id sem)
|
||||
{ return sys_delete_sem(sem); }
|
||||
|
||||
// OK
|
||||
status_t acquire_sem(sem_id sem)
|
||||
{ return sys_acquire_sem(sem); }
|
||||
|
||||
// Have to modify flags ???
|
||||
status_t acquire_sem_etc(sem_id sem, int32 count, uint32 flags, bigtime_t timeout)
|
||||
{ return sys_acquire_sem_etc(sem, count, flags, timeout); }
|
||||
|
||||
// OK
|
||||
status_t release_sem(sem_id sem)
|
||||
{ return sys_release_sem(sem); }
|
||||
|
||||
// Have to modify flags ???
|
||||
status_t release_sem_etc(sem_id sem, int32 count, uint32 flags)
|
||||
{ return sys_release_sem_etc(sem, count, flags); }
|
||||
|
||||
// OK
|
||||
status_t get_sem_count(sem_id sem, int32 *count)
|
||||
{ return sys_sem_get_count(sem,count); }
|
||||
|
||||
// OK
|
||||
status_t set_sem_owner(sem_id sem, team_id team)
|
||||
{ return sys_set_sem_owner(sem, team); }
|
||||
|
||||
// OK
|
||||
status_t _get_sem_info(sem_id sem, sem_info *info, size_t size)
|
||||
{ return sys_get_sem_info(sem,info, size); }
|
||||
|
||||
// OK
|
||||
status_t _get_next_sem_info(team_id team, int32 *cookie, sem_info *info, size_t size)
|
||||
{ return sys_get_next_sem_info(team,cookie,info, size); }
|
||||
|
||||
// TO DO
|
||||
bigtime_t set_alarm(bigtime_t when, uint32 flags);
|
||||
|
||||
// case SYSCALL_GET_CURRENT_THREAD_ID: *call_ret = thread_get_current_thread_id(); break;
|
||||
// case SYSCALL_THREAD_CREATE_THREAD: *call_ret = user_thread_create_user_thread((char *)arg0, thread_get_current_thread()->team->id, (addr)arg1, (void *)arg2); break;
|
||||
// case SYSCALL_PROC_CREATE_PROC: *call_ret = user_proc_create_proc((const char *)arg0, (const char *)arg1, (char **)arg2, (int )arg3, (int)arg4); break;
|
||||
// case SYSCALL_GET_CURRENT_PROC_ID: *call_ret = proc_get_current_proc_id(); break;
|
||||
// case SYSCALL_PROC_WAIT_ON_PROC: *call_ret = user_proc_wait_on_proc((proc_id)arg0, (int *)arg1); break;
|
||||
|
||||
// OK
|
||||
status_t kill_thread(thread_id thread)
|
||||
{ return sys_kill_thread(thread); }
|
||||
|
||||
// OK
|
||||
status_t resume_thread(thread_id thread)
|
||||
{ return sys_resume_thread(thread); }
|
||||
|
||||
// OK
|
||||
status_t suspend_thread(thread_id thread)
|
||||
{ return sys_suspend_thread(thread); }
|
||||
|
||||
// TO DO
|
||||
status_t rename_thread(thread_id thread, const char *new_name);
|
||||
// TO DO
|
||||
status_t set_thread_priority (thread_id thread, int32 new_priority);
|
||||
|
||||
// TO DO
|
||||
void exit_thread(status_t status)
|
||||
{ /* return sys_exit_thread(thread); */ }
|
||||
|
||||
// OK
|
||||
status_t wait_for_thread (thread_id thread, status_t *thread_return_value)
|
||||
{ return sys_wait_on_thread(thread,thread_return_value); }
|
||||
|
||||
// TO DO
|
||||
status_t on_exit_thread(void (*callback)(void *), void *data);
|
||||
|
||||
// OK
|
||||
status_t _get_thread_info(thread_id thread, thread_info *info, size_t size)
|
||||
{ return sys_get_thread_info(thread, info); }
|
||||
|
||||
// OK
|
||||
status_t _get_next_thread_info(team_id tmid, int32 *cookie, thread_info *info, size_t size)
|
||||
{ return sys_get_next_thread_info(tmid, cookie, info); }
|
||||
|
||||
// TO DO
|
||||
status_t _get_team_usage_info(team_id tmid, int32 who, team_usage_info *ti, size_t size);
|
||||
// TO DO
|
||||
thread_id find_thread(const char *name);
|
||||
|
||||
/*
|
||||
#define get_thread_info(thread, info) _get_thread_info((thread), (info), sizeof(*(info)))
|
||||
#define get_next_thread_info(tmid, cookie, info) _get_next_thread_info((tmid), (cookie), (info), sizeof(*(info)))
|
||||
#define get_team_usage_info(tmid, who, info) _get_team_usage_info((tmid), (who), (info), sizeof(*(info)))
|
||||
*/
|
||||
|
||||
// OK
|
||||
status_t send_data(thread_id thread, int32 code, const void *buf, size_t buffer_size);
|
||||
// OK
|
||||
status_t receive_data(thread_id *sender, void *buf, size_t buffer_size);
|
||||
// OK
|
||||
bool has_data(thread_id thread);
|
||||
// TO DO
|
||||
status_t snooze(bigtime_t microseconds);
|
||||
// TO DO
|
||||
status_t snooze_until(bigtime_t time, int timebase);
|
||||
|
||||
// OK
|
||||
status_t kill_team(team_id team)
|
||||
{ return sys_kill_team(team); }
|
||||
|
||||
// OK
|
||||
status_t _get_team_info(team_id team, team_info *info, size_t size)
|
||||
{ return sys_get_team_info(team, info); }
|
||||
|
||||
// OK
|
||||
status_t _get_next_team_info(int32 *cookie, team_info *info, size_t size)
|
||||
{ return sys_get_next_team_info(cookie, info); }
|
||||
|
||||
/*
|
||||
#define get_team_info(team, info) _get_team_info((team), (info), sizeof(*(info)))
|
||||
#define get_next_team_info(cookie, info) _get_next_team_info((cookie), (info), sizeof(*(info)))
|
||||
*/
|
||||
|
||||
// TO DO
|
||||
status_t get_cpuid(cpuid_info* info, uint32 eax_register, uint32 cpu_num);
|
||||
// TO DO
|
||||
status_t _get_system_info (system_info *returned_info, size_t size);
|
||||
#define get_system_info(info) _get_system_info((info), sizeof(*(info)))
|
||||
|
||||
int32 is_computer_on(void) {return 1;}
|
||||
double is_computer_on_fire(void) {return 0;}
|
||||
|
||||
uint32 real_time_clock (void);
|
||||
// TO DO
|
||||
void set_real_time_clock (int32 secs_since_jan1_1970);
|
||||
// TO DO
|
||||
bigtime_t real_time_clock_usecs (void);
|
||||
// TO DO
|
||||
status_t set_timezone(char *str);
|
||||
// TO DO
|
||||
|
||||
// OK
|
||||
bigtime_t system_time (void) /* time since booting in microseconds */
|
||||
{ return sys_system_time(); }
|
||||
|
||||
void debugger (const char *message);
|
||||
const int disable_debugger(int state);
|
@ -1,77 +0,0 @@
|
||||
#include <libroot_types.h>
|
||||
#ifndef _LIBROOT_H
|
||||
#define _LIBROOT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
"C" {
|
||||
#endif
|
||||
|
||||
area_id create_area(const char *name, void **start_addr, uint32 addr_spec, size_t size, uint32 lock, uint32 protection);
|
||||
area_id clone_area(const char *name, void **dest_addr, uint32 addr_spec, uint32 protection, area_id source);
|
||||
area_id find_area(const char *name);
|
||||
area_id area_for(void *addr);
|
||||
status_t delete_area(area_id id);
|
||||
status_t resize_area(area_id id, size_t new_size);
|
||||
status_t set_area_protection(area_id id, uint32 new_protection);
|
||||
|
||||
status_t _get_area_info(area_id id, area_info *ainfo, size_t size);
|
||||
status_t _get_next_area_info(team_id team, int32 *cookie, area_info *ainfo, size_t size);
|
||||
|
||||
|
||||
port_id create_port(int32 capacity, const char *name);
|
||||
port_id find_port(const char *name);
|
||||
status_t write_port(port_id port, int32 code, const void *buf, size_t buf_size);
|
||||
status_t read_port(port_id port, int32 *code, void *buf, size_t buf_size);
|
||||
status_t write_port_etc(port_id port, int32 code, const void *buf, size_t buf_size, uint32 flags, bigtime_t timeout);
|
||||
status_t read_port_etc(port_id port, int32 *code, void *buf, size_t buf_size, uint32 flags, bigtime_t timeout);
|
||||
ssize_t port_buffer_size(port_id port);
|
||||
ssize_t port_buffer_size_etc(port_id port, uint32 flags, bigtime_t timeout);
|
||||
ssize_t port_count(port_id port);
|
||||
status_t set_port_owner(port_id port, team_id team);
|
||||
status_t close_port(port_id port);
|
||||
status_t delete_port(port_id port);
|
||||
status_t _get_port_info(port_id port, port_info *info, size_t size);
|
||||
status_t _get_next_port_info(team_id team, int32 *cookie, port_info *info, size_t size);
|
||||
|
||||
bigtime_t set_alarm(bigtime_t when, uint32 flags);
|
||||
|
||||
status_t rename_thread(thread_id thread, const char *new_name);
|
||||
status_t set_thread_priority (thread_id thread, int32 new_priority);
|
||||
void exit_thread(status_t status);
|
||||
status_t wait_for_thread (thread_id thread, status_t *thread_return_value);
|
||||
status_t on_exit_thread(void (*callback)(void *), void *data);
|
||||
status_t _get_thread_info(thread_id thread, thread_info *info, size_t size);
|
||||
status_t _get_next_thread_info(team_id tmid, int32 *cookie, thread_info *info, size_t size);
|
||||
status_t _get_team_usage_info(team_id tmid, int32 who, team_usage_info *ti, size_t size);
|
||||
thread_id find_thread(const char *name);
|
||||
|
||||
|
||||
status_t send_data(thread_id thread, int32 code, const void *buf, size_t buffer_size);
|
||||
status_t receive_data(thread_id *sender, void *buf, size_t buffer_size);
|
||||
bool has_data(thread_id thread);
|
||||
status_t snooze(bigtime_t microseconds);
|
||||
status_t snooze_until(bigtime_t time, int timebase);
|
||||
status_t kill_team(team_id team); /* see also: send_signal() */
|
||||
status_t _get_team_info(team_id team, team_info *info, size_t size);
|
||||
status_t _get_next_team_info(int32 *cookie, team_info *info, size_t size);
|
||||
|
||||
status_t get_cpuid(cpuid_info* info, uint32 eax_register, uint32 cpu_num);
|
||||
status_t _get_system_info (system_info *returned_info, size_t size);
|
||||
|
||||
int32 is_computer_on(void);
|
||||
double is_computer_on_fire(void);
|
||||
|
||||
uint32 real_time_clock (void);
|
||||
void set_real_time_clock (int32 secs_since_jan1_1970);
|
||||
bigtime_t real_time_clock_usecs (void);
|
||||
status_t set_timezone(char *str);
|
||||
|
||||
bigtime_t system_time (void); /* time since booting in microseconds */
|
||||
void debugger (const char *message);
|
||||
const int disable_debugger(int state);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ifdef _LIBROOT_H */
|
17
src/kernel/libroot/libroot_init.c
Normal file
17
src/kernel/libroot/libroot_init.c
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
** Copyright 2002, Manuel J. Petit. All rights reserved.
|
||||
** Distributed under the terms of the NewOS License.
|
||||
*/
|
||||
|
||||
#include <user_runtime.h>
|
||||
|
||||
|
||||
extern void __init__dlfcn(struct uspace_prog_args_t const *uspa);
|
||||
|
||||
|
||||
void
|
||||
INIT_BEFORE_CTORS(unsigned imid, struct uspace_prog_args_t const *uspa)
|
||||
{
|
||||
__init__dlfcn(uspa);
|
||||
}
|
||||
|
@ -1,206 +0,0 @@
|
||||
#ifndef _LIBROOT_TYPES_H
|
||||
#define _LIBROOT_TYPES_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <defines.h>
|
||||
|
||||
#define B_NO_LOCK 0
|
||||
#define B_LAZY_LOCK 1
|
||||
#define B_FULL_LOCK 2
|
||||
#define B_CONTIGUOUS 3
|
||||
#define B_LOMEM 4
|
||||
|
||||
#define B_ANY_ADDRESS 0
|
||||
#define B_EXACT_ADDRESS 1
|
||||
#define B_BASE_ADDRESS 2
|
||||
#define B_CLONE_ADDRESS 3
|
||||
#define B_ANY_KERNEL_ADDRESS 4
|
||||
|
||||
#define B_READ_AREA 1
|
||||
#define B_WRITE_AREA 2
|
||||
|
||||
enum {
|
||||
B_ONE_SHOT_ABSOLUTE_ALARM = 1, /* alarm is one-shot and time is specified absolutely */
|
||||
B_ONE_SHOT_RELATIVE_ALARM = 2, /* alarm is one-shot and time is specified relatively */
|
||||
B_PERIODIC_ALARM = 3 /* alarm is periodic and time is the period */
|
||||
};
|
||||
|
||||
#define B_LOW_PRIORITY 5
|
||||
#define B_NORMAL_PRIORITY 10
|
||||
#define B_DISPLAY_PRIORITY 15
|
||||
#define B_URGENT_DISPLAY_PRIORITY 20
|
||||
#define B_REAL_TIME_DISPLAY_PRIORITY 100
|
||||
#define B_URGENT_PRIORITY 110
|
||||
#define B_REAL_TIME_PRIORITY 120
|
||||
|
||||
thread_id spawn_thread (
|
||||
thread_func function_name,
|
||||
const char *thread_name,
|
||||
int32 priority,
|
||||
void *arg
|
||||
);
|
||||
|
||||
#define B_SYSTEM_TIMEBASE (0)
|
||||
#define B_SYSTEM_TEAM 2
|
||||
|
||||
#if __INTEL__
|
||||
#define B_MAX_CPU_COUNT 8
|
||||
#endif
|
||||
|
||||
#if __POWERPC__
|
||||
#define B_MAX_CPU_COUNT 8
|
||||
#endif
|
||||
|
||||
typedef enum cpu_types {
|
||||
B_CPU_PPC_601 = 1,
|
||||
B_CPU_PPC_603 = 2,
|
||||
B_CPU_PPC_603e = 3,
|
||||
B_CPU_PPC_604 = 4,
|
||||
B_CPU_PPC_604e = 5,
|
||||
B_CPU_PPC_750 = 6,
|
||||
B_CPU_PPC_686 = 13,
|
||||
B_CPU_X86,
|
||||
B_CPU_ALPHA,
|
||||
B_CPU_MIPS,
|
||||
B_CPU_HPPA,
|
||||
B_CPU_M68K,
|
||||
B_CPU_ARM,
|
||||
B_CPU_SH,
|
||||
B_CPU_SPARC,
|
||||
// Since these have specific values, AFAIK, they will stay, even unsupported
|
||||
B_CPU_INTEL_X86 = 0x1000,
|
||||
B_CPU_INTEL_PENTIUM = 0x1051,
|
||||
B_CPU_INTEL_PENTIUM75,
|
||||
B_CPU_INTEL_PENTIUM_486_OVERDRIVE,
|
||||
B_CPU_INTEL_PENTIUM_MMX,
|
||||
B_CPU_INTEL_PENTIUM_MMX_MODEL_4 = B_CPU_INTEL_PENTIUM_MMX,
|
||||
B_CPU_INTEL_PENTIUM_MMX_MODEL_8 = 0x1058,
|
||||
B_CPU_INTEL_PENTIUM75_486_OVERDRIVE,
|
||||
B_CPU_INTEL_PENTIUM_PRO = 0x1061,
|
||||
B_CPU_INTEL_PENTIUM_II = 0x1063,
|
||||
B_CPU_INTEL_PENTIUM_II_MODEL_3 = 0x1063,
|
||||
B_CPU_INTEL_PENTIUM_II_MODEL_5 = 0x1065,
|
||||
B_CPU_INTEL_CELERON = 0x1066,
|
||||
B_CPU_INTEL_PENTIUM_III = 0x1067,
|
||||
B_CPU_INTEL_PENTIUM_III_MODEL_8 = 0x1068,
|
||||
|
||||
B_CPU_AMD_X86 = 0x1100,
|
||||
B_CPU_AMD_K5_MODEL0 = 0x1150,
|
||||
B_CPU_AMD_K5_MODEL1,
|
||||
B_CPU_AMD_K5_MODEL2,
|
||||
B_CPU_AMD_K5_MODEL3,
|
||||
|
||||
B_CPU_AMD_K6_MODEL6 = 0x1156,
|
||||
B_CPU_AMD_K6_MODEL7 = 0x1157,
|
||||
|
||||
B_CPU_AMD_K6_MODEL8 = 0x1158,
|
||||
B_CPU_AMD_K6_2 = 0x1158,
|
||||
|
||||
B_CPU_AMD_K6_MODEL9 = 0x1159,
|
||||
B_CPU_AMD_K6_III = 0x1159,
|
||||
|
||||
B_CPU_AMD_ATHLON_MODEL1 = 0x1161,
|
||||
|
||||
B_CPU_CYRIX_X86 = 0x1200,
|
||||
B_CPU_CYRIX_GXm = 0x1254,
|
||||
B_CPU_CYRIX_6x86MX = 0x1260,
|
||||
|
||||
B_CPU_IDT_X86 = 0x1300,
|
||||
B_CPU_IDT_WINCHIP_C6 = 0x1354,
|
||||
B_CPU_IDT_WINCHIP_2 = 0x1358,
|
||||
|
||||
B_CPU_RISE_X86 = 0x1400,
|
||||
B_CPU_RISE_mP6 = 0x1450
|
||||
|
||||
} cpu_type;
|
||||
|
||||
#define B_CPU_X86_VENDOR_MASK 0x1F00
|
||||
|
||||
typedef enum platform_types {
|
||||
B_BEBOX_PLATFORM = 0,
|
||||
B_MAC_PLATFORM,
|
||||
B_AT_CLONE_PLATFORM
|
||||
} platform_type;
|
||||
|
||||
typedef struct {
|
||||
bigtime_t active_time; /* # usec doing useful work since boot */
|
||||
} cpu_info;
|
||||
|
||||
|
||||
typedef int32 machine_id[2]; /* unique machine ID */
|
||||
|
||||
typedef struct {
|
||||
machine_id id; /* unique machine ID */
|
||||
bigtime_t boot_time; /* time of boot (# usec since 1/1/70) */
|
||||
|
||||
int32 cpu_count; /* # of cpus */
|
||||
enum cpu_types cpu_type; /* type of cpu */
|
||||
int32 cpu_revision; /* revision # of cpu */
|
||||
cpu_info cpu_infos[B_MAX_CPU_COUNT]; /* info about individual cpus */
|
||||
int64 cpu_clock_speed; /* processor clock speed (Hz) */
|
||||
int64 bus_clock_speed; /* bus clock speed (Hz) */
|
||||
enum platform_types platform_type; /* type of machine we're on */
|
||||
|
||||
int32 max_pages; /* total # physical pages */
|
||||
int32 used_pages; /* # physical pages in use */
|
||||
int32 page_faults; /* # of page faults */
|
||||
int32 max_sems; /* maximum # semaphores */
|
||||
int32 used_sems; /* # semaphores in use */
|
||||
int32 max_ports; /* maximum # ports */
|
||||
int32 used_ports; /* # ports in use */
|
||||
int32 max_threads; /* maximum # threads */
|
||||
int32 used_threads; /* # threads in use */
|
||||
int32 max_teams; /* maximum # teams */
|
||||
int32 used_teams; /* # teams in use */
|
||||
|
||||
char kernel_name [SYS_MAX_NAME_LEN]; /* name of kernel */
|
||||
char kernel_build_date[B_OS_NAME_LENGTH]; /* date kernel built */
|
||||
char kernel_build_time[B_OS_NAME_LENGTH]; /* time kernel built */
|
||||
int64 kernel_version; /* version of this kernel */
|
||||
|
||||
bigtime_t _busy_wait_time; /* reserved for Be */
|
||||
int32 pad[4]; /* just in case... */
|
||||
} system_info;
|
||||
|
||||
#ifdef __INTEL__
|
||||
typedef union {
|
||||
struct {
|
||||
uint32 max_eax;
|
||||
char vendorid[12];
|
||||
} eax_0;
|
||||
|
||||
struct {
|
||||
uint32 stepping : 4;
|
||||
uint32 model : 4;
|
||||
uint32 family : 4;
|
||||
uint32 type : 2;
|
||||
uint32 reserved_0 : 18;
|
||||
|
||||
uint32 reserved_1;
|
||||
uint32 features;
|
||||
uint32 reserved_2;
|
||||
} eax_1;
|
||||
|
||||
struct {
|
||||
uint8 call_num;
|
||||
uint8 cache_descriptors[15];
|
||||
} eax_2;
|
||||
|
||||
struct {
|
||||
uint32 reserved[2];
|
||||
uint32 serial_number_high;
|
||||
uint32 serial_number_low;
|
||||
} eax_3;
|
||||
|
||||
char as_chars[16];
|
||||
|
||||
struct {
|
||||
uint32 eax;
|
||||
uint32 ebx;
|
||||
uint32 edx;
|
||||
uint32 ecx;
|
||||
} regs;
|
||||
} cpuid_info;
|
||||
#endif
|
||||
|
||||
#endif /* ifdef _LIBROOT_TYPES_ */
|
130
src/kernel/libroot/syscalls.S
Normal file
130
src/kernel/libroot/syscalls.S
Normal file
@ -0,0 +1,130 @@
|
||||
#ifdef ARCH_x86
|
||||
#include "arch/x86/syscalls.inc"
|
||||
#endif
|
||||
#ifdef ARCH_alpha
|
||||
#include "arch/alpha/syscalls.inc"
|
||||
#endif
|
||||
#ifdef ARCH_sh4
|
||||
#include "arch/sh4/syscalls.inc"
|
||||
#endif
|
||||
#ifdef ARCH_sparc
|
||||
#include "arch/sparc/syscalls.inc"
|
||||
#endif
|
||||
#ifdef ARCH_sparc64
|
||||
#include "arch/sparc64/syscalls.inc"
|
||||
#endif
|
||||
#ifdef ARCH_mips
|
||||
#include "arch/mips/syscalls.inc"
|
||||
#endif
|
||||
#ifdef ARCH_ppc
|
||||
#include "arch/ppc/syscalls.inc"
|
||||
#endif
|
||||
#ifdef ARCH_m68k
|
||||
#include "arch/m68k/syscalls.inc"
|
||||
#endif
|
||||
|
||||
/* ToDo: we should do something about this file; either machine generate it */
|
||||
/* or make it more intelligent... it's really boring to maintain this one. */
|
||||
|
||||
SYSCALL0(sys_null, 0)
|
||||
SYSCALL4(sys_mount, 1)
|
||||
SYSCALL1(sys_unmount, 2)
|
||||
SYSCALL0(sys_sync, 3)
|
||||
SYSCALL2(sys_open, 4)
|
||||
SYSCALL5(sys_open_entry_ref, 81)
|
||||
SYSCALL1(sys_close, 5)
|
||||
SYSCALL1(sys_fsync, 6)
|
||||
SYSCALL5(sys_read, 7)
|
||||
SYSCALL5(sys_write, 8)
|
||||
SYSCALL4(sys_seek, 9)
|
||||
SYSCALL1(sys_open_dir, 77)
|
||||
SYSCALL4(sys_open_dir_entry_ref, 82)
|
||||
SYSCALL3(sys_open_dir_node_ref, 83)
|
||||
SYSCALL2(sys_create_dir, 78)
|
||||
SYSCALL5(sys_create_dir_entry_ref, 85)
|
||||
SYSCALL1(sys_remove_dir, 93)
|
||||
SYSCALL3(sys_create_symlink, 86)
|
||||
SYSCALL2(sys_create_link, 92)
|
||||
SYSCALL3(sys_read_link, 87)
|
||||
SYSCALL4(sys_read_dir, 75)
|
||||
SYSCALL1(sys_rewind_dir, 76)
|
||||
SYSCALL4(sys_ioctl, 10)
|
||||
SYSCALL3(sys_create, 11)
|
||||
SYSCALL6(sys_create_entry_ref, 84)
|
||||
SYSCALL1(sys_unlink, 12)
|
||||
SYSCALL2(sys_rename, 13)
|
||||
SYSCALL3(sys_read_stat, 14)
|
||||
SYSCALL5(sys_write_stat, 15)
|
||||
SYSCALL0(sys_system_time, 16)
|
||||
SYSCALL2(sys_snooze, 17)
|
||||
SYSCALL2(sys_create_sem, 18)
|
||||
SYSCALL1(sys_delete_sem, 19)
|
||||
SYSCALL1(sys_acquire_sem, 20)
|
||||
SYSCALL4(sys_acquire_sem_etc, 21)
|
||||
SYSCALL1(sys_release_sem, 22)
|
||||
SYSCALL3(sys_release_sem_etc, 23)
|
||||
|
||||
/* Thread calls */
|
||||
SYSCALL0(sys_get_current_thread_id, 24)
|
||||
SYSCALL4(sys_spawn_thread, 35)
|
||||
SYSCALL1(sys_kill_thread, 36)
|
||||
SYSCALL1(sys_suspend_thread, 37)
|
||||
SYSCALL1(sys_resume_thread, 38)
|
||||
|
||||
SYSCALL4(send_data, 94)
|
||||
SYSCALL3(receive_data, 95)
|
||||
SYSCALL1(has_data, 96)
|
||||
|
||||
SYSCALL1(sys_exit, 25)
|
||||
SYSCALL5(sys_create_team, 26)
|
||||
SYSCALL2(sys_wait_on_thread, 27)
|
||||
SYSCALL2(sys_wait_on_team, 28)
|
||||
SYSCALL6(sys_vm_create_anonymous_region, 29)
|
||||
SYSCALL6(sys_vm_clone_region, 30)
|
||||
SYSCALL9(sys_vm_map_file, 31)
|
||||
SYSCALL1(sys_vm_delete_region, 32)
|
||||
SYSCALL2(sys_vm_get_region_info, 33)
|
||||
SYSCALL1(sys_find_region_by_name, 34)
|
||||
SYSCALL1(sys_kill_team, 39)
|
||||
SYSCALL0(sys_get_current_team_id, 40)
|
||||
SYSCALL2(sys_getcwd, 41)
|
||||
SYSCALL2(sys_setcwd, 42)
|
||||
SYSCALL2(sys_port_create, 43)
|
||||
SYSCALL1(sys_port_close, 44)
|
||||
SYSCALL1(sys_port_delete, 45)
|
||||
SYSCALL1(sys_port_find, 46)
|
||||
SYSCALL2(sys_port_get_info, 47)
|
||||
SYSCALL3(sys_port_get_next_port_info, 48)
|
||||
SYSCALL1(sys_port_buffer_size, 49)
|
||||
SYSCALL4(sys_port_buffer_size_etc, 50)
|
||||
SYSCALL1(sys_port_count, 51)
|
||||
SYSCALL4(sys_port_read, 52)
|
||||
SYSCALL7(sys_port_read_etc, 53)
|
||||
SYSCALL2(sys_port_set_owner, 54)
|
||||
SYSCALL4(sys_port_write, 55)
|
||||
SYSCALL7(sys_port_write_etc, 56)
|
||||
SYSCALL2(sys_sem_get_count, 57)
|
||||
SYSCALL3(sys_get_sem_info, 58)
|
||||
SYSCALL4(sys_get_next_sem_info, 59)
|
||||
SYSCALL2(sys_set_sem_owner, 60)
|
||||
SYSCALL1(sys_dup, 61)
|
||||
SYSCALL2(sys_dup2, 62)
|
||||
//SYSCALL2(sys_team_get_table, 63)
|
||||
SYSCALL2(sys_getrlimit, 64)
|
||||
SYSCALL2(sys_setrlimit, 65)
|
||||
SYSCALL2(sys_atomic_add, 66)
|
||||
SYSCALL2(sys_atomic_and, 67)
|
||||
SYSCALL2(sys_atomic_or, 68)
|
||||
SYSCALL2(sys_atomic_set, 69)
|
||||
SYSCALL3(sys_test_and_set, 70)
|
||||
SYSCALL6(sys_sysctl, 71)
|
||||
//SYSCALL3(sys_socket, 72)
|
||||
SYSCALL2(sys_access, 73);
|
||||
SYSCALL2(sys_fstat, 74)
|
||||
SYSCALL3(sys_setenv, 79)
|
||||
SYSCALL2(sys_getenv, 80)
|
||||
SYSCALL2(sys_get_thread_info, 88)
|
||||
SYSCALL3(sys_get_next_thread_info, 89)
|
||||
SYSCALL2(sys_get_team_info, 90)
|
||||
SYSCALL2(sys_get_next_team_info, 91)
|
||||
|
Loading…
Reference in New Issue
Block a user