this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #753 from facekapow/add-csrctl

Implement csrctl

authored by

Luboš Doležel and committed by
GitHub
3ef6a324 839443e8

+32
+1
src/kernel/emulation/linux/CMakeLists.txt
··· 175 175 misc/csops.c 176 176 misc/fileport_makeport.c 177 177 misc/fileport_makefd.c 178 + misc/csrctl.c 178 179 fcntl/open.c 179 180 fcntl/openat.c 180 181 fcntl/fcntl.c
+20
src/kernel/emulation/linux/misc/csrctl.c
··· 1 + #include "csrctl.h" 2 + #include "../duct_errno.h" 3 + #define PRIVATE 4 + #include <sys/csr.h> 5 + 6 + long sys_csrctl(uint32_t op, void* useraddr, size_t usersize) { 7 + switch (op) { 8 + case CSR_SYSCALL_CHECK: { 9 + // allow everything 10 + return 0; 11 + } break; 12 + case CSR_SYSCALL_GET_ACTIVE_CONFIG: { 13 + // set everything to "allowed" 14 + *(uint32_t*)useraddr = CSR_VALID_FLAGS; 15 + return 0; 16 + } break; 17 + default: 18 + return ENOSYS; 19 + } 20 + };
+9
src/kernel/emulation/linux/misc/csrctl.h
··· 1 + #ifndef LINUX_CSRCTL_H 2 + #define LINUX_CSRCTL_H 3 + 4 + #include <stdint.h> 5 + #include <stddef.h> 6 + 7 + long sys_csrctl(uint32_t op, void* useraddr, size_t usersize); 8 + 9 + #endif // LINUX_CSRCTL_H
+2
src/kernel/emulation/linux/syscalls.c
··· 121 121 #include "misc/csops.h" 122 122 #include "misc/fileport_makeport.h" 123 123 #include "misc/fileport_makefd.h" 124 + #include "misc/csrctl.h" 124 125 #include "synch/semwait_signal.h" 125 126 #include "fcntl/open.h" 126 127 #include "fcntl/openat.h" ··· 463 464 [474] = sys_symlinkat, 464 465 [475] = sys_mkdirat, 465 466 [476] = sys_getattrlistat, 467 + [483] = sys_csrctl, 466 468 [500] = sys_getentropy, 467 469 [515] = sys_ulock_wait, 468 470 [516] = sys_ulock_wake,