aboutsummaryrefslogtreecommitdiff
path: root/pk/syscall.c
AgeCommit message (Collapse)AuthorFilesLines
2024-04-23Implementation of riscv_hwprobe syscall from Linux (#325)Wojciech Muła1-0/+51
See: https://www.kernel.org/doc/html/latest/arch/riscv/hwprobe.html
2024-03-22Implement syscall readlinkat and readv (#318)mylai-mtk1-0/+87
* Implement syscall readlinkat * Implement syscall readv by read syscalls Since pk lacks kernel-space dynamic memory management, we implement readv with normal read syscalls rather than forwarding it to spike
2022-04-30Fix a file leak in function `at_kfd` (#276)MaxXing1-1/+3
2022-04-11Handle unimplemented syscalls gracefullyAndrew Waterman1-11/+1
We previously kernel-panicked because that made it more obvious when a syscall implementation was missing. These days, it's more common that the C library will do something sensible in response to returning -ENOSYS. Favor that approach to avoid frustrating users.
2022-04-08Stub out sysinfo syscallAndrew Waterman1-0/+1
2022-01-09fix file leakAndrew Waterman1-1/+1
Eliminate excess reference count when associating fd with file. Fixes #258
2021-08-27pk: correct the handling of SYS_getcwd (#250)Saleem Abdulrasool1-1/+1
`SYS_getcwd` is different from `getcwd` in that the return value is < 0 on failure otherwise it is the length of the string. The proxy kernel was treating 0 as success and all other values as error. As a result, we would never return a valid value for `getcwd`. The following program now executes properly with the Proxy Kernel: ```c #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <linux/limits.h> int main(int argc, char **argv) { unsigned char buffer[PATH_MAX + 1] = {0}; if (getcwd(buffer, PATH_MAX)) printf("cwd: %s\n", buffer); return EXIT_SUCCESS; } ```
2021-03-25pk: support >2 GiB of user memory for RV64Andrew Waterman1-0/+2
Previously, the pk would always run from virtual address MEM_START. Instead, remap it into the negative virtual addresses, allowing user processes to expand beyond MEM_START.
2021-03-25Add some missing syscall stubsAndrew Waterman1-0/+8
2021-03-25pk: only access user memory through explicit accessorsAndrew Waterman1-57/+177
Enforced with sstatus.SUM.
2021-03-25Add `statx` syscall (#234)huaixv1-0/+20
2020-11-29Remove use of copy_stat() from sys_fstat and sys_lstat (#228)Marcus Comstedt1-2/+4
2020-11-17Remove use of copy_stat() from sys_fstatatMarcus Comstedt1-1/+1
The system call should return the stat struct in kernel format, not libc format.
2020-03-16Fix CPI calcualtion for -s option (#192)davidmetz1-1/+1
This attempt at rounding leads to wrong results, for example: 314689951 cycles 314690101 instructions 0.90 CPI With my change results in: 314689951 cycles 314690101 instructions 0.99 CPI I think this was supposed to be part of rounding behaviour but it doesn't work if only the final digit does it and there is no carry... Instead I changed it to truncate after the second digit
2019-10-22Implement dup3 syscall (#162)Luís Marques1-0/+16
2019-10-22Make performance counters always 64 bits wide (#178)Luís Marques1-12/+13
This prevents the counters from easily overflowing for a 32-bit pk.
2019-02-28Stub out madvise syscall (#145)Luís Marques1-0/+1
2019-01-04Implement clock_gettime syscall (#139)Luís Marques1-1/+10
2018-02-01Bump the Linux version PK claims to supportAndrew Waterman1-1/+1
This makes it more compatible with recent glibc.
2017-08-29Stub out sys_prlimit64Andrew Waterman1-0/+1
2016-12-06avoid non-standard predefined macrosAndrew Waterman1-1/+1
2016-11-13For RV32, mmap offset is in 4 KiB incrementsAndrew Waterman1-2/+6
2016-11-13Add syscall stubs to get through libpthread initializersAndrew Waterman1-0/+2
2016-08-10when -s is passed, print time, instret, cycle, and CPIAndrew Waterman1-2/+10
2016-07-12Remove uarch countersAndrew Waterman1-1/+0
We'll re-add support for the generic performance counter facility once it exists.
2016-04-30Move DRAM to high addressesAndrew Waterman1-11/+11
2016-04-20pk: proxy chdir syscall to fesvrGarret Kelly1-0/+6
2016-04-06Don't assume existence of uarch countersAndrew Waterman1-25/+1
2016-03-09Refactor pk, bbl, machine into separate librariesAndrew Waterman1-1/+1
Yuck.
2016-03-05Disentangle PK and BBL a bitAndrew Waterman1-1/+2
2016-02-19Fix struct stat size mismatch for RV32Andrew Waterman1-4/+8
2016-02-19Remove incorrect code supporting ELF32 on RV64 and vice-versaAndrew Waterman1-34/+12
This is technically possible by running an RV32 supervisor on an RV64 machine, but the M-mode and S-mode code would need to be compiled and linked separately.
2016-01-18add renameat syscallColin Schmidt1-0/+13
2015-09-14Add ftruncate syscallAndrew Waterman1-0/+15
2015-09-11Stub out a few system callsAndrew Waterman1-0/+4
2015-05-10Split pk functionality into pk and bblAndrew Waterman1-2/+1
pk is now an AEE only (i.e. it can only execute user programs). bbl is now an SEE only (i.e. it can only host kernels).
2015-03-12Update to new privileged specAndrew Waterman1-12/+21
2015-02-09work in progress on new supervisor specAndrew Waterman1-1/+0
2015-01-26return -ENOSYS for ioctl, rather than abortingAndrew Waterman1-0/+1
2015-01-20Support linkat, unlinkat, mkdirat syscallsAndrew Waterman1-58/+81
Also, old-style syscalls e.g. open are now implemented with e.g. openat.
2014-10-26Don't rely on the C libraryAndrew Waterman1-3/+9
2014-09-11Support glibc 2.20 programsAndrew Waterman1-1/+6
2014-08-10Fix uarch counter printout type.Christopher Celio1-1/+1
2014-08-07Added "-c" option to track uarch counter info.Christopher Celio1-0/+24
2014-06-13Changes to allow spike & RTL behavior to better match each other.Christopher Celio1-0/+1
- EI turned off on sys_exit. - IM/IP cleared on start. - badvaddr only saved to tf on page faults.
2014-05-27Allow mmap to map new segments larger than 1 page on top of existing ↵Colin Schmidt1-5/+6
mappings and add mprotect syscall
2014-05-22Add several syscalls, and move syscall header file from newlibColin Schmidt1-6/+142
syscalls added (openat, access, accessat, faccessat, etc.)
2014-02-04Abandon MIPS convention for indicating syscall errors in register a3Andrew Waterman1-47/+50
2013-12-13Add times syscallAndrew Waterman1-12/+37
2013-11-25Update to new privileged ISAAndrew Waterman1-1/+0