haiku/headers/private/kernel/ksyscalls.h

58 lines
1.2 KiB
C
Raw Normal View History

/*
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _KERNEL_KSYSCALLS_H
#define _KERNEL_KSYSCALLS_H
#include <SupportDefs.h>
#define MAX_SYSCALL_PARAMETERS 16
Merged branch haiku/branches/developer/bonefish/optimization revision 23139 into trunk, with roughly the following changes (for details svn log the branch): * The int 99 syscall handler is now fully in assembly. * Added a sysenter/sysexit handler and use it on Pentiums that support it (via commpage). * Got rid of i386_handle_trap(). A bit of functionality was moved into the assembly handler which now uses a jump table to call C functions handling the respective interrupt. * Some optimizations to get user debugger support code out of the interrupt handling path. * Introduced a thread::flags fields which allows to skip handling of rare events (signals, user debug enabling/disabling) on the common interrupt handling path. * Got rid of the explicit iframe stack. The iframes can still be retrieved by iterating through the stack frames. * Made the commpage an architecture independent feature. It's used for the real time data stuff (instead of creating a separate area). * The x86 CPU modules can now provide processor optimized versions for common functions (currently memcpy() only). They are used in the kernel and are provided to the userland via commpage entries. * Introduced build system feature allowing easy use of C structure member offsets in assembly code. Changes after merging: * Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp (caused by refactoring and introduction of "call" debugger command). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-01-11 03:36:44 +03:00
typedef struct syscall_info {
void *function; // pointer to the syscall function
int parameter_size; // summed up parameter size
} syscall_info;
typedef struct syscall_parameter_info {
int offset;
int size;
int used_size;
type_code type;
} syscall_parameter_info;
typedef struct syscall_return_type_info {
int size;
int used_size;
type_code type;
} syscall_return_type_info;
typedef struct extended_syscall_info {
const char* name;
int parameter_count;
syscall_return_type_info return_type;
syscall_parameter_info parameters[MAX_SYSCALL_PARAMETERS];
} extended_syscall_info;
extern const int kSyscallCount;
extern const syscall_info kSyscallInfos[];
extern const extended_syscall_info kExtendedSyscallInfos[];
#ifdef __cplusplus
extern "C" {
#endif
int32 syscall_dispatcher(uint32 function, void *argBuffer, uint64 *_returnValue);
status_t generic_syscall_init(void);
#ifdef __cplusplus
}
#endif
#endif /* _KERNEL_KSYSCALLS_H */