This project is mirrored from https://github.com/hermitcore/libhermit-rs.git.
Pull mirroring updated .
- 08 Aug, 2021 3 commits
-
-
Stefan Lankes authored
-
Stefan Lankes authored
- only if the counter is zero, we have to enable the non-polling mode
-
Stefan Lankes authored
the new interface is required for hermitcore/rusty-hermit#117
-
- 07 Aug, 2021 4 commits
-
-
bors[bot] authored
258: kernel_function: Clear upper bits of register r=stlankes a=mkroening If the type in a register is smaller than the register, Rust assumes the upper bits in the register to be zero. For example, checking a `bool` might happen via `test edi, edi`, although the type only occupies `dil`. Co-authored-by:
Martin Kröning <m.kroening@hotmail.de>
-
Stefan Lankes authored
-
Stefan Lankes authored
-
Martin Kröning authored
If the type in a register is smaller than the register, Rust assumes the upper bits in the register to be zero. For example, checking a `bool` might happen via `test edi, edi`, although the type only occupies `dil`.
-
- 11 Jul, 2021 1 commit
-
-
bors[bot] authored
254: update dependencies / lockfile r=stlankes a=striezel * updating proc-macro2 v1.0.26 -> v1.0.27 * updating raw-cpuid v9.0.0 -> v9.1.1 * updating syn v1.0.72 -> v1.0.73 `proc-macro2` and `syn` should be painless, because these are only patch version updates. `raw-cpuid` should be no hassle, too, if it follows semver - and its readme says it does. :) Co-authored-by:
Dirk Stolle <striezel-dev@web.de>
-
- 10 Jul, 2021 1 commit
-
-
Dirk Stolle authored
* updating proc-macro2 v1.0.26 -> v1.0.27 * updating raw-cpuid v9.0.0 -> v9.1.1 * updating syn v1.0.72 -> v1.0.73
-
- 09 Jul, 2021 1 commit
-
-
bors[bot] authored
253: fix some typos r=stlankes a=striezel This pull request fixes some typos. Co-authored-by:
Dirk Stolle <striezel-dev@web.de>
-
- 02 Jul, 2021 1 commit
-
-
Dirk Stolle authored
-
- 29 Jun, 2021 4 commits
-
-
bors[bot] authored
252: Fixup: Relay bigger types over pointers for affected kernel functions r=stlankes a=mkroening Fixes https://github.com/hermitcore/libhermit-rs/issues/250. This also improves documentation regarding the design of `kernel_function!`. Supersedes https://github.com/hermitcore/libhermit-rs/pull/251 . Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
Martin Kröning authored
-
Martin Kröning authored
-
Martin Kröning authored
-
- 28 Jun, 2021 2 commits
-
-
bors[bot] authored
246: Fix copyright header placement r=stlankes a=mkroening 248: Remove more instances of hardcoded stack offsets r=stlankes a=mkroening Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
bors[bot] authored
247: Fix switching to kernel stack r=stlankes a=mkroening This fixes https://github.com/hermitcore/libhermit-rs/issues/234 introduced in https://github.com/hermitcore/libhermit-rs/commit/41cf625c33801690f5be566db67e3eec5b372feb. As described in https://github.com/hermitcore/libhermit-rs/issues/234 , the issue with the old implementation was inlining resulting in wrongly managing stack space after the switch, potentially resulting in a page fault, when writing before the new stack: ```rust fn sys_foo() { // reserves stack space for `a` (`rsp -= 16`) switch_rsp(); // use reserved stack space (`[rsp + 16]`), even though rsp is not the same anymore let a = [0_u8; 16]; } ``` To my knowledge, inlining can only be really prevented, by explicitly `call`ing the function in assembly. I fixed this issue in five steps: 1. Remove `switch_to_kernel!`, `switch_to_user!`, migrate uses to `kernel_function!` 2. Fix a potential stack overflow caused by a typo (unrelated) 3. Improve consistency of kernel functions by adding the prefix `__sys_` to all functions. 4. Make all `__sys_`-functions `extern "C"` to allow calling in assembly. 5. Reimplement `kernel_function!` and call kernel function in assembly. Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
- 26 Jun, 2021 1 commit
-
-
Martin Kröning authored
To force Rust manage the new stack in the kernel function, we call the kernel function manually in assembly. That's why we need the kernel functions to be extern "C".
-
- 25 Jun, 2021 5 commits
-
-
Martin Kröning authored
-
Martin Kröning authored
-
Martin Kröning authored
-
Martin Kröning authored
-
Martin Kröning authored
Switch uses to kernel_function!
-
- 24 Jun, 2021 6 commits
-
-
Martin Kröning authored
-
Stefan Lankes authored
-
bors[bot] authored
243: Complete migration of kernel target r=stlankes a=mkroening I noticed this due to [failing docs CI](https://github.com/hermitcore/libhermit-rs/runs/2889060428). The rename began in 18dd15f5 . It seems that the repository-local json target specifications are not used, so I removed those. Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
Stefan Lankes authored
-
bors[bot] authored
244: CI: Fix typos r=stlankes a=mkroening Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
Martin Kröning authored
-
- 23 Jun, 2021 1 commit
-
-
Martin Kröning authored
I noticed this due to failing docs CI [1] The rename began in 18dd15f5. It seems that the repository-local json target specifications are not used, so I removed those. [1] https://github.com/hermitcore/libhermit-rs/runs/2889060428
-
- 22 Jun, 2021 5 commits
-
-
bors[bot] authored
231: Migrate to naked functions r=stlankes a=mkroening Fixes https://github.com/hermitcore/libhermit-rs/issues/222 . Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
bors[bot] authored
241: Improve macro hygiene r=stlankes a=mkroening Resolves https://github.com/hermitcore/libhermit-rs/issues/224 . Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
bors[bot] authored
230: CI: Rework toolchain setup r=stlankes a=mkroening This avoids double-installation of rust-toolchains in CI and enables coloring in the output. Fixes https://github.com/hermitcore/libhermit-rs/issues/226 . Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
bors[bot] authored
236: Semaphore: Drop guard explicitly for readability r=stlankes a=mkroening This is a rather opinionated change regarding code readability. In my code editor with four spaces per tab, the extra scope looks quite weird. By explicitly dropping the guard instead, I personally find this easier to read. What do you think? Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
bors[bot] authored
240: Remove unintended dereference r=stlankes a=mkroening 87a9d3f9 was wrong. Instead of calculating an address at one place in `acpi`, it read from that address. The warning in `apic` was due to an implicit borrow and can be resolved by an explicit copy into a let binding. Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
- 19 Jun, 2021 1 commit
-
-
bors[bot] authored
242: Make msb helper function portable r=stlankes a=mkroening `NonZeroU64::leading_zeros` has recently been stabilized. Now we can make our `msb` helper function portable, resulting in the same `x86_64` assembly: [Compiler Explorer](https://godbolt.org/#g:!((g:!((g:!((h:codeEditor,i:(fontScale:14,fontUsePx:'0',j:1,lang:rust,selection:(endColumn:8,endLineNumber:3,positionColumn:8,positionLineNumber:3,selectionStartColumn:5,selectionStartLineNumber:3,startColumn:5,startLineNumber:3),source:'%23!!%5Bfeature(asm)%5D%0A%0Ause+std::num::NonZeroU64%3B%0A%0Apub+fn+old_msb(n:+u64)+-%3E+Option%3Cu64%3E+%7B%0A%09if+n+%3E+0+%7B%0A%09%09let+ret%3B%0A%09%09unsafe+%7B%0A%09%09%09asm!!(%22bsr+%7B%7D,+%7B%7D%22,+out(reg)+ret,+in(reg)+n,+options(pure,+nomem,+nostack))%3B%0A%09%09%7D%0A%09%09Some(ret)%0A%09%7D+else+%7B%0A%09%09None%0A%09%7D%0A%7D%0A%0Apub+fn+new_msb(n:+u64)+-%3E+Option%3Cu32%3E+%7B%0A++++NonZeroU64::new(n).map(%7Cn%7C+63+-+n.leading_zeros())%0A%7D%0A'),l:'5',n:'0',o:'Rust+source+%231',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0'),(g:!((h:compiler,i:(compiler:nightly,filters:(b:'0',binary:'1',commentOnly:'0',demangle:'0',directives:'0',execute:'1',intel:'0',libraryCode:'0',trim:'1'),fontScale:14,fontUsePx:'0',j:2,lang:rust,libs:!(),options:'-C+opt-level%3D3',selection:(endColumn:1,endLineNumber:1,positionColumn:1,positionLineNumber:1,selectionStartColumn:1,selectionStartLineNumber:1,startColumn:1,startLineNumber:1),source:1),l:'5',n:'0',o:'rustc+nightly+(Editor+%231,+Compiler+%232)+Rust',t:'0')),k:50,l:'4',n:'0',o:'',s:0,t:'0')),l:'2',n:'0',o:'',t:'0')),version:4 ) Co-authored-by:
Martin Kröning <mkroening@posteo.net>
-
- 18 Jun, 2021 1 commit
-
-
Martin Kröning authored
-
- 17 Jun, 2021 3 commits
-
-
Martin Kröning authored
-
Martin Kröning authored
-
Martin Kröning authored
-