bunnie
c0484ca607
chore: fix formatting
2024-03-23 12:02:54 +08:00
bunnie
8b7912fb34
add some targeted debug; handle advisories before swapper registered
...
for now, we just count how mayn pages we missed an advisory on,
those all effectively are "wired". If we're fast enough on registering,
it turns out we actually miss nothing.
2024-03-23 11:59:31 +08:00
bunnie
233bb63878
add debug-swap targeted debug config
2024-03-23 11:59:31 +08:00
bunnie
10c4ab80c8
make the swapper register immediately
...
this means we miss fewer advisories at boot
2024-03-23 11:59:31 +08:00
bunnie
ed5dd7e538
fix argument order bug
...
just a dumb typo
2024-03-23 11:59:31 +08:00
bunnie
ced6dd9e63
fix bug in create-image invocation
...
its arguments require the 0x decorator to define hex,
whereas arguments to xtask don't. A little confusing, but
only if you actually ever call create-image -- which nobody
does, to a first order.
2024-03-23 11:59:31 +08:00
bunnie
fdbdea5ab0
add swap tag to image creation
2024-03-23 11:59:31 +08:00
bunnie
38f0002294
partial progress on create-image
...
create-image can now genereate inis sections
still needs to kick out a `swap` argument for the bootloader
so it knows where swap should go.
2024-03-23 11:59:31 +08:00
bunnie
66779dd479
add swap specifiers to xtask
2024-03-23 11:59:31 +08:00
bunnie
ff241b117b
fix ordering of processes so that the swapper is PID 2
2024-03-23 11:59:31 +08:00
bunnie
71b3244198
add "swap" to the arguments for syntax checking
...
doesn't hurt, makes it easier to debug things
2024-03-23 11:59:31 +08:00
bunnie
9ddf537115
setup argument unpacking in the swapper
2024-03-23 11:59:31 +08:00
bunnie
803ce1a847
move allocadvice to new home
2024-03-23 11:59:31 +08:00
bunnie
b62a639031
move AllocAdvice record to externally visible xous-rs definitions
...
this structure moves between swapper and userland.
2024-03-23 11:59:31 +08:00
bunnie
a2e6a75b2d
add test code to lock and top level workspace
2024-03-23 11:59:31 +08:00
bunnie
858e2c8eb3
add swapper test code to the swapper test image
2024-03-23 11:59:31 +08:00
bunnie
21338321cd
add a skeleton for swapper test code
2024-03-23 11:59:31 +08:00
bunnie
c2084af2ad
make sure the swapper feature is turned on
2024-03-23 11:59:31 +08:00
bunnie
af856124a0
pass kernel dependency to xous-rs
2024-03-23 11:59:31 +08:00
bunnie
025e39913b
implement retrieval from swap and allocation advisories
2024-03-23 11:59:31 +08:00
bunnie
4eefbd88bc
cleanup warning that crept into the code
2024-03-23 11:59:31 +08:00
bunnie
168e3454f6
handle free advisories
2024-03-23 11:59:31 +08:00
bunnie
28b415cb27
handle swapped pages and allocation advisories
2024-03-23 11:59:31 +08:00
bunnie
14364e09c6
ensure compliance with unsafe conditions on exit_blocking_call()
2024-03-23 11:59:31 +08:00
bunnie
b2cd829adb
upgrade api to use the new irq enum discipline
...
I think this commit message got swapped with the previous one,
the hazards of autocomplete.
2024-03-23 11:59:31 +08:00
bunnie
167cd04f06
remove arg page list, replace with set of 8 usize
...
this makes calls more efficient and avoids the double-shared page
2024-03-23 11:59:31 +08:00
bunnie
d6cfb13e4f
upgrade irq path to handle the new API
2024-03-23 11:59:31 +08:00
bunnie
5234127b7b
support multiple irq-like contexts with an enum
2024-03-23 11:59:31 +08:00
bunnie
70639214e1
specify the swap return address for swaps
2024-03-23 11:59:31 +08:00
bunnie
500a641848
specify the irq return address for irqs
2024-03-23 11:59:31 +08:00
bunnie
474e8f0822
make return address of callback configurable
2024-03-23 11:59:31 +08:00
bunnie
f2e44d364a
implement blocking callback
...
a roughed-out nonblocking callback version also staged
2024-03-23 11:59:31 +08:00
bunnie
65599a46d5
add state and handler to the setup
...
shared state is going to be much more complicated, for now,
just a placeholder
2024-03-23 11:59:31 +08:00
bunnie
fac6a43b19
add arguments for handler and state to registration
2024-03-23 11:59:31 +08:00
bunnie
505dce8343
define the swapper PID
2024-03-23 11:59:31 +08:00
bunnie
9008452a36
add arguments to register syscall for handler and state
2024-03-23 11:59:31 +08:00
bunnie
6806403da8
make the release page mechanism visible externally for swap config
2024-03-23 11:59:31 +08:00
bunnie
47a16b6ce4
add RETURN_FROM_ISR magic address
...
this is picked to not conflict with other addresses used by
the ARM implementation. I think it should be OK?
2024-03-23 11:59:31 +08:00
bunnie
26047bf956
add the routine to evict a page
2024-03-23 11:59:31 +08:00
bunnie
6f18a0ed21
add trampoline to return from swapper
2024-03-23 11:59:31 +08:00
bunnie
daf4d9a93e
make valid bit mapping symbolic instead of hard coded constant
2024-03-23 11:59:31 +08:00
bunnie
bc91055307
add template for EvictPage
...
actual function is still a todo
2024-03-23 11:59:31 +08:00
bunnie
fdb1cacf42
fix compile errors
2024-03-23 11:59:31 +08:00
bunnie
47e1ae2141
add EvictPage implementation
2024-03-23 11:59:31 +08:00
bunnie
b0665c3412
implement RegisterSwapper syscall
2024-03-23 11:59:31 +08:00
bunnie
9fb1acb705
swap module, with some initial functionality for registration
2024-03-23 11:59:31 +08:00
bunnie
4f15af3fee
add swap module to the kernel, and initialize it from args
2024-03-23 11:59:31 +08:00
bunnie
a1cffed9cd
un-use the P bit in the page table
...
prep for re-allocating it to swap
2024-03-23 11:59:31 +08:00
bunnie
5c3edef519
define initial data structures & registration
...
note that the SMT is a trait that has an implementation
dependent structure, because we can't always assume
that swap is memory-mapped.
2024-03-23 11:59:31 +08:00
bunnie
496d13b157
create swapper syscall entries; implement RegisterSwapper
2024-03-23 11:59:31 +08:00