|
14 | 14 | // See the License for the specific language governing permissions and |
15 | 15 | // limitations under the License. |
16 | 16 |
|
17 | | -#include <arch/x86/cpu.hpp> |
18 | 17 | #include <os.hpp> |
19 | | -#include <likely> |
20 | 18 | #include <kprint> |
21 | | -#include <errno.h> |
22 | | - |
23 | | -#define ARCH_SET_GS 0x1001 |
24 | | -#define ARCH_SET_FS 0x1002 |
25 | | -#define ARCH_GET_FS 0x1003 |
26 | | -#define ARCH_GET_GS 0x1004 |
27 | | - |
28 | | -#ifdef __x86_64__ |
29 | | -static long sys_prctl(int code, uintptr_t ptr) |
30 | | -{ |
31 | | - switch(code){ |
32 | | - case ARCH_SET_GS: |
33 | | - //kprintf("<arch_prctl> set_gs to %#lx\n", ptr); |
34 | | - if (UNLIKELY(!ptr)) return -EINVAL; |
35 | | - x86::CPU::set_gs((void*)ptr); |
36 | | - break; |
37 | | - case ARCH_SET_FS: |
38 | | - //kprintf("<arch_prctl> set_fs to %#lx\n", ptr); |
39 | | - if (UNLIKELY(!ptr)) return -EINVAL; |
40 | | - x86::CPU::set_fs((void*)ptr); |
41 | | - break; |
42 | | - case ARCH_GET_GS: |
43 | | - os::panic("<arch_prctl> GET_GS called!\n"); |
44 | | - case ARCH_GET_FS: |
45 | | - os::panic("<arch_prctl> GET_FS called!\n"); |
46 | | - } |
47 | | - return -EINVAL; |
48 | | -} |
49 | | -#endif |
50 | 19 |
|
51 | 20 | extern "C" |
52 | 21 | uintptr_t syscall_entry(uint64_t n, uint64_t a1, uint64_t a2, uint64_t a3, |
53 | 22 | uint64_t a4, uint64_t a5) |
54 | 23 | { |
55 | | - switch(n) { |
56 | | - case 158: // arch_prctl |
57 | | - sys_prctl(a1, a2); |
58 | | - break; |
59 | | - default: |
60 | | - kprintf("<syscall entry> no %lu (a1=%#lx a2=%#lx a3=%#lx a4=%#lx a5=%#lx) \n", |
| 24 | + kprintf("<syscall entry> no %lu (a1=%#lx a2=%#lx a3=%#lx a4=%#lx a5=%#lx) \n", |
61 | 25 | n, a1, a2, a3, a4, a5); |
62 | | - } |
| 26 | + os::panic("Syscalls are not implemented in IncludeOS!"); |
63 | 27 | return 0; |
64 | 28 | } |
65 | 29 |
|
66 | | -extern "C" |
67 | | -long syscall_SYS_set_thread_area(struct user_desc *u_info) |
68 | | -{ |
69 | | - if (UNLIKELY(!u_info)) return -EINVAL; |
70 | | -#ifdef __x86_64__ |
71 | | - x86::CPU::set_fs(u_info); |
72 | | -#else |
73 | | - x86::CPU::set_gs(u_info); |
74 | | -#endif |
75 | | - return 0; |
76 | | -} |
0 commit comments