Commit Graph

1216 Commits

Author SHA1 Message Date
bjorn3 782ec87f27 Fix UB in the locking code of context switching
The spin crate considers it UB to call force_write_unlock while there is
a threads trying to obtain a read lock on the same rwlock.

This also switches to the spinning_lot crate for the context rwlock as
it has support for a write guard keeping a reference to the rwlock using
an Arc instead of a reference.
2024-02-25 17:07:41 +01:00
bjorn3 449abb8925 Share bootstrap_mem between all archs 2024-02-25 15:53:04 +01:00
bjorn3 e23f0ed66b Share idt.rs between x86 and x86_64 2024-02-25 15:49:29 +01:00
bjorn3 f92b4c9608 Unify cpuid between x86 and x86_64 and don't return an Option
Systems without cpuid support aren't supported anyway.
2024-02-25 15:07:31 +01:00
bjorn3 eecfbb19d2 Share the functions in interrupt/mod.rs between x86 and x86_64 2024-02-25 14:48:28 +01:00
bjorn3 fbe2980b3d Share interrupt/ipi.rs between x86 and x86_64 2024-02-25 14:48:15 +01:00
bjorn3 62614db9ac Share interrupt/trace.rs between x86 and x86_64 2024-02-25 14:48:12 +01:00
bjorn3 c1d0c11a1b Fix typo in irq.rs 2024-02-25 14:31:52 +01:00
bjorn3 3610dd7e03 Remove unused interrupt handler 2024-02-25 14:31:28 +01:00
bjorn3 e9e3b4487d Reduce the difference of idt.rs between x86 and x86_64 2024-02-25 14:31:28 +01:00
Jeremy Soller 39c20720ee Fix compilation on x86_64 2024-02-16 22:05:57 -07:00
Jeremy Soller e4eb4031bd Fix APIC offsets for x86 32-bit 2024-02-16 22:02:47 -07:00
Jeremy Soller 6c6fc18f8e Format 2024-02-16 21:40:42 -07:00
Jeremy Soller 86589aa7fa Only switch to idle process when no other processes can run 2024-02-13 14:46:21 -07:00
Jeremy Soller 98f12fd750 Hack to workaround hangs by pinning to one cpu 2024-02-10 09:18:57 -07:00
Ron Williams 9331452bdb Use RedoxPath::as_parts. redox-path from crates.io 2024-02-09 15:05:45 +00:00
Ron Williams eeee40ae0c update unlink for new path format 2024-02-01 00:50:33 -08:00
Ivan Tan e7d47d10c6 aarch64: fix compile error 2024-01-27 23:29:37 +08:00
bjorn3 58314e6a47 Share a whole lot more code between x86 and x86_64 2024-01-25 13:34:04 +00:00
bjorn3 785975089b Dedup the last remaining piece of code in the driver module between x86 and x86_64 2024-01-25 13:34:04 +00:00
bjorn3 0d86348e41 Dedup the apic code between x86 and x86_64 2024-01-25 13:34:04 +00:00
bjorn3 86fb4208f2 Dedup some more code between x86 and x86_64 2024-01-25 13:34:04 +00:00
bjorn3 0d092d7921 Dedup code for most x86 and x86_64 device drivers 2024-01-25 13:34:04 +00:00
bjorn3 9404e9f892 Mark the sections used by alternative!() as allocated
This prevents the linker from discarding any function which uses the
alternative!() macro which would result in runtime relocation crashing.
2024-01-25 11:51:34 +01:00
bjorn3 5e71f6f9df Correctly mark unaligned write as such to avoid UB 2024-01-24 19:43:34 +01:00
bjorn3 e5c93ae334 Fix some UB and debug assertions
The UB has been found by rustc's new UB checks with debug assertions
enabled.
2024-01-24 13:51:20 +01:00
Jeremy Soller 87ee68998c Handle new path format 2024-01-18 12:35:32 -07:00
Jeremy Soller 45f1c4e29e Add rustfmt from relibc and apply it with cargo fmt 2024-01-17 13:52:01 -07:00
Jeremy Soller 73897bd83d scheme/pipe: allow removing fevent 2024-01-08 16:59:48 -07:00
Jeremy Soller d18c316012 Add session ID 2024-01-08 14:43:11 -07:00
4lDO2 529c491fa0 Allow disabling profiling at compile time. 2023-12-17 00:49:28 +01:00
4lDO2 fac0e783ef Refactor profiling code. 2023-12-17 00:49:28 +01:00
4lDO2 99ad6a0a2c Support toggling profiling. 2023-12-17 00:49:28 +01:00
4lDO2 0f27d55c0a Advance profiling buffer correctly. 2023-12-17 00:49:28 +01:00
4lDO2 14abf0cbc6 Exclude kmain from profile. 2023-12-17 00:49:27 +01:00
4lDO2 f973bc4128 Profiling 2023-12-17 00:49:24 +01:00
4lDO2 ee3aafa1d9 Remove PhysBorrowed hacks. 2023-12-15 15:14:40 +01:00
4lDO2 52df9dd1bc Remove the AddrSpace ref when exiting, not reaping. 2023-12-15 15:14:40 +01:00
4lDO2 d4a120188f Ensure PhysBorrowed iff !alloc-owned, vice versa.
This is allowed now that the old physalloc/physfree syscalls have been
removed.
2023-12-15 15:14:40 +01:00
4lDO2 eda462fd11 Remove SYS_PHYSMAP. 2023-12-15 15:14:40 +01:00
4lDO2 875a130843 Remove SYS_PHYSALLOC* and SYS_PHYSFREE. 2023-12-15 15:14:40 +01:00
4lDO2 a42e406569 Fix contiguous mmap. 2023-12-15 15:14:40 +01:00
4lDO2 cd19831ffb Improved options for memory: files. 2023-12-15 15:14:40 +01:00
4lDO2 77400f63ee Add a memory: file for phys-contiguous mmaps. 2023-12-15 15:14:36 +01:00
Ivan Tan ebf96fa843 aarch64: fix dtb scheme 2023-12-14 03:34:37 +00:00
Jeremy Soller 1cc5804333 Allow CPUs to take any context 2023-12-13 17:20:43 -07:00
Jeremy Soller 4386e0716d Missed change for last commit 2023-12-13 17:20:21 -07:00
Jeremy Soller fbaa4306e3 Add unblock_no_ipi function and use in context switch 2023-12-13 17:19:43 -07:00
bjorn3 2d065083df Use HashMap instead of BTreeMap where possible
This shrinks the kernel from 905840 bytes to 862408 bytes.
2023-12-13 19:55:20 +01:00
4lDO2 78beae5c92 Fix aarch64 2023-12-13 11:08:12 +01:00