Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RISCV] Leftovers after porting process #1188

Open
wants to merge 328 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
328 commits
Select commit Hold shift + click to select a range
c590443
Fix py formatting.
MichalBlk Jan 15, 2022
b7085ee
Remove cdefs.h
MichalBlk Jan 15, 2022
190962e
Fix Aarch64 dtb processing.
MichalBlk Jan 15, 2022
1cf11e5
Adapt the change to Malta and set the default klog mask at the beggin…
MichalBlk Jan 15, 2022
fa13bb8
Fix formatting.
MichalBlk Jan 15, 2022
55a31f6
Shift kasan initialization.
MichalBlk Jan 15, 2022
f094ee8
Update a comment.
MichalBlk Jan 15, 2022
295dcaa
Upgrade.
MichalBlk Jan 15, 2022
8ba4173
Fixes.
MichalBlk Jan 15, 2022
8af9d04
Update
MichalBlk Jan 16, 2022
352bc2a
Rename klog_update_maks and call it for MIPS.
MichalBlk Jan 23, 2022
956a104
We run on the cycle-accurate simulator
MichalBlk Feb 7, 2022
e28ffce
Merge https://github.com/cahirwpz/mimiker into aarch64-boot
MichalBlk Mar 10, 2022
b6d10fb
Update.
MichalBlk Mar 10, 2022
bf1466c
Fixes and cleanup.
MichalBlk Mar 10, 2022
ca90832
Update.
MichalBlk Mar 11, 2022
2b43cb9
Another update.
MichalBlk Mar 11, 2022
36acfaa
Cleanup.
MichalBlk Mar 11, 2022
67f5cd6
Further cleanup...
MichalBlk Mar 11, 2022
671fef5
Merge https://github.com/cahirwpz/mimiker into rv32-first-steps
MichalBlk Mar 11, 2022
eae4315
Initialize klog statically.
MichalBlk Mar 11, 2022
0d85b7b
Minimize changes
cahirwpz Mar 11, 2022
fc9209d
Merge branch 'aarch64-boot' of https://github.com/MichalBlk/mimiker i…
MichalBlk Mar 11, 2022
3f74357
u_long
MichalBlk Mar 11, 2022
fd29025
Update.
MichalBlk Mar 11, 2022
ee77a23
Merge https://github.com/cahirwpz/mimiker into rv32-first-steps
MichalBlk Mar 11, 2022
b723ddf
Introduce libfdt from FreeBSD.
MichalBlk Mar 18, 2022
68e415f
Create a sys/contrib dir and take the whole library.
MichalBlk Mar 21, 2022
0ba9097
Adapt fdt module form FreeBSD.
MichalBlk Mar 21, 2022
b35c1da
Update.
MichalBlk Mar 22, 2022
0030a24
Cleanup and minor fixes.
MichalBlk Mar 22, 2022
01ca862
Remove function calls as macro args.
MichalBlk Mar 22, 2022
f7364b1
Document the API and minor cleanup.
MichalBlk Mar 24, 2022
9f8f581
Fix typos and white spaces in comments.
MichalBlk Mar 24, 2022
2bc903b
Move klog initialization to board_init.
MichalBlk Mar 25, 2022
68a550f
Update to master.
MichalBlk Mar 25, 2022
0d2b5de
Fix BSD headers.
MichalBlk Mar 25, 2022
5e4ca62
Set klog origin to KL_INIT for boot and board RISC-V modules.
MichalBlk Mar 25, 2022
9d2ce03
Upgrade to new FDT.
MichalBlk Mar 25, 2022
f09f004
Update to master
MichalBlk Mar 28, 2022
5354ed2
Fixes
MichalBlk Mar 28, 2022
b75fdf9
Don't produce kernel variables regarding reserved memory
MichalBlk Mar 28, 2022
5e82160
Fix typos and modify comments
MichalBlk Mar 28, 2022
ce79d1f
Minor fixes.
MichalBlk Mar 28, 2022
0cc8820
Update
MichalBlk Mar 28, 2022
85943fa
SBI cleanup and cpufunc header.
MichalBlk Apr 1, 2022
32c6fb8
Extract common macros to cpufunc header.
MichalBlk Apr 1, 2022
7001c5d
Change address range functions' signetures.
MichalBlk Apr 1, 2022
e5a773f
Clear pending and disable supervisor interrupts during VM boot phase.
MichalBlk Apr 1, 2022
cff7140
Unify kernel PD and PTs for vm_page_t allocation.
MichalBlk Apr 1, 2022
d4ea9cc
Make the boot segment a free physical memory region after the bare me…
MichalBlk Apr 1, 2022
d2ce46e
Make the boot segment a free physical memory region after the bare me…
MichalBlk Apr 1, 2022
315d2fd
Remove unnecessary include.
MichalBlk Apr 11, 2022
34352fe
Update.
MichalBlk Apr 11, 2022
aecc45a
Further update.
MichalBlk Apr 11, 2022
4848f6a
Remove obsolete klog changes.
MichalBlk Apr 11, 2022
98ae984
FU540
MichalBlk Apr 20, 2022
8602799
Upgrade.
MichalBlk Apr 22, 2022
8af05c2
Merge https://github.com/cahirwpz/mimiker into rv32-first-steps
MichalBlk Apr 22, 2022
e41ac60
Cleanup.
MichalBlk Apr 22, 2022
256093f
Further cleanup.
MichalBlk Apr 22, 2022
a8decd8
Merge https://github.com/cahirwpz/mimiker into rv32-first-steps
MichalBlk Apr 22, 2022
5dcb24c
Merge https://github.com/cahirwpz/mimiker into rv32-first-steps
MichalBlk Apr 22, 2022
48d746d
Initialize the SBI module.
MichalBlk Apr 22, 2022
f1ba705
Add SBI header.
MichalBlk Apr 22, 2022
e363856
Simplify boot.c a bit.
cahirwpz Apr 25, 2022
9a66610
Fixes.
MichalBlk Apr 25, 2022
e3d6960
Update.
MichalBlk Apr 25, 2022
79b8a50
Latest update.
MichalBlk Apr 25, 2022
270037a
Merge branch 'master' into kernel-init
cahirwpz Apr 25, 2022
a234752
Basic simplebus.
MichalBlk May 2, 2022
9d2b285
Merge branch 'sb-v0' of https://github.com/MichalBlk/mimiker into ker…
MichalBlk May 2, 2022
385f614
Basic simplebus.
MichalBlk May 2, 2022
32d8850
Simplebus.
MichalBlk May 2, 2022
f458e44
Merge branch 'sb-v0' of https://github.com/MichalBlk/mimiker into ker…
MichalBlk May 2, 2022
5db23c3
Fixes.
MichalBlk May 2, 2022
ac368bf
Trap cleanup.
MichalBlk May 2, 2022
e1b0acb
Further fixes.
MichalBlk May 2, 2022
7360f93
Remove unused function.
MichalBlk May 2, 2022
d3ca066
Introduce simplebus-local FDT resource getters and add description fo…
MichalBlk May 5, 2022
08c8671
Cleanup.
MichalBlk May 5, 2022
371c456
Zero the tuple before filling it.
MichalBlk May 5, 2022
89c5db7
Generic pmap.
MichalBlk May 6, 2022
8c0276e
Merge https://github.com/cahirwpz/mimiker into gen-pmap
MichalBlk May 6, 2022
35037bd
Adapt RISC-V to the change.
MichalBlk May 6, 2022
0aa818d
Cleanup.
MichalBlk May 6, 2022
4471152
Rename intr struct member from node to iparent.
MichalBlk May 6, 2022
22a1055
Don't allocate fdt region struct on kernel's stack.
MichalBlk May 6, 2022
8976470
Merge branch 'master' into sb-v0
cahirwpz May 6, 2022
8aaa781
Update.
MichalBlk May 6, 2022
ec8c8d6
Fix error setting.
MichalBlk May 6, 2022
f4fe0e8
RV exception entry points.
MichalBlk May 12, 2022
491d6f0
Data copying.
MichalBlk May 12, 2022
5c98991
RV context switch.
MichalBlk May 12, 2022
d66791b
Utilize FreeBSD's copy routines.
MichalBlk May 13, 2022
268ef68
Update.
MichalBlk May 13, 2022
198362c
Update.
MichalBlk May 13, 2022
4b1332f
Conditional SUM usage.
MichalBlk May 13, 2022
37086ef
Add SUM handling.
MichalBlk May 13, 2022
f24f873
Merge branch 'conditional-sum' of https://github.com/MichalBlk/mimike…
MichalBlk May 13, 2022
3d99e94
Remove obsolete define.
MichalBlk May 13, 2022
c27896c
Conditional SUM usage.
MichalBlk May 13, 2022
73327cf
Update.
MichalBlk May 16, 2022
e109414
Move common asm macros to asm.h.
MichalBlk May 16, 2022
216bd70
Move common asm macros to asm.h.
MichalBlk May 16, 2022
d012dbc
Remove needless define.
MichalBlk May 16, 2022
9199fd5
Fix.
MichalBlk May 16, 2022
cf41c4e
Fix.
MichalBlk May 16, 2022
2c7c4d3
Update.
MichalBlk May 16, 2022
e42872e
Update CFI bug comment.
MichalBlk May 16, 2022
fe08ae9
Further work.
MichalBlk May 16, 2022
01d1cc8
Update.
MichalBlk May 16, 2022
9855eac
Update the comments.
MichalBlk May 16, 2022
550462e
Update.
MichalBlk May 16, 2022
e4a405f
Update exc.
MichalBlk May 16, 2022
9be066b
Update switch.
MichalBlk May 16, 2022
492638c
Update copy.
MichalBlk May 16, 2022
8197afd
Cleanup.
MichalBlk May 16, 2022
7390028
Change const.
MichalBlk May 16, 2022
c6a534e
Pmap update WIP.
MichalBlk May 16, 2022
7d076b4
pmap doesn't work yet.
MichalBlk May 19, 2022
a9bba59
Rename SUM to MI TRAP_USER_ACCESS.
MichalBlk May 19, 2022
ec7bb19
Upgrade.
MichalBlk May 20, 2022
4768cc7
Emulation for kernel pages is needed for tests.
MichalBlk May 20, 2022
1760cf2
Update.
MichalBlk May 20, 2022
2767627
Update gen pmap.
MichalBlk May 20, 2022
f769b1e
Add MI single pd handling.
MichalBlk May 20, 2022
fe30d26
Update.
MichalBlk May 20, 2022
10d1ec1
RV pmap implementation.
MichalBlk May 20, 2022
6997b51
LiteX VexRiscv dts.
MichalBlk May 20, 2022
e78d15a
Use comma as string separator in dts.
MichalBlk May 20, 2022
9fa42b7
Merge https://github.com/cahirwpz/mimiker into litex-riscv-dts
MichalBlk May 20, 2022
811f49c
Update and cleanup.
MichalBlk May 20, 2022
b6826be
Upgrade.
MichalBlk May 20, 2022
9836d2c
Update defines.
MichalBlk May 20, 2022
5006dad
Update.
MichalBlk May 20, 2022
e57ccf1
Merge branch 'gen-pmap' of https://github.com/MichalBlk/mimiker into …
MichalBlk May 20, 2022
0bb017f
Fixes due to fack that KASAN can also create kernel mappings.
MichalBlk May 20, 2022
0925dd2
Merge branch 'gen-pmap' of https://github.com/MichalBlk/mimiker into …
MichalBlk May 20, 2022
3b00d6c
Update.
MichalBlk May 20, 2022
4149535
Cleanup.
MichalBlk May 21, 2022
8721aa4
Merge with RV pmap PR.
MichalBlk May 21, 2022
c686c67
Further cleanup.
MichalBlk May 21, 2022
1986e62
Update.
MichalBlk May 23, 2022
694112f
Fixes.
MichalBlk May 23, 2022
8f99e20
Cleanup.
MichalBlk May 23, 2022
5e5f182
Change the ordering of clint interrupts.
MichalBlk May 23, 2022
7824ab1
Fix simplebus.
MichalBlk May 23, 2022
2eda5be
Cleanup.
MichalBlk May 23, 2022
57b8190
Use commas as string separators in dts.
MichalBlk May 24, 2022
c426151
Remove SHARED_KERNEL_PD and cleanup.
MichalBlk May 26, 2022
5b50a0a
Update.
MichalBlk May 26, 2022
f5f651c
Update.
MichalBlk May 26, 2022
ca8cd41
Use MD macros.
MichalBlk May 26, 2022
5aeabab
Update.
MichalBlk May 26, 2022
f3cda97
Cleanup.
MichalBlk May 26, 2022
61b63c5
Merge with master.
MichalBlk May 26, 2022
5fcaa1d
Extract common KASAN MI code to the KASAN module.
MichalBlk May 26, 2022
6d8fb50
Update.
MichalBlk May 26, 2022
e5ff962
RV KASAN.
MichalBlk May 27, 2022
8e7c4c0
Merge branch 'fix-simplebus' of https://github.com/MichalBlk/mimiker …
MichalBlk May 27, 2022
a20ded0
RV64 toolchain.
MichalBlk May 27, 2022
8cfaa8c
Upgrade.
MichalBlk May 27, 2022
887ac0c
Merge with master.
MichalBlk May 26, 2022
3d6a3ac
Cleanup.
MichalBlk May 27, 2022
21dce2f
Apply suggested changes.
MichalBlk Jun 2, 2022
579d2b4
Merge https://github.com/cahirwpz/mimiker into gen-pmap
MichalBlk Jun 2, 2022
d456a05
Merge https://github.com/cahirwpz/mimiker into rv-gen-pmap
MichalBlk Jun 2, 2022
095a053
Update.
MichalBlk Jun 3, 2022
543e500
Merge with master.
MichalBlk Jun 3, 2022
5446a6b
Update.
MichalBlk Jun 3, 2022
e109ab6
Uncomment code.
MichalBlk Jun 3, 2022
397fbd4
Update.
MichalBlk Jun 3, 2022
3db76d1
Merge branch 'litex-riscv-dts' of https://github.com/MichalBlk/mimike…
MichalBlk Jun 3, 2022
cdfa0d7
Merge with dts PR.
MichalBlk Jun 3, 2022
3886b17
Upgrade.
MichalBlk Jun 3, 2022
436326a
Update and fixes.
MichalBlk Jun 13, 2022
b2c19e5
Update
MichalBlk Jun 19, 2022
9baae36
Use dmap.
MichalBlk Jun 19, 2022
1f870e2
Access vm_page_t struct using dmap.
MichalBlk Jun 20, 2022
a0e64a9
Fix compilation issues.
MichalBlk Jun 20, 2022
2fa22ff
Update.
MichalBlk Jun 20, 2022
feb2060
Cleanup.
MichalBlk Jun 20, 2022
04252ce
Sifive Unleashed build target.
MichalBlk Jun 20, 2022
b228152
RV64 boot.
MichalBlk Jun 20, 2022
91a007b
Fix rv32 compilation.
MichalBlk Jun 20, 2022
21326fe
Merge branch 'master' into rv64-boot
cahirwpz Jun 20, 2022
f177ae6
Cleanup.
MichalBlk Jun 21, 2022
e011f71
Rename fu540 to sifive_u.
MichalBlk Jun 23, 2022
1482b8b
Rely on load addresses.
MichalBlk Jun 23, 2022
ae95389
Simplify the code.
MichalBlk Jun 24, 2022
6911a97
Merge https://github.com/cahirwpz/mimiker into rv64-boot
MichalBlk Jun 24, 2022
ca3f688
Merge branch 'master' into rv64-boot
cahirwpz Jun 25, 2022
cfc94c0
Merge branch 'master' into dmap-vm_page
cahirwpz Jun 25, 2022
5aee1a9
Remove redundant assert.
MichalBlk Jul 3, 2022
5a81333
Change global pointer calculation.
MichalBlk Jul 3, 2022
1bb2458
Use QEmu's OpenSBI.
MichalBlk Jul 3, 2022
50a0fa7
Update.
MichalBlk Jul 3, 2022
2019bdd
Rootdev unification.
MichalBlk Jul 3, 2022
2ecdbbd
Update.
MichalBlk Jul 3, 2022
a48349f
Keep up to date with dmap usage.
MichalBlk Jul 3, 2022
0939183
Keep up to date with dmap usage.
MichalBlk Jul 3, 2022
fa8e827
Cleanup.
MichalBlk Jul 4, 2022
ac0c346
Launch dtb processing.
MichalBlk Jul 4, 2022
0a5d59d
Change qemu binary.
MichalBlk Jul 4, 2022
90cd03b
SiFive_u launch.
MichalBlk Jul 4, 2022
f6c05dc
Update.
MichalBlk Jul 4, 2022
5112d32
Update.
MichalBlk Jul 4, 2022
b004315
Fixes.
MichalBlk Jul 7, 2022
ae960b3
Merge https://github.com/cahirwpz/mimiker into su
MichalBlk Jul 7, 2022
3708f80
Update.
MichalBlk Jul 8, 2022
fc1d064
Debugging...
MichalBlk Jul 8, 2022
d78fa79
Merge branch 'kgprof-instr' of https://github.com/wiklam/mimiker into su
MichalBlk Jul 8, 2022
4e21fa6
fu540 dts.
MichalBlk Jul 8, 2022
6e031d1
Update.
MichalBlk Jul 8, 2022
86d6390
Quick hack to KASAN enabled build with Clang.
cahirwpz Jul 10, 2022
97b78b3
TARGET is different for Clang and Gcc.
cahirwpz Jul 11, 2022
7c68d86
Enable KASAN & LOCKDEP on every CI build.
cahirwpz Jul 11, 2022
395742c
Better definition of weak & strong aliases.
cahirwpz Jul 11, 2022
752f178
Pass TARGET definition directly to Clang.
cahirwpz Jul 11, 2022
b1e4f85
Remove accidentaly added semicolon.
cahirwpz Jul 11, 2022
2c7b47d
Resolve issues with relocations on RISCV
cahirwpz Jul 11, 2022
c140418
Fix warnings reported by Clang 14.
cahirwpz Jul 11, 2022
1550681
Fix linking with LLD 14.
cahirwpz Jul 11, 2022
83ccc06
Do not inline calls to __asan_{load,store}* functions.
cahirwpz Jul 11, 2022
20ec67a
Fix Clang generating wrong code for call_ctors.
cahirwpz Jul 11, 2022
e4fb79f
Fix kernel stack overflow detection.
cahirwpz Jul 11, 2022
b592e0f
Update.
MichalBlk Jul 12, 2022
aba18d3
Update.
MichalBlk Jul 12, 2022
1075007
Merge branch 'clang-kasan' of https://github.com/cahirwpz/mimiker int…
MichalBlk Jul 12, 2022
a8a7a69
Once again. Update...
MichalBlk Jul 12, 2022
78950e5
Fix formatting.
MichalBlk Jul 12, 2022
28d8043
Further work.
MichalBlk Jul 12, 2022
55e4ee2
Update.
MichalBlk Jul 12, 2022
a00319b
RV dbg ctx.
MichalBlk Jul 12, 2022
1743771
Update.
MichalBlk Jul 12, 2022
203cf3c
Bootargs patch.
MichalBlk Jul 12, 2022
59db9d6
Merge branch 'master' into sifive_u-dts
cahirwpz Jul 13, 2022
c66dac3
Merge branch 'master' into kernel-init
cahirwpz Jul 13, 2022
9549d2d
Launch initrd boundaries setting.
MichalBlk Jul 14, 2022
e9d057e
Update.
MichalBlk Jul 14, 2022
b079991
Rename the bootargs patch.
MichalBlk Jul 14, 2022
43769c7
Merge https://github.com/cahirwpz/mimiker into sifive_u-dts
MichalBlk Jul 14, 2022
ea2ca43
Add initrd load address for sifive_u.
MichalBlk Jul 14, 2022
acfd98b
Update.
MichalBlk Jul 14, 2022
89a07e2
Merge branch 'master' into su
cahirwpz Jul 23, 2022
c940efb
Merge branch 'master' into kernel-init
cahirwpz Jul 23, 2022
8f6d4f7
Fixes after merge.
cahirwpz Jul 23, 2022
694c190
Merge branch 'su' into kernel-init
cahirwpz Jul 23, 2022
e9eb025
Remove launch.dts
cahirwpz Jul 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/tetris/tetris.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ main(int argc, char *argv[])
if (argc)
usage();

fallrate = 2000000 / level;
fallrate = /*2000000*/ 150000 / level;

for (i = 0; i <= (NUMKEYS-1); i++) {
for (j = i+1; j <= (NUMKEYS-1); j++) {
Expand Down
3 changes: 0 additions & 3 deletions etc/.kshrc
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
export TERM=xterm
if [ "$(stty size)" == "0 0" ]; then
setwinsize
fi
2 changes: 2 additions & 0 deletions include/riscv/cpufunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#define __wfi() __asm__ volatile("wfi")

#define __fence_i() __asm __volatile("fence.i" ::: "memory")

#define __sfence_vma() __asm__ volatile("sfence.vma" ::: "memory")

#define __sp() \
Expand Down
1 change: 1 addition & 0 deletions sys/drv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ SOURCES-RISCV = \
liteuart.c \
plic.c \
riscv_rootdev.c \
sbi_console.c \
sifive_uart.c

CPPFLAGS += -D_MACHDEP
Expand Down
1 change: 0 additions & 1 deletion sys/drv/liteuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
typedef struct liteuart_state {
resource_t *csrs;
resource_t *irq;
thread_t *thread;
} liteuart_state_t;

/*
Expand Down
22 changes: 22 additions & 0 deletions sys/drv/sbi_console.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <sys/console.h>
#include <riscv/sbi.h>

static void sbi_console_init(console_t *cn __unused) {
}

static int sbi_console_getc(console_t *cn __unused) {
return sbi_console_getchar();
}

static void sbi_console_putc(console_t *cn __unused, int c) {
sbi_console_putchar(c);
}

static console_t sbi_console = {
.cn_init = sbi_console_init,
.cn_getc = sbi_console_getc,
.cn_putc = sbi_console_putc,
.cn_prio = 1,
};

CONSOLE_ADD(sbi_console);
6 changes: 6 additions & 0 deletions sys/gen/pmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ static pte_t *pmap_lookup_pte(pmap_t *pmap, vaddr_t va) {
static void pmap_write_pte(pmap_t *pmap, pte_t *ptep, pte_t pte, vaddr_t va) {
*ptep = pte;
tlb_invalidate(va, pmap->asid);
#ifdef __riscv
#include <machine/cpufunc.h>
if (pte_access(pte, VM_PROT_EXEC))
__fence_i();
#endif
}

/* Return PTE pointer for `va`. Allocate page table if needed. */
Expand Down Expand Up @@ -218,6 +223,7 @@ void pmap_kenter(vaddr_t va, paddr_t pa, vm_prot_t prot, unsigned flags) {
WITH_MTX_LOCK (&pmap->mtx) {
pte_t *ptep = pmap_ensure_pte(pmap, va);
pmap_write_pte(pmap, ptep, pte, va);
assert(page_aligned_p(pte_frame(*ptep)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion sys/kern/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ resource_t *device_take_resource(device_t *dev, res_type_t type, int rid,
if (!r)
return NULL;

if ((type != RT_IRQ) && flags & RF_ACTIVE)
if ((type != RT_IRQ) && (flags & RF_ACTIVE))
bus_activate_resource(dev, r);

return r;
Expand Down
2 changes: 2 additions & 0 deletions sys/kern/klog.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ void klog_append(klog_origin_t origin, const char *file, unsigned line,
if (klog.first == klog.last)
klog.first = next(klog.first);
}

// klog_dump();
}

unsigned klog_setmask(unsigned newmask) {
Expand Down
3 changes: 3 additions & 0 deletions sys/kern/vm_physmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ MTX_DEFINE(vm_kernel_end_lock, 0);
void _vm_physseg_plug(paddr_t start, paddr_t end, bool used) {
assert(page_aligned_p(start) && page_aligned_p(end) && start < end);

klog("%s: %p - %p, used=%d", __func__, start, end, used);

static vm_physseg_t freeseg[VM_PHYSSEG_NMAX];
static unsigned freeseg_last = 0;

Expand Down Expand Up @@ -208,6 +210,7 @@ static vm_page_t *pm_take_page(size_t fl) {
}

vm_page_t *vm_page_alloc(size_t npages) {
assert(vm_boot_done);
assert((npages > 0) && powerof2(npages));

SCOPED_MTX_LOCK(&physmem_lock);
Expand Down