UbixOS V2
2.0
syscalls.h
Go to the documentation of this file.
1
/*-
2
* Copyright (c) 2002-2018 The UbixOS Project.
3
* All rights reserved.
4
*
5
* This was developed by Christopher W. Olsen for the UbixOS Project.
6
*
7
* Redistribution and use in source and binary forms, with or without modification, are permitted
8
* provided that the following conditions are met:
9
*
10
* 1) Redistributions of source code must retain the above copyright notice, this list of
11
* conditions, the following disclaimer and the list of authors.
12
* 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13
* conditions, the following disclaimer and the list of authors in the documentation and/or
14
* other materials provided with the distribution.
15
* 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16
* endorse or promote products derived from this software without specific prior written
17
* permission.
18
*
19
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
#ifndef _SYSCALLS_H
30
#define _SYSCALLS_H
31
32
#include <
ubixos/sched.h
>
33
#include <
vfs/file.h
>
34
#include <
ubixos/syscall.h
>
35
36
#define SYSCALLS_MAX 1024
37
38
#define PSL_C 0x00000001
/* carry bit */
39
#define EJUSTRETURN (-2)
/* don't modify regs, just return */
40
#define ERESTART (-1)
/* restart syscall */
41
42
#define ARG_COUNT(name) (sizeof(struct name) / sizeof(register_t))
43
44
#define SYSCALL_INVALID 0
45
#define SYSCALL_VALID 1
46
#define SYSCALL_DUMMY 2
47
#define SYSCALL_NOTIMP 3
48
49
typedef
int
sys_call_t
(
struct
thread
*,
void
*);
50
51
struct
syscall_entry
{
52
int
sc_args
;
53
char
*
sc_name
;
54
sys_call_t
*
sc_entry
;
55
int
sc_status
;
56
};
57
58
/*
59
*
60
* Old Style Calls Need Updates
61
*
62
*/
63
int
sysAuth
();
64
int
sysPasswd
();
65
int
sysAddModule
();
66
int
sysRmModule
();
67
int
sysGetpid
();
68
int
sysExit
();
69
int
sysExec
();
70
71
int
sysCheckPid
();
72
int
sysGetFreePage
();
73
74
int
sysFgetc
();
75
int
sysFopen
();
76
int
sysFclose
();
77
int
sysFseek
();
78
int
sysMkDir
();
79
int
sysRmDir
();
80
81
//int sysSDE();
82
int
sysGetDrives
();
83
int
sysGetCwd
();
84
int
sysChDir
();
85
int
sysGetUptime
();
86
int
sysGetTime
();
87
int
sysStartSDE
();
88
int
sysUnlink
();
89
int
sysMpiCreateMbox
();
90
int
sysMpiDestroyMbox
();
91
int
sysMpiPostMessage
();
92
int
sysMpiFetchMessage
();
93
int
sysMpiSpam
();
94
95
typedef
int (*
functionPTR
)();
96
97
extern
int
totalCalls
;
98
extern
struct
syscall_entry
systemCalls
[];
99
100
extern
int
totalCalls_posix
;
101
extern
struct
syscall_entry
systemCalls_posix
[];
102
103
#endif
sysUnlink
int sysUnlink()
syscall_entry::sc_entry
sys_call_t * sc_entry
Definition:
syscalls.h:54
sysMpiFetchMessage
int sysMpiFetchMessage()
sysAuth
int sysAuth()
file.h
sysAddModule
int sysAddModule()
Definition:
syscall.c:117
thread
Definition:
thread.h:40
syscall_entry::sc_args
int sc_args
Definition:
syscalls.h:52
sysExit
int sysExit()
sysChDir
int sysChDir()
sysGetDrives
int sysGetDrives()
sysGetpid
int sysGetpid()
syscall.h
sched.h
sysRmModule
int sysRmModule()
Definition:
syscall.c:121
systemCalls
struct syscall_entry systemCalls[]
Definition:
syscalls.c:34
sysMpiDestroyMbox
int sysMpiDestroyMbox()
sysMpiSpam
int sysMpiSpam()
functionPTR
int(* functionPTR)()
Definition:
syscalls.h:95
syscall_entry::sc_name
char * sc_name
Definition:
syscalls.h:53
sysExec
int sysExec()
syscall_entry::sc_status
int sc_status
Definition:
syscalls.h:55
sysMpiPostMessage
int sysMpiPostMessage()
sysGetUptime
int sysGetUptime()
sysGetFreePage
int sysGetFreePage()
sysGetTime
int sysGetTime()
sysGetCwd
int sysGetCwd()
sysCheckPid
int sysCheckPid()
sysPasswd
int sysPasswd()
sysFseek
int sysFseek()
sysMpiCreateMbox
int sysMpiCreateMbox()
sysFclose
int sysFclose()
totalCalls
int totalCalls
Definition:
syscalls.c:92
sysStartSDE
int sysStartSDE()
Definition:
syscall.c:226
sysMkDir
int sysMkDir()
totalCalls_posix
int totalCalls_posix
Definition:
syscalls_posix.c:2791
sysFopen
int sysFopen()
sysFgetc
int sysFgetc()
sysRmDir
int sysRmDir()
Definition:
file.c:115
syscall_entry
Definition:
syscalls.h:51
sys_call_t
int sys_call_t(struct thread *, void *)
Definition:
syscalls.h:49
systemCalls_posix
struct syscall_entry systemCalls_posix[]
Definition:
syscalls_posix.c:33
C:
Dev
git
UbixOS
sys
include
ubixos
syscalls.h
Generated by
1.8.16