aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-03-25pk: refactor vm free list managementAndrew Waterman4-61/+115
2021-03-25pk: support >2 GiB of user memory for RV64Andrew Waterman7-34/+76
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 Waterman2-0/+10
2021-03-25pk: avoid assertion failures on brk syscallsAndrew Waterman1-3/+5
Return the old brk if mmap fails, rather than just asserting out
2021-03-25pk: avoid out-of-memory errorsAndrew Waterman2-50/+107
Estimate available memory and return -1 from mmap if not enough is available, rather than assert-failing.
2021-03-25pk: remove linear VA mapping constraintAndrew Waterman1-46/+83
This will improve flexibility going forward.
2021-03-25pk: only access user memory through explicit accessorsAndrew Waterman9-77/+278
Enforced with sstatus.SUM.
2021-03-25Add `statx` syscall (#234)huaixv3-0/+23
2020-12-15Add support for the UART interface on the LiteX SoC (#230)gsomlo5-1/+101
Tested using the RocketChip CPU option. (see https://github.com/enjoy-digital/litex) Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
2020-11-29Remove unused file_stat, copy_stat functionsAndrew Waterman4-28/+0
2020-11-29Remove use of copy_stat() from sys_fstat and sys_lstat (#228)Marcus Comstedt1-2/+4
2020-11-23use MEM_START, not DRAM_BASE, for pk mappingsAndrew Waterman2-3/+3
2020-11-23Fix emulation of misaligned access on big endian target (#224)Marcus Comstedt2-3/+32
2020-11-16Merge pull request #222 from zeldin/stat-struct-formatAndrew Waterman1-1/+1
Remove use of copy_stat() from sys_fstatat
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-11-12Merge pull request #220 from zeldin/big-endianAndrew Waterman2-3/+8
Big endian
2020-11-11pk: Fix pushing of argc to match linux kernel behaviourMarcus Comstedt1-3/+3
The linux kernel pushes argc as an int, not an uintptr_t. (The offset to the next element is still sizeof(uintptr_t).)
2020-11-11fdt: Skip byteorder swap on big endianMarcus Comstedt1-0/+5
2020-10-31Disable device tree filter when load a dts from file (#219)Yan7-1/+60
* add device tree in elf, using --with-dts to add the absolute path of device tree * Disable device tree filter * Remove *.dtb dependence, when the --with-dts option is not used
2020-10-30Revert "Disable device tree filter when load a dts from file (#217)"Andrew Waterman7-54/+1
This reverts commit a161e6f3ef31004e47a5b94b85c2e84b764f8637. Resolves #218
2020-10-29Disable device tree filter when load a dts from file (#217)Yan7-1/+54
* add device tree in elf, using --with-dts to add the absolute path of device tree * Disable device tree filter
2020-08-07make htif_poweroff thread-safe (#211)Howard Mao1-2/+3
2020-07-31Don't perform 64-bit accesses to the PLIC (#205)Alexander Richardson3-7/+7
Recent QEMU will fault for 8-byte accesses. Use a uint32_t instead of uintptr_t to avoid those problems.
2020-07-18Fix UART register map (#208)Nicholas O'Brien1-1/+3
While it's unused upstream, according to the SiFive FU540 document, the UART divisor register is at offset 0x18. This also maps the interrupt enable and interrupt pending register offsets.
2020-06-07Consistently use fdt_string_list for FDT compatible property (#202)Jessica Clarke3-3/+3
QEMU's finisher is "sifive,test1\0sifive,test0\0syscon" so we fail to detect it currently. Instead, search the entire list, and for completeness do the same with the HTIF and SiFive UART drivers.
2020-04-28Use correct offset for bbl.bin with non-default MEM_START (#187)Jessica Clarke1-1/+1
2020-04-28Support --without-payload for OpenSBI fw_jump-style booting (#186)Jessica Clarke3-6/+25
We expect the firmware to load the external payload at the second megapage, and that there is space to put the filtered FDT at 0x2200000 past the start of memory. With a default MEM_START of 0x80000000, this matches the standard OpenSBI values for FW_JUMP_ADDR and FW_JUMP_FDT_ADDR of 0x80400000/0x80200000 (RV32/RV64) and 0x82200000 respectively, so payloads linked for one should work with the other.
2020-03-29Update encoding.h from riscv-opcodes (#194)Kito Cheng1-246/+1573
- Update to riscv-opcodes/231c5d58940113b006aa9fa22f47c18d5fac4123
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
2020-02-02Support manually zeroing out BSS when booting (#188)James Clarke4-1/+38
Some ELF loaders, in particular gdb's load command for dynamically loading files into memory, which is often used to load binaries onto FPGAs over JTAG, do not zero out BSS, leaving the memory in whatever state it was previously in. Thus, introduce a new --enable-zero-bss configure flag, which will include code to zero out BSS when booting.
2020-01-13Enable vector unit if present (continuation of ↵Andrew Waterman3-3/+8
77a5df569451571d608650a34183d53df99790ec)
2020-01-11Enable vector unit if presentAndrew Waterman2-0/+5
2019-12-09Added --with-abi configure option (#183)Nick Knight3-4/+27
* Added --with-abi configure option * Revised to preserve original semantics when user specifies --with-arch but not --with-abi or when the user specifies --with-arch but not --host.
2019-12-06Only prohibit float32-only when FP emulation is enabledAndrew Waterman3-7/+22
2019-11-06Support a subset of 16750 functionality, and improve baud rate selection (#182)Jonathan Kimmitt1-3/+15
2019-10-31fdt: allow mmu type "riscv,32" on rv32 systems (#177)Gokturk Yuksek1-0/+4
SV32 is presented in RISC-V Privileged Architecture Manual (version 20190608-Priv-MSU-Ratified) Section 4.3 for RV32 systems. However, BBL responds to sv32 with: hart_filter_mask saw unknown hart type: status="okay", mmu_type="riscv,sv32" and hangs. This patch is adopted from the original 'riscv-pk.diff' patch written by Fabrice Bellard, distributed as part of the following tarball: https://bellard.org/tinyemu/diskimage-linux-riscv-2018-09-23.tar.gz Closes: https://github.com/riscv/riscv-pk/issues/160
2019-10-23Add --help (#179)Luís Marques1-14/+35
2019-10-22Implement dup3 syscall (#162)Luís Marques4-0/+32
2019-10-22text-modification: delete a word 'and' in README.md (#115)dskwe1-1/+1
2019-10-22Merge pull request #150 from lsgunth/build_fixesAndrew Waterman2-5/+11
Build fixes
2019-10-22Make performance counters always 64 bits wide (#178)Luís Marques5-21/+93
This prevents the counters from easily overflowing for a 32-bit pk.
2019-10-18Add user write permissions to installed filesAndrew Waterman1-2/+2
2019-10-01Only accept statically linked binaries (#176)Luís Marques2-0/+4
2019-08-14Merge pull request #172 from riscv/versionPalmer Dabbelt2-26/+14
Mark PK as version 1.0.0
2019-08-14Mark PK as version 1.0.0v1.0.0Palmer Dabbelt2-26/+14
Why not? Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
2019-08-14Merge pull request #171 from ipatix/masterAndrew Waterman3-14/+54
allow additional ns16550a config via device tree
2019-08-12allow additional ns16550a config via device treeMichael Panzlaff3-14/+54
This commit makes bbl read some additional fields from the device tree if it detects an ns16550a: - reg-shift - reg-offset - clock-frequency For explanation of these check out the Linux Kernel doc: https://www.kernel.org/doc/Documentation/devicetree/bindings/serial/8250.txt In particular this allows the Xilinx AXI UART 16550 to act as serial console with bbl and the Linux early boot console. This also fixes a bug in which bbl will ignore any other than the first "compatible" string when iterating over the nodes. Previously this line would not have worked: compatible = "xlnx,xps-uart16550-2.00.a", "ns16550a"; Before bbl would have just checked the first field instead of checking all strings in the list.
2019-08-12Prevent memset from calling itselfAndrew Waterman1-0/+5
With -ftree-loop-distribute-patterns, GCC detects that the body of memset is equivalent to memset, and so turns it into a call to memset, causing infinite recursion. Closes #170.
2019-07-17Merge pull request #168 from riscv/fix-code-above-4gAndrew Waterman3-96/+96
Fix bbl/pk living above 4 GiB
2019-07-17Make illegal-instruction jump table entries relative to their baseAndrew Waterman2-77/+77
This supports bbl living above 4 GiB.