diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index f0a48de..b70710b --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ fs.img -*.S \ No newline at end of file +./VSCodeCounter/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules old mode 100644 new mode 100755 index 79e69ae..12ea1bc --- a/.gitmodules +++ b/.gitmodules @@ -7,4 +7,4 @@ url = git@github.com:Ko-oK-OS/xv6-mkfs.git [submodule "xv6-user"] path = xv6-user - url = git@github.com:Ko-oK-OS/xv6-user.git + url = git@github.com:Rand312/xv6-user.git \ No newline at end of file diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log new file mode 100644 index 0000000..2cb586c --- /dev/null +++ b/.vscode/configurationCache.log @@ -0,0 +1 @@ +{"buildTargets":["asm","clean","fs.img","kernel/target/riscv64gc-unknown-none-elf/debug/kernel","run","xv6-mkfs/mkfs","xv6-user/_forktest","xv6-user/initcode","xv6-user/start.o","xv6-user/usys.S","xv6-user/usys.o","xv6-user/uthread/getcontext.o","xv6-user/uthread/setcontext.o","xv6-user/uthread/ucontext.o","xv6-user/uthread/uswtch.o","xv6-user/uthread/uthread.o"],"launchTargets":["/home/rand/xv6-rust/xv6-mkfs>mkfs()","/home/rand/xv6-rust/xv6-user>_cat()","/home/rand/xv6-rust/xv6-user>_echo()","/home/rand/xv6-rust/xv6-user>_fifo_test1()","/home/rand/xv6-rust/xv6-user>_fifo_test2()","/home/rand/xv6-rust/xv6-user>_fork_test()","/home/rand/xv6-rust/xv6-user>_forktest()","/home/rand/xv6-rust/xv6-user>_init()","/home/rand/xv6-rust/xv6-user>_ls()","/home/rand/xv6-rust/xv6-user>_malloc_test()","/home/rand/xv6-rust/xv6-user>_mkdir()","/home/rand/xv6-rust/xv6-user>_msgtest1()","/home/rand/xv6-rust/xv6-user>_msgtest2()","/home/rand/xv6-rust/xv6-user>_pipe_test()","/home/rand/xv6-rust/xv6-user>_rm()","/home/rand/xv6-rust/xv6-user>_sem_test1()","/home/rand/xv6-rust/xv6-user>_sem_test2()","/home/rand/xv6-rust/xv6-user>_sh()","/home/rand/xv6-rust/xv6-user>_shmtest1()","/home/rand/xv6-rust/xv6-user>_shmtest2()","/home/rand/xv6-rust/xv6-user>_stressfs()","/home/rand/xv6-rust/xv6-user>_thread_test()","/home/rand/xv6-rust/xv6-user>_touch()","/home/rand/xv6-rust/xv6-user>_uthreadtest()","/home/rand/xv6-rust/xv6-user>_wc()","/home/rand/xv6-rust>xv6-mkfs/mkfs(fs.img,README.md,xv6-user/_init,xv6-user/_sh,xv6-user/_echo,xv6-user/_ls,xv6-user/_mkdir,xv6-user/_touch,xv6-user/_cat,xv6-user/_rm,xv6-user/_wc,xv6-user/_forktest,xv6-user/_stressfs,xv6-user/_sem_test1,xv6-user/_sem_test2,xv6-user/_thread_test,xv6-user/_malloc_test,xv6-user/_fork_test,xv6-user/_fifo_test1,xv6-user/_fifo_test2,xv6-user/_pipe_test,xv6-user/_uthreadtest,xv6-user/_msgtest1,xv6-user/_msgtest2,xv6-user/_shmtest1,xv6-user/_shmtest2)"],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":["/home/rand/xv6-rust/xv6-mkfs","/home/rand/xv6-rust/xv6-user","/home/rand/xv6-rust/xv6-user/uthread"],"compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/shmtest2.o","xv6-user/shmtest2.c"],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","windowsSdkVersion":""},"fileIndex":[["/home/rand/xv6-rust/xv6-mkfs/mkfs.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-mkfs/mkfs.c","path":"/home/rand/xv6-rust/xv6-mkfs/mkfs.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/gcc","compilerArgs":["-Werror","-Wall","-o","xv6-mkfs/mkfs","xv6-mkfs/mkfs.c"],"windowsSdkVersion":""},"compileCommand":{"command":"gcc -Werror -Wall -I./xv6-user -o xv6-mkfs/mkfs xv6-mkfs/mkfs.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-mkfs/mkfs.c"}}],["/home/rand/xv6-rust/xv6-user/init.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/init.c","path":"/home/rand/xv6-rust/xv6-user/init.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/init.o","xv6-user/init.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/init.o xv6-user/init.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/init.c"}}],["/home/rand/xv6-rust/xv6-user/ulib.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/ulib.c","path":"/home/rand/xv6-rust/xv6-user/ulib.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/ulib.o","xv6-user/ulib.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/ulib.o xv6-user/ulib.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/ulib.c"}}],["/home/rand/xv6-rust/xv6-user/printf.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/printf.c","path":"/home/rand/xv6-rust/xv6-user/printf.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/printf.o","xv6-user/printf.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/printf.o xv6-user/printf.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/printf.c"}}],["/home/rand/xv6-rust/xv6-user/umalloc.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/umalloc.c","path":"/home/rand/xv6-rust/xv6-user/umalloc.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/umalloc.o","xv6-user/umalloc.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/umalloc.o xv6-user/umalloc.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/umalloc.c"}}],["/home/rand/xv6-rust/xv6-user/thread.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/thread.c","path":"/home/rand/xv6-rust/xv6-user/thread.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/thread.o","xv6-user/thread.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/thread.o xv6-user/thread.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/thread.c"}}],["/home/rand/xv6-rust/xv6-user/uthread/ucontext.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/uthread/ucontext.c","path":"/home/rand/xv6-rust/xv6-user/uthread/ucontext.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","xv6-user/uthread/getcontext.o","xv6-user/uthread/setcontext.o","xv6-user/uthread/ucontext.c","-o","xv6-user/uthread/ucontext.o"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.c -o xv6-user/uthread/ucontext.o","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/uthread/ucontext.c"}}],["/home/rand/xv6-rust/xv6-user/uthread/uthread.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/uthread/uthread.c","path":"/home/rand/xv6-rust/xv6-user/uthread/uthread.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","xv6-user/uthread/uthread.c","-o","xv6-user/uthread/uthread.o"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c xv6-user/uthread/uthread.c -o xv6-user/uthread/uthread.o","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/uthread/uthread.c"}}],["/home/rand/xv6-rust/xv6-user/sh.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/sh.c","path":"/home/rand/xv6-rust/xv6-user/sh.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/sh.o","xv6-user/sh.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/sh.o xv6-user/sh.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/sh.c"}}],["/home/rand/xv6-rust/xv6-user/echo.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/echo.c","path":"/home/rand/xv6-rust/xv6-user/echo.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/echo.o","xv6-user/echo.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/echo.o xv6-user/echo.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/echo.c"}}],["/home/rand/xv6-rust/xv6-user/ls.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/ls.c","path":"/home/rand/xv6-rust/xv6-user/ls.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/ls.o","xv6-user/ls.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/ls.o xv6-user/ls.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/ls.c"}}],["/home/rand/xv6-rust/xv6-user/mkdir.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/mkdir.c","path":"/home/rand/xv6-rust/xv6-user/mkdir.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/mkdir.o","xv6-user/mkdir.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/mkdir.o xv6-user/mkdir.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/mkdir.c"}}],["/home/rand/xv6-rust/xv6-user/touch.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/touch.c","path":"/home/rand/xv6-rust/xv6-user/touch.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/touch.o","xv6-user/touch.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/touch.o xv6-user/touch.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/touch.c"}}],["/home/rand/xv6-rust/xv6-user/cat.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/cat.c","path":"/home/rand/xv6-rust/xv6-user/cat.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/cat.o","xv6-user/cat.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/cat.o xv6-user/cat.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/cat.c"}}],["/home/rand/xv6-rust/xv6-user/rm.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/rm.c","path":"/home/rand/xv6-rust/xv6-user/rm.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/rm.o","xv6-user/rm.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/rm.o xv6-user/rm.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/rm.c"}}],["/home/rand/xv6-rust/xv6-user/wc.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/wc.c","path":"/home/rand/xv6-rust/xv6-user/wc.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/wc.o","xv6-user/wc.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/wc.o xv6-user/wc.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/wc.c"}}],["/home/rand/xv6-rust/xv6-user/forktest.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/forktest.c","path":"/home/rand/xv6-rust/xv6-user/forktest.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/forktest.o","xv6-user/forktest.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/forktest.o xv6-user/forktest.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/forktest.c"}}],["/home/rand/xv6-rust/xv6-user/stressfs.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/stressfs.c","path":"/home/rand/xv6-rust/xv6-user/stressfs.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/stressfs.o","xv6-user/stressfs.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/stressfs.o xv6-user/stressfs.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/stressfs.c"}}],["/home/rand/xv6-rust/xv6-user/sem_test1.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/sem_test1.c","path":"/home/rand/xv6-rust/xv6-user/sem_test1.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/sem_test1.o","xv6-user/sem_test1.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/sem_test1.o xv6-user/sem_test1.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/sem_test1.c"}}],["/home/rand/xv6-rust/xv6-user/sem_test2.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/sem_test2.c","path":"/home/rand/xv6-rust/xv6-user/sem_test2.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/sem_test2.o","xv6-user/sem_test2.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/sem_test2.o xv6-user/sem_test2.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/sem_test2.c"}}],["/home/rand/xv6-rust/xv6-user/thread_test.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/thread_test.c","path":"/home/rand/xv6-rust/xv6-user/thread_test.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/thread_test.o","xv6-user/thread_test.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/thread_test.o xv6-user/thread_test.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/thread_test.c"}}],["/home/rand/xv6-rust/xv6-user/malloc_test.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/malloc_test.c","path":"/home/rand/xv6-rust/xv6-user/malloc_test.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/malloc_test.o","xv6-user/malloc_test.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/malloc_test.o xv6-user/malloc_test.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/malloc_test.c"}}],["/home/rand/xv6-rust/xv6-user/fork_test.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/fork_test.c","path":"/home/rand/xv6-rust/xv6-user/fork_test.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/fork_test.o","xv6-user/fork_test.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/fork_test.o xv6-user/fork_test.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/fork_test.c"}}],["/home/rand/xv6-rust/xv6-user/fifo_test1.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/fifo_test1.c","path":"/home/rand/xv6-rust/xv6-user/fifo_test1.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/fifo_test1.o","xv6-user/fifo_test1.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/fifo_test1.o xv6-user/fifo_test1.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/fifo_test1.c"}}],["/home/rand/xv6-rust/xv6-user/fifo_test2.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/fifo_test2.c","path":"/home/rand/xv6-rust/xv6-user/fifo_test2.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/fifo_test2.o","xv6-user/fifo_test2.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/fifo_test2.o xv6-user/fifo_test2.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/fifo_test2.c"}}],["/home/rand/xv6-rust/xv6-user/pipe_test.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/pipe_test.c","path":"/home/rand/xv6-rust/xv6-user/pipe_test.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/pipe_test.o","xv6-user/pipe_test.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/pipe_test.o xv6-user/pipe_test.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/pipe_test.c"}}],["/home/rand/xv6-rust/xv6-user/uthreadtest.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/uthreadtest.c","path":"/home/rand/xv6-rust/xv6-user/uthreadtest.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/uthreadtest.o","xv6-user/uthreadtest.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/uthreadtest.o xv6-user/uthreadtest.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/uthreadtest.c"}}],["/home/rand/xv6-rust/xv6-user/msgtest1.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/msgtest1.c","path":"/home/rand/xv6-rust/xv6-user/msgtest1.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/msgtest1.o","xv6-user/msgtest1.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/msgtest1.o xv6-user/msgtest1.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/msgtest1.c"}}],["/home/rand/xv6-rust/xv6-user/msgtest2.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/msgtest2.c","path":"/home/rand/xv6-rust/xv6-user/msgtest2.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/msgtest2.o","xv6-user/msgtest2.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/msgtest2.o xv6-user/msgtest2.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/msgtest2.c"}}],["/home/rand/xv6-rust/xv6-user/shmtest1.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/shmtest1.c","path":"/home/rand/xv6-rust/xv6-user/shmtest1.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/shmtest1.o","xv6-user/shmtest1.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/shmtest1.o xv6-user/shmtest1.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/shmtest1.c"}}],["/home/rand/xv6-rust/xv6-user/shmtest2.c",{"uri":{"$mid":1,"fsPath":"/home/rand/xv6-rust/xv6-user/shmtest2.c","path":"/home/rand/xv6-rust/xv6-user/shmtest2.c","scheme":"file"},"configuration":{"defines":[],"includePath":["/home/rand/xv6-rust/xv6-user"],"forcedInclude":[],"compilerPath":"/usr/bin/riscv64-unknown-elf-gcc","compilerArgs":["-Wall","-O","-fno-omit-frame-pointer","-ggdb","-MD","-mcmodel=medany","-ffreestanding","-fno-common","-nostdlib","-mno-relax","-fno-stack-protector","-fno-pie","-no-pie","-c","-o","xv6-user/shmtest2.o","xv6-user/shmtest2.c"],"windowsSdkVersion":""},"compileCommand":{"command":"riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/shmtest2.o xv6-user/shmtest2.c","directory":"/home/rand/xv6-rust","file":"/home/rand/xv6-rust/xv6-user/shmtest2.c"}}]]}} \ No newline at end of file diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log new file mode 100644 index 0000000..9870b17 --- /dev/null +++ b/.vscode/dryrun.log @@ -0,0 +1,139 @@ +make --dry-run --always-make --keep-going --print-directory +make: Entering directory '/home/rand/xv6-rust' +gcc -Werror -Wall -I./xv6-user -o xv6-mkfs/mkfs xv6-mkfs/mkfs.c + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/init.o xv6-user/init.c +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/ulib.o xv6-user/ulib.c +perl xv6-user/usys.pl > xv6-user/usys.S +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/usys.o xv6-user/usys.S +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/printf.o xv6-user/printf.c +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/umalloc.o xv6-user/umalloc.c +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/thread.o xv6-user/thread.c +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/start.o xv6-user/start.S +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/uthread/getcontext.o xv6-user/uthread/getcontext.S +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/uthread/setcontext.o xv6-user/uthread/setcontext.S + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.c -o xv6-user/uthread/ucontext.o +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/uthread/uswtch.o xv6-user/uthread/uswtch.S + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c xv6-user/uthread/uthread.c -o xv6-user/uthread/uthread.o +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_init xv6-user/init.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_init > xv6-user/init.asm +riscv64-unknown-elf-objdump -t xv6-user/_init | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/init.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/sh.o xv6-user/sh.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_sh xv6-user/sh.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_sh > xv6-user/sh.asm +riscv64-unknown-elf-objdump -t xv6-user/_sh | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/sh.sym +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/echo.o xv6-user/echo.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_echo xv6-user/echo.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_echo > xv6-user/echo.asm +riscv64-unknown-elf-objdump -t xv6-user/_echo | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/echo.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/ls.o xv6-user/ls.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_ls xv6-user/ls.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_ls > xv6-user/ls.asm +riscv64-unknown-elf-objdump -t xv6-user/_ls | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/ls.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/mkdir.o xv6-user/mkdir.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_mkdir xv6-user/mkdir.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_mkdir > xv6-user/mkdir.asm +riscv64-unknown-elf-objdump -t xv6-user/_mkdir | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/mkdir.sym +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/touch.o xv6-user/touch.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_touch xv6-user/touch.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_touch > xv6-user/touch.asm +riscv64-unknown-elf-objdump -t xv6-user/_touch | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/touch.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/cat.o xv6-user/cat.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_cat xv6-user/cat.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_cat > xv6-user/cat.asm +riscv64-unknown-elf-objdump -t xv6-user/_cat | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/cat.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/rm.o xv6-user/rm.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_rm xv6-user/rm.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_rm > xv6-user/rm.asm +riscv64-unknown-elf-objdump -t xv6-user/_rm | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/rm.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/wc.o xv6-user/wc.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_wc xv6-user/wc.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_wc > xv6-user/wc.asm +riscv64-unknown-elf-objdump -t xv6-user/_wc | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/wc.sym +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/forktest.o xv6-user/forktest.c +# forktest has less library code linked in - needs to be small +# in order to be able to max out the proc table. +riscv64-unknown-elf-ld -z max-page-size=4096 -N -e main -Ttext 0 -o xv6-user/_forktest xv6-user/forktest.o xv6-user/ulib.o xv6-user/usys.o +riscv64-unknown-elf-objdump -S xv6-user/_forktest > xv6-user/forktest.asm + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/stressfs.o xv6-user/stressfs.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_stressfs xv6-user/stressfs.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_stressfs > xv6-user/stressfs.asm +riscv64-unknown-elf-objdump -t xv6-user/_stressfs | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/stressfs.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/sem_test1.o xv6-user/sem_test1.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_sem_test1 xv6-user/sem_test1.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_sem_test1 > xv6-user/sem_test1.asm +riscv64-unknown-elf-objdump -t xv6-user/_sem_test1 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/sem_test1.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/sem_test2.o xv6-user/sem_test2.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_sem_test2 xv6-user/sem_test2.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_sem_test2 > xv6-user/sem_test2.asm +riscv64-unknown-elf-objdump -t xv6-user/_sem_test2 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/sem_test2.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/thread_test.o xv6-user/thread_test.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_thread_test xv6-user/thread_test.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_thread_test > xv6-user/thread_test.asm +riscv64-unknown-elf-objdump -t xv6-user/_thread_test | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/thread_test.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/malloc_test.o xv6-user/malloc_test.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_malloc_test xv6-user/malloc_test.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_malloc_test > xv6-user/malloc_test.asm +riscv64-unknown-elf-objdump -t xv6-user/_malloc_test | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/malloc_test.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/fork_test.o xv6-user/fork_test.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_fork_test xv6-user/fork_test.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_fork_test > xv6-user/fork_test.asm +riscv64-unknown-elf-objdump -t xv6-user/_fork_test | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/fork_test.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/fifo_test1.o xv6-user/fifo_test1.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_fifo_test1 xv6-user/fifo_test1.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_fifo_test1 > xv6-user/fifo_test1.asm +riscv64-unknown-elf-objdump -t xv6-user/_fifo_test1 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/fifo_test1.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/fifo_test2.o xv6-user/fifo_test2.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_fifo_test2 xv6-user/fifo_test2.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_fifo_test2 > xv6-user/fifo_test2.asm +riscv64-unknown-elf-objdump -t xv6-user/_fifo_test2 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/fifo_test2.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/pipe_test.o xv6-user/pipe_test.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_pipe_test xv6-user/pipe_test.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_pipe_test > xv6-user/pipe_test.asm +riscv64-unknown-elf-objdump -t xv6-user/_pipe_test | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/pipe_test.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/uthreadtest.o xv6-user/uthreadtest.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_uthreadtest xv6-user/uthreadtest.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_uthreadtest > xv6-user/uthreadtest.asm +riscv64-unknown-elf-objdump -t xv6-user/_uthreadtest | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/uthreadtest.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/msgtest1.o xv6-user/msgtest1.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_msgtest1 xv6-user/msgtest1.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_msgtest1 > xv6-user/msgtest1.asm +riscv64-unknown-elf-objdump -t xv6-user/_msgtest1 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/msgtest1.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/msgtest2.o xv6-user/msgtest2.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_msgtest2 xv6-user/msgtest2.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_msgtest2 > xv6-user/msgtest2.asm +riscv64-unknown-elf-objdump -t xv6-user/_msgtest2 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/msgtest2.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/shmtest1.o xv6-user/shmtest1.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_shmtest1 xv6-user/shmtest1.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_shmtest1 > xv6-user/shmtest1.asm +riscv64-unknown-elf-objdump -t xv6-user/_shmtest1 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/shmtest1.sym + +riscv64-unknown-elf-gcc -Wall -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I./xv6-user -fno-stack-protector -fno-pie -no-pie -c -o xv6-user/shmtest2.o xv6-user/shmtest2.c +riscv64-unknown-elf-ld -z max-page-size=4096 -N -Ttext 0 -o xv6-user/_shmtest2 xv6-user/shmtest2.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o xv6-user/start.o xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.o xv6-user/uthread/uswtch.o xv6-user/uthread/uthread.o +riscv64-unknown-elf-objdump -S xv6-user/_shmtest2 > xv6-user/shmtest2.asm +riscv64-unknown-elf-objdump -t xv6-user/_shmtest2 | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$/d' > xv6-user/shmtest2.sym +xv6-mkfs/mkfs fs.img README.md xv6-user/_init xv6-user/_sh xv6-user/_echo xv6-user/_ls xv6-user/_mkdir xv6-user/_touch xv6-user/_cat xv6-user/_rm xv6-user/_wc xv6-user/_forktest xv6-user/_stressfs xv6-user/_sem_test1 xv6-user/_sem_test2 xv6-user/_thread_test xv6-user/_malloc_test xv6-user/_fork_test xv6-user/_fifo_test1 xv6-user/_fifo_test2 xv6-user/_pipe_test xv6-user/_uthreadtest xv6-user/_msgtest1 xv6-user/_msgtest2 xv6-user/_shmtest1 xv6-user/_shmtest2 +make -C kernel run +make: Leaving directory '/home/rand/xv6-rust' + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..dbcdf8e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "makefile.extensionOutputFolder": "./.vscode", + "files.associations": { + "fcntl.h": "c", + "user.h": "c" + } +} \ No newline at end of file diff --git a/.vscode/targets.log b/.vscode/targets.log new file mode 100644 index 0000000..51d17e1 --- /dev/null +++ b/.vscode/targets.log @@ -0,0 +1,723 @@ +make all --print-data-base --no-builtin-variables --no-builtin-rules --question +make: *** No rule to make target 'all'. Stop. + +# GNU Make 4.2.1 +# Built for x86_64-pc-linux-gnu +# Copyright (C) 1988-2016 Free Software Foundation, Inc. +# License GPLv3+: GNU GPL version 3 or later +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. + +# Make data base, printed on Wed Aug 31 00:58:01 2022 + +# Variables + +# 'override' directive +GNUMAKEFLAGS := +# automatic +/dev/null 2>&1 && echo -fno-stack-protector) -fno-pie -no-pie +# environment +XDG_CONFIG_DIRS = /etc/xdg/xdg-ubuntu:/etc/xdg +# environment +SNAP_INSTANCE_NAME = code +# environment +SNAP_ARCH = amd64 +# makefile (from 'Makefile', line 1) +KERNEL = kernel/target/riscv64gc-unknown-none-elf/debug/kernel +# makefile (from 'Makefile', line 1) +MAKEFILE_LIST := Makefile +# automatic +@F = $(notdir $@) +# environment +GIO_LAUNCHED_DESKTOP_FILE = /var/lib/snapd/desktop/applications/code_code.desktop +# environment +USERNAME = rand +# environment +XDG_DATA_DIRS = /usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop +# environment +DBUS_SESSION_BUS_ADDRESS = unix:path=/run/user/1000/bus +# environment +_ = /snap/code/104/usr/share/code/code +# environment +MANAGERPID = 1098 +# environment +LESSOPEN = | /usr/bin/lesspipe %s +# environment +VSCODE_CWD = /home/rand +# environment +GSETTINGS_SCHEMA_DIR = /snap/code/104/usr/share/glib-2.0/schemas +# default +MAKE_HOST := x86_64-pc-linux-gnu +# environment +PATH = /home/rand/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/include/gstreamer-1.0:/usr/include/gstreamer-1.0:/usr/include/gstreamer-1.0:usr/include/glib-2.0 +# makefile (from 'Makefile', line 8) +LD = riscv64-unknown-elf-ld +# environment +GPG_AGENT_INFO = /run/user/1000/gnupg/S.gpg-agent:0:1 +# environment +SESSION_MANAGER = local/rand-virtual-machine:@/tmp/.ICE-unix/1542,unix/rand-virtual-machine:/tmp/.ICE-unix/1542 +# environment +XDG_RUNTIME_DIR = /run/user/1000 +# environment +GDK_PIXBUF_MODULE_FILE = /home/rand/snap/code/common/.cache/gdk-pixbuf-loaders.cache +# environment +SNAP = /snap/code/104 +# makefile (from 'Makefile', line 5) +CPUS = 1 +# environment +SNAP_VERSION = 6d9b74a7 +# environment +XDG_MENU_PREFIX = gnome- +# environment +DISABLE_WAYLAND = 1 +# environment +ELECTRON_RUN_AS_NODE = 1 +# environment +INVOCATION_ID = 24cf22dc8e2c421db73cc3dde1abd88c +# makefile (from 'Makefile', line 27) +LDFLAGS = -z max-page-size=4096 +# environment +GDK_PIXBUF_MODULEDIR = /snap/code/104/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders +# makefile (from 'Makefile', line 55) +ULIB = $(USER)/ulib.o $(USER)/usys.o $(USER)/printf.o $(USER)/umalloc.o $(USER)/thread.o +# default +.FEATURES := target-specific order-only second-expansion else-if shortest-stem undefine oneshell archives jobserver output-sync check-symlink load +# environment +LS_COLORS = +# environment +XDG_SESSION_DESKTOP = ubuntu +# environment +SSH_AUTH_SOCK = /run/user/1000/keyring/ssh +# environment +GIO_LAUNCHED_DESKTOP_FILE_PID = 32728 +# automatic +%F = $(notdir $%) +# environment +DISPLAY = :0 +# makefile (from 'Makefile', line 4) +UTHREAD = xv6-user/uthread +# environment +SNAP_INSTANCE_KEY = +# environment +PWD = /home/rand/xv6-rust +# default +.LOADED := +# environment +SSH_AGENT_PID = 1507 +# environment +ORIGINAL_XDG_CURRENT_DESKTOP = ubuntu:GNOME +# environment +GTK_MODULES = gail:atk-bridge +# environment +VSCODE_AMD_ENTRYPOINT = vs/workbench/api/node/extensionHostProcess +# environment +HOME = /home/rand +# environment +LESSCLOSE = /usr/bin/lesspipe %s %s +# environment +VSCODE_CLI = 1 +# environment +VSCODE_CODE_CACHE_PATH = /home/rand/.config/Code/CachedData/6d9b74a70ca9c7733b29f0456fd8195364076dda +# environment +LOGNAME = rand +# environment +APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 1 +# environment +SNAP_LIBRARY_PATH = /var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void +# environment +SNAP_CONTEXT = PENnFIpyvub9u-SZFk9fYj40Pbn8lwtpnstV8I5EV0Hm_7i8eDoY +# environment +ELECTRON_NO_ATTACH_CONSOLE = 1 +# environment +SNAP_USER_COMMON = /home/rand/snap/code/common +# environment +VSCODE_HANDLES_UNCAUGHT_ERRORS = true +# environment +GNOME_DESKTOP_SESSION_ID = this-is-deprecated +# automatic +^D = $(patsubst %/,%,$(dir $^)) +# environment +MAKELEVEL := 0 +# environment +SNAP_REAL_HOME = /home/rand +# default +MAKE = $(MAKE_COMMAND) +# default +MAKECMDGOALS := all +# environment +QT_IM_MODULE = ibus +# environment +SNAP_USER_DATA = /home/rand/snap/code/104 +# environment +SHLVL = 0 +# makefile (from 'Makefile', line 7) +CC = riscv64-unknown-elf-gcc +# environment +GNOME_SHELL_SESSION_MODE = ubuntu +# default +MAKE_VERSION := 4.2.1 +# makefile (from 'Makefile', line 2) +USER = xv6-user +# environment +SNAP_REVISION = 104 +# makefile +.DEFAULT_GOAL := run +# makefile (from 'Makefile', line 3) +INCLUDE = xv6-user/include +# environment +XDG_CURRENT_DESKTOP = Unity +# makefile (from 'Makefile', line 57) +CRT = $(ULIB) $(USER)/start.o $(UTHREADLIB) +# makefile (from 'Makefile', line 60) +UTHREADLIB = $(UTHREAD)/getcontext.o $(UTHREAD)/setcontext.o $(UTHREAD)/ucontext.o $(UTHREAD)/uswtch.o $(UTHREAD)/uthread.o +# automatic +%D = $(patsubst %/,%,$(dir $%)) +# default +MAKE_COMMAND := make +# default +.VARIABLES := +# automatic +*F = $(notdir $*) +# environment +LANGUAGE = zh_CN:zh +# environment +VSCODE_IPC_HOOK = /run/user/1000/vscode-f2998c1d-1.70.1-main.sock +# environment +BAMF_DESKTOP_FILE_HINT = /var/lib/snapd/desktop/applications/code_code.desktop +# makefile +MAKEFLAGS = pqrR +# environment +MFLAGS = -pqrR +# automatic +*D = $(patsubst %/,%,$(dir $*)) +# automatic ++D = $(patsubst %/,%,$(dir $+)) +# makefile (from 'Makefile', line 10) +OBJDUMP = riscv64-unknown-elf-objdump +# environment +GDK_BACKEND = x11 +# automatic ++F = $(notdir $+) +# environment +QT_ACCESSIBILITY = 1 +# 'override' directive +.SHELLSTATUS := 1 +# default +MAKEFILES := +# environment +SNAP_COOKIE = PENnFIpyvub9u-SZFk9fYj40Pbn8lwtpnstV8I5EV0Hm_7i8eDoY +# automatic + $*.asm + $(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $*.sym + +# 1 implicit rules, 0 (0.0%) terminal. + +# Files + +# Not a target: +xv6-user/_malloc_test: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_wc: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_shmtest2: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +all: +# Command line target. +# Implicit rule search has been done. +# File does not exist. +# File has not been updated. + +# Not a target: +%.o: +# Precious file (prerequisite of .PRECIOUS). +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/usys.o: xv6-user/usys.S +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 89): + $(CC) $(CFLAGS) -c -o $(USER)/usys.o $(USER)/usys.S + +xv6-user/uthread/ucontext.o: xv6-user/uthread/getcontext.o xv6-user/uthread/setcontext.o xv6-user/uthread/ucontext.c +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 74): + $(CC) $(CFLAGS) -c $^ -o $@ + +# Not a target: +xv6-user/_ls: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_shmtest1: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_thread_test: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/usys.pl: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/ulib.o: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +.PRECIOUS: %.o +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/start.S: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/uthread/setcontext.o: xv6-user/uthread/setcontext.S +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 71): + $(CC) $(CFLAGS) -c -o $@ $^ + +xv6-user/initcode: xv6-user/initcode.S +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 50): + $(CC) $(CFLAGS) -march=rv64g -nostdinc -I. -Iinclude -c $(USER)/initcode.S -o $(USER)/initcode.o + $(LD) $(LDFLAGS) -N -e start -Ttext 0 -o $(USER)/initcode.out $(USER)/initcode.o + $(OBJCOPY) -S -O binary $(USER)/initcode.out $(USER)/initcode + $(OBJDUMP) -S $(USER)/initcode.o > $(USER)/initcode.asm + +# Not a target: +xv6-user/include/fs.h: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/uthread/uthread.o: xv6-user/uthread/uthread.c +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 77): + $(CC) $(CFLAGS) -c $^ -o $@ + +kernel/target/riscv64gc-unknown-none-elf/debug/kernel: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 33): + make -C kernel + +# Not a target: +Makefile: +# Implicit rule search has been done. +# Last modified 2022-06-06 11:38:03.195113361 +# File has been updated. +# Successfully updated. + +# Not a target: +xv6-mkfs/mkfs.c: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/uthread/getcontext.o: xv6-user/uthread/getcontext.S +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 68): + $(CC) $(CFLAGS) -c -o $@ $^ + +# Not a target: +xv6-user/include/param.h: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_fork_test: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_mkdir: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_init: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/usys.S: xv6-user/usys.pl +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 86): + perl $(USER)/usys.pl > $(USER)/usys.S + +# Not a target: +xv6-user/uthread/ucontext.c: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_sem_test1: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_msgtest1: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/uthread/setcontext.S: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +fs.img: xv6-mkfs/mkfs README.md xv6-user/_init xv6-user/_sh xv6-user/_echo xv6-user/_ls xv6-user/_mkdir xv6-user/_touch xv6-user/_cat xv6-user/_rm xv6-user/_wc xv6-user/_forktest xv6-user/_stressfs xv6-user/_sem_test1 xv6-user/_sem_test2 xv6-user/_thread_test xv6-user/_malloc_test xv6-user/_fork_test xv6-user/_fifo_test1 xv6-user/_fifo_test2 xv6-user/_pipe_test xv6-user/_uthreadtest xv6-user/_msgtest1 xv6-user/_msgtest2 xv6-user/_shmtest1 xv6-user/_shmtest2 +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 136): + xv6-mkfs/mkfs fs.img README.md $(UPROGS) + +# Not a target: +xv6-user/initcode.S: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/uthread/uswtch.o: xv6-user/uthread/uswtch.S +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 65): + $(CC) $(CFLAGS) -c -o $@ $^ + +# Not a target: +xv6-user/forktest.o: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_uthreadtest: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/_forktest: xv6-user/forktest.o xv6-user/ulib.o xv6-user/usys.o xv6-user/printf.o xv6-user/umalloc.o xv6-user/thread.o +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 92): + # forktest has less library code linked in - needs to be small + # in order to be able to max out the proc table. + $(LD) $(LDFLAGS) -N -e main -Ttext 0 -o $(USER)/_forktest $(USER)/forktest.o $(USER)/ulib.o $(USER)/usys.o + $(OBJDUMP) -S $(USER)/_forktest > $(USER)/forktest.asm + +# Not a target: +.DEFAULT: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/uthread/uthread.c: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/uthread/getcontext.S: + +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_fifo_test1: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_rm: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +run: fs.img +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 30): + make -C kernel run + +clean: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 39): + rm -rf kernel.S + make -C kernel clean + rm -f $(USER)/*.o $(USER)/*.d $(USER)/*.asm $(USER)/*.sym \ + $(USER)/initcode $(USER)/initcode.out fs.img \ + xv6-mkfs/mkfs $(USER)/usys.S \ + $(UPROGS) + +# Not a target: +xv6-user/_pipe_test: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/thread.o: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_sem_test2: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +user/*.d: +# Implicit rule search has been done. +# File does not exist. +# File has been updated. +# Failed to be updated. + +# Not a target: +xv6-user/_msgtest2: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/printf.o: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_cat: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_sh: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_echo: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/umalloc.o: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-user/start.o: xv6-user/start.S +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 62): + $(CC) $(CFLAGS) -c -o $(USER)/start.o $(USER)/start.S + +# Not a target: +xv6-user/_stressfs: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +asm: kernel/target/riscv64gc-unknown-none-elf/debug/kernel +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 36): + $(OBJDUMP) -S $(KERNEL) > kernel.asm + +# Not a target: +xv6-user/uthread/uswtch.S: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_fifo_test2: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +xv6-user/_touch: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +README.md: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +xv6-mkfs/mkfs: xv6-mkfs/mkfs.c xv6-user/include/fs.h xv6-user/include/param.h +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# recipe to execute (from 'Makefile', line 98): + gcc -Werror -Wall -I./xv6-user -o xv6-mkfs/mkfs xv6-mkfs/mkfs.c + +# files hash-table stats: +# Load=63/1024=6%, Rehash=0, Collisions=6/124=5% +# VPATH Search Paths + +# No 'vpath' search paths. + +# No general ('VPATH' variable) search path. + +# strcache buffers: 1 (0) / strings = 92 / storage = 1372 B / avg = 14 B +# current buf: size = 8162 B / used = 1372 B / count = 92 / avg = 14 B + +# strcache performance: lookups = 141 / hit rate = 34% +# hash-table stats: +# Load=92/8192=1%, Rehash=0, Collisions=4/141=3% +# Finished Make data base on Wed Aug 31 00:58:01 2022 + + diff --git a/Makefile b/Makefile index 86c374f..3c68731 100755 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ KERNEL = kernel/target/riscv64gc-unknown-none-elf/debug/kernel USER = xv6-user INCLUDE = xv6-user/include -CPUS = 3 +UTHREAD = xv6-user/uthread +CPUS = 1 CC = riscv64-unknown-elf-gcc LD = riscv64-unknown-elf-ld OBJCOPY = riscv64-unknown-elf-objcopy OBJDUMP = riscv64-unknown-elf-objdump -CFLAGS = -Wall -Werror -O -fno-omit-frame-pointer -ggdb +CFLAGS = -Wall -O -fno-omit-frame-pointer -ggdb CFLAGS += -MD CFLAGS += -mcmodel=medany CFLAGS += -ffreestanding -fno-common -nostdlib -mno-relax @@ -32,7 +33,7 @@ $(KERNEL): make -C kernel asm: $(KERNEL) - $(OBJDUMP) -S $(KERNEL) > kernel.S + $(OBJDUMP) -S $(KERNEL) > kernel.asm clean: rm -rf kernel.S @@ -42,16 +43,42 @@ clean: xv6-mkfs/mkfs $(USER)/usys.S \ $(UPROGS) + + + $(USER)/initcode: $(USER)/initcode.S $(CC) $(CFLAGS) -march=rv64g -nostdinc -I. -Iinclude -c $(USER)/initcode.S -o $(USER)/initcode.o $(LD) $(LDFLAGS) -N -e start -Ttext 0 -o $(USER)/initcode.out $(USER)/initcode.o $(OBJCOPY) -S -O binary $(USER)/initcode.out $(USER)/initcode $(OBJDUMP) -S $(USER)/initcode.o > $(USER)/initcode.asm -ULIB = $(USER)/ulib.o $(USER)/usys.o $(USER)/printf.o $(USER)/umalloc.o +ULIB = $(USER)/ulib.o $(USER)/usys.o $(USER)/printf.o $(USER)/umalloc.o $(USER)/thread.o + +CRT = $(ULIB) $(USER)/start.o $(UTHREADLIB) + + +UTHREADLIB = $(UTHREAD)/getcontext.o $(UTHREAD)/setcontext.o $(UTHREAD)/ucontext.o $(UTHREAD)/uswtch.o $(UTHREAD)/uthread.o +$(USER)/start.o: $(USER)/start.S + $(CC) $(CFLAGS) -c -o $(USER)/start.o $(USER)/start.S + +$(UTHREAD)/uswtch.o: $(UTHREAD)/uswtch.S + $(CC) $(CFLAGS) -c -o $@ $^ + +$(UTHREAD)/getcontext.o: $(UTHREAD)/getcontext.S + $(CC) $(CFLAGS) -c -o $@ $^ -_%: %.o $(ULIB) - $(LD) $(LDFLAGS) -N -e main -Ttext 0 -o $@ $^ +$(UTHREAD)/setcontext.o: $(UTHREAD)/setcontext.S + $(CC) $(CFLAGS) -c -o $@ $^ + +$(UTHREAD)/ucontext.o: $(UTHREAD)/getcontext.o $(UTHREAD)/setcontext.o $(UTHREAD)/ucontext.c + $(CC) $(CFLAGS) -c $^ -o $@ + +$(UTHREAD)/uthread.o: $(UTHREAD)/uthread.c + $(CC) $(CFLAGS) -c $^ -o $@ + + +_%: %.o $(CRT) + $(LD) $(LDFLAGS) -N -Ttext 0 -o $@ $^ $(OBJDUMP) -S $@ > $*.asm $(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $*.sym @@ -70,6 +97,8 @@ $(USER)/_forktest: $(USER)/forktest.o $(ULIB) xv6-mkfs/mkfs: xv6-mkfs/mkfs.c $(INCLUDE)/fs.h $(INCLUDE)/param.h gcc -Werror -Wall -I./xv6-user -o xv6-mkfs/mkfs xv6-mkfs/mkfs.c + + # Prevent deletion of intermediate files, e.g. cat.o, after first build, so # that disk image changes after first build are persistent until clean. More # details: @@ -85,8 +114,23 @@ UPROGS=\ $(USER)/_touch \ $(USER)/_cat \ $(USER)/_rm \ + $(USER)/_wc \ $(USER)/_forktest \ - $(USER)/_stressfs + $(USER)/_stressfs \ + $(USER)/_sem_test1 \ + $(USER)/_sem_test2 \ + $(USER)/_thread_test \ + $(USER)/_malloc_test \ + $(USER)/_fork_test \ + $(USER)/_fifo_test1 \ + $(USER)/_fifo_test2 \ + $(USER)/_pipe_test \ + $(USER)/_uthreadtest \ + $(USER)/_msgtest1 \ + $(USER)/_msgtest2 \ + $(USER)/_shmtest1 \ + $(USER)/_shmtest2 + fs.img: xv6-mkfs/mkfs README.md $(UPROGS) xv6-mkfs/mkfs fs.img README.md $(UPROGS) diff --git a/README.md b/README.md index 3019967..b7e30a8 100755 --- a/README.md +++ b/README.md @@ -1,168 +1,37 @@ -# xv6-rust -## Introduction +## 项目简介 -![](run.png) +本项目是在去年比赛实现的 xv6-rust 基础之上进行二次开发,主要有两个方面:一是增加新的功能,二是修改完善现有代码的一些 bug,具体如下所示: -This is a try to implement xv6 OS in pure Rust. +- 实现进程间的通信功能: + - 信号量 + - 消息队列 + - 共享内存 + - 管道 -What's more, we are desired to add something new features into our OS, like network and GUI. +- 实现线程协程: + - 内核级线程 + - 用户级线程(协程) -The further goal of this project is to support multiple architecture and multiple boards, finally making our OS running in our own CPU. +- 简单封装运行库 +- 功能改进: + - 页面延迟分配 + - 优先级调度 -For the purpose of supporting the feature of Rust language, I also intend to use `async/await` feature to implement kernel thread scheduler renewedly. +- 修改重构: + - 重写进程结构体及其锁的形式,改用大粒度锁 + - 修改原有管道的 bug + - 修改内存管理的 bug -Due to the complexity of the project and the busy course-work, I think it's hard to complete above work independently, so I'm sincerely hope others can interest on this project and join our teams. +以上便是初赛阶段已完成的一些内容,还有一些目前正在做待完成 -## Start -### QEMU -**Linux**: -``` -wget https://download.qemu.org/qemu-5.0.0.tar.x -tar xvJf qemu-5.0.0.tar.xz -cd qemu-5.0.0 -./configure --target-list=riscv32-softmmu,riscv64-softmmu -make -j$(nproc) -sudo make install -``` -If you find some errors when building, you can slove by following hints: -- `ERROR: pkg-config binary 'pkg-config' not found` : `sudo apt-get install pkg-config` -- `ERROR: glib-2.48 gthread-2.0 is required to compile QEMU`: `sudo apt-get install libglib2.0-dev` -- `ERROR: pixman >= 0.21.8 not present`: `sudo apt-get install libpixman-1-dev` +- 模拟中断实现信号机制 +- 重新组织进程结构体,采用红黑树并实现 CFS 调度算法 +- 写时复制、mmap 等系统调用。 -### Rust -You need download rust to start our environment. We suggest you to use official shell: -``` -curl https://sh.rustup.rs -sSf | sh -``` -If you fail because of slow network speed. You can try this to speed up: -``` -export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static -export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup -curl https://sh.rustup.rs -sSf | sh -``` +## 环境搭建 -If you have finished these, you can test your environment by following commands: -``` -source $HOME/.cargo/env -rustc --version -``` -In addition, we'd better change the package mirror address crates.io used by the package manager cargo to the mirror server of the University of Science and Technology of China to speed up the download of the tripartite library. We open (create a new file if it doesn't exist) ~/.cargo/config and modify the content to: -``` -[source.crates-io] -registry = "https://github.com/rust-lang/crates.io-index" -replace-with = 'ustc' -[source.ustc] -registry = "git://mirrors.ustc.edu.cn/crates.io-index" -``` -Besides, you also update some tools in rust: +[环境搭建](doc/环境搭建.pdf) -``` -rustup target add riscv64gc-unknown-none-elf -cargo install cargo-binutils -rustup component add llvm-tools-preview -``` +## 设计文档 -Finally, you run this OS on your machine by excuteing following commands: - -``` -git clone https://github.com/Ko-oK-OS/xv6-rust.git -cd xv6-rust -git submodule update --init --recursive -make run -``` - -## GDB Usage -To use gdb to debug, we need to download `riscv64-unkonown-elf-gdb` and `tmux`. - -### GDB Download -- [Ubuntu](https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-ubuntu14.tar.gz) -- [CentOS](https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-centos6.tar.gz) -- [macOS](https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-apple-darwin.tar.gz) -- [Windows](https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-w64-mingw32.zip) - -We support gdb in OS kernel, you can exectue this command in `xv6-rust/kernel` directory: -```shell -make debug -``` -And then you can debug this programe step by step. - -## Schedule - -- Virtual Memory and Management - - [x] Virtulal Memory Map - - [x] Kernel Allocator(Buddy System Allocator) - - [x] Load ELF Files From Memory -- Traps,Interrupts, and drivers - - [x] Kernel Trap - - [x] Users Trap - - [x] UART Drivers - - [x] Machine-Mode Timer Interrupt - - [x] Virtio Disk Drivers - - [x] PCI and E1000 Drivers -- Locking - - [x] Spinlock - - [x] Sleeplock -- Process and Scheduing - - [x] Process - - [x] Scheduing - - [x] Muti-Core Support - - [x] Syscall -- File System - - [x] Mkfs - - [x] Buffer Layer - - [x] Log Layer - - [x] SuperBlock Layer - - [x] Inode Layer - - [x] Bitmap Layer - - [x] File Descriptor Layer - - [x] File Path - - [x] Pipe - - [x] Syscall -- NetWork - - [x] PCI and E1000 Initialize - - [x] Protocol Headers - - [ ] Network Card Driver - - [ ] Syscall -- Device Driver - - [x] Virtio Disk - - [x] Uart/Console - - [x] PCI - -## Differences -### Fs -- [x] Remove `FILE_TABLE` -- [x] Use `Arc` instead of `refs`, `Arc::clone()` will plat the same role of `refs++` -- [ ] User `enum FileInner` to separate files of various file types - -### Scheduler -- [ ] Use `VecDeque` instead of raw array. - -### Process -- [ ] Use `BTreeMap` to maintain open files in `Process` -- [ ] Add `Thread` in Kernel Process - -## Expected Future -- [ ] More Clear Memory Model -- [ ] Better Scheduler -- [ ] SD Card Driver Support -- [ ] Network Support(Use `smoltcp` to simplify design) -- [ ] Async IO Support - -## Docs - -[项目设计文档](docs/项目设计文档.pdf) - -## References - -- [Building a stupid Mutex in the Rust](https://medium.com/@Mnwa/building-a-stupid-mutex-in-the-rust-d55886538889) -- [Rust源码分析:std::sync::Mutex](https://zhuanlan.zhihu.com/p/50006335) -- [buddy_system_allocator](https://github.com/rcore-os/buddy_system_allocator) -- [Write a OS in Rust](https://os.phil-opp.com) -- [rCore-Tutorial-v3](https://rcore-os.github.io/rCore-Tutorial-Book-v3/index.html) -- [rCore-Tutorial](https://rcore-os.github.io/rCore-Tutorial-deploy/) -- [xv6-riscv](https://github.com/mit-pdos/xv6-riscv) -- [xv6-riscv-rust](https://github.com/Jaic1/xv6-riscv-rust) -- [rCore](https://github.com/rcore-os/rCore) - -## License -MIT License +[项目设计文档](doc/设计文档.pdf) diff --git a/bin/.gitignore b/bin/.gitignore old mode 100644 new mode 100755 diff --git a/docs/alloc.md b/doc/2021/alloc.md old mode 100644 new mode 100755 similarity index 100% rename from docs/alloc.md rename to doc/2021/alloc.md diff --git a/docs/boot.md b/doc/2021/boot.md old mode 100644 new mode 100755 similarity index 100% rename from docs/boot.md rename to doc/2021/boot.md diff --git a/docs/env.md b/doc/2021/env.md old mode 100644 new mode 100755 similarity index 100% rename from docs/env.md rename to doc/2021/env.md diff --git a/docs/gdb.md b/doc/2021/gdb.md old mode 100644 new mode 100755 similarity index 100% rename from docs/gdb.md rename to doc/2021/gdb.md diff --git a/docs/interrupt.md b/doc/2021/interrupt.md old mode 100644 new mode 100755 similarity index 100% rename from docs/interrupt.md rename to doc/2021/interrupt.md diff --git a/docs/lock.md b/doc/2021/lock.md old mode 100644 new mode 100755 similarity index 100% rename from docs/lock.md rename to doc/2021/lock.md diff --git a/docs/process.md b/doc/2021/process.md old mode 100644 new mode 100755 similarity index 100% rename from docs/process.md rename to doc/2021/process.md diff --git a/docs/scheduler.md b/doc/2021/scheduler.md old mode 100644 new mode 100755 similarity index 100% rename from docs/scheduler.md rename to doc/2021/scheduler.md diff --git a/docs/static/Figure5-24.jpg b/doc/2021/static/Figure5-24.jpg similarity index 100% rename from docs/static/Figure5-24.jpg rename to doc/2021/static/Figure5-24.jpg diff --git a/docs/static/Figure5-25.jpg b/doc/2021/static/Figure5-25.jpg similarity index 100% rename from docs/static/Figure5-25.jpg rename to doc/2021/static/Figure5-25.jpg diff --git a/docs/static/PLIC.jpg b/doc/2021/static/PLIC.jpg similarity index 100% rename from docs/static/PLIC.jpg rename to doc/2021/static/PLIC.jpg diff --git a/docs/static/PLICArch.jpg b/doc/2021/static/PLICArch.jpg similarity index 100% rename from docs/static/PLICArch.jpg rename to doc/2021/static/PLICArch.jpg diff --git a/docs/static/buddy.jpg b/doc/2021/static/buddy.jpg old mode 100644 new mode 100755 similarity index 100% rename from docs/static/buddy.jpg rename to doc/2021/static/buddy.jpg diff --git a/docs/static/kalloc.jpg b/doc/2021/static/kalloc.jpg old mode 100644 new mode 100755 similarity index 100% rename from docs/static/kalloc.jpg rename to doc/2021/static/kalloc.jpg diff --git a/docs/static/vm_1.jpg b/doc/2021/static/vm_1.jpg similarity index 100% rename from docs/static/vm_1.jpg rename to doc/2021/static/vm_1.jpg diff --git a/docs/static/vm_2.png b/doc/2021/static/vm_2.png similarity index 100% rename from docs/static/vm_2.png rename to doc/2021/static/vm_2.png diff --git a/docs/static/vm_3.jpg b/doc/2021/static/vm_3.jpg old mode 100644 new mode 100755 similarity index 100% rename from docs/static/vm_3.jpg rename to doc/2021/static/vm_3.jpg diff --git a/docs/static/vm_4.svg b/doc/2021/static/vm_4.svg old mode 100644 new mode 100755 similarity index 100% rename from docs/static/vm_4.svg rename to doc/2021/static/vm_4.svg diff --git a/docs/vm.md b/doc/2021/vm.md old mode 100644 new mode 100755 similarity index 100% rename from docs/vm.md rename to doc/2021/vm.md diff --git "a/docs/xv6 \346\226\207\344\273\266\347\263\273\347\273\237.md" "b/doc/2021/xv6 \346\226\207\344\273\266\347\263\273\347\273\237.md" old mode 100644 new mode 100755 similarity index 100% rename from "docs/xv6 \346\226\207\344\273\266\347\263\273\347\273\237.md" rename to "doc/2021/xv6 \346\226\207\344\273\266\347\263\273\347\273\237.md" diff --git "a/docs/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.md" "b/doc/2021/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.md" old mode 100644 new mode 100755 similarity index 100% rename from "docs/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.md" rename to "doc/2021/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.md" diff --git "a/docs/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.pdf" "b/doc/2021/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.pdf" old mode 100644 new mode 100755 similarity index 100% rename from "docs/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.pdf" rename to "doc/2021/\351\241\271\347\233\256\350\256\276\350\256\241\346\226\207\346\241\243.pdf" diff --git "a/doc/\347\216\257\345\242\203\346\220\255\345\273\272.md" "b/doc/\347\216\257\345\242\203\346\220\255\345\273\272.md" new file mode 100755 index 0000000..0fd067c --- /dev/null +++ "b/doc/\347\216\257\345\242\203\346\220\255\345\273\272.md" @@ -0,0 +1,102 @@ +# 环境搭建 + +## 1、ubuntu20.04 及相关环境 + +```bash +sudo apt-get update && sudo apt-get upgrade +sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu +sudo apt-get install riscv64-unknown-elf-gcc +#不能定位的话尝试 gcc-riscv64-unknown-elf +``` + +其他工具比如说 vim,vmtools 工具之类的 + +## 2、qemu + +```bash +wget https://download.qemu.org/qemu-5.0.0.tar.xz +tar xvJf qemu-5.0.0.tar.xz +cd qemu-5.0.0 +./configure --target-list=riscv32-softmmu,riscv64-softmmu +make -j$(nproc) +sudo make install +``` + +If you find some errors when building, you can slove by following hints: + +- `ERROR: pkg-config binary 'pkg-config' not found` : `sudo apt-get install pkg-config` +- `ERROR: glib-2.48 gthread-2.0 is required to compile QEMU`: `sudo apt-get install libglib2.0-dev` +- `ERROR: pixman >= 0.21.8 not present`: `sudo apt-get install libpixman-1-dev` + +## 3、clone + +```bash +git clone https://github.com/Ko-oK-OS/xv6-rust.git +``` + +其中有三个子仓库 clone 不下来,自己克隆或者下载然后移动进去,因为权限的原因没法直接使用 + +```bash +git submodule update --init --recursive +``` + +或者是去修改 .gitmodule 文件 URL 前缀为 https + +![image-20220502221208991](C:/Users/Rand/AppData/Roaming/Typora/typora-user-images/image-20220502221208991.png) + +## 4、RUST相关环境 + +You need download rust to start our environment. We suggest you to use official shell: + +```bash +curl https://sh.rustup.rs -sSf | sh +``` + +If you fail because of slow network speed. You can try this to speed up: + +```bash +export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static +export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup +curl https://sh.rustup.rs -sSf | sh +``` + +If you have finished these, you can test your environment by following commands: + +```bash +source $HOME/.cargo/env +rustc --version +``` + +In addition, we'd better change the package mirror address crates.io used by the package manager cargo to the mirror server of the University of Science and Technology of China to speed up the download of the tripartite library. We open (create a new file if it doesn't exist) ~/.cargo/config and modify the content to: + +``` +[source.crates-io] +registry = "https://github.com/rust-lang/crates.io-index" +replace-with = 'ustc' +[source.ustc] +registry = "git://mirrors.ustc.edu.cn/crates.io-index" +``` + +Besides, you also update some tools in rust: + +```bash +rustup target add riscv64gc-unknown-none-elf +cargo install cargo-binutils +rustup component add llvm-tools-preview +``` + +!!!!!!!!!!! 最后这一步的这两个命令 + +```bash +rustup target add riscv64gc-unknown-none-elf +rustup component add llvm-tools-preview +``` + +需要在 xv6-rust 目录下执行一次,还需要在 xv6-rust/kernel 目录下执行一次 + +## 5、搭建完成 + +``` +make run +``` + diff --git "a/doc/\347\216\257\345\242\203\346\220\255\345\273\272.pdf" "b/doc/\347\216\257\345\242\203\346\220\255\345\273\272.pdf" new file mode 100755 index 0000000..9ac45a5 Binary files /dev/null and "b/doc/\347\216\257\345\242\203\346\220\255\345\273\272.pdf" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/UserSpace.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/UserSpace.png" new file mode 100755 index 0000000..a035db7 Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/UserSpace.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234215182.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234215182.png" new file mode 100755 index 0000000..f26f7ed Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234215182.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234541086.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234541086.png" new file mode 100755 index 0000000..8c99a09 Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234541086.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234932013.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234932013.png" new file mode 100755 index 0000000..8a1f4d0 Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814234932013.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235137062.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235137062.png" new file mode 100755 index 0000000..da1b922 Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235137062.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235719246.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235719246.png" new file mode 100755 index 0000000..29825e3 Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235719246.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235910678.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235910678.png" new file mode 100755 index 0000000..65bfea6 Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/image-20220814235910678.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/pipe.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/pipe.png" new file mode 100755 index 0000000..33e2def Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/pipe.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/redir.png" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/redir.png" new file mode 100755 index 0000000..f5dd51b Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.assets/redir.png" differ diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.md" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.md" new file mode 100755 index 0000000..1c2ecbc --- /dev/null +++ "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.md" @@ -0,0 +1,1325 @@ +

+
xv6-rust 设计文档
+

+ +

2022全国大学生计算机系统能力大赛操作系统设计赛

+ +

剑指OS

+ +

彭泽杰、 刘辰、 董慧勇

+ +## 零、目录 + +[TOC] + +
+ +## 一、设计简介 + +本项目是在去年比赛实现的 xv6-rust 基础之上进行二次开发,主要有两个方面:一是增加新的功能,二是修改完善现有代码的一些 bug,具体如下所示: + +- 实现进程间的通信功能: + - 信号量 + - 消息队列 + - 共享内存 + - 管道 + +- 实现线程协程: + - 内核级线程 + - 用户级线程(协程) + +- 简单封装运行库 +- 功能改进: + - 页面延迟分配 + - 优先级调度 + +- 修改重构: + - 重写进程结构体及其锁的形式,改用大粒度锁 + - 修改原有管道的 bug + - 修改内存管理的 bug + +以上便是初赛阶段已完成的一些内容,还有一些目前正在做待完成 + +- 模拟中断实现信号机制 +- 重新组织进程结构体,采用红黑树并实现 CFS 调度算法 +- 写时复制、mmap 等系统调用。 + +## 二、设计实现 + +下面便详细说说以上的一些功能的设计实现,首先是进程间的通信功能 + +### 1 进程间的通信 + +**进程间要进行通信,从通信的内容来讲大致分为两类,一种是信号往来,比如说信号、信号量机制,可以用来通知某些时间的发生,某些共享资源的使用情况**。 + +**另外一种是数据往来,数据的往来需要较多的空间**,所以一般有两种方式: + +- **一是直接通过内存来传递数据消息**,比如说共享内存,管道,消息队列,本质上都是通过“一块内存”来传递消息,只不过访问这一块内存的方式有所不同罢了。 +- 二是直接不同进程读写相同的文件来进行通信,这里的文件指的是普通磁盘上的文件,而非广义上的"一切皆文件",只不过好像读写文件太过普遍的原因,一般说进程间的通信并未加上这种方式。 + +下面便详细讲述我们小组实现的几种进程间的通信方式 + +#### 1.1 共享内存 + +共享内存应该是不同进程之间通信最直接,最快速的一种通信方式了,不同进程共享一块内存,对这块内存进行读写操作便可实现通信。 + +**每个进程都有自己的页表,通过页表将虚拟内存映射到实际的物理内存。共享内存指的是不同进程的虚拟内存通过各自的页表映射到相同的物理内存**。 + +而要共享物理内存实际意思为:将不同进程各自的虚拟内存映射到相同的物理内存,具体来讲就是分配一块空闲的物理内存 $P$,然后 $A$ 进程找一块空闲的虚拟内存 $V_a$,添加页表项使得 $V_a$ 映射到 $P$,$B$ 进程找一块空闲的虚拟内存 $V_b$ 也映射到 $P$,这样便实现了 $A$ $B$ 进程共享物理内存 $P$。 + +这里涉及了几个关键问题: + +- **每个进程的空闲虚拟内存如何找寻**,原本的 $xv6$ 里面没有虚拟内存管理,所以用作共享内存的这部分虚拟内存需要我们自己实现管理 +- **空闲的物理内存分配**,这一部分倒是不用我们操心,原本 $xv6$ 物理内存管理实现了物理内存分配和释放,向外提供了 $kalloc$ 和 $free$ 接口。 +- **物理内存到虚拟内存的映射关系**,实际上就是填写相应的页表项,这部分 $xv6$ 也提供了相应的接口 $mappages$ + +##### 共享区管理 + +**所以其实这里需要我们做得便是从整个虚拟地址空间中划分一个区域作为共享区,然后对这块区域做相应的管理**,实现如下: + +定义两个常量,将内核下面的 $128M$ 当作共享区: + +```rust +pub const MAP_END: usize = KERNEL_BASE - PGSIZE; +pub const MAP_START: usize = MAP_END - 128*1024*1024; +``` + +每次映射的共享内存大小最大为 4M,如果一页大小为 4K,则每次最多映射 $1024$ 页 + +```rust +pub const SHARE_MEM_AREA_SIZE: usize = 4*1024*1024; +pub const SHARE_MEM_MAP_PAGES: usize = SHARE_MEM_AREA_SIZE/(PGSIZE); +``` + +然后便是对这 128M 的区域做相应的管理,**对于内存的管理,一般两种方式,位图和空闲链表**,空闲链表的方法应该更好,不过鉴于当前 xv6 的内存管理方式,先使用位图进行管理,后续对于底层内存管理的方式重构之后再使用链表的形式。 + +使用 1bit 表征一页的使用情况,所以位图大小为: + +```rust +pub const SHARE_MEM_BIT_MAP_SIZE: usize = SHARE_MEM_MAP_PAGES/8+1; +``` + +位图实际上就是特定大小的字节数组,定义位图数据结构如下: + +```rust +pub struct BitMap{ + bitmap: [u8; SHARE_MEM_BIT_MAP_SIZE] +} +``` + +每个进程都有自己管理共享区的位图结构体,所以在进程结构体中添加该信息: + +```rust +pub struct task_struct{ + //... + pub sharemem_bitmap: *mut BitMap; + //... +} +``` + +接下来便是一些关于位图的一些操作: + +```rust +pub fn page_to_addr(page: usize) -> usize //将共享区中的第page页转换为虚拟地址 +pub fn addr_to_page(addr: usize) -> usize //将共享区中的虚拟地址转换为第xx页 + +pub fn get_bit(&self, page: usize) -> usize //获取第page页的使用情况 +pub fn set_bit(&self, page: usize, bit: usize) //设置第page页的使用情况为bit + +//根据位图寻找连续npages页都空闲的区域,返回其地址 +pub fn get_unmapped_addr(&mut self, npages: usize) -> usize +``` + +##### 共享内存实现 + +我们具体实现共享内存的方式为:**设计一个共享内存结构体 `ShareMem`,使用它来记录映射信息比如映射的物理地址,映射了多少页,该内存的属性等等。不同进程想要通过共享内存通信,就要先获取相同的 `ShareMem`,获取到里面的物理地址,然后从自己的共享区找一块空闲虚拟内存映射到该物理地址指向的物理内存,如此便实现了不同进程的虚拟内存映射到相同的物理内存,实现内存共享**。 + +`ShareMem` 定义如下: + +```rust +struct ShareMem{ + id: usize, + used: bool, + //vaddr: usize, + paddr: usize, + npages: usize, + flags: usize, + links: usize, + name: [u8; MAX_NAME_LEN], + + lock: Spinlock<()> +} +``` + +各元素意义如下: + +- id 为该 ShareMem 的唯一标识,通过它来表示不同进程获取的是否同一 ShareMem +- used 该结构体是否使用 +- paddr 记录映射的物理地址 +- npages:连续映射了多少页 +- flags:该片内存的属性 +- links:该片内存被映射了多少次 +- name:该 ShareMem 的名字,主要用来找到相应的 ShareMem +- lock:共享内存是共享资源,避免竞争需要用个锁来保护 + +ShareMem 有三重要接口: + +```rust +pub fn free(&mut self) +``` + +free 函数用来释放该结构体,主要有两件事:释放物理内存,将该结构体的各属性字段"清零" + +```rust +pub fn map(&mut self, shmaddr: usize, flags: usize) -> Option{ + if shmaddr == 0 { //如果shmaddr==0 + vaddr = get_unmapped_addr(); //则表示内核(我们)自个儿在共享区里面找一块空闲的虚拟内存 + + if self.paddr == 0{ //如果该ShareMem物理地址为空,则说明第一次映射 + paddr = kalloc(); //调用物理内存分配函数分配一块物理内存 + pagetable.map(vaddr, paddr, PGSIZE, perm) //虚拟内存映射到物理内存 + } + } else { + //待完善 + } + self.links += 1; //该共享内存的映射次数加1 + + Some(self.vaddr) +} + +pub fn unmap(&mut self) { + //取消该进程的共享内存的映射 + //1、清除相应的页表项 + //2、相应的位图清零 + //3、links-- +} +``` + +上述即为 `ShareMem` 的三个重要接口,对外开放 map 和 unmap 函数,也是后面要添加的系统调用,**map 和 unmap 一般说来只是建立和取消映射关系,并不实际进行分配和释放映射的物理内存**。 + +一个 ShareMem 管理一个共享内存的映射,如果有多个进程在不同的共享内存上通信,则需要多个 ShareMem 来管理,为此再顶一个结构体 ShareMemManager: + +```rust +pub struct ShareMemManager{ + shares: [ShareMem; SHARE_MEM_TYPE_NR], + lock: Spinlock<()> +} +``` + +ShareMemManager 实为 ShareMem 数组,我们使用 ShareMemManager 来实现 ShareMem 的分配和回收,因此有三重要接口: + +```rust +pub fn alloc(&mut self, name: [u8; NAME_LEN], size: usize) -> Option +``` + +该函数用来分配一个 ShareMem 结构体,实际操作就是遍历 shares 数组,根据 used 字段找一个空闲 ShareMem,然后根据 name 和 size 字段初始化该 ShareMem 结构体 + +```rust +pub fn get(&mut self, name: [u8; NAME_LEN], size: usize, flags: uszie) -> Option +``` + +该函数用来获取 ShareMem 结构体,此函数是 alloc 的封装,如果 flags 指示的是新建(分配)一个 ShareMem 的话就直接调用 alloc 来分配一个空闲的,这一般是第一次映射。一般情况下,根据 name 字段寻找现有的 ShareMem,然后返回其 ID 值 + +```rust +pub fn put(&mut self, id: usize) +``` + +放下 ID 值为 id 的 ShareMem,主要调用 ShareMem.free 函数来释放物理内存,各属性字段清零 + +##### 添加系统调用 + +对于共享内存,对用户提供了 4 各系统调用: + +- get 获取一个 ShareMem,返回其 ID +- map 实现共享区的虚拟内存到物理内存的映射,返回起始虚拟地址 +- unmap 取消上述映射关系 +- put 回收该 ShareMem,释放物理内存 + +
+ +#### 1.2 管道 + +**管道是一种特殊文件,本质上是一块内存区域,一端只允许写,一端只允许读,数据的流向只能是写端到读端,感觉就像管道一般,所以将这种文件命名为管道文件**。原有 xv6 有匿名管道的基本实现,但是有 bug,我们所做的工作便是修改原有 bug,并在其基础上实现有名管道。 + +##### 重写匿名管道 + +匿名管道和有名管道的本质都是一块内存区域,只不过对其读写的方式不同: + +对于匿名管道,基本步骤是: + +1. 为其两端分配两个文件结构体,并关联到进程的两个文件描述符 +2. 读写时一般需要重定向:先关闭 0、1 标准输入输出,使用 dup 使上述的两文件结构体关联到 0、1 文件描述符,然后父子进程便可以通过标准输入输出来通信 + +重定向示意图如下: + +![redir](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/redir.png) + +通过匿名管道进行读写的示意图如下: + +![pipe](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/pipe.png) + +关于匿名管道的实现基本沿用原有项目,只是对原来的数据结构设计进行了简化,原来是管道数据结构包裹在 Spinlock 里面,而我们小组当时调试时总是有竞争锁的问题出现,于是直接简化,将管道与锁分离,与管道的各属性一起组成 Pipe 结构体: + +```rust +pub struct Pipe { + data: [u8; PIPE_SIZE], + nread: usize, + nwrite: usize, + read_open: bool, + write_open: bool, + pub pipe_lock: Spinlock<()> +} +``` + +对于 Pipe 相应的函数基本与原有项目的逻辑相同,只是修改了其中的一些 bug,这里不再详细说明,下面介绍有名管道的实现。 + +##### 实现有名管道 + +而我们现在就是要在这基础之上实现有名管道 fifo,如果按照“标准”来实现的话,fifo 是一种特殊文件,能够安装到目录里面,ls 命令能够识别打印信息。我们可以定义一个结构体 fifo,它是 pipe 结构体的封装,有两读写方法,fifowrite、fiforead,分别是 pipewrite、piperead 的封装。再改写一下文件系统部分,让其能够识别 FIFO,那么读写有名管道的函数调用顺序可以为 $write \rightarrow filewrite \rightarrow fifowrite \rightarrow pipewrite$ 。 + +不过要将 $fifo$ 当作文件安装在文件系统中,需要对底层的文件系统进行改写,私以为理论上逻辑上是没什么问题的,但是这种我没去实验,待后续完善。为了简单我直接将 fifowrite、fiforead 对用户开放为系统调用,所以调用方式为直接为 $fifowrite \rightarrow pipewrite$ 。 + +因此如何实现有名管道也就明了了,定义的 `Fifo_t` 结构体如下: + +```rust +pub struct Fifo_t { + pub pipe: Option<*mut Pipe>, //复用匿名管道Pipe + pub name: [u8; NAME_LEN], //名字 + pub used: bool, //该结构体是否使用 + pub ID: usize //ID值 +} +``` + +其相应的方法也就是 `Pipe` 的封装: + +```rust +pub fn read(& self, addr: usize, len: usize) -> Result { + let pipe = unsafe{&mut *self.pipe.unwrap()}; + pipe.read(addr, len) + //... +} + +pub fn write(&self, addr: usize, len: usize) -> Result { + let pipe = unsafe{&mut *self.pipe.unwrap()}; + pipe.write(addr, len) + //... +} + +pub fn close(&self){ + let pipe = unsafe{&mut *self.pipe.unwrap()}; + pipe.close(true); + pipe.close(false); + drop(self); + //... +} +``` + +对于 `fifo` 结构体需要进行管理,分配回收等等,所以定义了如下 `FifoTable` 结构体: + +```rust +pub struct FifoTable{ + fifos: [Fifo_t; N_FIFOS], + fifos_lock: Spinlock<()>, +} +``` + +本质上就是一个 `fifo` 数组,只不过多配了一把锁,因为 `fifos` 是共享资源,为避免竞争需要用锁来保护。 + +`FifoTable` 重要的方法如下: + +```rust +//分配一个空闲的fifo结构体, +pub fn alloc(&mut self, s: [u8; NAME_LEN]) -> Option +//获取一个现有的fifo结构体 +pub fn get(&mut self, name: [u8; NAME_LEN]) -> Option +//放下回收一个fifo结构体 +pub fn put(&mut self, id: usize) -> Option +``` + +##### 添加系统调用 + +有名管道对用户提供了 5 个系统调用: + +```rust +//调用alloc创建一个fifo +pub fn sys_mkfifo(&self) -> SysResult +//调用get获取一个fifo +pub fn sys_fifo_get(&self) -> SysResult +//调用put回收一个fifo +pub fn sys_fifo_put(&self) -> SysResult +//调用fifo read进行读取 +pub fn sys_fifo_read(&self) -> SysResult +//调用fifo_write进行写 +pub fn sys_fifo_write(&self) -> SysResult +``` + +
+ +#### 1.3 消息队列 + +共享内存是通过直接读写内存进行通信,管道是通过对这片内存进行包装,像外提供读写接口来通信,而消息队列呢?与管道一样,是对用于数据往来的内存进行包装,只不过实现的方式有所不同。 + +##### 数据结构设计 + +`消息 队列`,从名字上来看是要用队列来实现,基本思想为:**发送为将消息包装成结点,插入到消息队列,接收方从消息队列中取出消息结点获取消息**。 + +因此设计了两种数据结构:`msgque` 和 `msg` + +```rust +//消息结构体 +struct msg { + data: [u8; MSG_LEN], //实际的数据 + dataID: usize, //数据长度 + flags: usize, //属性 + + next: *mut msg //下一个msg +} +``` + +这是定义的消息结构体,也是消息队列中的一个结点,相应的方法有: + +```rust +pub fn new() //新建一个msg +pub fn free() //释放这个消息,释放内存 +``` + +```rust +//消息队列结构体 +struct msgque { + pmsgHead: *mut msg, //头节点 + pmsgTail: *mut msg, //尾结点 + id: usize, //该消息队列结构体ID + name: [u8; 16], //名字 + used: bool, //是否使用 + lock: Spinlock<()>, //锁 +} +``` + +通过消息队列进行通信的进程都要获取相同的 `msgque`,使用 id 值来区分,头节点尾结点尾分别为 `msg` 队列的头尾,其他属性基本同前面的 `IPC` 控制结构体,不再赘述,`msgque` 较为重要的方法有: + +```rust +pub fn write(&mut self, addr: usize, len: usize){ + pmsg = msg::new(); //新建一个msg + memcopy(pmsg->data, addr, len); //将数据从用户拷贝到内核 + self.insert(pmsg); //将pmsg插入到msg队列 +} + +pub fn read(&mut self, addr: usize, len: usize){ + pmsg = self.pmsgHead; //从头节点获取msg指针 + memcopy(addr, pmsg->data, len) //将数据复制到用户态 + self.remove(pmsg); //移除结点 +} +``` + +一个 `msgque` 只能管理一个通信,多个通信需要多个 `msgque`,同前面两种 `IPC`,`msgque` 也设计成一个集合 `MsgQueManager`: + +```rust +pub struct MsgQueManager { + msg_queues: [msgque; N_MSG_QUEUES], + lock: Spinlock<()> +} +``` + +本质上就是一个 `msgque` 数组,分配一把锁来控制 `msgque` 的分配,获取,回收,因此 `MsgQueManager` 的方法如下: + +```rust +alloc() //分配一个空闲msgque +get() //获取一个现有的msgque +put() //回收msgque +``` + +##### 添加系统调用 + +以上便是消息队列的设计,对用户提供了 5 个系统调用: + +```rust +sys_mq_alloc //封装MsgQueManager的alloc函数 +sys_mq_get +sys_mq_put +sys_mq_send +sys_mq_recv +``` + + + +#### 1.4 信号量 + +**信号量是一种不同进程/线程之间的一种同步手段,其内有一个计数器可以用来表示资源的个数,对外有 down,up 两种操作,分别可以表示获取和释放资源,当资源数小于 0 时执行 down 操作便会阻塞,阻塞到其他进程调用 up 释放资源**。 + +##### 数据结构设计 + +semaphore 本身就是一个数儿,所以有如下设计: + +```rust +pub struct semaphore{ + cnt: i32, + sem_lock: Spinlock<()>, +} +``` + +cnt 表示计数器,lock 来确保原子加减操作,相应的方法有: + +```rust +semaphore_down() //原子减 +semaphore_up() //原子加 +``` + +这里对于 semaphore 本身用 Spinlock 实现的,后续考虑使用 rust 自带原语实现 + +对于 semaphore 我们在其上再做封装为 sem_t 类型: + +```rust +pub struct sem_t{ + sem: semaphore, + used: bool, + id: i32, +} +``` + +增加了 used 和 id 属性,用作 sem_t 结构体的分配和回收,sem_t 的方法伪码如下: + +```rust +sem_init() //初始化 sem_t + +sem_down() { + while semaphore.cnt <= 0{ //如果计数值小于0 + sleep(semaphore, semaphore.lock) //休眠 + } + semaphore_down() //原子减 +} + +sem_up() { + semaphore_up(); + if semaphore.cnt > 0 { + wakeup(semaphore) //唤醒休眠在该semaphore上的进程 + } +} +``` + +xv6 本身的休眠和唤醒机制比较简单,每个进程结构体都有个休眠对象的属性:`chan: usize`,本质为休眠对象的地址,休眠操作就是将 chan 设置为休眠对象的地址,设置状态为 SLEEPING 然后让出 CPU,而唤醒操作 wakeup(chan) 就是遍历任务结构体,如果休眠对象的地址为相应的 chan,则将该进程的状态设置为 RUNNABLE,等待被调度。 + +所以我们要实现信号量其实就很简单,对于 down,up 操作只需要简单判断当前计数是否大于 0 即可,具体伪码如上所示。 + +另外需要注意的就是 down 操作判断 cnt 是否小于 0 时需要用 while 判断,因为 xv6 的唤醒机制是遍历整个任务结构体表,唤醒操作是统一唤醒,比如当前 A B C 三个进程都被唤醒想要获取 semaphore,但是只有最先被调度的 A 能够获取到,那么 B C 是获取不到的,需要用 while 再次进行判断才能保证逻辑正确,如果用 if 判断的话,那么 B C 也能获取 semaphore,则会出现错误。 + +目前我们所设计的信号量其实还是内核级的信号量,不能像标准的那样直接再用户态下声明一个 sem_t 即可使用,这里我们还是使用老办法设计一个 manager 对 sem_t 进行管理分配和回收 + +```rust +pub struct SemTable{ + sems: [sem_t; N_SEM], + st_lock: Spinlock<()>, +} +``` + +相应的接口函数也就不言而喻了,跟前面的一模一样: + +``` +alloc() +get() +put() +``` + +##### 添加系统调用 + +对外提供了 4 个系统调用 + +```rust +sys_sem_get //封装semTable.get和semTable.alloc 获取一个 sem_t +sys_sem_put //放下回收sem_t +sys_sem_up //up操作 +sys_sem_down //down操作 +``` + +
+ +### 2 线程、协程 + +**进程是资源分配的单位,线程是调度的单位**,这句话我们耳熟能详。根据进程的调度执行的过程,我们知道如果一个线程想要被单独调度而不是附属进程作为一个函数执行,它得有以下资源: + +- **内核被调用者保存寄存器组成的任务切换上下文,这是由 swtch 函数进行任务切换而必须的,本质上就是个函数跳转操作,只不过这里是我们自己手写汇编实现,保存的寄存器也要多一点** +- **中断、异常处理时的上下文,每个线程在执行期间都可能遭遇中断异常等实践,停下手头工作转而去处理这些紧急事件时需要保存原任务的上下文** +- **代码执行需要的栈资源,包括在内核运行时的内核栈,在用户态下执行的用户栈** + +**这就是线程能够正常工作所需要的所有资源,其他资源比如说页表,堆,等等都不是必要的,与附属进程共享,所以说线程粒度较小,速度较快**。 + +线程的实现方式多种多样,有内核级线程,也有用户级线程也是现在常说的协程,我们小组两者都做了简易实现。 + +#### 2.1 内核级线程 + +在 Linux 里面没有明确的进程线程之分,都是使用同一结构体 task_struct 结构体表示,这里我们沿用这一思想,对于线程仍然使用 task_struct 结构体(原 proc 结构体,这里改了个名),向其中添加了一项属性字段: + +##### 数据结构设计 + +```rust +pub struct task_struct{ + //... + pub ustack: usize; //线程的用户栈 +} +``` + +不像进程的用户栈是在 exec 函数里面分配好了,释放的时候根据页表释放就行了,线程的用户栈是在进程的堆里面分配的,需要记录下来,线程执行完成的时候才能找到位置然后释放。 + +##### 方法函数实现 + +对于线程提供了两个核心函数 clone 和 join,分别对标进程的 fork 和 wait,功能也是相似,只不过对于资源的处理有些许区别,伪码如下: + +```c +clone(ustackAddr, funcAddr, argAddr){ + task = get_task_struct(); //获取一个空闲的任务结构体 + task.init_context(); //初始化这个任务结构体的切换上下文 + task.init_trapframe(); //分配和初始化异常处理上下文 + + task.pagetable = parent.pagetable; //线程直接使用父进程的页表 + //处理pid,parent,open_file,cwd,size,name等属性字段 + + task.trapframe.epc = funcAddr; //返回用户态的PC值指向func函数 + task.trapframe.sp = ustackAddr + PGSIZE - 1; //栈顶指针指向用户栈栈顶 + task.trapframe.a0 = argAddr; //根据调用约定a0里面存放着第一个参数 + + task.state = RUNNABLE; //该线程准备好了,可以为其分配CPU了 +} + +join(ustackAddr){ + task.free_trapframe(); //释放trapframe + task.pagetable = 0; //将页表指针清零但不释放,释放是父进程的事 + + *ustackAddr = task.ustack; //将用户栈指针传出去 + //处理其他属性字段 + + task.state = UNUSED; //该任务结构体空闲了 +} +``` + +##### 添加系统调用 + +上述就是内核级线程的 内核部分主要实现,下面说说用户调用的接口,对用户提供了两个接口 + +###### 内核接口 + +```rust +sys_clone(funcAddr, argAddr, ustackAddr) //clone函数的封装 +sys_join(ustackAddr) //join的封装 +``` + +###### 用户接口 + +```c +int clone(void (*start_routine)(void *), void* arg, void *stack); +int join(void*); + +int thread_create(void (*start_routine)(void*), void *arg){ + void *stack = malloc(PGSIZE); //分配用户栈 + int ret = clone(start_routine, arg, stack); //clone系统调用 + return ret; +} + +int thread_join(){ + long stack; + int ret = join((void*)&stack); //join系统调用 + free((void*)stack); //释放用户栈 + return ret; +} +``` + +
+ +#### 2.2 用户级线程 + +接下来继续说明用户级线程的实现,在用户态下实现线程,仿照内核,主要有一下几个点: + +- 协程结构体设计 +- 调度 +- 上下文操作 + +一个一个来说明,先看上下文操作,这是最基础的部分 + +##### 上下文 + +这里的上下文就相当于函数切换的上下文,同内核里面任务切换上下文,定义如下: + +```c +typedef struct { + long ra; + long sp; + + long s0; + long s1; + long s2; + long s3; + long s4; + long s5; + long s6; + long s7; + long s8; + long s9; + long s10; + long s11; +} ucontext; +``` + +相应的操作,仿照 ucontext 类 + +```c +getcontext(ucontext* ctx) //获取当前的上下文,保存到ctx处 +setcontext(ucontext* ctx) //恢复ctx指向的上下文 +swapcontext(ucontext *o, ucontext *n) //保存当前的上下文到o 恢复n指向的上下文 +``` + +这三个函数的具体操作实际上就是 ld sd 指令,不再赘述。ucontext 类里面还有一个 makecontext 函数,这里我就没仿照实现了,直接在创建线程里面做了相应处理 + +##### 协程 + +结构体设计如下: + +```c +typedef void (*Func)(void*); +enum ThreadState {FREE, RUNNABLE, RUNNING}; + +typedef struct uthread_t { + ucontext ctx; //上下文 + Func func; //要执行的函数地址 + void *arg; //函数参数地址 + enum ThreadState state; //协程状态 + char *stack; //协程的用户栈 +}uthread_t; +``` + +相应操作的伪代码如下: + +```c +int uthread_create(Func func, void *arg){ + uthread = get_uthread(); //获取一个空闲的uthread结构体 + uthread.func = func; + uthread.arg = arg; + + uctx = uthread.ctx; + uctx.ra = (long)func; //返回地址为func地址 + void *stack = malloc(PGSIZE); //分配协程使用的栈 + uctx.sp = (long)stack + PGSIZE - 1; //栈顶指针设置为上述分配的栈的栈顶 + + uthread.state = RUNNABLE; //该协程准备好了 +} +``` + +##### 调度 + +对于调度设计了一个调度类: + +```c +typedef struct scheduler { + ucontext ctx; //调度器的上下文 + int running_thread; //当前运行的协程id + uthread_t threads[MAX_THREADS]; //该调度器管理的协程 +} scheduler; +``` + +**调度器拥有一个上下文,调度器实际上相当于主线程,由它来选择相应的协程执行,执行完之后又回到调度器**。相应的操作如下: + +```c +void scheduler_init(scheduler* schedule){ //调度器初始化 + for(int i = 0; i < MAX_THREADS; i++){ + sched->threads[i].state = FREE; + } + schedule.running_thread = -1; +} +void uthread_yield(scheduler *schedule){ //主动让出CPU + int id = schedule->running_thread; //获取当前协程 + uthread_t *t = &(schedule->threads[id]); + t->state = RUNNABLE; //状态置为RUNNABLE + swapcontext(&t->ctx, &schedule->ctx); //切换到调度器 +} +void uthread_exit(scheduler *schedule){ //协程退出 + int id = schedule->running_thread; //获取当前协程 + uthread_t *t = &(schedule->threads[id]); + + void *stack = t.stack; //获取栈地址 + free(stack); //释放栈 + + t->state = FREE; //结构体只空 + setcontext(&schedule->ctx); //设置为调度器上下文回到调度器 +} + +void runScheduler(scheduler *schedule){ + while(not all finished){ + uthread = seek_one_Runnable(); //寻找一个RUNNABLE协程 + schedule->running_thread = uthread->id; //正在执行的协程id更新 + swapcontext(&schedule->ctx, &uthread->ctx); //切换! + schedule->running_thread = -1; //没有在执行的 + } +} +``` + +上述便是用户级线程的实现,主要就是模拟内核里面调度,上下文的操作。 + +
+ +### 3 其他功能实现 + +#### 3.1 封装运行库 + +**运行库,顾名思义用户程序运行需要的环境组成的一个库,可以看作是标准库的超集,其中一个功能便是给 main 函数提供环境**。 + +main 函数也是函数,根据函数调用约定,如果 P 调用 Q,P 要提供 Q 需要的参数,P 还要要处理 Q 执行的结果。那谁来为 main 函数提供准备参数呢?谁又来处理 main 函数的执行结果呢?答案就是这里的运行库。 + +原有的 xv6 没有封装运行库,所以 exec 函数执行完之后,直接中断退出到用户态开始执行用户程序,用户程序执行完之后不能像普通函数那样 return 返回,只能调用 exit 函数进行退出。封装了运行库之后,使得 main 函数更像普通函数,可以使用 return 语句。具体实现如下: + +```assembly +.globl main +.globl exit + +.section .text +.globl _start +_start: + + jal ra, main + jal x0, exit +``` + +编写如上所示的汇编代码,指定 _start 标识,然后和用户程序编译在一起: + +```makefile +CRT = $(ULIB) $(USER)/start.o $(UTHREADLIB) + +#$(LD) $(LDFLAGS) -N -e main -Ttext 0 -o $@ $^ +$(LD) $(LDFLAGS) -N -Ttext 0 -o $@ $^ +``` + +这样以来,用户程序的入口点从指定的 main,变为默认的 `_start`,这样的话执行 main 函数之前会先执行 `_start` 汇编程序。 + +这里首先就直接跳到 main 函数执行,之所以没有为其准备参数是因为在 exec 函数里面已经准备好了,a0 a1 寄存器里面就是现在 main 函数需要的参数,不需要做任何改变。 + +main 函数执行完成使用 `return x` 退出之后,a0 里面存放的是返回状态码,也是 exit 函数需要的参数,同样的我们不需要做任何改变,直接调用 exit 函数。 + +这就是运行库的作用之一,为 main 函数准备环境和善后收尾。 + +#### 3.2 改写任务结构体 + +实现前面的功能时老是会出现锁的问题,就想着先使用大粒度锁来简化操作,后续开发再使用小粒度锁提高性能。 + +对于内核任务管理锁的方面做如下处理:使用一把锁 ptable_lock 来管理整个任务结构体表,用来保护任务结构体的分配,回收,状态变化等等。再使用一把锁 wait_lock 来确保 wait 函数不会错过休眠。 + +xv6 中的休眠唤醒机制如下所示: + +```c +sleep(objAddr, obj_lock); +``` + +休眠在某个对象上是指将该进程的 chan 属性字段设置为 objAddr,然后设置状态为 SLEEPING,调用 swtch 函数进行任务切换。 + +之所以需要 obj_lock 是为了避免错过唤醒,原因如下: + +**首先需要一个 obj_lock 来保护资源在不同进程之间的竞争,另外如果没有 obj_lock 的话,那么 唤醒进程 调用 wakeup 函数是可能在 休眠进程 调用 sleep 之前的**。 + +举个例子,唤醒进程使用 A 来表示,休眠进程使用 B 来表示,B 调用了 sleep 函数休眠,需要 A 调用 wakeup 来唤醒。 + +**如果没有 obj_lock,B 直接 sleep(obj) 休眠在 obj 上,如果 B 因为某些事件比如说中断延后执行 sleep,由于没有 obj_lock 的保护,那么进程 A 可以调用 wakeup 进行唤醒,但毫无作用。B 进程回来之后调用 sleep 进行休眠,但是 A 已经执行过 wakeup 了,这就是错了唤醒,所以必须使用 obj_lock 来保证不会错过唤醒**。 + +但是必须得把 obj_lock 当作参数传进 sleep 函数,原因如下: + +1. **我们不能带锁休眠,不然会死锁,所以在实际将 state = SLEEPING; swtch() 之前,需要释放锁。** +2. **但是如果在 state = SLEEPING; swtch() 之前释放锁,完全有可能出现前面所说的情况,在这之前 B 进程因为某些事件延后执行,就比如中断。这时候 A 进程取得 obj_lock,执行 wakeup 函数,那么 B 进程就会错过唤醒**。 + +所以综上,**sleep 函数需要在 state = SLEEPING ; swtch 之前释放掉 obj_lock 来保证不会带锁休眠导致死锁, 又需要在 state = SLEEPING ;swtch 之后释放调用来保证不会错过唤醒**。 + +两者明显冲突,**因此需要另外一个来保证两者是原子操作就行,这里就使用了 ptable_lock**,所以 sleep 函数中的操作为: + +```cc +sleep(obj, obj_lock){ + acquire(ptable_lock); + release(obj_lock); + + state = SLEEPING; + swtch(); + + release(ptable_lock); + acquire(obj_lock); +} +``` + +如此便解决了带锁休眠,错过唤醒的两个问题,不过还有一个小问题:**wait 函数中休眠的对象锁就是 ptable_lock,冲突了,为此设计了一个 wait_lock 来供 wait 函数使用**。 + +经过上述改造,对于进程的调度,状态改变锁的使用简单许多,虽然性能有些许下降,但是便于后面的功能实现和测试,待完善以后再使用小粒度锁提高性能。 + +#### 3.3 修改页表内存释放 bug + +原有项目代码对于页表占用的内存释放有 bug,并未完全释放,这里修改,释放进程的函数主要有两个 + +```c +uvm_free(size){ //根据用户程序大小释放内存 + for page in 0..size { + free(page) + } +} +free_pagetable(pgt){ //释放页表占用的内存 + //如果不是叶子页表,即页表项指向的内存不是物理内存还是页表 + if pgt.isleaf() == 0 { + for pte in pgt { //遍历页表项 + free_pagetable(pte as pgt) //递归释放子页表 + } + } + free(pgt) //释放了子页表,释放自己 +} +``` + +#### 3.4 延迟分配 + +缺页异常有三种情况: + +1. **读写页表项不存在的内存,可以利用这个来实现延迟分配** +2. **读写内存没有相应的权限,比如对只读内存进行写操作,可以用来实现写时复制** +3. **读写页表项 P 位为 0 的内存,表明相应的数据不在主存,而在外存磁盘上,可以用来实现页面置换算法** + +这里我们先实现了页面延迟分配。 + +需要分配内存的地方就是 malloc,malloc 有个函数 morecore,morecore 又调用 sbrk 系统调用向内核申请空间。 + +sbrk 系统调用会调用 growproc 来进行物理内存分配,然后使用 map 建立映射关系,这里我们需要做的就是 sbrk 里面并不实际调用 growproc 来增长物理内存,只将用户程序的大小增加相应的值然后返回。 + +待到实际向这片区域进行读写操作时,就会触发缺页异常,这时候再从 stval 中读取到引发缺页异常的地址,对这个地址向下取整,然后为其分配实际的物理内存再建立映射关系。 + +#### 3.5 进程优先级调度 + +对于进程的调度算法,在原先的基础上实现了优先级调度,目前的实现思想和方式比较简单,**就是在结构体里面添加 priority 优先级字段,每次调度器 scheduler 执行的时候,如果当前进程还没有执行完成,那么优先级按照一定算法降低,最简单的就是减去一个固定值。然后 scheduler 每次都从就绪队列中选取一个优先级最高的进程为其分配 CPU**。 + +由于原有的进程结构体的组织方式用的是数组,每次都要遍历,效率其实不高,这在后续中我们会改成使用链表或者树结构,实现红黑树以及 CFS 完全公平调度算法。 + +
+ +### 4 待/正开发的功能 + +#### 4.1 信号机制 + +**Signal 机制也是进程间通信的一部分,它是用软件对中断的模拟。这是一般情况下的意义,只不过现在信号的含义比较广泛,它可能与外部中断有关,比如说键盘按下 Ctrl + C 触发 SIGINT 信号。另外信号机制在英文中有时也称为 software interrupt,x86 架构下的 INT x 指令也是这个称呼,但这其实是两种不同的概念**。 + +这里我们打算实现有软件来模拟中断的信号机制,数据结构设计如下: + +##### 数据结构设计 + +```c +struct proc { + //... + uint sig_pending; //等待处理得信号 + uint sig_mask; //屏蔽得信号 + void *sig_handlers; //处理信号的函数的位置 + //... +} +``` + +主体部分就是在进程结构体 proc 中添加以上三个属性字段,各含义如上所示。 + +```cc +struct sigaction { + void (*sa_handler)(int); //sig_handler + uint sigmask; //是否屏蔽 +}; +``` + +这个结构体用作注册信号使用,具体含义如上所示 + +下面来讲述信号的处理过程以及上述结构涉及的一些方法 + +##### 信号处理过程 + +###### 注册信号 + +```c +int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact){ + struct proc *p = myproc(); //获取当前进程 + //将当前的 sigaction 传到用户态的old位置处 + copyout(p->pagetable, (uint64)&oldact->sa_handler, (void *)&p->sig_handlers[signum], sizeof(p->sig_handlers[signum])); + copyout(p->pagetable, (uint64)&oldact->sigmask, (void *)&p->handlers_mask[signum], sizeof(p->handlers_mask[signum])); + //将用户态的sigaction结构体信息复制到内核,即将处理该信号的函数地址赋到sig_handlers[signum] + copyin(p->pagetable, (void *)&p->sig_handlers[signum], (uint64)&act->sa_handler, sizeof(act->sa_handler)); + copyin(p->pagetable, (void *)&p->handlers_mask[signum], (uint64)&act->sigmask, sizeof(act->sigmask)); +} +``` + +###### 发送信号 + +发送信号是 kill 函数来实现,这里我们改进原 xv6 里面的 kill 函数 + +```c +int kill(int pid, int signum){ + struct proc *p = getProcByPid(); + //... + p->sig_pending = p->sig_pending | (1 << signum); + //... +} +``` + +如上所示,发送信号是相当简单,将进程号为 pid 的进程的 sig_pending 属性字段与 (1<处理信号->恢复上下文 这三个过程。 + +**但是信号处理与实际的中断处理还是有所不同,中断的处理过程一定是在内核当中实现,也就是说中断处理函数是个内核函数,需要在内核态执行,但是信号处理函数不一定,信号处理函数有些是内核函数,比如说 kill 一个进程发送的 SIGKILL 信号,这个信号的处理是可以在内核中直接完成的。但是对于一些用户注册的信号,其处理函数是在用户态,虽然内核权力大可以执行用户态的代码,存取用户态的数据,但是各司其职,其处理过程还是应当在用户态完成,所以这里就会有上下文保存恢复,特权级转移**,我们的伪码实现如下所示: + +```c +void handle_signal(){ + struct proc *p = myproc(); + for(int i = 0; i < 32; i++){ //遍历所有信号 + //如果当前信号未处理并且未屏蔽 + if(p->sig_pending & (1 << i) && !p->sig_mask & (1 << i)){ + if(i == SIGKILL | SIGSTOP | ...){ //如果内核可以直接处理 + handle_in_kernel(); + }else{ + + p->trapframe->sp -= sizeof(struct trapframe); //在用户栈分配用户态的trapframe空间 + p->signal_trapframe = p->trapframe->sp; //将这个地址记录在案 + //将当前的trapframe填充到用户栈 + copyout(p->pagetable, p->signal_trapframe, p->trapframe, sizeof(struct trapframe)); + + //信号处理退出函数的大小 + long size = (long)&sigret_end - (long)&sigret_start; + p->trapframe->sp -= size; //在栈中为信息处理函数分配空间 + //将信息处理函数复制到用户栈 + copyout(p->pagetable, p->trapframe->sp, (void*)&sigret_start, size); + + p->trapframe->a0 = i; //第一个参数为signum + p->trapframe->ra = p->trapframe->sp; //信号处理函数执行完之后执行这个函数sigret + + p->trapframe->epc = (long)p->sig_handlers[i]; //返回用户态时的地址,执行信号处理函数 + + } + } + + p->sig_pending &= ~(1 << i); //该信号“在处理了” + } +} + +void sigret(void){ + struct proc *p = myproc(); + //将保存在用户态的trapframe复制到该进程的trapframe + copyin(p->pagetable, (char *)t->trapframe, (uint64)t->usertrap_backup, sizeof(struct trapframe)); + //.. + p->trapframe->sp += sizeof(struct trapframe); //栈指针向上移动一个trapframe大小 +} +``` + +上述便是处理信号处理的核心过程,最重要的就是保存上下文到用户栈,然后更新 epc, ra 寄存器来改变执行流的操作。这部分会在后续完善。 + +#### 4.2 写时复制 + +**写时复制是利用页表项的读写位来实现的,主要用在 fork 程序当中,在原本的 fork 程序当中,子进程是实实在在的复制了一份父进程的页表和用户态的所有数据(代码和数据)。但是写时复制只会复制父进程的页表,不会复制数据,只有当一个进程在写的时候才会实际分配物理内存复制一份数据**。因此,按照这个思想,写实复制实现的思路如下所示: + +```c +int uvmcopy(pagetable_t old, pagetable_t new, uint64 sz){ + for(int i = 0; i < sz; i++){ + pte = getPte(i); //获取地址i所在页的pte,不存在的话就分配 + pa = PTE2PA(pte); //取出里面存放的物理地址 + + pte.W = 1; //旧页表项禁止写操作 + pte.COW = 1; //将COW位置1,没有这个位,我们将页表项中的保留未使用的位当作COW位 + flags = pte.flags; //获取页表项的flags; + //将地址i映射到pa,标识为flags,同样禁止写,此函数会自动创建页表项。 + mappages(new, i, PGSIZE, pa, flags); + } +} +``` + +**此函数便是改进后复制用户数据的函数,可以看出并未实际复制数据,只是复制了一份页表,并且将叶子页表项的 W 位清零表示禁止写操作**。 + +所以如果有进程对相应内存进行写操作,那么就会触发缺页异常,因此接下来需要做得就是在异常处理函数处理该异常,为触发异常的进程分配内存,复制一份数据,修改页表项为可写,伪码如下: + +```c +trap(){ + struct proc *p = myproc(); + if(r_scause() == 15){ //表示StorePageFault + va = r_stval(); //获取触发异常的虚拟地址 + va = PG_ROUND_DOWN(va); //向下取整到PGSIZE整数倍 + + pte = walk(p->pagetable, va); //获取该地址va所在页的页表项 + if(pte.COW == 1){ + mem = kalloc(); //分配物理内存 + pa = getPaddr(p->pagetable, va); //根据页表获取va的物理地址 + memmove(mem, pa, PGSIZE); //复制一份数据 + + flags = getFlags(pte); //获取flags + flags |= PTE_W; //增加可写 + flags &= ~PTE_COW; //取消COW位 + + mappages(p->pagetable, va, PGSIZE, mem, flags); //重新将va映射到mem + } + } +} +``` + +上述便是 COW 写时复制的基本实现过程,核心就是不复制数据,只复制页表,等到出错触发缺页异常的时候才真正复制一份数据出来并重新映射修改页表项使其可写。 + +**复制相当于之前的分配操作,我们已经完成,但有分配就有回收,还需要对回收操作进行改动,因为在写时复制下,多个进程共享内存,当一个进程退出时会释放内存,但是因为共享,不能真正的释放内存**,解决方法如下: + +```c +char pa_ref[NR_PG]; //设计一个数组存放每个数据页的引用次数 +copy_uvm(){ //复制数据的时候 + add_ref(pa); //增加该页的引用次数 +} +kree(pa){ //释放该页 + sub_ref(pa) //该页引用次数减1 + if(pa_ref[pa] == 0){ //只有该页的引用次数为 0 的时候才真正的释放 + free(pa); + } +} +``` + +**核心思想就是增加一个引用计数,只有当物理页的引用次数为 0 的时候才真正的进行释放操作**。 + +以上便是写时复制的实现思路,这在原本的 xv6 上是很好实现的,因为分配和释放物理内存的单位都是页,不过现有项目底层实现了伙伴系统和 Slab 分配器,实现方式会有所不同,但核心思想不变,这在后面完善实现。 + +#### 4.3 mmap 系统调用 + +mmap 系统调用的功能很多,我们准备实现其基本零拷贝读写文件的功能,**mmap 与共享内存挂钩,可以看作是 共享内存 + bread**,我们首先在共享区申请一块共享内存,然后调用文件系统底层的读取快缓冲函数将数据读到该共享内存。如此便实现了零拷贝读写文件的功能,在取消映射的时候将数据同步到磁盘。 + +#### 4.4 CFS 调度算法 + +现下只是实现了简单的优先级调度,后续会改进进程结构体的组织方式,使用红黑树实现,然后在其上实现 CFS 调度算法。将 task_struct 维护成一个红黑树,排序规则为 虚拟时间大小,最左侧为虚拟时间最小的节点,每次取最左侧的节点分配 CPU,是为“完全公平”。一些数据结构设计如下所示: + +##### 红黑树 + +红黑树是一种自平衡的二叉树,最左的叶子节点永远是 key 最小的节点。红黑树通过插入(更新)和删除时的操作保证这些原子操作之间红黑树永远是平衡的。 + +##### 运行时间 + +$ 运行时间 t_n =调度周期T \times 进程权重 w / 运行队列中全部进程的权重之和 S $ + +调度周期/调度延迟 是内核里面中的固有概念(不是固定值),他表示了一段时间,并且在这段时间内,所有的可被调度程序都应该至少被运行一次. + +但是在 CFS 中没有固定的时间片了,我们的方法是先规定好调度延时,然后进程再根据比例去瓜分一个调度延时(周期)的时间. + +##### 最小运行时间 + +为了避免过度频繁的抢占发生,我们设置每个 Task(进程)的最小运行时间(或称运行时间粒度),在这个时间内,这个进程的 CPU 资源是不可被抢占的。除非进程主动让出 CPU 或者执行了阻塞的系统调用,一般而言进程都可以执行最少执行完这个时间。 + +##### 虚拟运行时间 + +$ 虚拟运行时间=真实运行时间 \times NICE\_0\_LOAD / 进程的权重 $ + +其中 nice 值为 0 的权重 NICE_0_LOAD=1024,nice 值每差1,权重大约差 1.25 倍。这里的1.25 计算依据来源于 nice 值差 1,运行时间相差 10% 这样的设计 + +权重越大的值虚拟运行时间越小,可能使得**高优先级进程运行15ms=低优先级运行5ms** + +在内核里面我们将调度队列上的进程按照 vruntime 排列成红黑树,这样选取最小 vruntime 的进程就变为了简单地选出最左边的叶子节点了,一次来达到“完全公平”调度。 + +
+ +## 三、问题与解决方法 + +### 1 rust语言和riscv架构 + +此次项目是在 riscv 架构下使用 rust 语言开发,对于 rust 语言和 riscv 架构之前没怎么接触过,不是很了解。rust 语言有着自己的特性,比如所有权,生命周期等概念,rust安全性很高,在编译时期就将许多错误指出来,所以编写代码时经常需要与编译器斗智斗勇。 + +架构方面,以前较为熟悉的是 x86 架构,此次的接触 riscv 架构,使用精简指令集,对于汇编的写法,函数调用的约定,中断处理的过程,特权级的分离转移等等都有所不同。经常因为 x86 的定势思维而写错代码。 + +### 2 用户栈溢出问题 + +xv6 里面的内存布局与现在的 Linux 有所不同,栈直接位于数据段上面,并且只分配了一页,如下图所示: + +![UserSpace](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/UserSpace.png) + +所以用户栈的大小其实比较小,最开始在实现协程时,为其分配协程栈时直接定义成了 char 数组,大小为 4096 字节,局部变量都是存在栈中的,所以这会导致栈溢出。 + +最开始没有注意到这个问题,因为对于线程协程的实现,对于上下文的操作涉及到精密的寄存器操作,定向思维觉得是上下文操作更可能出错,便没有注意到栈溢出的问题。 + +后来反复打印消息和使用 gdb 进行调试,发现定义一个协程可以语句可以执行,但只要一执行后面的语句马上出错,这让我意识到应该是用户栈出了问题。然后仔细排查,得出声明的协程类中栈应该设置为一个 char \* 的指针即可,实际的内存从堆里面分配。 + +### 3 trapframe 覆盖问题 + +这个问题也还是定向思维的问题,我之前一直了解的是 x86 下的 xv6,x86 架构下,trapframe 没有单独分配空间,使用的是内核栈空间。切换进程最重要的操作就是更换内核栈,然后恢复任务切换上下文,再然后弹出恢复存放在内核栈里面的 trapframe 恢复到用户态。 + +而且 x86 架构下的中断机制通过 IDT,中断向量,中断描述符等机制实现,跳转到的中断服务程序地址由中断描述符中记录的地址决定。再者 x86 下对于特权级转移时 内核栈 用户栈 是通过 TSS 中记录的 esp0 来实现的的。 + +但 riscv 架构下的 xv6 不同,trapframe 的虚拟地址固定,中断跳转退出的地址都固定。每个进程要退回用户态时都从同一个地方获取 trapframe,然后恢复上下文。 + +在实现内核级线程的时候,线程有自己单独的 trapframe,但是它的地址不再是预定义好的 TRAPONLINE,所以退出的时候也不能从 TRAPONLINE 获取 trapframe 的地址。 + +这个 bug 我找了很多天,一直没找到,后面仔细研究了 riscv 的中断机制,然后细细阅读代码找到了这个原因。然后便给出了上述章节 2.1 给出的解决方案,每次读取的地址变为 $TRAPONLINE + threadID * sizeof(struct\ \ trapframe)$,便解决了问题,具体方案见前。 + +### 4 锁的问题 + +xv6 底层锁的本身设计比较简单,但是使用起来比较困难,特别是如果想要提高性能,将锁的粒度降下来更是困难。在开发当中出现了很多与锁相关的问题,但细细研究其实出问题的地方并非是锁,比如上述的 trapframe 覆盖,栈溢出等问题,由于栈中的数据和 trapframe 中保存到的上下文出了问题,这些都涉及到了实际的指令方面的问题,会导致莫名的错误,然后又是由于多 CPU,总总原因最后会导致取锁问题,然后 panic。 + +这种莫名问题最是难以调试,而且由于调度时机等问题,每次调试的结果都不一样,为了简化操作,缩小出问题的范围,便将锁的粒度给降下来,比如说进程方面,只是用了一个 ptable_lock,wait_lock 来保护,重构了管道使其数据与锁分离等等,来减小因为锁出问题的概率,然后缩小实际出错的范围,便于调试。 + +### 5 其他问题 + +其他问题大多就是写代码的时候由于粗心大意,用错函数,比如说某些函数的参数较多,参数顺序弄错,就如 mappages(pagetable, va, size, pa, perm),其中虚拟地址 va 和 pa 是分开的,中间隔了一个 size,而我以为 va 和 pa 两个参数在一起,导致错误发生,这类错误有的还是很好排查,有的不太起眼便不太容易。 + +另外还有就是由于不太清楚 rust、makefile、qemu 等等一些配置文件,有时稍有不经意的改动,便会出错,比如说当时安装 tmux 因占用端口的原因导致不能远程连接 debug,后来仔细分析报错信息和阅读一些配置脚本文件,将错误改了过来。 + +
+ +## 四、结果 + +### 1 进程间的通信 + +#### 1.1 共享内存 + +![share memory](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/image-20220814234215182.png) + +#### 1.2 消息队列 + +![image-20220814234541086](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/image-20220814234541086.png) + +#### 1.3 有名管道 + +![image-20220814234932013](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/image-20220814234932013.png) + +#### 1.4 信号量 + +![image-20220814235137062](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/image-20220814235137062.png) + + + +### 2 线程协程 + +#### 2.1 线程 + +![image-20220814235719246](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/image-20220814235719246.png) + +#### 2.2 协程 + +![image-20220814235910678](D:/OS_Competion/docs/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.assets/image-20220814235910678.png) + +
+ +## 五、未来展望 + +目前我们组只实现了最基本的功能,还有许多地方都未完善,将在后面完善,提高安全稳定健壮性,具体如下所示 + +### 1 进程间通信 + +改写内存管理方式,将共享区使用链表来管理 + +改写文件系统,使得有名管道像文件一样可以安装到文件系统中 + +信号量机制目前只实现了内核级的,并不能像已有库里面那样直接在用户程序里面声明使用,另外对于计数器的原子加减是通过锁来实现的,后续可以利用 rust 特性来实现。 + +消息队列以及上述所有的通信方式都还需要在生产者消费者模型上,以及多个进程通信上完善 + +另外后续也会尝试实现较为复杂的信号机制,将外部中断,软件中断,实际的信号等抽象出来 + +### 2 线程协程 + +对于内核级线程,后续可以尝试将进程线程稍微分离开来,并不是简单粗暴的线程直接使用进程的结构体,只不过在某些资源方面"置空"处理,将线程需要独占的资源分离出来,用另外的数据结构表示,再实现相应的方法,如此性能可能进一步提高 + +对于用户级线程,后续会完善 ucontext 类,对于用户级线程的调度器也还需要完善。 + +### 3 缺页异常 + +利用缺页异常可以实现延迟分配,写时复制,页面置换,目前已经实现了延迟分配,后续可以实现写时复制和页面置换。 + +写时复制的核心思想是:调用 fork 赋值用户态数据时并不进行实际的复制操作,只复制相应的页表,在复制的过程中将父子进程的页表项的读写为设置为只读,如此父子进程的某一方需要对内存进行写操作时便会触发缺页异常,这时我们才在缺页异常处理函数中为其分配实际的物理内存修改页表项重新建立映射关系 + +目前写时复制已经实现了这一步,不过写时复制应该还要增加页面引用计数功能,这在原先的物理内存分配接口 kalloc,free 是比较方便操作的,不过现有项目底层的物理内存分配器为伙伴系统和 Slab 分配器结合体,具体如何操作有待后续思考完成 + +### 4 调度算法 + +关于调度算法目前只是在原有的时间片轮转法基础上为进程添加优先级属性,scheduler 每次挑选进程时总是挑选优先级高的进程,以此来实现了最简单的优先级调度算法。 + +使用数组来组织任务结构体效率较低,后续准备使用链表或者红黑树来组织任务结构体,然后实现 CFS 调度算法。 + +不只是任务结构体的组织方式,休眠唤醒机制也可以使用链表来实现,不然每次遍历任务结构体数组,效率太低。 + +
+ +## 六、代码结构 + +项目的代码结构如下所示: + +``` +├───allocator +├───bin +├───docs +│ └───static +├───fs-lib +│ ├───src +│ └───target +│ +├───kernel +│ ├───.cargo +│ └───src +│ ├───asm +│ ├───console +│ ├───define +│ ├───driver +│ ├───fs +| ├───ipc +│ ├───interrupt +│ ├───lock +│ ├───logo +│ ├───memory +│ │ └───mapping +│ ├───net +│ ├───process +│ ├───register +│ ├───syscall +│ └───test +├───mkfs +│ ├───src +│ └───target +├───user +│ ├───.cargo +│ └───src +| ├───include +│ ├───uthread +│ └───bin +└───utils +``` + +`allocator` 单独作为一个 `crate` 实现 `Buddy System` ,在 kernel 中引入 + +`bin` 用来存放用户程序的二进制可执行程序 + +`docs` 用来存放文档 + +`fs-lib` 用来为 `mkfs` 实现一些基础的文件系统的数据结构和方法 + +`kernel` 用来存放操作系统内核打代码 + +- `asm` 用来存放汇编代码 +- `console` 用来存放输入输出相关代码,包括`uart` 和 `console` 的实现 +- `define` 主要用来存放常量的定义 +- `driver` 存放设备驱动代码 +- `fs` 存放文件系统的实现 +- `ipc` 存放进程间通信的各种实现 +- `interrupt` 存放 `trap` 的处理函数 +- `lock` 实现了 `spinlock` 和 `sleeplock` +- `logo` 为本项目的 logo +- `memory` 存放内存分配以及地址映射等相关代码实现 +- `net` 存放网络栈的实现代码 +- `process` 存放进程与调度相关的代码 +- `register` 主要用来存放各种寄存器的相关代码 +- `syscall` 用来存放系统调用的实现 +- `test` 主要存放一些用于在内核测试的代码 + +`mkfs` 用来存放构建文件镜像的实现代码 + +`user` 用来存放用户程序,其中包括函数库,系统调用和用户程序的实现 + +- `uthread`,实现了协程库和 `ucontext` 库 +- 其下还有上述实现(二)的各种测试程序 + +`utils` 主要用于存放一些帮助程序运行的工具代码 + +## 七、收获 + +- 使用 Rust 改写 xv6,更加深刻地理解了操作系统与硬件是如何协同工作的 +- 熟悉了 Rust 语言在系统级应用上的开发 +- 增强了调试程序的能力 +- 提高了自己开发较大型工程的能力 + +## 八 分工 + +彭泽杰:信号量,有名管道,线程协程,封装运行库等 + +董慧勇:消息队列,文档书写 + +刘辰:共享内存,文档书写 + +## 九、参考实现 + +- [xv6-riscv](https://github.com/mit-pdos/xv6-riscv) + +- [rCore-Tutorial-v3](https://github.com/rcore-os/rCore-Tutorial-v3) + +- [xbook2](https://gitee.com/hzc1998/xbook2) diff --git "a/doc/\350\256\276\350\256\241\346\226\207\346\241\243.pdf" "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.pdf" new file mode 100755 index 0000000..0bd7b45 Binary files /dev/null and "b/doc/\350\256\276\350\256\241\346\226\207\346\241\243.pdf" differ diff --git a/fs-lib/.gitignore b/fs-lib/.gitignore old mode 100644 new mode 100755 diff --git a/fs-lib/Cargo.toml b/fs-lib/Cargo.toml old mode 100644 new mode 100755 diff --git a/fs-lib/src/inode.rs b/fs-lib/src/inode.rs old mode 100644 new mode 100755 diff --git a/fs-lib/src/lib.rs b/fs-lib/src/lib.rs old mode 100644 new mode 100755 diff --git a/fs-lib/src/superblock.rs b/fs-lib/src/superblock.rs old mode 100644 new mode 100755 diff --git a/kernel.asm b/kernel.asm new file mode 100644 index 0000000..4f8a9d0 --- /dev/null +++ b/kernel.asm @@ -0,0 +1,78733 @@ + +kernel/target/riscv64gc-unknown-none-elf/debug/kernel: file format elf64-littleriscv + + +Disassembly of section .text: + +0000000080000000 <_entry>: + 80000000: 00039117 auipc sp,0x39 + 80000004: 37010113 addi sp,sp,880 # 80039370 + 80000008: 6511 lui a0,0x4 + 8000000a: f14025f3 csrr a1,mhartid + 8000000e: 0585 addi a1,a1,1 + 80000010: 02b50533 mul a0,a0,a1 + 80000014: 912a add sp,sp,a0 + 80000016: 0000d097 auipc ra,0xd + 8000001a: cba080e7 jalr -838(ra) # 8000ccd0 + 8000001e: 0001 nop + +0000000080000020 : + 80000020: 7111 addi sp,sp,-256 + 80000022: e006 sd ra,0(sp) + 80000024: e40a sd sp,8(sp) + 80000026: e80e sd gp,16(sp) + 80000028: ec12 sd tp,24(sp) + 8000002a: f016 sd t0,32(sp) + 8000002c: f41a sd t1,40(sp) + 8000002e: f81e sd t2,48(sp) + 80000030: fc22 sd s0,56(sp) + 80000032: e0a6 sd s1,64(sp) + 80000034: e4aa sd a0,72(sp) + 80000036: e8ae sd a1,80(sp) + 80000038: ecb2 sd a2,88(sp) + 8000003a: f0b6 sd a3,96(sp) + 8000003c: f4ba sd a4,104(sp) + 8000003e: f8be sd a5,112(sp) + 80000040: fcc2 sd a6,120(sp) + 80000042: e146 sd a7,128(sp) + 80000044: e54a sd s2,136(sp) + 80000046: e94e sd s3,144(sp) + 80000048: ed52 sd s4,152(sp) + 8000004a: f156 sd s5,160(sp) + 8000004c: f55a sd s6,168(sp) + 8000004e: f95e sd s7,176(sp) + 80000050: fd62 sd s8,184(sp) + 80000052: e1e6 sd s9,192(sp) + 80000054: e5ea sd s10,200(sp) + 80000056: e9ee sd s11,208(sp) + 80000058: edf2 sd t3,216(sp) + 8000005a: f1f6 sd t4,224(sp) + 8000005c: f5fa sd t5,232(sp) + 8000005e: f9fe sd t6,240(sp) + 80000060: 00007097 auipc ra,0x7 + 80000064: 8a0080e7 jalr -1888(ra) # 80006900 + 80000068: 6082 ld ra,0(sp) + 8000006a: 6122 ld sp,8(sp) + 8000006c: 61c2 ld gp,16(sp) + 8000006e: 7282 ld t0,32(sp) + 80000070: 7322 ld t1,40(sp) + 80000072: 73c2 ld t2,48(sp) + 80000074: 7462 ld s0,56(sp) + 80000076: 6486 ld s1,64(sp) + 80000078: 6526 ld a0,72(sp) + 8000007a: 65c6 ld a1,80(sp) + 8000007c: 6666 ld a2,88(sp) + 8000007e: 7686 ld a3,96(sp) + 80000080: 7726 ld a4,104(sp) + 80000082: 77c6 ld a5,112(sp) + 80000084: 7866 ld a6,120(sp) + 80000086: 688a ld a7,128(sp) + 80000088: 692a ld s2,136(sp) + 8000008a: 69ca ld s3,144(sp) + 8000008c: 6a6a ld s4,152(sp) + 8000008e: 7a8a ld s5,160(sp) + 80000090: 7b2a ld s6,168(sp) + 80000092: 7bca ld s7,176(sp) + 80000094: 7c6a ld s8,184(sp) + 80000096: 6c8e ld s9,192(sp) + 80000098: 6d2e ld s10,200(sp) + 8000009a: 6dce ld s11,208(sp) + 8000009c: 6e6e ld t3,216(sp) + 8000009e: 7e8e ld t4,224(sp) + 800000a0: 7f2e ld t5,232(sp) + 800000a2: 7fce ld t6,240(sp) + 800000a4: 6111 addi sp,sp,256 + 800000a6: 10200073 sret + 800000aa: 00000013 nop + 800000ae: 0001 nop + +00000000800000b0 : + 800000b0: 34051573 csrrw a0,mscratch,a0 + 800000b4: e10c sd a1,0(a0) + 800000b6: e510 sd a2,8(a0) + 800000b8: e914 sd a3,16(a0) + 800000ba: 6d0c ld a1,24(a0) + 800000bc: 7110 ld a2,32(a0) + 800000be: 6194 ld a3,0(a1) + 800000c0: 96b2 add a3,a3,a2 + 800000c2: e194 sd a3,0(a1) + 800000c4: 4589 li a1,2 + 800000c6: 14459073 csrw sip,a1 + 800000ca: 6914 ld a3,16(a0) + 800000cc: 6510 ld a2,8(a0) + 800000ce: 610c ld a1,0(a0) + 800000d0: 34051573 csrrw a0,mscratch,a0 + 800000d4: 30200073 mret + ... + +0000000080001000 : + 80001000: 14051573 csrrw a0,sscratch,a0 + 80001004: 02153423 sd ra,40(a0) # 4028 <.Lline_table_start0+0xb7> + 80001008: 02253823 sd sp,48(a0) + 8000100c: 02353c23 sd gp,56(a0) + 80001010: 04453023 sd tp,64(a0) + 80001014: 04553423 sd t0,72(a0) + 80001018: 04653823 sd t1,80(a0) + 8000101c: 04753c23 sd t2,88(a0) + 80001020: f120 sd s0,96(a0) + 80001022: f524 sd s1,104(a0) + 80001024: fd2c sd a1,120(a0) + 80001026: e150 sd a2,128(a0) + 80001028: e554 sd a3,136(a0) + 8000102a: e958 sd a4,144(a0) + 8000102c: ed5c sd a5,152(a0) + 8000102e: 0b053023 sd a6,160(a0) + 80001032: 0b153423 sd a7,168(a0) + 80001036: 0b253823 sd s2,176(a0) + 8000103a: 0b353c23 sd s3,184(a0) + 8000103e: 0d453023 sd s4,192(a0) + 80001042: 0d553423 sd s5,200(a0) + 80001046: 0d653823 sd s6,208(a0) + 8000104a: 0d753c23 sd s7,216(a0) + 8000104e: 0f853023 sd s8,224(a0) + 80001052: 0f953423 sd s9,232(a0) + 80001056: 0fa53823 sd s10,240(a0) + 8000105a: 0fb53c23 sd s11,248(a0) + 8000105e: 11c53023 sd t3,256(a0) + 80001062: 11d53423 sd t4,264(a0) + 80001066: 11e53823 sd t5,272(a0) + 8000106a: 11f53c23 sd t6,280(a0) + 8000106e: 140022f3 csrr t0,sscratch + 80001072: 06553823 sd t0,112(a0) + 80001076: 141022f3 csrr t0,sepc + 8000107a: 00553c23 sd t0,24(a0) + 8000107e: 00853103 ld sp,8(a0) + 80001082: 02053203 ld tp,32(a0) + 80001086: 01053283 ld t0,16(a0) + 8000108a: 00053303 ld t1,0(a0) + 8000108e: 18031073 csrw satp,t1 + 80001092: 12000073 sfence.vma + 80001096: 8282 jr t0 + ... + +00000000800010a0 : + 800010a0: 18059073 csrw satp,a1 + 800010a4: 12000073 sfence.vma + 800010a8: 07053283 ld t0,112(a0) + 800010ac: 14029073 csrw sscratch,t0 + 800010b0: 02853083 ld ra,40(a0) + 800010b4: 03053103 ld sp,48(a0) + 800010b8: 03853183 ld gp,56(a0) + 800010bc: 04053203 ld tp,64(a0) + 800010c0: 04853283 ld t0,72(a0) + 800010c4: 05053303 ld t1,80(a0) + 800010c8: 05853383 ld t2,88(a0) + 800010cc: 7120 ld s0,96(a0) + 800010ce: 7524 ld s1,104(a0) + 800010d0: 7d2c ld a1,120(a0) + 800010d2: 6150 ld a2,128(a0) + 800010d4: 6554 ld a3,136(a0) + 800010d6: 6958 ld a4,144(a0) + 800010d8: 6d5c ld a5,152(a0) + 800010da: 0a053803 ld a6,160(a0) + 800010de: 0a853883 ld a7,168(a0) + 800010e2: 0b053903 ld s2,176(a0) + 800010e6: 0b853983 ld s3,184(a0) + 800010ea: 0c053a03 ld s4,192(a0) + 800010ee: 0c853a83 ld s5,200(a0) + 800010f2: 0d053b03 ld s6,208(a0) + 800010f6: 0d853b83 ld s7,216(a0) + 800010fa: 0e053c03 ld s8,224(a0) + 800010fe: 0e853c83 ld s9,232(a0) + 80001102: 0f053d03 ld s10,240(a0) + 80001106: 0f853d83 ld s11,248(a0) + 8000110a: 10053e03 ld t3,256(a0) + 8000110e: 10853e83 ld t4,264(a0) + 80001112: 11053f03 ld t5,272(a0) + 80001116: 11853f83 ld t6,280(a0) + 8000111a: 14051573 csrrw a0,sscratch,a0 + 8000111e: 10200073 sret + +0000000080001122 : + 80001122: 00153023 sd ra,0(a0) + 80001126: 00253423 sd sp,8(a0) + 8000112a: e900 sd s0,16(a0) + 8000112c: ed04 sd s1,24(a0) + 8000112e: 03253023 sd s2,32(a0) + 80001132: 03353423 sd s3,40(a0) + 80001136: 03453823 sd s4,48(a0) + 8000113a: 03553c23 sd s5,56(a0) + 8000113e: 05653023 sd s6,64(a0) + 80001142: 05753423 sd s7,72(a0) + 80001146: 05853823 sd s8,80(a0) + 8000114a: 05953c23 sd s9,88(a0) + 8000114e: 07a53023 sd s10,96(a0) + 80001152: 07b53423 sd s11,104(a0) + 80001156: 0005b083 ld ra,0(a1) + 8000115a: 0085b103 ld sp,8(a1) + 8000115e: 6980 ld s0,16(a1) + 80001160: 6d84 ld s1,24(a1) + 80001162: 0205b903 ld s2,32(a1) + 80001166: 0285b983 ld s3,40(a1) + 8000116a: 0305ba03 ld s4,48(a1) + 8000116e: 0385ba83 ld s5,56(a1) + 80001172: 0405bb03 ld s6,64(a1) + 80001176: 0485bb83 ld s7,72(a1) + 8000117a: 0505bc03 ld s8,80(a1) + 8000117e: 0585bc83 ld s9,88(a1) + 80001182: 0605bd03 ld s10,96(a1) + 80001186: 0685bd83 ld s11,104(a1) + 8000118a: 8082 ret + +Disassembly of section .text._ZN6kernel7process3elf8load_seg17h8e22665aca7680efE: + +000000008000118c <_ZN6kernel7process3elf8load_seg17h8e22665aca7680efE>: +/// va must be page-aligned +/// and the pages from va to va+sz must already be mapped. +/// Returns 0 on success, -1 on failure. +#[allow(unused_variables)] +#[allow(unused_assignments)] +fn load_seg( + 8000118c: 7111 addi sp,sp,-256 + 8000118e: fd86 sd ra,248(sp) + 80001190: e4ba sd a4,72(sp) + 80001192: e8b6 sd a3,80(sp) + 80001194: ecb2 sd a2,88(sp) + 80001196: f0ae sd a1,96(sp) + 80001198: 85aa mv a1,a0 + 8000119a: 7506 ld a0,96(sp) + 8000119c: f4ae sd a1,104(sp) + 8000119e: e5ae sd a1,200(sp) + 800011a0: e9aa sd a0,208(sp) + 800011a2: edb2 sd a2,216(sp) + 800011a4: f1b6 sd a3,224(sp) + 800011a6: f5ba sd a4,232(sp) + inode_data: &mut SleepLockGuard, + offset: usize, + size: usize +) -> Result<(), &'static str> { + // 生成虚拟地址 + let mut va = VirtualAddress::new(va); + 800011a8: 00011097 auipc ra,0x11 + 800011ac: d9e080e7 jalr -610(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 800011b0: e12a sd a0,128(sp) + 800011b2: a009 j 800011b4 <_ZN6kernel7process3elf8load_seg17h8e22665aca7680efE+0x28> + 800011b4: 0108 addi a0,sp,128 + if !va.is_page_aligned() { + 800011b6: 00003097 auipc ra,0x3 + 800011ba: 742080e7 jalr 1858(ra) # 800048f8 <_ZN6kernel6memory7address4Addr15is_page_aligned17h21d9aa1b7bd151ebE> + 800011be: e0aa sd a0,64(sp) + 800011c0: a009 j 800011c2 <_ZN6kernel7process3elf8load_seg17h8e22665aca7680efE+0x36> + 800011c2: 6506 ld a0,64(sp) + 800011c4: e10d bnez a0,800011e6 <.LBB0_33+0x16> + 800011c6: a009 j 800011c8 <.LBB0_32> + +00000000800011c8 <.LBB0_32>: + panic!("load_seg(): va must be page aligned."); + 800011c8: 00025517 auipc a0,0x25 + 800011cc: f4850513 addi a0,a0,-184 # 80026110 <.L__unnamed_1> + +00000000800011d0 <.LBB0_33>: + 800011d0: 00025617 auipc a2,0x25 + 800011d4: f7860613 addi a2,a2,-136 # 80026148 <.L__unnamed_2> + 800011d8: 02400593 li a1,36 + 800011dc: 00022097 auipc ra,0x22 + 800011e0: f68080e7 jalr -152(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800011e4: 0000 unimp + 800011e6: 7526 ld a0,104(sp) + 800011e8: 4581 li a1,0 + } + + let mut copy_size: usize = 0; + 800011ea: e52e sd a1,136(sp) + let pagetable = unsafe { &mut *page_table }; + 800011ec: f9aa sd a0,240(sp) + while copy_size < size { + 800011ee: a009 j 800011f0 <.LBB0_33+0x20> + 800011f0: 65a6 ld a1,72(sp) + 800011f2: 652a ld a0,136(sp) + 800011f4: 00b56663 bltu a0,a1,80001200 <.LBB0_33+0x30> + 800011f8: a009 j 800011fa <.LBB0_33+0x2a> + 800011fa: 4501 li a0,0 + + copy_size += PGSIZE; + va.add_page(); + } + + Ok(()) + 800011fc: f8aa sd a0,112(sp) +} + 800011fe: a211 j 80001302 <.LBB0_36+0x30> + .pgt_translate(va) { + 80001200: 7526 ld a0,104(sp) + 80001202: 658a ld a1,128(sp) + match pagetable + 80001204: 00017097 auipc ra,0x17 + 80001208: d2a080e7 jalr -726(ra) # 80017f2e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E> + 8000120c: e92a sd a0,144(sp) + 8000120e: ed2e sd a1,152(sp) + 80001210: a009 j 80001212 <.LBB0_33+0x42> + Some(pa) => { + 80001212: 654a ld a0,144(sp) + 80001214: 4581 li a1,0 + 80001216: 00b50463 beq a0,a1,8000121e <.LBB0_34> + 8000121a: a009 j 8000121c <.LBB0_33+0x4c> + 8000121c: a00d j 8000123e <.LBB0_35+0x18> + +000000008000121e <.LBB0_34>: + panic!("load_seg(): address should exist."); + 8000121e: 00025517 auipc a0,0x25 + 80001222: 01250513 addi a0,a0,18 # 80026230 <.L__unnamed_3> + +0000000080001226 <.LBB0_35>: + 80001226: 00025617 auipc a2,0x25 + 8000122a: 03260613 addi a2,a2,50 # 80026258 <.L__unnamed_4> + 8000122e: 02100593 li a1,33 + 80001232: 00022097 auipc ra,0x22 + 80001236: f12080e7 jalr -238(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000123a: 0000 unimp + match pagetable + 8000123c: 0000 unimp + Some(pa) => { + 8000123e: 6526 ld a0,72(sp) + 80001240: 65ea ld a1,152(sp) + 80001242: f12e sd a1,160(sp) + if size - copy_size < PGSIZE { + 80001244: 65aa ld a1,136(sp) + 80001246: 40b505b3 sub a1,a0,a1 + 8000124a: fc2e sd a1,56(sp) + 8000124c: 0cb56063 bltu a0,a1,8000130c <.LBB0_37> + 80001250: a009 j 80001252 <.LBB0_35+0x2c> + 80001252: 7562 ld a0,56(sp) + 80001254: 8131 srli a0,a0,0xc + 80001256: 4581 li a1,0 + 80001258: 00b51b63 bne a0,a1,8000126e <.LBB0_35+0x48> + 8000125c: a009 j 8000125e <.LBB0_35+0x38> + count = size - copy_size; + 8000125e: 6526 ld a0,72(sp) + 80001260: 65aa ld a1,136(sp) + 80001262: 40b505b3 sub a1,a0,a1 + 80001266: f82e sd a1,48(sp) + 80001268: 0cb56163 bltu a0,a1,8000132a <.LBB0_39> + 8000126c: a021 j 80001274 <.LBB0_35+0x4e> + 8000126e: 6505 lui a0,0x1 + count = PGSIZE; + 80001270: f52a sd a0,168(sp) + if size - copy_size < PGSIZE { + 80001272: a021 j 8000127a <.LBB0_35+0x54> + count = size - copy_size; + 80001274: 7542 ld a0,48(sp) + 80001276: f52a sd a0,168(sp) + if size - copy_size < PGSIZE { + 80001278: a009 j 8000127a <.LBB0_35+0x54> + if inode_data.read( + 8000127a: 6566 ld a0,88(sp) + 8000127c: 0001d097 auipc ra,0x1d + 80001280: 22a080e7 jalr 554(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80001284: f42a sd a0,40(sp) + 80001286: a009 j 80001288 <.LBB0_35+0x62> + 80001288: 1108 addi a0,sp,160 + pa.as_usize(), + 8000128a: 00011097 auipc ra,0x11 + 8000128e: caa080e7 jalr -854(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 80001292: f02a sd a0,32(sp) + 80001294: a009 j 80001296 <.LBB0_35+0x70> + (offset + copy_size) as u32, + 80001296: 65c6 ld a1,80(sp) + 80001298: 652a ld a0,136(sp) + 8000129a: 952e add a0,a0,a1 + 8000129c: ec2a sd a0,24(sp) + 8000129e: 0ab56563 bltu a0,a1,80001348 <.LBB0_41> + 800012a2: a009 j 800012a4 <.LBB0_35+0x7e> + count as u32 + 800012a4: 6762 ld a4,24(sp) + 800012a6: 7682 ld a3,32(sp) + 800012a8: 75a2 ld a1,40(sp) + 800012aa: 77aa ld a5,168(sp) + 800012ac: 1908 addi a0,sp,176 + 800012ae: 4601 li a2,0 + if inode_data.read( + 800012b0: 0001a097 auipc ra,0x1a + 800012b4: dcc080e7 jalr -564(ra) # 8001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E> + 800012b8: a009 j 800012ba <.LBB0_35+0x94> + 800012ba: 1908 addi a0,sp,176 + 800012bc: 0000c097 auipc ra,0xc + 800012c0: 3da080e7 jalr 986(ra) # 8000d696 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17he593c7735b347060E> + 800012c4: e82a sd a0,16(sp) + 800012c6: a009 j 800012c8 <.LBB0_35+0xa2> + 800012c8: 6542 ld a0,16(sp) + 800012ca: 4581 li a1,0 + 800012cc: 00b50b63 beq a0,a1,800012e2 <.LBB0_36+0x10> + 800012d0: a009 j 800012d2 <.LBB0_36> + +00000000800012d2 <.LBB0_36>: + return Err("load_seg: Fail to read inode") + 800012d2: 00025517 auipc a0,0x25 + 800012d6: f2a50513 addi a0,a0,-214 # 800261fc <.L__unnamed_5> + 800012da: f8aa sd a0,112(sp) + 800012dc: 4571 li a0,28 + 800012de: fcaa sd a0,120(sp) +} + 800012e0: a00d j 80001302 <.LBB0_36+0x30> + copy_size += PGSIZE; + 800012e2: 65aa ld a1,136(sp) + 800012e4: 6505 lui a0,0x1 + 800012e6: 952e add a0,a0,a1 + 800012e8: e42a sd a0,8(sp) + 800012ea: 06b56d63 bltu a0,a1,80001364 <.LBB0_43> + 800012ee: a009 j 800012f0 <.LBB0_36+0x1e> + 800012f0: 6522 ld a0,8(sp) + 800012f2: e52a sd a0,136(sp) + 800012f4: 0108 addi a0,sp,128 + va.add_page(); + 800012f6: 00003097 auipc ra,0x3 + 800012fa: 7d6080e7 jalr 2006(ra) # 80004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE> + 800012fe: a009 j 80001300 <.LBB0_36+0x2e> + while copy_size < size { + 80001300: bdc5 j 800011f0 <.LBB0_33+0x20> +} + 80001302: 7546 ld a0,112(sp) + 80001304: 75e6 ld a1,120(sp) + 80001306: 70ee ld ra,248(sp) + 80001308: 6111 addi sp,sp,256 + 8000130a: 8082 ret + +000000008000130c <.LBB0_37>: + if size - copy_size < PGSIZE { + 8000130c: 00025517 auipc a0,0x25 + 80001310: e7450513 addi a0,a0,-396 # 80026180 + +0000000080001314 <.LBB0_38>: + 80001314: 00025617 auipc a2,0x25 + 80001318: e4c60613 addi a2,a2,-436 # 80026160 <.L__unnamed_6> + 8000131c: 02100593 li a1,33 + 80001320: 00022097 auipc ra,0x22 + 80001324: e24080e7 jalr -476(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000132a <.LBB0_39>: + count = size - copy_size; + 8000132a: 00025517 auipc a0,0x25 + 8000132e: e5650513 addi a0,a0,-426 # 80026180 + +0000000080001332 <.LBB0_40>: + 80001332: 00025617 auipc a2,0x25 + 80001336: e7660613 addi a2,a2,-394 # 800261a8 <.L__unnamed_7> + 8000133a: 02100593 li a1,33 + 8000133e: 00022097 auipc ra,0x22 + 80001342: e06080e7 jalr -506(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080001348 <.LBB0_41>: + (offset + copy_size) as u32, + 80001348: 00025517 auipc a0,0x25 + 8000134c: e9850513 addi a0,a0,-360 # 800261e0 + +0000000080001350 <.LBB0_42>: + 80001350: 00025617 auipc a2,0x25 + 80001354: e7060613 addi a2,a2,-400 # 800261c0 <.L__unnamed_8> + 80001358: 45f1 li a1,28 + 8000135a: 00022097 auipc ra,0x22 + 8000135e: dea080e7 jalr -534(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080001364 <.LBB0_43>: + copy_size += PGSIZE; + 80001364: 00025517 auipc a0,0x25 + 80001368: e7c50513 addi a0,a0,-388 # 800261e0 + +000000008000136c <.LBB0_44>: + 8000136c: 00025617 auipc a2,0x25 + 80001370: eac60613 addi a2,a2,-340 # 80026218 <.L__unnamed_9> + 80001374: 45f1 li a1,28 + 80001376: 00022097 auipc ra,0x22 + 8000137a: dce080e7 jalr -562(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7process3elf4exec17h6cecf459cb29fe26E: + +0000000080001380 <_ZN6kernel7process3elf4exec17h6cecf459cb29fe26E>: + + +pub unsafe fn exec( + 80001380: 9f010113 addi sp,sp,-1552 + 80001384: 60113423 sd ra,1544(sp) + 80001388: 28e13023 sd a4,640(sp) + 8000138c: 28d13423 sd a3,648(sp) + 80001390: 28c13823 sd a2,656(sp) + 80001394: 28b13c23 sd a1,664(sp) + 80001398: 2aa13023 sd a0,672(sp) + 8000139c: 54b13823 sd a1,1360(sp) + 800013a0: 54c13c23 sd a2,1368(sp) + 800013a4: 56d13023 sd a3,1376(sp) + 800013a8: 56e13423 sd a4,1384(sp) + 800013ac: 4501 li a0,0 + path: &str, + argv: &[*const u8] +) -> Result { + let elf = Box::::new_zeroed().assume_init(); + 800013ae: 54a107a3 sb a0,1359(sp) + 800013b2: 54a10723 sb a0,1358(sp) + 800013b6: 0001b097 auipc ra,0x1b + 800013ba: 2d0080e7 jalr 720(ra) # 8001c686 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he41f9c30769fb517E> + 800013be: 2aa13423 sd a0,680(sp) + 800013c2: a009 j 800013c4 <_ZN6kernel7process3elf4exec17h6cecf459cb29fe26E+0x44> + 800013c4: 2a813503 ld a0,680(sp) + 800013c8: 0001c097 auipc ra,0x1c + 800013cc: e6c080e7 jalr -404(ra) # 8001d234 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h4ed953d8735ade7eE> + 800013d0: 2aa13823 sd a0,688(sp) + 800013d4: a009 j 800013d6 <_ZN6kernel7process3elf4exec17h6cecf459cb29fe26E+0x56> + let ph = Box::::new_zeroed().assume_init(); + 800013d6: 0001b097 auipc ra,0x1b + 800013da: 280080e7 jalr 640(ra) # 8001c656 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17hb9a4ac65c8961d16E> + 800013de: 26a13c23 sd a0,632(sp) + 800013e2: a009 j 800013e4 <_ZN6kernel7process3elf4exec17h6cecf459cb29fe26E+0x64> + 800013e4: 27813503 ld a0,632(sp) + 800013e8: 0001c097 auipc ra,0x1c + 800013ec: e76080e7 jalr -394(ra) # 8001d25e <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17hef567e32e2b3ffa4E> + 800013f0: 2aa13c23 sd a0,696(sp) + 800013f4: a009 j 800013f6 <_ZN6kernel7process3elf4exec17h6cecf459cb29fe26E+0x76> + 800013f6: 4581 li a1,0 + // let mut page_table: *mut PageTable; + let mut size = 0; + 800013f8: 2cb13023 sd a1,704(sp) + 800013fc: 0d88 addi a0,sp,720 + 800013fe: 10000613 li a2,256 + let p: &mut task_struct; + let mut sp: usize; + let stack_base: usize; + let mut user_stack: [usize; MAXARG] = [0;MAXARG]; + 80001402: 00025097 auipc ra,0x25 + 80001406: cd2080e7 jalr -814(ra) # 800260d4 + +000000008000140a <.LBB1_209>: + let inode: Inode; + + LOG.begin_op(); + 8000140a: 0005a517 auipc a0,0x5a + 8000140e: 0ce50513 addi a0,a0,206 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80001412: 00008097 auipc ra,0x8 + 80001416: fc8080e7 jalr -56(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 8000141a: a009 j 8000141c <.LBB1_209+0x12> + 8000141c: 29013503 ld a0,656(sp) + 80001420: 29813583 ld a1,664(sp) + 80001424: 5eb13423 sd a1,1512(sp) + 80001428: 5ea13823 sd a0,1520(sp) + #[inline(always)] + #[allow(unused_attributes)] + #[rustc_allow_const_fn_unstable(const_fn_transmute)] + pub const fn as_bytes(&self) -> &[u8] { + // SAFETY: const sound because we transmute two types with the same layout + unsafe { mem::transmute(self) } + 8000142c: 5eb13c23 sd a1,1528(sp) + 80001430: 60a13023 sd a0,1536(sp) + + // Get current inode by path + inode = ICACHE.namei(path.as_bytes()).ok_or("Fail to find executable file")?; + 80001434: 26b13423 sd a1,616(sp) + 80001438: 26a13823 sd a0,624(sp) + 8000143c: a009 j 8000143e <.LBB1_209+0x34> + 8000143e: 27013683 ld a3,624(sp) + 80001442: 26813603 ld a2,616(sp) + +0000000080001446 <.LBB1_210>: + 80001446: 0005a597 auipc a1,0x5a + 8000144a: 13a58593 addi a1,a1,314 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 8000144e: 42010513 addi a0,sp,1056 + 80001452: 00019097 auipc ra,0x19 + 80001456: dd6080e7 jalr -554(ra) # 8001a228 <_ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E> + 8000145a: a009 j 8000145c <.LBB1_211> + +000000008000145c <.LBB1_211>: + 8000145c: 00025617 auipc a2,0x25 + 80001460: e1460613 addi a2,a2,-492 # 80026270 <.L__unnamed_10> + 80001464: 40810513 addi a0,sp,1032 + 80001468: 42010593 addi a1,sp,1056 + 8000146c: 46f1 li a3,28 + 8000146e: 0000e097 auipc ra,0xe + 80001472: e52080e7 jalr -430(ra) # 8000f2c0 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E> + 80001476: a009 j 80001478 <.LBB1_211+0x1c> + 80001478: 1f88 addi a0,sp,1008 + 8000147a: 40810593 addi a1,sp,1032 + 8000147e: 0000c097 auipc ra,0xc + 80001482: 680080e7 jalr 1664(ra) # 8000dafe <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h7e17d789c0860991E> + 80001486: a009 j 80001488 <.LBB1_211+0x2c> + 80001488: 3f013503 ld a0,1008(sp) + 8000148c: 4581 li a1,0 + 8000148e: 00b50463 beq a0,a1,80001496 <.LBB1_211+0x3a> + 80001492: a009 j 80001494 <.LBB1_211+0x38> + 80001494: a089 j 800014d6 <.LBB1_211+0x7a> + 80001496: 40013583 ld a1,1024(sp) + 8000149a: 44b13023 sd a1,1088(sp) + 8000149e: 3f813603 ld a2,1016(sp) + 800014a2: 42c13c23 sd a2,1080(sp) + 800014a6: 3ec13023 sd a2,992(sp) + 800014aa: 3eb13423 sd a1,1000(sp) + 800014ae: 4505 li a0,1 + 800014b0: 54a107a3 sb a0,1359(sp) + 800014b4: 3cc13823 sd a2,976(sp) + 800014b8: 3cb13c23 sd a1,984(sp) + + // Get inode data by sleeplock + let mut inode_guard = inode.lock(); + 800014bc: 54a10723 sb a0,1358(sp) + 800014c0: 0f88 addi a0,sp,976 + 800014c2: 0001a097 auipc ra,0x1a + 800014c6: 7aa080e7 jalr 1962(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 800014ca: 44a13423 sd a0,1096(sp) + 800014ce: 44b13823 sd a1,1104(sp) + 800014d2: a081 j 80001512 <.LBB1_211+0xb6> + inode = ICACHE.namei(path.as_bytes()).ok_or("Fail to find executable file")?; + 800014d4: 0000 unimp + 800014d6: 3f813503 ld a0,1016(sp) + 800014da: 40013583 ld a1,1024(sp) + 800014de: 56a13823 sd a0,1392(sp) + 800014e2: 56b13c23 sd a1,1400(sp) + 800014e6: 0000b097 auipc ra,0xb + 800014ea: ea0080e7 jalr -352(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 800014ee: 24a13c23 sd a0,600(sp) + 800014f2: 26b13023 sd a1,608(sp) + 800014f6: a009 j 800014f8 <.LBB1_211+0x9c> + 800014f8: 26013603 ld a2,608(sp) + 800014fc: 25813583 ld a1,600(sp) + 80001500: 2a013503 ld a0,672(sp) + 80001504: 0000c097 auipc ra,0xc + 80001508: 4c2080e7 jalr 1218(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 8000150c: a009 j 8000150e <.LBB1_211+0xb2> +#![no_std] + 8000150e: 3f90006f j 80002106 <.LBB1_239+0xe6> + 80001512: 44810513 addi a0,sp,1096 + + // Check ELF header + if inode_guard.read( + 80001516: 0001d097 auipc ra,0x1d + 8000151a: f90080e7 jalr -112(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8000151e: 24a13823 sd a0,592(sp) + 80001522: a009 j 80001524 <.LBB1_211+0xc8> + false, + &*elf as *const ElfHeader as usize, + 80001524: 2b013503 ld a0,688(sp) + 0, + size_of::() as u32 + 80001528: 24a13423 sd a0,584(sp) + 8000152c: a009 j 8000152e <.LBB1_211+0xd2> + if inode_guard.read( + 8000152e: 24813683 ld a3,584(sp) + 80001532: 25013583 ld a1,592(sp) + 80001536: 45810513 addi a0,sp,1112 + 8000153a: 4701 li a4,0 + 8000153c: 04000793 li a5,64 + 80001540: 863a mv a2,a4 + 80001542: 0001a097 auipc ra,0x1a + 80001546: b3a080e7 jalr -1222(ra) # 8001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E> + 8000154a: a009 j 8000154c <.LBB1_211+0xf0> + 8000154c: 45810513 addi a0,sp,1112 + 80001550: 0000c097 auipc ra,0xc + 80001554: 146080e7 jalr 326(ra) # 8000d696 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17he593c7735b347060E> + 80001558: 24a13023 sd a0,576(sp) + 8000155c: a009 j 8000155e <.LBB1_211+0x102> + 8000155e: 24013503 ld a0,576(sp) + 80001562: 4581 li a1,0 + 80001564: 00b50f63 beq a0,a1,80001582 <.LBB1_211+0x126> + 80001568: a009 j 8000156a <.LBB1_211+0x10e> + 8000156a: 4501 li a0,0 + ).is_err() { + drop(inode_guard); + 8000156c: 54a10723 sb a0,1358(sp) + 80001570: 44813503 ld a0,1096(sp) + 80001574: 45013583 ld a1,1104(sp) + 80001578: 0001d097 auipc ra,0x1d + 8000157c: 8c2080e7 jalr -1854(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80001580: a819 j 80001596 <.LBB1_212> + LOG.end_op(); + return Err("exec: Fail to read elf header.") + } + + // println!("[Debug] 检查魔数"); + if elf.magic != ELF_MAGIC { + 80001582: 2b013503 ld a0,688(sp) + 80001586: 4108 lw a0,0(a0) + 80001588: 464c45b7 lui a1,0x464c4 + 8000158c: 57f5859b addiw a1,a1,1407 + 80001590: 02b51963 bne a0,a1,800015c2 <.LBB1_213+0x16> + 80001594: a099 j 800015da <.LBB1_214> + +0000000080001596 <.LBB1_212>: + LOG.end_op(); + 80001596: 0005a517 auipc a0,0x5a + 8000159a: f4250513 addi a0,a0,-190 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8000159e: 00008097 auipc ra,0x8 + 800015a2: 422080e7 jalr 1058(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800015a6: a009 j 800015a8 <.LBB1_212+0x12> + return Err("exec: Fail to read elf header.") + 800015a8: 2a013583 ld a1,672(sp) + +00000000800015ac <.LBB1_213>: + 800015ac: 00025517 auipc a0,0x25 + 800015b0: ce050513 addi a0,a0,-800 # 8002628c <.L__unnamed_11> + 800015b4: e588 sd a0,8(a1) + 800015b6: 4579 li a0,30 + 800015b8: e988 sd a0,16(a1) + 800015ba: 4505 li a0,1 + 800015bc: e188 sd a0,0(a1) + 800015be: 3330006f j 800020f0 <.LBB1_239+0xd0> + 800015c2: 4501 li a0,0 + // println!("[Debug] 魔数错误, 为0x{:x}, 应为0x{:x}", elf.magic, ELF_MAGIC); + drop(inode_guard); + 800015c4: 54a10723 sb a0,1358(sp) + 800015c8: 44813503 ld a0,1096(sp) + 800015cc: 45013583 ld a1,1104(sp) + 800015d0: 0001d097 auipc ra,0x1d + 800015d4: 86a080e7 jalr -1942(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800015d8: a821 j 800015f0 <.LBB1_215> + +00000000800015da <.LBB1_214>: + LOG.end_op(); + return Err("exec: Elf magic number is wrong.") + } + + let my_proc = CPU_MANAGER.myproc().unwrap(); + 800015da: 00065517 auipc a0,0x65 + 800015de: b6650513 addi a0,a0,-1178 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 800015e2: 00011097 auipc ra,0x11 + 800015e6: e76080e7 jalr -394(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 800015ea: 22a13c23 sd a0,568(sp) + 800015ee: a805 j 8000161e <.LBB1_216+0x18> + +00000000800015f0 <.LBB1_215>: + LOG.end_op(); + 800015f0: 0005a517 auipc a0,0x5a + 800015f4: ee850513 addi a0,a0,-280 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800015f8: 00008097 auipc ra,0x8 + 800015fc: 3c8080e7 jalr 968(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80001600: a009 j 80001602 <.LBB1_215+0x12> + return Err("exec: Elf magic number is wrong.") + 80001602: 2a013583 ld a1,672(sp) + +0000000080001606 <.LBB1_216>: + 80001606: 00025517 auipc a0,0x25 + 8000160a: cc450513 addi a0,a0,-828 # 800262ca <.L__unnamed_11+0x3e> + 8000160e: e588 sd a0,8(a1) + 80001610: 02000513 li a0,32 + 80001614: e988 sd a0,16(a1) + 80001616: 4505 li a0,1 + 80001618: e188 sd a0,0(a1) + 8000161a: 2d70006f j 800020f0 <.LBB1_239+0xd0> + let my_proc = CPU_MANAGER.myproc().unwrap(); + 8000161e: 23813503 ld a0,568(sp) + +0000000080001622 <.LBB1_217>: + 80001622: 00025597 auipc a1,0x25 + 80001626: e2e58593 addi a1,a1,-466 # 80026450 <.L__unnamed_13> + 8000162a: 0000e097 auipc ra,0xe + 8000162e: 166080e7 jalr 358(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80001632: 85aa mv a1,a0 + 80001634: 22b13823 sd a1,560(sp) + 80001638: 58a13023 sd a0,1408(sp) + 8000163c: a009 j 8000163e <.LBB1_217+0x1c> + let pagetable = my_proc.proc_pagetable(); + 8000163e: 23013503 ld a0,560(sp) + 80001642: 00015097 auipc ra,0x15 + 80001646: 7de080e7 jalr 2014(ra) # 80016e20 <_ZN6kernel7process7process11task_struct14proc_pagetable17h83123d92b87bdd8cE> + 8000164a: 85aa mv a1,a0 + 8000164c: 22b13423 sd a1,552(sp) + 80001650: 58a13423 sd a0,1416(sp) + 80001654: a009 j 80001656 <.LBB1_217+0x34> + let page_table = &mut *pagetable; + 80001656: 22813503 ld a0,552(sp) + 8000165a: 58a13823 sd a0,1424(sp) + + + let ph_size = size_of::() as u32; + 8000165e: a009 j 80001660 <.LBB1_217+0x3e> + 80001660: 03800513 li a0,56 + 80001664: 20a13823 sd a0,528(sp) + 80001668: 58a12c23 sw a0,1432(sp) + // Load program into memeory. + let mut off = elf.phoff; + 8000166c: 2b013503 ld a0,688(sp) + 80001670: 710c ld a1,32(a0) + 80001672: 46b13823 sd a1,1136(sp) + for _ in 0..elf.phnum { + 80001676: 03851583 lh a1,56(a0) + 8000167a: 4501 li a0,0 + 8000167c: 46a11c23 sh a0,1144(sp) + 80001680: 46b11d23 sh a1,1146(sp) + 80001684: 0000b097 auipc ra,0xb + 80001688: cda080e7 jalr -806(ra) # 8000c35e <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he12a3ecdd35a2d32E> + 8000168c: 20a13c23 sd a0,536(sp) + 80001690: 22b13023 sd a1,544(sp) + 80001694: a009 j 80001696 <.LBB1_217+0x74> + 80001696: 22013503 ld a0,544(sp) + 8000169a: 21813583 ld a1,536(sp) + 8000169e: 48b11023 sh a1,1152(sp) + 800016a2: 48a11123 sh a0,1154(sp) + 800016a6: a009 j 800016a8 <.LBB1_217+0x86> + 800016a8: 48010513 addi a0,sp,1152 + 800016ac: 0000b097 auipc ra,0xb + 800016b0: ac0080e7 jalr -1344(ra) # 8000c16c <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE> + 800016b4: 48a11423 sh a0,1160(sp) + 800016b8: 48b11523 sh a1,1162(sp) + 800016bc: a009 j 800016be <.LBB1_217+0x9c> + 800016be: 48815503 lhu a0,1160(sp) + 800016c2: 4581 li a1,0 + 800016c4: 00b50463 beq a0,a1,800016cc <.LBB1_217+0xaa> + 800016c8: a009 j 800016ca <.LBB1_217+0xa8> + 800016ca: a831 j 800016e6 <.LBB1_217+0xc4> + 800016cc: 4501 li a0,0 + } + off += size_of::(); + } + // println!("[Debug] 完成加载程序"); + + drop(inode_guard); + 800016ce: 54a10723 sb a0,1358(sp) + 800016d2: 44813503 ld a0,1096(sp) + 800016d6: 45013583 ld a1,1104(sp) + 800016da: 0001c097 auipc ra,0x1c + 800016de: 760080e7 jalr 1888(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800016e2: ae81 j 80001a32 <.LBB1_230> + for _ in 0..elf.phnum { + 800016e4: 0000 unimp + 800016e6: 48a11503 lh a0,1162(sp) + 800016ea: 58a11e23 sh a0,1436(sp) + 800016ee: 58a11f23 sh a0,1438(sp) + 800016f2: 44810513 addi a0,sp,1096 + if inode_guard.read( + 800016f6: 0001d097 auipc ra,0x1d + 800016fa: db0080e7 jalr -592(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 800016fe: 20a13423 sd a0,520(sp) + 80001702: a009 j 80001704 <.LBB1_217+0xe2> + &*ph as *const ProgHeader as usize, + 80001704: 21013783 ld a5,528(sp) + 80001708: 20813583 ld a1,520(sp) + 8000170c: 2b813683 ld a3,696(sp) + off as u32, + 80001710: 47013703 ld a4,1136(sp) + 80001714: 49010513 addi a0,sp,1168 + 80001718: 4601 li a2,0 + if inode_guard.read( + 8000171a: 0001a097 auipc ra,0x1a + 8000171e: 962080e7 jalr -1694(ra) # 8001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E> + 80001722: a009 j 80001724 <.LBB1_217+0x102> + 80001724: 49010513 addi a0,sp,1168 + 80001728: 0000c097 auipc ra,0xc + 8000172c: e4e080e7 jalr -434(ra) # 8000d576 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E> + 80001730: 20a13023 sd a0,512(sp) + 80001734: a009 j 80001736 <.LBB1_217+0x114> + 80001736: 20013503 ld a0,512(sp) + 8000173a: 4581 li a1,0 + 8000173c: 00b50a63 beq a0,a1,80001750 <.LBB1_217+0x12e> + 80001740: a009 j 80001742 <.LBB1_217+0x120> + if ph.prog_type != ELF_PROG_LOAD { continue; } + 80001742: 2b813503 ld a0,696(sp) + 80001746: 4108 lw a0,0(a0) + 80001748: 4585 li a1,1 + 8000174a: f4b51fe3 bne a0,a1,800016a8 <.LBB1_217+0x86> + 8000174e: a801 j 8000175e <.LBB1_217+0x13c> + drop(page_table); + 80001750: 22813503 ld a0,552(sp) + 80001754: 0001c097 auipc ra,0x1c + 80001758: 780080e7 jalr 1920(ra) # 8001ded4 <_ZN4core3mem4drop17ha184dbcd1a83d607E> + 8000175c: acb5 j 800019d8 <.LBB1_227+0x14> + if ph.mem_size < ph.file_size { + 8000175e: 2b813583 ld a1,696(sp) + 80001762: 7588 ld a0,40(a1) + 80001764: 718c ld a1,32(a1) + 80001766: 00b57c63 bgeu a0,a1,8000177e <.LBB1_217+0x15c> + 8000176a: a009 j 8000176c <.LBB1_217+0x14a> + page_table.proc_free_pagetable(size); + 8000176c: 22813503 ld a0,552(sp) + 80001770: 2c013583 ld a1,704(sp) + 80001774: 00018097 auipc ra,0x18 + 80001778: 960080e7 jalr -1696(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 8000177c: a811 j 80001790 <.LBB1_217+0x16e> + if ph.vaddr + ph.mem_size < ph.vaddr { + 8000177e: 2b813503 ld a0,696(sp) + 80001782: 690c ld a1,16(a0) + 80001784: 7508 ld a0,40(a0) + 80001786: 952e add a0,a0,a1 + 80001788: ffaa sd a0,504(sp) + 8000178a: 18b563e3 bltu a0,a1,80002110 <.LBB1_240> + 8000178e: a0a1 j 800017d6 <.LBB1_219+0x18> + 80001790: 4501 li a0,0 + drop(inode_guard); + 80001792: 54a10723 sb a0,1358(sp) + 80001796: 44813503 ld a0,1096(sp) + 8000179a: 45013583 ld a1,1104(sp) + 8000179e: 0001c097 auipc ra,0x1c + 800017a2: 69c080e7 jalr 1692(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800017a6: a009 j 800017a8 <.LBB1_218> + +00000000800017a8 <.LBB1_218>: + LOG.end_op(); + 800017a8: 0005a517 auipc a0,0x5a + 800017ac: d3050513 addi a0,a0,-720 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800017b0: 00008097 auipc ra,0x8 + 800017b4: 210080e7 jalr 528(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800017b8: a009 j 800017ba <.LBB1_218+0x12> + return Err("exec: memory size is less than file size.") + 800017ba: 2a013583 ld a1,672(sp) + +00000000800017be <.LBB1_219>: + 800017be: 00025517 auipc a0,0x25 + 800017c2: caa50513 addi a0,a0,-854 # 80026468 <.L__unnamed_14> + 800017c6: e588 sd a0,8(a1) + 800017c8: 02900513 li a0,41 + 800017cc: e988 sd a0,16(a1) + 800017ce: 4505 li a0,1 + 800017d0: e188 sd a0,0(a1) + 800017d2: 11f0006f j 800020f0 <.LBB1_239+0xd0> + if ph.vaddr + ph.mem_size < ph.vaddr { + 800017d6: 757e ld a0,504(sp) + 800017d8: 2b813583 ld a1,696(sp) + 800017dc: 698c ld a1,16(a1) + 800017de: 00b57c63 bgeu a0,a1,800017f6 <.LBB1_219+0x38> + 800017e2: a009 j 800017e4 <.LBB1_219+0x26> + page_table.proc_free_pagetable(size); + 800017e4: 22813503 ld a0,552(sp) + 800017e8: 2c013583 ld a1,704(sp) + 800017ec: 00018097 auipc ra,0x18 + 800017f0: 8e8080e7 jalr -1816(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 800017f4: a829 j 8000180e <.LBB1_219+0x50> + .uvm_alloc(size, ph.vaddr + ph.mem_size) + 800017f6: 2c013503 ld a0,704(sp) + 800017fa: f7aa sd a0,488(sp) + 800017fc: 2b813503 ld a0,696(sp) + 80001800: 690c ld a1,16(a0) + 80001802: 7508 ld a0,40(a0) + 80001804: 952e add a0,a0,a1 + 80001806: fbaa sd a0,496(sp) + 80001808: 12b562e3 bltu a0,a1,8000212c <.LBB1_242> + 8000180c: a099 j 80001852 <.LBB1_221+0x16> + 8000180e: 4501 li a0,0 + drop(inode_guard); + 80001810: 54a10723 sb a0,1358(sp) + 80001814: 44813503 ld a0,1096(sp) + 80001818: 45013583 ld a1,1104(sp) + 8000181c: 0001c097 auipc ra,0x1c + 80001820: 61e080e7 jalr 1566(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80001824: a009 j 80001826 <.LBB1_220> + +0000000080001826 <.LBB1_220>: + LOG.end_op(); + 80001826: 0005a517 auipc a0,0x5a + 8000182a: cb250513 addi a0,a0,-846 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8000182e: 00008097 auipc ra,0x8 + 80001832: 192080e7 jalr 402(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80001836: a009 j 80001838 <.LBB1_220+0x12> + return Err("exec: vaddr + mem_size < vaddr") + 80001838: 2a013583 ld a1,672(sp) + +000000008000183c <.LBB1_221>: + 8000183c: 00025517 auipc a0,0x25 + 80001840: c7450513 addi a0,a0,-908 # 800264b0 <.L__unnamed_15> + 80001844: e588 sd a0,8(a1) + 80001846: 4579 li a0,30 + 80001848: e988 sd a0,16(a1) + 8000184a: 4505 li a0,1 + 8000184c: e188 sd a0,0(a1) + 8000184e: 0a30006f j 800020f0 <.LBB1_239+0xd0> + match page_table + 80001852: 765e ld a2,496(sp) + 80001854: 75be ld a1,488(sp) + 80001856: 22813503 ld a0,552(sp) + 8000185a: 00017097 auipc ra,0x17 + 8000185e: afe080e7 jalr -1282(ra) # 80018358 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE> + 80001862: 4aa13c23 sd a0,1208(sp) + 80001866: 4cb13023 sd a1,1216(sp) + 8000186a: a009 j 8000186c <.LBB1_221+0x30> + 8000186c: 4b810513 addi a0,sp,1208 + 80001870: 0000d097 auipc ra,0xd + 80001874: 75e080e7 jalr 1886(ra) # 8000efce <_ZN4core6option15Option$LT$T$GT$4take17h3f0477f04f3bf4c3E> + 80001878: 4aa13423 sd a0,1192(sp) + 8000187c: 4ab13823 sd a1,1200(sp) + 80001880: a009 j 80001882 <.LBB1_221+0x46> + None => { + 80001882: 4a813503 ld a0,1192(sp) + 80001886: 4581 li a1,0 + 80001888: 02b50563 beq a0,a1,800018b2 <.LBB1_221+0x76> + 8000188c: a009 j 8000188e <.LBB1_221+0x52> + Some(new_size) => { + 8000188e: 4b013503 ld a0,1200(sp) + 80001892: 5aa13023 sd a0,1440(sp) + size = new_size; + 80001896: 2ca13023 sd a0,704(sp) + if ph.vaddr % PGSIZE != 0 { + 8000189a: 2b813503 ld a0,696(sp) + 8000189e: 01055503 lhu a0,16(a0) + 800018a2: 6585 lui a1,0x1 + 800018a4: 35fd addiw a1,a1,-1 + 800018a6: 8d6d and a0,a0,a1 + 800018a8: 4581 li a1,0 + 800018aa: 06b50763 beq a0,a1,80001918 <.LBB1_223+0x26> + 800018ae: a8a1 j 80001906 <.LBB1_223+0x14> + match page_table + 800018b0: 0000 unimp + page_table.proc_free_pagetable(size); + 800018b2: 22813503 ld a0,552(sp) + 800018b6: 2c013583 ld a1,704(sp) + 800018ba: 00018097 auipc ra,0x18 + 800018be: 81a080e7 jalr -2022(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 800018c2: a009 j 800018c4 <.LBB1_221+0x88> + 800018c4: 4501 li a0,0 + drop(inode_guard); + 800018c6: 54a10723 sb a0,1358(sp) + 800018ca: 44813503 ld a0,1096(sp) + 800018ce: 45013583 ld a1,1104(sp) + 800018d2: 0001c097 auipc ra,0x1c + 800018d6: 568080e7 jalr 1384(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800018da: a009 j 800018dc <.LBB1_222> + +00000000800018dc <.LBB1_222>: + LOG.end_op(); + 800018dc: 0005a517 auipc a0,0x5a + 800018e0: bfc50513 addi a0,a0,-1028 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800018e4: 00008097 auipc ra,0x8 + 800018e8: 0dc080e7 jalr 220(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800018ec: a009 j 800018ee <.LBB1_222+0x12> + return Err("exec: Fail to uvmalloc.") + 800018ee: 2a013583 ld a1,672(sp) + +00000000800018f2 <.LBB1_223>: + 800018f2: 00025517 auipc a0,0x25 + 800018f6: c6650513 addi a0,a0,-922 # 80026558 <.L__unnamed_16> + 800018fa: e588 sd a0,8(a1) + 800018fc: 455d li a0,23 + 800018fe: e988 sd a0,16(a1) + 80001900: 4505 li a0,1 + 80001902: e188 sd a0,0(a1) + 80001904: a7f5 j 800020f0 <.LBB1_239+0xd0> + page_table.proc_free_pagetable(size); + 80001906: 22813503 ld a0,552(sp) + 8000190a: 2c013583 ld a1,704(sp) + 8000190e: 00017097 auipc ra,0x17 + 80001912: 7c6080e7 jalr 1990(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80001916: a01d j 8000193c <.LBB1_224> + ph.vaddr, + 80001918: 22813503 ld a0,552(sp) + 8000191c: 2b813603 ld a2,696(sp) + 80001920: 6a0c ld a1,16(a2) + ph.off, + 80001922: 6614 ld a3,8(a2) + ph.file_size + 80001924: 7218 ld a4,32(a2) + 80001926: 44810613 addi a2,sp,1096 + if load_seg( + 8000192a: 00000097 auipc ra,0x0 + 8000192e: 862080e7 jalr -1950(ra) # 8000118c <_ZN6kernel7process3elf8load_seg17h8e22665aca7680efE> + 80001932: 4ca13423 sd a0,1224(sp) + 80001936: 4cb13823 sd a1,1232(sp) + 8000193a: a03d j 80001968 <.LBB1_225+0x16> + +000000008000193c <.LBB1_224>: + LOG.end_op(); + 8000193c: 0005a517 auipc a0,0x5a + 80001940: b9c50513 addi a0,a0,-1124 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80001944: 00008097 auipc ra,0x8 + 80001948: 07c080e7 jalr 124(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 8000194c: a009 j 8000194e <.LBB1_224+0x12> + return Err("exec: Programe Header must be integer multiple of PGSIZE. ") + 8000194e: 2a013583 ld a1,672(sp) + +0000000080001952 <.LBB1_225>: + 80001952: 00025517 auipc a0,0x25 + 80001956: b9650513 addi a0,a0,-1130 # 800264e8 <.L__unnamed_17> + 8000195a: e588 sd a0,8(a1) + 8000195c: 03a00513 li a0,58 + 80001960: e988 sd a0,16(a1) + 80001962: 4505 li a0,1 + 80001964: e188 sd a0,0(a1) + 80001966: a769 j 800020f0 <.LBB1_239+0xd0> + 80001968: 4c810513 addi a0,sp,1224 + if load_seg( + 8000196c: 0000c097 auipc ra,0xc + 80001970: d0c080e7 jalr -756(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 80001974: f3aa sd a0,480(sp) + 80001976: a009 j 80001978 <.LBB1_225+0x26> + 80001978: 751e ld a0,480(sp) + 8000197a: 4581 li a1,0 + 8000197c: 00b50c63 beq a0,a1,80001994 <.LBB1_225+0x42> + 80001980: a009 j 80001982 <.LBB1_225+0x30> + page_table.proc_free_pagetable(size); + 80001982: 22813503 ld a0,552(sp) + 80001986: 2c013583 ld a1,704(sp) + 8000198a: 00017097 auipc ra,0x17 + 8000198e: 74a080e7 jalr 1866(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80001992: a011 j 80001996 <.LBB1_225+0x44> + off += size_of::(); + 80001994: a059 j 80001a1a <.LBB1_229+0x14> + 80001996: 4501 li a0,0 + drop(inode_guard); + 80001998: 54a10723 sb a0,1358(sp) + 8000199c: 44813503 ld a0,1096(sp) + 800019a0: 45013583 ld a1,1104(sp) + 800019a4: 0001c097 auipc ra,0x1c + 800019a8: 496080e7 jalr 1174(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800019ac: a009 j 800019ae <.LBB1_226> + +00000000800019ae <.LBB1_226>: + LOG.end_op(); + 800019ae: 0005a517 auipc a0,0x5a + 800019b2: b2a50513 addi a0,a0,-1238 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800019b6: 00008097 auipc ra,0x8 + 800019ba: 00a080e7 jalr 10(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800019be: a009 j 800019c0 <.LBB1_226+0x12> + return Err("exec: Fail to load segment. ") + 800019c0: 2a013583 ld a1,672(sp) + +00000000800019c4 <.LBB1_227>: + 800019c4: 00025517 auipc a0,0x25 + 800019c8: b5e50513 addi a0,a0,-1186 # 80026522 <.L__unnamed_18> + 800019cc: e588 sd a0,8(a1) + 800019ce: 4571 li a0,28 + 800019d0: e988 sd a0,16(a1) + 800019d2: 4505 li a0,1 + 800019d4: e188 sd a0,0(a1) + 800019d6: af29 j 800020f0 <.LBB1_239+0xd0> + 800019d8: 4501 li a0,0 + drop(inode_guard); + 800019da: 54a10723 sb a0,1358(sp) + 800019de: 44813503 ld a0,1096(sp) + 800019e2: 45013583 ld a1,1104(sp) + 800019e6: 0001c097 auipc ra,0x1c + 800019ea: 454080e7 jalr 1108(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800019ee: a009 j 800019f0 <.LBB1_228> + +00000000800019f0 <.LBB1_228>: + LOG.end_op(); + 800019f0: 0005a517 auipc a0,0x5a + 800019f4: ae850513 addi a0,a0,-1304 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800019f8: 00008097 auipc ra,0x8 + 800019fc: fc8080e7 jalr -56(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80001a00: a009 j 80001a02 <.LBB1_228+0x12> + return Err("exec: Fail to read from inode") + 80001a02: 2a013583 ld a1,672(sp) + +0000000080001a06 <.LBB1_229>: + 80001a06: 00025517 auipc a0,0x25 + 80001a0a: b6950513 addi a0,a0,-1175 # 8002656f <.L__unnamed_19> + 80001a0e: e588 sd a0,8(a1) + 80001a10: 4575 li a0,29 + 80001a12: e988 sd a0,16(a1) + 80001a14: 4505 li a0,1 + 80001a16: e188 sd a0,0(a1) + 80001a18: ade1 j 800020f0 <.LBB1_239+0xd0> + off += size_of::(); + 80001a1a: 47013583 ld a1,1136(sp) + 80001a1e: 03858513 addi a0,a1,56 # 1038 <.Lline_table_start0+0x178> + 80001a22: efaa sd a0,472(sp) + 80001a24: 72b56263 bltu a0,a1,80002148 <.LBB1_244> + 80001a28: a009 j 80001a2a <.LBB1_229+0x24> + 80001a2a: 657e ld a0,472(sp) + 80001a2c: 46a13823 sd a0,1136(sp) + for _ in 0..elf.phnum { + 80001a30: b9a5 j 800016a8 <.LBB1_217+0x86> + +0000000080001a32 <.LBB1_230>: + LOG.end_op(); + 80001a32: 0005a517 auipc a0,0x5a + 80001a36: aa650513 addi a0,a0,-1370 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80001a3a: 00008097 auipc ra,0x8 + 80001a3e: f86080e7 jalr -122(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80001a42: a009 j 80001a44 <.LBB1_231> + +0000000080001a44 <.LBB1_231>: + + p = CPU_MANAGER.myproc().unwrap(); + 80001a44: 00064517 auipc a0,0x64 + 80001a48: 6fc50513 addi a0,a0,1788 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80001a4c: 00011097 auipc ra,0x11 + 80001a50: a0c080e7 jalr -1524(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80001a54: ebaa sd a0,464(sp) + 80001a56: a009 j 80001a58 <.LBB1_231+0x14> + 80001a58: 655e ld a0,464(sp) + +0000000080001a5a <.LBB1_232>: + 80001a5a: 00025597 auipc a1,0x25 + 80001a5e: b3658593 addi a1,a1,-1226 # 80026590 <.L__unnamed_20> + 80001a62: 0000e097 auipc ra,0xe + 80001a66: d2e080e7 jalr -722(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80001a6a: e7aa sd a0,456(sp) + 80001a6c: a009 j 80001a6e <.LBB1_232+0x14> + 80001a6e: 653e ld a0,456(sp) + 80001a70: 5aa13423 sd a0,1448(sp) + let old_size = p.size; + 80001a74: 6908 ld a0,16(a0) + 80001a76: ff2a sd a0,440(sp) + 80001a78: 5aa13823 sd a0,1456(sp) + + // Allocate two pages at the next page boundary + // Use the second as the user stack. + size = page_round_up(size); + 80001a7c: 2c013503 ld a0,704(sp) + 80001a80: 0001d097 auipc ra,0x1d + 80001a84: c4e080e7 jalr -946(ra) # 8001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE> + 80001a88: e3aa sd a0,448(sp) + 80001a8a: a009 j 80001a8c <.LBB1_232+0x32> + 80001a8c: 659e ld a1,448(sp) + 80001a8e: 2cb13023 sd a1,704(sp) + match page_table + .uvm_alloc(size, size + 2 * PGSIZE) { + 80001a92: 852e mv a0,a1 + 80001a94: f72a sd a0,424(sp) + 80001a96: 6509 lui a0,0x2 + 80001a98: 952e add a0,a0,a1 + 80001a9a: fb2a sd a0,432(sp) + 80001a9c: 6cb56463 bltu a0,a1,80002164 <.LBB1_246> + 80001aa0: a009 j 80001aa2 <.LBB1_232+0x48> + match page_table + 80001aa2: 765a ld a2,432(sp) + 80001aa4: 75ba ld a1,424(sp) + 80001aa6: 22813503 ld a0,552(sp) + 80001aaa: 00017097 auipc ra,0x17 + 80001aae: 8ae080e7 jalr -1874(ra) # 80018358 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE> + 80001ab2: 4ca13c23 sd a0,1240(sp) + 80001ab6: 4eb13023 sd a1,1248(sp) + 80001aba: a009 j 80001abc <.LBB1_232+0x62> + None => { + 80001abc: 4d813503 ld a0,1240(sp) + 80001ac0: 4581 li a1,0 + 80001ac2: 02b50063 beq a0,a1,80001ae2 <.LBB1_232+0x88> + 80001ac6: a009 j 80001ac8 <.LBB1_232+0x6e> + page_table.proc_free_pagetable(size); + return Err("exec: Fail to uvmalloc") + } + + Some(new_size) => { + 80001ac8: 4e013503 ld a0,1248(sp) + 80001acc: 5aa13c23 sd a0,1464(sp) + size = new_size; + 80001ad0: 2ca13023 sd a0,704(sp) + 80001ad4: 75f9 lui a1,0xffffe + } + } + + page_table.uvm_clear(VirtualAddress::new(size - 2 * PGSIZE)); + 80001ad6: 95aa add a1,a1,a0 + 80001ad8: f32e sd a1,416(sp) + 80001ada: 6ab56363 bltu a0,a1,80002180 <.LBB1_248> + 80001ade: a03d j 80001b0c <.LBB1_233+0x14> + match page_table + 80001ae0: 0000 unimp + page_table.proc_free_pagetable(size); + 80001ae2: 22813503 ld a0,552(sp) + 80001ae6: 2c013583 ld a1,704(sp) + 80001aea: 00017097 auipc ra,0x17 + 80001aee: 5ea080e7 jalr 1514(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80001af2: a009 j 80001af4 <.LBB1_232+0x9a> + return Err("exec: Fail to uvmalloc") + 80001af4: 2a013583 ld a1,672(sp) + +0000000080001af8 <.LBB1_233>: + 80001af8: 00025517 auipc a0,0x25 + 80001afc: da050513 addi a0,a0,-608 # 80026898 <.L__unnamed_21> + 80001b00: e588 sd a0,8(a1) + 80001b02: 4559 li a0,22 + 80001b04: e988 sd a0,16(a1) + 80001b06: 4505 li a0,1 + 80001b08: e188 sd a0,0(a1) + 80001b0a: a3dd j 800020f0 <.LBB1_239+0xd0> + page_table.uvm_clear(VirtualAddress::new(size - 2 * PGSIZE)); + 80001b0c: 751a ld a0,416(sp) + 80001b0e: 00010097 auipc ra,0x10 + 80001b12: 438080e7 jalr 1080(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80001b16: ef2a sd a0,408(sp) + 80001b18: a009 j 80001b1a <.LBB1_233+0x22> + 80001b1a: 65fa ld a1,408(sp) + 80001b1c: 22813503 ld a0,552(sp) + 80001b20: 00017097 auipc ra,0x17 + 80001b24: e0e080e7 jalr -498(ra) # 8001892e <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_clear17hb623751aee30bcf2E> + 80001b28: a009 j 80001b2a <.LBB1_233+0x32> + // Get stack top address. + sp = size; + 80001b2a: 2c013503 ld a0,704(sp) + 80001b2e: 2ca13423 sd a0,712(sp) + // Get stack bottom address. + stack_base = sp - PGSIZE; + 80001b32: 80050593 addi a1,a0,-2048 + 80001b36: 80058593 addi a1,a1,-2048 # ffffffffffffd800 + 80001b3a: eb2e sd a1,400(sp) + 80001b3c: 66b56163 bltu a0,a1,8000219e <.LBB1_250> + 80001b40: a009 j 80001b42 <.LBB1_233+0x4a> + 80001b42: 655a ld a0,400(sp) + 80001b44: 5ca13023 sd a0,1472(sp) + 80001b48: 4501 li a0,0 + + // Push argument strings, prepare rest of stack in ustack. + let mut argc = 0; + 80001b4a: 4ea13423 sd a0,1256(sp) + loop { + 80001b4e: a009 j 80001b50 <.LBB1_233+0x58> + if argv[argc] as usize == 0x0 { break; } + 80001b50: 28013583 ld a1,640(sp) + 80001b54: 4e813503 ld a0,1256(sp) + 80001b58: e72a sd a0,392(sp) + 80001b5a: 66b57163 bgeu a0,a1,800021bc <.LBB1_251+0x16> + 80001b5e: a009 j 80001b60 <.LBB1_233+0x68> + 80001b60: 28813503 ld a0,648(sp) + 80001b64: 65ba ld a1,392(sp) + 80001b66: 058e slli a1,a1,0x3 + 80001b68: 952e add a0,a0,a1 + 80001b6a: 6108 ld a0,0(a0) + 80001b6c: 4581 li a1,0 + 80001b6e: 00b51b63 bne a0,a1,80001b84 <.LBB1_233+0x8c> + 80001b72: a009 j 80001b74 <.LBB1_233+0x7c> + return Err("exec: Fail to copy out.") + } + user_stack[argc] = sp; + argc += 1; + } + user_stack[argc] = 0; + 80001b74: 4e813503 ld a0,1256(sp) + 80001b78: e32a sd a0,384(sp) + 80001b7a: 02000593 li a1,32 + 80001b7e: 20b56763 bltu a0,a1,80001d8c <.LBB1_236+0x3a> + 80001b82: af35 j 800022be <.LBB1_265+0x14> + if argc >= MAXARG { + 80001b84: 4e813503 ld a0,1256(sp) + 80001b88: 02000593 li a1,32 + 80001b8c: 00b56c63 bltu a0,a1,80001ba4 <.LBB1_233+0xac> + 80001b90: a009 j 80001b92 <.LBB1_233+0x9a> + page_table.proc_free_pagetable(size); + 80001b92: 22813503 ld a0,552(sp) + 80001b96: 2c013583 ld a1,704(sp) + 80001b9a: 00017097 auipc ra,0x17 + 80001b9e: 53a080e7 jalr 1338(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80001ba2: a809 j 80001bb4 <.LBB1_233+0xbc> + sp -= str_len(argv[argc]) + 1; + 80001ba4: 28013583 ld a1,640(sp) + 80001ba8: 4e813503 ld a0,1256(sp) + 80001bac: feaa sd a0,376(sp) + 80001bae: 02b56063 bltu a0,a1,80001bce <.LBB1_234+0x16> + 80001bb2: a50d j 800021d4 <.LBB1_252+0x12> + return Err("exec: argc is more than MAXARG. ") + 80001bb4: 2a013583 ld a1,672(sp) + +0000000080001bb8 <.LBB1_234>: + 80001bb8: 00025517 auipc a0,0x25 + 80001bbc: 81250513 addi a0,a0,-2030 # 800263ca <.L__unnamed_11+0x13e> + 80001bc0: e588 sd a0,8(a1) + 80001bc2: 02000513 li a0,32 + 80001bc6: e988 sd a0,16(a1) + 80001bc8: 4505 li a0,1 + 80001bca: e188 sd a0,0(a1) + 80001bcc: a315 j 800020f0 <.LBB1_239+0xd0> + sp -= str_len(argv[argc]) + 1; + 80001bce: 28813503 ld a0,648(sp) + 80001bd2: 75f6 ld a1,376(sp) + 80001bd4: 058e slli a1,a1,0x3 + 80001bd6: 952e add a0,a0,a1 + 80001bd8: 6108 ld a0,0(a0) + 80001bda: 00006097 auipc ra,0x6 + 80001bde: e78080e7 jalr -392(ra) # 80007a52 <_ZN6kernel4misc7str_len17h64928e428ab71413E> + 80001be2: faaa sd a0,368(sp) + 80001be4: a009 j 80001be6 <.LBB1_234+0x2e> + 80001be6: 75d6 ld a1,368(sp) + 80001be8: 00158513 addi a0,a1,1 + 80001bec: f6aa sd a0,360(sp) + 80001bee: 5eb56f63 bltu a0,a1,800021ec <.LBB1_254> + 80001bf2: a009 j 80001bf4 <.LBB1_234+0x3c> + 80001bf4: 75b6 ld a1,360(sp) + 80001bf6: 2c813503 ld a0,712(sp) + 80001bfa: 40b505b3 sub a1,a0,a1 + 80001bfe: f2ae sd a1,352(sp) + 80001c00: 60b56463 bltu a0,a1,80002208 <.LBB1_256> + 80001c04: a009 j 80001c06 <.LBB1_234+0x4e> + 80001c06: 7516 ld a0,352(sp) + 80001c08: 2ca13423 sd a0,712(sp) + sp = align_sp(sp); + 80001c0c: 00000097 auipc ra,0x0 + 80001c10: 796080e7 jalr 1942(ra) # 800023a2 <_ZN6kernel7process3elf8align_sp17h0cb3435f5c58b65bE> + 80001c14: eeaa sd a0,344(sp) + 80001c16: a009 j 80001c18 <.LBB1_234+0x60> + 80001c18: 6576 ld a0,344(sp) + 80001c1a: 65da ld a1,400(sp) + 80001c1c: 2ca13423 sd a0,712(sp) + if sp < stack_base { + 80001c20: 00b57a63 bgeu a0,a1,80001c34 <.LBB1_234+0x7c> + 80001c24: a009 j 80001c26 <.LBB1_234+0x6e> + drop(page_table); + 80001c26: 22813503 ld a0,552(sp) + 80001c2a: 0001c097 auipc ra,0x1c + 80001c2e: 2aa080e7 jalr 682(ra) # 8001ded4 <_ZN4core3mem4drop17ha184dbcd1a83d607E> + 80001c32: a821 j 80001c4a <.LBB1_234+0x92> + sp, + 80001c34: 28013583 ld a1,640(sp) + 80001c38: 2c813503 ld a0,712(sp) + argv[argc] as *mut u8, + 80001c3c: e6aa sd a0,328(sp) + 80001c3e: 4e813503 ld a0,1256(sp) + 80001c42: eaaa sd a0,336(sp) + 80001c44: 00b56f63 bltu a0,a1,80001c62 <.LBB1_235+0x14> + 80001c48: abf9 j 80002226 <.LBB1_257+0x16> + return Err("User Stack Bomb!") + 80001c4a: 2a013583 ld a1,672(sp) + +0000000080001c4e <.LBB1_235>: + 80001c4e: 00025517 auipc a0,0x25 + 80001c52: a8250513 addi a0,a0,-1406 # 800266d0 <.L__unnamed_35+0x98> + 80001c56: e588 sd a0,8(a1) + 80001c58: 4541 li a0,16 + 80001c5a: e988 sd a0,16(a1) + 80001c5c: 4505 li a0,1 + 80001c5e: e188 sd a0,0(a1) + 80001c60: a941 j 800020f0 <.LBB1_239+0xd0> + argv[argc] as *mut u8, + 80001c62: 28013583 ld a1,640(sp) + 80001c66: 28813503 ld a0,648(sp) + 80001c6a: 6656 ld a2,336(sp) + 80001c6c: 060e slli a2,a2,0x3 + 80001c6e: 9532 add a0,a0,a2 + 80001c70: 6108 ld a0,0(a0) + str_len(argv[argc]) + 80001c72: fe2a sd a0,312(sp) + 80001c74: 4e813503 ld a0,1256(sp) + 80001c78: e2aa sd a0,320(sp) + 80001c7a: 5cb57263 bgeu a0,a1,8000223e <.LBB1_258+0x12> + 80001c7e: a009 j 80001c80 <.LBB1_235+0x32> + 80001c80: 28813503 ld a0,648(sp) + 80001c84: 6596 ld a1,320(sp) + 80001c86: 058e slli a1,a1,0x3 + 80001c88: 952e add a0,a0,a1 + 80001c8a: 6108 ld a0,0(a0) + 80001c8c: 00006097 auipc ra,0x6 + 80001c90: dc6080e7 jalr -570(ra) # 80007a52 <_ZN6kernel4misc7str_len17h64928e428ab71413E> + 80001c94: fa2a sd a0,304(sp) + 80001c96: a009 j 80001c98 <.LBB1_235+0x4a> + core::slice::from_raw_parts_mut( + 80001c98: 75d2 ld a1,304(sp) + 80001c9a: 7572 ld a0,312(sp) + 80001c9c: 00004097 auipc ra,0x4 + 80001ca0: 872080e7 jalr -1934(ra) # 8000550e <_ZN4core5slice3raw18from_raw_parts_mut17h0bc9e5c0c3217bc8E> + 80001ca4: f22a sd a0,288(sp) + 80001ca6: f62e sd a1,296(sp) + 80001ca8: a009 j 80001caa <.LBB1_235+0x5c> + 80001caa: 75b2 ld a1,296(sp) + 80001cac: 7512 ld a0,288(sp) + 80001cae: 0001f097 auipc ra,0x1f + 80001cb2: 850080e7 jalr -1968(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 80001cb6: ee2a sd a0,280(sp) + 80001cb8: a009 j 80001cba <.LBB1_235+0x6c> + str_len(argv[argc]) + 1, + 80001cba: 28013583 ld a1,640(sp) + 80001cbe: 4e813503 ld a0,1256(sp) + 80001cc2: ea2a sd a0,272(sp) + 80001cc4: 58b57963 bgeu a0,a1,80002256 <.LBB1_259+0x12> + 80001cc8: a009 j 80001cca <.LBB1_235+0x7c> + 80001cca: 28813503 ld a0,648(sp) + 80001cce: 65d2 ld a1,272(sp) + 80001cd0: 058e slli a1,a1,0x3 + 80001cd2: 952e add a0,a0,a1 + 80001cd4: 6108 ld a0,0(a0) + 80001cd6: 00006097 auipc ra,0x6 + 80001cda: d7c080e7 jalr -644(ra) # 80007a52 <_ZN6kernel4misc7str_len17h64928e428ab71413E> + 80001cde: e62a sd a0,264(sp) + 80001ce0: a009 j 80001ce2 <.LBB1_235+0x94> + 80001ce2: 65b2 ld a1,264(sp) + 80001ce4: 00158513 addi a0,a1,1 + 80001ce8: e22a sd a0,256(sp) + 80001cea: 58b56263 bltu a0,a1,8000226e <.LBB1_261> + 80001cee: a009 j 80001cf0 <.LBB1_235+0xa2> + if page_table + 80001cf0: 6692 ld a3,256(sp) + 80001cf2: 6672 ld a2,280(sp) + 80001cf4: 65b6 ld a1,328(sp) + 80001cf6: 22813503 ld a0,552(sp) + 80001cfa: 00017097 auipc ra,0x17 + 80001cfe: c84080e7 jalr -892(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 80001d02: 4ea13823 sd a0,1264(sp) + 80001d06: 4eb13c23 sd a1,1272(sp) + 80001d0a: a009 j 80001d0c <.LBB1_235+0xbe> + 80001d0c: 4f010513 addi a0,sp,1264 + 80001d10: 0000c097 auipc ra,0xc + 80001d14: 968080e7 jalr -1688(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 80001d18: fdaa sd a0,248(sp) + 80001d1a: a009 j 80001d1c <.LBB1_235+0xce> + 80001d1c: 756e ld a0,248(sp) + 80001d1e: 4581 li a1,0 + 80001d20: 00b50c63 beq a0,a1,80001d38 <.LBB1_235+0xea> + 80001d24: a009 j 80001d26 <.LBB1_235+0xd8> + page_table.proc_free_pagetable(size); + 80001d26: 22813503 ld a0,552(sp) + 80001d2a: 2c013583 ld a1,704(sp) + 80001d2e: 00017097 auipc ra,0x17 + 80001d32: 3a6080e7 jalr 934(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80001d36: a821 j 80001d4e <.LBB1_235+0x100> + user_stack[argc] = sp; + 80001d38: 2c813503 ld a0,712(sp) + 80001d3c: f5aa sd a0,232(sp) + 80001d3e: 4e813503 ld a0,1256(sp) + 80001d42: f9aa sd a0,240(sp) + 80001d44: 02000593 li a1,32 + 80001d48: 00b56f63 bltu a0,a1,80001d66 <.LBB1_236+0x14> + 80001d4c: ab3d j 8000228a <.LBB1_262+0x14> + return Err("exec: Fail to copy out.") + 80001d4e: 2a013583 ld a1,672(sp) + +0000000080001d52 <.LBB1_236>: + 80001d52: 00025517 auipc a0,0x25 + 80001d56: a3e50513 addi a0,a0,-1474 # 80026790 <.L__unnamed_24> + 80001d5a: e588 sd a0,8(a1) + 80001d5c: 455d li a0,23 + 80001d5e: e988 sd a0,16(a1) + 80001d60: 4505 li a0,1 + 80001d62: e188 sd a0,0(a1) + 80001d64: a671 j 800020f0 <.LBB1_239+0xd0> + user_stack[argc] = sp; + 80001d66: 752e ld a0,232(sp) + 80001d68: 75ce ld a1,240(sp) + 80001d6a: 00359613 slli a2,a1,0x3 + 80001d6e: 0d8c addi a1,sp,720 + 80001d70: 95b2 add a1,a1,a2 + 80001d72: e188 sd a0,0(a1) + argc += 1; + 80001d74: 4e813583 ld a1,1256(sp) + 80001d78: 00158513 addi a0,a1,1 + 80001d7c: f1aa sd a0,224(sp) + 80001d7e: 52b56263 bltu a0,a1,800022a2 <.LBB1_264> + 80001d82: a009 j 80001d84 <.LBB1_236+0x32> + 80001d84: 750e ld a0,224(sp) + 80001d86: 4ea13423 sd a0,1256(sp) + loop { + 80001d8a: b3d9 j 80001b50 <.LBB1_233+0x58> + user_stack[argc] = 0; + 80001d8c: 651a ld a0,384(sp) + 80001d8e: 00351593 slli a1,a0,0x3 + 80001d92: 0d88 addi a0,sp,720 + 80001d94: 95aa add a1,a1,a0 + 80001d96: 4501 li a0,0 + 80001d98: e188 sd a0,0(a1) + + // Push the array of argv pointers. + sp -= (argc + 1) * size_of::(); + 80001d9a: 4e813583 ld a1,1256(sp) + 80001d9e: 00158513 addi a0,a1,1 + 80001da2: edaa sd a0,216(sp) + 80001da4: 52b56963 bltu a0,a1,800022d6 <.LBB1_267> + 80001da8: a009 j 80001daa <.LBB1_236+0x58> + 80001daa: a009 j 80001dac <.LBB1_236+0x5a> + 80001dac: 65ee ld a1,216(sp) + 80001dae: 4505 li a0,1 + 80001db0: 1576 slli a0,a0,0x3d + 80001db2: 157d addi a0,a0,-1 + 80001db4: 8d6d and a0,a0,a1 + 80001db6: 00359613 slli a2,a1,0x3 + 80001dba: e9b2 sd a2,208(sp) + 80001dbc: 52b51b63 bne a0,a1,800022f2 <.LBB1_269> + 80001dc0: a009 j 80001dc2 <.LBB1_236+0x70> + 80001dc2: 65ce ld a1,208(sp) + 80001dc4: 2c813503 ld a0,712(sp) + 80001dc8: 40b505b3 sub a1,a0,a1 + 80001dcc: e5ae sd a1,200(sp) + 80001dce: 54b56163 bltu a0,a1,80002310 <.LBB1_271> + 80001dd2: a009 j 80001dd4 <.LBB1_236+0x82> + 80001dd4: 652e ld a0,200(sp) + 80001dd6: 2ca13423 sd a0,712(sp) + sp = align_sp(sp); + 80001dda: 00000097 auipc ra,0x0 + 80001dde: 5c8080e7 jalr 1480(ra) # 800023a2 <_ZN6kernel7process3elf8align_sp17h0cb3435f5c58b65bE> + 80001de2: e1aa sd a0,192(sp) + 80001de4: a009 j 80001de6 <.LBB1_236+0x94> + 80001de6: 650e ld a0,192(sp) + 80001de8: 65da ld a1,400(sp) + 80001dea: 2ca13423 sd a0,712(sp) + if sp < stack_base { + 80001dee: 00b57c63 bgeu a0,a1,80001e06 <.LBB1_237+0x12> + 80001df2: a009 j 80001df4 <.LBB1_237> + +0000000080001df4 <.LBB1_237>: + LOG.end_op(); + 80001df4: 00059517 auipc a0,0x59 + 80001df8: 6e450513 addi a0,a0,1764 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80001dfc: 00008097 auipc ra,0x8 + 80001e00: bc4080e7 jalr -1084(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80001e04: a011 j 80001e08 <.LBB1_237+0x14> + if sp < stack_base { + 80001e06: a819 j 80001e1c <.LBB1_237+0x28> + page_table.proc_free_pagetable(size); + 80001e08: 22813503 ld a0,552(sp) + 80001e0c: 2c013583 ld a1,704(sp) + 80001e10: 00017097 auipc ra,0x17 + 80001e14: 2c4080e7 jalr 708(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80001e18: a009 j 80001e1a <.LBB1_237+0x26> + if sp < stack_base { + 80001e1a: a009 j 80001e1c <.LBB1_237+0x28> + } + + if page_table + .copy_out( + sp, + 80001e1c: 2c813503 ld a0,712(sp) + core::slice::from_raw_parts_mut( + user_stack.as_mut_ptr() as *mut u8, + 80001e20: f92a sd a0,176(sp) + 80001e22: 0d88 addi a0,sp,720 + 80001e24: 02000593 li a1,32 + 80001e28: 0001e097 auipc ra,0x1e + 80001e2c: 648080e7 jalr 1608(ra) # 80020470 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17he2d11453020d912aE> + 80001e30: fd2a sd a0,184(sp) + 80001e32: a009 j 80001e34 <.LBB1_237+0x40> + 80001e34: 756a ld a0,184(sp) + (argc + 1)*size_of::() + 80001e36: f12a sd a0,160(sp) + 80001e38: 4e813583 ld a1,1256(sp) + 80001e3c: 00158513 addi a0,a1,1 + 80001e40: f52a sd a0,168(sp) + 80001e42: 4eb56663 bltu a0,a1,8000232e <.LBB1_273> + 80001e46: a009 j 80001e48 <.LBB1_237+0x54> + 80001e48: a009 j 80001e4a <.LBB1_237+0x56> + 80001e4a: 75aa ld a1,168(sp) + 80001e4c: 4505 li a0,1 + 80001e4e: 1576 slli a0,a0,0x3d + 80001e50: 157d addi a0,a0,-1 + 80001e52: 8d6d and a0,a0,a1 + 80001e54: 00359613 slli a2,a1,0x3 + 80001e58: ed32 sd a2,152(sp) + 80001e5a: 4eb51863 bne a0,a1,8000234a <.LBB1_275> + 80001e5e: a009 j 80001e60 <.LBB1_237+0x6c> + core::slice::from_raw_parts_mut( + 80001e60: 65ea ld a1,152(sp) + 80001e62: 750a ld a0,160(sp) + 80001e64: 00003097 auipc ra,0x3 + 80001e68: 6aa080e7 jalr 1706(ra) # 8000550e <_ZN4core5slice3raw18from_raw_parts_mut17h0bc9e5c0c3217bc8E> + 80001e6c: e52a sd a0,136(sp) + 80001e6e: e92e sd a1,144(sp) + 80001e70: a009 j 80001e72 <.LBB1_237+0x7e> + 80001e72: 65ca ld a1,144(sp) + 80001e74: 652a ld a0,136(sp) + 80001e76: 0001e097 auipc ra,0x1e + 80001e7a: 688080e7 jalr 1672(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 80001e7e: e12a sd a0,128(sp) + 80001e80: a009 j 80001e82 <.LBB1_237+0x8e> + ).as_ptr(), + (argc + 1)*size_of::() + 80001e82: 4e813583 ld a1,1256(sp) + 80001e86: 00158513 addi a0,a1,1 + 80001e8a: fcaa sd a0,120(sp) + 80001e8c: 4cb56e63 bltu a0,a1,80002368 <.LBB1_277> + 80001e90: a009 j 80001e92 <.LBB1_237+0x9e> + 80001e92: a009 j 80001e94 <.LBB1_237+0xa0> + 80001e94: 75e6 ld a1,120(sp) + 80001e96: 4505 li a0,1 + 80001e98: 1576 slli a0,a0,0x3d + 80001e9a: 157d addi a0,a0,-1 + 80001e9c: 8d6d and a0,a0,a1 + 80001e9e: 00359613 slli a2,a1,0x3 + 80001ea2: f8b2 sd a2,112(sp) + 80001ea4: 4eb51063 bne a0,a1,80002384 <.LBB1_279> + 80001ea8: a009 j 80001eaa <.LBB1_237+0xb6> + if page_table + 80001eaa: 76c6 ld a3,112(sp) + 80001eac: 660a ld a2,128(sp) + 80001eae: 75ca ld a1,176(sp) + 80001eb0: 22813503 ld a0,552(sp) + 80001eb4: 00017097 auipc ra,0x17 + 80001eb8: aca080e7 jalr -1334(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 80001ebc: 50a13023 sd a0,1280(sp) + 80001ec0: 50b13423 sd a1,1288(sp) + 80001ec4: a009 j 80001ec6 <.LBB1_237+0xd2> + 80001ec6: 50010513 addi a0,sp,1280 + 80001eca: 0000b097 auipc ra,0xb + 80001ece: 7ae080e7 jalr 1966(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 80001ed2: f4aa sd a0,104(sp) + 80001ed4: a009 j 80001ed6 <.LBB1_237+0xe2> + 80001ed6: 7526 ld a0,104(sp) + 80001ed8: 4581 li a1,0 + 80001eda: 00b50c63 beq a0,a1,80001ef2 <.LBB1_237+0xfe> + 80001ede: a009 j 80001ee0 <.LBB1_237+0xec> + ).is_err() { + page_table.proc_free_pagetable(size); + 80001ee0: 22813503 ld a0,552(sp) + 80001ee4: 2c013583 ld a1,704(sp) + 80001ee8: 00017097 auipc ra,0x17 + 80001eec: 1ec080e7 jalr 492(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80001ef0: a005 j 80001f10 <.LBB1_237+0x11c> + + // arguments to user main(argc, argv) + // argc is returned via the system call return + // value, which goes in a0. + + let trapframe = &mut *p.trapframe; + 80001ef2: 653e ld a0,456(sp) + 80001ef4: 710c ld a1,32(a0) + 80001ef6: f0ae sd a1,96(sp) + 80001ef8: 5cb13423 sd a1,1480(sp) + trapframe.a1 = sp; + 80001efc: 2c813503 ld a0,712(sp) + 80001f00: fda8 sd a0,120(a1) + 80001f02: 51010513 addi a0,sp,1296 + + // Save program name for debugging + // core::ptr::copy(path.as_ptr(), &mut pdata.name as *mut u8, 16); + let mut exec_name: String = String::new(); + 80001f06: 0001d097 auipc ra,0x1d + 80001f0a: 3d2080e7 jalr 978(ra) # 8001f2d8 <_ZN5alloc6string6String3new17h806e7bcacb841554E> + 80001f0e: a829 j 80001f28 <.LBB1_238+0x14> + return Err("exec: Fail to copy out.") + 80001f10: 2a013583 ld a1,672(sp) + +0000000080001f14 <.LBB1_238>: + 80001f14: 00025517 auipc a0,0x25 + 80001f18: 87c50513 addi a0,a0,-1924 # 80026790 <.L__unnamed_24> + 80001f1c: e588 sd a0,8(a1) + 80001f1e: 455d li a0,23 + 80001f20: e988 sd a0,16(a1) + 80001f22: 4505 li a0,1 + 80001f24: e188 sd a0,0(a1) + 80001f26: a2e9 j 800020f0 <.LBB1_239+0xd0> + for c in path.chars() { + 80001f28: 29013583 ld a1,656(sp) + 80001f2c: 29813503 ld a0,664(sp) + 80001f30: 00017097 auipc ra,0x17 + 80001f34: 258080e7 jalr 600(ra) # 80019188 <_ZN4core3str21_$LT$impl$u20$str$GT$5chars17h18a0dd289a8edb0cE> + 80001f38: e8aa sd a0,80(sp) + 80001f3a: ecae sd a1,88(sp) + 80001f3c: a009 j 80001f3e <.LBB1_238+0x2a> + 80001f3e: 65e6 ld a1,88(sp) + 80001f40: 6546 ld a0,80(sp) + 80001f42: 0001d097 auipc ra,0x1d + 80001f46: d96080e7 jalr -618(ra) # 8001ecd8 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hdbffcc8df8ebe27dE> + 80001f4a: e0aa sd a0,64(sp) + 80001f4c: e4ae sd a1,72(sp) + 80001f4e: a009 j 80001f50 <.LBB1_238+0x3c> + 80001f50: 6526 ld a0,72(sp) + 80001f52: 6586 ld a1,64(sp) + 80001f54: 52b13423 sd a1,1320(sp) + 80001f58: 52a13823 sd a0,1328(sp) + 80001f5c: a009 j 80001f5e <.LBB1_238+0x4a> + 80001f5e: 52810513 addi a0,sp,1320 + 80001f62: 0000b097 auipc ra,0xb + 80001f66: 518080e7 jalr 1304(ra) # 8000d47a <_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h562590808242c9ccE> + 80001f6a: 1502 slli a0,a0,0x20 + 80001f6c: 9101 srli a0,a0,0x20 + 80001f6e: 52a12e23 sw a0,1340(sp) + 80001f72: a009 j 80001f74 <.LBB1_238+0x60> + 80001f74: 53c12503 lw a0,1340(sp) + 80001f78: ffef05b7 lui a1,0xffef0 + 80001f7c: 9d2d addw a0,a0,a1 + 80001f7e: 00a035b3 snez a1,a0 + 80001f82: 4581 li a1,0 + 80001f84: 00b50463 beq a0,a1,80001f8c <.LBB1_238+0x78> + 80001f88: a009 j 80001f8a <.LBB1_238+0x76> + 80001f8a: a819 j 80001fa0 <.LBB1_238+0x8c> + 80001f8c: 51010513 addi a0,sp,1296 + if c != '/' { + exec_name.push(c); + } + } + core::ptr::copy(exec_name.as_ptr(), &mut p.name as *mut u8, 16); + 80001f90: 0001d097 auipc ra,0x1d + 80001f94: 3ee080e7 jalr 1006(ra) # 8001f37e <_ZN65_$LT$alloc..string..String$u20$as$u20$core..ops..deref..Deref$GT$5deref17hb3510aeed9e3d071E> + 80001f98: f82a sd a0,48(sp) + 80001f9a: fc2e sd a1,56(sp) + 80001f9c: a835 j 80001fd8 <.LBB1_238+0xc4> + for c in path.chars() { + 80001f9e: 0000 unimp + 80001fa0: 53c12503 lw a0,1340(sp) + 80001fa4: 02051593 slli a1,a0,0x20 + 80001fa8: 9181 srli a1,a1,0x20 + 80001faa: f42e sd a1,40(sp) + 80001fac: 5ca12a23 sw a0,1492(sp) + 80001fb0: 5ca12c23 sw a0,1496(sp) + 80001fb4: 5ca12e23 sw a0,1500(sp) + 80001fb8: 02f00593 li a1,47 + if c != '/' { + 80001fbc: 00b50b63 beq a0,a1,80001fd2 <.LBB1_238+0xbe> + 80001fc0: a009 j 80001fc2 <.LBB1_238+0xae> + exec_name.push(c); + 80001fc2: 75a2 ld a1,40(sp) + 80001fc4: 51010513 addi a0,sp,1296 + 80001fc8: 0001d097 auipc ra,0x1d + 80001fcc: 336080e7 jalr 822(ra) # 8001f2fe <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E> + 80001fd0: a011 j 80001fd4 <.LBB1_238+0xc0> + if c != '/' { + 80001fd2: a011 j 80001fd6 <.LBB1_238+0xc2> + 80001fd4: a009 j 80001fd6 <.LBB1_238+0xc2> + for c in path.chars() { + 80001fd6: b761 j 80001f5e <.LBB1_238+0x4a> + core::ptr::copy(exec_name.as_ptr(), &mut p.name as *mut u8, 16); + 80001fd8: 75e2 ld a1,56(sp) + 80001fda: 7542 ld a0,48(sp) + 80001fdc: 00017097 auipc ra,0x17 + 80001fe0: 1e2080e7 jalr 482(ra) # 800191be <_ZN4core3str21_$LT$impl$u20$str$GT$6as_ptr17h399b117e49285f4dE> + 80001fe4: f02a sd a0,32(sp) + 80001fe6: a009 j 80001fe8 <.LBB1_238+0xd4> + 80001fe8: 7582 ld a1,32(sp) + 80001fea: 653e ld a0,456(sp) + 80001fec: 40050513 addi a0,a0,1024 + 80001ff0: 4641 li a2,16 + 80001ff2: 00024097 auipc ra,0x24 + 80001ff6: 0a6080e7 jalr 166(ra) # 80026098 + 80001ffa: a009 j 80001ffc <.LBB1_238+0xe8> + + // Commit to user image. + let old_pgt = p.pagetable.as_mut().take().unwrap(); + 80001ffc: 653e ld a0,456(sp) + 80001ffe: 6d08 ld a0,24(a0) + 80002000: 0000b097 auipc ra,0xb + 80002004: 4aa080e7 jalr 1194(ra) # 8000d4aa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E> + 80002008: 54a13023 sd a0,1344(sp) + 8000200c: a009 j 8000200e <.LBB1_238+0xfa> + 8000200e: 54010513 addi a0,sp,1344 + 80002012: 0000d097 auipc ra,0xd + 80002016: fa2080e7 jalr -94(ra) # 8000efb4 <_ZN4core6option15Option$LT$T$GT$4take17h2bb26f7cfbd48ae3E> + 8000201a: ec2a sd a0,24(sp) + 8000201c: a009 j 8000201e <.LBB1_238+0x10a> + 8000201e: 6562 ld a0,24(sp) + +0000000080002020 <.LBB1_239>: + 80002020: 00025597 auipc a1,0x25 + 80002024: 86058593 addi a1,a1,-1952 # 80026880 <.L__unnamed_25> + 80002028: 0000d097 auipc ra,0xd + 8000202c: 4e0080e7 jalr 1248(ra) # 8000f508 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E> + 80002030: 85aa mv a1,a0 + 80002032: e82e sd a1,16(sp) + 80002034: 5ea13023 sd a0,1504(sp) + 80002038: a009 j 8000203a <.LBB1_239+0x1a> + old_pgt.proc_free_pagetable(old_size); + 8000203a: 75fa ld a1,440(sp) + 8000203c: 6542 ld a0,16(sp) + 8000203e: 00017097 auipc ra,0x17 + 80002042: 096080e7 jalr 150(ra) # 800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E> + 80002046: a009 j 80002048 <.LBB1_239+0x28> + + p.pagetable = pagetable; + 80002048: 2a013583 ld a1,672(sp) + 8000204c: 7606 ld a2,96(sp) + 8000204e: 66be ld a3,456(sp) + 80002050: 22813503 ld a0,552(sp) + 80002054: ee88 sd a0,24(a3) + p.size = size; + 80002056: 2c013503 ld a0,704(sp) + 8000205a: ea88 sd a0,16(a3) + // initial program counter = main + trapframe.epc = elf.entry; + 8000205c: 2b013503 ld a0,688(sp) + 80002060: 6d08 ld a0,24(a0) + 80002062: ee08 sd a0,24(a2) + // initial stack pointer + trapframe.sp = sp; + 80002064: 2c813503 ld a0,712(sp) + 80002068: fa08 sd a0,48(a2) + + Ok(argc) + 8000206a: 4e813503 ld a0,1256(sp) + 8000206e: e588 sd a0,8(a1) + 80002070: 4501 li a0,0 + 80002072: e188 sd a0,0(a1) + 80002074: 51010513 addi a0,sp,1296 +} + 80002078: 00005097 auipc ra,0x5 + 8000207c: fc0080e7 jalr -64(ra) # 80007038 <_ZN4core3ptr42drop_in_place$LT$alloc..string..String$GT$17h586f2f4ef42593a1E> + 80002080: a009 j 80002082 <.LBB1_239+0x62> + 80002082: 4501 li a0,0 + 80002084: 54a10723 sb a0,1358(sp) + 80002088: 0f88 addi a0,sp,976 + 8000208a: 00005097 auipc ra,0x5 + 8000208e: fdc080e7 jalr -36(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80002092: a009 j 80002094 <.LBB1_239+0x74> + 80002094: 4501 li a0,0 + 80002096: 54a107a3 sb a0,1359(sp) + 8000209a: 1d28 addi a0,sp,696 + 8000209c: 00005097 auipc ra,0x5 + 800020a0: 0ee080e7 jalr 238(ra) # 8000718a <_ZN4core3ptr78drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ProgHeader$GT$$GT$17h18632e5365e45018E> + 800020a4: a009 j 800020a6 <.LBB1_239+0x86> + 800020a6: 1d08 addi a0,sp,688 + 800020a8: 00005097 auipc ra,0x5 + 800020ac: 0c4080e7 jalr 196(ra) # 8000716c <_ZN4core3ptr77drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ElfHeader$GT$$GT$17hf970e769dc617072E> + 800020b0: a025 j 800020d8 <.LBB1_239+0xb8> + 800020b2: 4501 li a0,0 + 800020b4: 54a10723 sb a0,1358(sp) + 800020b8: a0b9 j 80002106 <.LBB1_239+0xe6> + 800020ba: 4501 li a0,0 + 800020bc: 54a107a3 sb a0,1359(sp) + 800020c0: 1d28 addi a0,sp,696 + 800020c2: 00005097 auipc ra,0x5 + 800020c6: 0c8080e7 jalr 200(ra) # 8000718a <_ZN4core3ptr78drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ProgHeader$GT$$GT$17h18632e5365e45018E> + 800020ca: a009 j 800020cc <.LBB1_239+0xac> + 800020cc: 1d08 addi a0,sp,688 + 800020ce: 00005097 auipc ra,0x5 + 800020d2: 09e080e7 jalr 158(ra) # 8000716c <_ZN4core3ptr77drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ElfHeader$GT$$GT$17hf970e769dc617072E> + 800020d6: a009 j 800020d8 <.LBB1_239+0xb8> + 800020d8: 60813083 ld ra,1544(sp) + 800020dc: 61010113 addi sp,sp,1552 + 800020e0: 8082 ret + 800020e2: 44810513 addi a0,sp,1096 + 800020e6: 00005097 auipc ra,0x5 + 800020ea: 154080e7 jalr 340(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 800020ee: b7d1 j 800020b2 <.LBB1_239+0x92> + 800020f0: 54e14503 lbu a0,1358(sp) + 800020f4: 8905 andi a0,a0,1 + 800020f6: f575 bnez a0,800020e2 <.LBB1_239+0xc2> + 800020f8: bf6d j 800020b2 <.LBB1_239+0x92> + 800020fa: 0f88 addi a0,sp,976 + 800020fc: 00005097 auipc ra,0x5 + 80002100: f6a080e7 jalr -150(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80002104: bf5d j 800020ba <.LBB1_239+0x9a> + 80002106: 54f14503 lbu a0,1359(sp) + 8000210a: 8905 andi a0,a0,1 + 8000210c: f57d bnez a0,800020fa <.LBB1_239+0xda> + 8000210e: b775 j 800020ba <.LBB1_239+0x9a> + +0000000080002110 <.LBB1_240>: + if ph.vaddr + ph.mem_size < ph.vaddr { + 80002110: 00024517 auipc a0,0x24 + 80002114: 0d050513 addi a0,a0,208 # 800261e0 + +0000000080002118 <.LBB1_241>: + 80002118: 00024617 auipc a2,0x24 + 8000211c: 38060613 addi a2,a2,896 # 80026498 <.L__unnamed_26> + 80002120: 45f1 li a1,28 + 80002122: 00021097 auipc ra,0x21 + 80002126: 022080e7 jalr 34(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000212c <.LBB1_242>: + .uvm_alloc(size, ph.vaddr + ph.mem_size) + 8000212c: 00024517 auipc a0,0x24 + 80002130: 0b450513 addi a0,a0,180 # 800261e0 + +0000000080002134 <.LBB1_243>: + 80002134: 00024617 auipc a2,0x24 + 80002138: 39c60613 addi a2,a2,924 # 800264d0 <.L__unnamed_27> + 8000213c: 45f1 li a1,28 + 8000213e: 00021097 auipc ra,0x21 + 80002142: 006080e7 jalr 6(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002148 <.LBB1_244>: + off += size_of::(); + 80002148: 00024517 auipc a0,0x24 + 8000214c: 09850513 addi a0,a0,152 # 800261e0 + +0000000080002150 <.LBB1_245>: + 80002150: 00024617 auipc a2,0x24 + 80002154: 3f060613 addi a2,a2,1008 # 80026540 <.L__unnamed_28> + 80002158: 45f1 li a1,28 + 8000215a: 00021097 auipc ra,0x21 + 8000215e: fea080e7 jalr -22(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002164 <.LBB1_246>: + .uvm_alloc(size, size + 2 * PGSIZE) { + 80002164: 00024517 auipc a0,0x24 + 80002168: 07c50513 addi a0,a0,124 # 800261e0 + +000000008000216c <.LBB1_247>: + 8000216c: 00024617 auipc a2,0x24 + 80002170: 43c60613 addi a2,a2,1084 # 800265a8 <.L__unnamed_29> + 80002174: 45f1 li a1,28 + 80002176: 00021097 auipc ra,0x21 + 8000217a: fce080e7 jalr -50(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002180 <.LBB1_248>: + page_table.uvm_clear(VirtualAddress::new(size - 2 * PGSIZE)); + 80002180: 00024517 auipc a0,0x24 + 80002184: 00050513 mv a0,a0 + +0000000080002188 <.LBB1_249>: + 80002188: 00024617 auipc a2,0x24 + 8000218c: 43860613 addi a2,a2,1080 # 800265c0 <.L__unnamed_30> + 80002190: 02100593 li a1,33 + 80002194: 00021097 auipc ra,0x21 + 80002198: fb0080e7 jalr -80(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000219e <.LBB1_250>: + stack_base = sp - PGSIZE; + 8000219e: 00024517 auipc a0,0x24 + 800021a2: fe250513 addi a0,a0,-30 # 80026180 + +00000000800021a6 <.LBB1_251>: + 800021a6: 00024617 auipc a2,0x24 + 800021aa: 43260613 addi a2,a2,1074 # 800265d8 <.L__unnamed_31> + 800021ae: 02100593 li a1,33 + 800021b2: 00021097 auipc ra,0x21 + 800021b6: f92080e7 jalr -110(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800021ba: 0000 unimp + if argv[argc] as usize == 0x0 { break; } + 800021bc: 28013583 ld a1,640(sp) + 800021c0: 653a ld a0,392(sp) + +00000000800021c2 <.LBB1_252>: + 800021c2: 00024617 auipc a2,0x24 + 800021c6: 42e60613 addi a2,a2,1070 # 800265f0 <.L__unnamed_32> + 800021ca: 00021097 auipc ra,0x21 + 800021ce: fa6080e7 jalr -90(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 800021d2: 0000 unimp + sp -= str_len(argv[argc]) + 1; + 800021d4: 28013583 ld a1,640(sp) + 800021d8: 7576 ld a0,376(sp) + +00000000800021da <.LBB1_253>: + 800021da: 00024617 auipc a2,0x24 + 800021de: 42e60613 addi a2,a2,1070 # 80026608 <.L__unnamed_33> + 800021e2: 00021097 auipc ra,0x21 + 800021e6: f8e080e7 jalr -114(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +00000000800021ec <.LBB1_254>: + 800021ec: 00024517 auipc a0,0x24 + 800021f0: ff450513 addi a0,a0,-12 # 800261e0 + +00000000800021f4 <.LBB1_255>: + 800021f4: 00024617 auipc a2,0x24 + 800021f8: 42c60613 addi a2,a2,1068 # 80026620 <.L__unnamed_34> + 800021fc: 45f1 li a1,28 + 800021fe: 00021097 auipc ra,0x21 + 80002202: f46080e7 jalr -186(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002208 <.LBB1_256>: + 80002208: 00024517 auipc a0,0x24 + 8000220c: f7850513 addi a0,a0,-136 # 80026180 + +0000000080002210 <.LBB1_257>: + 80002210: 00024617 auipc a2,0x24 + 80002214: 42860613 addi a2,a2,1064 # 80026638 <.L__unnamed_35> + 80002218: 02100593 li a1,33 + 8000221c: 00021097 auipc ra,0x21 + 80002220: f28080e7 jalr -216(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80002224: 0000 unimp + argv[argc] as *mut u8, + 80002226: 28013583 ld a1,640(sp) + 8000222a: 6556 ld a0,336(sp) + +000000008000222c <.LBB1_258>: + 8000222c: 00024617 auipc a2,0x24 + 80002230: 50460613 addi a2,a2,1284 # 80026730 <.L__unnamed_36> + 80002234: 00021097 auipc ra,0x21 + 80002238: f3c080e7 jalr -196(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000223c: 0000 unimp + str_len(argv[argc]) + 8000223e: 28013583 ld a1,640(sp) + 80002242: 6516 ld a0,320(sp) + +0000000080002244 <.LBB1_259>: + 80002244: 00024617 auipc a2,0x24 + 80002248: 50460613 addi a2,a2,1284 # 80026748 <.L__unnamed_37> + 8000224c: 00021097 auipc ra,0x21 + 80002250: f24080e7 jalr -220(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80002254: 0000 unimp + str_len(argv[argc]) + 1, + 80002256: 28013583 ld a1,640(sp) + 8000225a: 6552 ld a0,272(sp) + +000000008000225c <.LBB1_260>: + 8000225c: 00024617 auipc a2,0x24 + 80002260: 50460613 addi a2,a2,1284 # 80026760 <.L__unnamed_38> + 80002264: 00021097 auipc ra,0x21 + 80002268: f0c080e7 jalr -244(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000226e <.LBB1_261>: + 8000226e: 00024517 auipc a0,0x24 + 80002272: f7250513 addi a0,a0,-142 # 800261e0 + +0000000080002276 <.LBB1_262>: + 80002276: 00024617 auipc a2,0x24 + 8000227a: 50260613 addi a2,a2,1282 # 80026778 <.L__unnamed_39> + 8000227e: 45f1 li a1,28 + 80002280: 00021097 auipc ra,0x21 + 80002284: ec4080e7 jalr -316(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80002288: 0000 unimp + user_stack[argc] = sp; + 8000228a: 754e ld a0,240(sp) + +000000008000228c <.LBB1_263>: + 8000228c: 00024617 auipc a2,0x24 + 80002290: 51c60613 addi a2,a2,1308 # 800267a8 <.L__unnamed_40> + 80002294: 02000593 li a1,32 + 80002298: 00021097 auipc ra,0x21 + 8000229c: ed8080e7 jalr -296(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +00000000800022a2 <.LBB1_264>: + argc += 1; + 800022a2: 00024517 auipc a0,0x24 + 800022a6: f3e50513 addi a0,a0,-194 # 800261e0 + +00000000800022aa <.LBB1_265>: + 800022aa: 00024617 auipc a2,0x24 + 800022ae: 51660613 addi a2,a2,1302 # 800267c0 <.L__unnamed_41> + 800022b2: 45f1 li a1,28 + 800022b4: 00021097 auipc ra,0x21 + 800022b8: e90080e7 jalr -368(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800022bc: 0000 unimp + user_stack[argc] = 0; + 800022be: 651a ld a0,384(sp) + +00000000800022c0 <.LBB1_266>: + 800022c0: 00024617 auipc a2,0x24 + 800022c4: 51860613 addi a2,a2,1304 # 800267d8 <.L__unnamed_42> + 800022c8: 02000593 li a1,32 + 800022cc: 00021097 auipc ra,0x21 + 800022d0: ea4080e7 jalr -348(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +00000000800022d6 <.LBB1_267>: + sp -= (argc + 1) * size_of::(); + 800022d6: 00024517 auipc a0,0x24 + 800022da: f0a50513 addi a0,a0,-246 # 800261e0 + +00000000800022de <.LBB1_268>: + 800022de: 00024617 auipc a2,0x24 + 800022e2: 51260613 addi a2,a2,1298 # 800267f0 <.L__unnamed_43> + 800022e6: 45f1 li a1,28 + 800022e8: 00021097 auipc ra,0x21 + 800022ec: e5c080e7 jalr -420(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800022f2 <.LBB1_269>: + 800022f2: 00024517 auipc a0,0x24 + 800022f6: 51e50513 addi a0,a0,1310 # 80026810 + +00000000800022fa <.LBB1_270>: + 800022fa: 00024617 auipc a2,0x24 + 800022fe: 4f660613 addi a2,a2,1270 # 800267f0 <.L__unnamed_43> + 80002302: 02100593 li a1,33 + 80002306: 00021097 auipc ra,0x21 + 8000230a: e3e080e7 jalr -450(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002310 <.LBB1_271>: + 80002310: 00024517 auipc a0,0x24 + 80002314: e7050513 addi a0,a0,-400 # 80026180 + +0000000080002318 <.LBB1_272>: + 80002318: 00024617 auipc a2,0x24 + 8000231c: 52060613 addi a2,a2,1312 # 80026838 <.L__unnamed_44> + 80002320: 02100593 li a1,33 + 80002324: 00021097 auipc ra,0x21 + 80002328: e20080e7 jalr -480(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000232e <.LBB1_273>: + (argc + 1)*size_of::() + 8000232e: 00024517 auipc a0,0x24 + 80002332: eb250513 addi a0,a0,-334 # 800261e0 + +0000000080002336 <.LBB1_274>: + 80002336: 00024617 auipc a2,0x24 + 8000233a: 51a60613 addi a2,a2,1306 # 80026850 <.L__unnamed_45> + 8000233e: 45f1 li a1,28 + 80002340: 00021097 auipc ra,0x21 + 80002344: e04080e7 jalr -508(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000234a <.LBB1_275>: + 8000234a: 00024517 auipc a0,0x24 + 8000234e: 4c650513 addi a0,a0,1222 # 80026810 + +0000000080002352 <.LBB1_276>: + 80002352: 00024617 auipc a2,0x24 + 80002356: 4fe60613 addi a2,a2,1278 # 80026850 <.L__unnamed_45> + 8000235a: 02100593 li a1,33 + 8000235e: 00021097 auipc ra,0x21 + 80002362: de6080e7 jalr -538(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002368 <.LBB1_277>: + (argc + 1)*size_of::() + 80002368: 00024517 auipc a0,0x24 + 8000236c: e7850513 addi a0,a0,-392 # 800261e0 + +0000000080002370 <.LBB1_278>: + 80002370: 00024617 auipc a2,0x24 + 80002374: 4f860613 addi a2,a2,1272 # 80026868 <.L__unnamed_46> + 80002378: 45f1 li a1,28 + 8000237a: 00021097 auipc ra,0x21 + 8000237e: dca080e7 jalr -566(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002384 <.LBB1_279>: + 80002384: 00024517 auipc a0,0x24 + 80002388: 48c50513 addi a0,a0,1164 # 80026810 + +000000008000238c <.LBB1_280>: + 8000238c: 00024617 auipc a2,0x24 + 80002390: 4dc60613 addi a2,a2,1244 # 80026868 <.L__unnamed_46> + 80002394: 02100593 li a1,33 + 80002398: 00021097 auipc ra,0x21 + 8000239c: dac080e7 jalr -596(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7process3elf8align_sp17h0cb3435f5c58b65bE: + +00000000800023a2 <_ZN6kernel7process3elf8align_sp17h0cb3435f5c58b65bE>: + + +#[inline] +fn align_sp(sp: usize) -> usize { + 800023a2: 1141 addi sp,sp,-16 + 800023a4: e42a sd a0,8(sp) + sp - (sp % 16) + 800023a6: ff057593 andi a1,a0,-16 + 800023aa: e02e sd a1,0(sp) + 800023ac: 00b56663 bltu a0,a1,800023b8 <.LBB2_3> + 800023b0: a009 j 800023b2 <_ZN6kernel7process3elf8align_sp17h0cb3435f5c58b65bE+0x10> + 800023b2: 6502 ld a0,0(sp) + 800023b4: 0141 addi sp,sp,16 + 800023b6: 8082 ret + +00000000800023b8 <.LBB2_3>: + sp - (sp % 16) + 800023b8: 00024517 auipc a0,0x24 + 800023bc: dc850513 addi a0,a0,-568 # 80026180 + +00000000800023c0 <.LBB2_4>: + 800023c0: 00024617 auipc a2,0x24 + 800023c4: 4f060613 addi a2,a2,1264 # 800268b0 <.L__unnamed_47> + 800023c8: 02100593 li a1,33 + 800023cc: 00021097 auipc ra,0x21 + 800023d0: d78080e7 jalr -648(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hf28a3b70ff934ae9E: + +00000000800023d6 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hf28a3b70ff934ae9E>: +#[stable(feature = "rust1", since = "1.0.0")] +impl Into for T +where + U: From, +{ + fn into(self) -> U { + 800023d6: 1101 addi sp,sp,-32 + 800023d8: ec06 sd ra,24(sp) + 800023da: e82a sd a0,16(sp) + U::from(self) + 800023dc: 0000e097 auipc ra,0xe + 800023e0: bb0080e7 jalr -1104(ra) # 8000ff8c <_ZN98_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h99a3612f25da96c9E> + 800023e4: e42a sd a0,8(sp) + 800023e6: a009 j 800023e8 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hf28a3b70ff934ae9E+0x12> + } + 800023e8: 6522 ld a0,8(sp) + 800023ea: 60e2 ld ra,24(sp) + 800023ec: 6105 addi sp,sp,32 + 800023ee: 8082 ret + +Disassembly of section .text._ZN5alloc4sync12Arc$LT$T$GT$10from_inner17ha9d20dd6b0e60056E: + +00000000800023f0 <_ZN5alloc4sync12Arc$LT$T$GT$10from_inner17ha9d20dd6b0e60056E>: + +#[unstable(feature = "dispatch_from_dyn", issue = "none")] +impl, U: ?Sized> DispatchFromDyn> for Arc {} + +impl Arc { + fn from_inner(ptr: NonNull>) -> Self { + 800023f0: 1141 addi sp,sp,-16 + 800023f2: e42a sd a0,8(sp) + Self { ptr, phantom: PhantomData } + 800023f4: e02a sd a0,0(sp) + } + 800023f6: 0141 addi sp,sp,16 + 800023f8: 8082 ret + +Disassembly of section .text._ZN5alloc4sync12Arc$LT$T$GT$17get_mut_unchecked17hb9140ecfe8505044E: + +00000000800023fa <_ZN5alloc4sync12Arc$LT$T$GT$17get_mut_unchecked17hb9140ecfe8505044E>: + /// } + /// assert_eq!(*x, "foo"); + /// ``` + #[inline] + #[unstable(feature = "get_mut_unchecked", issue = "63292")] + pub unsafe fn get_mut_unchecked(this: &mut Self) -> &mut T { + 800023fa: 1101 addi sp,sp,-32 + 800023fc: ec06 sd ra,24(sp) + 800023fe: e82a sd a0,16(sp) + // We are careful to *not* create a reference covering the "count" fields, as + // this would alias with concurrent access to the reference counts (e.g. by `Weak`). + unsafe { &mut (*this.ptr.as_ptr()).data } + 80002400: 6108 ld a0,0(a0) + 80002402: 0000e097 auipc ra,0xe + 80002406: a7e080e7 jalr -1410(ra) # 8000fe80 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE> + 8000240a: e42a sd a0,8(sp) + 8000240c: a009 j 8000240e <_ZN5alloc4sync12Arc$LT$T$GT$17get_mut_unchecked17hb9140ecfe8505044E+0x14> + 8000240e: 6522 ld a0,8(sp) + 80002410: 0541 addi a0,a0,16 + } + 80002412: 60e2 ld ra,24(sp) + 80002414: 6105 addi sp,sp,32 + 80002416: 8082 ret + +Disassembly of section .text._ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE: + +0000000080002418 <_ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE>: + pub fn new(data: T) -> Arc { + 80002418: 7175 addi sp,sp,-144 + 8000241a: e506 sd ra,136(sp) + 8000241c: ec2a sd a0,24(sp) + 8000241e: 04800513 li a0,72 + 80002422: 45a1 li a1,8 + let x: Box<_> = box ArcInner { + 80002424: 0000a097 auipc ra,0xa + 80002428: 30a080e7 jalr 778(ra) # 8000c72e <_ZN5alloc5alloc15exchange_malloc17hc8acd7fb5c1fe184E> + strong: atomic::AtomicUsize::new(1), + 8000242c: f02a sd a0,32(sp) + 8000242e: 4505 li a0,1 + 80002430: 00002097 auipc ra,0x2 + 80002434: 38c080e7 jalr 908(ra) # 800047bc <_ZN4core4sync6atomic11AtomicUsize3new17hb5d2654a6be55e11E> + 80002438: f8aa sd a0,112(sp) + 8000243a: f42a sd a0,40(sp) + 8000243c: a009 j 8000243e <_ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE+0x26> + 8000243e: 4505 li a0,1 + weak: atomic::AtomicUsize::new(1), + 80002440: 00002097 auipc ra,0x2 + 80002444: 37c080e7 jalr 892(ra) # 800047bc <_ZN4core4sync6atomic11AtomicUsize3new17hb5d2654a6be55e11E> + 80002448: fcaa sd a0,120(sp) + 8000244a: f82a sd a0,48(sp) + 8000244c: a009 j 8000244e <_ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE+0x36> + data, + 8000244e: 7502 ld a0,32(sp) + 80002450: 65e2 ld a1,24(sp) + 80002452: 7990 ld a2,48(a1) + 80002454: f4b2 sd a2,104(sp) + 80002456: 7590 ld a2,40(a1) + 80002458: f0b2 sd a2,96(sp) + 8000245a: 7190 ld a2,32(a1) + 8000245c: ecb2 sd a2,88(sp) + 8000245e: 6d90 ld a2,24(a1) + 80002460: e8b2 sd a2,80(sp) + 80002462: 6990 ld a2,16(a1) + 80002464: e4b2 sd a2,72(sp) + 80002466: 6590 ld a2,8(a1) + 80002468: e0b2 sd a2,64(sp) + 8000246a: 618c ld a1,0(a1) + 8000246c: fc2e sd a1,56(sp) + let x: Box<_> = box ArcInner { + 8000246e: 75a2 ld a1,40(sp) + 80002470: e10c sd a1,0(a0) + 80002472: 75c2 ld a1,48(sp) + 80002474: e50c sd a1,8(a0) + 80002476: 75a6 ld a1,104(sp) + 80002478: e12c sd a1,64(a0) + 8000247a: 7586 ld a1,96(sp) + 8000247c: fd0c sd a1,56(a0) + 8000247e: 65e6 ld a1,88(sp) + 80002480: f90c sd a1,48(a0) + 80002482: 65c6 ld a1,80(sp) + 80002484: f50c sd a1,40(a0) + 80002486: 65a6 ld a1,72(sp) + 80002488: f10c sd a1,32(a0) + 8000248a: 6586 ld a1,64(sp) + 8000248c: ed0c sd a1,24(a0) + 8000248e: 75e2 ld a1,56(sp) + 80002490: e90c sd a1,16(a0) + 80002492: e12a sd a0,128(sp) + Self::from_inner(Box::leak(x).into()) + 80002494: 0001b097 auipc ra,0x1b + 80002498: c0a080e7 jalr -1014(ra) # 8001d09e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17ha0a7030531762e6fE> + 8000249c: e82a sd a0,16(sp) + 8000249e: a009 j 800024a0 <_ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE+0x88> + 800024a0: 6542 ld a0,16(sp) + 800024a2: 00000097 auipc ra,0x0 + 800024a6: f34080e7 jalr -204(ra) # 800023d6 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hf28a3b70ff934ae9E> + 800024aa: e42a sd a0,8(sp) + 800024ac: a009 j 800024ae <_ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE+0x96> + 800024ae: 6522 ld a0,8(sp) + 800024b0: 00000097 auipc ra,0x0 + 800024b4: f40080e7 jalr -192(ra) # 800023f0 <_ZN5alloc4sync12Arc$LT$T$GT$10from_inner17ha9d20dd6b0e60056E> + 800024b8: e02a sd a0,0(sp) + 800024ba: a009 j 800024bc <_ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE+0xa4> + } + 800024bc: 6502 ld a0,0(sp) + 800024be: 60aa ld ra,136(sp) + 800024c0: 6149 addi sp,sp,144 + 800024c2: 8082 ret + +Disassembly of section .text._ZN5alloc4sync12Arc$LT$T$GT$5inner17h9bfe4db1ecae9d98E: + +00000000800024c4 <_ZN5alloc4sync12Arc$LT$T$GT$5inner17h9bfe4db1ecae9d98E>: + fn inner(&self) -> &ArcInner { + 800024c4: 1101 addi sp,sp,-32 + 800024c6: ec06 sd ra,24(sp) + 800024c8: e82a sd a0,16(sp) + unsafe { self.ptr.as_ref() } + 800024ca: 0000e097 auipc ra,0xe + 800024ce: 9ce080e7 jalr -1586(ra) # 8000fe98 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ref17hb658835e636047c4E> + 800024d2: e42a sd a0,8(sp) + 800024d4: a009 j 800024d6 <_ZN5alloc4sync12Arc$LT$T$GT$5inner17h9bfe4db1ecae9d98E+0x12> + } + 800024d6: 6522 ld a0,8(sp) + 800024d8: 60e2 ld ra,24(sp) + 800024da: 6105 addi sp,sp,32 + 800024dc: 8082 ret + +Disassembly of section .text._ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17hcb02a55d90430c0dE: + +00000000800024de <_ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17hcb02a55d90430c0dE>: + unsafe fn drop_slow(&mut self) { + 800024de: 7179 addi sp,sp,-48 + 800024e0: f406 sd ra,40(sp) + 800024e2: e42a sd a0,8(sp) + 800024e4: f02a sd a0,32(sp) + unsafe { ptr::drop_in_place(Self::get_mut_unchecked(self)) }; + 800024e6: 00000097 auipc ra,0x0 + 800024ea: f14080e7 jalr -236(ra) # 800023fa <_ZN5alloc4sync12Arc$LT$T$GT$17get_mut_unchecked17hb9140ecfe8505044E> + 800024ee: e82a sd a0,16(sp) + 800024f0: a009 j 800024f2 <_ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17hcb02a55d90430c0dE+0x14> + 800024f2: 6542 ld a0,16(sp) + 800024f4: 00005097 auipc ra,0x5 + 800024f8: b5a080e7 jalr -1190(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 800024fc: a009 j 800024fe <_ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17hcb02a55d90430c0dE+0x20> + drop(Weak { ptr: self.ptr }); + 800024fe: 6522 ld a0,8(sp) + 80002500: 6108 ld a0,0(a0) + 80002502: ec2a sd a0,24(sp) + 80002504: 0001c097 auipc ra,0x1c + 80002508: 95a080e7 jalr -1702(ra) # 8001de5e <_ZN4core3mem4drop17h4200387821e72e60E> + 8000250c: a009 j 8000250e <_ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17hcb02a55d90430c0dE+0x30> + } + 8000250e: 70a2 ld ra,40(sp) + 80002510: 6145 addi sp,sp,48 + 80002512: 8082 ret + +Disassembly of section .text._ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE: + +0000000080002514 <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE>: + } + + /// Returns `None` when the pointer is dangling and there is no allocated `ArcInner`, + /// (i.e., when this `Weak` was created by `Weak::new`). + #[inline] + fn inner(&self) -> Option> { + 80002514: 711d addi sp,sp,-96 + 80002516: ec86 sd ra,88(sp) + 80002518: ec2a sd a0,24(sp) + 8000251a: e4aa sd a0,72(sp) + if is_dangling(self.ptr.as_ptr()) { + 8000251c: 6108 ld a0,0(a0) + 8000251e: 0000e097 auipc ra,0xe + 80002522: 962080e7 jalr -1694(ra) # 8000fe80 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE> + 80002526: f02a sd a0,32(sp) + 80002528: a009 j 8000252a <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE+0x16> + 8000252a: 7502 ld a0,32(sp) + 8000252c: 0000b097 auipc ra,0xb + 80002530: 03a080e7 jalr 58(ra) # 8000d566 <_ZN5alloc2rc11is_dangling17hdc2075289302a6eaE> + 80002534: e82a sd a0,16(sp) + 80002536: a009 j 80002538 <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE+0x24> + 80002538: 6542 ld a0,16(sp) + 8000253a: 4581 li a1,0 + 8000253c: 00b50663 beq a0,a1,80002548 <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE+0x34> + 80002540: a009 j 80002542 <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE+0x2e> + 80002542: 4501 li a0,0 + None + 80002544: f42a sd a0,40(sp) + if is_dangling(self.ptr.as_ptr()) { + 80002546: a01d j 8000256c <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE+0x58> + } else { + // We are careful to *not* create a reference covering the "data" field, as + // the field may be mutated concurrently (for example, if the last `Arc` + // is dropped, the data field will be dropped in-place). + Some(unsafe { + let ptr = self.ptr.as_ptr(); + 80002548: 6562 ld a0,24(sp) + 8000254a: 6108 ld a0,0(a0) + 8000254c: 0000e097 auipc ra,0xe + 80002550: 934080e7 jalr -1740(ra) # 8000fe80 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE> + 80002554: 85aa mv a1,a0 + 80002556: e42e sd a1,8(sp) + 80002558: e8aa sd a0,80(sp) + 8000255a: a009 j 8000255c <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE+0x48> + WeakInner { strong: &(*ptr).strong, weak: &(*ptr).weak } + 8000255c: 6522 ld a0,8(sp) + 8000255e: 00850593 addi a1,a0,8 + 80002562: fc2e sd a1,56(sp) + 80002564: e0aa sd a0,64(sp) + Some(unsafe { + 80002566: f42e sd a1,40(sp) + 80002568: f82a sd a0,48(sp) + if is_dangling(self.ptr.as_ptr()) { + 8000256a: a009 j 8000256c <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE+0x58> + }) + } + } + 8000256c: 7522 ld a0,40(sp) + 8000256e: 75c2 ld a1,48(sp) + 80002570: 60e6 ld ra,88(sp) + 80002572: 6125 addi sp,sp,96 + 80002574: 8082 ret + +Disassembly of section .text._ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E: + +0000000080002576 <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E>: + fn clone(&self) -> Arc { + 80002576: 7139 addi sp,sp,-64 + 80002578: fc06 sd ra,56(sp) + 8000257a: e82a sd a0,16(sp) + 8000257c: f42a sd a0,40(sp) + let old_size = self.inner().strong.fetch_add(1, Relaxed); + 8000257e: 00000097 auipc ra,0x0 + 80002582: f46080e7 jalr -186(ra) # 800024c4 <_ZN5alloc4sync12Arc$LT$T$GT$5inner17h9bfe4db1ecae9d98E> + 80002586: ec2a sd a0,24(sp) + 80002588: a009 j 8000258a <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E+0x14> + 8000258a: 6562 ld a0,24(sp) + 8000258c: 4601 li a2,0 + 8000258e: 02c103a3 sb a2,39(sp) + 80002592: 4585 li a1,1 + 80002594: 00002097 auipc ra,0x2 + 80002598: 244080e7 jalr 580(ra) # 800047d8 <_ZN4core4sync6atomic11AtomicUsize9fetch_add17h9147f412b3f815f9E> + 8000259c: 85aa mv a1,a0 + 8000259e: e42e sd a1,8(sp) + 800025a0: f82a sd a0,48(sp) + 800025a2: a009 j 800025a4 <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E+0x2e> + 800025a4: 65a2 ld a1,8(sp) + 800025a6: 557d li a0,-1 + if old_size > MAX_REFCOUNT { + 800025a8: 00b54563 blt a0,a1,800025b2 <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E+0x3c> + 800025ac: a009 j 800025ae <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E+0x38> + abort(); + 800025ae: 0000 unimp + 800025b0: 0000 unimp + Self::from_inner(self.ptr) + 800025b2: 6542 ld a0,16(sp) + 800025b4: 6108 ld a0,0(a0) + 800025b6: 00000097 auipc ra,0x0 + 800025ba: e3a080e7 jalr -454(ra) # 800023f0 <_ZN5alloc4sync12Arc$LT$T$GT$10from_inner17ha9d20dd6b0e60056E> + 800025be: e02a sd a0,0(sp) + 800025c0: a009 j 800025c2 <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E+0x4c> + } + 800025c2: 6502 ld a0,0(sp) + 800025c4: 70e2 ld ra,56(sp) + 800025c6: 6121 addi sp,sp,64 + 800025c8: 8082 ret + +Disassembly of section .text._ZN69_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7c280ba665690166E: + +00000000800025ca <_ZN69_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7c280ba665690166E>: + fn deref(&self) -> &T { + 800025ca: 1101 addi sp,sp,-32 + 800025cc: ec06 sd ra,24(sp) + 800025ce: e82a sd a0,16(sp) + &self.inner().data + 800025d0: 00000097 auipc ra,0x0 + 800025d4: ef4080e7 jalr -268(ra) # 800024c4 <_ZN5alloc4sync12Arc$LT$T$GT$5inner17h9bfe4db1ecae9d98E> + 800025d8: e42a sd a0,8(sp) + 800025da: a009 j 800025dc <_ZN69_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7c280ba665690166E+0x12> + 800025dc: 6522 ld a0,8(sp) + 800025de: 0541 addi a0,a0,16 + } + 800025e0: 60e2 ld ra,24(sp) + 800025e2: 6105 addi sp,sp,32 + 800025e4: 8082 ret + +Disassembly of section .text._ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E: + +00000000800025e6 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E>: + } +} + +impl SpecFromElem for u8 { + #[inline] + fn from_elem(elem: u8, n: usize, alloc: A) -> Vec { + 800025e6: 7159 addi sp,sp,-112 + 800025e8: f486 sd ra,104(sp) + 800025ea: f032 sd a2,32(sp) + 800025ec: f42a sd a0,40(sp) + 800025ee: 0ff5f513 andi a0,a1,255 + 800025f2: 86ae mv a3,a1 + 800025f4: f836 sd a3,48(sp) + 800025f6: 04b10ba3 sb a1,87(sp) + 800025fa: ecb2 sd a2,88(sp) + 800025fc: 4581 li a1,0 + if elem == 0 { + 800025fe: 00b51b63 bne a0,a1,80002614 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x2e> + 80002602: a009 j 80002604 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x1e> + return Vec { buf: RawVec::with_capacity_zeroed_in(n, alloc), len: n }; + 80002604: 7502 ld a0,32(sp) + 80002606: 00000097 auipc ra,0x0 + 8000260a: 6e6080e7 jalr 1766(ra) # 80002cec <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$23with_capacity_zeroed_in17hc0850ff3c2415cf8E> + 8000260e: e82a sd a0,16(sp) + 80002610: ec2e sd a1,24(sp) + 80002612: a801 j 80002622 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x3c> + } + unsafe { + let mut v = Vec::with_capacity_in(n, alloc); + 80002614: 7582 ld a1,32(sp) + 80002616: 1828 addi a0,sp,56 + 80002618: 00015097 auipc ra,0x15 + 8000261c: 366080e7 jalr 870(ra) # 8001797e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$16with_capacity_in17hb324b531b744c1e4E> + 80002620: a809 j 80002632 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x4c> + return Vec { buf: RawVec::with_capacity_zeroed_in(n, alloc), len: n }; + 80002622: 7502 ld a0,32(sp) + 80002624: 75a2 ld a1,40(sp) + 80002626: 6662 ld a2,24(sp) + 80002628: 66c2 ld a3,16(sp) + 8000262a: e194 sd a3,0(a1) + 8000262c: e590 sd a2,8(a1) + 8000262e: e988 sd a0,16(a1) + ptr::write_bytes(v.as_mut_ptr(), elem, n); + v.set_len(n); + v + } + } + 80002630: a83d j 8000266e <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x88> + 80002632: 1828 addi a0,sp,56 + ptr::write_bytes(v.as_mut_ptr(), elem, n); + 80002634: 00015097 auipc ra,0x15 + 80002638: 296080e7 jalr 662(ra) # 800178ca <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE> + 8000263c: e42a sd a0,8(sp) + 8000263e: a009 j 80002640 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x5a> + 80002640: 7602 ld a2,32(sp) + 80002642: 75c2 ld a1,48(sp) + 80002644: 6522 ld a0,8(sp) + 80002646: 00020097 auipc ra,0x20 + 8000264a: 3b8080e7 jalr 952(ra) # 800229fe <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E> + 8000264e: a009 j 80002650 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x6a> + v.set_len(n); + 80002650: 7582 ld a1,32(sp) + 80002652: 1828 addi a0,sp,56 + 80002654: 00015097 auipc ra,0x15 + 80002658: 462080e7 jalr 1122(ra) # 80017ab6 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$7set_len17h69219cf242af5cbaE> + 8000265c: a009 j 8000265e <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x78> + v + 8000265e: 75a2 ld a1,40(sp) + 80002660: 6526 ld a0,72(sp) + 80002662: e988 sd a0,16(a1) + 80002664: 6506 ld a0,64(sp) + 80002666: e588 sd a0,8(a1) + 80002668: 7562 ld a0,56(sp) + 8000266a: e188 sd a0,0(a1) + } + 8000266c: a009 j 8000266e <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E+0x88> + 8000266e: 70a6 ld ra,104(sp) + 80002670: 6165 addi sp,sp,112 + 80002672: 8082 ret + +Disassembly of section .text._ZN4core9panicking13assert_failed17hb31c8c2a34dfd8a3E: + +0000000080002674 <_ZN4core9panicking13assert_failed17hb31c8c2a34dfd8a3E>: + +/// Internal function for `assert_eq!` and `assert_ne!` macros +#[cold] +#[track_caller] +#[doc(hidden)] +pub fn assert_failed( + 80002674: 715d addi sp,sp,-80 + 80002676: 883a mv a6,a4 + 80002678: e42e sd a1,8(sp) + 8000267a: e832 sd a2,16(sp) + 8000267c: 04a107a3 sb a0,79(sp) +) -> ! +where + T: fmt::Debug + ?Sized, + U: fmt::Debug + ?Sized, +{ + assert_failed_inner(kind, &left, &right, args) + 80002680: 628c ld a1,0(a3) + 80002682: ec2e sd a1,24(sp) + 80002684: 668c ld a1,8(a3) + 80002686: f02e sd a1,32(sp) + 80002688: 6a8c ld a1,16(a3) + 8000268a: f42e sd a1,40(sp) + 8000268c: 6e8c ld a1,24(a3) + 8000268e: f82e sd a1,48(sp) + 80002690: 728c ld a1,32(a3) + 80002692: fc2e sd a1,56(sp) + 80002694: 768c ld a1,40(a3) + 80002696: e0ae sd a1,64(sp) + +0000000080002698 <.LBB0_1>: + 80002698: 00024717 auipc a4,0x24 + 8000269c: 23070713 addi a4,a4,560 # 800268c8 <.L__unnamed_1> + 800026a0: 002c addi a1,sp,8 + 800026a2: 0814 addi a3,sp,16 + 800026a4: 083c addi a5,sp,24 + 800026a6: 863a mv a2,a4 + 800026a8: 00021097 auipc ra,0x21 + 800026ac: b30080e7 jalr -1232(ra) # 800231d8 <_ZN4core9panicking19assert_failed_inner17h4615d2e87cda8e50E> + ... + +Disassembly of section .text._ZN6kernel4arch5riscv8register4mepc5write17h048707cbba437631E: + +00000000800026b2 <_ZN6kernel4arch5riscv8register4mepc5write17h048707cbba437631E>: +// machine exception program counter, holds the +// instruction address to which a return from +// exception will go. +#[inline] +pub unsafe fn write(mepc: usize) { + 800026b2: 1141 addi sp,sp,-16 + 800026b4: e42a sd a0,8(sp) + llvm_asm!("csrw mepc, $0" :: "r"(mepc)::"volatile"); + 800026b6: 34151073 csrw mepc,a0 + 800026ba: 0141 addi sp,sp,16 + 800026bc: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h40dcf832be5517eaE: + +00000000800026be <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h40dcf832be5517eaE>: + /// ``` + #[stable(feature = "pointer_methods", since = "1.26.0")] + #[must_use = "returns a new pointer rather than modifying its argument"] + #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[inline] + pub const unsafe fn add(self, count: usize) -> Self + 800026be: 1101 addi sp,sp,-32 + 800026c0: ec06 sd ra,24(sp) + 800026c2: e42a sd a0,8(sp) + 800026c4: e82e sd a1,16(sp) + where + T: Sized, + { + // SAFETY: the caller must uphold the safety contract for `offset`. + unsafe { self.offset(count as isize) } + 800026c6: 00000097 auipc ra,0x0 + 800026ca: 014080e7 jalr 20(ra) # 800026da <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf87d8bdf4eec6bc8E> + 800026ce: e02a sd a0,0(sp) + 800026d0: a009 j 800026d2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h40dcf832be5517eaE+0x14> + } + 800026d2: 6502 ld a0,0(sp) + 800026d4: 60e2 ld ra,24(sp) + 800026d6: 6105 addi sp,sp,32 + 800026d8: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf87d8bdf4eec6bc8E: + +00000000800026da <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf87d8bdf4eec6bc8E>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 800026da: 1101 addi sp,sp,-32 + 800026dc: e42a sd a0,8(sp) + 800026de: e82e sd a1,16(sp) + 800026e0: 03800613 li a2,56 + unsafe { intrinsics::offset(self, count) as *mut T } + 800026e4: 02c585b3 mul a1,a1,a2 + 800026e8: 952e add a0,a0,a1 + 800026ea: e02a sd a0,0(sp) + 800026ec: ec2a sd a0,24(sp) + 800026ee: a009 j 800026f0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf87d8bdf4eec6bc8E+0x16> + } + 800026f0: 6502 ld a0,0(sp) + 800026f2: 6105 addi sp,sp,32 + 800026f4: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17heba1b469892184ceE: + +00000000800026f6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17heba1b469892184ceE>: + pub const fn is_null(self) -> bool { + 800026f6: 1101 addi sp,sp,-32 + 800026f8: ec06 sd ra,24(sp) + 800026fa: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 800026fc: e42a sd a0,8(sp) + 800026fe: a009 j 80002700 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17heba1b469892184ceE+0xa> + 80002700: 6522 ld a0,8(sp) + 80002702: 4581 li a1,0 + 80002704: 00021097 auipc ra,0x21 + 80002708: 806080e7 jalr -2042(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 8000270c: e02a sd a0,0(sp) + 8000270e: a009 j 80002710 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17heba1b469892184ceE+0x1a> + } + 80002710: 6502 ld a0,0(sp) + 80002712: 60e2 ld ra,24(sp) + 80002714: 6105 addi sp,sp,32 + 80002716: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h183dec752c293806E: + +0000000080002718 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h183dec752c293806E>: + /// assert_eq!(x, &[3, 4, 6]); + /// ``` + #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[inline] + pub const fn as_mut_ptr(&mut self) -> *mut T { + 80002718: 1141 addi sp,sp,-16 + 8000271a: e02a sd a0,0(sp) + 8000271c: e42e sd a1,8(sp) + self as *mut [T] as *mut T + } + 8000271e: 0141 addi sp,sp,16 + 80002720: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h9f8bef1b1861f62bE: + +0000000080002722 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h9f8bef1b1861f62bE>: + pub const fn len(&self) -> usize { + 80002722: 7179 addi sp,sp,-48 + 80002724: e42e sd a1,8(sp) + 80002726: 85aa mv a1,a0 + 80002728: 6522 ld a0,8(sp) + 8000272a: f02e sd a1,32(sp) + 8000272c: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 8000272e: e82e sd a1,16(sp) + 80002730: ec2a sd a0,24(sp) + } + 80002732: 6145 addi sp,sp,48 + 80002734: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hac04d36b27f3ea4eE: + +0000000080002736 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hac04d36b27f3ea4eE>: + /// } + /// assert_eq!(x, &[3, 4, 6]); + /// ``` + #[stable(feature = "rust1", since = "1.0.0")] + #[inline] + pub fn iter_mut(&mut self) -> IterMut<'_, T> { + 80002736: 7179 addi sp,sp,-48 + 80002738: f406 sd ra,40(sp) + 8000273a: ec2a sd a0,24(sp) + 8000273c: f02e sd a1,32(sp) + IterMut::new(self) + 8000273e: 00009097 auipc ra,0x9 + 80002742: 0e8080e7 jalr 232(ra) # 8000b826 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE> + 80002746: e42a sd a0,8(sp) + 80002748: e82e sd a1,16(sp) + 8000274a: a009 j 8000274c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hac04d36b27f3ea4eE+0x16> + } + 8000274c: 65c2 ld a1,16(sp) + 8000274e: 6522 ld a0,8(sp) + 80002750: 70a2 ld ra,40(sp) + 80002752: 6145 addi sp,sp,48 + 80002754: 8082 ret + +Disassembly of section .text._ZN6kernel7process9trapframe9Trapframe10update_epc17h24874241e4b03020E: + +0000000080002756 <_ZN6kernel7process9trapframe9Trapframe10update_epc17h24874241e4b03020E>: + /*280 */ pub t6:usize +} + + +impl Trapframe { + pub fn update_epc(&mut self) { + 80002756: 1101 addi sp,sp,-32 + 80002758: e42a sd a0,8(sp) + 8000275a: ec2a sd a0,24(sp) + self.epc += 4; + 8000275c: 6d0c ld a1,24(a0) + 8000275e: 00458513 addi a0,a1,4 + 80002762: e82a sd a0,16(sp) + 80002764: 00b56863 bltu a0,a1,80002774 <.LBB0_3> + 80002768: a009 j 8000276a <_ZN6kernel7process9trapframe9Trapframe10update_epc17h24874241e4b03020E+0x14> + 8000276a: 6542 ld a0,16(sp) + 8000276c: 65a2 ld a1,8(sp) + 8000276e: ed88 sd a0,24(a1) + } + 80002770: 6105 addi sp,sp,32 + 80002772: 8082 ret + +0000000080002774 <.LBB0_3>: + self.epc += 4; + 80002774: 00024517 auipc a0,0x24 + 80002778: 1ac50513 addi a0,a0,428 # 80026920 + +000000008000277c <.LBB0_4>: + 8000277c: 00024617 auipc a2,0x24 + 80002780: 18460613 addi a2,a2,388 # 80026900 <.L__unnamed_1> + 80002784: 45f1 li a1,28 + 80002786: 00021097 auipc ra,0x21 + 8000278a: 9be080e7 jalr -1602(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE: + +0000000080002790 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE>: +// This function is outside `RawVec` to minimize compile times. See the comment +// above `RawVec::grow_amortized` for details. (The `A` parameter isn't +// significant, because the number of different `A` types seen in practice is +// much smaller than the number of `T` types.) +#[inline(never)] +fn finish_grow( + 80002790: 7129 addi sp,sp,-320 + 80002792: fe06 sd ra,312(sp) + 80002794: f83a sd a4,48(sp) + new_layout: Result, + current_memory: Option<(NonNull, Layout)>, + 80002796: fc36 sd a3,56(sp) + 80002798: e0aa sd a0,64(sp) + 8000279a: f1ae sd a1,224(sp) + 8000279c: f5b2 sd a2,232(sp) + 8000279e: f9ba sd a4,240(sp) + 800027a0: 1888 addi a0,sp,112 +) -> Result, TryReserveError> +where + A: Allocator, +{ + // Check for the error here to minimize the size of `RawVec::grow_*`. + let new_layout = new_layout.map_err(|_| CapacityOverflow)?; + 800027a2: 0000b097 auipc ra,0xb + 800027a6: 0e4080e7 jalr 228(ra) # 8000d886 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E> + 800027aa: a009 j 800027ac <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x1c> + 800027ac: 08a8 addi a0,sp,88 + 800027ae: 188c addi a1,sp,112 + 800027b0: 0000b097 auipc ra,0xb + 800027b4: 366080e7 jalr 870(ra) # 8000db16 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h81067e0558a14198E> + 800027b8: a009 j 800027ba <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x2a> + 800027ba: 6566 ld a0,88(sp) + 800027bc: 4581 li a1,0 + 800027be: 00b50463 beq a0,a1,800027c6 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x36> + 800027c2: a009 j 800027c4 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x34> + 800027c4: a839 j 800027e2 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x52> + 800027c6: 7586 ld a1,96(sp) + 800027c8: 7526 ld a0,104(sp) + 800027ca: ea2e sd a1,272(sp) + 800027cc: ee2a sd a0,280(sp) + 800027ce: e4ae sd a1,72(sp) + 800027d0: e8aa sd a0,80(sp) + 800027d2: 00a8 addi a0,sp,72 + + alloc_guard(new_layout.size())?; + 800027d4: 0001d097 auipc ra,0x1d + 800027d8: 088080e7 jalr 136(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 800027dc: f42a sd a0,40(sp) + 800027de: a035 j 8000280a <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x7a> + let new_layout = new_layout.map_err(|_| CapacityOverflow)?; + 800027e0: 0000 unimp + 800027e2: 7506 ld a0,96(sp) + 800027e4: 75a6 ld a1,104(sp) + 800027e6: e22a sd a0,256(sp) + 800027e8: e62e sd a1,264(sp) + 800027ea: 00014097 auipc ra,0x14 + 800027ee: 02a080e7 jalr 42(ra) # 80016814 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h00cb4931a375be30E> + 800027f2: ec2a sd a0,24(sp) + 800027f4: f02e sd a1,32(sp) + 800027f6: a009 j 800027f8 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x68> + 800027f8: 7602 ld a2,32(sp) + 800027fa: 65e2 ld a1,24(sp) + 800027fc: 6506 ld a0,64(sp) + 800027fe: 0000b097 auipc ra,0xb + 80002802: 210080e7 jalr 528(ra) # 8000da0e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h7458ba93a206fcffE> + 80002806: a009 j 80002808 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x78> + 80002808: a8c9 j 800028da <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x14a> + alloc_guard(new_layout.size())?; + 8000280a: 75a2 ld a1,40(sp) + 8000280c: 1108 addi a0,sp,160 + 8000280e: 0001d097 auipc ra,0x1d + 80002812: ba0080e7 jalr -1120(ra) # 8001f3ae <_ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E> + 80002816: a009 j 80002818 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x88> + 80002818: 0128 addi a0,sp,136 + 8000281a: 110c addi a1,sp,160 + 8000281c: 0000b097 auipc ra,0xb + 80002820: 29a080e7 jalr 666(ra) # 8000dab6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h219e266dbc1ee71cE> + 80002824: a009 j 80002826 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x96> + 80002826: 652a ld a0,136(sp) + 80002828: 4581 li a1,0 + 8000282a: 00b50463 beq a0,a1,80002832 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0xa2> + 8000282e: a009 j 80002830 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0xa0> + 80002830: a801 j 80002840 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0xb0> + + let memory = if let Some((ptr, old_layout)) = current_memory { + 80002832: 7562 ld a0,56(sp) + 80002834: 6108 ld a0,0(a0) + 80002836: 4581 li a1,0 + 80002838: 04b51263 bne a0,a1,8000287c <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0xec> + 8000283c: a035 j 80002868 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0xd8> + alloc_guard(new_layout.size())?; + 8000283e: 0000 unimp + 80002840: 654a ld a0,144(sp) + 80002842: 65ea ld a1,152(sp) + 80002844: f22a sd a0,288(sp) + 80002846: f62e sd a1,296(sp) + 80002848: 00014097 auipc ra,0x14 + 8000284c: fcc080e7 jalr -52(ra) # 80016814 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h00cb4931a375be30E> + 80002850: e42a sd a0,8(sp) + 80002852: e82e sd a1,16(sp) + 80002854: a009 j 80002856 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0xc6> + 80002856: 6642 ld a2,16(sp) + 80002858: 65a2 ld a1,8(sp) + 8000285a: 6506 ld a0,64(sp) + 8000285c: 0000b097 auipc ra,0xb + 80002860: 1b2080e7 jalr 434(ra) # 8000da0e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h7458ba93a206fcffE> + 80002864: a009 j 80002866 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0xd6> + 80002866: a895 j 800028da <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x14a> + // The allocator checks for alignment equality + intrinsics::assume(old_layout.align() == new_layout.align()); + alloc.grow(ptr, old_layout, new_layout) + } + } else { + alloc.allocate(new_layout) + 80002868: 7542 ld a0,48(sp) + 8000286a: 65a6 ld a1,72(sp) + 8000286c: 6646 ld a2,80(sp) + 8000286e: 0000a097 auipc ra,0xa + 80002872: 3c0080e7 jalr 960(ra) # 8000cc2e <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17ha3ee32ed39eb82efE> + 80002876: fd2a sd a0,184(sp) + 80002878: e1ae sd a1,192(sp) + 8000287a: a0a1 j 800028c2 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x132> + let memory = if let Some((ptr, old_layout)) = current_memory { + 8000287c: 7562 ld a0,56(sp) + 8000287e: 610c ld a1,0(a0) + 80002880: e02e sd a1,0(sp) + 80002882: fa2e sd a1,304(sp) + 80002884: 650c ld a1,8(a0) + 80002886: 6908 ld a0,16(a0) + 80002888: e5ae sd a1,200(sp) + 8000288a: e9aa sd a0,208(sp) + 8000288c: 01a8 addi a0,sp,200 + intrinsics::assume(old_layout.align() == new_layout.align()); + 8000288e: 0001d097 auipc ra,0x1d + 80002892: fd8080e7 jalr -40(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 80002896: a009 j 80002898 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x108> + 80002898: 00a8 addi a0,sp,72 + 8000289a: 0001d097 auipc ra,0x1d + 8000289e: fcc080e7 jalr -52(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 800028a2: a009 j 800028a4 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x114> + 800028a4: a009 j 800028a6 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x116> + alloc.grow(ptr, old_layout, new_layout) + 800028a6: 6582 ld a1,0(sp) + 800028a8: 7542 ld a0,48(sp) + 800028aa: 662e ld a2,200(sp) + 800028ac: 66ce ld a3,208(sp) + 800028ae: 6726 ld a4,72(sp) + 800028b0: 67c6 ld a5,80(sp) + 800028b2: 0000a097 auipc ra,0xa + 800028b6: 352080e7 jalr 850(ra) # 8000cc04 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$4grow17h7670efcd8d0be277E> + 800028ba: fd2a sd a0,184(sp) + 800028bc: e1ae sd a1,192(sp) + 800028be: a009 j 800028c0 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x130> + let memory = if let Some((ptr, old_layout)) = current_memory { + 800028c0: a011 j 800028c4 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x134> + 800028c2: a009 j 800028c4 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x134> + }; + + memory.map_err(|_| AllocError { layout: new_layout, non_exhaustive: () }) + 800028c4: 6506 ld a0,64(sp) + 800028c6: 75ea ld a1,184(sp) + 800028c8: 660e ld a2,192(sp) + 800028ca: 00b4 addi a3,sp,72 + 800028cc: edb6 sd a3,216(sp) + 800028ce: 0000b097 auipc ra,0xb + 800028d2: 020080e7 jalr 32(ra) # 8000d8ee <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E> + 800028d6: a009 j 800028d8 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x148> +} + 800028d8: a011 j 800028dc <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x14c> + 800028da: a009 j 800028dc <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE+0x14c> + 800028dc: 70f2 ld ra,312(sp) + 800028de: 6131 addi sp,sp,320 + 800028e0: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec11finish_grow28_$u7b$$u7b$closure$u7d$$u7d$17h4102ec07be08fbafE: + +00000000800028e2 <_ZN5alloc7raw_vec11finish_grow28_$u7b$$u7b$closure$u7d$$u7d$17h4102ec07be08fbafE>: + memory.map_err(|_| AllocError { layout: new_layout, non_exhaustive: () }) + 800028e2: 1101 addi sp,sp,-32 + 800028e4: 85aa mv a1,a0 + 800028e6: e82e sd a1,16(sp) + 800028e8: 6188 ld a0,0(a1) + 800028ea: 658c ld a1,8(a1) + 800028ec: e02a sd a0,0(sp) + 800028ee: e42e sd a1,8(sp) + 800028f0: 6105 addi sp,sp,32 + 800028f2: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec11finish_grow28_$u7b$$u7b$closure$u7d$$u7d$17h73415ce87cdd3564E: + +00000000800028f4 <_ZN5alloc7raw_vec11finish_grow28_$u7b$$u7b$closure$u7d$$u7d$17h73415ce87cdd3564E>: + let new_layout = new_layout.map_err(|_| CapacityOverflow)?; + 800028f4: 1101 addi sp,sp,-32 + 800028f6: 4581 li a1,0 + 800028f8: e42e sd a1,8(sp) + 800028fa: 6502 ld a0,0(sp) + 800028fc: 6105 addi sp,sp,32 + 800028fe: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E: + +0000000080002900 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E>: + fn allocate_in(capacity: usize, init: AllocInit, alloc: A) -> Self { + 80002900: 7151 addi sp,sp,-240 + 80002902: f586 sd ra,232(sp) + 80002904: e0aa sd a0,64(sp) + 80002906: 04b107a3 sb a1,79(sp) + 8000290a: f92a sd a0,176(sp) + if mem::size_of::() == 0 { + 8000290c: a009 j 8000290e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xe> + 8000290e: 4505 li a0,1 + 80002910: e909 bnez a0,80002922 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x22> + 80002912: a009 j 80002914 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x14> + Self::new_in(alloc) + 80002914: 00000097 auipc ra,0x0 + 80002918: 418080e7 jalr 1048(ra) # 80002d2c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$6new_in17hcde8bd186b8458cbE> + 8000291c: ecaa sd a0,88(sp) + 8000291e: f0ae sd a1,96(sp) + 80002920: a809 j 80002932 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x32> + let layout = match Layout::array::(capacity) { + 80002922: 6506 ld a0,64(sp) + 80002924: 00006097 auipc ra,0x6 + 80002928: 51e080e7 jalr 1310(ra) # 80008e42 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E> + 8000292c: fcaa sd a0,120(sp) + 8000292e: e12e sd a1,128(sp) + 80002930: a011 j 80002934 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x34> + if mem::size_of::() == 0 { + 80002932: aa11 j 80002a46 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x146> + Ok(layout) => layout, + 80002934: 650a ld a0,128(sp) + 80002936: 00153593 seqz a1,a0 + 8000293a: 4581 li a1,0 + 8000293c: 00b51963 bne a0,a1,8000294e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x4e> + 80002940: a009 j 80002942 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x42> + Err(_) => capacity_overflow(), + 80002942: 00020097 auipc ra,0x20 + 80002946: 618080e7 jalr 1560(ra) # 80022f5a <_ZN5alloc7raw_vec17capacity_overflow17hae1c560931d103e4E> + 8000294a: 0000 unimp + let layout = match Layout::array::(capacity) { + 8000294c: 0000 unimp + Ok(layout) => layout, + 8000294e: 75e6 ld a1,120(sp) + 80002950: 650a ld a0,128(sp) + 80002952: fd2e sd a1,184(sp) + 80002954: e1aa sd a0,192(sp) + 80002956: f4ae sd a1,104(sp) + 80002958: f8aa sd a0,112(sp) + 8000295a: 10a8 addi a0,sp,104 + match alloc_guard(layout.size()) { + 8000295c: 0001d097 auipc ra,0x1d + 80002960: f00080e7 jalr -256(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 80002964: fc2a sd a0,56(sp) + 80002966: a009 j 80002968 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x68> + 80002968: 75e2 ld a1,56(sp) + 8000296a: 0128 addi a0,sp,136 + 8000296c: 0001d097 auipc ra,0x1d + 80002970: a42080e7 jalr -1470(ra) # 8001f3ae <_ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E> + 80002974: a009 j 80002976 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x76> + Ok(_) => {} + 80002976: 652a ld a0,136(sp) + 80002978: 4581 li a1,0 + 8000297a: 00b50963 beq a0,a1,8000298c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x8c> + 8000297e: a009 j 80002980 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x80> + Err(_) => capacity_overflow(), + 80002980: 00020097 auipc ra,0x20 + 80002984: 5da080e7 jalr 1498(ra) # 80022f5a <_ZN5alloc7raw_vec17capacity_overflow17hae1c560931d103e4E> + 80002988: 0000 unimp + match alloc_guard(layout.size()) { + 8000298a: 0000 unimp + AllocInit::Uninitialized => alloc.allocate(layout), + 8000298c: 04f14503 lbu a0,79(sp) + 80002990: 8905 andi a0,a0,1 + 80002992: 4581 li a1,0 + 80002994: 00b50e63 beq a0,a1,800029b0 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xb0> + 80002998: a009 j 8000299a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x9a> + AllocInit::Zeroed => alloc.allocate_zeroed(layout), + 8000299a: 75a6 ld a1,104(sp) + 8000299c: 7646 ld a2,112(sp) + 8000299e: 0888 addi a0,sp,80 + 800029a0: 0000a097 auipc ra,0xa + 800029a4: 240080e7 jalr 576(ra) # 8000cbe0 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE> + 800029a8: f12a sd a0,160(sp) + 800029aa: f52e sd a1,168(sp) + 800029ac: a829 j 800029c6 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xc6> + let result = match init { + 800029ae: 0000 unimp + AllocInit::Uninitialized => alloc.allocate(layout), + 800029b0: 75a6 ld a1,104(sp) + 800029b2: 7646 ld a2,112(sp) + 800029b4: 0888 addi a0,sp,80 + 800029b6: 0000a097 auipc ra,0xa + 800029ba: 278080e7 jalr 632(ra) # 8000cc2e <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17ha3ee32ed39eb82efE> + 800029be: f12a sd a0,160(sp) + 800029c0: f52e sd a1,168(sp) + 800029c2: a009 j 800029c4 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xc4> + let result = match init { + 800029c4: a011 j 800029c8 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xc8> + 800029c6: a009 j 800029c8 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xc8> + Ok(ptr) => ptr, + 800029c8: 750a ld a0,160(sp) + 800029ca: 00153593 seqz a1,a0 + 800029ce: 4581 li a1,0 + 800029d0: 00b51b63 bne a0,a1,800029e6 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xe6> + 800029d4: a009 j 800029d6 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0xd6> + Err(_) => handle_alloc_error(layout), + 800029d6: 7526 ld a0,104(sp) + 800029d8: 75c6 ld a1,112(sp) + 800029da: 00020097 auipc ra,0x20 + 800029de: 564080e7 jalr 1380(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + 800029e2: 0000 unimp + let ptr = match result { + 800029e4: 0000 unimp + Ok(ptr) => ptr, + 800029e6: 750a ld a0,160(sp) + 800029e8: f02a sd a0,32(sp) + 800029ea: 75aa ld a1,168(sp) + 800029ec: f42e sd a1,40(sp) + 800029ee: e5aa sd a0,200(sp) + 800029f0: e9ae sd a1,208(sp) + 800029f2: edaa sd a0,216(sp) + 800029f4: f1ae sd a1,224(sp) + ptr: unsafe { Unique::new_unchecked(ptr.cast().as_ptr()) }, + 800029f6: 0000d097 auipc ra,0xd + 800029fa: 3c8080e7 jalr 968(ra) # 8000fdbe <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17he3c6d28f0e68e811E> + 800029fe: f82a sd a0,48(sp) + 80002a00: a009 j 80002a02 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x102> + 80002a02: 7542 ld a0,48(sp) + 80002a04: 0000d097 auipc ra,0xd + 80002a08: 44a080e7 jalr 1098(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 80002a0c: ec2a sd a0,24(sp) + 80002a0e: a009 j 80002a10 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x110> + 80002a10: 6562 ld a0,24(sp) + 80002a12: 0000a097 auipc ra,0xa + 80002a16: a16080e7 jalr -1514(ra) # 8000c428 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E> + 80002a1a: e82a sd a0,16(sp) + 80002a1c: a009 j 80002a1e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x11e> + cap: Self::capacity_from_bytes(ptr.len()), + 80002a1e: 75a2 ld a1,40(sp) + 80002a20: 7502 ld a0,32(sp) + 80002a22: 0000d097 auipc ra,0xd + 80002a26: 53c080e7 jalr 1340(ra) # 8000ff5e <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$3len17h17d848b65404492bE> + 80002a2a: e42a sd a0,8(sp) + 80002a2c: a009 j 80002a2e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x12e> + 80002a2e: 6522 ld a0,8(sp) + 80002a30: 00000097 auipc ra,0x0 + 80002a34: 28c080e7 jalr 652(ra) # 80002cbc <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$19capacity_from_bytes17hb8f80a7316d4a8fbE> + 80002a38: e02a sd a0,0(sp) + 80002a3a: a009 j 80002a3c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x13c> + Self { + 80002a3c: 6502 ld a0,0(sp) + 80002a3e: 65c2 ld a1,16(sp) + 80002a40: ecae sd a1,88(sp) + 80002a42: f0aa sd a0,96(sp) + if mem::size_of::() == 0 { + 80002a44: a009 j 80002a46 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E+0x146> + } + 80002a46: 6566 ld a0,88(sp) + 80002a48: 7586 ld a1,96(sp) + 80002a4a: 70ae ld ra,232(sp) + 80002a4c: 616d addi sp,sp,240 + 80002a4e: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$13needs_to_grow17ha08818b631ce0004E: + +0000000080002a50 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$13needs_to_grow17ha08818b631ce0004E>: + fn needs_to_grow(&self, len: usize, additional: usize) -> bool { + 80002a50: 715d addi sp,sp,-80 + 80002a52: e486 sd ra,72(sp) + 80002a54: e432 sd a2,8(sp) + 80002a56: e82e sd a1,16(sp) + 80002a58: f02a sd a0,32(sp) + 80002a5a: f42e sd a1,40(sp) + 80002a5c: f832 sd a2,48(sp) + 80002a5e: e0aa sd a0,64(sp) + if mem::size_of::() == 0 { usize::MAX } else { self.cap } + 80002a60: 6508 ld a0,8(a0) + 80002a62: ec2a sd a0,24(sp) + 80002a64: fc2a sd a0,56(sp) + additional > self.capacity().wrapping_sub(len) + 80002a66: a009 j 80002a68 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$13needs_to_grow17ha08818b631ce0004E+0x18> + 80002a68: 65c2 ld a1,16(sp) + 80002a6a: 6562 ld a0,24(sp) + 80002a6c: 0001c097 auipc ra,0x1c + 80002a70: 500080e7 jalr 1280(ra) # 8001ef6c <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_sub17h8f077bf007d122c9E> + 80002a74: e02a sd a0,0(sp) + 80002a76: a009 j 80002a78 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$13needs_to_grow17ha08818b631ce0004E+0x28> + 80002a78: 6502 ld a0,0(sp) + 80002a7a: 65a2 ld a1,8(sp) + 80002a7c: 00b53533 sltu a0,a0,a1 + } + 80002a80: 60a6 ld ra,72(sp) + 80002a82: 6161 addi sp,sp,80 + 80002a84: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E: + +0000000080002a86 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E>: + fn current_memory(&self) -> Option<(NonNull, Layout)> { + 80002a86: 7175 addi sp,sp,-144 + 80002a88: e506 sd ra,136(sp) + 80002a8a: f42e sd a1,40(sp) + 80002a8c: f82a sd a0,48(sp) + 80002a8e: ecae sd a1,88(sp) + if mem::size_of::() == 0 || self.cap == 0 { + 80002a90: a025 j 80002ab8 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x32> + 80002a92: 4505 li a0,1 + 80002a94: 02a10fa3 sb a0,63(sp) + 80002a98: a819 j 80002aae <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x28> + 80002a9a: 4501 li a0,0 + 80002a9c: 02a10fa3 sb a0,63(sp) + 80002aa0: a039 j 80002aae <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x28> + 80002aa2: 7522 ld a0,40(sp) + 80002aa4: 6508 ld a0,8(a0) + 80002aa6: 4581 li a1,0 + 80002aa8: feb505e3 beq a0,a1,80002a92 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0xc> + 80002aac: b7fd j 80002a9a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x14> + 80002aae: 03f14503 lbu a0,63(sp) + 80002ab2: 8905 andi a0,a0,1 + 80002ab4: e509 bnez a0,80002abe <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x38> + 80002ab6: a801 j 80002ac6 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x40> + 80002ab8: 4501 li a0,0 + 80002aba: fd61 bnez a0,80002a92 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0xc> + 80002abc: b7dd j 80002aa2 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x1c> + 80002abe: 75c2 ld a1,48(sp) + 80002ac0: 4501 li a0,0 + None + 80002ac2: e188 sd a0,0(a1) + if mem::size_of::() == 0 || self.cap == 0 { + 80002ac4: a085 j 80002b24 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x9e> + 80002ac6: 4505 li a0,1 +#[inline(always)] +#[stable(feature = "rust1", since = "1.0.0")] +#[rustc_promotable] +#[rustc_const_stable(feature = "const_align_of", since = "1.24.0")] +pub const fn align_of() -> usize { + intrinsics::min_align_of::() + 80002ac8: f02a sd a0,32(sp) + 80002aca: e12a sd a0,128(sp) + let align = mem::align_of::(); + 80002acc: f0aa sd a0,96(sp) + 80002ace: a009 j 80002ad0 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x4a> + let size = mem::size_of::() * self.cap; + 80002ad0: a009 j 80002ad2 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x4c> + 80002ad2: 7582 ld a1,32(sp) + 80002ad4: 7522 ld a0,40(sp) + 80002ad6: 6508 ld a0,8(a0) + 80002ad8: f4aa sd a0,104(sp) + let layout = Layout::from_size_align_unchecked(size, align); + 80002ada: 0001d097 auipc ra,0x1d + 80002ade: d58080e7 jalr -680(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80002ae2: 862a mv a2,a0 + 80002ae4: e832 sd a2,16(sp) + 80002ae6: 862e mv a2,a1 + 80002ae8: ec32 sd a2,24(sp) + 80002aea: f8aa sd a0,112(sp) + 80002aec: fcae sd a1,120(sp) + 80002aee: a009 j 80002af0 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x6a> + Some((self.ptr.cast().into(), layout)) + 80002af0: 7522 ld a0,40(sp) + 80002af2: 6108 ld a0,0(a0) + 80002af4: 0000a097 auipc ra,0xa + 80002af8: 9ac080e7 jalr -1620(ra) # 8000c4a0 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h63879fc8651a3d59E> + 80002afc: e42a sd a0,8(sp) + 80002afe: a009 j 80002b00 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x7a> + 80002b00: 6522 ld a0,8(sp) + 80002b02: 0000a097 auipc ra,0xa + 80002b06: aa8080e7 jalr -1368(ra) # 8000c5aa <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17h6726b37a43d030b4E> + 80002b0a: e02a sd a0,0(sp) + 80002b0c: a009 j 80002b0e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x88> + 80002b0e: 6502 ld a0,0(sp) + 80002b10: 75c2 ld a1,48(sp) + 80002b12: 6642 ld a2,16(sp) + 80002b14: 66e2 ld a3,24(sp) + 80002b16: e0aa sd a0,64(sp) + 80002b18: e4b2 sd a2,72(sp) + 80002b1a: e8b6 sd a3,80(sp) + 80002b1c: e994 sd a3,16(a1) + 80002b1e: e590 sd a2,8(a1) + 80002b20: e188 sd a0,0(a1) + if mem::size_of::() == 0 || self.cap == 0 { + 80002b22: a009 j 80002b24 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E+0x9e> + } + 80002b24: 60aa ld ra,136(sp) + 80002b26: 6149 addi sp,sp,144 + 80002b28: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E: + +0000000080002b2a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E>: + fn grow_amortized(&mut self, len: usize, additional: usize) -> Result<(), TryReserveError> { + 80002b2a: 7125 addi sp,sp,-416 + 80002b2c: ef06 sd ra,408(sp) + 80002b2e: ecb6 sd a3,88(sp) + 80002b30: f0b2 sd a2,96(sp) + 80002b32: f4ae sd a1,104(sp) + 80002b34: f8aa sd a0,112(sp) + 80002b36: ea2e sd a1,272(sp) + 80002b38: ee32 sd a2,280(sp) + 80002b3a: f236 sd a3,288(sp) + if mem::size_of::() == 0 { + 80002b3c: a009 j 80002b3e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x14> + 80002b3e: 4505 li a0,1 + 80002b40: e919 bnez a0,80002b56 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x2c> + 80002b42: a009 j 80002b44 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x1a> + 80002b44: 75c6 ld a1,112(sp) + 80002b46: 4501 li a0,0 + return Err(CapacityOverflow); + 80002b48: e12a sd a0,128(sp) + 80002b4a: 7666 ld a2,120(sp) + 80002b4c: e590 sd a2,8(a1) + 80002b4e: e988 sd a0,16(a1) + 80002b50: 4505 li a0,1 + 80002b52: e188 sd a0,0(a1) + 80002b54: aa3d j 80002c92 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x168> + let required_cap = len.checked_add(additional).ok_or(CapacityOverflow)?; + 80002b56: 65e6 ld a1,88(sp) + 80002b58: 7506 ld a0,96(sp) + 80002b5a: 0001c097 auipc ra,0x1c + 80002b5e: 31c080e7 jalr 796(ra) # 8001ee76 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E> + 80002b62: e4aa sd a0,72(sp) + 80002b64: e8ae sd a1,80(sp) + 80002b66: a009 j 80002b68 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x3e> + 80002b68: 6646 ld a2,80(sp) + 80002b6a: 65a6 ld a1,72(sp) + 80002b6c: 4701 li a4,0 + 80002b6e: e1ba sd a4,192(sp) + 80002b70: 76ea ld a3,184(sp) + 80002b72: 1108 addi a0,sp,160 + 80002b74: 0000c097 auipc ra,0xc + 80002b78: 61e080e7 jalr 1566(ra) # 8000f192 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E> + 80002b7c: a009 j 80002b7e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x54> + 80002b7e: 0128 addi a0,sp,136 + 80002b80: 110c addi a1,sp,160 + 80002b82: 0000b097 auipc ra,0xb + 80002b86: fdc080e7 jalr -36(ra) # 8000db5e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hda96dc8b8fa1398aE> + 80002b8a: a009 j 80002b8c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x62> + 80002b8c: 652a ld a0,136(sp) + 80002b8e: 4581 li a1,0 + 80002b90: 00b50463 beq a0,a1,80002b98 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x6e> + 80002b94: a009 j 80002b96 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x6c> + 80002b96: a005 j 80002bb6 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x8c> + 80002b98: 7526 ld a0,104(sp) + 80002b9a: 65ca ld a1,144(sp) + 80002b9c: fe2e sd a1,312(sp) + 80002b9e: e2ae sd a1,320(sp) + let cap = cmp::max(self.cap * 2, required_cap); + 80002ba0: 6508 ld a0,8(a0) + 80002ba2: 0506 slli a0,a0,0x1 + 80002ba4: 00020097 auipc ra,0x20 + 80002ba8: 204080e7 jalr 516(ra) # 80022da8 <_ZN4core3cmp3max17h3dc8da765fcdebd4E> + 80002bac: 85aa mv a1,a0 + 80002bae: e0ae sd a1,64(sp) + 80002bb0: e6aa sd a0,328(sp) + 80002bb2: a035 j 80002bde <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0xb4> + let required_cap = len.checked_add(additional).ok_or(CapacityOverflow)?; + 80002bb4: 0000 unimp + 80002bb6: 654a ld a0,144(sp) + 80002bb8: 65ea ld a1,152(sp) + 80002bba: f62a sd a0,296(sp) + 80002bbc: fa2e sd a1,304(sp) + 80002bbe: 00014097 auipc ra,0x14 + 80002bc2: c56080e7 jalr -938(ra) # 80016814 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h00cb4931a375be30E> + 80002bc6: f82a sd a0,48(sp) + 80002bc8: fc2e sd a1,56(sp) + 80002bca: a009 j 80002bcc <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0xa2> + 80002bcc: 7662 ld a2,56(sp) + 80002bce: 75c2 ld a1,48(sp) + 80002bd0: 7546 ld a0,112(sp) + 80002bd2: 0000b097 auipc ra,0xb + 80002bd6: e18080e7 jalr -488(ra) # 8000d9ea <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h5998e5a20485011cE> + 80002bda: a009 j 80002bdc <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0xb2> + 80002bdc: a855 j 80002c90 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x166> + let cap = cmp::max(Self::MIN_NON_ZERO_CAP, cap); + 80002bde: 6586 ld a1,64(sp) + 80002be0: 4521 li a0,8 + 80002be2: 00020097 auipc ra,0x20 + 80002be6: 1c6080e7 jalr 454(ra) # 80022da8 <_ZN4core3cmp3max17h3dc8da765fcdebd4E> + 80002bea: 85aa mv a1,a0 + 80002bec: f42e sd a1,40(sp) + 80002bee: eaaa sd a0,336(sp) + 80002bf0: a009 j 80002bf2 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0xc8> + let new_layout = Layout::array::(cap); + 80002bf2: 7522 ld a0,40(sp) + 80002bf4: 00006097 auipc ra,0x6 + 80002bf8: 24e080e7 jalr 590(ra) # 80008e42 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E> + 80002bfc: 862a mv a2,a0 + 80002bfe: ec32 sd a2,24(sp) + 80002c00: 862e mv a2,a1 + 80002c02: f032 sd a2,32(sp) + 80002c04: eeaa sd a0,344(sp) + 80002c06: f2ae sd a1,352(sp) + 80002c08: a009 j 80002c0a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0xe0> + let ptr = finish_grow(new_layout, self.current_memory(), &mut self.alloc)?; + 80002c0a: 75a6 ld a1,104(sp) + 80002c0c: 19a8 addi a0,sp,248 + 80002c0e: 00000097 auipc ra,0x0 + 80002c12: e78080e7 jalr -392(ra) # 80002a86 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E> + 80002c16: a009 j 80002c18 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0xee> + 80002c18: 7726 ld a4,104(sp) + 80002c1a: 7602 ld a2,32(sp) + 80002c1c: 65e2 ld a1,24(sp) + 80002c1e: 1188 addi a0,sp,224 + 80002c20: 19b4 addi a3,sp,248 + 80002c22: 00000097 auipc ra,0x0 + 80002c26: b6e080e7 jalr -1170(ra) # 80002790 <_ZN5alloc7raw_vec11finish_grow17h67df8fd3b618c18aE> + 80002c2a: a009 j 80002c2c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x102> + 80002c2c: 01a8 addi a0,sp,200 + 80002c2e: 118c addi a1,sp,224 + 80002c30: 0000b097 auipc ra,0xb + 80002c34: f5e080e7 jalr -162(ra) # 8000db8e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hf2a730b9c7ab248fE> + 80002c38: a009 j 80002c3a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x110> + 80002c3a: 652e ld a0,200(sp) + 80002c3c: 4581 li a1,0 + 80002c3e: 00b50463 beq a0,a1,80002c46 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x11c> + 80002c42: a009 j 80002c44 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x11a> + 80002c44: a831 j 80002c60 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x136> + 80002c46: 7526 ld a0,104(sp) + 80002c48: 65ce ld a1,208(sp) + 80002c4a: 666e ld a2,216(sp) + 80002c4c: feae sd a1,376(sp) + 80002c4e: e332 sd a2,384(sp) + 80002c50: e72e sd a1,392(sp) + 80002c52: eb32 sd a2,400(sp) + self.set_ptr(ptr); + 80002c54: 00000097 auipc ra,0x0 + 80002c58: 164080e7 jalr 356(ra) # 80002db8 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE> + 80002c5c: a035 j 80002c88 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x15e> + let ptr = finish_grow(new_layout, self.current_memory(), &mut self.alloc)?; + 80002c5e: 0000 unimp + 80002c60: 654e ld a0,208(sp) + 80002c62: 65ee ld a1,216(sp) + 80002c64: f6aa sd a0,360(sp) + 80002c66: faae sd a1,368(sp) + 80002c68: 00014097 auipc ra,0x14 + 80002c6c: bac080e7 jalr -1108(ra) # 80016814 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h00cb4931a375be30E> + 80002c70: e42a sd a0,8(sp) + 80002c72: e82e sd a1,16(sp) + 80002c74: a009 j 80002c76 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x14c> + 80002c76: 6642 ld a2,16(sp) + 80002c78: 65a2 ld a1,8(sp) + 80002c7a: 7546 ld a0,112(sp) + 80002c7c: 0000b097 auipc ra,0xb + 80002c80: d6e080e7 jalr -658(ra) # 8000d9ea <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h5998e5a20485011cE> + 80002c84: a009 j 80002c86 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x15c> + 80002c86: a029 j 80002c90 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x166> + 80002c88: 75c6 ld a1,112(sp) + 80002c8a: 4501 li a0,0 + Ok(()) + 80002c8c: e188 sd a0,0(a1) + } + 80002c8e: a011 j 80002c92 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x168> + 80002c90: a009 j 80002c92 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E+0x168> + 80002c92: 60fa ld ra,408(sp) + 80002c94: 611d addi sp,sp,416 + 80002c96: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$16with_capacity_in17hb06502444696164dE: + +0000000080002c98 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$16with_capacity_in17hb06502444696164dE>: + pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { + 80002c98: 7179 addi sp,sp,-48 + 80002c9a: f406 sd ra,40(sp) + 80002c9c: ec2a sd a0,24(sp) + 80002c9e: 4581 li a1,0 + Self::allocate_in(capacity, AllocInit::Uninitialized, alloc) + 80002ca0: 00b10ba3 sb a1,23(sp) + 80002ca4: 00000097 auipc ra,0x0 + 80002ca8: c5c080e7 jalr -932(ra) # 80002900 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E> + 80002cac: e02a sd a0,0(sp) + 80002cae: e42e sd a1,8(sp) + 80002cb0: a009 j 80002cb2 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$16with_capacity_in17hb06502444696164dE+0x1a> + } + 80002cb2: 65a2 ld a1,8(sp) + 80002cb4: 6502 ld a0,0(sp) + 80002cb6: 70a2 ld ra,40(sp) + 80002cb8: 6145 addi sp,sp,48 + 80002cba: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$19capacity_from_bytes17hb8f80a7316d4a8fbE: + +0000000080002cbc <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$19capacity_from_bytes17hb8f80a7316d4a8fbE>: + fn capacity_from_bytes(excess: usize) -> usize { + 80002cbc: 1141 addi sp,sp,-16 + 80002cbe: e02a sd a0,0(sp) + 80002cc0: e42a sd a0,8(sp) + excess / mem::size_of::() + 80002cc2: a009 j 80002cc4 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$19capacity_from_bytes17hb8f80a7316d4a8fbE+0x8> + 80002cc4: 4501 li a0,0 + 80002cc6: e509 bnez a0,80002cd0 <.LBB8_4> + 80002cc8: a009 j 80002cca <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$19capacity_from_bytes17hb8f80a7316d4a8fbE+0xe> + } + 80002cca: 6502 ld a0,0(sp) + 80002ccc: 0141 addi sp,sp,16 + 80002cce: 8082 ret + +0000000080002cd0 <.LBB8_4>: + excess / mem::size_of::() + 80002cd0: 00024517 auipc a0,0x24 + 80002cd4: d0050513 addi a0,a0,-768 # 800269d0 + +0000000080002cd8 <.LBB8_5>: + 80002cd8: 00024617 auipc a2,0x24 + 80002cdc: ce060613 addi a2,a2,-800 # 800269b8 <.L__unnamed_1> + 80002ce0: 45e5 li a1,25 + 80002ce2: 00020097 auipc ra,0x20 + 80002ce6: 462080e7 jalr 1122(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$23with_capacity_zeroed_in17hc0850ff3c2415cf8E: + +0000000080002cec <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$23with_capacity_zeroed_in17hc0850ff3c2415cf8E>: + pub fn with_capacity_zeroed_in(capacity: usize, alloc: A) -> Self { + 80002cec: 7179 addi sp,sp,-48 + 80002cee: f406 sd ra,40(sp) + 80002cf0: ec2a sd a0,24(sp) + 80002cf2: 4585 li a1,1 + Self::allocate_in(capacity, AllocInit::Zeroed, alloc) + 80002cf4: 00b10ba3 sb a1,23(sp) + 80002cf8: 00000097 auipc ra,0x0 + 80002cfc: c08080e7 jalr -1016(ra) # 80002900 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$11allocate_in17hb1a7e5211a2ca028E> + 80002d00: e02a sd a0,0(sp) + 80002d02: e42e sd a1,8(sp) + 80002d04: a009 j 80002d06 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$23with_capacity_zeroed_in17hc0850ff3c2415cf8E+0x1a> + } + 80002d06: 65a2 ld a1,8(sp) + 80002d08: 6502 ld a0,0(sp) + 80002d0a: 70a2 ld ra,40(sp) + 80002d0c: 6145 addi sp,sp,48 + 80002d0e: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$3ptr17h887fa3437b1e26b7E: + +0000000080002d10 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$3ptr17h887fa3437b1e26b7E>: + pub fn ptr(&self) -> *mut T { + 80002d10: 1101 addi sp,sp,-32 + 80002d12: ec06 sd ra,24(sp) + 80002d14: e82a sd a0,16(sp) + self.ptr.as_ptr() + 80002d16: 6108 ld a0,0(a0) + 80002d18: 0000a097 auipc ra,0xa + 80002d1c: 820080e7 jalr -2016(ra) # 8000c538 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hc428d38b809aa8c2E> + 80002d20: e42a sd a0,8(sp) + 80002d22: a009 j 80002d24 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$3ptr17h887fa3437b1e26b7E+0x14> + } + 80002d24: 6522 ld a0,8(sp) + 80002d26: 60e2 ld ra,24(sp) + 80002d28: 6105 addi sp,sp,32 + 80002d2a: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$6new_in17hcde8bd186b8458cbE: + +0000000080002d2c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$6new_in17hcde8bd186b8458cbE>: + pub const fn new_in(alloc: A) -> Self { + 80002d2c: 7179 addi sp,sp,-48 + Self { ptr: Unique::dangling(), cap: 0, alloc } + 80002d2e: f406 sd ra,40(sp) + 80002d30: 0000a097 auipc ra,0xa + 80002d34: 858080e7 jalr -1960(ra) # 8000c588 <_ZN4core3ptr6unique15Unique$LT$T$GT$8dangling17h9486dd80fcd97a92E> + 80002d38: e42a sd a0,8(sp) + 80002d3a: a009 j 80002d3c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$6new_in17hcde8bd186b8458cbE+0x10> + 80002d3c: 6522 ld a0,8(sp) + 80002d3e: e82a sd a0,16(sp) + 80002d40: 4581 li a1,0 + 80002d42: ec2e sd a1,24(sp) + } + 80002d44: 70a2 ld ra,40(sp) + 80002d46: 6145 addi sp,sp,48 + 80002d48: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E: + +0000000080002d4a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E>: + pub fn reserve(&mut self, len: usize, additional: usize) { + 80002d4a: 715d addi sp,sp,-80 + 80002d4c: e486 sd ra,72(sp) + 80002d4e: e432 sd a2,8(sp) + 80002d50: e82e sd a1,16(sp) + 80002d52: ec2a sd a0,24(sp) + 80002d54: f82a sd a0,48(sp) + 80002d56: fc2e sd a1,56(sp) + 80002d58: e0b2 sd a2,64(sp) + if self.needs_to_grow(len, additional) { + 80002d5a: 00000097 auipc ra,0x0 + 80002d5e: cf6080e7 jalr -778(ra) # 80002a50 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$13needs_to_grow17ha08818b631ce0004E> + 80002d62: f02a sd a0,32(sp) + 80002d64: a009 j 80002d66 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E+0x1c> + 80002d66: 7502 ld a0,32(sp) + 80002d68: 4581 li a1,0 + 80002d6a: 00b50b63 beq a0,a1,80002d80 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E+0x36> + 80002d6e: a009 j 80002d70 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E+0x26> + do_reserve_and_handle(self, len, additional); + 80002d70: 6622 ld a2,8(sp) + 80002d72: 65c2 ld a1,16(sp) + 80002d74: 6562 ld a0,24(sp) + 80002d76: 00000097 auipc ra,0x0 + 80002d7a: 014080e7 jalr 20(ra) # 80002d8a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve21do_reserve_and_handle17h338385e566e859eeE> + 80002d7e: a011 j 80002d82 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E+0x38> + if self.needs_to_grow(len, additional) { + 80002d80: a011 j 80002d84 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E+0x3a> + 80002d82: a009 j 80002d84 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E+0x3a> + } + 80002d84: 60a6 ld ra,72(sp) + 80002d86: 6161 addi sp,sp,80 + 80002d88: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve21do_reserve_and_handle17h338385e566e859eeE: + +0000000080002d8a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve21do_reserve_and_handle17h338385e566e859eeE>: + fn do_reserve_and_handle( + 80002d8a: 7139 addi sp,sp,-64 + 80002d8c: fc06 sd ra,56(sp) + 80002d8e: 86b2 mv a3,a2 + 80002d90: 862e mv a2,a1 + 80002d92: 85aa mv a1,a0 + 80002d94: f02e sd a1,32(sp) + 80002d96: f432 sd a2,40(sp) + 80002d98: f836 sd a3,48(sp) + 80002d9a: 0028 addi a0,sp,8 + handle_reserve(slf.grow_amortized(len, additional)); + 80002d9c: 00000097 auipc ra,0x0 + 80002da0: d8e080e7 jalr -626(ra) # 80002b2a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14grow_amortized17h6d7a8aee2de04232E> + 80002da4: a009 j 80002da6 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve21do_reserve_and_handle17h338385e566e859eeE+0x1c> + 80002da6: 0028 addi a0,sp,8 + 80002da8: 0001c097 auipc ra,0x1c + 80002dac: 630080e7 jalr 1584(ra) # 8001f3d8 <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E> + 80002db0: a009 j 80002db2 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve21do_reserve_and_handle17h338385e566e859eeE+0x28> + } + 80002db2: 70e2 ld ra,56(sp) + 80002db4: 6121 addi sp,sp,64 + 80002db6: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE: + +0000000080002db8 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE>: + fn set_ptr(&mut self, ptr: NonNull<[u8]>) { + 80002db8: 711d addi sp,sp,-96 + 80002dba: ec86 sd ra,88(sp) + 80002dbc: f032 sd a2,32(sp) + 80002dbe: 862e mv a2,a1 + 80002dc0: 7582 ld a1,32(sp) + 80002dc2: f432 sd a2,40(sp) + 80002dc4: 862a mv a2,a0 + 80002dc6: 7522 ld a0,40(sp) + 80002dc8: f832 sd a2,48(sp) + 80002dca: e0b2 sd a2,64(sp) + 80002dcc: e4aa sd a0,72(sp) + 80002dce: e8ae sd a1,80(sp) + self.ptr = unsafe { Unique::new_unchecked(ptr.cast().as_ptr()) }; + 80002dd0: 0000d097 auipc ra,0xd + 80002dd4: fee080e7 jalr -18(ra) # 8000fdbe <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17he3c6d28f0e68e811E> + 80002dd8: fc2a sd a0,56(sp) + 80002dda: a009 j 80002ddc <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE+0x24> + 80002ddc: 7562 ld a0,56(sp) + 80002dde: 0000d097 auipc ra,0xd + 80002de2: 070080e7 jalr 112(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 80002de6: ec2a sd a0,24(sp) + 80002de8: a009 j 80002dea <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE+0x32> + 80002dea: 6562 ld a0,24(sp) + 80002dec: 00009097 auipc ra,0x9 + 80002df0: 63c080e7 jalr 1596(ra) # 8000c428 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E> + 80002df4: e82a sd a0,16(sp) + 80002df6: a009 j 80002df8 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE+0x40> + 80002df8: 7582 ld a1,32(sp) + 80002dfa: 7522 ld a0,40(sp) + 80002dfc: 6642 ld a2,16(sp) + 80002dfe: 76c2 ld a3,48(sp) + 80002e00: e290 sd a2,0(a3) + self.cap = Self::capacity_from_bytes(ptr.len()); + 80002e02: 0000d097 auipc ra,0xd + 80002e06: 15c080e7 jalr 348(ra) # 8000ff5e <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$3len17h17d848b65404492bE> + 80002e0a: e42a sd a0,8(sp) + 80002e0c: a009 j 80002e0e <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE+0x56> + 80002e0e: 6522 ld a0,8(sp) + 80002e10: 00000097 auipc ra,0x0 + 80002e14: eac080e7 jalr -340(ra) # 80002cbc <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$19capacity_from_bytes17hb8f80a7316d4a8fbE> + 80002e18: e02a sd a0,0(sp) + 80002e1a: a009 j 80002e1c <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7set_ptr17hbcba753f42d1a54eE+0x64> + 80002e1c: 6502 ld a0,0(sp) + 80002e1e: 75c2 ld a1,48(sp) + 80002e20: e588 sd a0,8(a1) + } + 80002e22: 60e6 ld ra,88(sp) + 80002e24: 6125 addi sp,sp,96 + 80002e26: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register5clint10read_mtime17h47cb1a320cb6e740E: + +0000000080002e28 <_ZN6kernel4arch5riscv8register5clint10read_mtime17h47cb1a320cb6e740E>: +use crate::arch::riscv::qemu::layout::{CLINT_MTIME, CLINT_MTIMECMP, CLINT}; + +// core local interruptor (CLINT), which contains the timer. + +#[inline] +unsafe fn read_mtime() -> u64 { + 80002e28: 1101 addi sp,sp,-32 + 80002e2a: ec06 sd ra,24(sp) + 80002e2c: 0200c537 lui a0,0x200c + 80002e30: 3561 addiw a0,a0,-8 + ptr::read_volatile(Into::::into(CLINT_MTIME) as *const u64) + 80002e32: 00009097 auipc ra,0x9 + 80002e36: 566080e7 jalr 1382(ra) # 8000c398 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E> + 80002e3a: e82a sd a0,16(sp) + 80002e3c: a009 j 80002e3e <_ZN6kernel4arch5riscv8register5clint10read_mtime17h47cb1a320cb6e740E+0x16> + 80002e3e: 6542 ld a0,16(sp) + 80002e40: 00016097 auipc ra,0x16 + 80002e44: 4fe080e7 jalr 1278(ra) # 8001933e <_ZN4core3ptr13read_volatile17h53ed030574802bd4E> + 80002e48: e42a sd a0,8(sp) + 80002e4a: a009 j 80002e4c <_ZN6kernel4arch5riscv8register5clint10read_mtime17h47cb1a320cb6e740E+0x24> +} + 80002e4c: 6522 ld a0,8(sp) + 80002e4e: 60e2 ld ra,24(sp) + 80002e50: 6105 addi sp,sp,32 + 80002e52: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register5clint14write_mtimecmp17h37dad6df38dd09a3E: + +0000000080002e54 <_ZN6kernel4arch5riscv8register5clint14write_mtimecmp17h37dad6df38dd09a3E>: + +unsafe fn write_mtimecmp(mhartid:usize, value: u64) { + 80002e54: 715d addi sp,sp,-80 + 80002e56: e486 sd ra,72(sp) + 80002e58: ec2e sd a1,24(sp) + 80002e5a: f02a sd a0,32(sp) + 80002e5c: f82a sd a0,48(sp) + 80002e5e: fc2e sd a1,56(sp) + 80002e60: 02004537 lui a0,0x2004 + let offset = Into::::into(CLINT_MTIMECMP) + 8*mhartid; + 80002e64: 00009097 auipc ra,0x9 + 80002e68: 534080e7 jalr 1332(ra) # 8000c398 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E> + 80002e6c: f42a sd a0,40(sp) + 80002e6e: a009 j 80002e70 <_ZN6kernel4arch5riscv8register5clint14write_mtimecmp17h37dad6df38dd09a3E+0x1c> + 80002e70: 7582 ld a1,32(sp) + 80002e72: 4505 li a0,1 + 80002e74: 1576 slli a0,a0,0x3d + 80002e76: 157d addi a0,a0,-1 + 80002e78: 8d6d and a0,a0,a1 + 80002e7a: 00359613 slli a2,a1,0x3 + 80002e7e: e832 sd a2,16(sp) + 80002e80: 02b51563 bne a0,a1,80002eaa <.LBB1_7> + 80002e84: a009 j 80002e86 <_ZN6kernel4arch5riscv8register5clint14write_mtimecmp17h37dad6df38dd09a3E+0x32> + 80002e86: 75a2 ld a1,40(sp) + 80002e88: 6542 ld a0,16(sp) + 80002e8a: 952e add a0,a0,a1 + 80002e8c: e42a sd a0,8(sp) + 80002e8e: 02b56d63 bltu a0,a1,80002ec8 <.LBB1_9> + 80002e92: a009 j 80002e94 <_ZN6kernel4arch5riscv8register5clint14write_mtimecmp17h37dad6df38dd09a3E+0x40> + 80002e94: 65e2 ld a1,24(sp) + 80002e96: 6522 ld a0,8(sp) + 80002e98: e0aa sd a0,64(sp) + ptr::write_volatile(offset as *mut u64, value); + 80002e9a: 00016097 auipc ra,0x16 + 80002e9e: 4c4080e7 jalr 1220(ra) # 8001935e <_ZN4core3ptr14write_volatile17h935b49f1a63f6714E> + 80002ea2: a009 j 80002ea4 <_ZN6kernel4arch5riscv8register5clint14write_mtimecmp17h37dad6df38dd09a3E+0x50> +} + 80002ea4: 60a6 ld ra,72(sp) + 80002ea6: 6161 addi sp,sp,80 + 80002ea8: 8082 ret + +0000000080002eaa <.LBB1_7>: + let offset = Into::::into(CLINT_MTIMECMP) + 8*mhartid; + 80002eaa: 00024517 auipc a0,0x24 + 80002eae: b6650513 addi a0,a0,-1178 # 80026a10 + +0000000080002eb2 <.LBB1_8>: + 80002eb2: 00024617 auipc a2,0x24 + 80002eb6: b3e60613 addi a2,a2,-1218 # 800269f0 <.L__unnamed_1> + 80002eba: 02100593 li a1,33 + 80002ebe: 00020097 auipc ra,0x20 + 80002ec2: 286080e7 jalr 646(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002ec8 <.LBB1_9>: + 80002ec8: 00024517 auipc a0,0x24 + 80002ecc: b8850513 addi a0,a0,-1144 # 80026a50 + +0000000080002ed0 <.LBB1_10>: + 80002ed0: 00024617 auipc a2,0x24 + 80002ed4: b6860613 addi a2,a2,-1176 # 80026a38 <.L__unnamed_2> + 80002ed8: 45f1 li a1,28 + 80002eda: 00020097 auipc ra,0x20 + 80002ede: 26a080e7 jalr 618(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4arch5riscv8register5clint12add_mtimecmp17hca3030d0d062e6f9E: + +0000000080002ee4 <_ZN6kernel4arch5riscv8register5clint12add_mtimecmp17hca3030d0d062e6f9E>: + +pub unsafe fn add_mtimecmp(mhartid:usize, interval:u64){ + 80002ee4: 7139 addi sp,sp,-64 + 80002ee6: fc06 sd ra,56(sp) + 80002ee8: e42e sd a1,8(sp) + 80002eea: e82a sd a0,16(sp) + 80002eec: f02a sd a0,32(sp) + 80002eee: f42e sd a1,40(sp) + let value = read_mtime(); + 80002ef0: 00000097 auipc ra,0x0 + 80002ef4: f38080e7 jalr -200(ra) # 80002e28 <_ZN6kernel4arch5riscv8register5clint10read_mtime17h47cb1a320cb6e740E> + 80002ef8: 85aa mv a1,a0 + 80002efa: ec2e sd a1,24(sp) + 80002efc: f82a sd a0,48(sp) + 80002efe: a009 j 80002f00 <_ZN6kernel4arch5riscv8register5clint12add_mtimecmp17hca3030d0d062e6f9E+0x1c> + write_mtimecmp(mhartid, value+interval); + 80002f00: 65e2 ld a1,24(sp) + 80002f02: 6522 ld a0,8(sp) + 80002f04: 952e add a0,a0,a1 + 80002f06: e02a sd a0,0(sp) + 80002f08: 00b56d63 bltu a0,a1,80002f22 <.LBB2_5> + 80002f0c: a009 j 80002f0e <_ZN6kernel4arch5riscv8register5clint12add_mtimecmp17hca3030d0d062e6f9E+0x2a> + 80002f0e: 6582 ld a1,0(sp) + 80002f10: 6542 ld a0,16(sp) + 80002f12: 00000097 auipc ra,0x0 + 80002f16: f42080e7 jalr -190(ra) # 80002e54 <_ZN6kernel4arch5riscv8register5clint14write_mtimecmp17h37dad6df38dd09a3E> + 80002f1a: a009 j 80002f1c <_ZN6kernel4arch5riscv8register5clint12add_mtimecmp17hca3030d0d062e6f9E+0x38> +} + 80002f1c: 70e2 ld ra,56(sp) + 80002f1e: 6121 addi sp,sp,64 + 80002f20: 8082 ret + +0000000080002f22 <.LBB2_5>: + write_mtimecmp(mhartid, value+interval); + 80002f22: 00024517 auipc a0,0x24 + 80002f26: b2e50513 addi a0,a0,-1234 # 80026a50 + +0000000080002f2a <.LBB2_6>: + 80002f2a: 00024617 auipc a2,0x24 + 80002f2e: b4660613 addi a2,a2,-1210 # 80026a70 <.L__unnamed_3> + 80002f32: 45f1 li a1,28 + 80002f34: 00020097 auipc ra,0x20 + 80002f38: 210080e7 jalr 528(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4arch5riscv8register5clint13count_mtiecmp17h29e162b64ddfbfccE: + +0000000080002f3e <_ZN6kernel4arch5riscv8register5clint13count_mtiecmp17h29e162b64ddfbfccE>: + +pub fn count_mtiecmp(mhartid:usize) -> usize{ + 80002f3e: 7139 addi sp,sp,-64 + 80002f40: fc06 sd ra,56(sp) + 80002f42: ec2a sd a0,24(sp) + 80002f44: f42a sd a0,40(sp) + 80002f46: 02000537 lui a0,0x2000 + let ret:usize; + ret = Into::::into(CLINT) + 8*mhartid + 0x4000; + 80002f4a: 00009097 auipc ra,0x9 + 80002f4e: 44e080e7 jalr 1102(ra) # 8000c398 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E> + 80002f52: f02a sd a0,32(sp) + 80002f54: a009 j 80002f56 <_ZN6kernel4arch5riscv8register5clint13count_mtiecmp17h29e162b64ddfbfccE+0x18> + 80002f56: 65e2 ld a1,24(sp) + 80002f58: 4505 li a0,1 + 80002f5a: 1576 slli a0,a0,0x3d + 80002f5c: 157d addi a0,a0,-1 + 80002f5e: 8d6d and a0,a0,a1 + 80002f60: 00359613 slli a2,a1,0x3 + 80002f64: e832 sd a2,16(sp) + 80002f66: 02b51663 bne a0,a1,80002f92 <.LBB3_8> + 80002f6a: a009 j 80002f6c <_ZN6kernel4arch5riscv8register5clint13count_mtiecmp17h29e162b64ddfbfccE+0x2e> + 80002f6c: 7582 ld a1,32(sp) + 80002f6e: 6542 ld a0,16(sp) + 80002f70: 952e add a0,a0,a1 + 80002f72: e42a sd a0,8(sp) + 80002f74: 02b56e63 bltu a0,a1,80002fb0 <.LBB3_10> + 80002f78: a009 j 80002f7a <_ZN6kernel4arch5riscv8register5clint13count_mtiecmp17h29e162b64ddfbfccE+0x3c> + 80002f7a: 65a2 ld a1,8(sp) + 80002f7c: 6511 lui a0,0x4 + 80002f7e: 952e add a0,a0,a1 + 80002f80: e02a sd a0,0(sp) + 80002f82: 04b56563 bltu a0,a1,80002fcc <.LBB3_12> + 80002f86: a009 j 80002f88 <_ZN6kernel4arch5riscv8register5clint13count_mtiecmp17h29e162b64ddfbfccE+0x4a> + 80002f88: 6502 ld a0,0(sp) + 80002f8a: f82a sd a0,48(sp) + ret +} + 80002f8c: 70e2 ld ra,56(sp) + 80002f8e: 6121 addi sp,sp,64 + 80002f90: 8082 ret + +0000000080002f92 <.LBB3_8>: + ret = Into::::into(CLINT) + 8*mhartid + 0x4000; + 80002f92: 00024517 auipc a0,0x24 + 80002f96: a7e50513 addi a0,a0,-1410 # 80026a10 + +0000000080002f9a <.LBB3_9>: + 80002f9a: 00024617 auipc a2,0x24 + 80002f9e: aee60613 addi a2,a2,-1298 # 80026a88 <.L__unnamed_4> + 80002fa2: 02100593 li a1,33 + 80002fa6: 00020097 auipc ra,0x20 + 80002faa: 19e080e7 jalr 414(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002fb0 <.LBB3_10>: + 80002fb0: 00024517 auipc a0,0x24 + 80002fb4: aa050513 addi a0,a0,-1376 # 80026a50 + +0000000080002fb8 <.LBB3_11>: + 80002fb8: 00024617 auipc a2,0x24 + 80002fbc: ae860613 addi a2,a2,-1304 # 80026aa0 <.L__unnamed_5> + 80002fc0: 45f1 li a1,28 + 80002fc2: 00020097 auipc ra,0x20 + 80002fc6: 182080e7 jalr 386(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080002fcc <.LBB3_12>: + 80002fcc: 00024517 auipc a0,0x24 + 80002fd0: a8450513 addi a0,a0,-1404 # 80026a50 + +0000000080002fd4 <.LBB3_13>: + 80002fd4: 00024617 auipc a2,0x24 + 80002fd8: acc60613 addi a2,a2,-1332 # 80026aa0 <.L__unnamed_5> + 80002fdc: 45f1 li a1,28 + 80002fde: 00020097 auipc ra,0x20 + 80002fe2: 166080e7 jalr 358(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E: + +0000000080002fe8 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E>: + /// println!("We got back the value: {}!", val_back); + /// } + /// ``` + #[stable(feature = "ptr_as_ref", since = "1.9.0")] + #[inline] + pub unsafe fn as_ref<'a>(self) -> Option<&'a T> { + 80002fe8: 7179 addi sp,sp,-48 + 80002fea: f406 sd ra,40(sp) + 80002fec: e42a sd a0,8(sp) + 80002fee: f02a sd a0,32(sp) + // SAFETY: the caller must guarantee that `self` is valid + // for a reference if it isn't null. + if self.is_null() { None } else { unsafe { Some(&*self) } } + 80002ff0: 00000097 auipc ra,0x0 + 80002ff4: 02a080e7 jalr 42(ra) # 8000301a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17hb09234d1bdc9d8a1E> + 80002ff8: e82a sd a0,16(sp) + 80002ffa: a009 j 80002ffc <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E+0x14> + 80002ffc: 6542 ld a0,16(sp) + 80002ffe: 4581 li a1,0 + 80003000: 00b50663 beq a0,a1,8000300c <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E+0x24> + 80003004: a009 j 80003006 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E+0x1e> + 80003006: 4501 li a0,0 + 80003008: ec2a sd a0,24(sp) + 8000300a: a021 j 80003012 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E+0x2a> + 8000300c: 6522 ld a0,8(sp) + 8000300e: ec2a sd a0,24(sp) + 80003010: a009 j 80003012 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E+0x2a> + } + 80003012: 6562 ld a0,24(sp) + 80003014: 70a2 ld ra,40(sp) + 80003016: 6145 addi sp,sp,48 + 80003018: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17hb09234d1bdc9d8a1E: + +000000008000301a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17hb09234d1bdc9d8a1E>: + pub const fn is_null(self) -> bool { + 8000301a: 1101 addi sp,sp,-32 + 8000301c: ec06 sd ra,24(sp) + 8000301e: e82a sd a0,16(sp) + (self as *const u8).guaranteed_eq(null()) + 80003020: e42a sd a0,8(sp) + 80003022: a009 j 80003024 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17hb09234d1bdc9d8a1E+0xa> + 80003024: 6522 ld a0,8(sp) + 80003026: 4581 li a1,0 + 80003028: 00020097 auipc ra,0x20 + 8000302c: efc080e7 jalr -260(ra) # 80022f24 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17h0ce622e77376dc6cE> + 80003030: e02a sd a0,0(sp) + 80003032: a009 j 80003034 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17hb09234d1bdc9d8a1E+0x1a> + } + 80003034: 6502 ld a0,0(sp) + 80003036: 60e2 ld ra,24(sp) + 80003038: 6105 addi sp,sp,32 + 8000303a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE: + +000000008000303c <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE>: + } + } + + /// Init the bcache. + /// Should only be called once when the kernel inits itself. + pub fn binit(&self) { + 8000303c: 7125 addi sp,sp,-416 + 8000303e: ef06 sd ra,408(sp) + 80003040: faaa sd a0,368(sp) + let mut ctrl = self.ctrl.acquire(); + 80003042: 0000e097 auipc ra,0xe + 80003046: d60080e7 jalr -672(ra) # 80010da2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE> + 8000304a: f22a sd a0,288(sp) + 8000304c: a009 j 8000304e <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x12> + 8000304e: 1208 addi a0,sp,288 + let len = ctrl.inner.len(); + 80003050: 0000f097 auipc ra,0xf + 80003054: d0e080e7 jalr -754(ra) # 80011d5e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hc8a5a3c7c4ffa947E> + 80003058: ee2a sd a0,280(sp) + 8000305a: a009 j 8000305c <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x20> + 8000305c: 6572 ld a0,280(sp) + 8000305e: 45f9 li a1,30 + 80003060: 00002097 auipc ra,0x2 + 80003064: 756080e7 jalr 1878(ra) # 800057b6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h0b5a743241a7cbfaE> + 80003068: 85aa mv a1,a0 + 8000306a: ea2e sd a1,272(sp) + 8000306c: feaa sd a0,376(sp) + 8000306e: a009 j 80003070 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x34> + 80003070: 1208 addi a0,sp,288 + + // init the head and tail of the lru list + ctrl.head = &mut ctrl.inner[0]; + 80003072: 0000f097 auipc ra,0xf + 80003076: daa080e7 jalr -598(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000307a: e62a sd a0,264(sp) + 8000307c: a009 j 8000307e <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x42> + 8000307e: 6532 ld a0,264(sp) + 80003080: fdaa sd a0,248(sp) + 80003082: 1208 addi a0,sp,288 + 80003084: 0000f097 auipc ra,0xf + 80003088: d98080e7 jalr -616(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000308c: e22a sd a0,256(sp) + 8000308e: a009 j 80003090 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x54> + 80003090: 756e ld a0,248(sp) + 80003092: 6592 ld a1,256(sp) + 80003094: 4aa5b823 sd a0,1200(a1) + 80003098: 1208 addi a0,sp,288 + ctrl.tail = &mut ctrl.inner[len-1]; + 8000309a: 0000f097 auipc ra,0xf + 8000309e: d82080e7 jalr -638(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 800030a2: f9aa sd a0,240(sp) + 800030a4: a009 j 800030a6 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x6a> + 800030a6: 6552 ld a0,272(sp) + 800030a8: fff50593 addi a1,a0,-1 + 800030ac: f5ae sd a1,232(sp) + 800030ae: 28b56263 bltu a0,a1,80003332 <.LBB0_62> + 800030b2: a009 j 800030b4 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x78> + 800030b4: 75ae ld a1,232(sp) + 800030b6: 4575 li a0,29 + 800030b8: 28b56c63 bltu a0,a1,80003350 <.LBB0_63+0x16> + 800030bc: a009 j 800030be <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x82> + 800030be: 754e ld a0,240(sp) + 800030c0: 75ae ld a1,232(sp) + 800030c2: 02800613 li a2,40 + 800030c6: 02c585b3 mul a1,a1,a2 + 800030ca: 952e add a0,a0,a1 + 800030cc: edaa sd a0,216(sp) + 800030ce: 1208 addi a0,sp,288 + 800030d0: 0000f097 auipc ra,0xf + 800030d4: d4c080e7 jalr -692(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 800030d8: f1aa sd a0,224(sp) + 800030da: a009 j 800030dc <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0xa0> + 800030dc: 656e ld a0,216(sp) + 800030de: 758e ld a1,224(sp) + 800030e0: 4aa5bc23 sd a0,1208(a1) + + // init prev and next field + ctrl.inner[0].prev = ptr::null_mut(); + 800030e4: a009 j 800030e6 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0xaa> + 800030e6: 1208 addi a0,sp,288 + 800030e8: 0000f097 auipc ra,0xf + 800030ec: d34080e7 jalr -716(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 800030f0: e9aa sd a0,208(sp) + 800030f2: a009 j 800030f4 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0xb8> + 800030f4: 65ce ld a1,208(sp) + 800030f6: 4501 li a0,0 + 800030f8: e188 sd a0,0(a1) + 800030fa: 1208 addi a0,sp,288 + ctrl.inner[0].next = &mut ctrl.inner[1]; + 800030fc: 0000f097 auipc ra,0xf + 80003100: d20080e7 jalr -736(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 80003104: e5aa sd a0,200(sp) + 80003106: a009 j 80003108 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0xcc> + 80003108: 652e ld a0,200(sp) + 8000310a: 02850513 addi a0,a0,40 + 8000310e: fd2a sd a0,184(sp) + 80003110: 1208 addi a0,sp,288 + 80003112: 0000f097 auipc ra,0xf + 80003116: d0a080e7 jalr -758(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000311a: e1aa sd a0,192(sp) + 8000311c: a009 j 8000311e <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0xe2> + 8000311e: 756a ld a0,184(sp) + 80003120: 658e ld a1,192(sp) + 80003122: e588 sd a0,8(a1) + 80003124: 1208 addi a0,sp,288 + ctrl.inner[len-1].prev = &mut ctrl.inner[len-2]; + 80003126: 0000f097 auipc ra,0xf + 8000312a: cf6080e7 jalr -778(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000312e: f92a sd a0,176(sp) + 80003130: a009 j 80003132 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0xf6> + 80003132: 6552 ld a0,272(sp) + 80003134: ffe50593 addi a1,a0,-2 + 80003138: f52e sd a1,168(sp) + 8000313a: 22b56663 bltu a0,a1,80003366 <.LBB0_65> + 8000313e: a009 j 80003140 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x104> + 80003140: 75aa ld a1,168(sp) + 80003142: 4575 li a0,29 + 80003144: 24b56063 bltu a0,a1,80003384 <.LBB0_66+0x16> + 80003148: a009 j 8000314a <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x10e> + 8000314a: 754a ld a0,176(sp) + 8000314c: 75aa ld a1,168(sp) + 8000314e: 02800613 li a2,40 + 80003152: 02c585b3 mul a1,a1,a2 + 80003156: 952e add a0,a0,a1 + 80003158: ed2a sd a0,152(sp) + 8000315a: 1208 addi a0,sp,288 + 8000315c: 0000f097 auipc ra,0xf + 80003160: cc0080e7 jalr -832(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 80003164: f12a sd a0,160(sp) + 80003166: a009 j 80003168 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x12c> + 80003168: 6552 ld a0,272(sp) + 8000316a: fff50593 addi a1,a0,-1 + 8000316e: e92e sd a1,144(sp) + 80003170: 22b56563 bltu a0,a1,8000339a <.LBB0_68> + 80003174: a009 j 80003176 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x13a> + 80003176: 65ca ld a1,144(sp) + 80003178: 4575 li a0,29 + 8000317a: 22b56f63 bltu a0,a1,800033b8 <.LBB0_69+0x16> + 8000317e: a009 j 80003180 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x144> + 80003180: 656a ld a0,152(sp) + 80003182: 758a ld a1,160(sp) + 80003184: 664a ld a2,144(sp) + 80003186: 02800693 li a3,40 + 8000318a: 02d60633 mul a2,a2,a3 + 8000318e: 95b2 add a1,a1,a2 + 80003190: e188 sd a0,0(a1) + ctrl.inner[len-1].next = ptr::null_mut(); + 80003192: a009 j 80003194 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x158> + 80003194: 1208 addi a0,sp,288 + 80003196: 0000f097 auipc ra,0xf + 8000319a: c86080e7 jalr -890(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000319e: e52a sd a0,136(sp) + 800031a0: a009 j 800031a2 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x166> + 800031a2: 6552 ld a0,272(sp) + 800031a4: fff50593 addi a1,a0,-1 + 800031a8: e12e sd a1,128(sp) + 800031aa: 22b56263 bltu a0,a1,800033ce <.LBB0_71> + 800031ae: a009 j 800031b0 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x174> + 800031b0: 658a ld a1,128(sp) + 800031b2: 4575 li a0,29 + 800031b4: 22b56c63 bltu a0,a1,800033ec <.LBB0_72+0x16> + 800031b8: a009 j 800031ba <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x17e> + 800031ba: 6552 ld a0,272(sp) + 800031bc: 65aa ld a1,136(sp) + 800031be: 660a ld a2,128(sp) + 800031c0: 02800693 li a3,40 + 800031c4: 02d60633 mul a2,a2,a3 + 800031c8: 962e add a2,a2,a1 + 800031ca: 4581 li a1,0 + 800031cc: e60c sd a1,8(a2) + for i in 1..(len-1) { + 800031ce: fff50593 addi a1,a0,-1 + 800031d2: fcae sd a1,120(sp) + 800031d4: 22b56763 bltu a0,a1,80003402 <.LBB0_74> + 800031d8: a009 j 800031da <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x19e> + 800031da: 75e6 ld a1,120(sp) + 800031dc: 4505 li a0,1 + 800031de: f62a sd a0,296(sp) + 800031e0: fa2e sd a1,304(sp) + 800031e2: 0001d097 auipc ra,0x1d + 800031e6: 62e080e7 jalr 1582(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 800031ea: f4aa sd a0,104(sp) + 800031ec: f8ae sd a1,112(sp) + 800031ee: a009 j 800031f0 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x1b4> + 800031f0: 7546 ld a0,112(sp) + 800031f2: 75a6 ld a1,104(sp) + 800031f4: fe2e sd a1,312(sp) + 800031f6: e2aa sd a0,320(sp) + 800031f8: a009 j 800031fa <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x1be> + 800031fa: 1a28 addi a0,sp,312 + 800031fc: 0001d097 auipc ra,0x1d + 80003200: 5a6080e7 jalr 1446(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80003204: e6aa sd a0,328(sp) + 80003206: eaae sd a1,336(sp) + 80003208: a009 j 8000320a <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x1ce> + 8000320a: 6536 ld a0,328(sp) + 8000320c: 4581 li a1,0 + 8000320e: 00b50463 beq a0,a1,80003216 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x1da> + 80003212: a009 j 80003214 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x1d8> + 80003214: a809 j 80003226 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x1ea> + 80003216: 1208 addi a0,sp,288 + ctrl.inner[i].prev = &mut ctrl.inner[i-1]; + ctrl.inner[i].next = &mut ctrl.inner[i+1]; + } + + // init index + ctrl.inner.iter_mut() + 80003218: 0000f097 auipc ra,0xf + 8000321c: c04080e7 jalr -1020(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 80003220: f0aa sd a0,96(sp) + 80003222: a8c1 j 800032f2 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x2b6> + for i in 1..(len-1) { + 80003224: 0000 unimp + 80003226: 6556 ld a0,336(sp) + 80003228: e8aa sd a0,80(sp) + 8000322a: e32a sd a0,384(sp) + 8000322c: e72a sd a0,392(sp) + 8000322e: eb2a sd a0,400(sp) + 80003230: 1208 addi a0,sp,288 + ctrl.inner[i].prev = &mut ctrl.inner[i-1]; + 80003232: 0000f097 auipc ra,0xf + 80003236: bea080e7 jalr -1046(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000323a: ecaa sd a0,88(sp) + 8000323c: a009 j 8000323e <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x202> + 8000323e: 6546 ld a0,80(sp) + 80003240: fff50593 addi a1,a0,-1 + 80003244: e4ae sd a1,72(sp) + 80003246: 1cb56d63 bltu a0,a1,80003420 <.LBB0_76> + 8000324a: a009 j 8000324c <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x210> + 8000324c: 65a6 ld a1,72(sp) + 8000324e: 4575 li a0,29 + 80003250: 1eb56763 bltu a0,a1,8000343e <.LBB0_77+0x16> + 80003254: a009 j 80003256 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x21a> + 80003256: 6566 ld a0,88(sp) + 80003258: 65a6 ld a1,72(sp) + 8000325a: 02800613 li a2,40 + 8000325e: 02c585b3 mul a1,a1,a2 + 80003262: 952e add a0,a0,a1 + 80003264: fc2a sd a0,56(sp) + 80003266: 1208 addi a0,sp,288 + 80003268: 0000f097 auipc ra,0xf + 8000326c: bb4080e7 jalr -1100(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 80003270: e0aa sd a0,64(sp) + 80003272: a009 j 80003274 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x238> + 80003274: 65c6 ld a1,80(sp) + 80003276: 4575 li a0,29 + 80003278: 1cb56e63 bltu a0,a1,80003454 <.LBB0_78+0x14> + 8000327c: a009 j 8000327e <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x242> + 8000327e: 7562 ld a0,56(sp) + 80003280: 6586 ld a1,64(sp) + 80003282: 6646 ld a2,80(sp) + 80003284: 02800693 li a3,40 + 80003288: 02d60633 mul a2,a2,a3 + 8000328c: 95b2 add a1,a1,a2 + 8000328e: e188 sd a0,0(a1) + 80003290: 1208 addi a0,sp,288 + ctrl.inner[i].next = &mut ctrl.inner[i+1]; + 80003292: 0000f097 auipc ra,0xf + 80003296: b8a080e7 jalr -1142(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000329a: f82a sd a0,48(sp) + 8000329c: a009 j 8000329e <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x262> + 8000329e: 65c6 ld a1,80(sp) + 800032a0: 00158513 addi a0,a1,1 + 800032a4: f42a sd a0,40(sp) + 800032a6: 1cb56263 bltu a0,a1,8000346a <.LBB0_80> + 800032aa: a009 j 800032ac <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x270> + 800032ac: 75a2 ld a1,40(sp) + 800032ae: 4575 li a0,29 + 800032b0: 1cb56b63 bltu a0,a1,80003486 <.LBB0_81+0x14> + 800032b4: a009 j 800032b6 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x27a> + 800032b6: 7542 ld a0,48(sp) + 800032b8: 75a2 ld a1,40(sp) + 800032ba: 02800613 li a2,40 + 800032be: 02c585b3 mul a1,a1,a2 + 800032c2: 952e add a0,a0,a1 + 800032c4: ec2a sd a0,24(sp) + 800032c6: 1208 addi a0,sp,288 + 800032c8: 0000f097 auipc ra,0xf + 800032cc: b54080e7 jalr -1196(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 800032d0: f02a sd a0,32(sp) + 800032d2: a009 j 800032d4 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x298> + 800032d4: 65c6 ld a1,80(sp) + 800032d6: 4575 li a0,29 + 800032d8: 1cb56263 bltu a0,a1,8000349c <.LBB0_82+0x14> + 800032dc: a009 j 800032de <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x2a2> + 800032de: 6562 ld a0,24(sp) + 800032e0: 7582 ld a1,32(sp) + 800032e2: 6646 ld a2,80(sp) + 800032e4: 02800693 li a3,40 + 800032e8: 02d60633 mul a2,a2,a3 + 800032ec: 95b2 add a1,a1,a2 + 800032ee: e588 sd a0,8(a1) + for i in 1..(len-1) { + 800032f0: b729 j 800031fa <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x1be> + ctrl.inner.iter_mut() + 800032f2: 7506 ld a0,96(sp) + 800032f4: 45f9 li a1,30 + 800032f6: 00002097 auipc ra,0x2 + 800032fa: 4d4080e7 jalr 1236(ra) # 800057ca <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h56877d4d8de3d254E> + 800032fe: e42a sd a0,8(sp) + 80003300: e82e sd a1,16(sp) + 80003302: a009 j 80003304 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x2c8> + 80003304: 6642 ld a2,16(sp) + 80003306: 65a2 ld a1,8(sp) + 80003308: 0aa8 addi a0,sp,344 + 8000330a: 00008097 auipc ra,0x8 + 8000330e: 0f2080e7 jalr 242(ra) # 8000b3fc <_ZN4core4iter6traits8iterator8Iterator9enumerate17h42a569d91d49dc41E> + 80003312: a009 j 80003314 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x2d8> + 80003314: 0aa8 addi a0,sp,344 + 80003316: 00010097 auipc ra,0x10 + 8000331a: 810080e7 jalr -2032(ra) # 80012b26 <_ZN4core4iter6traits8iterator8Iterator8for_each17hc49183b8c223967eE> + 8000331e: a009 j 80003320 <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x2e4> + 80003320: 1208 addi a0,sp,288 + .enumerate() + .for_each(|(i, b)| b.index = i); + } + 80003322: 00004097 auipc ra,0x4 + 80003326: eb2080e7 jalr -334(ra) # 800071d4 <_ZN4core3ptr89drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..bio..BufLru$GT$$GT$17h9c86fb58887d325bE> + 8000332a: a009 j 8000332c <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE+0x2f0> + 8000332c: 60fa ld ra,408(sp) + 8000332e: 611d addi sp,sp,416 + 80003330: 8082 ret + +0000000080003332 <.LBB0_62>: + ctrl.tail = &mut ctrl.inner[len-1]; + 80003332: 00023517 auipc a0,0x23 + 80003336: 7ce50513 addi a0,a0,1998 # 80026b00 + +000000008000333a <.LBB0_63>: + 8000333a: 00023617 auipc a2,0x23 + 8000333e: 7a660613 addi a2,a2,1958 # 80026ae0 <.L__unnamed_1> + 80003342: 02100593 li a1,33 + 80003346: 00020097 auipc ra,0x20 + 8000334a: dfe080e7 jalr -514(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000334e: 0000 unimp + 80003350: 752e ld a0,232(sp) + +0000000080003352 <.LBB0_64>: + 80003352: 00023617 auipc a2,0x23 + 80003356: 7d660613 addi a2,a2,2006 # 80026b28 <.L__unnamed_2> + 8000335a: 45f9 li a1,30 + 8000335c: 00020097 auipc ra,0x20 + 80003360: e14080e7 jalr -492(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080003366 <.LBB0_65>: + ctrl.inner[len-1].prev = &mut ctrl.inner[len-2]; + 80003366: 00023517 auipc a0,0x23 + 8000336a: 79a50513 addi a0,a0,1946 # 80026b00 + +000000008000336e <.LBB0_66>: + 8000336e: 00023617 auipc a2,0x23 + 80003372: 7d260613 addi a2,a2,2002 # 80026b40 <.L__unnamed_3> + 80003376: 02100593 li a1,33 + 8000337a: 00020097 auipc ra,0x20 + 8000337e: dca080e7 jalr -566(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80003382: 0000 unimp + 80003384: 752a ld a0,168(sp) + +0000000080003386 <.LBB0_67>: + 80003386: 00023617 auipc a2,0x23 + 8000338a: 7d260613 addi a2,a2,2002 # 80026b58 <.L__unnamed_4> + 8000338e: 45f9 li a1,30 + 80003390: 00020097 auipc ra,0x20 + 80003394: de0080e7 jalr -544(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000339a <.LBB0_68>: + 8000339a: 00023517 auipc a0,0x23 + 8000339e: 76650513 addi a0,a0,1894 # 80026b00 + +00000000800033a2 <.LBB0_69>: + 800033a2: 00023617 auipc a2,0x23 + 800033a6: 7ce60613 addi a2,a2,1998 # 80026b70 <.L__unnamed_5> + 800033aa: 02100593 li a1,33 + 800033ae: 00020097 auipc ra,0x20 + 800033b2: d96080e7 jalr -618(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800033b6: 0000 unimp + 800033b8: 654a ld a0,144(sp) + +00000000800033ba <.LBB0_70>: + 800033ba: 00023617 auipc a2,0x23 + 800033be: 7ce60613 addi a2,a2,1998 # 80026b88 <.L__unnamed_6> + 800033c2: 45f9 li a1,30 + 800033c4: 00020097 auipc ra,0x20 + 800033c8: dac080e7 jalr -596(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +00000000800033ce <.LBB0_71>: + ctrl.inner[len-1].next = ptr::null_mut(); + 800033ce: 00023517 auipc a0,0x23 + 800033d2: 73250513 addi a0,a0,1842 # 80026b00 + +00000000800033d6 <.LBB0_72>: + 800033d6: 00023617 auipc a2,0x23 + 800033da: 7ca60613 addi a2,a2,1994 # 80026ba0 <.L__unnamed_7> + 800033de: 02100593 li a1,33 + 800033e2: 00020097 auipc ra,0x20 + 800033e6: d62080e7 jalr -670(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800033ea: 0000 unimp + 800033ec: 650a ld a0,128(sp) + +00000000800033ee <.LBB0_73>: + 800033ee: 00023617 auipc a2,0x23 + 800033f2: 7ca60613 addi a2,a2,1994 # 80026bb8 <.L__unnamed_8> + 800033f6: 45f9 li a1,30 + 800033f8: 00020097 auipc ra,0x20 + 800033fc: d78080e7 jalr -648(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080003402 <.LBB0_74>: + for i in 1..(len-1) { + 80003402: 00023517 auipc a0,0x23 + 80003406: 6fe50513 addi a0,a0,1790 # 80026b00 + +000000008000340a <.LBB0_75>: + 8000340a: 00023617 auipc a2,0x23 + 8000340e: 7c660613 addi a2,a2,1990 # 80026bd0 <.L__unnamed_9> + 80003412: 02100593 li a1,33 + 80003416: 00020097 auipc ra,0x20 + 8000341a: d2e080e7 jalr -722(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080003420 <.LBB0_76>: + ctrl.inner[i].prev = &mut ctrl.inner[i-1]; + 80003420: 00023517 auipc a0,0x23 + 80003424: 6e050513 addi a0,a0,1760 # 80026b00 + +0000000080003428 <.LBB0_77>: + 80003428: 00023617 auipc a2,0x23 + 8000342c: 7c060613 addi a2,a2,1984 # 80026be8 <.L__unnamed_10> + 80003430: 02100593 li a1,33 + 80003434: 00020097 auipc ra,0x20 + 80003438: d10080e7 jalr -752(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000343c: 0000 unimp + 8000343e: 6526 ld a0,72(sp) + +0000000080003440 <.LBB0_78>: + 80003440: 00023617 auipc a2,0x23 + 80003444: 7c060613 addi a2,a2,1984 # 80026c00 <.L__unnamed_11> + 80003448: 45f9 li a1,30 + 8000344a: 00020097 auipc ra,0x20 + 8000344e: d26080e7 jalr -730(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80003452: 0000 unimp + 80003454: 6546 ld a0,80(sp) + +0000000080003456 <.LBB0_79>: + 80003456: 00023617 auipc a2,0x23 + 8000345a: 7c260613 addi a2,a2,1986 # 80026c18 <.L__unnamed_12> + 8000345e: 45f9 li a1,30 + 80003460: 00020097 auipc ra,0x20 + 80003464: d10080e7 jalr -752(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000346a <.LBB0_80>: + ctrl.inner[i].next = &mut ctrl.inner[i+1]; + 8000346a: 00023517 auipc a0,0x23 + 8000346e: 7e650513 addi a0,a0,2022 # 80026c50 + +0000000080003472 <.LBB0_81>: + 80003472: 00023617 auipc a2,0x23 + 80003476: 7be60613 addi a2,a2,1982 # 80026c30 <.L__unnamed_13> + 8000347a: 45f1 li a1,28 + 8000347c: 00020097 auipc ra,0x20 + 80003480: cc8080e7 jalr -824(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80003484: 0000 unimp + 80003486: 7522 ld a0,40(sp) + +0000000080003488 <.LBB0_82>: + 80003488: 00023617 auipc a2,0x23 + 8000348c: 7e860613 addi a2,a2,2024 # 80026c70 <.L__unnamed_14> + 80003490: 45f9 li a1,30 + 80003492: 00020097 auipc ra,0x20 + 80003496: cde080e7 jalr -802(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000349a: 0000 unimp + 8000349c: 6546 ld a0,80(sp) + +000000008000349e <.LBB0_83>: + 8000349e: 00023617 auipc a2,0x23 + 800034a2: 7ea60613 addi a2,a2,2026 # 80026c88 <.L__unnamed_15> + 800034a6: 45f9 li a1,30 + 800034a8: 00020097 auipc ra,0x20 + 800034ac: cc8080e7 jalr -824(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE: + +00000000800034b2 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE>: + + fn bget(&self, dev: u32, blockno: u32) -> Buf<'_> { + 800034b2: 716d addi sp,sp,-272 + 800034b4: e606 sd ra,264(sp) + 800034b6: ecae sd a1,88(sp) + 800034b8: 85aa mv a1,a0 + 800034ba: 6566 ld a0,88(sp) + 800034bc: f0ae sd a1,96(sp) + 800034be: 85b6 mv a1,a3 + 800034c0: f4ae sd a1,104(sp) + 800034c2: 85b2 mv a1,a2 + 800034c4: f8ae sd a1,112(sp) + 800034c6: edaa sd a0,216(sp) + 800034c8: d1b2 sw a2,224(sp) + 800034ca: d3b6 sw a3,228(sp) + let mut ctrl = self.ctrl.acquire(); + 800034cc: 0000e097 auipc ra,0xe + 800034d0: 8d6080e7 jalr -1834(ra) # 80010da2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE> + 800034d4: fcaa sd a0,120(sp) + 800034d6: a009 j 800034d8 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x26> + 800034d8: 18a8 addi a0,sp,120 + + // find cached block + match ctrl.find_cached(dev, blockno) { + 800034da: 0000f097 auipc ra,0xf + 800034de: 942080e7 jalr -1726(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 800034e2: e8aa sd a0,80(sp) + 800034e4: a009 j 800034e6 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x34> + 800034e6: 76a6 ld a3,104(sp) + 800034e8: 7646 ld a2,112(sp) + 800034ea: 65c6 ld a1,80(sp) + 800034ec: 0108 addi a0,sp,128 + 800034ee: 00000097 auipc ra,0x0 + 800034f2: 41e080e7 jalr 1054(ra) # 8000390c <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E> + 800034f6: a009 j 800034f8 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x46> + Some((index, rc_ptr)) => { + 800034f8: 650a ld a0,128(sp) + 800034fa: 4581 li a1,0 + 800034fc: 00b50463 beq a0,a1,80003504 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x52> + 80003500: a009 j 80003502 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x50> + 80003502: a809 j 80003514 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x62> + 80003504: 18a8 addi a0,sp,120 + } + } + None => { + // not cached + // recycle the least recently used (LRU) unused buffer + match ctrl.recycle(dev, blockno) { + 80003506: 0000f097 auipc ra,0xf + 8000350a: 916080e7 jalr -1770(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000350e: e4aa sd a0,72(sp) + 80003510: a0ad j 8000357a <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0xc8> + match ctrl.find_cached(dev, blockno) { + 80003512: 0000 unimp + Some((index, rc_ptr)) => { + 80003514: 652a ld a0,136(sp) + 80003516: fc2a sd a0,56(sp) + 80003518: f5aa sd a0,232(sp) + 8000351a: 654a ld a0,144(sp) + 8000351c: e0aa sd a0,64(sp) + 8000351e: f9aa sd a0,240(sp) + drop(ctrl); + 80003520: 7566 ld a0,120(sp) + 80003522: 0001b097 auipc ra,0x1b + 80003526: 968080e7 jalr -1688(ra) # 8001de8a <_ZN4core3mem4drop17h82526bd482ef36a5E> + 8000352a: a009 j 8000352c <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x7a> + 8000352c: 75e2 ld a1,56(sp) + 8000352e: 4575 li a0,29 + data: Some(self.bufs[index].data.lock()) + 80003530: 12b56163 bltu a0,a1,80003652 <.LBB1_27+0xb2> + 80003534: a009 j 80003536 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0x84> + 80003536: 6566 ld a0,88(sp) + 80003538: 75e2 ld a1,56(sp) + 8000353a: 44000613 li a2,1088 + 8000353e: 02c585b3 mul a1,a1,a2 + 80003542: 952e add a0,a0,a1 + 80003544: 4e050513 addi a0,a0,1248 + 80003548: 0001b097 auipc ra,0x1b + 8000354c: d86080e7 jalr -634(ra) # 8001e2ce <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE> + 80003550: f42a sd a0,40(sp) + 80003552: f82e sd a1,48(sp) + 80003554: a009 j 80003556 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0xa4> + 80003556: 7586 ld a1,96(sp) + 80003558: 6506 ld a0,64(sp) + 8000355a: 7626 ld a2,104(sp) + 8000355c: 76c6 ld a3,112(sp) + 8000355e: 7762 ld a4,56(sp) + 80003560: 77c2 ld a5,48(sp) + 80003562: 7822 ld a6,40(sp) + 80003564: ed42 sd a6,152(sp) + 80003566: f13e sd a5,160(sp) + Buf { + 80003568: e198 sd a4,0(a1) + 8000356a: d194 sw a3,32(a1) + 8000356c: d1d0 sw a2,36(a1) + 8000356e: e588 sd a0,8(a1) + 80003570: 666a ld a2,152(sp) + 80003572: 750a ld a0,160(sp) + 80003574: e990 sd a2,16(a1) + 80003576: ed88 sd a0,24(a1) + } + None => panic!("no usable buffer") + } + } + } + } + 80003578: a8d1 j 8000364c <.LBB1_27+0xac> + match ctrl.recycle(dev, blockno) { + 8000357a: 76a6 ld a3,104(sp) + 8000357c: 7646 ld a2,112(sp) + 8000357e: 65a6 ld a1,72(sp) + 80003580: 1128 addi a0,sp,168 + 80003582: 00000097 auipc ra,0x0 + 80003586: 47c080e7 jalr 1148(ra) # 800039fe <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E> + 8000358a: a009 j 8000358c <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0xda> + Some((index, rc_ptr)) => { + 8000358c: 752a ld a0,168(sp) + 8000358e: 4581 li a1,0 + 80003590: 00b50463 beq a0,a1,80003598 <.LBB1_26> + 80003594: a009 j 80003596 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE+0xe4> + 80003596: a005 j 800035b6 <.LBB1_27+0x16> + +0000000080003598 <.LBB1_26>: + None => panic!("no usable buffer") + 80003598: 00023517 auipc a0,0x23 + 8000359c: 16850513 addi a0,a0,360 # 80026700 <.L__unnamed_35+0xc8> + +00000000800035a0 <.LBB1_27>: + 800035a0: 00023617 auipc a2,0x23 + 800035a4: 74860613 addi a2,a2,1864 # 80026ce8 <.L__unnamed_17> + 800035a8: 45c1 li a1,16 + 800035aa: 00020097 auipc ra,0x20 + 800035ae: b9a080e7 jalr -1126(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800035b2: 0000 unimp + match ctrl.recycle(dev, blockno) { + 800035b4: 0000 unimp + Some((index, rc_ptr)) => { + 800035b6: 75ca ld a1,176(sp) + 800035b8: ec2e sd a1,24(sp) + 800035ba: fdae sd a1,248(sp) + 800035bc: 756a ld a0,184(sp) + 800035be: f02a sd a0,32(sp) + 800035c0: e22a sd a0,256(sp) + 800035c2: 4575 li a0,29 + self.bufs[index].valid.store(false, Ordering::Relaxed); + 800035c4: 0ab56263 bltu a0,a1,80003668 <.LBB1_28+0x14> + 800035c8: a009 j 800035ca <.LBB1_27+0x2a> + 800035ca: 6566 ld a0,88(sp) + 800035cc: 65e2 ld a1,24(sp) + 800035ce: 44000613 li a2,1088 + 800035d2: 02c585b3 mul a1,a1,a2 + 800035d6: 952e add a0,a0,a1 + 800035d8: 48c50513 addi a0,a0,1164 + 800035dc: 48c50513 addi a0,a0,1164 + 800035e0: 4601 li a2,0 + 800035e2: 0cc103a3 sb a2,199(sp) + 800035e6: 85b2 mv a1,a2 + 800035e8: 00001097 auipc ra,0x1 + 800035ec: 19c080e7 jalr 412(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 800035f0: a009 j 800035f2 <.LBB1_27+0x52> + drop(ctrl); + 800035f2: 7566 ld a0,120(sp) + 800035f4: 0001b097 auipc ra,0x1b + 800035f8: 896080e7 jalr -1898(ra) # 8001de8a <_ZN4core3mem4drop17h82526bd482ef36a5E> + 800035fc: a009 j 800035fe <.LBB1_27+0x5e> + 800035fe: 65e2 ld a1,24(sp) + 80003600: 4575 li a0,29 + data: Some(self.bufs[index].data.lock()), + 80003602: 06b56e63 bltu a0,a1,8000367e <.LBB1_29+0x14> + 80003606: a009 j 80003608 <.LBB1_27+0x68> + 80003608: 6566 ld a0,88(sp) + 8000360a: 65e2 ld a1,24(sp) + 8000360c: 44000613 li a2,1088 + 80003610: 02c585b3 mul a1,a1,a2 + 80003614: 952e add a0,a0,a1 + 80003616: 4e050513 addi a0,a0,1248 + 8000361a: 0001b097 auipc ra,0x1b + 8000361e: cb4080e7 jalr -844(ra) # 8001e2ce <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE> + 80003622: e42a sd a0,8(sp) + 80003624: e82e sd a1,16(sp) + 80003626: a009 j 80003628 <.LBB1_27+0x88> + 80003628: 7586 ld a1,96(sp) + 8000362a: 7502 ld a0,32(sp) + 8000362c: 7626 ld a2,104(sp) + 8000362e: 76c6 ld a3,112(sp) + 80003630: 6762 ld a4,24(sp) + 80003632: 67c2 ld a5,16(sp) + 80003634: 6822 ld a6,8(sp) + 80003636: e5c2 sd a6,200(sp) + 80003638: e9be sd a5,208(sp) + return Buf { + 8000363a: e198 sd a4,0(a1) + 8000363c: d194 sw a3,32(a1) + 8000363e: d1d0 sw a2,36(a1) + 80003640: e588 sd a0,8(a1) + 80003642: 662e ld a2,200(sp) + 80003644: 654e ld a0,208(sp) + 80003646: e990 sd a2,16(a1) + 80003648: ed88 sd a0,24(a1) + } + 8000364a: a009 j 8000364c <.LBB1_27+0xac> + 8000364c: 60b2 ld ra,264(sp) + 8000364e: 6151 addi sp,sp,272 + 80003650: 8082 ret + data: Some(self.bufs[index].data.lock()) + 80003652: 7562 ld a0,56(sp) + +0000000080003654 <.LBB1_28>: + 80003654: 00023617 auipc a2,0x23 + 80003658: 64c60613 addi a2,a2,1612 # 80026ca0 <.L__unnamed_18> + 8000365c: 45f9 li a1,30 + 8000365e: 00020097 auipc ra,0x20 + 80003662: b12080e7 jalr -1262(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80003666: 0000 unimp + self.bufs[index].valid.store(false, Ordering::Relaxed); + 80003668: 6562 ld a0,24(sp) + +000000008000366a <.LBB1_29>: + 8000366a: 00023617 auipc a2,0x23 + 8000366e: 64e60613 addi a2,a2,1614 # 80026cb8 <.L__unnamed_19> + 80003672: 45f9 li a1,30 + 80003674: 00020097 auipc ra,0x20 + 80003678: afc080e7 jalr -1284(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000367c: 0000 unimp + data: Some(self.bufs[index].data.lock()), + 8000367e: 6562 ld a0,24(sp) + +0000000080003680 <.LBB1_30>: + 80003680: 00023617 auipc a2,0x23 + 80003684: 65060613 addi a2,a2,1616 # 80026cd0 <.L__unnamed_20> + 80003688: 45f9 li a1,30 + 8000368a: 00020097 auipc ra,0x20 + 8000368e: ae6080e7 jalr -1306(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE: + +0000000080003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE>: + + /// Get the buf from the cache/disk + pub fn bread<'a>(&'a self, dev: u32, blockno: u32) -> Buf<'a> { + 80003694: 715d addi sp,sp,-80 + let mut b = self.bget(dev, blockno); + 80003696: e486 sd ra,72(sp) + 80003698: f02e sd a1,32(sp) + 8000369a: f42a sd a0,40(sp) + 8000369c: fc2e sd a1,56(sp) + 8000369e: c0b2 sw a2,64(sp) + 800036a0: c2b6 sw a3,68(sp) + 800036a2: 00000097 auipc ra,0x0 + 800036a6: e10080e7 jalr -496(ra) # 800034b2 <_ZN6kernel2fs3bio6Bcache4bget17h5f7e8a4c3a341a1bE> + 800036aa: a009 j 800036ac <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE+0x18> + if !self.bufs[b.index].valid.load(Ordering::Relaxed) { + 800036ac: 7522 ld a0,40(sp) + 800036ae: 610c ld a1,0(a0) + 800036b0: ec2e sd a1,24(sp) + 800036b2: 4575 li a0,29 + 800036b4: 08b56563 bltu a0,a1,8000373e <.LBB2_12+0x54> + 800036b8: a009 j 800036ba <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE+0x26> + 800036ba: 7502 ld a0,32(sp) + 800036bc: 65e2 ld a1,24(sp) + 800036be: 44000613 li a2,1088 + 800036c2: 02c585b3 mul a1,a1,a2 + 800036c6: 952e add a0,a0,a1 + 800036c8: 48c50513 addi a0,a0,1164 + 800036cc: 48c50513 addi a0,a0,1164 + 800036d0: 4581 li a1,0 + 800036d2: 02b10b23 sb a1,54(sp) + 800036d6: 00001097 auipc ra,0x1 + 800036da: 030080e7 jalr 48(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 800036de: e82a sd a0,16(sp) + 800036e0: a009 j 800036e2 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE+0x4e> + 800036e2: 6542 ld a0,16(sp) + 800036e4: ed09 bnez a0,800036fe <.LBB2_12+0x14> + 800036e6: a009 j 800036e8 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE+0x54> + DISK.rw(&mut b, false); + 800036e8: 75a2 ld a1,40(sp) + +00000000800036ea <.LBB2_12>: + 800036ea: 0005c517 auipc a0,0x5c + 800036ee: 91650513 addi a0,a0,-1770 # 8005f000 <_ZN6kernel6driver11virtio_disk4DISK17h9e8917083150b34aE> + 800036f2: 4601 li a2,0 + 800036f4: 00006097 auipc ra,0x6 + 800036f8: 486080e7 jalr 1158(ra) # 80009b7a <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E> + 800036fc: a011 j 80003700 <.LBB2_12+0x16> + if !self.bufs[b.index].valid.load(Ordering::Relaxed) { + 800036fe: a82d j 80003738 <.LBB2_12+0x4e> + self.bufs[b.index].valid.store(true, Ordering::Relaxed); + 80003700: 7522 ld a0,40(sp) + 80003702: 610c ld a1,0(a0) + 80003704: e42e sd a1,8(sp) + 80003706: 4575 li a0,29 + 80003708: 04b56663 bltu a0,a1,80003754 <.LBB2_13+0x14> + 8000370c: a009 j 8000370e <.LBB2_12+0x24> + 8000370e: 7502 ld a0,32(sp) + 80003710: 65a2 ld a1,8(sp) + 80003712: 44000613 li a2,1088 + 80003716: 02c585b3 mul a1,a1,a2 + 8000371a: 952e add a0,a0,a1 + 8000371c: 48c50513 addi a0,a0,1164 + 80003720: 48c50513 addi a0,a0,1164 + 80003724: 4601 li a2,0 + 80003726: 02c10ba3 sb a2,55(sp) + 8000372a: 4585 li a1,1 + 8000372c: 00001097 auipc ra,0x1 + 80003730: 058080e7 jalr 88(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 80003734: a009 j 80003736 <.LBB2_12+0x4c> + if !self.bufs[b.index].valid.load(Ordering::Relaxed) { + 80003736: a009 j 80003738 <.LBB2_12+0x4e> + } + b + } + 80003738: 60a6 ld ra,72(sp) + 8000373a: 6161 addi sp,sp,80 + 8000373c: 8082 ret + if !self.bufs[b.index].valid.load(Ordering::Relaxed) { + 8000373e: 6562 ld a0,24(sp) + +0000000080003740 <.LBB2_13>: + 80003740: 00023617 auipc a2,0x23 + 80003744: 5c060613 addi a2,a2,1472 # 80026d00 <.L__unnamed_21> + 80003748: 45f9 li a1,30 + 8000374a: 00020097 auipc ra,0x20 + 8000374e: a26080e7 jalr -1498(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80003752: 0000 unimp + self.bufs[b.index].valid.store(true, Ordering::Relaxed); + 80003754: 6522 ld a0,8(sp) + +0000000080003756 <.LBB2_14>: + 80003756: 00023617 auipc a2,0x23 + 8000375a: 5c260613 addi a2,a2,1474 # 80026d18 <.L__unnamed_22> + 8000375e: 45f9 li a1,30 + 80003760: 00020097 auipc ra,0x20 + 80003764: a10080e7 jalr -1520(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs3bio6Bcache6brelse17hc59c97ea45d16b39E: + +000000008000376a <_ZN6kernel2fs3bio6Bcache6brelse17hc59c97ea45d16b39E>: + + /// Move an unlocked buf to the head of the most-recently-used list. + fn brelse(&self, index: usize) { + 8000376a: 7179 addi sp,sp,-48 + 8000376c: f406 sd ra,40(sp) + 8000376e: e42e sd a1,8(sp) + 80003770: ec2a sd a0,24(sp) + 80003772: f02e sd a1,32(sp) + self.ctrl.acquire().move_if_no_ref(index); + 80003774: 0000d097 auipc ra,0xd + 80003778: 62e080e7 jalr 1582(ra) # 80010da2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE> + 8000377c: e82a sd a0,16(sp) + 8000377e: a009 j 80003780 <_ZN6kernel2fs3bio6Bcache6brelse17hc59c97ea45d16b39E+0x16> + 80003780: 0808 addi a0,sp,16 + 80003782: 0000e097 auipc ra,0xe + 80003786: 69a080e7 jalr 1690(ra) # 80011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE> + 8000378a: e02a sd a0,0(sp) + 8000378c: a009 j 8000378e <_ZN6kernel2fs3bio6Bcache6brelse17hc59c97ea45d16b39E+0x24> + 8000378e: 65a2 ld a1,8(sp) + 80003790: 6502 ld a0,0(sp) + 80003792: 00000097 auipc ra,0x0 + 80003796: 338080e7 jalr 824(ra) # 80003aca <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE> + 8000379a: a009 j 8000379c <_ZN6kernel2fs3bio6Bcache6brelse17hc59c97ea45d16b39E+0x32> + 8000379c: 0808 addi a0,sp,16 + 8000379e: 00004097 auipc ra,0x4 + 800037a2: a36080e7 jalr -1482(ra) # 800071d4 <_ZN4core3ptr89drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..bio..BufLru$GT$$GT$17h9c86fb58887d325bE> + 800037a6: a009 j 800037a8 <_ZN6kernel2fs3bio6Bcache6brelse17hc59c97ea45d16b39E+0x3e> + } + 800037a8: 70a2 ld ra,40(sp) + 800037aa: 6145 addi sp,sp,48 + 800037ac: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio3Buf12read_blockno17ha2cb61f265147e82E: + +00000000800037ae <_ZN6kernel2fs3bio3Buf12read_blockno17ha2cb61f265147e82E>: + /// Introduced to let the sleeplock guard drop before the whole struct. + data: Option>, +} + +impl<'a> Buf<'a> { + pub fn read_blockno(&self) -> u32 { + 800037ae: 1141 addi sp,sp,-16 + 800037b0: e42a sd a0,8(sp) + self.blockno + } + 800037b2: 5148 lw a0,36(a0) + 800037b4: 0141 addi sp,sp,16 + 800037b6: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio3Buf6bwrite17hec751387ebedcc62E: + +00000000800037b8 <_ZN6kernel2fs3bio3Buf6bwrite17hec751387ebedcc62E>: + + pub fn bwrite(&mut self) { + 800037b8: 1141 addi sp,sp,-16 + 800037ba: e406 sd ra,8(sp) + 800037bc: 85aa mv a1,a0 + 800037be: e02e sd a1,0(sp) + +00000000800037c0 <.LBB5_2>: + DISK.rw(self, true); + 800037c0: 0005c517 auipc a0,0x5c + 800037c4: 84050513 addi a0,a0,-1984 # 8005f000 <_ZN6kernel6driver11virtio_disk4DISK17h9e8917083150b34aE> + 800037c8: 4605 li a2,1 + 800037ca: 00006097 auipc ra,0x6 + 800037ce: 3b0080e7 jalr 944(ra) # 80009b7a <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E> + 800037d2: a009 j 800037d4 <.LBB5_2+0x14> + } + 800037d4: 60a2 ld ra,8(sp) + 800037d6: 0141 addi sp,sp,16 + 800037d8: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E: + +00000000800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E>: + + /// Gives out a raw const pointer at the buf data. + pub fn raw_data(&self) -> *const BufData { + 800037da: 7179 addi sp,sp,-48 + 800037dc: f406 sd ra,40(sp) + 800037de: ec2a sd a0,24(sp) + let guard = self.data.as_ref().unwrap(); + 800037e0: 0541 addi a0,a0,16 + 800037e2: 0000c097 auipc ra,0xc + 800037e6: bec080e7 jalr -1044(ra) # 8000f3ce <_ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E> + 800037ea: e82a sd a0,16(sp) + 800037ec: a009 j 800037ee <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E+0x14> + 800037ee: 6542 ld a0,16(sp) + +00000000800037f0 <.LBB6_4>: + 800037f0: 00023597 auipc a1,0x23 + 800037f4: 54058593 addi a1,a1,1344 # 80026d30 <.L__unnamed_23> + 800037f8: 0000c097 auipc ra,0xc + 800037fc: de6080e7 jalr -538(ra) # 8000f5de <_ZN4core6option15Option$LT$T$GT$6unwrap17h5e7c29d7de25e54aE> + 80003800: 85aa mv a1,a0 + 80003802: e42e sd a1,8(sp) + 80003804: f02a sd a0,32(sp) + 80003806: a009 j 80003808 <.LBB6_4+0x18> + guard.deref() + 80003808: 6522 ld a0,8(sp) + 8000380a: 0001b097 auipc ra,0x1b + 8000380e: c7e080e7 jalr -898(ra) # 8001e488 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17he0c0fee5a6939b40E> + 80003812: e02a sd a0,0(sp) + 80003814: a009 j 80003816 <.LBB6_4+0x26> + } + 80003816: 6502 ld a0,0(sp) + 80003818: 70a2 ld ra,40(sp) + 8000381a: 6145 addi sp,sp,48 + 8000381c: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE: + +000000008000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE>: + + /// Gives out a raw mut pointer at the buf data. + pub fn raw_data_mut(&mut self) -> *mut BufData { + 8000381e: 7179 addi sp,sp,-48 + 80003820: f406 sd ra,40(sp) + 80003822: ec2a sd a0,24(sp) + let guard = self.data.as_mut().unwrap(); + 80003824: 0541 addi a0,a0,16 + 80003826: 0000c097 auipc ra,0xc + 8000382a: afc080e7 jalr -1284(ra) # 8000f322 <_ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E> + 8000382e: e82a sd a0,16(sp) + 80003830: a009 j 80003832 <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE+0x14> + 80003832: 6542 ld a0,16(sp) + +0000000080003834 <.LBB7_4>: + 80003834: 00023597 auipc a1,0x23 + 80003838: 51458593 addi a1,a1,1300 # 80026d48 <.L__unnamed_24> + 8000383c: 0000c097 auipc ra,0xc + 80003840: fbe080e7 jalr -66(ra) # 8000f7fa <_ZN4core6option15Option$LT$T$GT$6unwrap17heec1a84bcf97bc0fE> + 80003844: 85aa mv a1,a0 + 80003846: e42e sd a1,8(sp) + 80003848: f02a sd a0,32(sp) + 8000384a: a009 j 8000384c <.LBB7_4+0x18> + guard.deref_mut() + 8000384c: 6522 ld a0,8(sp) + 8000384e: 0001b097 auipc ra,0x1b + 80003852: c4e080e7 jalr -946(ra) # 8001e49c <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h29ddb6c86f63b2e9E> + 80003856: e02a sd a0,0(sp) + 80003858: a009 j 8000385a <.LBB7_4+0x26> + } + 8000385a: 6502 ld a0,0(sp) + 8000385c: 70a2 ld ra,40(sp) + 8000385e: 6145 addi sp,sp,48 + 80003860: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio3Buf3pin17hb02a509b70e70322E: + +0000000080003862 <_ZN6kernel2fs3bio3Buf3pin17hb02a509b70e70322E>: + + /// Pin the buf. + /// SAFETY: it should be definitly safe. + /// Because the current refcnt >= 1, so the rc_ptr is valid. + pub unsafe fn pin(&self) { + 80003862: 1101 addi sp,sp,-32 + 80003864: e02a sd a0,0(sp) + 80003866: e82a sd a0,16(sp) + let rc = *self.rc_ptr; + 80003868: 6508 ld a0,8(a0) + 8000386a: 610c ld a1,0(a0) + 8000386c: ec2e sd a1,24(sp) + *self.rc_ptr = rc + 1; + 8000386e: 00158513 addi a0,a1,1 + 80003872: e42a sd a0,8(sp) + 80003874: 00b56963 bltu a0,a1,80003886 <.LBB8_3> + 80003878: a009 j 8000387a <_ZN6kernel2fs3bio3Buf3pin17hb02a509b70e70322E+0x18> + 8000387a: 6522 ld a0,8(sp) + 8000387c: 6582 ld a1,0(sp) + 8000387e: 658c ld a1,8(a1) + 80003880: e188 sd a0,0(a1) + } + 80003882: 6105 addi sp,sp,32 + 80003884: 8082 ret + +0000000080003886 <.LBB8_3>: + *self.rc_ptr = rc + 1; + 80003886: 00023517 auipc a0,0x23 + 8000388a: 3ca50513 addi a0,a0,970 # 80026c50 + +000000008000388e <.LBB8_4>: + 8000388e: 00023617 auipc a2,0x23 + 80003892: 4d260613 addi a2,a2,1234 # 80026d60 <.L__unnamed_25> + 80003896: 45f1 li a1,28 + 80003898: 00020097 auipc ra,0x20 + 8000389c: 8ac080e7 jalr -1876(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs3bio3Buf5unpin17h781e1439f4d799baE: + +00000000800038a2 <_ZN6kernel2fs3bio3Buf5unpin17h781e1439f4d799baE>: + + /// Unpin the buf. + /// SAFETY: it should be called matching pin. + pub unsafe fn unpin(&self) { + 800038a2: 7179 addi sp,sp,-48 + 800038a4: e82a sd a0,16(sp) + 800038a6: f02a sd a0,32(sp) + let rc = *self.rc_ptr; + 800038a8: 6508 ld a0,8(a0) + 800038aa: 610c ld a1,0(a0) + 800038ac: ec2e sd a1,24(sp) + 800038ae: f42e sd a1,40(sp) + 800038b0: 4505 li a0,1 + if rc <= 1 { + 800038b2: 02b56163 bltu a0,a1,800038d4 <.LBB9_6+0x14> + 800038b6: a009 j 800038b8 <.LBB9_5> + +00000000800038b8 <.LBB9_5>: + panic!("buf unpin not match"); + 800038b8: 00023517 auipc a0,0x23 + 800038bc: 4c050513 addi a0,a0,1216 # 80026d78 <.L__unnamed_26> + +00000000800038c0 <.LBB9_6>: + 800038c0: 00023617 auipc a2,0x23 + 800038c4: 4d060613 addi a2,a2,1232 # 80026d90 <.L__unnamed_27> + 800038c8: 45cd li a1,19 + 800038ca: 00020097 auipc ra,0x20 + 800038ce: 87a080e7 jalr -1926(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800038d2: 0000 unimp + } + *self.rc_ptr = rc - 1; + 800038d4: 6562 ld a0,24(sp) + 800038d6: fff50593 addi a1,a0,-1 + 800038da: e42e sd a1,8(sp) + 800038dc: 00b56963 bltu a0,a1,800038ee <.LBB9_7> + 800038e0: a009 j 800038e2 <.LBB9_6+0x22> + 800038e2: 6522 ld a0,8(sp) + 800038e4: 65c2 ld a1,16(sp) + 800038e6: 658c ld a1,8(a1) + 800038e8: e188 sd a0,0(a1) + } + 800038ea: 6145 addi sp,sp,48 + 800038ec: 8082 ret + +00000000800038ee <.LBB9_7>: + *self.rc_ptr = rc - 1; + 800038ee: 00023517 auipc a0,0x23 + 800038f2: 21250513 addi a0,a0,530 # 80026b00 + +00000000800038f6 <.LBB9_8>: + 800038f6: 00023617 auipc a2,0x23 + 800038fa: 4b260613 addi a2,a2,1202 # 80026da8 <.L__unnamed_28> + 800038fe: 02100593 li a1,33 + 80003902: 00020097 auipc ra,0x20 + 80003906: 842080e7 jalr -1982(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E: + +000000008000390c <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E>: + } + } + + /// Find if the requested block is cached. + /// Return its index and incr the refcnt if found. + fn find_cached(&mut self, dev: u32, blockno: u32) -> Option<(usize, *mut usize)> { + 8000390c: 7119 addi sp,sp,-128 + 8000390e: fc86 sd ra,120(sp) + 80003910: f42a sd a0,40(sp) + 80003912: 8536 mv a0,a3 + 80003914: f82a sd a0,48(sp) + 80003916: 8532 mv a0,a2 + 80003918: fc2a sd a0,56(sp) + 8000391a: f0ae sd a1,96(sp) + 8000391c: d4b2 sw a2,104(sp) + 8000391e: d6b6 sw a3,108(sp) + let mut b = self.head; + 80003920: 4b05b503 ld a0,1200(a1) + 80003924: e0aa sd a0,64(sp) + while !b.is_null() { + 80003926: a009 j 80003928 <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E+0x1c> + 80003928: 6506 ld a0,64(sp) + 8000392a: 00002097 auipc ra,0x2 + 8000392e: e60080e7 jalr -416(ra) # 8000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E> + 80003932: f02a sd a0,32(sp) + 80003934: a009 j 80003936 <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E+0x2a> + 80003936: 7502 ld a0,32(sp) + 80003938: 4581 li a1,0 + 8000393a: 00b50763 beq a0,a1,80003948 <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E+0x3c> + 8000393e: a009 j 80003940 <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E+0x34> + 80003940: 75a2 ld a1,40(sp) + 80003942: 4501 li a0,0 + bref.refcnt += 1; + return Some((bref.index, &mut bref.refcnt)); + } + b = bref.next; + } + None + 80003944: e188 sd a0,0(a1) + } + 80003946: a859 j 800039dc <.LBB10_16+0x84> + let bref = unsafe { b.as_mut().unwrap() }; + 80003948: 6506 ld a0,64(sp) + 8000394a: 00002097 auipc ra,0x2 + 8000394e: df2080e7 jalr -526(ra) # 8000573c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E> + 80003952: ec2a sd a0,24(sp) + 80003954: a009 j 80003956 <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E+0x4a> + 80003956: 6562 ld a0,24(sp) + +0000000080003958 <.LBB10_16>: + 80003958: 00023597 auipc a1,0x23 + 8000395c: 46858593 addi a1,a1,1128 # 80026dc0 <.L__unnamed_29> + 80003960: 0000c097 auipc ra,0xc + 80003964: c14080e7 jalr -1004(ra) # 8000f574 <_ZN4core6option15Option$LT$T$GT$6unwrap17h34586233d4d65f4cE> + 80003968: e82a sd a0,16(sp) + 8000396a: a009 j 8000396c <.LBB10_16+0x14> + 8000396c: 75e2 ld a1,56(sp) + 8000396e: 6542 ld a0,16(sp) + 80003970: f8aa sd a0,112(sp) + if bref.dev == dev && bref.blockno == blockno { + 80003972: 5108 lw a0,32(a0) + 80003974: 2581 sext.w a1,a1 + 80003976: 00b50b63 beq a0,a1,8000398c <.LBB10_16+0x34> + 8000397a: a029 j 80003984 <.LBB10_16+0x2c> + 8000397c: 4505 li a0,1 + 8000397e: 04a107a3 sb a0,79(sp) + 80003982: a821 j 8000399a <.LBB10_16+0x42> + 80003984: 4501 li a0,0 + 80003986: 04a107a3 sb a0,79(sp) + 8000398a: a801 j 8000399a <.LBB10_16+0x42> + 8000398c: 75c2 ld a1,48(sp) + 8000398e: 6542 ld a0,16(sp) + 80003990: 5148 lw a0,36(a0) + 80003992: 2581 sext.w a1,a1 + 80003994: feb504e3 beq a0,a1,8000397c <.LBB10_16+0x24> + 80003998: b7f5 j 80003984 <.LBB10_16+0x2c> + 8000399a: 04f14503 lbu a0,79(sp) + 8000399e: 8905 andi a0,a0,1 + 800039a0: 4581 li a1,0 + 800039a2: 00b50b63 beq a0,a1,800039b8 <.LBB10_16+0x60> + 800039a6: a009 j 800039a8 <.LBB10_16+0x50> + bref.refcnt += 1; + 800039a8: 6542 ld a0,16(sp) + 800039aa: 690c ld a1,16(a0) + 800039ac: 00158513 addi a0,a1,1 + 800039b0: e42a sd a0,8(sp) + 800039b2: 02b56863 bltu a0,a1,800039e2 <.LBB10_17> + 800039b6: a029 j 800039c0 <.LBB10_16+0x68> + b = bref.next; + 800039b8: 6542 ld a0,16(sp) + 800039ba: 6508 ld a0,8(a0) + 800039bc: e0aa sd a0,64(sp) + while !b.is_null() { + 800039be: b7ad j 80003928 <_ZN6kernel2fs3bio6BufLru11find_cached17h75fa078c96ee4834E+0x1c> + bref.refcnt += 1; + 800039c0: 75a2 ld a1,40(sp) + 800039c2: 6642 ld a2,16(sp) + 800039c4: 66a2 ld a3,8(sp) + 800039c6: 01060513 addi a0,a2,16 + 800039ca: ea14 sd a3,16(a2) + return Some((bref.index, &mut bref.refcnt)); + 800039cc: 6e10 ld a2,24(a2) + 800039ce: e8b2 sd a2,80(sp) + 800039d0: ecaa sd a0,88(sp) + 800039d2: e590 sd a2,8(a1) + 800039d4: e988 sd a0,16(a1) + 800039d6: 4505 li a0,1 + 800039d8: e188 sd a0,0(a1) + } + 800039da: a009 j 800039dc <.LBB10_16+0x84> + 800039dc: 70e6 ld ra,120(sp) + 800039de: 6109 addi sp,sp,128 + 800039e0: 8082 ret + +00000000800039e2 <.LBB10_17>: + bref.refcnt += 1; + 800039e2: 00023517 auipc a0,0x23 + 800039e6: 26e50513 addi a0,a0,622 # 80026c50 + +00000000800039ea <.LBB10_18>: + 800039ea: 00023617 auipc a2,0x23 + 800039ee: 3ee60613 addi a2,a2,1006 # 80026dd8 <.L__unnamed_30> + 800039f2: 45f1 li a1,28 + 800039f4: 0001f097 auipc ra,0x1f + 800039f8: 750080e7 jalr 1872(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E: + +00000000800039fe <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E>: + + /// Recycle an unused buffer from the tail. + /// Return its index if found. + fn recycle(&mut self, dev: u32, blockno: u32) -> Option<(usize, *mut usize)> { + 800039fe: 7159 addi sp,sp,-112 + 80003a00: f486 sd ra,104(sp) + 80003a02: f02a sd a0,32(sp) + 80003a04: 8536 mv a0,a3 + 80003a06: f42a sd a0,40(sp) + 80003a08: 8532 mv a0,a2 + 80003a0a: f82a sd a0,48(sp) + 80003a0c: e8ae sd a1,80(sp) + 80003a0e: ccb2 sw a2,88(sp) + 80003a10: ceb6 sw a3,92(sp) + let mut b = self.tail; + 80003a12: 4b85b503 ld a0,1208(a1) + 80003a16: fc2a sd a0,56(sp) + while !b.is_null() { + 80003a18: a009 j 80003a1a <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E+0x1c> + 80003a1a: 7562 ld a0,56(sp) + 80003a1c: 00002097 auipc ra,0x2 + 80003a20: d6e080e7 jalr -658(ra) # 8000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E> + 80003a24: ec2a sd a0,24(sp) + 80003a26: a009 j 80003a28 <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E+0x2a> + 80003a28: 6562 ld a0,24(sp) + 80003a2a: 4581 li a1,0 + 80003a2c: 00b50763 beq a0,a1,80003a3a <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E+0x3c> + 80003a30: a009 j 80003a32 <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E+0x34> + 80003a32: 7582 ld a1,32(sp) + 80003a34: 4501 li a0,0 + bref.refcnt += 1; + return Some((bref.index, &mut bref.refcnt)); + } + b = bref.prev; + } + None + 80003a36: e188 sd a0,0(a1) + } + 80003a38: a885 j 80003aa8 <.LBB11_12+0x5e> + let bref = unsafe { b.as_mut().unwrap() }; + 80003a3a: 7562 ld a0,56(sp) + 80003a3c: 00002097 auipc ra,0x2 + 80003a40: d00080e7 jalr -768(ra) # 8000573c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E> + 80003a44: e82a sd a0,16(sp) + 80003a46: a009 j 80003a48 <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E+0x4a> + 80003a48: 6542 ld a0,16(sp) + +0000000080003a4a <.LBB11_12>: + 80003a4a: 00023597 auipc a1,0x23 + 80003a4e: 3a658593 addi a1,a1,934 # 80026df0 <.L__unnamed_31> + 80003a52: 0000c097 auipc ra,0xc + 80003a56: b22080e7 jalr -1246(ra) # 8000f574 <_ZN4core6option15Option$LT$T$GT$6unwrap17h34586233d4d65f4cE> + 80003a5a: e42a sd a0,8(sp) + 80003a5c: a009 j 80003a5e <.LBB11_12+0x14> + 80003a5e: 6522 ld a0,8(sp) + 80003a60: f0aa sd a0,96(sp) + if bref.refcnt == 0 { + 80003a62: 6908 ld a0,16(a0) + 80003a64: 4581 li a1,0 + 80003a66: 00b51f63 bne a0,a1,80003a84 <.LBB11_12+0x3a> + 80003a6a: a009 j 80003a6c <.LBB11_12+0x22> + bref.dev = dev; + 80003a6c: 6522 ld a0,8(sp) + 80003a6e: 75a2 ld a1,40(sp) + 80003a70: 7642 ld a2,48(sp) + 80003a72: d110 sw a2,32(a0) + bref.blockno = blockno; + 80003a74: d14c sw a1,36(a0) + bref.refcnt += 1; + 80003a76: 690c ld a1,16(a0) + 80003a78: 00158513 addi a0,a1,1 + 80003a7c: e02a sd a0,0(sp) + 80003a7e: 02b56863 bltu a0,a1,80003aae <.LBB11_13> + 80003a82: a029 j 80003a8c <.LBB11_12+0x42> + b = bref.prev; + 80003a84: 6522 ld a0,8(sp) + 80003a86: 6108 ld a0,0(a0) + 80003a88: fc2a sd a0,56(sp) + while !b.is_null() { + 80003a8a: bf41 j 80003a1a <_ZN6kernel2fs3bio6BufLru7recycle17h2cc2179c79ac2f75E+0x1c> + bref.refcnt += 1; + 80003a8c: 7582 ld a1,32(sp) + 80003a8e: 6622 ld a2,8(sp) + 80003a90: 6682 ld a3,0(sp) + 80003a92: 01060513 addi a0,a2,16 + 80003a96: ea14 sd a3,16(a2) + return Some((bref.index, &mut bref.refcnt)); + 80003a98: 6e10 ld a2,24(a2) + 80003a9a: e0b2 sd a2,64(sp) + 80003a9c: e4aa sd a0,72(sp) + 80003a9e: e590 sd a2,8(a1) + 80003aa0: e988 sd a0,16(a1) + 80003aa2: 4505 li a0,1 + 80003aa4: e188 sd a0,0(a1) + } + 80003aa6: a009 j 80003aa8 <.LBB11_12+0x5e> + 80003aa8: 70a6 ld ra,104(sp) + 80003aaa: 6165 addi sp,sp,112 + 80003aac: 8082 ret + +0000000080003aae <.LBB11_13>: + bref.refcnt += 1; + 80003aae: 00023517 auipc a0,0x23 + 80003ab2: 1a250513 addi a0,a0,418 # 80026c50 + +0000000080003ab6 <.LBB11_14>: + 80003ab6: 00023617 auipc a2,0x23 + 80003aba: 35260613 addi a2,a2,850 # 80026e08 <.L__unnamed_32> + 80003abe: 45f1 li a1,28 + 80003ac0: 0001f097 auipc ra,0x1f + 80003ac4: 684080e7 jalr 1668(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE: + +0000000080003aca <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE>: + + /// Move an entry to the head if no live ref. + fn move_if_no_ref(&mut self, index: usize) { + 80003aca: 7175 addi sp,sp,-144 + 80003acc: e506 sd ra,136(sp) + 80003ace: fc2e sd a1,56(sp) + 80003ad0: e0aa sd a0,64(sp) + 80003ad2: fcaa sd a0,120(sp) + 80003ad4: e12e sd a1,128(sp) + 80003ad6: 4575 li a0,29 + let b = &mut self.inner[index]; + 80003ad8: 14b56763 bltu a0,a1,80003c26 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x15c> + 80003adc: a009 j 80003ade <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x14> + 80003ade: 6506 ld a0,64(sp) + 80003ae0: 75e2 ld a1,56(sp) + 80003ae2: 02800613 li a2,40 + 80003ae6: 02c585b3 mul a1,a1,a2 + 80003aea: 952e add a0,a0,a1 + 80003aec: e8aa sd a0,80(sp) + b.refcnt -= 1; + 80003aee: 6908 ld a0,16(a0) + 80003af0: fff50593 addi a1,a0,-1 + 80003af4: f82e sd a1,48(sp) + 80003af6: 14b56363 bltu a0,a1,80003c3c <.LBB12_30> + 80003afa: a009 j 80003afc <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x32> + 80003afc: 7542 ld a0,48(sp) + 80003afe: 65c6 ld a1,80(sp) + 80003b00: e988 sd a0,16(a1) + if b.refcnt == 0 && !ptr::eq(self.head, b) { + 80003b02: 6546 ld a0,80(sp) + 80003b04: 6908 ld a0,16(a0) + 80003b06: 4581 li a1,0 + 80003b08: 00b50b63 beq a0,a1,80003b1e <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x54> + 80003b0c: a029 j 80003b16 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x4c> + 80003b0e: 4505 li a0,1 + 80003b10: 04a10f23 sb a0,94(sp) + 80003b14: a839 j 80003b32 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x68> + 80003b16: 4501 li a0,0 + 80003b18: 04a10f23 sb a0,94(sp) + 80003b1c: a819 j 80003b32 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x68> + 80003b1e: 6506 ld a0,64(sp) + 80003b20: 4b053503 ld a0,1200(a0) + 80003b24: 65c6 ld a1,80(sp) + 80003b26: 00016097 auipc ra,0x16 + 80003b2a: 8bc080e7 jalr -1860(ra) # 800193e2 <_ZN4core3ptr2eq17h2ab91a60e465e9ebE> + 80003b2e: f42a sd a0,40(sp) + 80003b30: a031 j 80003b3c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x72> + 80003b32: 05e14503 lbu a0,94(sp) + 80003b36: 8905 andi a0,a0,1 + 80003b38: e519 bnez a0,80003b46 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x7c> + 80003b3a: a005 j 80003b5a <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x90> + 80003b3c: 7522 ld a0,40(sp) + 80003b3e: 4581 li a1,0 + 80003b40: fcb507e3 beq a0,a1,80003b0e <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x44> + 80003b44: bfc9 j 80003b16 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x4c> + // forward the tail if b is at the tail + // b may be the only entry in the lru list + if ptr::eq(self.tail, b) && !b.prev.is_null() { + 80003b46: 6506 ld a0,64(sp) + 80003b48: 4b853503 ld a0,1208(a0) + 80003b4c: 65c6 ld a1,80(sp) + 80003b4e: 00016097 auipc ra,0x16 + 80003b52: 894080e7 jalr -1900(ra) # 800193e2 <_ZN4core3ptr2eq17h2ab91a60e465e9ebE> + 80003b56: f02a sd a0,32(sp) + 80003b58: a03d j 80003b86 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xbc> + if b.refcnt == 0 && !ptr::eq(self.head, b) { + 80003b5a: a0d9 j 80003c20 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x156> + 80003b5c: 4505 li a0,1 + if ptr::eq(self.tail, b) && !b.prev.is_null() { + 80003b5e: 04a10fa3 sb a0,95(sp) + 80003b62: a829 j 80003b7c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xb2> + 80003b64: 4501 li a0,0 + 80003b66: 04a10fa3 sb a0,95(sp) + 80003b6a: a809 j 80003b7c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xb2> + 80003b6c: 6546 ld a0,80(sp) + 80003b6e: 6108 ld a0,0(a0) + 80003b70: 00002097 auipc ra,0x2 + 80003b74: c1a080e7 jalr -998(ra) # 8000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E> + 80003b78: ec2a sd a0,24(sp) + 80003b7a: a809 j 80003b8c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xc2> + 80003b7c: 05f14503 lbu a0,95(sp) + 80003b80: 8905 andi a0,a0,1 + 80003b82: e911 bnez a0,80003b96 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xcc> + 80003b84: a839 j 80003ba2 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xd8> + 80003b86: 7502 ld a0,32(sp) + 80003b88: f175 bnez a0,80003b6c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xa2> + 80003b8a: bfe9 j 80003b64 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x9a> + 80003b8c: 6562 ld a0,24(sp) + 80003b8e: 4581 li a1,0 + 80003b90: fcb506e3 beq a0,a1,80003b5c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x92> + 80003b94: bfc1 j 80003b64 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x9a> + self.tail = b.prev; + 80003b96: 6586 ld a1,64(sp) + 80003b98: 6546 ld a0,80(sp) + 80003b9a: 6108 ld a0,0(a0) + 80003b9c: 4aa5bc23 sd a0,1208(a1) + if ptr::eq(self.tail, b) && !b.prev.is_null() { + 80003ba0: a011 j 80003ba4 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xda> + 80003ba2: a009 j 80003ba4 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xda> + } + + // detach b + unsafe { + b.next.as_mut().map(|b_next| b_next.prev = b.prev); + 80003ba4: 6546 ld a0,80(sp) + 80003ba6: 6508 ld a0,8(a0) + 80003ba8: 00002097 auipc ra,0x2 + 80003bac: b94080e7 jalr -1132(ra) # 8000573c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E> + 80003bb0: e82a sd a0,16(sp) + 80003bb2: a009 j 80003bb4 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xea> + 80003bb4: 6542 ld a0,16(sp) + 80003bb6: 088c addi a1,sp,80 + 80003bb8: f0ae sd a1,96(sp) + 80003bba: 0000b097 auipc ra,0xb + 80003bbe: 27c080e7 jalr 636(ra) # 8000ee36 <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E> + 80003bc2: a009 j 80003bc4 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0xfa> + b.prev.as_mut().map(|b_prev| b_prev.next = b.next); + 80003bc4: 6546 ld a0,80(sp) + 80003bc6: 6108 ld a0,0(a0) + 80003bc8: 00002097 auipc ra,0x2 + 80003bcc: b74080e7 jalr -1164(ra) # 8000573c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E> + 80003bd0: e42a sd a0,8(sp) + 80003bd2: a009 j 80003bd4 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x10a> + 80003bd4: 6522 ld a0,8(sp) + 80003bd6: 088c addi a1,sp,80 + 80003bd8: f4ae sd a1,104(sp) + 80003bda: 0000b097 auipc ra,0xb + 80003bde: 31e080e7 jalr 798(ra) # 8000eef8 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E> + 80003be2: a009 j 80003be4 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x11a> + } + + // attach b + b.prev = ptr::null_mut(); + 80003be4: a009 j 80003be6 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x11c> + 80003be6: 6506 ld a0,64(sp) + 80003be8: 6646 ld a2,80(sp) + 80003bea: 4581 li a1,0 + 80003bec: e20c sd a1,0(a2) + b.next = self.head; + 80003bee: 4b053583 ld a1,1200(a0) + 80003bf2: 6646 ld a2,80(sp) + 80003bf4: e60c sd a1,8(a2) + unsafe { + self.head.as_mut().map(|old_head| old_head.prev = b); + 80003bf6: 4b053503 ld a0,1200(a0) + 80003bfa: 00002097 auipc ra,0x2 + 80003bfe: b42080e7 jalr -1214(ra) # 8000573c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E> + 80003c02: e02a sd a0,0(sp) + 80003c04: a009 j 80003c06 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x13c> + 80003c06: 6502 ld a0,0(sp) + 80003c08: 088c addi a1,sp,80 + 80003c0a: f8ae sd a1,112(sp) + 80003c0c: 0000b097 auipc ra,0xb + 80003c10: 34a080e7 jalr 842(ra) # 8000ef56 <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E> + 80003c14: a009 j 80003c16 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x14c> + } + self.head = b; + 80003c16: 6586 ld a1,64(sp) + 80003c18: 6546 ld a0,80(sp) + 80003c1a: 4aa5b823 sd a0,1200(a1) + if b.refcnt == 0 && !ptr::eq(self.head, b) { + 80003c1e: a009 j 80003c20 <_ZN6kernel2fs3bio6BufLru14move_if_no_ref17h9c300d5c07285c6bE+0x156> + } + } + 80003c20: 60aa ld ra,136(sp) + 80003c22: 6149 addi sp,sp,144 + 80003c24: 8082 ret + let b = &mut self.inner[index]; + 80003c26: 7562 ld a0,56(sp) + +0000000080003c28 <.LBB12_29>: + 80003c28: 00023617 auipc a2,0x23 + 80003c2c: 1f860613 addi a2,a2,504 # 80026e20 <.L__unnamed_33> + 80003c30: 45f9 li a1,30 + 80003c32: 0001f097 auipc ra,0x1f + 80003c36: 53e080e7 jalr 1342(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080003c3c <.LBB12_30>: + b.refcnt -= 1; + 80003c3c: 00023517 auipc a0,0x23 + 80003c40: ec450513 addi a0,a0,-316 # 80026b00 + +0000000080003c44 <.LBB12_31>: + 80003c44: 00023617 auipc a2,0x23 + 80003c48: 1f460613 addi a2,a2,500 # 80026e38 <.L__unnamed_34> + 80003c4c: 02100593 li a1,33 + 80003c50: 0001f097 auipc ra,0x1f + 80003c54: 4f4080e7 jalr 1268(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7get_bit17h5d59737ea892b952E: + +0000000080003c5a <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7get_bit17h5d59737ea892b952E>: + ($($t:ty)*) => ($( + impl BitField for $t { + const BIT_LENGTH: usize = ::core::mem::size_of::() as usize * 8; + + #[inline] + fn get_bit(&self, bit: usize) -> bool { + 80003c5a: 7179 addi sp,sp,-48 + 80003c5c: e82e sd a1,16(sp) + 80003c5e: ec2a sd a0,24(sp) + 80003c60: f02a sd a0,32(sp) + 80003c62: f42e sd a1,40(sp) + 80003c64: 4521 li a0,8 + assert!(bit < Self::BIT_LENGTH); + 80003c66: 02a5e263 bltu a1,a0,80003c8a <.LBB0_6+0x16> + 80003c6a: a009 j 80003c6c <.LBB0_5> + +0000000080003c6c <.LBB0_5>: + 80003c6c: 00023517 auipc a0,0x23 + 80003c70: 1e450513 addi a0,a0,484 # 80026e50 <.L__unnamed_1> + +0000000080003c74 <.LBB0_6>: + 80003c74: 00023617 auipc a2,0x23 + 80003c78: 26460613 addi a2,a2,612 # 80026ed8 <.L__unnamed_2> + 80003c7c: 02800593 li a1,40 + 80003c80: 0001f097 auipc ra,0x1f + 80003c84: 4c4080e7 jalr 1220(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80003c88: 0000 unimp + + (*self & (1 << bit)) != 0 + 80003c8a: 65c2 ld a1,16(sp) + 80003c8c: 6562 ld a0,24(sp) + 80003c8e: 00054503 lbu a0,0(a0) + 80003c92: e02a sd a0,0(sp) + 80003c94: ff85f513 andi a0,a1,-8 + 80003c98: 0075f613 andi a2,a1,7 + 80003c9c: 4585 li a1,1 + 80003c9e: 00c595b3 sll a1,a1,a2 + 80003ca2: e42e sd a1,8(sp) + 80003ca4: 4581 li a1,0 + 80003ca6: 00b51a63 bne a0,a1,80003cba <.LBB0_7> + 80003caa: a009 j 80003cac <.LBB0_6+0x38> + 80003cac: 6502 ld a0,0(sp) + 80003cae: 65a2 ld a1,8(sp) + 80003cb0: 8d6d and a0,a0,a1 + 80003cb2: 00a03533 snez a0,a0 + } + 80003cb6: 6145 addi sp,sp,48 + 80003cb8: 8082 ret + +0000000080003cba <.LBB0_7>: + (*self & (1 << bit)) != 0 + 80003cba: 00023517 auipc a0,0x23 + 80003cbe: 23650513 addi a0,a0,566 # 80026ef0 + +0000000080003cc2 <.LBB0_8>: + 80003cc2: 00023617 auipc a2,0x23 + 80003cc6: 21660613 addi a2,a2,534 # 80026ed8 <.L__unnamed_2> + 80003cca: 02300593 li a1,35 + 80003cce: 0001f097 auipc ra,0x1f + 80003cd2: 476080e7 jalr 1142(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7set_bit17ha97cadf2a55a43d3E: + +0000000080003cd8 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7set_bit17ha97cadf2a55a43d3E>: + // shift away low bits + bits >> range.start + } + + #[inline] + fn set_bit(&mut self, bit: usize, value: bool) -> &mut Self { + 80003cd8: 7139 addi sp,sp,-64 + 80003cda: e82e sd a1,16(sp) + 80003cdc: ec2a sd a0,24(sp) + 80003cde: 86b2 mv a3,a2 + 80003ce0: f036 sd a3,32(sp) + 80003ce2: f42a sd a0,40(sp) + 80003ce4: f82e sd a1,48(sp) + 80003ce6: 02c10fa3 sb a2,63(sp) + 80003cea: 4521 li a0,8 + assert!(bit < Self::BIT_LENGTH); + 80003cec: 02a5e263 bltu a1,a0,80003d10 <.LBB1_11+0x16> + 80003cf0: a009 j 80003cf2 <.LBB1_10> + +0000000080003cf2 <.LBB1_10>: + 80003cf2: 00023517 auipc a0,0x23 + 80003cf6: 15e50513 addi a0,a0,350 # 80026e50 <.L__unnamed_1> + +0000000080003cfa <.LBB1_11>: + 80003cfa: 00023617 auipc a2,0x23 + 80003cfe: 1de60613 addi a2,a2,478 # 80026ed8 <.L__unnamed_2> + 80003d02: 02800593 li a1,40 + 80003d06: 0001f097 auipc ra,0x1f + 80003d0a: 43e080e7 jalr 1086(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80003d0e: 0000 unimp + 80003d10: 7502 ld a0,32(sp) + 80003d12: 4581 li a1,0 + + if value { + 80003d14: 02b50063 beq a0,a1,80003d34 <.LBB1_11+0x3a> + 80003d18: a009 j 80003d1a <.LBB1_11+0x20> + *self |= 1 << bit; + 80003d1a: 65c2 ld a1,16(sp) + 80003d1c: ff85f513 andi a0,a1,-8 + 80003d20: 0075f613 andi a2,a1,7 + 80003d24: 4585 li a1,1 + 80003d26: 00c595b3 sll a1,a1,a2 + 80003d2a: e42e sd a1,8(sp) + 80003d2c: 4581 li a1,0 + 80003d2e: 04b51563 bne a0,a1,80003d78 <.LBB1_12> + 80003d32: a831 j 80003d4e <.LBB1_11+0x54> + } else { + *self &= !(1 << bit); + 80003d34: 65c2 ld a1,16(sp) + 80003d36: ff85f513 andi a0,a1,-8 + 80003d3a: 0075f613 andi a2,a1,7 + 80003d3e: 4585 li a1,1 + 80003d40: 00c595b3 sll a1,a1,a2 + 80003d44: e02e sd a1,0(sp) + 80003d46: 4581 li a1,0 + 80003d48: 04b51763 bne a0,a1,80003d96 <.LBB1_14> + 80003d4c: a809 j 80003d5e <.LBB1_11+0x64> + *self |= 1 << bit; + 80003d4e: 65e2 ld a1,24(sp) + 80003d50: 6622 ld a2,8(sp) + 80003d52: 00058503 lb a0,0(a1) + 80003d56: 8d51 or a0,a0,a2 + 80003d58: 00a58023 sb a0,0(a1) + if value { + 80003d5c: a819 j 80003d72 <.LBB1_11+0x78> + *self &= !(1 << bit); + 80003d5e: 65e2 ld a1,24(sp) + 80003d60: 6502 ld a0,0(sp) + 80003d62: fff54613 not a2,a0 + 80003d66: 00058503 lb a0,0(a1) + 80003d6a: 8d71 and a0,a0,a2 + 80003d6c: 00a58023 sb a0,0(a1) + if value { + 80003d70: a009 j 80003d72 <.LBB1_11+0x78> + } + + self + } + 80003d72: 6562 ld a0,24(sp) + 80003d74: 6121 addi sp,sp,64 + 80003d76: 8082 ret + +0000000080003d78 <.LBB1_12>: + *self |= 1 << bit; + 80003d78: 00023517 auipc a0,0x23 + 80003d7c: 17850513 addi a0,a0,376 # 80026ef0 + +0000000080003d80 <.LBB1_13>: + 80003d80: 00023617 auipc a2,0x23 + 80003d84: 15860613 addi a2,a2,344 # 80026ed8 <.L__unnamed_2> + 80003d88: 02300593 li a1,35 + 80003d8c: 0001f097 auipc ra,0x1f + 80003d90: 3b8080e7 jalr 952(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080003d96 <.LBB1_14>: + *self &= !(1 << bit); + 80003d96: 00023517 auipc a0,0x23 + 80003d9a: 15a50513 addi a0,a0,346 # 80026ef0 + +0000000080003d9e <.LBB1_15>: + 80003d9e: 00023617 auipc a2,0x23 + 80003da2: 13a60613 addi a2,a2,314 # 80026ed8 <.L__unnamed_2> + 80003da6: 02300593 li a1,35 + 80003daa: 0001f097 auipc ra,0x1f + 80003dae: 39a080e7 jalr 922(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E: + +0000000080003db4 <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E>: + fn get_bit(&self, bit: usize) -> bool { + 80003db4: 7179 addi sp,sp,-48 + 80003db6: e82e sd a1,16(sp) + 80003db8: ec2a sd a0,24(sp) + 80003dba: f02a sd a0,32(sp) + 80003dbc: f42e sd a1,40(sp) + 80003dbe: 04000513 li a0,64 + assert!(bit < Self::BIT_LENGTH); + 80003dc2: 02a5e263 bltu a1,a0,80003de6 <.LBB2_6+0x16> + 80003dc6: a009 j 80003dc8 <.LBB2_5> + +0000000080003dc8 <.LBB2_5>: + 80003dc8: 00023517 auipc a0,0x23 + 80003dcc: 08850513 addi a0,a0,136 # 80026e50 <.L__unnamed_1> + +0000000080003dd0 <.LBB2_6>: + 80003dd0: 00023617 auipc a2,0x23 + 80003dd4: 10860613 addi a2,a2,264 # 80026ed8 <.L__unnamed_2> + 80003dd8: 02800593 li a1,40 + 80003ddc: 0001f097 auipc ra,0x1f + 80003de0: 368080e7 jalr 872(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80003de4: 0000 unimp + (*self & (1 << bit)) != 0 + 80003de6: 6642 ld a2,16(sp) + 80003de8: 6562 ld a0,24(sp) + 80003dea: 6108 ld a0,0(a0) + 80003dec: e02a sd a0,0(sp) + 80003dee: fc067513 andi a0,a2,-64 + 80003df2: 4585 li a1,1 + 80003df4: 00c595b3 sll a1,a1,a2 + 80003df8: e42e sd a1,8(sp) + 80003dfa: 4581 li a1,0 + 80003dfc: 00b51a63 bne a0,a1,80003e10 <.LBB2_7> + 80003e00: a009 j 80003e02 <.LBB2_6+0x32> + 80003e02: 6502 ld a0,0(sp) + 80003e04: 65a2 ld a1,8(sp) + 80003e06: 8d6d and a0,a0,a1 + 80003e08: 00a03533 snez a0,a0 + } + 80003e0c: 6145 addi sp,sp,48 + 80003e0e: 8082 ret + +0000000080003e10 <.LBB2_7>: + (*self & (1 << bit)) != 0 + 80003e10: 00023517 auipc a0,0x23 + 80003e14: 0e050513 addi a0,a0,224 # 80026ef0 + +0000000080003e18 <.LBB2_8>: + 80003e18: 00023617 auipc a2,0x23 + 80003e1c: 0c060613 addi a2,a2,192 # 80026ed8 <.L__unnamed_2> + 80003e20: 02300593 li a1,35 + 80003e24: 0001f097 auipc ra,0x1f + 80003e28: 320080e7 jalr 800(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7set_bit17h956504fd5d951209E: + +0000000080003e2e <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7set_bit17h956504fd5d951209E>: + fn set_bit(&mut self, bit: usize, value: bool) -> &mut Self { + 80003e2e: 7139 addi sp,sp,-64 + 80003e30: e82e sd a1,16(sp) + 80003e32: ec2a sd a0,24(sp) + 80003e34: 86b2 mv a3,a2 + 80003e36: f036 sd a3,32(sp) + 80003e38: f42a sd a0,40(sp) + 80003e3a: f82e sd a1,48(sp) + 80003e3c: 02c10fa3 sb a2,63(sp) + 80003e40: 04000513 li a0,64 + assert!(bit < Self::BIT_LENGTH); + 80003e44: 02a5e263 bltu a1,a0,80003e68 <.LBB3_11+0x16> + 80003e48: a009 j 80003e4a <.LBB3_10> + +0000000080003e4a <.LBB3_10>: + 80003e4a: 00023517 auipc a0,0x23 + 80003e4e: 00650513 addi a0,a0,6 # 80026e50 <.L__unnamed_1> + +0000000080003e52 <.LBB3_11>: + 80003e52: 00023617 auipc a2,0x23 + 80003e56: 08660613 addi a2,a2,134 # 80026ed8 <.L__unnamed_2> + 80003e5a: 02800593 li a1,40 + 80003e5e: 0001f097 auipc ra,0x1f + 80003e62: 2e6080e7 jalr 742(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80003e66: 0000 unimp + 80003e68: 7502 ld a0,32(sp) + 80003e6a: 4581 li a1,0 + if value { + 80003e6c: 00b50e63 beq a0,a1,80003e88 <.LBB3_11+0x36> + 80003e70: a009 j 80003e72 <.LBB3_11+0x20> + *self |= 1 << bit; + 80003e72: 6642 ld a2,16(sp) + 80003e74: fc067513 andi a0,a2,-64 + 80003e78: 4585 li a1,1 + 80003e7a: 00c595b3 sll a1,a1,a2 + 80003e7e: e42e sd a1,8(sp) + 80003e80: 4581 li a1,0 + 80003e82: 02b51f63 bne a0,a1,80003ec0 <.LBB3_12> + 80003e86: a821 j 80003e9e <.LBB3_11+0x4c> + *self &= !(1 << bit); + 80003e88: 6642 ld a2,16(sp) + 80003e8a: fc067513 andi a0,a2,-64 + 80003e8e: 4585 li a1,1 + 80003e90: 00c595b3 sll a1,a1,a2 + 80003e94: e02e sd a1,0(sp) + 80003e96: 4581 li a1,0 + 80003e98: 04b51363 bne a0,a1,80003ede <.LBB3_14> + 80003e9c: a039 j 80003eaa <.LBB3_11+0x58> + *self |= 1 << bit; + 80003e9e: 65e2 ld a1,24(sp) + 80003ea0: 6622 ld a2,8(sp) + 80003ea2: 6188 ld a0,0(a1) + 80003ea4: 8d51 or a0,a0,a2 + 80003ea6: e188 sd a0,0(a1) + if value { + 80003ea8: a809 j 80003eba <.LBB3_11+0x68> + *self &= !(1 << bit); + 80003eaa: 65e2 ld a1,24(sp) + 80003eac: 6502 ld a0,0(sp) + 80003eae: fff54613 not a2,a0 + 80003eb2: 6188 ld a0,0(a1) + 80003eb4: 8d71 and a0,a0,a2 + 80003eb6: e188 sd a0,0(a1) + if value { + 80003eb8: a009 j 80003eba <.LBB3_11+0x68> + } + 80003eba: 6562 ld a0,24(sp) + 80003ebc: 6121 addi sp,sp,64 + 80003ebe: 8082 ret + +0000000080003ec0 <.LBB3_12>: + *self |= 1 << bit; + 80003ec0: 00023517 auipc a0,0x23 + 80003ec4: 03050513 addi a0,a0,48 # 80026ef0 + +0000000080003ec8 <.LBB3_13>: + 80003ec8: 00023617 auipc a2,0x23 + 80003ecc: 01060613 addi a2,a2,16 # 80026ed8 <.L__unnamed_2> + 80003ed0: 02300593 li a1,35 + 80003ed4: 0001f097 auipc ra,0x1f + 80003ed8: 270080e7 jalr 624(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080003ede <.LBB3_14>: + *self &= !(1 << bit); + 80003ede: 00023517 auipc a0,0x23 + 80003ee2: 01250513 addi a0,a0,18 # 80026ef0 + +0000000080003ee6 <.LBB3_15>: + 80003ee6: 00023617 auipc a2,0x23 + 80003eea: ff260613 addi a2,a2,-14 # 80026ed8 <.L__unnamed_2> + 80003eee: 02300593 li a1,35 + 80003ef2: 0001f097 auipc ra,0x1f + 80003ef6: 252080e7 jalr 594(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE: + +0000000080003efc <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE>: + } + } +} + +/// Put a single character to console. +pub(crate) fn putc(c: u8) { + 80003efc: 1101 addi sp,sp,-32 + 80003efe: ec06 sd ra,24(sp) + 80003f00: 85aa mv a1,a0 + 80003f02: 0ff5f513 andi a0,a1,255 + 80003f06: 862e mv a2,a1 + 80003f08: e432 sd a2,8(sp) + 80003f0a: 00b10ba3 sb a1,23(sp) + 80003f0e: 45a1 li a1,8 + if c == CTRL_BS { + 80003f10: 00b51963 bne a0,a1,80003f22 <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x26> + 80003f14: a009 j 80003f16 <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x1a> + 80003f16: 4521 li a0,8 + putc_sync(CTRL_BS); + 80003f18: 00018097 auipc ra,0x18 + 80003f1c: 584080e7 jalr 1412(ra) # 8001c49c <_ZN6kernel6driver4uart9putc_sync17h8ef1d9e0f2a8eae2E> + 80003f20: a039 j 80003f2e <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x32> + putc_sync(b' '); + putc_sync(CTRL_BS); + } else { + putc_sync(c); + 80003f22: 6522 ld a0,8(sp) + 80003f24: 00018097 auipc ra,0x18 + 80003f28: 578080e7 jalr 1400(ra) # 8001c49c <_ZN6kernel6driver4uart9putc_sync17h8ef1d9e0f2a8eae2E> + 80003f2c: a839 j 80003f4a <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x4e> + 80003f2e: 02000513 li a0,32 + putc_sync(b' '); + 80003f32: 00018097 auipc ra,0x18 + 80003f36: 56a080e7 jalr 1386(ra) # 8001c49c <_ZN6kernel6driver4uart9putc_sync17h8ef1d9e0f2a8eae2E> + 80003f3a: a009 j 80003f3c <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x40> + 80003f3c: 4521 li a0,8 + putc_sync(CTRL_BS); + 80003f3e: 00018097 auipc ra,0x18 + 80003f42: 55e080e7 jalr 1374(ra) # 8001c49c <_ZN6kernel6driver4uart9putc_sync17h8ef1d9e0f2a8eae2E> + 80003f46: a009 j 80003f48 <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x4c> + if c == CTRL_BS { + 80003f48: a011 j 80003f4c <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x50> + 80003f4a: a009 j 80003f4c <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE+0x50> + } +} + 80003f4c: 60e2 ld ra,24(sp) + 80003f4e: 6105 addi sp,sp,32 + 80003f50: 8082 ret + +Disassembly of section .text._ZN6kernel6driver7console12console_read17hbad5452084e392ddE: + +0000000080003f52 <_ZN6kernel6driver7console12console_read17hbad5452084e392ddE>: + +/// User read from the console go here. +/// copy a whole input line to dst. +/// is_user indicated whether dst is a user +/// or kernel address. +pub(super) fn console_read( + 80003f52: 712d addi sp,sp,-288 + 80003f54: ee06 sd ra,280(sp) + 80003f56: ed32 sd a2,152(sp) + 80003f58: 86aa mv a3,a0 + 80003f5a: f136 sd a3,160(sp) + 80003f5c: f52e sd a1,168(sp) + 80003f5e: 0ea10fa3 sb a0,255(sp) + 80003f62: e232 sd a2,256(sp) + +0000000080003f64 <.LBB1_45>: + is_user: bool, + mut dst: usize, + size: usize +) -> Option { + let mut console = CONSOLE.acquire(); + 80003f64: 00034517 auipc a0,0x34 + 80003f68: 4fc50513 addi a0,a0,1276 # 80038460 <_ZN6kernel6driver7console7CONSOLE17h7fc6e38a093b4810E> + 80003f6c: 0000d097 auipc ra,0xd + 80003f70: d56080e7 jalr -682(ra) # 80010cc2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E> + 80003f74: e1aa sd a0,192(sp) + 80003f76: a009 j 80003f78 <.LBB1_45+0x14> + + let mut left = size; + 80003f78: 656a ld a0,152(sp) + 80003f7a: e5aa sd a0,200(sp) + while left > 0 { + 80003f7c: a009 j 80003f7e <.LBB1_45+0x1a> + 80003f7e: 652e ld a0,200(sp) + 80003f80: 4581 li a1,0 + 80003f82: 00b51463 bne a0,a1,80003f8a <.LBB1_45+0x26> + 80003f86: a009 j 80003f88 <.LBB1_45+0x24> + 80003f88: a2f1 j 80004154 <.LBB1_49+0x108> + 80003f8a: 0188 addi a0,sp,192 + // if no available data in console buf + // wait until the console device write some data. + while console.read_index == console.write_index { + 80003f8c: 0000e097 auipc ra,0xe + 80003f90: d92080e7 jalr -622(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80003f94: e92a sd a0,144(sp) + 80003f96: a009 j 80003f98 <.LBB1_45+0x34> + 80003f98: 654a ld a0,144(sp) + 80003f9a: e12a sd a0,128(sp) + 80003f9c: 0188 addi a0,sp,192 + 80003f9e: 0000e097 auipc ra,0xe + 80003fa2: d80080e7 jalr -640(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80003fa6: e52a sd a0,136(sp) + 80003fa8: a009 j 80003faa <.LBB1_45+0x46> + 80003faa: 650a ld a0,128(sp) + 80003fac: 65aa ld a1,136(sp) + 80003fae: 05a1 addi a1,a1,8 + 80003fb0: 0000c097 auipc ra,0xc + 80003fb4: fe6080e7 jalr -26(ra) # 8000ff96 <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2eq17h94523e3cd63d6752E> + 80003fb8: fcaa sd a0,120(sp) + 80003fba: a009 j 80003fbc <.LBB1_45+0x58> + 80003fbc: 7566 ld a0,120(sp) + 80003fbe: e909 bnez a0,80003fd0 <.LBB1_46> + 80003fc0: a009 j 80003fc2 <.LBB1_45+0x5e> + 80003fc2: 0188 addi a0,sp,192 + p.sleep(&console.read_index as *const _ as usize, console); + console = CONSOLE.acquire(); + } + + // read + let c = console.buf[console.read_index.0 % INPUT_BUF]; + 80003fc4: 0000e097 auipc ra,0xe + 80003fc8: d5a080e7 jalr -678(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80003fcc: f8aa sd a0,112(sp) + 80003fce: a861 j 80004066 <.LBB1_49+0x1a> + +0000000080003fd0 <.LBB1_46>: + CPU_MANAGER.myproc().expect("Fail to get my process") + 80003fd0: 00062517 auipc a0,0x62 + 80003fd4: 17050513 addi a0,a0,368 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80003fd8: 0000e097 auipc ra,0xe + 80003fdc: 480080e7 jalr 1152(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80003fe0: f4aa sd a0,104(sp) + 80003fe2: a009 j 80003fe4 <.LBB1_46+0x14> + 80003fe4: 7526 ld a0,104(sp) + +0000000080003fe6 <.LBB1_47>: + 80003fe6: 00023597 auipc a1,0x23 + 80003fea: f3458593 addi a1,a1,-204 # 80026f1a <.L__unnamed_1> + +0000000080003fee <.LBB1_48>: + 80003fee: 00023697 auipc a3,0x23 + 80003ff2: f5a68693 addi a3,a3,-166 # 80026f48 <.L__unnamed_2> + 80003ff6: 4659 li a2,22 + 80003ff8: 0000b097 auipc ra,0xb + 80003ffc: 402080e7 jalr 1026(ra) # 8000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE> + 80004000: f0aa sd a0,96(sp) + 80004002: a009 j 80004004 <.LBB1_48+0x16> + 80004004: 7506 ld a0,96(sp) + 80004006: e62a sd a0,264(sp) + if p.killed() { + 80004008: 00013097 auipc ra,0x13 + 8000400c: d9a080e7 jalr -614(ra) # 80016da2 <_ZN6kernel7process7process11task_struct6killed17h6ef392cf7098b250E> + 80004010: ecaa sd a0,88(sp) + 80004012: a009 j 80004014 <.LBB1_48+0x26> + 80004014: 6566 ld a0,88(sp) + 80004016: 4581 li a1,0 + 80004018: 00b50b63 beq a0,a1,8000402e <.LBB1_48+0x40> + 8000401c: a009 j 8000401e <.LBB1_48+0x30> + 8000401e: 4501 li a0,0 + return None + 80004020: f92a sd a0,176(sp) + 80004022: 0188 addi a0,sp,192 + } + } + // 结果应该返回读取的字节数 + let ret = size - left; + Some(ret) +} + 80004024: 00003097 auipc ra,0x3 + 80004028: 22c080e7 jalr 556(ra) # 80007250 <_ZN4core3ptr98drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..console..Console$GT$$GT$17hbea8b3b0221deadaE> + 8000402c: a2b9 j 8000417a <.LBB1_49+0x12e> + 8000402e: 0188 addi a0,sp,192 + p.sleep(&console.read_index as *const _ as usize, console); + 80004030: 0000e097 auipc ra,0xe + 80004034: cee080e7 jalr -786(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80004038: e8aa sd a0,80(sp) + 8000403a: a009 j 8000403c <.LBB1_48+0x4e> + 8000403c: 65c6 ld a1,80(sp) + 8000403e: 7506 ld a0,96(sp) + 80004040: 660e ld a2,192(sp) + 80004042: 0000e097 auipc ra,0xe + 80004046: 0f2080e7 jalr 242(ra) # 80012134 <_ZN6kernel7process7process11task_struct5sleep17h09ab315f9f2cb91eE> + 8000404a: a009 j 8000404c <.LBB1_49> + +000000008000404c <.LBB1_49>: + console = CONSOLE.acquire(); + 8000404c: 00034517 auipc a0,0x34 + 80004050: 41450513 addi a0,a0,1044 # 80038460 <_ZN6kernel6driver7console7CONSOLE17h7fc6e38a093b4810E> + 80004054: 0000d097 auipc ra,0xd + 80004058: c6e080e7 jalr -914(ra) # 80010cc2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E> + 8000405c: e4aa sd a0,72(sp) + 8000405e: a009 j 80004060 <.LBB1_49+0x14> + 80004060: 6526 ld a0,72(sp) + 80004062: e1aa sd a0,192(sp) + while console.read_index == console.write_index { + 80004064: b71d j 80003f8a <.LBB1_45+0x26> + 80004066: 0188 addi a0,sp,192 + let c = console.buf[console.read_index.0 % INPUT_BUF]; + 80004068: 0000e097 auipc ra,0xe + 8000406c: cb6080e7 jalr -842(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80004070: e0aa sd a0,64(sp) + 80004072: a009 j 80004074 <.LBB1_49+0x28> + 80004074: 6506 ld a0,64(sp) + 80004076: 6108 ld a0,0(a0) + 80004078: 07f57593 andi a1,a0,127 + 8000407c: fc2e sd a1,56(sp) + 8000407e: 07f00513 li a0,127 + 80004082: 10b56163 bltu a0,a1,80004184 <.LBB1_49+0x138> + 80004086: a009 j 80004088 <.LBB1_49+0x3c> + 80004088: 7546 ld a0,112(sp) + 8000408a: 75e2 ld a1,56(sp) + 8000408c: 952e add a0,a0,a1 + 8000408e: 01850503 lb a0,24(a0) + 80004092: 0ca10ba3 sb a0,215(sp) + 80004096: 0188 addi a0,sp,192 + console.read_index += Wrapping(1); + 80004098: 0000e097 auipc ra,0xe + 8000409c: d44080e7 jalr -700(ra) # 80011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E> + 800040a0: f82a sd a0,48(sp) + 800040a2: a009 j 800040a4 <.LBB1_49+0x58> + 800040a4: 7542 ld a0,48(sp) + 800040a6: 4585 li a1,1 + 800040a8: edae sd a1,216(sp) + 800040aa: 00003097 auipc ra,0x3 + 800040ae: 536080e7 jalr 1334(ra) # 800075e0 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..AddAssign$GT$10add_assign17hc731864567f3481aE> + 800040b2: a009 j 800040b4 <.LBB1_49+0x68> + if c == CTRL_EOT { + 800040b4: 0d714503 lbu a0,215(sp) + 800040b8: 4591 li a1,4 + 800040ba: 00b51863 bne a0,a1,800040ca <.LBB1_49+0x7e> + 800040be: a009 j 800040c0 <.LBB1_49+0x74> + if left < size { + 800040c0: 65ea ld a1,152(sp) + 800040c2: 652e ld a0,200(sp) + 800040c4: 00b56f63 bltu a0,a1,800040e2 <.LBB1_49+0x96> + 800040c8: a025 j 800040f0 <.LBB1_49+0xa4> + if copy_from_kernel(is_user, dst, &c as *const u8, 1).is_err() { + 800040ca: 750a ld a0,160(sp) + 800040cc: 75aa ld a1,168(sp) + 800040ce: 0d710613 addi a2,sp,215 + 800040d2: 4685 li a3,1 + 800040d4: 0001b097 auipc ra,0x1b + 800040d8: a1a080e7 jalr -1510(ra) # 8001eaee <_ZN6kernel6memory16copy_from_kernel17hf0969988b3a5fbc0E> + 800040dc: f5aa sd a0,232(sp) + 800040de: f9ae sd a1,240(sp) + 800040e0: a01d j 80004106 <.LBB1_49+0xba> + 800040e2: 0188 addi a0,sp,192 + console.read_index -= Wrapping(1); + 800040e4: 0000e097 auipc ra,0xe + 800040e8: cf8080e7 jalr -776(ra) # 80011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E> + 800040ec: f42a sd a0,40(sp) + 800040ee: a011 j 800040f2 <.LBB1_49+0xa6> + if left < size { + 800040f0: a811 j 80004104 <.LBB1_49+0xb8> + 800040f2: 7522 ld a0,40(sp) + 800040f4: 4585 li a1,1 + console.read_index -= Wrapping(1); + 800040f6: f1ae sd a1,224(sp) + 800040f8: 00003097 auipc ra,0x3 + 800040fc: 50c080e7 jalr 1292(ra) # 80007604 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..SubAssign$GT$10sub_assign17h67a53f3fa0ccb70bE> + 80004100: a009 j 80004102 <.LBB1_49+0xb6> + if left < size { + 80004102: a009 j 80004104 <.LBB1_49+0xb8> + 80004104: a881 j 80004154 <.LBB1_49+0x108> + 80004106: 11a8 addi a0,sp,232 + if copy_from_kernel(is_user, dst, &c as *const u8, 1).is_err() { + 80004108: 00009097 auipc ra,0x9 + 8000410c: 570080e7 jalr 1392(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 80004110: f02a sd a0,32(sp) + 80004112: a009 j 80004114 <.LBB1_49+0xc8> + 80004114: 7502 ld a0,32(sp) + 80004116: 4581 li a1,0 + 80004118: 00b50463 beq a0,a1,80004120 <.LBB1_49+0xd4> + 8000411c: a009 j 8000411e <.LBB1_49+0xd2> + 8000411e: a81d j 80004154 <.LBB1_49+0x108> + dst += 1; + 80004120: 75aa ld a1,168(sp) + 80004122: 00158513 addi a0,a1,1 + 80004126: ec2a sd a0,24(sp) + 80004128: 06b56a63 bltu a0,a1,8000419c <.LBB1_51> + 8000412c: a009 j 8000412e <.LBB1_49+0xe2> + 8000412e: 6562 ld a0,24(sp) + 80004130: f52a sd a0,168(sp) + left -= 1; + 80004132: 652e ld a0,200(sp) + 80004134: fff50593 addi a1,a0,-1 + 80004138: e82e sd a1,16(sp) + 8000413a: 06b56f63 bltu a0,a1,800041b8 <.LBB1_53> + 8000413e: a009 j 80004140 <.LBB1_49+0xf4> + 80004140: 6542 ld a0,16(sp) + 80004142: e5aa sd a0,200(sp) + if c == CTRL_LF { + 80004144: 0d714503 lbu a0,215(sp) + 80004148: 45a9 li a1,10 + 8000414a: 00b51463 bne a0,a1,80004152 <.LBB1_49+0x106> + 8000414e: a009 j 80004150 <.LBB1_49+0x104> + 80004150: a011 j 80004154 <.LBB1_49+0x108> + while left > 0 { + 80004152: b535 j 80003f7e <.LBB1_45+0x1a> + let ret = size - left; + 80004154: 656a ld a0,152(sp) + 80004156: 65ae ld a1,200(sp) + 80004158: 40b505b3 sub a1,a0,a1 + 8000415c: e42e sd a1,8(sp) + 8000415e: 06b56c63 bltu a0,a1,800041d6 <.LBB1_55> + 80004162: a009 j 80004164 <.LBB1_49+0x118> + 80004164: 6522 ld a0,8(sp) + 80004166: ea2a sd a0,272(sp) + Some(ret) + 80004168: fd2a sd a0,184(sp) + 8000416a: 4505 li a0,1 + 8000416c: f92a sd a0,176(sp) + 8000416e: 0188 addi a0,sp,192 +} + 80004170: 00003097 auipc ra,0x3 + 80004174: 0e0080e7 jalr 224(ra) # 80007250 <_ZN4core3ptr98drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..console..Console$GT$$GT$17hbea8b3b0221deadaE> + 80004178: a009 j 8000417a <.LBB1_49+0x12e> + 8000417a: 754a ld a0,176(sp) + 8000417c: 75ea ld a1,184(sp) + 8000417e: 60f2 ld ra,280(sp) + 80004180: 6115 addi sp,sp,288 + 80004182: 8082 ret + let c = console.buf[console.read_index.0 % INPUT_BUF]; + 80004184: 7562 ld a0,56(sp) + +0000000080004186 <.LBB1_50>: + 80004186: 00023617 auipc a2,0x23 + 8000418a: dda60613 addi a2,a2,-550 # 80026f60 <.L__unnamed_3> + 8000418e: 08000593 li a1,128 + 80004192: 0001f097 auipc ra,0x1f + 80004196: fde080e7 jalr -34(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000419c <.LBB1_51>: + dst += 1; + 8000419c: 00023517 auipc a0,0x23 + 800041a0: df450513 addi a0,a0,-524 # 80026f90 + +00000000800041a4 <.LBB1_52>: + 800041a4: 00023617 auipc a2,0x23 + 800041a8: dd460613 addi a2,a2,-556 # 80026f78 <.L__unnamed_4> + 800041ac: 45f1 li a1,28 + 800041ae: 0001f097 auipc ra,0x1f + 800041b2: f96080e7 jalr -106(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800041b8 <.LBB1_53>: + left -= 1; + 800041b8: 00023517 auipc a0,0x23 + 800041bc: e1850513 addi a0,a0,-488 # 80026fd0 + +00000000800041c0 <.LBB1_54>: + 800041c0: 00023617 auipc a2,0x23 + 800041c4: df060613 addi a2,a2,-528 # 80026fb0 <.L__unnamed_5> + 800041c8: 02100593 li a1,33 + 800041cc: 0001f097 auipc ra,0x1f + 800041d0: f78080e7 jalr -136(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800041d6 <.LBB1_55>: + let ret = size - left; + 800041d6: 00023517 auipc a0,0x23 + 800041da: dfa50513 addi a0,a0,-518 # 80026fd0 + +00000000800041de <.LBB1_56>: + 800041de: 00023617 auipc a2,0x23 + 800041e2: e1a60613 addi a2,a2,-486 # 80026ff8 <.L__unnamed_6> + 800041e6: 02100593 li a1,33 + 800041ea: 0001f097 auipc ra,0x1f + 800041ee: f5a080e7 jalr -166(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E: + +00000000800041f4 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E>: + +/// User write to the console go here. +pub(super) fn console_write( + 800041f4: 7155 addi sp,sp,-208 + 800041f6: e586 sd ra,200(sp) + 800041f8: f032 sd a2,32(sp) + 800041fa: 862e mv a2,a1 + 800041fc: 7582 ld a1,32(sp) + 800041fe: 86aa mv a3,a0 + 80004200: f436 sd a3,40(sp) + 80004202: e0b2 sd a2,64(sp) + 80004204: 0aa103a3 sb a0,167(sp) + 80004208: f52e sd a1,168(sp) + 8000420a: 4501 li a0,0 + is_user: bool, + mut src: usize, + size: usize +) -> Option { + for i in 0..size { + 8000420c: ecaa sd a0,88(sp) + 8000420e: f0ae sd a1,96(sp) + 80004210: 0001c097 auipc ra,0x1c + 80004214: 600080e7 jalr 1536(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80004218: f82a sd a0,48(sp) + 8000421a: fc2e sd a1,56(sp) + 8000421c: a009 j 8000421e <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x2a> + 8000421e: 7562 ld a0,56(sp) + 80004220: 75c2 ld a1,48(sp) + 80004222: f4ae sd a1,104(sp) + 80004224: f8aa sd a0,112(sp) + 80004226: a009 j 80004228 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x34> + 80004228: 10a8 addi a0,sp,104 + 8000422a: 0001c097 auipc ra,0x1c + 8000422e: 578080e7 jalr 1400(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80004232: fcaa sd a0,120(sp) + 80004234: e12e sd a1,128(sp) + 80004236: a009 j 80004238 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x44> + 80004238: 7566 ld a0,120(sp) + 8000423a: 4581 li a1,0 + 8000423c: 00b50463 beq a0,a1,80004244 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x50> + 80004240: a009 j 80004242 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x4e> + 80004242: a039 j 80004250 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x5c> + return Some(i) + } + UART.putc(c); + src += 1; + } + Some(size) + 80004244: 7502 ld a0,32(sp) + 80004246: e8aa sd a0,80(sp) + 80004248: 4505 li a0,1 + 8000424a: e4aa sd a0,72(sp) +} + 8000424c: a8a5 j 800042c4 <.LBB2_16+0x26> + for i in 0..size { + 8000424e: 0000 unimp + 80004250: 75a2 ld a1,40(sp) + 80004252: 650a ld a0,128(sp) + 80004254: ec2a sd a0,24(sp) + 80004256: f92a sd a0,176(sp) + 80004258: fd2a sd a0,184(sp) + 8000425a: e1aa sd a0,192(sp) + 8000425c: 4501 li a0,0 + let mut c = 0u8; + 8000425e: 08a107a3 sb a0,143(sp) + if copy_to_kernel(&mut c as *mut u8, is_user, src, 1).is_err() { + 80004262: 6606 ld a2,64(sp) + 80004264: 08f10513 addi a0,sp,143 + 80004268: 4685 li a3,1 + 8000426a: 0001a097 auipc ra,0x1a + 8000426e: 7d4080e7 jalr 2004(ra) # 8001ea3e <_ZN6kernel6memory14copy_to_kernel17hd4730b664342d99cE> + 80004272: e92a sd a0,144(sp) + 80004274: ed2e sd a1,152(sp) + 80004276: a009 j 80004278 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x84> + 80004278: 0908 addi a0,sp,144 + 8000427a: 00009097 auipc ra,0x9 + 8000427e: 3fe080e7 jalr 1022(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 80004282: e82a sd a0,16(sp) + 80004284: a009 j 80004286 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x92> + 80004286: 6542 ld a0,16(sp) + 80004288: 4581 li a1,0 + 8000428a: 00b50863 beq a0,a1,8000429a <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0xa6> + 8000428e: a009 j 80004290 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x9c> + return Some(i) + 80004290: 6562 ld a0,24(sp) + 80004292: e8aa sd a0,80(sp) + 80004294: 4505 li a0,1 + 80004296: e4aa sd a0,72(sp) +} + 80004298: a035 j 800042c4 <.LBB2_16+0x26> + UART.putc(c); + 8000429a: 08f10583 lb a1,143(sp) + +000000008000429e <.LBB2_16>: + 8000429e: 00059517 auipc a0,0x59 + 800042a2: 0b250513 addi a0,a0,178 # 8005d350 <_ZN6kernel6driver4uart4UART17h0708b3e179d548ddE> + 800042a6: 00006097 auipc ra,0x6 + 800042aa: 312080e7 jalr 786(ra) # 8000a5b8 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4putc17h6cd19d349a1fe87bE> + 800042ae: a009 j 800042b0 <.LBB2_16+0x12> + src += 1; + 800042b0: 6586 ld a1,64(sp) + 800042b2: 00158513 addi a0,a1,1 + 800042b6: e42a sd a0,8(sp) + 800042b8: 00b56b63 bltu a0,a1,800042ce <.LBB2_17> + 800042bc: a009 j 800042be <.LBB2_16+0x20> + 800042be: 6522 ld a0,8(sp) + 800042c0: e0aa sd a0,64(sp) + for i in 0..size { + 800042c2: b79d j 80004228 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E+0x34> +} + 800042c4: 6526 ld a0,72(sp) + 800042c6: 65c6 ld a1,80(sp) + 800042c8: 60ae ld ra,200(sp) + 800042ca: 6169 addi sp,sp,208 + 800042cc: 8082 ret + +00000000800042ce <.LBB2_17>: + src += 1; + 800042ce: 00023517 auipc a0,0x23 + 800042d2: cc250513 addi a0,a0,-830 # 80026f90 + +00000000800042d6 <.LBB2_18>: + 800042d6: 00023617 auipc a2,0x23 + 800042da: d3a60613 addi a2,a2,-710 # 80027010 <.L__unnamed_7> + 800042de: 45f1 li a1,28 + 800042e0: 0001f097 auipc ra,0x1f + 800042e4: e64080e7 jalr -412(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver7console12console_intr17hcdedd3169cb49f5fE: + +00000000800042ea <_ZN6kernel6driver7console12console_intr17hcdedd3169cb49f5fE>: +/// The normal routine is: +/// 1. user input; +/// 2. uart handler interrupt; +/// 3. console handle interrupt. +/// 4. console echo back input or do extra controlling. +pub(super) fn console_intr(c: u8) { + 800042ea: 710d addi sp,sp,-352 + 800042ec: ee86 sd ra,344(sp) + 800042ee: 85aa mv a1,a0 + 800042f0: e22e sd a1,256(sp) + 800042f2: 14a107a3 sb a0,335(sp) + +00000000800042f6 <.LBB3_73>: + let mut console = CONSOLE.acquire(); + 800042f6: 00034517 auipc a0,0x34 + 800042fa: 16a50513 addi a0,a0,362 # 80038460 <_ZN6kernel6driver7console7CONSOLE17h7fc6e38a093b4810E> + 800042fe: 0000d097 auipc ra,0xd + 80004302: 9c4080e7 jalr -1596(ra) # 80010cc2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E> + 80004306: ea2a sd a0,272(sp) + 80004308: a009 j 8000430a <.LBB3_73+0x14> + + match c { + CTRL_PRINT_PROCESS => { + 8000430a: 6512 ld a0,256(sp) + 8000430c: 0ff57513 andi a0,a0,255 + 80004310: 45a1 li a1,8 + 80004312: 12b50663 beq a0,a1,8000443e <.LBB3_74+0xec> + 80004316: a009 j 80004318 <.LBB3_73+0x22> + 80004318: 6512 ld a0,256(sp) + 8000431a: 0ff57513 andi a0,a0,255 + 8000431e: 45c1 li a1,16 + 80004320: 02b50963 beq a0,a1,80004352 <.LBB3_74> + 80004324: a009 j 80004326 <.LBB3_73+0x30> + 80004326: 6512 ld a0,256(sp) + 80004328: 0ff57513 andi a0,a0,255 + 8000432c: 45d5 li a1,21 + 8000432e: 02b50c63 beq a0,a1,80004366 <.LBB3_74+0x14> + 80004332: a009 j 80004334 <.LBB3_73+0x3e> + 80004334: 6512 ld a0,256(sp) + 80004336: 0ff57513 andi a0,a0,255 + 8000433a: 07f00593 li a1,127 + 8000433e: 10b50063 beq a0,a1,8000443e <.LBB3_74+0xec> + 80004342: a009 j 80004344 <.LBB3_73+0x4e> + } + }, + + _ => { + // echo back + if c != 0 && (console.edit_index - console.read_index).0 < INPUT_BUF { + 80004344: 6512 ld a0,256(sp) + 80004346: 0ff57513 andi a0,a0,255 + 8000434a: 4581 li a1,0 + 8000434c: 16b50463 beq a0,a1,800044b4 <.LBB3_74+0x162> + 80004350: a2b5 j 800044bc <.LBB3_74+0x16a> + +0000000080004352 <.LBB3_74>: + PROC_MANAGER.proc_dump(); + 80004352: 00055517 auipc a0,0x55 + 80004356: 07e50513 addi a0,a0,126 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000435a: 0000a097 auipc ra,0xa + 8000435e: 7f4080e7 jalr 2036(ra) # 8000eb4e <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E> + 80004362: a009 j 80004364 <.LBB3_74+0x12> + match c { + 80004364: ae01 j 80004674 <.LBB3_75+0x14> + 80004366: 0a08 addi a0,sp,272 + while console.edit_index != console.write_index && + 80004368: 0000e097 auipc ra,0xe + 8000436c: 9b6080e7 jalr -1610(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80004370: fdaa sd a0,248(sp) + 80004372: a02d j 8000439c <.LBB3_74+0x4a> + 80004374: 4505 li a0,1 + 80004376: 10a10fa3 sb a0,287(sp) + 8000437a: a821 j 80004392 <.LBB3_74+0x40> + 8000437c: 4501 li a0,0 + 8000437e: 10a10fa3 sb a0,287(sp) + 80004382: a801 j 80004392 <.LBB3_74+0x40> + 80004384: 0a08 addi a0,sp,272 + console.buf[(console.edit_index - Wrapping(1)).0 % INPUT_BUF] != CTRL_LF { + 80004386: 0000e097 auipc ra,0xe + 8000438a: 998080e7 jalr -1640(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 8000438e: f9aa sd a0,240(sp) + 80004390: a825 j 800043c8 <.LBB3_74+0x76> + while console.edit_index != console.write_index && + 80004392: 11f14503 lbu a0,287(sp) + 80004396: 8905 andi a0,a0,1 + 80004398: ed25 bnez a0,80004410 <.LBB3_74+0xbe> + 8000439a: a895 j 8000440e <.LBB3_74+0xbc> + 8000439c: 756e ld a0,248(sp) + 8000439e: 0541 addi a0,a0,16 + 800043a0: f1aa sd a0,224(sp) + 800043a2: 0a08 addi a0,sp,272 + 800043a4: 0000e097 auipc ra,0xe + 800043a8: 97a080e7 jalr -1670(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 800043ac: f5aa sd a0,232(sp) + 800043ae: a009 j 800043b0 <.LBB3_74+0x5e> + 800043b0: 750e ld a0,224(sp) + 800043b2: 75ae ld a1,232(sp) + 800043b4: 05a1 addi a1,a1,8 + 800043b6: 0000c097 auipc ra,0xc + 800043ba: c00080e7 jalr -1024(ra) # 8000ffb6 <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2ne17h2d3bd6a577efe0b1E> + 800043be: edaa sd a0,216(sp) + 800043c0: a009 j 800043c2 <.LBB3_74+0x70> + 800043c2: 656e ld a0,216(sp) + 800043c4: f161 bnez a0,80004384 <.LBB3_74+0x32> + 800043c6: bf5d j 8000437c <.LBB3_74+0x2a> + 800043c8: 0a08 addi a0,sp,272 + console.buf[(console.edit_index - Wrapping(1)).0 % INPUT_BUF] != CTRL_LF { + 800043ca: 0000e097 auipc ra,0xe + 800043ce: 954080e7 jalr -1708(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 800043d2: e9aa sd a0,208(sp) + 800043d4: a009 j 800043d6 <.LBB3_74+0x84> + 800043d6: 654e ld a0,208(sp) + 800043d8: 6908 ld a0,16(a0) + 800043da: 4585 li a1,1 + 800043dc: f22e sd a1,288(sp) + 800043de: 00003097 auipc ra,0x3 + 800043e2: 1e4080e7 jalr 484(ra) # 800075c2 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Sub$GT$3sub17h09c98f8a3aa1050aE> + 800043e6: e5aa sd a0,200(sp) + 800043e8: a009 j 800043ea <.LBB3_74+0x98> + 800043ea: 652e ld a0,200(sp) + 800043ec: 07f57593 andi a1,a0,127 + 800043f0: e1ae sd a1,192(sp) + 800043f2: 07f00513 li a0,127 + 800043f6: 2ab56463 bltu a0,a1,8000469e <.LBB3_76+0x16> + 800043fa: a009 j 800043fc <.LBB3_74+0xaa> + 800043fc: 754e ld a0,240(sp) + 800043fe: 658e ld a1,192(sp) + 80004400: 952e add a0,a0,a1 + 80004402: 01854503 lbu a0,24(a0) + 80004406: 45a9 li a1,10 + while console.edit_index != console.write_index && + 80004408: f6b516e3 bne a0,a1,80004374 <.LBB3_74+0x22> + 8000440c: bf85 j 8000437c <.LBB3_74+0x2a> + match c { + 8000440e: a49d j 80004674 <.LBB3_75+0x14> + 80004410: 0a08 addi a0,sp,272 + console.edit_index -= Wrapping(1); + 80004412: 0000e097 auipc ra,0xe + 80004416: 9ca080e7 jalr -1590(ra) # 80011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E> + 8000441a: fd2a sd a0,184(sp) + 8000441c: a009 j 8000441e <.LBB3_74+0xcc> + 8000441e: 756a ld a0,184(sp) + 80004420: 0541 addi a0,a0,16 + 80004422: 4585 li a1,1 + 80004424: f62e sd a1,296(sp) + 80004426: 00003097 auipc ra,0x3 + 8000442a: 1de080e7 jalr 478(ra) # 80007604 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..SubAssign$GT$10sub_assign17h67a53f3fa0ccb70bE> + 8000442e: a009 j 80004430 <.LBB3_74+0xde> + 80004430: 4521 li a0,8 + putc(CTRL_BS); + 80004432: 00000097 auipc ra,0x0 + 80004436: aca080e7 jalr -1334(ra) # 80003efc <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE> + 8000443a: a009 j 8000443c <.LBB3_74+0xea> + while console.edit_index != console.write_index && + 8000443c: b72d j 80004366 <.LBB3_74+0x14> + 8000443e: 0a08 addi a0,sp,272 + if console.edit_index != console.write_index { + 80004440: 0000e097 auipc ra,0xe + 80004444: 8de080e7 jalr -1826(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80004448: f92a sd a0,176(sp) + 8000444a: a009 j 8000444c <.LBB3_74+0xfa> + 8000444c: 754a ld a0,176(sp) + 8000444e: 0541 addi a0,a0,16 + 80004450: f12a sd a0,160(sp) + 80004452: 0a08 addi a0,sp,272 + 80004454: 0000e097 auipc ra,0xe + 80004458: 8ca080e7 jalr -1846(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 8000445c: f52a sd a0,168(sp) + 8000445e: a009 j 80004460 <.LBB3_74+0x10e> + 80004460: 750a ld a0,160(sp) + 80004462: 75aa ld a1,168(sp) + 80004464: 05a1 addi a1,a1,8 + 80004466: 0000c097 auipc ra,0xc + 8000446a: b50080e7 jalr -1200(ra) # 8000ffb6 <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2ne17h2d3bd6a577efe0b1E> + 8000446e: ed2a sd a0,152(sp) + 80004470: a009 j 80004472 <.LBB3_74+0x120> + 80004472: 656a ld a0,152(sp) + 80004474: 4581 li a1,0 + 80004476: 00b50a63 beq a0,a1,8000448a <.LBB3_74+0x138> + 8000447a: a009 j 8000447c <.LBB3_74+0x12a> + 8000447c: 0a08 addi a0,sp,272 + console.edit_index -= Wrapping(1); + 8000447e: 0000e097 auipc ra,0xe + 80004482: 95e080e7 jalr -1698(ra) # 80011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E> + 80004486: e92a sd a0,144(sp) + 80004488: a011 j 8000448c <.LBB3_74+0x13a> + if console.edit_index != console.write_index { + 8000448a: a2ed j 80004674 <.LBB3_75+0x14> + console.edit_index -= Wrapping(1); + 8000448c: 654a ld a0,144(sp) + 8000448e: 0541 addi a0,a0,16 + 80004490: 4585 li a1,1 + 80004492: fa2e sd a1,304(sp) + 80004494: 00003097 auipc ra,0x3 + 80004498: 170080e7 jalr 368(ra) # 80007604 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..SubAssign$GT$10sub_assign17h67a53f3fa0ccb70bE> + 8000449c: a009 j 8000449e <.LBB3_74+0x14c> + 8000449e: 4521 li a0,8 + putc(CTRL_BS); + 800044a0: 00000097 auipc ra,0x0 + 800044a4: a5c080e7 jalr -1444(ra) # 80003efc <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE> + 800044a8: a009 j 800044aa <.LBB3_74+0x158> + if console.edit_index != console.write_index { + 800044aa: a2e9 j 80004674 <.LBB3_75+0x14> + 800044ac: 4505 li a0,1 + if c != 0 && (console.edit_index - console.read_index).0 < INPUT_BUF { + 800044ae: 12a10f23 sb a0,318(sp) + 800044b2: a821 j 800044ca <.LBB3_74+0x178> + 800044b4: 4501 li a0,0 + 800044b6: 12a10f23 sb a0,318(sp) + 800044ba: a801 j 800044ca <.LBB3_74+0x178> + 800044bc: 0a08 addi a0,sp,272 + 800044be: 0000e097 auipc ra,0xe + 800044c2: 860080e7 jalr -1952(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 800044c6: e52a sd a0,136(sp) + 800044c8: a031 j 800044d4 <.LBB3_74+0x182> + 800044ca: 13e14503 lbu a0,318(sp) + 800044ce: 8905 andi a0,a0,1 + 800044d0: e91d bnez a0,80004506 <.LBB3_74+0x1b4> + 800044d2: a089 j 80004514 <.LBB3_74+0x1c2> + 800044d4: 652a ld a0,136(sp) + 800044d6: 6908 ld a0,16(a0) + 800044d8: fcaa sd a0,120(sp) + 800044da: 0a08 addi a0,sp,272 + 800044dc: 0000e097 auipc ra,0xe + 800044e0: 842080e7 jalr -1982(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 800044e4: e12a sd a0,128(sp) + 800044e6: a009 j 800044e8 <.LBB3_74+0x196> + 800044e8: 7566 ld a0,120(sp) + 800044ea: 658a ld a1,128(sp) + 800044ec: 618c ld a1,0(a1) + 800044ee: 00003097 auipc ra,0x3 + 800044f2: 0d4080e7 jalr 212(ra) # 800075c2 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Sub$GT$3sub17h09c98f8a3aa1050aE> + 800044f6: f8aa sd a0,112(sp) + 800044f8: a009 j 800044fa <.LBB3_74+0x1a8> + 800044fa: 7546 ld a0,112(sp) + 800044fc: 08000593 li a1,128 + 80004500: fab566e3 bltu a0,a1,800044ac <.LBB3_74+0x15a> + 80004504: bf45 j 800044b4 <.LBB3_74+0x162> + let c = if c == CTRL_CR { CTRL_LF } else { c }; + 80004506: 6512 ld a0,256(sp) + 80004508: 0ff57513 andi a0,a0,255 + 8000450c: 45b5 li a1,13 + 8000450e: 00b50463 beq a0,a1,80004516 <.LBB3_74+0x1c4> + 80004512: a031 j 8000451e <.LBB3_74+0x1cc> + if c != 0 && (console.edit_index - console.read_index).0 < INPUT_BUF { + 80004514: a285 j 80004674 <.LBB3_75+0x14> + 80004516: 4529 li a0,10 + let c = if c == CTRL_CR { CTRL_LF } else { c }; + 80004518: 12a10fa3 sb a0,319(sp) + 8000451c: a029 j 80004526 <.LBB3_74+0x1d4> + 8000451e: 6512 ld a0,256(sp) + 80004520: 12a10fa3 sb a0,319(sp) + 80004524: a009 j 80004526 <.LBB3_74+0x1d4> + putc(c); + 80004526: 13f10503 lb a0,319(sp) + 8000452a: 00000097 auipc ra,0x0 + 8000452e: 9d2080e7 jalr -1582(ra) # 80003efc <_ZN6kernel6driver7console4putc17h15d6d35ca2ac864eE> + 80004532: a009 j 80004534 <.LBB3_74+0x1e2> + 80004534: 0a08 addi a0,sp,272 + let edit_index = console.edit_index.0 % INPUT_BUF; + 80004536: 0000d097 auipc ra,0xd + 8000453a: 7e8080e7 jalr 2024(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 8000453e: f4aa sd a0,104(sp) + 80004540: a009 j 80004542 <.LBB3_74+0x1f0> + 80004542: 7526 ld a0,104(sp) + 80004544: 6908 ld a0,16(a0) + 80004546: 07f57513 andi a0,a0,127 + 8000454a: e8aa sd a0,80(sp) + 8000454c: eaaa sd a0,336(sp) + console.buf[edit_index] = c; + 8000454e: 13f14503 lbu a0,319(sp) + 80004552: ecaa sd a0,88(sp) + 80004554: 0a08 addi a0,sp,272 + 80004556: 0000e097 auipc ra,0xe + 8000455a: 886080e7 jalr -1914(ra) # 80011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E> + 8000455e: f0aa sd a0,96(sp) + 80004560: a009 j 80004562 <.LBB3_74+0x210> + 80004562: 65c6 ld a1,80(sp) + 80004564: 07f00513 li a0,127 + 80004568: 10b56f63 bltu a0,a1,80004686 <.LBB3_75+0x26> + 8000456c: a009 j 8000456e <.LBB3_74+0x21c> + 8000456e: 6566 ld a0,88(sp) + 80004570: 7586 ld a1,96(sp) + 80004572: 6646 ld a2,80(sp) + 80004574: 95b2 add a1,a1,a2 + 80004576: 00a58c23 sb a0,24(a1) + 8000457a: 0a08 addi a0,sp,272 + console.edit_index += Wrapping(1); + 8000457c: 0000e097 auipc ra,0xe + 80004580: 860080e7 jalr -1952(ra) # 80011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E> + 80004584: e4aa sd a0,72(sp) + 80004586: a009 j 80004588 <.LBB3_74+0x236> + 80004588: 6526 ld a0,72(sp) + 8000458a: 0541 addi a0,a0,16 + 8000458c: 4585 li a1,1 + 8000458e: e2ae sd a1,320(sp) + 80004590: 00003097 auipc ra,0x3 + 80004594: 050080e7 jalr 80(ra) # 800075e0 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..AddAssign$GT$10add_assign17hc731864567f3481aE> + 80004598: a009 j 8000459a <.LBB3_74+0x248> + if c == CTRL_LF || c == CTRL_EOT || (console.edit_index - console.read_index).0 == INPUT_BUF { + 8000459a: 13f14503 lbu a0,319(sp) + 8000459e: 45a9 li a1,10 + 800045a0: 02b50763 beq a0,a1,800045ce <.LBB3_74+0x27c> + 800045a4: a82d j 800045de <.LBB3_74+0x28c> + 800045a6: 4505 li a0,1 + 800045a8: 14a106a3 sb a0,333(sp) + 800045ac: a821 j 800045c4 <.LBB3_74+0x272> + 800045ae: 4501 li a0,0 + 800045b0: 14a106a3 sb a0,333(sp) + 800045b4: a801 j 800045c4 <.LBB3_74+0x272> + 800045b6: 0a08 addi a0,sp,272 + 800045b8: 0000d097 auipc ra,0xd + 800045bc: 766080e7 jalr 1894(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 800045c0: e0aa sd a0,64(sp) + 800045c2: a80d j 800045f4 <.LBB3_74+0x2a2> + 800045c4: 14d14503 lbu a0,333(sp) + 800045c8: 8905 andi a0,a0,1 + 800045ca: ed31 bnez a0,80004626 <.LBB3_74+0x2d4> + 800045cc: a0a5 j 80004634 <.LBB3_74+0x2e2> + 800045ce: 4505 li a0,1 + 800045d0: 14a10723 sb a0,334(sp) + 800045d4: a819 j 800045ea <.LBB3_74+0x298> + 800045d6: 4501 li a0,0 + 800045d8: 14a10723 sb a0,334(sp) + 800045dc: a039 j 800045ea <.LBB3_74+0x298> + 800045de: 13f14503 lbu a0,319(sp) + 800045e2: 4591 li a1,4 + 800045e4: feb505e3 beq a0,a1,800045ce <.LBB3_74+0x27c> + 800045e8: b7fd j 800045d6 <.LBB3_74+0x284> + 800045ea: 14e14503 lbu a0,334(sp) + 800045ee: 8905 andi a0,a0,1 + 800045f0: f95d bnez a0,800045a6 <.LBB3_74+0x254> + 800045f2: b7d1 j 800045b6 <.LBB3_74+0x264> + 800045f4: 6506 ld a0,64(sp) + 800045f6: 6908 ld a0,16(a0) + 800045f8: f82a sd a0,48(sp) + 800045fa: 0a08 addi a0,sp,272 + 800045fc: 0000d097 auipc ra,0xd + 80004600: 722080e7 jalr 1826(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80004604: fc2a sd a0,56(sp) + 80004606: a009 j 80004608 <.LBB3_74+0x2b6> + 80004608: 7542 ld a0,48(sp) + 8000460a: 75e2 ld a1,56(sp) + 8000460c: 618c ld a1,0(a1) + 8000460e: 00003097 auipc ra,0x3 + 80004612: fb4080e7 jalr -76(ra) # 800075c2 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Sub$GT$3sub17h09c98f8a3aa1050aE> + 80004616: f42a sd a0,40(sp) + 80004618: a009 j 8000461a <.LBB3_74+0x2c8> + 8000461a: 7522 ld a0,40(sp) + 8000461c: 08000593 li a1,128 + 80004620: f8b503e3 beq a0,a1,800045a6 <.LBB3_74+0x254> + 80004624: b769 j 800045ae <.LBB3_74+0x25c> + 80004626: 0a08 addi a0,sp,272 + console.write_index = console.edit_index; + 80004628: 0000d097 auipc ra,0xd + 8000462c: 6f6080e7 jalr 1782(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 80004630: f02a sd a0,32(sp) + 80004632: a011 j 80004636 <.LBB3_74+0x2e4> + if c == CTRL_LF || c == CTRL_EOT || (console.edit_index - console.read_index).0 == INPUT_BUF { + 80004634: a081 j 80004674 <.LBB3_75+0x14> + console.write_index = console.edit_index; + 80004636: 7502 ld a0,32(sp) + 80004638: 6908 ld a0,16(a0) + 8000463a: e82a sd a0,16(sp) + 8000463c: 0a08 addi a0,sp,272 + 8000463e: 0000d097 auipc ra,0xd + 80004642: 79e080e7 jalr 1950(ra) # 80011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E> + 80004646: ec2a sd a0,24(sp) + 80004648: a009 j 8000464a <.LBB3_74+0x2f8> + 8000464a: 6542 ld a0,16(sp) + 8000464c: 65e2 ld a1,24(sp) + 8000464e: e588 sd a0,8(a1) + 80004650: 0a08 addi a0,sp,272 + // 当检测到用户换行的时候,唤醒 `console_read` 进行读取 + unsafe{ + PROC_MANAGER.wake_up(&console.read_index as *const _ as usize) + 80004652: 0000d097 auipc ra,0xd + 80004656: 6cc080e7 jalr 1740(ra) # 80011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E> + 8000465a: e42a sd a0,8(sp) + 8000465c: a009 j 8000465e <.LBB3_74+0x30c> + 8000465e: 65a2 ld a1,8(sp) + +0000000080004660 <.LBB3_75>: + 80004660: 00055517 auipc a0,0x55 + 80004664: d7050513 addi a0,a0,-656 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80004668: 0000a097 auipc ra,0xa + 8000466c: b98080e7 jalr -1128(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 80004670: a009 j 80004672 <.LBB3_75+0x12> + if c == CTRL_LF || c == CTRL_EOT || (console.edit_index - console.read_index).0 == INPUT_BUF { + 80004672: a009 j 80004674 <.LBB3_75+0x14> + 80004674: 0a08 addi a0,sp,272 + }; + } + } + } + } +} + 80004676: 00003097 auipc ra,0x3 + 8000467a: bda080e7 jalr -1062(ra) # 80007250 <_ZN4core3ptr98drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..console..Console$GT$$GT$17hbea8b3b0221deadaE> + 8000467e: a009 j 80004680 <.LBB3_75+0x20> + 80004680: 60f6 ld ra,344(sp) + 80004682: 6135 addi sp,sp,352 + 80004684: 8082 ret + console.buf[edit_index] = c; + 80004686: 6546 ld a0,80(sp) + +0000000080004688 <.LBB3_76>: + 80004688: 00023617 auipc a2,0x23 + 8000468c: 9a060613 addi a2,a2,-1632 # 80027028 <.L__unnamed_8> + 80004690: 08000593 li a1,128 + 80004694: 0001f097 auipc ra,0x1f + 80004698: adc080e7 jalr -1316(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000469c: 0000 unimp + console.buf[(console.edit_index - Wrapping(1)).0 % INPUT_BUF] != CTRL_LF { + 8000469e: 650e ld a0,192(sp) + +00000000800046a0 <.LBB3_77>: + 800046a0: 00023617 auipc a2,0x23 + 800046a4: 9a060613 addi a2,a2,-1632 # 80027040 <.L__unnamed_9> + 800046a8: 08000593 li a1,128 + 800046ac: 0001f097 auipc ra,0x1f + 800046b0: ac4080e7 jalr -1340(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6driver7console12console_init17h6fb79c78956ee465E: + +00000000800046b6 <_ZN6kernel6driver7console12console_init17h6fb79c78956ee465E>: + +use core::sync::atomic::AtomicBool; +pub(crate) static PANICKED: AtomicBool = AtomicBool::new(false); + +/// must be called only once in rmain.rs:rust_main +pub unsafe fn console_init() { + 800046b6: 1141 addi sp,sp,-16 + use crate::fs::DEVICE_LIST; + use crate::arch::riscv::qemu::devices::CONSOLE; + super::uart::uart_init(); + 800046b8: e406 sd ra,8(sp) + 800046ba: 00018097 auipc ra,0x18 + 800046be: af4080e7 jalr -1292(ra) # 8001c1ae <_ZN6kernel6driver4uart9uart_init17h01daa242cfe569c9E> + 800046c2: a009 j 800046c4 <.LBB4_2> + +00000000800046c4 <.LBB4_2>: + DEVICE_LIST.table[CONSOLE].write = console_write as *const u8; + 800046c4: 00000517 auipc a0,0x0 + 800046c8: b3050513 addi a0,a0,-1232 # 800041f4 <_ZN6kernel6driver7console13console_write17h0e125bdbb626dc42E> + +00000000800046cc <.LBB4_3>: + 800046cc: 00060597 auipc a1,0x60 + 800046d0: 93458593 addi a1,a1,-1740 # 80064000 <_ZN6kernel2fs7devices11DEVICE_LIST17h17b7683da24e3570E> + 800046d4: ed88 sd a0,24(a1) + +00000000800046d6 <.LBB4_4>: + DEVICE_LIST.table[CONSOLE].read = console_read as *const u8; + 800046d6: 00000517 auipc a0,0x0 + 800046da: 87c50513 addi a0,a0,-1924 # 80003f52 <_ZN6kernel6driver7console12console_read17hbad5452084e392ddE> + 800046de: e988 sd a0,16(a1) + 800046e0: 60a2 ld ra,8(sp) + 800046e2: 0141 addi sp,sp,16 + 800046e4: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic10AtomicBool3new17hb0054f5394c676a1E: + +00000000800046e6 <_ZN4core4sync6atomic10AtomicBool3new17hb0054f5394c676a1E>: + /// let atomic_false = AtomicBool::new(false); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_stable(feature = "const_atomic_new", since = "1.24.0")] + pub const fn new(v: bool) -> AtomicBool { + 800046e6: 1101 addi sp,sp,-32 + 800046e8: ec06 sd ra,24(sp) + 800046ea: 00a10ba3 sb a0,23(sp) + AtomicBool { v: UnsafeCell::new(v as u8) } + 800046ee: 0001f097 auipc ra,0x1f + 800046f2: 80e080e7 jalr -2034(ra) # 80022efc <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17h3aa2f2534c029263E> + 800046f6: e42a sd a0,8(sp) + 800046f8: a009 j 800046fa <_ZN4core4sync6atomic10AtomicBool3new17hb0054f5394c676a1E+0x14> + 800046fa: 6522 ld a0,8(sp) + 800046fc: 00a10823 sb a0,16(sp) + } + 80004700: 60e2 ld ra,24(sp) + 80004702: 6105 addi sp,sp,32 + 80004704: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E: + +0000000080004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E>: + /// + /// assert_eq!(some_bool.load(Ordering::Relaxed), true); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + pub fn load(&self, order: Ordering) -> bool { + 80004706: 7179 addi sp,sp,-48 + 80004708: f406 sd ra,40(sp) + 8000470a: 862e mv a2,a1 + 8000470c: e432 sd a2,8(sp) + 8000470e: ec2a sd a0,24(sp) + 80004710: 02b103a3 sb a1,39(sp) + // SAFETY: any data races are prevented by atomic intrinsics and the raw + // pointer passed in is valid because we got it from a reference. + unsafe { atomic_load(self.v.get(), order) != 0 } + 80004714: 0001e097 auipc ra,0x1e + 80004718: 7e0080e7 jalr 2016(ra) # 80022ef4 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h34ebeaa57b5c7248E> + 8000471c: e82a sd a0,16(sp) + 8000471e: a009 j 80004720 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E+0x1a> + 80004720: 65a2 ld a1,8(sp) + 80004722: 6542 ld a0,16(sp) + 80004724: 0001e097 auipc ra,0x1e + 80004728: 710080e7 jalr 1808(ra) # 80022e34 <_ZN4core4sync6atomic11atomic_load17h7c28be5fa6ab6ea0E> + 8000472c: e02a sd a0,0(sp) + 8000472e: a009 j 80004730 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E+0x2a> + 80004730: 6502 ld a0,0(sp) + 80004732: 0ff57513 andi a0,a0,255 + 80004736: 00a03533 snez a0,a0 + } + 8000473a: 70a2 ld ra,40(sp) + 8000473c: 6145 addi sp,sp,48 + 8000473e: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E: + +0000000080004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E>: + /// assert_eq!(some_bool.load(Ordering::Relaxed), false); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + #[cfg(target_has_atomic = "8")] + pub fn swap(&self, val: bool, order: Ordering) -> bool { + 80004740: 7139 addi sp,sp,-64 + 80004742: fc06 sd ra,56(sp) + 80004744: 86b2 mv a3,a2 + 80004746: e836 sd a3,16(sp) + 80004748: 86ae mv a3,a1 + 8000474a: ec36 sd a3,24(sp) + 8000474c: f42a sd a0,40(sp) + 8000474e: 02b10b23 sb a1,54(sp) + 80004752: 02c10ba3 sb a2,55(sp) + // SAFETY: data races are prevented by atomic intrinsics. + unsafe { atomic_swap(self.v.get(), val as u8, order) != 0 } + 80004756: 0001e097 auipc ra,0x1e + 8000475a: 79e080e7 jalr 1950(ra) # 80022ef4 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h34ebeaa57b5c7248E> + 8000475e: f02a sd a0,32(sp) + 80004760: a009 j 80004762 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E+0x22> + 80004762: 6642 ld a2,16(sp) + 80004764: 65e2 ld a1,24(sp) + 80004766: 7502 ld a0,32(sp) + 80004768: 0000c097 auipc ra,0xc + 8000476c: 080080e7 jalr 128(ra) # 800107e8 <_ZN4core4sync6atomic11atomic_swap17hdd22e709589114eaE> + 80004770: e42a sd a0,8(sp) + 80004772: a009 j 80004774 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E+0x34> + 80004774: 6522 ld a0,8(sp) + 80004776: 0ff57513 andi a0,a0,255 + 8000477a: 00a03533 snez a0,a0 + } + 8000477e: 70e2 ld ra,56(sp) + 80004780: 6121 addi sp,sp,64 + 80004782: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E: + +0000000080004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E>: + pub fn store(&self, val: bool, order: Ordering) { + 80004784: 7179 addi sp,sp,-48 + 80004786: f406 sd ra,40(sp) + 80004788: 86b2 mv a3,a2 + 8000478a: e036 sd a3,0(sp) + 8000478c: 86ae mv a3,a1 + 8000478e: e436 sd a3,8(sp) + 80004790: ec2a sd a0,24(sp) + 80004792: 02b10323 sb a1,38(sp) + 80004796: 02c103a3 sb a2,39(sp) + atomic_store(self.v.get(), val as u8, order); + 8000479a: 0001e097 auipc ra,0x1e + 8000479e: 75a080e7 jalr 1882(ra) # 80022ef4 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h34ebeaa57b5c7248E> + 800047a2: e82a sd a0,16(sp) + 800047a4: a009 j 800047a6 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E+0x22> + 800047a6: 6602 ld a2,0(sp) + 800047a8: 65a2 ld a1,8(sp) + 800047aa: 6542 ld a0,16(sp) + 800047ac: 0000c097 auipc ra,0xc + 800047b0: 188080e7 jalr 392(ra) # 80010934 <_ZN4core4sync6atomic12atomic_store17h031d76ab229dd222E> + 800047b4: a009 j 800047b6 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E+0x32> + } + 800047b6: 70a2 ld ra,40(sp) + 800047b8: 6145 addi sp,sp,48 + 800047ba: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic11AtomicUsize3new17hb5d2654a6be55e11E: + +00000000800047bc <_ZN4core4sync6atomic11AtomicUsize3new17hb5d2654a6be55e11E>: + #[doc = concat!("let atomic_forty_two = ", stringify!($atomic_type), "::new(42);")] + /// ``` + #[inline] + #[$stable] + #[$const_stable] + pub const fn new(v: $int_type) -> Self { + 800047bc: 1101 addi sp,sp,-32 + 800047be: ec06 sd ra,24(sp) + 800047c0: e82a sd a0,16(sp) + Self {v: UnsafeCell::new(v)} + 800047c2: 00001097 auipc ra,0x1 + 800047c6: c0e080e7 jalr -1010(ra) # 800053d0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17h4d1d6404457ffa31E> + 800047ca: e02a sd a0,0(sp) + 800047cc: a009 j 800047ce <_ZN4core4sync6atomic11AtomicUsize3new17hb5d2654a6be55e11E+0x12> + 800047ce: 6502 ld a0,0(sp) + 800047d0: e42a sd a0,8(sp) + } + 800047d2: 60e2 ld ra,24(sp) + 800047d4: 6105 addi sp,sp,32 + 800047d6: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic11AtomicUsize9fetch_add17h9147f412b3f815f9E: + +00000000800047d8 <_ZN4core4sync6atomic11AtomicUsize9fetch_add17h9147f412b3f815f9E>: + /// assert_eq!(foo.load(Ordering::SeqCst), 10); + /// ``` + #[inline] + #[$stable] + #[$cfg_cas] + pub fn fetch_add(&self, val: $int_type, order: Ordering) -> $int_type { + 800047d8: 7139 addi sp,sp,-64 + 800047da: fc06 sd ra,56(sp) + 800047dc: e42e sd a1,8(sp) + 800047de: 86b2 mv a3,a2 + 800047e0: e836 sd a3,16(sp) + 800047e2: f02a sd a0,32(sp) + 800047e4: f42e sd a1,40(sp) + 800047e6: 02c10ba3 sb a2,55(sp) + // SAFETY: data races are prevented by atomic intrinsics. + unsafe { atomic_add(self.v.get(), val, order) } + 800047ea: 0001e097 auipc ra,0x1e + 800047ee: 790080e7 jalr 1936(ra) # 80022f7a <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hcdc438fb74b7ecc8E> + 800047f2: ec2a sd a0,24(sp) + 800047f4: a009 j 800047f6 <_ZN4core4sync6atomic11AtomicUsize9fetch_add17h9147f412b3f815f9E+0x1e> + 800047f6: 6642 ld a2,16(sp) + 800047f8: 65a2 ld a1,8(sp) + 800047fa: 6562 ld a0,24(sp) + 800047fc: 0000c097 auipc ra,0xc + 80004800: ef0080e7 jalr -272(ra) # 800106ec <_ZN4core4sync6atomic10atomic_add17hcefa99837e5e8934E> + 80004804: e02a sd a0,0(sp) + 80004806: a009 j 80004808 <_ZN4core4sync6atomic11AtomicUsize9fetch_add17h9147f412b3f815f9E+0x30> + } + 80004808: 6502 ld a0,0(sp) + 8000480a: 70e2 ld ra,56(sp) + 8000480c: 6121 addi sp,sp,64 + 8000480e: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic11AtomicUsize9fetch_sub17h94fe355041184982E: + +0000000080004810 <_ZN4core4sync6atomic11AtomicUsize9fetch_sub17h94fe355041184982E>: + /// assert_eq!(foo.load(Ordering::SeqCst), 10); + /// ``` + #[inline] + #[$stable] + #[$cfg_cas] + pub fn fetch_sub(&self, val: $int_type, order: Ordering) -> $int_type { + 80004810: 7139 addi sp,sp,-64 + 80004812: fc06 sd ra,56(sp) + 80004814: e42e sd a1,8(sp) + 80004816: 86b2 mv a3,a2 + 80004818: e836 sd a3,16(sp) + 8000481a: f02a sd a0,32(sp) + 8000481c: f42e sd a1,40(sp) + 8000481e: 02c10ba3 sb a2,55(sp) + // SAFETY: data races are prevented by atomic intrinsics. + unsafe { atomic_sub(self.v.get(), val, order) } + 80004822: 0001e097 auipc ra,0x1e + 80004826: 758080e7 jalr 1880(ra) # 80022f7a <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hcdc438fb74b7ecc8E> + 8000482a: ec2a sd a0,24(sp) + 8000482c: a009 j 8000482e <_ZN4core4sync6atomic11AtomicUsize9fetch_sub17h94fe355041184982E+0x1e> + 8000482e: 6642 ld a2,16(sp) + 80004830: 65a2 ld a1,8(sp) + 80004832: 6562 ld a0,24(sp) + 80004834: 0000c097 auipc ra,0xc + 80004838: f2c080e7 jalr -212(ra) # 80010760 <_ZN4core4sync6atomic10atomic_sub17ha62074418a99a7bbE> + 8000483c: e02a sd a0,0(sp) + 8000483e: a009 j 80004840 <_ZN4core4sync6atomic11AtomicUsize9fetch_sub17h94fe355041184982E+0x30> + } + 80004840: 6502 ld a0,0(sp) + 80004842: 70e2 ld ra,56(sp) + 80004844: 6121 addi sp,sp,64 + 80004846: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E: + +0000000080004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E>: +/// } +/// } +/// ``` +#[inline] +#[stable(feature = "rust1", since = "1.0.0")] +pub fn fence(order: Ordering) { + 80004848: 1101 addi sp,sp,-32 + 8000484a: 00a10ba3 sb a0,23(sp) + // SAFETY: using an atomic fence is safe. + unsafe { + match order { + Acquire => intrinsics::atomic_fence_acq(), + 8000484e: 0ff57513 andi a0,a0,255 + 80004852: e42a sd a0,8(sp) + 80004854: 6522 ld a0,8(sp) + 80004856: 050e slli a0,a0,0x3 + +0000000080004858 <.LBB7_9>: + 80004858: 00023597 auipc a1,0x23 + 8000485c: 80058593 addi a1,a1,-2048 # 80027058 <.LJTI7_0> + 80004860: 952e add a0,a0,a1 + 80004862: 6108 ld a0,0(a0) + 80004864: 8502 jr a0 + +0000000080004866 <.LBB7_10>: + Release => intrinsics::atomic_fence_rel(), + AcqRel => intrinsics::atomic_fence_acqrel(), + SeqCst => intrinsics::atomic_fence(), + Relaxed => panic!("there is no such thing as a relaxed fence"), + 80004866: 00023517 auipc a0,0x23 + 8000486a: 81a50513 addi a0,a0,-2022 # 80027080 <.L__unnamed_1> + +000000008000486e <.LBB7_11>: + 8000486e: 00023617 auipc a2,0x23 + 80004872: 8ba60613 addi a2,a2,-1862 # 80027128 <.L__unnamed_2> + 80004876: 02900593 li a1,41 + 8000487a: 0001f097 auipc ra,0x1f + 8000487e: 8ca080e7 jalr -1846(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80004882: 0000 unimp + ... + +0000000080004886 <.LBB7_4>: + Acquire => intrinsics::atomic_fence_acq(), + 80004886: 0230000f fence r,rw + 8000488a: a811 j 8000489e <.LBB7_7+0x6> + +000000008000488c <.LBB7_5>: + Release => intrinsics::atomic_fence_rel(), + 8000488c: 0310000f fence rw,w + 80004890: a039 j 8000489e <.LBB7_7+0x6> + +0000000080004892 <.LBB7_6>: + AcqRel => intrinsics::atomic_fence_acqrel(), + 80004892: 8330000f fence.tso + 80004896: a021 j 8000489e <.LBB7_7+0x6> + +0000000080004898 <.LBB7_7>: + SeqCst => intrinsics::atomic_fence(), + 80004898: 0330000f fence rw,rw + 8000489c: a009 j 8000489e <.LBB7_7+0x6> + } + } +} + 8000489e: 6105 addi sp,sp,32 + 800048a0: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$12wrapping_add17h10470fd1e83789bbE: + +00000000800048a2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$12wrapping_add17h10470fd1e83789bbE>: + /// ``` + #[stable(feature = "pointer_methods", since = "1.26.0")] + #[must_use = "returns a new pointer rather than modifying its argument"] + #[rustc_const_unstable(feature = "const_ptr_offset", issue = "71499")] + #[inline] + pub const fn wrapping_add(self, count: usize) -> Self + 800048a2: 1101 addi sp,sp,-32 + 800048a4: ec06 sd ra,24(sp) + 800048a6: e42a sd a0,8(sp) + 800048a8: e82e sd a1,16(sp) + where + T: Sized, + { + self.wrapping_offset(count as isize) + 800048aa: 00000097 auipc ra,0x0 + 800048ae: 014080e7 jalr 20(ra) # 800048be <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$15wrapping_offset17hf5c823f0de9373d9E> + 800048b2: e02a sd a0,0(sp) + 800048b4: a009 j 800048b6 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$12wrapping_add17h10470fd1e83789bbE+0x14> + } + 800048b6: 6502 ld a0,0(sp) + 800048b8: 60e2 ld ra,24(sp) + 800048ba: 6105 addi sp,sp,32 + 800048bc: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$15wrapping_offset17hf5c823f0de9373d9E: + +00000000800048be <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$15wrapping_offset17hf5c823f0de9373d9E>: + pub const fn wrapping_offset(self, count: isize) -> *const T + 800048be: 1101 addi sp,sp,-32 + 800048c0: e42a sd a0,8(sp) + 800048c2: e82e sd a1,16(sp) + unsafe { intrinsics::arith_offset(self, count) } + 800048c4: 952e add a0,a0,a1 + 800048c6: e02a sd a0,0(sp) + 800048c8: ec2a sd a0,24(sp) + 800048ca: a009 j 800048cc <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$15wrapping_offset17hf5c823f0de9373d9E+0xe> + } + 800048cc: 6502 ld a0,0(sp) + 800048ce: 6105 addi sp,sp,32 + 800048d0: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$4cast17h03bc1f4ed09a4b3cE: + +00000000800048d2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$4cast17h03bc1f4ed09a4b3cE>: + pub const fn cast(self) -> *const U { + 800048d2: 1141 addi sp,sp,-16 + 800048d4: e42a sd a0,8(sp) + } + 800048d6: 0141 addi sp,sp,16 + 800048d8: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$4cast17he44352a5ab45ee06E: + +00000000800048da <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$4cast17he44352a5ab45ee06E>: + pub const fn cast(self) -> *const U { + 800048da: 1141 addi sp,sp,-16 + 800048dc: e42a sd a0,8(sp) + } + 800048de: 0141 addi sp,sp,16 + 800048e0: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h936ab5e813f51efdE: + +00000000800048e2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h936ab5e813f51efdE>: + pub const unsafe fn offset(self, count: isize) -> *const T + 800048e2: 1101 addi sp,sp,-32 + 800048e4: e42a sd a0,8(sp) + 800048e6: e82e sd a1,16(sp) + unsafe { intrinsics::offset(self, count) } + 800048e8: 058a slli a1,a1,0x2 + 800048ea: 952e add a0,a0,a1 + 800048ec: e02a sd a0,0(sp) + 800048ee: ec2a sd a0,24(sp) + 800048f0: a009 j 800048f2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h936ab5e813f51efdE+0x10> + } + 800048f2: 6502 ld a0,0(sp) + 800048f4: 6105 addi sp,sp,32 + 800048f6: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7address4Addr15is_page_aligned17h21d9aa1b7bd151ebE: + +00000000800048f8 <_ZN6kernel6memory7address4Addr15is_page_aligned17h21d9aa1b7bd151ebE>: + fn data_ref(&self) -> &usize; + + fn data_mut(&mut self) -> &mut usize; + + #[inline] + fn is_page_aligned(&self) -> bool{ + 800048f8: 1101 addi sp,sp,-32 + 800048fa: ec06 sd ra,24(sp) + 800048fc: e82a sd a0,16(sp) + self.as_usize() % PGSIZE == 0 + 800048fe: 0000d097 auipc ra,0xd + 80004902: 624080e7 jalr 1572(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80004906: e42a sd a0,8(sp) + 80004908: a009 j 8000490a <_ZN6kernel6memory7address4Addr15is_page_aligned17h21d9aa1b7bd151ebE+0x12> + 8000490a: 6522 ld a0,8(sp) + 8000490c: 6585 lui a1,0x1 + 8000490e: 35fd addiw a1,a1,-1 + 80004910: 8d6d and a0,a0,a1 + 80004912: 00153513 seqz a0,a0 + } + 80004916: 60e2 ld ra,24(sp) + 80004918: 6105 addi sp,sp,32 + 8000491a: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7address4Addr10as_mut_ptr17hfa59607f4391fdb5E: + +000000008000491c <_ZN6kernel6memory7address4Addr10as_mut_ptr17hfa59607f4391fdb5E>: + fn as_ptr(&self) -> *const u8{ + self.as_usize() as *const u8 + } + + #[inline] + fn as_mut_ptr(&self) -> *mut u8{ + 8000491c: 1101 addi sp,sp,-32 + 8000491e: ec06 sd ra,24(sp) + 80004920: e82a sd a0,16(sp) + self.as_usize() as *mut u8 + 80004922: 0000d097 auipc ra,0xd + 80004926: 612080e7 jalr 1554(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 8000492a: e42a sd a0,8(sp) + 8000492c: a009 j 8000492e <_ZN6kernel6memory7address4Addr10as_mut_ptr17hfa59607f4391fdb5E+0x12> + } + 8000492e: 6522 ld a0,8(sp) + 80004930: 60e2 ld ra,24(sp) + 80004932: 6105 addi sp,sp,32 + 80004934: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7address4Addr11pg_round_up17h43579bab3405c977E: + +0000000080004936 <_ZN6kernel6memory7address4Addr11pg_round_up17h43579bab3405c977E>: + + #[inline] + fn pg_round_up(&mut self) { + 80004936: 7139 addi sp,sp,-64 + 80004938: fc06 sd ra,56(sp) + 8000493a: f02a sd a0,32(sp) + 8000493c: f82a sd a0,48(sp) + *self.data_mut() = (*self.data_mut() + PGSIZE - 1) & !(PGSIZE - 1) + 8000493e: 0000d097 auipc ra,0xd + 80004942: 5ee080e7 jalr 1518(ra) # 80011f2c <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h88794159bc97d31bE> + 80004946: f42a sd a0,40(sp) + 80004948: a009 j 8000494a <_ZN6kernel6memory7address4Addr11pg_round_up17h43579bab3405c977E+0x14> + 8000494a: 7522 ld a0,40(sp) + 8000494c: 610c ld a1,0(a0) + 8000494e: 6505 lui a0,0x1 + 80004950: 952e add a0,a0,a1 + 80004952: ec2a sd a0,24(sp) + 80004954: 02b56963 bltu a0,a1,80004986 <.LBB2_7> + 80004958: a009 j 8000495a <_ZN6kernel6memory7address4Addr11pg_round_up17h43579bab3405c977E+0x24> + 8000495a: 6562 ld a0,24(sp) + 8000495c: fff50593 addi a1,a0,-1 # fff <.Lline_table_start0+0x13f> + 80004960: e82e sd a1,16(sp) + 80004962: 04b56063 bltu a0,a1,800049a2 <.LBB2_9> + 80004966: a009 j 80004968 <_ZN6kernel6memory7address4Addr11pg_round_up17h43579bab3405c977E+0x32> + 80004968: 7502 ld a0,32(sp) + 8000496a: 0000d097 auipc ra,0xd + 8000496e: 5c2080e7 jalr 1474(ra) # 80011f2c <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h88794159bc97d31bE> + 80004972: e42a sd a0,8(sp) + 80004974: a009 j 80004976 <_ZN6kernel6memory7address4Addr11pg_round_up17h43579bab3405c977E+0x40> + 80004976: 65a2 ld a1,8(sp) + 80004978: 6542 ld a0,16(sp) + 8000497a: 767d lui a2,0xfffff + 8000497c: 8d71 and a0,a0,a2 + 8000497e: e188 sd a0,0(a1) + } + 80004980: 70e2 ld ra,56(sp) + 80004982: 6121 addi sp,sp,64 + 80004984: 8082 ret + +0000000080004986 <.LBB2_7>: + *self.data_mut() = (*self.data_mut() + PGSIZE - 1) & !(PGSIZE - 1) + 80004986: 00022517 auipc a0,0x22 + 8000498a: 7ea50513 addi a0,a0,2026 # 80027170 + +000000008000498e <.LBB2_8>: + 8000498e: 00022617 auipc a2,0x22 + 80004992: 7ca60613 addi a2,a2,1994 # 80027158 <.L__unnamed_1> + 80004996: 45f1 li a1,28 + 80004998: 0001e097 auipc ra,0x1e + 8000499c: 7ac080e7 jalr 1964(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800049a2 <.LBB2_9>: + 800049a2: 00023517 auipc a0,0x23 + 800049a6: 80e50513 addi a0,a0,-2034 # 800271b0 + +00000000800049aa <.LBB2_10>: + 800049aa: 00022617 auipc a2,0x22 + 800049ae: 7e660613 addi a2,a2,2022 # 80027190 <.L__unnamed_2> + 800049b2: 02100593 li a1,33 + 800049b6: 0001e097 auipc ra,0x1e + 800049ba: 78e080e7 jalr 1934(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7address4Addr11pg_round_up17h93ce0bf629830ebdE: + +00000000800049c0 <_ZN6kernel6memory7address4Addr11pg_round_up17h93ce0bf629830ebdE>: + fn pg_round_up(&mut self) { + 800049c0: 7139 addi sp,sp,-64 + 800049c2: fc06 sd ra,56(sp) + 800049c4: f02a sd a0,32(sp) + 800049c6: f82a sd a0,48(sp) + *self.data_mut() = (*self.data_mut() + PGSIZE - 1) & !(PGSIZE - 1) + 800049c8: 0000d097 auipc ra,0xd + 800049cc: 576080e7 jalr 1398(ra) # 80011f3e <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h98a368b1f7383ca3E> + 800049d0: f42a sd a0,40(sp) + 800049d2: a009 j 800049d4 <_ZN6kernel6memory7address4Addr11pg_round_up17h93ce0bf629830ebdE+0x14> + 800049d4: 7522 ld a0,40(sp) + 800049d6: 610c ld a1,0(a0) + 800049d8: 6505 lui a0,0x1 + 800049da: 952e add a0,a0,a1 + 800049dc: ec2a sd a0,24(sp) + 800049de: 02b56963 bltu a0,a1,80004a10 <.LBB3_7> + 800049e2: a009 j 800049e4 <_ZN6kernel6memory7address4Addr11pg_round_up17h93ce0bf629830ebdE+0x24> + 800049e4: 6562 ld a0,24(sp) + 800049e6: fff50593 addi a1,a0,-1 # fff <.Lline_table_start0+0x13f> + 800049ea: e82e sd a1,16(sp) + 800049ec: 04b56063 bltu a0,a1,80004a2c <.LBB3_9> + 800049f0: a009 j 800049f2 <_ZN6kernel6memory7address4Addr11pg_round_up17h93ce0bf629830ebdE+0x32> + 800049f2: 7502 ld a0,32(sp) + 800049f4: 0000d097 auipc ra,0xd + 800049f8: 54a080e7 jalr 1354(ra) # 80011f3e <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h98a368b1f7383ca3E> + 800049fc: e42a sd a0,8(sp) + 800049fe: a009 j 80004a00 <_ZN6kernel6memory7address4Addr11pg_round_up17h93ce0bf629830ebdE+0x40> + 80004a00: 65a2 ld a1,8(sp) + 80004a02: 6542 ld a0,16(sp) + 80004a04: 767d lui a2,0xfffff + 80004a06: 8d71 and a0,a0,a2 + 80004a08: e188 sd a0,0(a1) + } + 80004a0a: 70e2 ld ra,56(sp) + 80004a0c: 6121 addi sp,sp,64 + 80004a0e: 8082 ret + +0000000080004a10 <.LBB3_7>: + *self.data_mut() = (*self.data_mut() + PGSIZE - 1) & !(PGSIZE - 1) + 80004a10: 00022517 auipc a0,0x22 + 80004a14: 76050513 addi a0,a0,1888 # 80027170 + +0000000080004a18 <.LBB3_8>: + 80004a18: 00022617 auipc a2,0x22 + 80004a1c: 74060613 addi a2,a2,1856 # 80027158 <.L__unnamed_1> + 80004a20: 45f1 li a1,28 + 80004a22: 0001e097 auipc ra,0x1e + 80004a26: 722080e7 jalr 1826(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080004a2c <.LBB3_9>: + 80004a2c: 00022517 auipc a0,0x22 + 80004a30: 78450513 addi a0,a0,1924 # 800271b0 + +0000000080004a34 <.LBB3_10>: + 80004a34: 00022617 auipc a2,0x22 + 80004a38: 75c60613 addi a2,a2,1884 # 80027190 <.L__unnamed_2> + 80004a3c: 02100593 li a1,33 + 80004a40: 0001e097 auipc ra,0x1e + 80004a44: 704080e7 jalr 1796(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE: + +0000000080004a4a <_ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE>: + + #[inline] + fn pg_round_down(&mut self) { + 80004a4a: 7179 addi sp,sp,-48 + 80004a4c: f406 sd ra,40(sp) + 80004a4e: e82a sd a0,16(sp) + 80004a50: f02a sd a0,32(sp) + *self.data_mut() = *self.data_mut() & !(PGSIZE - 1) + 80004a52: 0000d097 auipc ra,0xd + 80004a56: 4da080e7 jalr 1242(ra) # 80011f2c <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h88794159bc97d31bE> + 80004a5a: ec2a sd a0,24(sp) + 80004a5c: a009 j 80004a5e <_ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE+0x14> + 80004a5e: 6542 ld a0,16(sp) + 80004a60: 65e2 ld a1,24(sp) + 80004a62: 618c ld a1,0(a1) + 80004a64: e02e sd a1,0(sp) + 80004a66: 0000d097 auipc ra,0xd + 80004a6a: 4c6080e7 jalr 1222(ra) # 80011f2c <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h88794159bc97d31bE> + 80004a6e: e42a sd a0,8(sp) + 80004a70: a009 j 80004a72 <_ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE+0x28> + 80004a72: 65a2 ld a1,8(sp) + 80004a74: 6502 ld a0,0(sp) + 80004a76: 767d lui a2,0xfffff + 80004a78: 8d71 and a0,a0,a2 + 80004a7a: e188 sd a0,0(a1) + } + 80004a7c: 70a2 ld ra,40(sp) + 80004a7e: 6145 addi sp,sp,48 + 80004a80: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7address4Addr8add_page17h93c7d6ddd860f6baE: + +0000000080004a82 <_ZN6kernel6memory7address4Addr8add_page17h93c7d6ddd860f6baE>: + + #[inline] + fn add_page(&mut self){ + 80004a82: 1101 addi sp,sp,-32 + 80004a84: ec06 sd ra,24(sp) + 80004a86: e82a sd a0,16(sp) + *self.data_mut() += PGSIZE; + 80004a88: 0000d097 auipc ra,0xd + 80004a8c: 4b6080e7 jalr 1206(ra) # 80011f3e <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h98a368b1f7383ca3E> + 80004a90: e42a sd a0,8(sp) + 80004a92: a009 j 80004a94 <_ZN6kernel6memory7address4Addr8add_page17h93c7d6ddd860f6baE+0x12> + 80004a94: 6522 ld a0,8(sp) + 80004a96: 610c ld a1,0(a0) + 80004a98: 6505 lui a0,0x1 + 80004a9a: 952e add a0,a0,a1 + 80004a9c: e02a sd a0,0(sp) + 80004a9e: 00b56963 bltu a0,a1,80004ab0 <.LBB5_4> + 80004aa2: a009 j 80004aa4 <_ZN6kernel6memory7address4Addr8add_page17h93c7d6ddd860f6baE+0x22> + 80004aa4: 6502 ld a0,0(sp) + 80004aa6: 65a2 ld a1,8(sp) + 80004aa8: e188 sd a0,0(a1) + } + 80004aaa: 60e2 ld ra,24(sp) + 80004aac: 6105 addi sp,sp,32 + 80004aae: 8082 ret + +0000000080004ab0 <.LBB5_4>: + *self.data_mut() += PGSIZE; + 80004ab0: 00022517 auipc a0,0x22 + 80004ab4: 6c050513 addi a0,a0,1728 # 80027170 + +0000000080004ab8 <.LBB5_5>: + 80004ab8: 00022617 auipc a2,0x22 + 80004abc: 72060613 addi a2,a2,1824 # 800271d8 <.L__unnamed_3> + 80004ac0: 45f1 li a1,28 + 80004ac2: 0001e097 auipc ra,0x1e + 80004ac6: 682080e7 jalr 1666(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE: + +0000000080004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE>: + fn add_page(&mut self){ + 80004acc: 1101 addi sp,sp,-32 + 80004ace: ec06 sd ra,24(sp) + 80004ad0: e82a sd a0,16(sp) + *self.data_mut() += PGSIZE; + 80004ad2: 0000d097 auipc ra,0xd + 80004ad6: 45a080e7 jalr 1114(ra) # 80011f2c <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h88794159bc97d31bE> + 80004ada: e42a sd a0,8(sp) + 80004adc: a009 j 80004ade <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE+0x12> + 80004ade: 6522 ld a0,8(sp) + 80004ae0: 610c ld a1,0(a0) + 80004ae2: 6505 lui a0,0x1 + 80004ae4: 952e add a0,a0,a1 + 80004ae6: e02a sd a0,0(sp) + 80004ae8: 00b56963 bltu a0,a1,80004afa <.LBB6_4> + 80004aec: a009 j 80004aee <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE+0x22> + 80004aee: 6502 ld a0,0(sp) + 80004af0: 65a2 ld a1,8(sp) + 80004af2: e188 sd a0,0(a1) + } + 80004af4: 60e2 ld ra,24(sp) + 80004af6: 6105 addi sp,sp,32 + 80004af8: 8082 ret + +0000000080004afa <.LBB6_4>: + *self.data_mut() += PGSIZE; + 80004afa: 00022517 auipc a0,0x22 + 80004afe: 67650513 addi a0,a0,1654 # 80027170 + +0000000080004b02 <.LBB6_5>: + 80004b02: 00022617 auipc a2,0x22 + 80004b06: 6d660613 addi a2,a2,1750 # 800271d8 <.L__unnamed_3> + 80004b0a: 45f1 li a1,28 + 80004b0c: 0001e097 auipc ra,0x1e + 80004b10: 638080e7 jalr 1592(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN104_$LT$core..iter..adapters..copied..Copied$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h5c47b4a6235bae37E: + +0000000080004b16 <_ZN104_$LT$core..iter..adapters..copied..Copied$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h5c47b4a6235bae37E>: + I: Iterator, + T: Copy, +{ + type Item = T; + + fn next(&mut self) -> Option { + 80004b16: 7179 addi sp,sp,-48 + 80004b18: f406 sd ra,40(sp) + 80004b1a: f02a sd a0,32(sp) + self.it.next().copied() + 80004b1c: 00007097 auipc ra,0x7 + 80004b20: e82080e7 jalr -382(ra) # 8000b99e <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE> + 80004b24: ec2a sd a0,24(sp) + 80004b26: a009 j 80004b28 <_ZN104_$LT$core..iter..adapters..copied..Copied$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h5c47b4a6235bae37E+0x12> + 80004b28: 6562 ld a0,24(sp) + 80004b2a: 0000b097 auipc ra,0xb + 80004b2e: e78080e7 jalr -392(ra) # 8000f9a2 <_ZN4core6option19Option$LT$$RF$T$GT$6copied17h53fb63a9bdc6d466E> + 80004b32: e42a sd a0,8(sp) + 80004b34: e82e sd a1,16(sp) + 80004b36: a009 j 80004b38 <_ZN104_$LT$core..iter..adapters..copied..Copied$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h5c47b4a6235bae37E+0x22> + } + 80004b38: 65c2 ld a1,16(sp) + 80004b3a: 6522 ld a0,8(sp) + 80004b3c: 8905 andi a0,a0,1 + 80004b3e: 70a2 ld ra,40(sp) + 80004b40: 6145 addi sp,sp,48 + 80004b42: 8082 ret + +Disassembly of section .text._ZN4core4iter8adapters6copied15Copied$LT$I$GT$3new17h07d9127b76ff3571E: + +0000000080004b44 <_ZN4core4iter8adapters6copied15Copied$LT$I$GT$3new17h07d9127b76ff3571E>: + pub(in crate::iter) fn new(it: I) -> Copied { + 80004b44: 1101 addi sp,sp,-32 + 80004b46: e82a sd a0,16(sp) + 80004b48: ec2e sd a1,24(sp) + Copied { it } + 80004b4a: e02a sd a0,0(sp) + 80004b4c: e42e sd a1,8(sp) + } + 80004b4e: 6105 addi sp,sp,32 + 80004b50: 8082 ret + +Disassembly of section .text._ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE: + +0000000080004b52 <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE>: + /// allocation error are encouraged to call the [`handle_alloc_error`] function, + /// rather than directly invoking `panic!` or similar. + /// + /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html + #[stable(feature = "global_alloc", since = "1.28.0")] + unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { + 80004b52: 715d addi sp,sp,-80 + 80004b54: e486 sd ra,72(sp) + 80004b56: e82a sd a0,16(sp) + 80004b58: f02e sd a1,32(sp) + 80004b5a: f432 sd a2,40(sp) + 80004b5c: f82a sd a0,48(sp) + 80004b5e: 1008 addi a0,sp,32 + let size = layout.size(); + 80004b60: 0001b097 auipc ra,0x1b + 80004b64: cfc080e7 jalr -772(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 80004b68: 85aa mv a1,a0 + 80004b6a: ec2e sd a1,24(sp) + 80004b6c: fc2a sd a0,56(sp) + 80004b6e: a009 j 80004b70 <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x1e> + // SAFETY: the safety contract for `alloc` must be upheld by the caller. + let ptr = unsafe { self.alloc(layout) }; + 80004b70: 6542 ld a0,16(sp) + 80004b72: 7582 ld a1,32(sp) + 80004b74: 7622 ld a2,40(sp) + 80004b76: 00008097 auipc ra,0x8 + 80004b7a: 5a2080e7 jalr 1442(ra) # 8000d118 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E> + 80004b7e: 85aa mv a1,a0 + 80004b80: e42e sd a1,8(sp) + 80004b82: e0aa sd a0,64(sp) + 80004b84: a009 j 80004b86 <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x34> + if !ptr.is_null() { + 80004b86: 6522 ld a0,8(sp) + 80004b88: 0001c097 auipc ra,0x1c + 80004b8c: ac8080e7 jalr -1336(ra) # 80020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E> + 80004b90: e02a sd a0,0(sp) + 80004b92: a009 j 80004b94 <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x42> + 80004b94: 6502 ld a0,0(sp) + 80004b96: e911 bnez a0,80004baa <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x58> + 80004b98: a009 j 80004b9a <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x48> + // SAFETY: as allocation succeeded, the region from `ptr` + // of size `size` is guaranteed to be valid for writes. + unsafe { ptr::write_bytes(ptr, 0, size) }; + 80004b9a: 6662 ld a2,24(sp) + 80004b9c: 6522 ld a0,8(sp) + 80004b9e: 4581 li a1,0 + 80004ba0: 0001e097 auipc ra,0x1e + 80004ba4: e5e080e7 jalr -418(ra) # 800229fe <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E> + 80004ba8: a011 j 80004bac <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x5a> + if !ptr.is_null() { + 80004baa: a011 j 80004bae <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x5c> + 80004bac: a009 j 80004bae <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE+0x5c> + } + ptr + } + 80004bae: 6522 ld a0,8(sp) + 80004bb0: 60a6 ld ra,72(sp) + 80004bb2: 6161 addi sp,sp,80 + 80004bb4: 8082 ret + +Disassembly of section .text._ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E: + +0000000080004bb6 <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E>: + /// reallocation error are encouraged to call the [`handle_alloc_error`] function, + /// rather than directly invoking `panic!` or similar. + /// + /// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html + #[stable(feature = "global_alloc", since = "1.28.0")] + unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { + 80004bb6: 7135 addi sp,sp,-160 + 80004bb8: ed06 sd ra,152(sp) + 80004bba: fc3a sd a4,56(sp) + 80004bbc: e0ae sd a1,64(sp) + 80004bbe: e4aa sd a0,72(sp) + 80004bc0: ecb2 sd a2,88(sp) + 80004bc2: f0b6 sd a3,96(sp) + 80004bc4: f4aa sd a0,104(sp) + 80004bc6: f8ae sd a1,112(sp) + 80004bc8: fcba sd a4,120(sp) + 80004bca: 08a8 addi a0,sp,88 + // SAFETY: the caller must ensure that the `new_size` does not overflow. + // `layout.align()` comes from a `Layout` and is thus guaranteed to be valid. + let new_layout = unsafe { Layout::from_size_align_unchecked(new_size, layout.align()) }; + 80004bcc: 0001b097 auipc ra,0x1b + 80004bd0: c9a080e7 jalr -870(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 80004bd4: e8aa sd a0,80(sp) + 80004bd6: a009 j 80004bd8 <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x22> + 80004bd8: 65c6 ld a1,80(sp) + 80004bda: 7562 ld a0,56(sp) + 80004bdc: 0001b097 auipc ra,0x1b + 80004be0: c56080e7 jalr -938(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80004be4: 862a mv a2,a0 + 80004be6: f432 sd a2,40(sp) + 80004be8: 862e mv a2,a1 + 80004bea: f832 sd a2,48(sp) + 80004bec: e12a sd a0,128(sp) + 80004bee: e52e sd a1,136(sp) + 80004bf0: a009 j 80004bf2 <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x3c> + // SAFETY: the caller must ensure that `new_layout` is greater than zero. + let new_ptr = unsafe { self.alloc(new_layout) }; + 80004bf2: 7642 ld a2,48(sp) + 80004bf4: 75a2 ld a1,40(sp) + 80004bf6: 6526 ld a0,72(sp) + 80004bf8: 00008097 auipc ra,0x8 + 80004bfc: 520080e7 jalr 1312(ra) # 8000d118 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E> + 80004c00: 85aa mv a1,a0 + 80004c02: f02e sd a1,32(sp) + 80004c04: e92a sd a0,144(sp) + 80004c06: a009 j 80004c08 <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x52> + if !new_ptr.is_null() { + 80004c08: 7502 ld a0,32(sp) + 80004c0a: 0001c097 auipc ra,0x1c + 80004c0e: a46080e7 jalr -1466(ra) # 80020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E> + 80004c12: ec2a sd a0,24(sp) + 80004c14: a009 j 80004c16 <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x60> + 80004c16: 6562 ld a0,24(sp) + 80004c18: e909 bnez a0,80004c2a <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x74> + 80004c1a: a009 j 80004c1c <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x66> + 80004c1c: 08a8 addi a0,sp,88 + // SAFETY: the previously allocated block cannot overlap the newly allocated block. + // The safety contract for `dealloc` must be upheld by the caller. + unsafe { + ptr::copy_nonoverlapping(ptr, new_ptr, cmp::min(layout.size(), new_size)); + 80004c1e: 0001b097 auipc ra,0x1b + 80004c22: c3e080e7 jalr -962(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 80004c26: e82a sd a0,16(sp) + 80004c28: a011 j 80004c2c <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x76> + if !new_ptr.is_null() { + 80004c2a: a815 j 80004c5e <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0xa8> + ptr::copy_nonoverlapping(ptr, new_ptr, cmp::min(layout.size(), new_size)); + 80004c2c: 75e2 ld a1,56(sp) + 80004c2e: 6542 ld a0,16(sp) + 80004c30: 00018097 auipc ra,0x18 + 80004c34: 674080e7 jalr 1652(ra) # 8001d2a4 <_ZN4core3cmp3min17hbc9e632873ab1838E> + 80004c38: e42a sd a0,8(sp) + 80004c3a: a009 j 80004c3c <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0x86> + 80004c3c: 6586 ld a1,64(sp) + 80004c3e: 6622 ld a2,8(sp) + 80004c40: 7502 ld a0,32(sp) + 80004c42: 00021097 auipc ra,0x21 + 80004c46: 440080e7 jalr 1088(ra) # 80026082 + 80004c4a: 6586 ld a1,64(sp) + self.dealloc(ptr, layout); + 80004c4c: 6526 ld a0,72(sp) + 80004c4e: 6666 ld a2,88(sp) + 80004c50: 7686 ld a3,96(sp) + 80004c52: 00008097 auipc ra,0x8 + 80004c56: 514080e7 jalr 1300(ra) # 8000d166 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E> + 80004c5a: a009 j 80004c5c <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0xa6> + if !new_ptr.is_null() { + 80004c5c: a009 j 80004c5e <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E+0xa8> + } + } + new_ptr + } + 80004c5e: 7502 ld a0,32(sp) + 80004c60: 60ea ld ra,152(sp) + 80004c62: 610d addi sp,sp,160 + 80004c64: 8082 ret + +Disassembly of section .text._ZN4core5slice3cmp81_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$B$u5d$$GT$$u20$for$u20$$u5b$A$u5d$$GT$2eq17hb066b813a10237c1E: + +0000000080004c66 <_ZN4core5slice3cmp81_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$B$u5d$$GT$$u20$for$u20$$u5b$A$u5d$$GT$2eq17hb066b813a10237c1E>: +#[stable(feature = "rust1", since = "1.0.0")] +impl PartialEq<[B]> for [A] +where + A: PartialEq, +{ + fn eq(&self, other: &[B]) -> bool { + 80004c66: 7179 addi sp,sp,-48 + 80004c68: f406 sd ra,40(sp) + 80004c6a: e42a sd a0,8(sp) + 80004c6c: e82e sd a1,16(sp) + 80004c6e: ec32 sd a2,24(sp) + 80004c70: f036 sd a3,32(sp) + SlicePartialEq::equal(self, other) + 80004c72: 00000097 auipc ra,0x0 + 80004c76: 014080e7 jalr 20(ra) # 80004c86 <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E> + 80004c7a: e02a sd a0,0(sp) + 80004c7c: a009 j 80004c7e <_ZN4core5slice3cmp81_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$B$u5d$$GT$$u20$for$u20$$u5b$A$u5d$$GT$2eq17hb066b813a10237c1E+0x18> + } + 80004c7e: 6502 ld a0,0(sp) + 80004c80: 70a2 ld ra,40(sp) + 80004c82: 6145 addi sp,sp,48 + 80004c84: 8082 ret + +Disassembly of section .text._ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E: + +0000000080004c86 <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E>: +// Use memcmp for bytewise equality when the types allow +impl SlicePartialEq for [A] +where + A: BytewiseEquality, +{ + fn equal(&self, other: &[B]) -> bool { + 80004c86: 7175 addi sp,sp,-144 + 80004c88: e506 sd ra,136(sp) + 80004c8a: f836 sd a3,48(sp) + 80004c8c: fc32 sd a2,56(sp) + 80004c8e: e0ae sd a1,64(sp) + 80004c90: e4aa sd a0,72(sp) + 80004c92: f0aa sd a0,96(sp) + 80004c94: f4ae sd a1,104(sp) + 80004c96: f8b2 sd a2,112(sp) + 80004c98: fcb6 sd a3,120(sp) + if self.len() != other.len() { + 80004c9a: 0001c097 auipc ra,0x1c + 80004c9e: 808080e7 jalr -2040(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80004ca2: e8aa sd a0,80(sp) + 80004ca4: a009 j 80004ca6 <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x20> + 80004ca6: 75c2 ld a1,48(sp) + 80004ca8: 7562 ld a0,56(sp) + 80004caa: 0001b097 auipc ra,0x1b + 80004cae: 7f8080e7 jalr 2040(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80004cb2: f42a sd a0,40(sp) + 80004cb4: a009 j 80004cb6 <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x30> + 80004cb6: 6546 ld a0,80(sp) + 80004cb8: 75a2 ld a1,40(sp) + 80004cba: 00b50763 beq a0,a1,80004cc8 <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x42> + 80004cbe: a009 j 80004cc0 <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x3a> + 80004cc0: 4501 li a0,0 + return false; + 80004cc2: 04a10fa3 sb a0,95(sp) + // The two slices have been checked to have the same size above. + unsafe { + let size = mem::size_of_val(self); + memcmp(self.as_ptr() as *const u8, other.as_ptr() as *const u8, size) == 0 + } + } + 80004cc6: a891 j 80004d1a <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x94> + let size = mem::size_of_val(self); + 80004cc8: 6586 ld a1,64(sp) + 80004cca: 6526 ld a0,72(sp) + 80004ccc: 00019097 auipc ra,0x19 + 80004cd0: 0c0080e7 jalr 192(ra) # 8001dd8c <_ZN4core3mem11size_of_val17hcff6d035291fbe5fE> + 80004cd4: 85aa mv a1,a0 + 80004cd6: f02e sd a1,32(sp) + 80004cd8: e12a sd a0,128(sp) + 80004cda: a009 j 80004cdc <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x56> + memcmp(self.as_ptr() as *const u8, other.as_ptr() as *const u8, size) == 0 + 80004cdc: 6586 ld a1,64(sp) + 80004cde: 6526 ld a0,72(sp) + 80004ce0: 0001c097 auipc ra,0x1c + 80004ce4: 81e080e7 jalr -2018(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 80004ce8: ec2a sd a0,24(sp) + 80004cea: a009 j 80004cec <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x66> + 80004cec: 75c2 ld a1,48(sp) + 80004cee: 7562 ld a0,56(sp) + 80004cf0: 0001c097 auipc ra,0x1c + 80004cf4: 80e080e7 jalr -2034(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 80004cf8: e82a sd a0,16(sp) + 80004cfa: a009 j 80004cfc <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x76> + 80004cfc: 7602 ld a2,32(sp) + 80004cfe: 65c2 ld a1,16(sp) + 80004d00: 6562 ld a0,24(sp) + 80004d02: 00021097 auipc ra,0x21 + 80004d06: 3e2080e7 jalr 994(ra) # 800260e4 + 80004d0a: e42a sd a0,8(sp) + 80004d0c: a009 j 80004d0e <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x88> + 80004d0e: 6522 ld a0,8(sp) + 80004d10: 00153513 seqz a0,a0 + 80004d14: 04a10fa3 sb a0,95(sp) + } + 80004d18: a009 j 80004d1a <_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h1b2b75063a535cf0E+0x94> + 80004d1a: 05f14503 lbu a0,95(sp) + 80004d1e: 60aa ld ra,136(sp) + 80004d20: 6149 addi sp,sp,144 + 80004d22: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register4sepc4read17hcaa3e2a818646c19E: + +0000000080004d24 <_ZN6kernel4arch5riscv8register4sepc4read17hcaa3e2a818646c19E>: +// machine exception program counter, holds the +// instruction address to which a return from +// exception will go. +#[inline] +pub unsafe fn read() -> usize { + 80004d24: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, sepc":"=r"(ret):::"volatile"); + 80004d26: 14102573 csrr a0,sepc + 80004d2a: e42a sd a0,8(sp) + ret +} + 80004d2c: 0141 addi sp,sp,16 + 80004d2e: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register4sepc5write17h2074fd389defa9f2E: + +0000000080004d30 <_ZN6kernel4arch5riscv8register4sepc5write17h2074fd389defa9f2E>: + +#[inline] +pub unsafe fn write(x:usize){ + 80004d30: 1141 addi sp,sp,-16 + 80004d32: e42a sd a0,8(sp) + llvm_asm!("csrw sepc, $0"::"r"(x)::"volatile"); + 80004d34: 14151073 csrw sepc,a0 + 80004d38: 0141 addi sp,sp,16 + 80004d3a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs6bitmap19locate_inode_offset17h27b37f6ce6332c77E: + +0000000080004d3c <_ZN6kernel2fs6bitmap19locate_inode_offset17h27b37f6ce6332c77E>: +// } + +/// Given an inode number. +/// Calculate the offset index of this inode inside the block. +#[inline] +fn locate_inode_offset(inum: u32) -> usize { + 80004d3c: 1141 addi sp,sp,-16 + 80004d3e: c62a sw a0,12(sp) + inum as usize % IPB + 80004d40: 893d andi a0,a0,15 +} + 80004d42: 0141 addi sp,sp,16 + 80004d44: 8082 ret + +Disassembly of section .text._ZN6kernel2fs6bitmap5bfree17h2d4cb92b39e2512aE: + +0000000080004d46 <_ZN6kernel2fs6bitmap5bfree17h2d4cb92b39e2512aE>: + +/// Free a block in the disk by setting the relevant bit in bitmap to 0. +pub fn bfree(dev: u32, blockno: u32) { + 80004d46: 7155 addi sp,sp,-208 + 80004d48: e586 sd ra,200(sp) + 80004d4a: 862e mv a2,a1 + 80004d4c: fc32 sd a2,56(sp) + 80004d4e: 862a mv a2,a0 + 80004d50: e0b2 sd a2,64(sp) + 80004d52: d12a sw a0,160(sp) + 80004d54: d32e sw a1,164(sp) + +0000000080004d56 <.LBB1_12>: + let bm_blockno = unsafe { SUPER_BLOCK.bitmap_blockno(blockno) }; + 80004d56: 0005f517 auipc a0,0x5f + 80004d5a: 34a50513 addi a0,a0,842 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 80004d5e: 00003097 auipc ra,0x3 + 80004d62: c8c080e7 jalr -884(ra) # 800079ea <_ZN6kernel2fs10superblock10SuperBlock14bitmap_blockno17h010142deb773804aE> + 80004d66: 85aa mv a1,a0 + 80004d68: e4ae sd a1,72(sp) + 80004d6a: d52a sw a0,168(sp) + 80004d6c: a009 j 80004d6e <.LBB1_12+0x18> + 80004d6e: 66a6 ld a3,72(sp) + 80004d70: 6606 ld a2,64(sp) + 80004d72: 7562 ld a0,56(sp) + 80004d74: 6589 lui a1,0x2 + 80004d76: 35fd addiw a1,a1,-1 + let bm_offset = blockno % BPB; + 80004d78: 8de9 and a1,a1,a0 + 80004d7a: d72e sw a1,172(sp) + let index = (bm_offset / 8) as isize; + 80004d7c: 00355593 srli a1,a0,0x3 + 80004d80: 3ff5f593 andi a1,a1,1023 + 80004d84: f42e sd a1,40(sp) + 80004d86: f92e sd a1,176(sp) + let bit = (bm_offset % 8) as usize; + 80004d88: 891d andi a0,a0,7 + 80004d8a: f82a sd a0,48(sp) + 80004d8c: fd2a sd a0,184(sp) + +0000000080004d8e <.LBB1_13>: + let mut buf = BCACHE.bread(dev, bm_blockno); + 80004d8e: 0002b597 auipc a1,0x2b + 80004d92: 27258593 addi a1,a1,626 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 80004d96: 0888 addi a0,sp,80 + 80004d98: fffff097 auipc ra,0xfffff + 80004d9c: 8fc080e7 jalr -1796(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 80004da0: a009 j 80004da2 <.LBB1_13+0x14> + 80004da2: 0888 addi a0,sp,80 + + let byte = unsafe { (buf.raw_data_mut() as *mut u8).offset(index).as_mut().unwrap() }; + 80004da4: fffff097 auipc ra,0xfffff + 80004da8: a7a080e7 jalr -1414(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 80004dac: f02a sd a0,32(sp) + 80004dae: a009 j 80004db0 <.LBB1_13+0x22> + 80004db0: 75a2 ld a1,40(sp) + 80004db2: 7502 ld a0,32(sp) + 80004db4: 0001c097 auipc ra,0x1c + 80004db8: 888080e7 jalr -1912(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 80004dbc: ec2a sd a0,24(sp) + 80004dbe: a009 j 80004dc0 <.LBB1_13+0x32> + 80004dc0: 6562 ld a0,24(sp) + 80004dc2: 0001c097 auipc ra,0x1c + 80004dc6: 848080e7 jalr -1976(ra) # 8002060a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E> + 80004dca: e82a sd a0,16(sp) + 80004dcc: a009 j 80004dce <.LBB1_13+0x40> + 80004dce: 6542 ld a0,16(sp) + +0000000080004dd0 <.LBB1_14>: + 80004dd0: 00022597 auipc a1,0x22 + 80004dd4: 42058593 addi a1,a1,1056 # 800271f0 <.L__unnamed_1> + 80004dd8: 0001d097 auipc ra,0x1d + 80004ddc: 7fc080e7 jalr 2044(ra) # 800225d4 <_ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E> + 80004de0: e42a sd a0,8(sp) + 80004de2: a009 j 80004de4 <.LBB1_14+0x14> + 80004de4: 75c2 ld a1,48(sp) + 80004de6: 6522 ld a0,8(sp) + 80004de8: e1aa sd a0,192(sp) + if !byte.get_bit(bit) { + 80004dea: fffff097 auipc ra,0xfffff + 80004dee: e70080e7 jalr -400(ra) # 80003c5a <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7get_bit17h5d59737ea892b952E> + 80004df2: e02a sd a0,0(sp) + 80004df4: a009 j 80004df6 <.LBB1_14+0x26> + 80004df6: 6502 ld a0,0(sp) + 80004df8: e105 bnez a0,80004e18 <.LBB1_16+0x14> + 80004dfa: a009 j 80004dfc <.LBB1_15> + +0000000080004dfc <.LBB1_15>: + panic!("bitmap: double freeing a block"); + 80004dfc: 00022517 auipc a0,0x22 + 80004e00: 40c50513 addi a0,a0,1036 # 80027208 <.L__unnamed_2> + +0000000080004e04 <.LBB1_16>: + 80004e04: 00022617 auipc a2,0x22 + 80004e08: 42460613 addi a2,a2,1060 # 80027228 <.L__unnamed_3> + 80004e0c: 45f9 li a1,30 + 80004e0e: 0001e097 auipc ra,0x1e + 80004e12: 336080e7 jalr 822(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80004e16: 0000 unimp + } + byte.set_bit(bit, false); + 80004e18: 75c2 ld a1,48(sp) + 80004e1a: 6522 ld a0,8(sp) + 80004e1c: 4601 li a2,0 + 80004e1e: fffff097 auipc ra,0xfffff + 80004e22: eba080e7 jalr -326(ra) # 80003cd8 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7set_bit17ha97cadf2a55a43d3E> + 80004e26: a009 j 80004e28 <.LBB1_16+0x24> + LOG.write(buf); + 80004e28: 7546 ld a0,112(sp) + 80004e2a: ed2a sd a0,152(sp) + 80004e2c: 7526 ld a0,104(sp) + 80004e2e: e92a sd a0,144(sp) + 80004e30: 7506 ld a0,96(sp) + 80004e32: e52a sd a0,136(sp) + 80004e34: 6566 ld a0,88(sp) + 80004e36: e12a sd a0,128(sp) + 80004e38: 6546 ld a0,80(sp) + 80004e3a: fcaa sd a0,120(sp) + +0000000080004e3c <.LBB1_17>: + 80004e3c: 00056517 auipc a0,0x56 + 80004e40: 69c50513 addi a0,a0,1692 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80004e44: 18ac addi a1,sp,120 + 80004e46: 00004097 auipc ra,0x4 + 80004e4a: 786080e7 jalr 1926(ra) # 800095cc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE> + 80004e4e: a009 j 80004e50 <.LBB1_17+0x14> +} + 80004e50: 60ae ld ra,200(sp) + 80004e52: 6169 addi sp,sp,208 + 80004e54: 8082 ret + +Disassembly of section .text._ZN6kernel2fs6bitmap6balloc17hb1927bc98cc6e122E: + +0000000080004e56 <_ZN6kernel2fs6bitmap6balloc17hb1927bc98cc6e122E>: + + +/// Allocate a zeroed disk block +pub fn balloc(dev: u32) -> u32 { + 80004e56: 712d addi sp,sp,-288 + 80004e58: ee06 sd ra,280(sp) + 80004e5a: 85aa mv a1,a0 + 80004e5c: f0ae sd a1,96(sp) + 80004e5e: ddaa sw a0,248(sp) + 80004e60: 4501 li a0,0 + let mut b = 0; + 80004e62: daaa sw a0,116(sp) + +0000000080004e64 <.LBB2_33>: + let sb_size = unsafe{ SUPER_BLOCK.size() }; + 80004e64: 0005f517 auipc a0,0x5f + 80004e68: 23c50513 addi a0,a0,572 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 80004e6c: 00003097 auipc ra,0x3 + 80004e70: a5e080e7 jalr -1442(ra) # 800078ca <_ZN6kernel2fs10superblock10SuperBlock4size17hb3cee79658d4a223E> + 80004e74: 85aa mv a1,a0 + 80004e76: f4ae sd a1,104(sp) + 80004e78: dfaa sw a0,252(sp) + 80004e7a: a009 j 80004e7c <.LBB2_33+0x18> + while b < sb_size { + 80004e7c: 75a6 ld a1,104(sp) + 80004e7e: 5556 lw a0,116(sp) + 80004e80: 2581 sext.w a1,a1 + 80004e82: 02b56263 bltu a0,a1,80004ea6 <.LBB2_35+0x16> + 80004e86: a009 j 80004e88 <.LBB2_34> + +0000000080004e88 <.LBB2_34>: + } + } + drop(buf); + b += BPB; + } + panic!("balloc: out of the block ranges.") + 80004e88: 00021517 auipc a0,0x21 + 80004e8c: 4e250513 addi a0,a0,1250 # 8002636a <.L__unnamed_11+0xde> + +0000000080004e90 <.LBB2_35>: + 80004e90: 00022617 auipc a2,0x22 + 80004e94: 49060613 addi a2,a2,1168 # 80027320 <.L__unnamed_5> + 80004e98: 02000593 li a1,32 + 80004e9c: 0001e097 auipc ra,0x1e + 80004ea0: 2a8080e7 jalr 680(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80004ea4: 0000 unimp + let bm_blockno = unsafe{ SUPER_BLOCK.bitmap_blockno(b) }; + 80004ea6: 55d6 lw a1,116(sp) + +0000000080004ea8 <.LBB2_36>: + 80004ea8: 0005f517 auipc a0,0x5f + 80004eac: 1f850513 addi a0,a0,504 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 80004eb0: 00003097 auipc ra,0x3 + 80004eb4: b3a080e7 jalr -1222(ra) # 800079ea <_ZN6kernel2fs10superblock10SuperBlock14bitmap_blockno17h010142deb773804aE> + 80004eb8: 85aa mv a1,a0 + 80004eba: ecae sd a1,88(sp) + 80004ebc: 10a12023 sw a0,256(sp) + 80004ec0: a009 j 80004ec2 <.LBB2_36+0x1a> + let mut buf = BCACHE.bread(dev, bm_blockno); + 80004ec2: 66e6 ld a3,88(sp) + 80004ec4: 7606 ld a2,96(sp) + +0000000080004ec6 <.LBB2_37>: + 80004ec6: 0002b597 auipc a1,0x2b + 80004eca: 13a58593 addi a1,a1,314 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 80004ece: 18a8 addi a0,sp,120 + 80004ed0: ffffe097 auipc ra,0xffffe + 80004ed4: 7c4080e7 jalr 1988(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 80004ed8: a009 j 80004eda <.LBB2_37+0x14> + 80004eda: 4501 li a0,0 + let mut bi = 0; + 80004edc: d12a sw a0,160(sp) + while bi < BPB && b + bi < sb_size { + 80004ede: a009 j 80004ee0 <.LBB2_37+0x1a> + 80004ee0: 0a016503 lwu a0,160(sp) + 80004ee4: 8135 srli a0,a0,0xd + 80004ee6: 4581 li a1,0 + 80004ee8: 00b50b63 beq a0,a1,80004efe <.LBB2_37+0x38> + 80004eec: a029 j 80004ef6 <.LBB2_37+0x30> + 80004eee: 4505 li a0,1 + 80004ef0: 0aa103a3 sb a0,167(sp) + 80004ef4: a00d j 80004f16 <.LBB2_37+0x50> + 80004ef6: 4501 li a0,0 + 80004ef8: 0aa103a3 sb a0,167(sp) + 80004efc: a829 j 80004f16 <.LBB2_37+0x50> + 80004efe: 07416503 lwu a0,116(sp) + 80004f02: 0a016583 lwu a1,160(sp) + 80004f06: 95aa add a1,a1,a0 + 80004f08: e8ae sd a1,80(sp) + 80004f0a: 02059513 slli a0,a1,0x20 + 80004f0e: 9101 srli a0,a0,0x20 + 80004f10: 14b51863 bne a0,a1,80005060 <.LBB2_40> + 80004f14: a031 j 80004f20 <.LBB2_37+0x5a> + 80004f16: 0a714503 lbu a0,167(sp) + 80004f1a: 8905 andi a0,a0,1 + 80004f1c: e90d bnez a0,80004f4e <.LBB2_37+0x88> + 80004f1e: a801 j 80004f2e <.LBB2_37+0x68> + 80004f20: 6546 ld a0,80(sp) + 80004f22: 75a6 ld a1,104(sp) + 80004f24: 2581 sext.w a1,a1 + 80004f26: 2501 sext.w a0,a0 + 80004f28: fcb563e3 bltu a0,a1,80004eee <.LBB2_37+0x28> + 80004f2c: b7e9 j 80004ef6 <.LBB2_37+0x30> + drop(buf); + 80004f2e: 656a ld a0,152(sp) + 80004f30: f9aa sd a0,240(sp) + 80004f32: 654a ld a0,144(sp) + 80004f34: f5aa sd a0,232(sp) + 80004f36: 652a ld a0,136(sp) + 80004f38: f1aa sd a0,224(sp) + 80004f3a: 650a ld a0,128(sp) + 80004f3c: edaa sd a0,216(sp) + 80004f3e: 7566 ld a0,120(sp) + 80004f40: e9aa sd a0,208(sp) + 80004f42: 0988 addi a0,sp,208 + 80004f44: 00019097 auipc ra,0x19 + 80004f48: fda080e7 jalr -38(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 80004f4c: a8e5 j 80005044 <.LBB2_39+0x34> + bi += 1; + 80004f4e: 0a016503 lwu a0,160(sp) + 80004f52: 00150593 addi a1,a0,1 + 80004f56: e4ae sd a1,72(sp) + 80004f58: 02059513 slli a0,a1,0x20 + 80004f5c: 9101 srli a0,a0,0x20 + 80004f5e: 10b51f63 bne a0,a1,8000507c <.LBB2_42> + 80004f62: a009 j 80004f64 <.LBB2_37+0x9e> + 80004f64: 6526 ld a0,72(sp) + 80004f66: d12a sw a0,160(sp) + let m = 1 << (bi % 8); + 80004f68: 00757593 andi a1,a0,7 + 80004f6c: 4505 li a0,1 + 80004f6e: 00b51533 sll a0,a0,a1 + 80004f72: e0aa sd a0,64(sp) + 80004f74: 4501 li a0,0 + 80004f76: 12051163 bnez a0,80005098 <.LBB2_44> + 80004f7a: a009 j 80004f7c <.LBB2_37+0xb6> + 80004f7c: 6506 ld a0,64(sp) + 80004f7e: 10a103a3 sb a0,263(sp) + 80004f82: 18a8 addi a0,sp,120 + let buf_ptr = unsafe{ (buf.raw_data_mut() as *mut u8).offset((bi / 8) as isize).as_mut().unwrap() }; + 80004f84: fffff097 auipc ra,0xfffff + 80004f88: 89a080e7 jalr -1894(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 80004f8c: fc2a sd a0,56(sp) + 80004f8e: a009 j 80004f90 <.LBB2_37+0xca> + 80004f90: 7562 ld a0,56(sp) + 80004f92: 0a016583 lwu a1,160(sp) + 80004f96: 818d srli a1,a1,0x3 + 80004f98: 0001b097 auipc ra,0x1b + 80004f9c: 6a4080e7 jalr 1700(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 80004fa0: f82a sd a0,48(sp) + 80004fa2: a009 j 80004fa4 <.LBB2_37+0xde> + 80004fa4: 7542 ld a0,48(sp) + 80004fa6: 0001b097 auipc ra,0x1b + 80004faa: 664080e7 jalr 1636(ra) # 8002060a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E> + 80004fae: f42a sd a0,40(sp) + 80004fb0: a009 j 80004fb2 <.LBB2_37+0xec> + 80004fb2: 7522 ld a0,40(sp) + +0000000080004fb4 <.LBB2_38>: + 80004fb4: 00022597 auipc a1,0x22 + 80004fb8: 32458593 addi a1,a1,804 # 800272d8 <.L__unnamed_6> + 80004fbc: 0001d097 auipc ra,0x1d + 80004fc0: 618080e7 jalr 1560(ra) # 800225d4 <_ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E> + 80004fc4: f02a sd a0,32(sp) + 80004fc6: a009 j 80004fc8 <.LBB2_38+0x14> + 80004fc8: 7502 ld a0,32(sp) + 80004fca: e62a sd a0,264(sp) + let buf_val = unsafe{ ptr::read(buf_ptr) }; + 80004fcc: 00014097 auipc ra,0x14 + 80004fd0: 426080e7 jalr 1062(ra) # 800193f2 <_ZN4core3ptr4read17h018161c0cd37b3fbE> + 80004fd4: 85aa mv a1,a0 + 80004fd6: ec2e sd a1,24(sp) + 80004fd8: 10a10ba3 sb a0,279(sp) + 80004fdc: a009 j 80004fde <.LBB2_38+0x2a> + if buf_val == 0 { // Is block free? + 80004fde: 6562 ld a0,24(sp) + 80004fe0: 0ff57513 andi a0,a0,255 + 80004fe4: 4581 li a1,0 + 80004fe6: 00b51a63 bne a0,a1,80004ffa <.LBB2_38+0x46> + 80004fea: a009 j 80004fec <.LBB2_38+0x38> + unsafe{ ptr::write(buf_ptr, m) }; + 80004fec: 6586 ld a1,64(sp) + 80004fee: 7502 ld a0,32(sp) + 80004ff0: 00014097 auipc ra,0x14 + 80004ff4: 68c080e7 jalr 1676(ra) # 8001967c <_ZN4core3ptr5write17h0fb1ba83ac2984c7E> + 80004ff8: a011 j 80004ffc <.LBB2_38+0x48> + while bi < BPB && b + bi < sb_size { + 80004ffa: b5dd j 80004ee0 <.LBB2_37+0x1a> + LOG.write(buf); + 80004ffc: 656a ld a0,152(sp) + 80004ffe: e5aa sd a0,200(sp) + 80005000: 654a ld a0,144(sp) + 80005002: e1aa sd a0,192(sp) + 80005004: 652a ld a0,136(sp) + 80005006: fd2a sd a0,184(sp) + 80005008: 650a ld a0,128(sp) + 8000500a: f92a sd a0,176(sp) + 8000500c: 7566 ld a0,120(sp) + 8000500e: f52a sd a0,168(sp) + +0000000080005010 <.LBB2_39>: + 80005010: 00056517 auipc a0,0x56 + 80005014: 4c850513 addi a0,a0,1224 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80005018: 112c addi a1,sp,168 + 8000501a: 00004097 auipc ra,0x4 + 8000501e: 5b2080e7 jalr 1458(ra) # 800095cc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE> + 80005022: a009 j 80005024 <.LBB2_39+0x14> + return b + bi + 80005024: 07416503 lwu a0,116(sp) + 80005028: 0a016583 lwu a1,160(sp) + 8000502c: 95aa add a1,a1,a0 + 8000502e: e82e sd a1,16(sp) + 80005030: 02059513 slli a0,a1,0x20 + 80005034: 9101 srli a0,a0,0x20 + 80005036: 08b51063 bne a0,a1,800050b6 <.LBB2_46> + 8000503a: a009 j 8000503c <.LBB2_39+0x2c> +} + 8000503c: 6542 ld a0,16(sp) + 8000503e: 60f2 ld ra,280(sp) + 80005040: 6115 addi sp,sp,288 + 80005042: 8082 ret + b += BPB; + 80005044: 07416503 lwu a0,116(sp) + 80005048: 6589 lui a1,0x2 + 8000504a: 95aa add a1,a1,a0 + 8000504c: e42e sd a1,8(sp) + 8000504e: 02059513 slli a0,a1,0x20 + 80005052: 9101 srli a0,a0,0x20 + 80005054: 06b51f63 bne a0,a1,800050d2 <.LBB2_48> + 80005058: a009 j 8000505a <.LBB2_39+0x4a> + 8000505a: 6522 ld a0,8(sp) + 8000505c: daaa sw a0,116(sp) + while b < sb_size { + 8000505e: bd39 j 80004e7c <.LBB2_33+0x18> + +0000000080005060 <.LBB2_40>: + while bi < BPB && b + bi < sb_size { + 80005060: 00022517 auipc a0,0x22 + 80005064: 20050513 addi a0,a0,512 # 80027260 + +0000000080005068 <.LBB2_41>: + 80005068: 00022617 auipc a2,0x22 + 8000506c: 1d860613 addi a2,a2,472 # 80027240 <.L__unnamed_7> + 80005070: 45f1 li a1,28 + 80005072: 0001e097 auipc ra,0x1e + 80005076: 0d2080e7 jalr 210(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000507c <.LBB2_42>: + bi += 1; + 8000507c: 00022517 auipc a0,0x22 + 80005080: 1e450513 addi a0,a0,484 # 80027260 + +0000000080005084 <.LBB2_43>: + 80005084: 00022617 auipc a2,0x22 + 80005088: 1fc60613 addi a2,a2,508 # 80027280 <.L__unnamed_8> + 8000508c: 45f1 li a1,28 + 8000508e: 0001e097 auipc ra,0x1e + 80005092: 0b6080e7 jalr 182(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080005098 <.LBB2_44>: + let m = 1 << (bi % 8); + 80005098: 00022517 auipc a0,0x22 + 8000509c: 21850513 addi a0,a0,536 # 800272b0 + +00000000800050a0 <.LBB2_45>: + 800050a0: 00022617 auipc a2,0x22 + 800050a4: 1f860613 addi a2,a2,504 # 80027298 <.L__unnamed_9> + 800050a8: 02300593 li a1,35 + 800050ac: 0001e097 auipc ra,0x1e + 800050b0: 098080e7 jalr 152(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800050b6 <.LBB2_46>: + return b + bi + 800050b6: 00022517 auipc a0,0x22 + 800050ba: 1aa50513 addi a0,a0,426 # 80027260 + +00000000800050be <.LBB2_47>: + 800050be: 00022617 auipc a2,0x22 + 800050c2: 23260613 addi a2,a2,562 # 800272f0 <.L__unnamed_10> + 800050c6: 45f1 li a1,28 + 800050c8: 0001e097 auipc ra,0x1e + 800050cc: 07c080e7 jalr 124(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800050d2 <.LBB2_48>: + b += BPB; + 800050d2: 00022517 auipc a0,0x22 + 800050d6: 18e50513 addi a0,a0,398 # 80027260 + +00000000800050da <.LBB2_49>: + 800050da: 00022617 auipc a2,0x22 + 800050de: 22e60613 addi a2,a2,558 # 80027308 <.L__unnamed_11> + 800050e2: 45f1 li a1,28 + 800050e4: 0001e097 auipc ra,0x1e + 800050e8: 060080e7 jalr 96(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs6bitmap11inode_alloc17h289cf49ddd9fbbd3E: + +00000000800050ee <_ZN6kernel2fs6bitmap11inode_alloc17h289cf49ddd9fbbd3E>: + +pub fn inode_alloc(dev: u32, itype: InodeType) -> u32 { + 800050ee: 716d addi sp,sp,-272 + 800050f0: e606 sd ra,264(sp) + 800050f2: 862e mv a2,a1 + 800050f4: e4b2 sd a2,72(sp) + 800050f6: 862a mv a2,a0 + 800050f8: e8b2 sd a2,80(sp) + 800050fa: cbaa sw a0,212(sp) + 800050fc: 0cb11d23 sh a1,218(sp) + +0000000080005100 <.LBB3_20>: + let size = unsafe { SUPER_BLOCK.ninodes() }; + 80005100: 0005f517 auipc a0,0x5f + 80005104: fa050513 addi a0,a0,-96 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 80005108: 00002097 auipc ra,0x2 + 8000510c: 7e2080e7 jalr 2018(ra) # 800078ea <_ZN6kernel2fs10superblock10SuperBlock7ninodes17h32fa650b3c4991daE> + 80005110: 85aa mv a1,a0 + 80005112: ecae sd a1,88(sp) + 80005114: cfaa sw a0,220(sp) + 80005116: a009 j 80005118 <.LBB3_20+0x18> + 80005118: 65e6 ld a1,88(sp) + 8000511a: 4505 li a0,1 + for inum in 1..size { + 8000511c: d0aa sw a0,96(sp) + 8000511e: d2ae sw a1,100(sp) + 80005120: 00007097 auipc ra,0x7 + 80005124: 234080e7 jalr 564(ra) # 8000c354 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h2819071fbc006758E> + 80005128: fc2a sd a0,56(sp) + 8000512a: e0ae sd a1,64(sp) + 8000512c: a009 j 8000512e <.LBB3_20+0x2e> + 8000512e: 6506 ld a0,64(sp) + 80005130: 75e2 ld a1,56(sp) + 80005132: d4ae sw a1,104(sp) + 80005134: d6aa sw a0,108(sp) + 80005136: a009 j 80005138 <.LBB3_20+0x38> + 80005138: 10a8 addi a0,sp,104 + 8000513a: 00007097 auipc ra,0x7 + 8000513e: 0ac080e7 jalr 172(ra) # 8000c1e6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE> + 80005142: d8aa sw a0,112(sp) + 80005144: daae sw a1,116(sp) + 80005146: a009 j 80005148 <.LBB3_20+0x48> + 80005148: 07016503 lwu a0,112(sp) + 8000514c: 4581 li a1,0 + 8000514e: 00b50463 beq a0,a1,80005156 <.LBB3_21> + 80005152: a009 j 80005154 <.LBB3_20+0x54> + 80005154: a005 j 80005174 <.LBB3_22+0x16> + +0000000080005156 <.LBB3_21>: + LOG.write(buf); + return inum + } + } + + panic!("not enough inode to alloc"); + 80005156: 00022517 auipc a0,0x22 + 8000515a: 1e250513 addi a0,a0,482 # 80027338 <.L__unnamed_12> + +000000008000515e <.LBB3_22>: + 8000515e: 00022617 auipc a2,0x22 + 80005162: 1fa60613 addi a2,a2,506 # 80027358 <.L__unnamed_13> + 80005166: 45e5 li a1,25 + 80005168: 0001e097 auipc ra,0x1e + 8000516c: fdc080e7 jalr -36(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80005170: 0000 unimp + for inum in 1..size { + 80005172: 0000 unimp + 80005174: 07416583 lwu a1,116(sp) + 80005178: f42e sd a1,40(sp) + 8000517a: d1ae sw a1,224(sp) + 8000517c: d3ae sw a1,228(sp) + 8000517e: d5ae sw a1,232(sp) + +0000000080005180 <.LBB3_23>: + let blockno = unsafe { SUPER_BLOCK.locate_inode(inum) }; + 80005180: 0005f517 auipc a0,0x5f + 80005184: f2050513 addi a0,a0,-224 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 80005188: 00002097 auipc ra,0x2 + 8000518c: 77e080e7 jalr 1918(ra) # 80007906 <_ZN6kernel2fs10superblock10SuperBlock12locate_inode17hc2dbfb20b9411e7cE> + 80005190: 85aa mv a1,a0 + 80005192: f82e sd a1,48(sp) + 80005194: d7aa sw a0,236(sp) + 80005196: a009 j 80005198 <.LBB3_23+0x18> + let offset = locate_inode_offset(inum) as isize; + 80005198: 7522 ld a0,40(sp) + 8000519a: 00000097 auipc ra,0x0 + 8000519e: ba2080e7 jalr -1118(ra) # 80004d3c <_ZN6kernel2fs6bitmap19locate_inode_offset17h27b37f6ce6332c77E> + 800051a2: f02a sd a0,32(sp) + 800051a4: a009 j 800051a6 <.LBB3_23+0x26> + 800051a6: 76c2 ld a3,48(sp) + 800051a8: 6646 ld a2,80(sp) + 800051aa: 7502 ld a0,32(sp) + 800051ac: f9aa sd a0,240(sp) + +00000000800051ae <.LBB3_24>: + let mut buf = BCACHE.bread(dev, blockno); + 800051ae: 0002b597 auipc a1,0x2b + 800051b2: e5258593 addi a1,a1,-430 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 800051b6: 18a8 addi a0,sp,120 + 800051b8: ffffe097 auipc ra,0xffffe + 800051bc: 4dc080e7 jalr 1244(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 800051c0: a009 j 800051c2 <.LBB3_24+0x14> + 800051c2: 18a8 addi a0,sp,120 + let dinode = unsafe { (buf.raw_data_mut() as *mut DiskInode).offset(offset) }; + 800051c4: ffffe097 auipc ra,0xffffe + 800051c8: 65a080e7 jalr 1626(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 800051cc: ec2a sd a0,24(sp) + 800051ce: a009 j 800051d0 <.LBB3_24+0x22> + 800051d0: 7582 ld a1,32(sp) + 800051d2: 6562 ld a0,24(sp) + 800051d4: 00014097 auipc ra,0x14 + 800051d8: 032080e7 jalr 50(ra) # 80019206 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf7573a6302c08e61E> + 800051dc: 85aa mv a1,a0 + 800051de: e82e sd a1,16(sp) + 800051e0: fdaa sd a0,248(sp) + 800051e2: a009 j 800051e4 <.LBB3_24+0x36> + let dinode = unsafe { &mut *dinode }; + 800051e4: 65a6 ld a1,72(sp) + 800051e6: 6542 ld a0,16(sp) + 800051e8: e22a sd a0,256(sp) + if dinode.try_alloc(itype).is_ok() { + 800051ea: 00003097 auipc ra,0x3 + 800051ee: 220080e7 jalr 544(ra) # 8000840a <_ZN6kernel2fs6dinode9DiskInode9try_alloc17h945d9012d7c3db98E> + 800051f2: 0aa103a3 sb a0,167(sp) + 800051f6: a009 j 800051f8 <.LBB3_24+0x4a> + 800051f8: 0a710513 addi a0,sp,167 + 800051fc: 00008097 auipc ra,0x8 + 80005200: 3a0080e7 jalr 928(ra) # 8000d59c <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h2dc3ede719915417E> + 80005204: e42a sd a0,8(sp) + 80005206: a009 j 80005208 <.LBB3_24+0x5a> + 80005208: 6522 ld a0,8(sp) + 8000520a: 4581 li a1,0 + 8000520c: 02b50763 beq a0,a1,8000523a <.LBB3_25+0x14> + 80005210: a009 j 80005212 <.LBB3_24+0x64> + LOG.write(buf); + 80005212: 656a ld a0,152(sp) + 80005214: e5aa sd a0,200(sp) + 80005216: 654a ld a0,144(sp) + 80005218: e1aa sd a0,192(sp) + 8000521a: 652a ld a0,136(sp) + 8000521c: fd2a sd a0,184(sp) + 8000521e: 650a ld a0,128(sp) + 80005220: f92a sd a0,176(sp) + 80005222: 7566 ld a0,120(sp) + 80005224: f52a sd a0,168(sp) + +0000000080005226 <.LBB3_25>: + 80005226: 00056517 auipc a0,0x56 + 8000522a: 2b250513 addi a0,a0,690 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8000522e: 112c addi a1,sp,168 + 80005230: 00004097 auipc ra,0x4 + 80005234: 39c080e7 jalr 924(ra) # 800095cc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE> + 80005238: a039 j 80005246 <.LBB3_25+0x20> + 8000523a: 18a8 addi a0,sp,120 + } + 8000523c: 00002097 auipc ra,0x2 + 80005240: dd6080e7 jalr -554(ra) # 80007012 <_ZN4core3ptr41drop_in_place$LT$kernel..fs..bio..Buf$GT$17hc35967244f3e9eb6E> + 80005244: a029 j 8000524e <.LBB3_25+0x28> + 80005246: 7522 ld a0,40(sp) + 80005248: 60b2 ld ra,264(sp) + 8000524a: 6151 addi sp,sp,272 + 8000524c: 8082 ret + for inum in 1..size { + 8000524e: b5ed j 80005138 <.LBB3_20+0x38> + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$3get17ha10dd437ebde1b39E: + +0000000080005250 <_ZN4core4cell13Cell$LT$T$GT$3get17ha10dd437ebde1b39E>: + /// + /// let five = c.get(); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + pub fn get(&self) -> T { + 80005250: 1101 addi sp,sp,-32 + 80005252: ec06 sd ra,24(sp) + 80005254: e82a sd a0,16(sp) + // SAFETY: This can cause data races if called from a separate thread, + // but `Cell` is `!Sync` so this won't happen. + unsafe { *self.value.get() } + 80005256: 00000097 auipc ra,0x0 + 8000525a: 15a080e7 jalr 346(ra) # 800053b0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h9354550c008f8577E> + 8000525e: e42a sd a0,8(sp) + 80005260: a009 j 80005262 <_ZN4core4cell13Cell$LT$T$GT$3get17ha10dd437ebde1b39E+0x12> + 80005262: 6522 ld a0,8(sp) + 80005264: 00054503 lbu a0,0(a0) + } + 80005268: 60e2 ld ra,24(sp) + 8000526a: 6105 addi sp,sp,32 + 8000526c: 8082 ret + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE: + +000000008000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE>: + pub fn get(&self) -> T { + 8000526e: 1101 addi sp,sp,-32 + 80005270: ec06 sd ra,24(sp) + 80005272: e82a sd a0,16(sp) + unsafe { *self.value.get() } + 80005274: 00000097 auipc ra,0x0 + 80005278: 124080e7 jalr 292(ra) # 80005398 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h592018459564cd3bE> + 8000527c: e42a sd a0,8(sp) + 8000527e: a009 j 80005280 <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE+0x12> + 80005280: 6522 ld a0,8(sp) + 80005282: 6108 ld a0,0(a0) + } + 80005284: 60e2 ld ra,24(sp) + 80005286: 6105 addi sp,sp,32 + 80005288: 8082 ret + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$3new17h92764083b52e393eE: + +000000008000528a <_ZN4core4cell13Cell$LT$T$GT$3new17h92764083b52e393eE>: + pub const fn new(value: T) -> Cell { + 8000528a: 1101 addi sp,sp,-32 + 8000528c: ec06 sd ra,24(sp) + 8000528e: e82a sd a0,16(sp) + Cell { value: UnsafeCell::new(value) } + 80005290: 00000097 auipc ra,0x0 + 80005294: 150080e7 jalr 336(ra) # 800053e0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17hc9ea09ea33e2099aE> + 80005298: e02a sd a0,0(sp) + 8000529a: a009 j 8000529c <_ZN4core4cell13Cell$LT$T$GT$3new17h92764083b52e393eE+0x12> + 8000529c: 6502 ld a0,0(sp) + 8000529e: e42a sd a0,8(sp) + } + 800052a0: 60e2 ld ra,24(sp) + 800052a2: 6105 addi sp,sp,32 + 800052a4: 8082 ret + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E: + +00000000800052a6 <_ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E>: + pub fn set(&self, val: T) { + 800052a6: 1101 addi sp,sp,-32 + 800052a8: ec06 sd ra,24(sp) + 800052aa: e42a sd a0,8(sp) + 800052ac: 00b10b23 sb a1,22(sp) + let old = self.replace(val); + 800052b0: 00000097 auipc ra,0x0 + 800052b4: 068080e7 jalr 104(ra) # 80005318 <_ZN4core4cell13Cell$LT$T$GT$7replace17h84abfc72a05bacf1E> + 800052b8: 85aa mv a1,a0 + 800052ba: e02e sd a1,0(sp) + 800052bc: 00a10ba3 sb a0,23(sp) + 800052c0: a009 j 800052c2 <_ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E+0x1c> + drop(old); + 800052c2: 6502 ld a0,0(sp) + 800052c4: 00019097 auipc ra,0x19 + 800052c8: b00080e7 jalr -1280(ra) # 8001ddc4 <_ZN4core3mem4drop17h0a31045cd6ca0c7bE> + 800052cc: a009 j 800052ce <_ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E+0x28> + } + 800052ce: 60e2 ld ra,24(sp) + 800052d0: 6105 addi sp,sp,32 + 800052d2: 8082 ret + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E: + +00000000800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E>: + pub fn set(&self, val: T) { + 800052d4: 7179 addi sp,sp,-48 + 800052d6: f406 sd ra,40(sp) + 800052d8: e82a sd a0,16(sp) + 800052da: ec2e sd a1,24(sp) + let old = self.replace(val); + 800052dc: 00000097 auipc ra,0x0 + 800052e0: 06e080e7 jalr 110(ra) # 8000534a <_ZN4core4cell13Cell$LT$T$GT$7replace17ha9b4881d80b5e394E> + 800052e4: 85aa mv a1,a0 + 800052e6: e42e sd a1,8(sp) + 800052e8: f02a sd a0,32(sp) + 800052ea: a009 j 800052ec <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E+0x18> + drop(old); + 800052ec: 6522 ld a0,8(sp) + 800052ee: 00019097 auipc ra,0x19 + 800052f2: bf0080e7 jalr -1040(ra) # 8001dede <_ZN4core3mem4drop17ha75bac042eb9b458E> + 800052f6: a009 j 800052f8 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E+0x24> + } + 800052f8: 70a2 ld ra,40(sp) + 800052fa: 6145 addi sp,sp,48 + 800052fc: 8082 ret + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$6as_ptr17h2323c3e07ac4531cE: + +00000000800052fe <_ZN4core4cell13Cell$LT$T$GT$6as_ptr17h2323c3e07ac4531cE>: + /// let ptr = c.as_ptr(); + /// ``` + #[inline] + #[stable(feature = "cell_as_ptr", since = "1.12.0")] + #[rustc_const_stable(feature = "const_cell_as_ptr", since = "1.32.0")] + pub const fn as_ptr(&self) -> *mut T { + 800052fe: 1101 addi sp,sp,-32 + 80005300: ec06 sd ra,24(sp) + 80005302: e82a sd a0,16(sp) + self.value.get() + 80005304: 00000097 auipc ra,0x0 + 80005308: 0ac080e7 jalr 172(ra) # 800053b0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h9354550c008f8577E> + 8000530c: e42a sd a0,8(sp) + 8000530e: a009 j 80005310 <_ZN4core4cell13Cell$LT$T$GT$6as_ptr17h2323c3e07ac4531cE+0x12> + } + 80005310: 6522 ld a0,8(sp) + 80005312: 60e2 ld ra,24(sp) + 80005314: 6105 addi sp,sp,32 + 80005316: 8082 ret + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$7replace17h84abfc72a05bacf1E: + +0000000080005318 <_ZN4core4cell13Cell$LT$T$GT$7replace17h84abfc72a05bacf1E>: + pub fn replace(&self, val: T) -> T { + 80005318: 7179 addi sp,sp,-48 + 8000531a: f406 sd ra,40(sp) + 8000531c: 862e mv a2,a1 + 8000531e: e432 sd a2,8(sp) + 80005320: ec2a sd a0,24(sp) + 80005322: 02b103a3 sb a1,39(sp) + mem::replace(unsafe { &mut *self.value.get() }, val) + 80005326: 00000097 auipc ra,0x0 + 8000532a: 08a080e7 jalr 138(ra) # 800053b0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h9354550c008f8577E> + 8000532e: e82a sd a0,16(sp) + 80005330: a009 j 80005332 <_ZN4core4cell13Cell$LT$T$GT$7replace17h84abfc72a05bacf1E+0x1a> + 80005332: 65a2 ld a1,8(sp) + 80005334: 6542 ld a0,16(sp) + 80005336: 00019097 auipc ra,0x19 + 8000533a: cde080e7 jalr -802(ra) # 8001e014 <_ZN4core3mem7replace17h1967adb5d4092576E> + 8000533e: e02a sd a0,0(sp) + 80005340: a009 j 80005342 <_ZN4core4cell13Cell$LT$T$GT$7replace17h84abfc72a05bacf1E+0x2a> + } + 80005342: 6502 ld a0,0(sp) + 80005344: 70a2 ld ra,40(sp) + 80005346: 6145 addi sp,sp,48 + 80005348: 8082 ret + +Disassembly of section .text._ZN4core4cell13Cell$LT$T$GT$7replace17ha9b4881d80b5e394E: + +000000008000534a <_ZN4core4cell13Cell$LT$T$GT$7replace17ha9b4881d80b5e394E>: + pub fn replace(&self, val: T) -> T { + 8000534a: 7179 addi sp,sp,-48 + 8000534c: f406 sd ra,40(sp) + 8000534e: e42e sd a1,8(sp) + 80005350: ec2a sd a0,24(sp) + 80005352: f02e sd a1,32(sp) + mem::replace(unsafe { &mut *self.value.get() }, val) + 80005354: 00000097 auipc ra,0x0 + 80005358: 044080e7 jalr 68(ra) # 80005398 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h592018459564cd3bE> + 8000535c: e82a sd a0,16(sp) + 8000535e: a009 j 80005360 <_ZN4core4cell13Cell$LT$T$GT$7replace17ha9b4881d80b5e394E+0x16> + 80005360: 65a2 ld a1,8(sp) + 80005362: 6542 ld a0,16(sp) + 80005364: 00019097 auipc ra,0x19 + 80005368: d20080e7 jalr -736(ra) # 8001e084 <_ZN4core3mem7replace17ha3220c9fe59ec441E> + 8000536c: e02a sd a0,0(sp) + 8000536e: a009 j 80005370 <_ZN4core4cell13Cell$LT$T$GT$7replace17ha9b4881d80b5e394E+0x26> + } + 80005370: 6502 ld a0,0(sp) + 80005372: 70a2 ld ra,40(sp) + 80005374: 6145 addi sp,sp,48 + 80005376: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h05438521b5304ed4E: + +0000000080005378 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h05438521b5304ed4E>: + /// let five = uc.get(); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_stable(feature = "const_unsafecell_get", since = "1.32.0")] + pub const fn get(&self) -> *mut T { + 80005378: 1141 addi sp,sp,-16 + 8000537a: e42a sd a0,8(sp) + // We can just cast the pointer from `UnsafeCell` to `T` because of + // #[repr(transparent)]. This exploits libstd's special status, there is + // no guarantee for user code that this will work in future versions of the compiler! + self as *const UnsafeCell as *const T as *mut T + } + 8000537c: 0141 addi sp,sp,16 + 8000537e: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h0c090ec98b6b5023E: + +0000000080005380 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h0c090ec98b6b5023E>: + pub const fn get(&self) -> *mut T { + 80005380: 1141 addi sp,sp,-16 + 80005382: e42a sd a0,8(sp) + } + 80005384: 0141 addi sp,sp,16 + 80005386: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h222732a2deb54afaE: + +0000000080005388 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h222732a2deb54afaE>: + pub const fn get(&self) -> *mut T { + 80005388: 1141 addi sp,sp,-16 + 8000538a: e42a sd a0,8(sp) + } + 8000538c: 0141 addi sp,sp,16 + 8000538e: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h4b85f27290bf8d3bE: + +0000000080005390 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h4b85f27290bf8d3bE>: + pub const fn get(&self) -> *mut T { + 80005390: 1141 addi sp,sp,-16 + 80005392: e42a sd a0,8(sp) + } + 80005394: 0141 addi sp,sp,16 + 80005396: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h592018459564cd3bE: + +0000000080005398 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h592018459564cd3bE>: + pub const fn get(&self) -> *mut T { + 80005398: 1141 addi sp,sp,-16 + 8000539a: e42a sd a0,8(sp) + } + 8000539c: 0141 addi sp,sp,16 + 8000539e: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h6b3041abf61d3f4fE: + +00000000800053a0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h6b3041abf61d3f4fE>: + pub const fn get(&self) -> *mut T { + 800053a0: 1141 addi sp,sp,-16 + 800053a2: e42a sd a0,8(sp) + } + 800053a4: 0141 addi sp,sp,16 + 800053a6: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h85f42af92512c053E: + +00000000800053a8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h85f42af92512c053E>: + pub const fn get(&self) -> *mut T { + 800053a8: 1141 addi sp,sp,-16 + 800053aa: e42a sd a0,8(sp) + } + 800053ac: 0141 addi sp,sp,16 + 800053ae: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h9354550c008f8577E: + +00000000800053b0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h9354550c008f8577E>: + pub const fn get(&self) -> *mut T { + 800053b0: 1141 addi sp,sp,-16 + 800053b2: e42a sd a0,8(sp) + } + 800053b4: 0141 addi sp,sp,16 + 800053b6: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17hb24b2b56dfaab8d4E: + +00000000800053b8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hb24b2b56dfaab8d4E>: + pub const fn get(&self) -> *mut T { + 800053b8: 1141 addi sp,sp,-16 + 800053ba: e42a sd a0,8(sp) + } + 800053bc: 0141 addi sp,sp,16 + 800053be: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17hbe9e1598ba1bbd42E: + +00000000800053c0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hbe9e1598ba1bbd42E>: + pub const fn get(&self) -> *mut T { + 800053c0: 1141 addi sp,sp,-16 + 800053c2: e42a sd a0,8(sp) + } + 800053c4: 0141 addi sp,sp,16 + 800053c6: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17hf0694f5cd8271985E: + +00000000800053c8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hf0694f5cd8271985E>: + pub const fn get(&self) -> *mut T { + 800053c8: 1141 addi sp,sp,-16 + 800053ca: e42a sd a0,8(sp) + } + 800053cc: 0141 addi sp,sp,16 + 800053ce: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3new17h4d1d6404457ffa31E: + +00000000800053d0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17h4d1d6404457ffa31E>: + pub const fn new(value: T) -> UnsafeCell { + 800053d0: 1141 addi sp,sp,-16 + 800053d2: e42a sd a0,8(sp) + UnsafeCell { value } + 800053d4: e02a sd a0,0(sp) + } + 800053d6: 0141 addi sp,sp,16 + 800053d8: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3new17hc63dc9326193c257E: + +00000000800053da <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17hc63dc9326193c257E>: + pub const fn new(value: T) -> UnsafeCell { + 800053da: 1141 addi sp,sp,-16 + } + 800053dc: 0141 addi sp,sp,16 + 800053de: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3new17hc9ea09ea33e2099aE: + +00000000800053e0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17hc9ea09ea33e2099aE>: + pub const fn new(value: T) -> UnsafeCell { + 800053e0: 1141 addi sp,sp,-16 + 800053e2: e42a sd a0,8(sp) + UnsafeCell { value } + 800053e4: e02a sd a0,0(sp) + } + 800053e6: 0141 addi sp,sp,16 + 800053e8: 8082 ret + +Disassembly of section .text._ZN6kernel2fs7devices6Device4read17h5487da2141591295E: + +00000000800053ea <_ZN6kernel2fs7devices6Device4read17h5487da2141591295E>: + read: 0 as *const u8, + write: 0 as *const u8 + } + } + + pub fn read(&self) -> ReadFn { + 800053ea: 1101 addi sp,sp,-32 + 800053ec: e42a sd a0,8(sp) + let func = unsafe { + transmute::<*const u8, ReadFn>(self.read) + 800053ee: 6108 ld a0,0(a0) + 800053f0: e02a sd a0,0(sp) + 800053f2: e82a sd a0,16(sp) + 800053f4: ec2a sd a0,24(sp) + 800053f6: a009 j 800053f8 <_ZN6kernel2fs7devices6Device4read17h5487da2141591295E+0xe> + }; + func + } + 800053f8: 6502 ld a0,0(sp) + 800053fa: 6105 addi sp,sp,32 + 800053fc: 8082 ret + +Disassembly of section .text._ZN6kernel2fs7devices6Device5write17hdacd5bd8b779c8b1E: + +00000000800053fe <_ZN6kernel2fs7devices6Device5write17hdacd5bd8b779c8b1E>: + + pub fn write(&self) -> WriteFn { + 800053fe: 1101 addi sp,sp,-32 + 80005400: e42a sd a0,8(sp) + let func = unsafe { + transmute::<*const u8, WriteFn>(self.write) + 80005402: 6508 ld a0,8(a0) + 80005404: e02a sd a0,0(sp) + 80005406: e82a sd a0,16(sp) + 80005408: ec2a sd a0,24(sp) + 8000540a: a009 j 8000540c <_ZN6kernel2fs7devices6Device5write17hdacd5bd8b779c8b1E+0xe> + }; + func + } + 8000540c: 6502 ld a0,0(sp) + 8000540e: 6105 addi sp,sp,32 + 80005410: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register5stval4read17h328c9da49d53d19fE: + +0000000080005412 <_ZN6kernel4arch5riscv8register5stval4read17h328c9da49d53d19fE>: +// Supervisor Trap Value +#[inline] +pub unsafe fn read() -> usize { + 80005412: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, stval":"=r"(ret):::"volatile"); + 80005414: 14302573 csrr a0,stval + 80005418: e42a sd a0,8(sp) + ret +} + 8000541a: 0141 addi sp,sp,16 + 8000541c: 8082 ret + +Disassembly of section .text._ZN6kernel8shutdown12system_reset17h91571bbff266ab01E: + +000000008000541e <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E>: + +const TEST_FAIL:u32 = 0x3333; +const TEST_PASS:u32 = 0x5555; +const TEST_RESET:u32 = 0x7777; + +pub fn system_reset(reset_type: usize, reset_reason: usize) { + 8000541e: 7179 addi sp,sp,-48 + 80005420: f406 sd ra,40(sp) + 80005422: e02e sd a1,0(sp) + 80005424: e42a sd a0,8(sp) + 80005426: ec2a sd a0,24(sp) + 80005428: f02e sd a1,32(sp) + 8000542a: 4581 li a1,0 + // Fail = 0x3333, + // Pass = 0x5555, + // Reset = 0x7777, + + let mut value = match reset_type { + RESET_TYPE_SHUTDOWN => TEST_PASS, + 8000542c: 02b50263 beq a0,a1,80005450 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x32> + 80005430: a009 j 80005432 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x14> + 80005432: 6522 ld a0,8(sp) + 80005434: 4585 li a1,1 + 80005436: 02b50263 beq a0,a1,8000545a <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x3c> + 8000543a: a009 j 8000543c <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x1e> + 8000543c: 6522 ld a0,8(sp) + 8000543e: 4589 li a1,2 + 80005440: 02b50263 beq a0,a1,80005464 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x46> + 80005444: a009 j 80005446 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x28> + 80005446: 650d lui a0,0x3 + 80005448: 3335051b addiw a0,a0,819 + RESET_TYPE_COLD_REBOOT => TEST_RESET, + RESET_TYPE_WARM_REBOOT => TEST_RESET, + _ => TEST_FAIL, + 8000544c: ca2a sw a0,20(sp) + let mut value = match reset_type { + 8000544e: a005 j 8000546e <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x50> + 80005450: 6515 lui a0,0x5 + 80005452: 5555051b addiw a0,a0,1365 + RESET_TYPE_SHUTDOWN => TEST_PASS, + 80005456: ca2a sw a0,20(sp) + let mut value = match reset_type { + 80005458: a819 j 8000546e <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x50> + 8000545a: 651d lui a0,0x7 + 8000545c: 7775051b addiw a0,a0,1911 + RESET_TYPE_COLD_REBOOT => TEST_RESET, + 80005460: ca2a sw a0,20(sp) + let mut value = match reset_type { + 80005462: a031 j 8000546e <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x50> + 80005464: 651d lui a0,0x7 + 80005466: 7775051b addiw a0,a0,1911 + RESET_TYPE_WARM_REBOOT => TEST_RESET, + 8000546a: ca2a sw a0,20(sp) + let mut value = match reset_type { + 8000546c: a009 j 8000546e <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x50> + 8000546e: 6502 ld a0,0(sp) + 80005470: 4585 li a1,1 + }; + + if reset_reason == RESET_REASON_SYSTEM_FAILURE { + 80005472: 00b51863 bne a0,a1,80005482 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x64> + 80005476: a009 j 80005478 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x5a> + 80005478: 650d lui a0,0x3 + 8000547a: 3335051b addiw a0,a0,819 + value = TEST_FAIL + 8000547e: ca2a sw a0,20(sp) + if reset_reason == RESET_REASON_SYSTEM_FAILURE { + 80005480: a011 j 80005484 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x66> + 80005482: a009 j 80005484 <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E+0x66> + } + + unsafe { + core::ptr::write_volatile(VIRT_TEST, value); + 80005484: 45d2 lw a1,20(sp) + 80005486: 00100537 lui a0,0x100 + 8000548a: 00014097 auipc ra,0x14 + 8000548e: ec6080e7 jalr -314(ra) # 80019350 <_ZN4core3ptr14write_volatile17h1c498a4c32cde7d4E> + 80005492: a009 j 80005494 <.LBB0_12> + +0000000080005494 <.LBB0_12>: + } + + unreachable!(); + 80005494: 00022517 auipc a0,0x22 + 80005498: edc50513 addi a0,a0,-292 # 80027370 <.L__unnamed_1> + +000000008000549c <.LBB0_13>: + 8000549c: 00022617 auipc a2,0x22 + 800054a0: f0c60613 addi a2,a2,-244 # 800273a8 <.L__unnamed_2> + 800054a4: 02800593 li a1,40 + 800054a8: 0001e097 auipc ra,0x1e + 800054ac: c9c080e7 jalr -868(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel8shutdown8shutdown17hf11bb5dd05ff266dE: + +00000000800054b2 <_ZN6kernel8shutdown8shutdown17hf11bb5dd05ff266dE>: +} + +pub fn shutdown() { + 800054b2: 1141 addi sp,sp,-16 + 800054b4: e406 sd ra,8(sp) + 800054b6: 4521 li a0,8 + 800054b8: 4681 li a3,0 + kernel_env_call(SHUTDOWN, 0, 0, 0); + 800054ba: 85b6 mv a1,a3 + 800054bc: 8636 mv a2,a3 + 800054be: 00011097 auipc ra,0x11 + 800054c2: d1c080e7 jalr -740(ra) # 800161da <_ZN6kernel7syscall15kernel_env_call17h9e1a25b47e8ef67bE> + 800054c6: a009 j 800054c8 <_ZN6kernel8shutdown8shutdown17hf11bb5dd05ff266dE+0x16> +} + 800054c8: 60a2 ld ra,8(sp) + 800054ca: 0141 addi sp,sp,16 + 800054cc: 8082 ret + +Disassembly of section .text._ZN4core5slice3raw14from_raw_parts17h24ea7267a8aa7c05E: + +00000000800054ce <_ZN4core5slice3raw14from_raw_parts17h24ea7267a8aa7c05E>: +/// +/// [valid]: ptr#safety +/// [`NonNull::dangling()`]: ptr::NonNull::dangling +#[inline] +#[stable(feature = "rust1", since = "1.0.0")] +pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] { + 800054ce: 7179 addi sp,sp,-48 + 800054d0: f406 sd ra,40(sp) + 800054d2: ec2a sd a0,24(sp) + 800054d4: f02e sd a1,32(sp) + debug_assert!( + mem::size_of::().saturating_mul(len) <= isize::MAX as usize, + "attempt to create slice covering at least half the address space" + ); + // SAFETY: the caller must uphold the safety contract for `from_raw_parts`. + unsafe { &*ptr::slice_from_raw_parts(data, len) } + 800054d6: 00014097 auipc ra,0x14 + 800054da: ea8080e7 jalr -344(ra) # 8001937e <_ZN4core3ptr20slice_from_raw_parts17h19b34a977b1709d3E> + 800054de: e42a sd a0,8(sp) + 800054e0: e82e sd a1,16(sp) + 800054e2: a009 j 800054e4 <_ZN4core5slice3raw14from_raw_parts17h24ea7267a8aa7c05E+0x16> +} + 800054e4: 65c2 ld a1,16(sp) + 800054e6: 6522 ld a0,8(sp) + 800054e8: 70a2 ld ra,40(sp) + 800054ea: 6145 addi sp,sp,48 + 800054ec: 8082 ret + +Disassembly of section .text._ZN4core5slice3raw14from_raw_parts17hf1accf0e45b69f71E: + +00000000800054ee <_ZN4core5slice3raw14from_raw_parts17hf1accf0e45b69f71E>: +pub unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T] { + 800054ee: 7179 addi sp,sp,-48 + 800054f0: f406 sd ra,40(sp) + 800054f2: ec2a sd a0,24(sp) + 800054f4: f02e sd a1,32(sp) + unsafe { &*ptr::slice_from_raw_parts(data, len) } + 800054f6: 00014097 auipc ra,0x14 + 800054fa: eba080e7 jalr -326(ra) # 800193b0 <_ZN4core3ptr20slice_from_raw_parts17h4c1ee3b844c20623E> + 800054fe: e42a sd a0,8(sp) + 80005500: e82e sd a1,16(sp) + 80005502: a009 j 80005504 <_ZN4core5slice3raw14from_raw_parts17hf1accf0e45b69f71E+0x16> +} + 80005504: 65c2 ld a1,16(sp) + 80005506: 6522 ld a0,8(sp) + 80005508: 70a2 ld ra,40(sp) + 8000550a: 6145 addi sp,sp,48 + 8000550c: 8082 ret + +Disassembly of section .text._ZN4core5slice3raw18from_raw_parts_mut17h0bc9e5c0c3217bc8E: + +000000008000550e <_ZN4core5slice3raw18from_raw_parts_mut17h0bc9e5c0c3217bc8E>: +/// +/// [valid]: ptr#safety +/// [`NonNull::dangling()`]: ptr::NonNull::dangling +#[inline] +#[stable(feature = "rust1", since = "1.0.0")] +pub unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T] { + 8000550e: 7179 addi sp,sp,-48 + 80005510: f406 sd ra,40(sp) + 80005512: ec2a sd a0,24(sp) + 80005514: f02e sd a1,32(sp) + debug_assert!( + mem::size_of::().saturating_mul(len) <= isize::MAX as usize, + "attempt to create slice covering at least half the address space" + ); + // SAFETY: the caller must uphold the safety contract for `from_raw_parts_mut`. + unsafe { &mut *ptr::slice_from_raw_parts_mut(data, len) } + 80005516: 0001d097 auipc ra,0x1d + 8000551a: 160080e7 jalr 352(ra) # 80022676 <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E> + 8000551e: e42a sd a0,8(sp) + 80005520: e82e sd a1,16(sp) + 80005522: a009 j 80005524 <_ZN4core5slice3raw18from_raw_parts_mut17h0bc9e5c0c3217bc8E+0x16> +} + 80005524: 65c2 ld a1,16(sp) + 80005526: 6522 ld a0,8(sp) + 80005528: 70a2 ld ra,40(sp) + 8000552a: 6145 addi sp,sp,48 + 8000552c: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec28_$u7b$$u7b$closure$u7d$$u7d$17hac210036fe7eba45E: + +000000008000552e <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec28_$u7b$$u7b$closure$u7d$$u7d$17hac210036fe7eba45E>: + MAXARG + ) + }; + let ret = unsafe { + exec(path, &argv).map_err( + |_|(()) + 8000552e: 1101 addi sp,sp,-32 + 80005530: e82a sd a0,16(sp) + 80005532: ec2e sd a1,24(sp) + 80005534: 6105 addi sp,sp,32 + 80005536: 8082 ret + +Disassembly of section .text._ZN45_$LT$$LP$$RP$$u20$as$u20$core..fmt..Debug$GT$3fmt17hde552876d1bc9ef6E: + +0000000080005538 <_ZN45_$LT$$LP$$RP$$u20$as$u20$core..fmt..Debug$GT$3fmt17hde552876d1bc9ef6E>: +} + +#[stable(feature = "rust1", since = "1.0.0")] +impl Debug for () { + #[inline] + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + 80005538: 7179 addi sp,sp,-48 + 8000553a: f406 sd ra,40(sp) + 8000553c: e42e sd a1,8(sp) + 8000553e: 85aa mv a1,a0 + 80005540: 6522 ld a0,8(sp) + 80005542: ec2e sd a1,24(sp) + 80005544: f02a sd a0,32(sp) + +0000000080005546 <.LBB0_2>: + f.pad("()") + 80005546: 00022597 auipc a1,0x22 + 8000554a: e7a58593 addi a1,a1,-390 # 800273c0 <.L__unnamed_1> + 8000554e: 4609 li a2,2 + 80005550: 0001f097 auipc ra,0x1f + 80005554: 890080e7 jalr -1904(ra) # 80023de0 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE> + 80005558: e82a sd a0,16(sp) + 8000555a: a009 j 8000555c <.LBB0_2+0x16> + } + 8000555c: 6542 ld a0,16(sp) + 8000555e: 70a2 ld ra,40(sp) + 80005560: 6145 addi sp,sp,48 + 80005562: 8082 ret + +Disassembly of section .text._ZN4core3fmt9Arguments16new_v1_formatted17hf6d3ed0f8e821319E: + +0000000080005564 <_ZN4core3fmt9Arguments16new_v1_formatted17hf6d3ed0f8e821319E>: + pub fn new_v1_formatted( + 80005564: 7139 addi sp,sp,-64 + 80005566: e82e sd a1,16(sp) + 80005568: ec32 sd a2,24(sp) + 8000556a: f036 sd a3,32(sp) + 8000556c: f43a sd a4,40(sp) + 8000556e: f83e sd a5,48(sp) + 80005570: fc42 sd a6,56(sp) + Arguments { pieces, fmt: Some(fmt), args } + 80005572: e03e sd a5,0(sp) + 80005574: e442 sd a6,8(sp) + 80005576: e10c sd a1,0(a0) + 80005578: e510 sd a2,8(a0) + 8000557a: 6602 ld a2,0(sp) + 8000557c: 65a2 ld a1,8(sp) + 8000557e: e910 sd a2,16(a0) + 80005580: ed0c sd a1,24(a0) + 80005582: f114 sd a3,32(a0) + 80005584: f518 sd a4,40(a0) + } + 80005586: 6121 addi sp,sp,64 + 80005588: 8082 ret + +Disassembly of section .text._ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE: + +000000008000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE>: + pub fn new_v1(pieces: &'a [&'static str], args: &'a [ArgumentV1<'a>]) -> Arguments<'a> { + 8000558a: 7179 addi sp,sp,-48 + 8000558c: e82e sd a1,16(sp) + 8000558e: ec32 sd a2,24(sp) + 80005590: f036 sd a3,32(sp) + 80005592: f43a sd a4,40(sp) + 80005594: 4781 li a5,0 + Arguments { pieces, fmt: None, args } + 80005596: e03e sd a5,0(sp) + 80005598: e10c sd a1,0(a0) + 8000559a: e510 sd a2,8(a0) + 8000559c: 6602 ld a2,0(sp) + 8000559e: 65a2 ld a1,8(sp) + 800055a0: e910 sd a2,16(a0) + 800055a2: ed0c sd a1,24(a0) + 800055a4: f114 sd a3,32(a0) + 800055a6: f518 sd a4,40(a0) + } + 800055a8: 6145 addi sp,sp,48 + 800055aa: 8082 ret + +Disassembly of section .text._ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E: + +00000000800055ac <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E>: + +/// Reads the next code point out of a byte iterator (assuming a +/// UTF-8-like encoding). +#[unstable(feature = "str_internals", issue = "none")] +#[inline] +pub fn next_code_point<'a, I: Iterator>(bytes: &mut I) -> Option { + 800055ac: 7131 addi sp,sp,-192 + 800055ae: fd06 sd ra,184(sp) + 800055b0: f0aa sd a0,96(sp) + 800055b2: e52a sd a0,136(sp) + // Decode UTF-8 + let x = *bytes.next()?; + 800055b4: 00006097 auipc ra,0x6 + 800055b8: 3ea080e7 jalr 1002(ra) # 8000b99e <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE> + 800055bc: f4aa sd a0,104(sp) + 800055be: a009 j 800055c0 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x14> + 800055c0: 7526 ld a0,104(sp) + 800055c2: 0000a097 auipc ra,0xa + 800055c6: 5ca080e7 jalr 1482(ra) # 8000fb8c <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hce0d66149b699885E> + 800055ca: fcaa sd a0,120(sp) + 800055cc: a009 j 800055ce <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x22> + 800055ce: 7566 ld a0,120(sp) + 800055d0: 00153593 seqz a1,a0 + 800055d4: 4581 li a1,0 + 800055d6: 00b51463 bne a0,a1,800055de <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x32> + 800055da: a009 j 800055dc <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x30> + 800055dc: a839 j 800055fa <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x4e> + 800055de: 7566 ld a0,120(sp) + 800055e0: ed2a sd a0,152(sp) + 800055e2: 00050583 lb a1,0(a0) + 800055e6: 0ff5f513 andi a0,a1,255 + 800055ea: ecaa sd a0,88(sp) + 800055ec: 0ab103a3 sb a1,167(sp) + 800055f0: 557d li a0,-1 + if x < 128 { + 800055f2: 02b54163 blt a0,a1,80005614 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x68> + 800055f6: a025 j 8000561e <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x72> + let x = *bytes.next()?; + 800055f8: 0000 unimp + 800055fa: 0000a097 auipc ra,0xa + 800055fe: 3d8080e7 jalr 984(ra) # 8000f9d2 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h8871efd663dd0baaE> + 80005602: a009 j 80005604 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x58> + 80005604: 0000a097 auipc ra,0xa + 80005608: 556080e7 jalr 1366(ra) # 8000fb5a <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h35e87322ea53eeb5E> + 8000560c: d8aa sw a0,112(sp) + 8000560e: daae sw a1,116(sp) + 80005610: a009 j 80005612 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x66> + 80005612: a209 j 80005714 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x168> + return Some(x as u32); + 80005614: 6566 ld a0,88(sp) + 80005616: daaa sw a0,116(sp) + 80005618: 4505 li a0,1 + 8000561a: d8aa sw a0,112(sp) + 8000561c: a8e5 j 80005714 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x168> + } + + // Multibyte case follows + // Decode from a byte combination out of: [[[x y] z] w] + // NOTE: Performance is sensitive to the exact formulation here + let init = utf8_first_byte(x, 2); + 8000561e: 6566 ld a0,88(sp) + 80005620: 4589 li a1,2 + 80005622: 00004097 auipc ra,0x4 + 80005626: b9c080e7 jalr -1124(ra) # 800091be <_ZN4core3str11validations15utf8_first_byte17h336ce196ba99428fE> + 8000562a: 85aa mv a1,a0 + 8000562c: e8ae sd a1,80(sp) + 8000562e: d52a sw a0,168(sp) + 80005630: a009 j 80005632 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x86> + let y = unwrap_or_0(bytes.next()); + 80005632: 7506 ld a0,96(sp) + 80005634: 00006097 auipc ra,0x6 + 80005638: 36a080e7 jalr 874(ra) # 8000b99e <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE> + 8000563c: e4aa sd a0,72(sp) + 8000563e: a009 j 80005640 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x94> + 80005640: 6526 ld a0,72(sp) + 80005642: 00004097 auipc ra,0x4 + 80005646: b48080e7 jalr -1208(ra) # 8000918a <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E> + 8000564a: 85aa mv a1,a0 + 8000564c: e0ae sd a1,64(sp) + 8000564e: 0aa10723 sb a0,174(sp) + 80005652: a009 j 80005654 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0xa8> + let mut ch = utf8_acc_cont_byte(init, y); + 80005654: 6586 ld a1,64(sp) + 80005656: 6546 ld a0,80(sp) + 80005658: 00004097 auipc ra,0x4 + 8000565c: b80080e7 jalr -1152(ra) # 800091d8 <_ZN4core3str11validations18utf8_acc_cont_byte17h8689eb325a5b266aE> + 80005660: c32a sw a0,132(sp) + 80005662: a009 j 80005664 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0xb8> + 80005664: 6566 ld a0,88(sp) + 80005666: 0e000593 li a1,224 + if x >= 0xE0 { + 8000566a: 00b56a63 bltu a0,a1,8000567e <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0xd2> + 8000566e: a009 j 80005670 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0xc4> + // [[x y z] w] case + // 5th bit in 0xE0 .. 0xEF is always clear, so `init` is still valid + let z = unwrap_or_0(bytes.next()); + 80005670: 7506 ld a0,96(sp) + 80005672: 00006097 auipc ra,0x6 + 80005676: 32c080e7 jalr 812(ra) # 8000b99e <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE> + 8000567a: fc2a sd a0,56(sp) + 8000567c: a011 j 80005680 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0xd4> + if x >= 0xE0 { + 8000567e: a071 j 8000570a <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x15e> + let z = unwrap_or_0(bytes.next()); + 80005680: 7562 ld a0,56(sp) + 80005682: 00004097 auipc ra,0x4 + 80005686: b08080e7 jalr -1272(ra) # 8000918a <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E> + 8000568a: 85aa mv a1,a0 + 8000568c: f82e sd a1,48(sp) + 8000568e: 0aa107a3 sb a0,175(sp) + 80005692: a009 j 80005694 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0xe8> + let y_z = utf8_acc_cont_byte((y & CONT_MASK) as u32, z); + 80005694: 75c2 ld a1,48(sp) + 80005696: 6506 ld a0,64(sp) + 80005698: 03f57513 andi a0,a0,63 + 8000569c: 00004097 auipc ra,0x4 + 800056a0: b3c080e7 jalr -1220(ra) # 800091d8 <_ZN4core3str11validations18utf8_acc_cont_byte17h8689eb325a5b266aE> + 800056a4: 85aa mv a1,a0 + 800056a6: f42e sd a1,40(sp) + 800056a8: d92a sw a0,176(sp) + 800056aa: a009 j 800056ac <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x100> + ch = init << 12 | y_z; + 800056ac: 6566 ld a0,88(sp) + 800056ae: 7622 ld a2,40(sp) + 800056b0: 65c6 ld a1,80(sp) + 800056b2: 05b2 slli a1,a1,0xc + 800056b4: 8dd1 or a1,a1,a2 + 800056b6: c32e sw a1,132(sp) + 800056b8: 0f000593 li a1,240 + if x >= 0xF0 { + 800056bc: 00b56a63 bltu a0,a1,800056d0 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x124> + 800056c0: a009 j 800056c2 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x116> + // [x y z w] case + // use only the lower 3 bits of `init` + let w = unwrap_or_0(bytes.next()); + 800056c2: 7506 ld a0,96(sp) + 800056c4: 00006097 auipc ra,0x6 + 800056c8: 2da080e7 jalr 730(ra) # 8000b99e <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE> + 800056cc: f02a sd a0,32(sp) + 800056ce: a011 j 800056d2 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x126> + if x >= 0xF0 { + 800056d0: a825 j 80005708 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x15c> + let w = unwrap_or_0(bytes.next()); + 800056d2: 7502 ld a0,32(sp) + 800056d4: 00004097 auipc ra,0x4 + 800056d8: ab6080e7 jalr -1354(ra) # 8000918a <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E> + 800056dc: 85aa mv a1,a0 + 800056de: ec2e sd a1,24(sp) + 800056e0: 0aa10ba3 sb a0,183(sp) + 800056e4: a009 j 800056e6 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x13a> + ch = (init & 7) << 18 | utf8_acc_cont_byte(y_z, w); + 800056e6: 65e2 ld a1,24(sp) + 800056e8: 7522 ld a0,40(sp) + 800056ea: 6646 ld a2,80(sp) + 800056ec: 8a1d andi a2,a2,7 + 800056ee: 064a slli a2,a2,0x12 + 800056f0: e432 sd a2,8(sp) + 800056f2: 00004097 auipc ra,0x4 + 800056f6: ae6080e7 jalr -1306(ra) # 800091d8 <_ZN4core3str11validations18utf8_acc_cont_byte17h8689eb325a5b266aE> + 800056fa: e82a sd a0,16(sp) + 800056fc: a009 j 800056fe <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x152> + 800056fe: 6522 ld a0,8(sp) + 80005700: 65c2 ld a1,16(sp) + 80005702: 8d4d or a0,a0,a1 + 80005704: c32a sw a0,132(sp) + if x >= 0xF0 { + 80005706: a009 j 80005708 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x15c> + if x >= 0xE0 { + 80005708: a009 j 8000570a <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x15e> + } + } + + Some(ch) + 8000570a: 451a lw a0,132(sp) + 8000570c: daaa sw a0,116(sp) + 8000570e: 4505 li a0,1 + 80005710: d8aa sw a0,112(sp) +} + 80005712: a011 j 80005716 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x16a> + 80005714: a009 j 80005716 <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E+0x16a> + 80005716: 5546 lw a0,112(sp) + 80005718: 55d6 lw a1,116(sp) + 8000571a: 70ea ld ra,184(sp) + 8000571c: 6129 addi sp,sp,192 + 8000571e: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17hffa57d7c8ffaba34E: + +0000000080005720 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17hffa57d7c8ffaba34E>: + pub const unsafe fn add(self, count: usize) -> Self + 80005720: 1101 addi sp,sp,-32 + 80005722: ec06 sd ra,24(sp) + 80005724: e42a sd a0,8(sp) + 80005726: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 80005728: 00000097 auipc ra,0x0 + 8000572c: 046080e7 jalr 70(ra) # 8000576e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h6150def6e470518fE> + 80005730: e02a sd a0,0(sp) + 80005732: a009 j 80005734 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17hffa57d7c8ffaba34E+0x14> + } + 80005734: 6502 ld a0,0(sp) + 80005736: 60e2 ld ra,24(sp) + 80005738: 6105 addi sp,sp,32 + 8000573a: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E: + +000000008000573c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E>: + pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> { + 8000573c: 7179 addi sp,sp,-48 + 8000573e: f406 sd ra,40(sp) + 80005740: e42a sd a0,8(sp) + 80005742: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&mut *self) } } + 80005744: 00000097 auipc ra,0x0 + 80005748: 046080e7 jalr 70(ra) # 8000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E> + 8000574c: e82a sd a0,16(sp) + 8000574e: a009 j 80005750 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E+0x14> + 80005750: 6542 ld a0,16(sp) + 80005752: 4581 li a1,0 + 80005754: 00b50663 beq a0,a1,80005760 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E+0x24> + 80005758: a009 j 8000575a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E+0x1e> + 8000575a: 4501 li a0,0 + 8000575c: ec2a sd a0,24(sp) + 8000575e: a021 j 80005766 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E+0x2a> + 80005760: 6522 ld a0,8(sp) + 80005762: ec2a sd a0,24(sp) + 80005764: a009 j 80005766 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h12167601873b3d53E+0x2a> + } + 80005766: 6562 ld a0,24(sp) + 80005768: 70a2 ld ra,40(sp) + 8000576a: 6145 addi sp,sp,48 + 8000576c: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h6150def6e470518fE: + +000000008000576e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h6150def6e470518fE>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 8000576e: 1101 addi sp,sp,-32 + 80005770: e42a sd a0,8(sp) + 80005772: e82e sd a1,16(sp) + 80005774: 02800613 li a2,40 + unsafe { intrinsics::offset(self, count) as *mut T } + 80005778: 02c585b3 mul a1,a1,a2 + 8000577c: 952e add a0,a0,a1 + 8000577e: e02a sd a0,0(sp) + 80005780: ec2a sd a0,24(sp) + 80005782: a009 j 80005784 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h6150def6e470518fE+0x16> + } + 80005784: 6502 ld a0,0(sp) + 80005786: 6105 addi sp,sp,32 + 80005788: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E: + +000000008000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E>: + pub const fn is_null(self) -> bool { + 8000578a: 1101 addi sp,sp,-32 + 8000578c: ec06 sd ra,24(sp) + 8000578e: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 80005790: e42a sd a0,8(sp) + 80005792: a009 j 80005794 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E+0xa> + 80005794: 6522 ld a0,8(sp) + 80005796: 4581 li a1,0 + 80005798: 0001d097 auipc ra,0x1d + 8000579c: 772080e7 jalr 1906(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 800057a0: e02a sd a0,0(sp) + 800057a2: a009 j 800057a4 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E+0x1a> + } + 800057a4: 6502 ld a0,0(sp) + 800057a6: 60e2 ld ra,24(sp) + 800057a8: 6105 addi sp,sp,32 + 800057aa: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h37e95d8a2d6ca634E: + +00000000800057ac <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h37e95d8a2d6ca634E>: + pub const fn as_mut_ptr(&mut self) -> *mut T { + 800057ac: 1141 addi sp,sp,-16 + 800057ae: e02a sd a0,0(sp) + 800057b0: e42e sd a1,8(sp) + } + 800057b2: 0141 addi sp,sp,16 + 800057b4: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h0b5a743241a7cbfaE: + +00000000800057b6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h0b5a743241a7cbfaE>: + pub const fn len(&self) -> usize { + 800057b6: 7179 addi sp,sp,-48 + 800057b8: e42e sd a1,8(sp) + 800057ba: 85aa mv a1,a0 + 800057bc: 6522 ld a0,8(sp) + 800057be: f02e sd a1,32(sp) + 800057c0: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 800057c2: e82e sd a1,16(sp) + 800057c4: ec2a sd a0,24(sp) + } + 800057c6: 6145 addi sp,sp,48 + 800057c8: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h56877d4d8de3d254E: + +00000000800057ca <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h56877d4d8de3d254E>: + pub fn iter_mut(&mut self) -> IterMut<'_, T> { + 800057ca: 7179 addi sp,sp,-48 + 800057cc: f406 sd ra,40(sp) + 800057ce: ec2a sd a0,24(sp) + 800057d0: f02e sd a1,32(sp) + IterMut::new(self) + 800057d2: 00006097 auipc ra,0x6 + 800057d6: df0080e7 jalr -528(ra) # 8000b5c2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E> + 800057da: e42a sd a0,8(sp) + 800057dc: e82e sd a1,16(sp) + 800057de: a009 j 800057e0 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h56877d4d8de3d254E+0x16> + } + 800057e0: 65c2 ld a1,16(sp) + 800057e2: 6522 ld a0,8(sp) + 800057e4: 70a2 ld ra,40(sp) + 800057e6: 6145 addi sp,sp,48 + 800057e8: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio6Bcache5binit28_$u7b$$u7b$closure$u7d$$u7d$17h25f2c34d7a851755E: + +00000000800057ea <_ZN6kernel2fs3bio6Bcache5binit28_$u7b$$u7b$closure$u7d$$u7d$17h25f2c34d7a851755E>: + .for_each(|(i, b)| b.index = i); + 800057ea: 7179 addi sp,sp,-48 + 800057ec: e42a sd a0,8(sp) + 800057ee: e82e sd a1,16(sp) + 800057f0: ec32 sd a2,24(sp) + 800057f2: f02e sd a1,32(sp) + 800057f4: f432 sd a2,40(sp) + 800057f6: ee0c sd a1,24(a2) + 800057f8: 6145 addi sp,sp,48 + 800057fa: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h09361c1327a61982E: + +00000000800057fc <_ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h09361c1327a61982E>: + b.next.as_mut().map(|b_next| b_next.prev = b.prev); + 800057fc: 1141 addi sp,sp,-16 + 800057fe: e02a sd a0,0(sp) + 80005800: e42e sd a1,8(sp) + 80005802: 6108 ld a0,0(a0) + 80005804: 6108 ld a0,0(a0) + 80005806: e188 sd a0,0(a1) + 80005808: 0141 addi sp,sp,16 + 8000580a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h0a4afebccbc6cf13E: + +000000008000580c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h0a4afebccbc6cf13E>: + b.prev.as_mut().map(|b_prev| b_prev.next = b.next); + 8000580c: 1141 addi sp,sp,-16 + 8000580e: e02a sd a0,0(sp) + 80005810: e42e sd a1,8(sp) + 80005812: 6108 ld a0,0(a0) + 80005814: 6508 ld a0,8(a0) + 80005816: e588 sd a0,8(a1) + 80005818: 0141 addi sp,sp,16 + 8000581a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h304675452a5a98dfE: + +000000008000581c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h304675452a5a98dfE>: + self.head.as_mut().map(|old_head| old_head.prev = b); + 8000581c: 1141 addi sp,sp,-16 + 8000581e: e02a sd a0,0(sp) + 80005820: e42e sd a1,8(sp) + 80005822: 6108 ld a0,0(a0) + 80005824: e188 sd a0,0(a1) + 80005826: 0141 addi sp,sp,16 + 80005828: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4file5VFile4init17h000c38ec0bf103cfE: + +000000008000582a <_ZN6kernel2fs4file5VFile4init17h000c38ec0bf103cfE>: + pub(crate) major: i16 + // inner: FileInner +} + +impl VFile { + pub(crate) const fn init() -> Self { + 8000582a: 7179 addi sp,sp,-48 + 8000582c: 85aa mv a1,a0 + 8000582e: 4501 li a0,0 + Self{ + ftype: FileType::None, + readable: false, + writeable: false, + pipe: None, + 80005830: e42a sd a0,8(sp) + inode: None, + 80005832: ec2a sd a0,24(sp) + Self{ + 80005834: 02a59623 sh a0,44(a1) + 80005838: 02a59823 sh a0,48(a1) + 8000583c: 66a2 ld a3,8(sp) + 8000583e: 6642 ld a2,16(sp) + 80005840: e194 sd a3,0(a1) + 80005842: e590 sd a2,8(a1) + 80005844: 6662 ld a2,24(sp) + 80005846: e990 sd a2,16(a1) + 80005848: 7602 ld a2,32(sp) + 8000584a: ed90 sd a2,24(a1) + 8000584c: 7622 ld a2,40(sp) + 8000584e: f190 sd a2,32(a1) + 80005850: d588 sw a0,40(a1) + 80005852: 02a59723 sh a0,46(a1) + // fifo: None, + offset: 0, + major: 0 + } + } + 80005856: 6145 addi sp,sp,48 + 80005858: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4file5VFile4read17h537db93950e2de6aE: + +000000008000585a <_ZN6kernel2fs4file5VFile4read17h537db93950e2de6aE>: + + pub fn read( + 8000585a: 7145 addi sp,sp,-464 + 8000585c: e786 sd ra,456(sp) + 8000585e: e136 sd a3,128(sp) + 80005860: e532 sd a2,136(sp) + 80005862: e92e sd a1,144(sp) + 80005864: 85aa mv a1,a0 + 80005866: 654a ld a0,144(sp) + 80005868: ed2e sd a1,152(sp) + 8000586a: e6aa sd a0,328(sp) + 8000586c: eab2 sd a2,336(sp) + 8000586e: eeb6 sd a3,344(sp) + 80005870: 4581 li a1,0 + &self, + addr: usize, + len: usize + ) -> Result { + let ret; + 80005872: 14b103a3 sb a1,327(sp) + if !self.readable() { + 80005876: 00000097 auipc ra,0x0 + 8000587a: 7d8080e7 jalr 2008(ra) # 8000604e <_ZN6kernel2fs4file5VFile8readable17h4e596856d12086d6E> + 8000587e: f12a sd a0,160(sp) + 80005880: a009 j 80005882 <_ZN6kernel2fs4file5VFile4read17h537db93950e2de6aE+0x28> + 80005882: 750a ld a0,160(sp) + 80005884: e105 bnez a0,800058a4 <.LBB1_58+0x14> + 80005886: a009 j 80005888 <.LBB1_57> + +0000000080005888 <.LBB1_57>: + panic!("File can't be read!") + 80005888: 00022517 auipc a0,0x22 + 8000588c: b3a50513 addi a0,a0,-1222 # 800273c2 <.L__unnamed_1> + +0000000080005890 <.LBB1_58>: + 80005890: 00022617 auipc a2,0x22 + 80005894: b5860613 addi a2,a2,-1192 # 800273e8 <.L__unnamed_2> + 80005898: 45cd li a1,19 + 8000589a: 0001e097 auipc ra,0x1e + 8000589e: 8aa080e7 jalr -1878(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800058a2: 0000 unimp + } + + match self.ftype { + FileType::Pipe => { + 800058a4: 654a ld a0,144(sp) + 800058a6: 02c55503 lhu a0,44(a0) + 800058aa: fcaa sd a0,120(sp) + 800058ac: 4585 li a1,1 + 800058ae: 02b50b63 beq a0,a1,800058e4 <.LBB1_60+0x14> + 800058b2: a009 j 800058b4 <.LBB1_58+0x24> + 800058b4: 7566 ld a0,120(sp) + 800058b6: 4589 li a1,2 + 800058b8: 1eb50363 beq a0,a1,80005a9e <.LBB1_65+0x68> + 800058bc: a009 j 800058be <.LBB1_58+0x2e> + 800058be: 7566 ld a0,120(sp) + 800058c0: 458d li a1,3 + 800058c2: 0ab50163 beq a0,a1,80005964 <.LBB1_61+0x7a> + 800058c6: a009 j 800058c8 <.LBB1_59> + +00000000800058c8 <.LBB1_59>: + } + } + }, + + _ => { + panic!("Invalid file!") + 800058c8: 00022517 auipc a0,0x22 + 800058cc: b3850513 addi a0,a0,-1224 # 80027400 <.L__unnamed_3> + +00000000800058d0 <.LBB1_60>: + 800058d0: 00022617 auipc a2,0x22 + 800058d4: b4060613 addi a2,a2,-1216 # 80027410 <.L__unnamed_4> + 800058d8: 45b5 li a1,13 + 800058da: 0001e097 auipc ra,0x1e + 800058de: 86a080e7 jalr -1942(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800058e2: 0000 unimp + let pipe = unsafe{ &mut *self.pipe.unwrap() }; + 800058e4: 65ca ld a1,144(sp) + 800058e6: 6188 ld a0,0(a1) + 800058e8: 658c ld a1,8(a1) + +00000000800058ea <.LBB1_61>: + 800058ea: 00022617 auipc a2,0x22 + 800058ee: bd660613 addi a2,a2,-1066 # 800274c0 <.L__unnamed_5> + 800058f2: 0000a097 auipc ra,0xa + 800058f6: cb8080e7 jalr -840(ra) # 8000f5aa <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E> + 800058fa: f8aa sd a0,112(sp) + 800058fc: a009 j 800058fe <.LBB1_61+0x14> + 800058fe: 668a ld a3,128(sp) + 80005900: 662a ld a2,136(sp) + 80005902: 75c6 ld a1,112(sp) + 80005904: f72e sd a1,424(sp) + 80005906: 01a8 addi a0,sp,200 + ret = pipe.read(addr, len)?; + 80005908: 00005097 auipc ra,0x5 + 8000590c: 046080e7 jalr 70(ra) # 8000a94e <_ZN6kernel2fs4pipe4Pipe4read17h2c2acb00d7827debE> + 80005910: a009 j 80005912 <.LBB1_61+0x28> + 80005912: 1908 addi a0,sp,176 + 80005914: 01ac addi a1,sp,200 + 80005916: 00008097 auipc ra,0x8 + 8000591a: 17e080e7 jalr 382(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 8000591e: a009 j 80005920 <.LBB1_61+0x36> + 80005920: 754a ld a0,176(sp) + 80005922: 4581 li a1,0 + 80005924: 00b50463 beq a0,a1,8000592c <.LBB1_61+0x42> + 80005928: a009 j 8000592a <.LBB1_61+0x40> + 8000592a: a811 j 8000593e <.LBB1_61+0x54> + 8000592c: 65ea ld a1,152(sp) + 8000592e: 756a ld a0,184(sp) + 80005930: e3aa sd a0,448(sp) + 80005932: f52a sd a0,168(sp) + return Ok(ret) + 80005934: e588 sd a0,8(a1) + 80005936: 4501 li a0,0 + 80005938: e188 sd a0,0(a1) + 8000593a: a481 j 80005b7a <.LBB1_66+0xca> + ret = pipe.read(addr, len)?; + 8000593c: 0000 unimp + 8000593e: 756a ld a0,184(sp) + 80005940: 658e ld a1,192(sp) + 80005942: fb2a sd a0,432(sp) + 80005944: ff2e sd a1,440(sp) + 80005946: 00007097 auipc ra,0x7 + 8000594a: a40080e7 jalr -1472(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8000594e: f0aa sd a0,96(sp) + 80005950: f4ae sd a1,104(sp) + 80005952: a009 j 80005954 <.LBB1_61+0x6a> + 80005954: 7626 ld a2,104(sp) + 80005956: 7586 ld a1,96(sp) + 80005958: 656a ld a0,152(sp) + 8000595a: 00008097 auipc ra,0x8 + 8000595e: 06c080e7 jalr 108(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 80005962: ac21 j 80005b7a <.LBB1_66+0xca> + if self.major < 0 || + 80005964: 654a ld a0,144(sp) + 80005966: 02e51503 lh a0,46(a0) + 8000596a: 4581 li a1,0 + 8000596c: 02b54863 blt a0,a1,8000599c <.LBB1_61+0xb2> + 80005970: a835 j 800059ac <.LBB1_61+0xc2> + 80005972: 4505 li a0,1 + 80005974: 0ea10323 sb a0,230(sp) + 80005978: a829 j 80005992 <.LBB1_61+0xa8> + 8000597a: 4501 li a0,0 + 8000597c: 0ea10323 sb a0,230(sp) + 80005980: a809 j 80005992 <.LBB1_61+0xa8> + unsafe{ DEVICE_LIST.table[self.major as usize].read as usize == 0 }{ + 80005982: 654a ld a0,144(sp) + 80005984: 02e51503 lh a0,46(a0) + 80005988: ecaa sd a0,88(sp) + 8000598a: 45a9 li a1,10 + 8000598c: 02b56c63 bltu a0,a1,800059c4 <.LBB1_61+0xda> + 80005990: a419 j 80005b96 <.LBB1_66+0xe6> + if self.major < 0 || + 80005992: 0e614503 lbu a0,230(sp) + 80005996: 8905 andi a0,a0,1 + 80005998: e131 bnez a0,800059dc <.LBB1_62+0x14> + 8000599a: a8a9 j 800059f4 <.LBB1_63+0x16> + 8000599c: 4505 li a0,1 + 8000599e: 0ea103a3 sb a0,231(sp) + 800059a2: a821 j 800059ba <.LBB1_61+0xd0> + 800059a4: 4501 li a0,0 + 800059a6: 0ea103a3 sb a0,231(sp) + 800059aa: a801 j 800059ba <.LBB1_61+0xd0> + self.major as usize >= NDEV || + 800059ac: 654a ld a0,144(sp) + 800059ae: 02e51583 lh a1,46(a0) + 800059b2: 4525 li a0,9 + if self.major < 0 || + 800059b4: feb564e3 bltu a0,a1,8000599c <.LBB1_61+0xb2> + 800059b8: b7f5 j 800059a4 <.LBB1_61+0xba> + 800059ba: 0e714503 lbu a0,231(sp) + 800059be: 8905 andi a0,a0,1 + 800059c0: f94d bnez a0,80005972 <.LBB1_61+0x88> + 800059c2: b7c1 j 80005982 <.LBB1_61+0x98> + unsafe{ DEVICE_LIST.table[self.major as usize].read as usize == 0 }{ + 800059c4: 6566 ld a0,88(sp) + 800059c6: 0512 slli a0,a0,0x4 + +00000000800059c8 <.LBB1_62>: + 800059c8: 0005e597 auipc a1,0x5e + 800059cc: 63858593 addi a1,a1,1592 # 80064000 <_ZN6kernel2fs7devices11DEVICE_LIST17h17b7683da24e3570E> + 800059d0: 952e add a0,a0,a1 + 800059d2: 6108 ld a0,0(a0) + 800059d4: 4581 li a1,0 + if self.major < 0 || + 800059d6: f8b50ee3 beq a0,a1,80005972 <.LBB1_61+0x88> + 800059da: b745 j 8000597a <.LBB1_61+0x90> + return Err("[Error] vfs: Fail to read device") + 800059dc: 65ea ld a1,152(sp) + +00000000800059de <.LBB1_63>: + 800059de: 00021517 auipc a0,0x21 + 800059e2: 9cc50513 addi a0,a0,-1588 # 800263aa <.L__unnamed_11+0x11e> + 800059e6: e588 sd a0,8(a1) + 800059e8: 02000513 li a0,32 + 800059ec: e988 sd a0,16(a1) + 800059ee: 4505 li a0,1 + 800059f0: e188 sd a0,0(a1) + 800059f2: a261 j 80005b7a <.LBB1_66+0xca> + DEVICE_LIST.table[self.major as usize].read() + 800059f4: 654a ld a0,144(sp) + 800059f6: 02e51583 lh a1,46(a0) + 800059fa: e8ae sd a1,80(sp) + 800059fc: 4525 li a0,9 + 800059fe: 1ab56763 bltu a0,a1,80005bac <.LBB1_67+0x14> + 80005a02: a009 j 80005a04 <.LBB1_63+0x26> + 80005a04: 6546 ld a0,80(sp) + 80005a06: 0512 slli a0,a0,0x4 + +0000000080005a08 <.LBB1_64>: + 80005a08: 0005e597 auipc a1,0x5e + 80005a0c: 5f858593 addi a1,a1,1528 # 80064000 <_ZN6kernel2fs7devices11DEVICE_LIST17h17b7683da24e3570E> + 80005a10: 952e add a0,a0,a1 + 80005a12: 00000097 auipc ra,0x0 + 80005a16: 9d8080e7 jalr -1576(ra) # 800053ea <_ZN6kernel2fs7devices6Device4read17h5487da2141591295E> + 80005a1a: 85aa mv a1,a0 + 80005a1c: e4ae sd a1,72(sp) + 80005a1e: f2aa sd a0,352(sp) + 80005a20: a009 j 80005a22 <.LBB1_64+0x1a> + ret = read(true, addr, len).ok_or("Fail to read device")?; + 80005a22: 66a6 ld a3,72(sp) + 80005a24: 660a ld a2,128(sp) + 80005a26: 65aa ld a1,136(sp) + 80005a28: 4505 li a0,1 + 80005a2a: 9682 jalr a3 + 80005a2c: fc2a sd a0,56(sp) + 80005a2e: e0ae sd a1,64(sp) + 80005a30: a009 j 80005a32 <.LBB1_64+0x2a> + 80005a32: 6606 ld a2,64(sp) + 80005a34: 75e2 ld a1,56(sp) + +0000000080005a36 <.LBB1_65>: + 80005a36: 00022697 auipc a3,0x22 + 80005a3a: a2268693 addi a3,a3,-1502 # 80027458 <.L__unnamed_7> + 80005a3e: 0208 addi a0,sp,256 + 80005a40: 474d li a4,19 + 80005a42: 00009097 auipc ra,0x9 + 80005a46: 65e080e7 jalr 1630(ra) # 8000f0a0 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E> + 80005a4a: a009 j 80005a4c <.LBB1_65+0x16> + 80005a4c: 11a8 addi a0,sp,232 + 80005a4e: 020c addi a1,sp,256 + 80005a50: 00008097 auipc ra,0x8 + 80005a54: 044080e7 jalr 68(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 80005a58: a009 j 80005a5a <.LBB1_65+0x24> + 80005a5a: 752e ld a0,232(sp) + 80005a5c: 4581 li a1,0 + 80005a5e: 00b50463 beq a0,a1,80005a66 <.LBB1_65+0x30> + 80005a62: a009 j 80005a64 <.LBB1_65+0x2e> + 80005a64: a811 j 80005a78 <.LBB1_65+0x42> + 80005a66: 65ea ld a1,152(sp) + 80005a68: 754e ld a0,240(sp) + 80005a6a: feaa sd a0,376(sp) + 80005a6c: f52a sd a0,168(sp) + return Ok(ret) + 80005a6e: e588 sd a0,8(a1) + 80005a70: 4501 li a0,0 + 80005a72: e188 sd a0,0(a1) + 80005a74: a219 j 80005b7a <.LBB1_66+0xca> + ret = read(true, addr, len).ok_or("Fail to read device")?; + 80005a76: 0000 unimp + 80005a78: 754e ld a0,240(sp) + 80005a7a: 75ee ld a1,248(sp) + 80005a7c: f6aa sd a0,360(sp) + 80005a7e: faae sd a1,368(sp) + 80005a80: 00007097 auipc ra,0x7 + 80005a84: 906080e7 jalr -1786(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 80005a88: f42a sd a0,40(sp) + 80005a8a: f82e sd a1,48(sp) + 80005a8c: a009 j 80005a8e <.LBB1_65+0x58> + 80005a8e: 7642 ld a2,48(sp) + 80005a90: 75a2 ld a1,40(sp) + 80005a92: 656a ld a0,152(sp) + 80005a94: 00008097 auipc ra,0x8 + 80005a98: f32080e7 jalr -206(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 80005a9c: a8f9 j 80005b7a <.LBB1_66+0xca> + let inode = self.inode.as_ref().unwrap(); + 80005a9e: 654a ld a0,144(sp) + 80005aa0: 0541 addi a0,a0,16 + 80005aa2: 0000a097 auipc ra,0xa + 80005aa6: 902080e7 jalr -1790(ra) # 8000f3a4 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E> + 80005aaa: f02a sd a0,32(sp) + 80005aac: a009 j 80005aae <.LBB1_65+0x78> + 80005aae: 7502 ld a0,32(sp) + +0000000080005ab0 <.LBB1_66>: + 80005ab0: 00022597 auipc a1,0x22 + 80005ab4: 9c058593 addi a1,a1,-1600 # 80027470 <.L__unnamed_8> + 80005ab8: 0000a097 auipc ra,0xa + 80005abc: c00080e7 jalr -1024(ra) # 8000f6b8 <_ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E> + 80005ac0: 85aa mv a1,a0 + 80005ac2: ec2e sd a1,24(sp) + 80005ac4: e32a sd a0,384(sp) + 80005ac6: a009 j 80005ac8 <.LBB1_66+0x18> + 80005ac8: 6562 ld a0,24(sp) + 80005aca: 4585 li a1,1 + let mut inode_guard = inode.lock(); + 80005acc: 14b103a3 sb a1,327(sp) + 80005ad0: 00016097 auipc ra,0x16 + 80005ad4: 19c080e7 jalr 412(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 80005ad8: ee2a sd a0,280(sp) + 80005ada: f22e sd a1,288(sp) + 80005adc: a009 j 80005ade <.LBB1_66+0x2e> + 80005ade: 0a28 addi a0,sp,280 + match inode_guard.read(true, addr, self.offset, len as u32) { + 80005ae0: 00019097 auipc ra,0x19 + 80005ae4: 9c6080e7 jalr -1594(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80005ae8: e82a sd a0,16(sp) + 80005aea: a009 j 80005aec <.LBB1_66+0x3c> + 80005aec: 678a ld a5,128(sp) + 80005aee: 66aa ld a3,136(sp) + 80005af0: 65c2 ld a1,16(sp) + 80005af2: 654a ld a0,144(sp) + 80005af4: 5518 lw a4,40(a0) + 80005af6: 1228 addi a0,sp,296 + 80005af8: 4605 li a2,1 + 80005afa: 00015097 auipc ra,0x15 + 80005afe: 582080e7 jalr 1410(ra) # 8001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E> + 80005b02: a009 j 80005b04 <.LBB1_66+0x54> + Ok(size) => { + 80005b04: 7532 ld a0,296(sp) + 80005b06: 4581 li a1,0 + 80005b08: 00b50e63 beq a0,a1,80005b24 <.LBB1_66+0x74> + 80005b0c: a009 j 80005b0e <.LBB1_66+0x5e> + Err(err) => { + 80005b0e: 65ea ld a1,152(sp) + 80005b10: 7652 ld a2,304(sp) + 80005b12: 7572 ld a0,312(sp) + 80005b14: e732 sd a2,392(sp) + 80005b16: eb2a sd a0,400(sp) + Err(err) + 80005b18: e590 sd a2,8(a1) + 80005b1a: e988 sd a0,16(a1) + 80005b1c: 4505 li a0,1 + 80005b1e: e188 sd a0,0(a1) + match inode_guard.read(true, addr, self.offset, len as u32) { + 80005b20: a0b5 j 80005b8c <.LBB1_66+0xdc> + 80005b22: 0000 unimp + Ok(size) => { + 80005b24: 654a ld a0,144(sp) + 80005b26: 75d2 ld a1,304(sp) + 80005b28: ef2e sd a1,408(sp) + ret = size; + 80005b2a: f52e sd a1,168(sp) + let offset = unsafe { &mut *(&self.offset as *const _ as *mut u32)}; + 80005b2c: 02850613 addi a2,a0,40 + 80005b30: e032 sd a2,0(sp) + 80005b32: f332 sd a2,416(sp) + *offset += ret as u32; + 80005b34: 1582 slli a1,a1,0x20 + 80005b36: 9181 srli a1,a1,0x20 + 80005b38: 02856503 lwu a0,40(a0) + 80005b3c: 95aa add a1,a1,a0 + 80005b3e: e42e sd a1,8(sp) + 80005b40: 02059513 slli a0,a1,0x20 + 80005b44: 9101 srli a0,a0,0x20 + 80005b46: 06b51e63 bne a0,a1,80005bc2 <.LBB1_69> + 80005b4a: a009 j 80005b4c <.LBB1_66+0x9c> + 80005b4c: 6522 ld a0,8(sp) + 80005b4e: 6582 ld a1,0(sp) + 80005b50: c188 sw a0,0(a1) + 80005b52: 4501 li a0,0 + drop(inode_guard); + 80005b54: 14a103a3 sb a0,327(sp) + 80005b58: 6572 ld a0,280(sp) + 80005b5a: 7592 ld a1,288(sp) + 80005b5c: 00018097 auipc ra,0x18 + 80005b60: 2de080e7 jalr 734(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80005b64: a009 j 80005b66 <.LBB1_66+0xb6> + Ok(ret) + 80005b66: 65ea ld a1,152(sp) + 80005b68: 752a ld a0,168(sp) + 80005b6a: e588 sd a0,8(a1) + 80005b6c: 4501 li a0,0 + 80005b6e: e188 sd a0,0(a1) + match inode_guard.read(true, addr, self.offset, len as u32) { + 80005b70: a831 j 80005b8c <.LBB1_66+0xdc> + 80005b72: 4501 li a0,0 + }, + 80005b74: 14a103a3 sb a0,327(sp) + }, + } + } + 80005b78: a009 j 80005b7a <.LBB1_66+0xca> + 80005b7a: 60be ld ra,456(sp) + 80005b7c: 6179 addi sp,sp,464 + 80005b7e: 8082 ret + 80005b80: 0a28 addi a0,sp,280 + }, + 80005b82: 00001097 auipc ra,0x1 + 80005b86: 6b8080e7 jalr 1720(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 80005b8a: b7e5 j 80005b72 <.LBB1_66+0xc2> + 80005b8c: 14714503 lbu a0,327(sp) + 80005b90: 8905 andi a0,a0,1 + 80005b92: f57d bnez a0,80005b80 <.LBB1_66+0xd0> + 80005b94: bff9 j 80005b72 <.LBB1_66+0xc2> + unsafe{ DEVICE_LIST.table[self.major as usize].read as usize == 0 }{ + 80005b96: 6566 ld a0,88(sp) + +0000000080005b98 <.LBB1_67>: + 80005b98: 00022617 auipc a2,0x22 + 80005b9c: 89060613 addi a2,a2,-1904 # 80027428 <.L__unnamed_9> + 80005ba0: 45a9 li a1,10 + 80005ba2: 0001d097 auipc ra,0x1d + 80005ba6: 5ce080e7 jalr 1486(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80005baa: 0000 unimp + DEVICE_LIST.table[self.major as usize].read() + 80005bac: 6546 ld a0,80(sp) + +0000000080005bae <.LBB1_68>: + 80005bae: 00022617 auipc a2,0x22 + 80005bb2: 89260613 addi a2,a2,-1902 # 80027440 <.L__unnamed_10> + 80005bb6: 45a9 li a1,10 + 80005bb8: 0001d097 auipc ra,0x1d + 80005bbc: 5b8080e7 jalr 1464(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080005bc2 <.LBB1_69>: + *offset += ret as u32; + 80005bc2: 00022517 auipc a0,0x22 + 80005bc6: 8de50513 addi a0,a0,-1826 # 800274a0 + +0000000080005bca <.LBB1_70>: + 80005bca: 00022617 auipc a2,0x22 + 80005bce: 8be60613 addi a2,a2,-1858 # 80027488 <.L__unnamed_11> + 80005bd2: 45f1 li a1,28 + 80005bd4: 0001d097 auipc ra,0x1d + 80005bd8: 570080e7 jalr 1392(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs4file5VFile5write17h6504f6f101707b61E: + +0000000080005bde <_ZN6kernel2fs4file5VFile5write17h6504f6f101707b61E>: + + /// Write to file f. + /// addr is a user virtual address. + pub fn write( + 80005bde: de010113 addi sp,sp,-544 + 80005be2: 20113c23 sd ra,536(sp) + 80005be6: f536 sd a3,168(sp) + 80005be8: f932 sd a2,176(sp) + 80005bea: fd2e sd a1,184(sp) + 80005bec: 85aa mv a1,a0 + 80005bee: 756a ld a0,184(sp) + 80005bf0: e1ae sd a1,192(sp) + 80005bf2: eb2a sd a0,400(sp) + 80005bf4: ef32 sd a2,408(sp) + 80005bf6: f336 sd a3,416(sp) + &self, + addr: usize, + len: usize + ) -> Result { + let ret; + if !self.writeable() { + 80005bf8: 00000097 auipc ra,0x0 + 80005bfc: 462080e7 jalr 1122(ra) # 8000605a <_ZN6kernel2fs4file5VFile9writeable17h876bce4459deb027E> + 80005c00: e5aa sd a0,200(sp) + 80005c02: a009 j 80005c04 <_ZN6kernel2fs4file5VFile5write17h6504f6f101707b61E+0x26> + 80005c04: 652e ld a0,200(sp) + 80005c06: e105 bnez a0,80005c26 <.LBB2_72+0x14> + 80005c08: a009 j 80005c0a <.LBB2_71> + +0000000080005c0a <.LBB2_71>: + panic!("file can't be written") + 80005c0a: 00022517 auipc a0,0x22 + 80005c0e: 8ce50513 addi a0,a0,-1842 # 800274d8 <.L__unnamed_12> + +0000000080005c12 <.LBB2_72>: + 80005c12: 00022617 auipc a2,0x22 + 80005c16: 8de60613 addi a2,a2,-1826 # 800274f0 <.L__unnamed_13> + 80005c1a: 45d5 li a1,21 + 80005c1c: 0001d097 auipc ra,0x1d + 80005c20: 528080e7 jalr 1320(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80005c24: 0000 unimp + } + + match self.ftype { + FileType::Pipe => { + 80005c26: 756a ld a0,184(sp) + 80005c28: 02c55503 lhu a0,44(a0) + 80005c2c: f12a sd a0,160(sp) + 80005c2e: 4585 li a1,1 + 80005c30: 02b50b63 beq a0,a1,80005c66 <.LBB2_74+0x14> + 80005c34: a009 j 80005c36 <.LBB2_72+0x24> + 80005c36: 750a ld a0,160(sp) + 80005c38: 4589 li a1,2 + 80005c3a: 1eb50663 beq a0,a1,80005e26 <.LBB2_79+0x68> + 80005c3e: a009 j 80005c40 <.LBB2_72+0x2e> + 80005c40: 750a ld a0,160(sp) + 80005c42: 458d li a1,3 + 80005c44: 0ab50463 beq a0,a1,80005cec <.LBB2_75+0x80> + 80005c48: a009 j 80005c4a <.LBB2_73> + +0000000080005c4a <.LBB2_73>: + ret = count; + Ok(ret) + }, + + _ => { + panic!("Invalid File Type!") + 80005c4a: 00022517 auipc a0,0x22 + 80005c4e: 8be50513 addi a0,a0,-1858 # 80027508 <.L__unnamed_14> + +0000000080005c52 <.LBB2_74>: + 80005c52: 00022617 auipc a2,0x22 + 80005c56: 8ce60613 addi a2,a2,-1842 # 80027520 <.L__unnamed_15> + 80005c5a: 45c9 li a1,18 + 80005c5c: 0001d097 auipc ra,0x1d + 80005c60: 4e8080e7 jalr 1256(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80005c64: 0000 unimp + let pipe = unsafe{ &mut *self.pipe.unwrap() }; + 80005c66: 75ea ld a1,184(sp) + 80005c68: 6188 ld a0,0(a1) + 80005c6a: 658c ld a1,8(a1) + +0000000080005c6c <.LBB2_75>: + 80005c6c: 00022617 auipc a2,0x22 + 80005c70: 9cc60613 addi a2,a2,-1588 # 80027638 <.L__unnamed_16> + 80005c74: 0000a097 auipc ra,0xa + 80005c78: 936080e7 jalr -1738(ra) # 8000f5aa <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E> + 80005c7c: ed2a sd a0,152(sp) + 80005c7e: a009 j 80005c80 <.LBB2_75+0x14> + 80005c80: 76aa ld a3,168(sp) + 80005c82: 764a ld a2,176(sp) + 80005c84: 65ea ld a1,152(sp) + 80005c86: ffae sd a1,504(sp) + 80005c88: 1988 addi a0,sp,240 + ret = pipe.write(addr, len)?; + 80005c8a: 00005097 auipc ra,0x5 + 80005c8e: f5a080e7 jalr -166(ra) # 8000abe4 <_ZN6kernel2fs4pipe4Pipe5write17h441574030d245cddE> + 80005c92: a009 j 80005c94 <.LBB2_75+0x28> + 80005c94: 09a8 addi a0,sp,216 + 80005c96: 198c addi a1,sp,240 + 80005c98: 00008097 auipc ra,0x8 + 80005c9c: dfc080e7 jalr -516(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 80005ca0: a009 j 80005ca2 <.LBB2_75+0x36> + 80005ca2: 656e ld a0,216(sp) + 80005ca4: 4581 li a1,0 + 80005ca6: 00b50463 beq a0,a1,80005cae <.LBB2_75+0x42> + 80005caa: a009 j 80005cac <.LBB2_75+0x40> + 80005cac: a819 j 80005cc2 <.LBB2_75+0x56> + 80005cae: 658e ld a1,192(sp) + 80005cb0: 750e ld a0,224(sp) + 80005cb2: 20a13823 sd a0,528(sp) + 80005cb6: e9aa sd a0,208(sp) + Ok(ret) + 80005cb8: e588 sd a0,8(a1) + 80005cba: 4501 li a0,0 + 80005cbc: e188 sd a0,0(a1) + match self.ftype { + 80005cbe: a4e5 j 80005fa6 <.LBB2_82+0x4e> + ret = pipe.write(addr, len)?; + 80005cc0: 0000 unimp + 80005cc2: 750e ld a0,224(sp) + 80005cc4: 75ae ld a1,232(sp) + 80005cc6: 20a13023 sd a0,512(sp) + 80005cca: 20b13423 sd a1,520(sp) + 80005cce: 00006097 auipc ra,0x6 + 80005cd2: 6b8080e7 jalr 1720(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 80005cd6: e52a sd a0,136(sp) + 80005cd8: e92e sd a1,144(sp) + 80005cda: a009 j 80005cdc <.LBB2_75+0x70> + 80005cdc: 664a ld a2,144(sp) + 80005cde: 65aa ld a1,136(sp) + 80005ce0: 650e ld a0,192(sp) + 80005ce2: 00008097 auipc ra,0x8 + 80005ce6: ce4080e7 jalr -796(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 80005cea: ac75 j 80005fa6 <.LBB2_82+0x4e> + if self.major < 0 || + 80005cec: 756a ld a0,184(sp) + 80005cee: 02e51503 lh a0,46(a0) + 80005cf2: 4581 li a1,0 + 80005cf4: 02b54863 blt a0,a1,80005d24 <.LBB2_75+0xb8> + 80005cf8: a835 j 80005d34 <.LBB2_75+0xc8> + 80005cfa: 4505 li a0,1 + 80005cfc: 10a10723 sb a0,270(sp) + 80005d00: a829 j 80005d1a <.LBB2_75+0xae> + 80005d02: 4501 li a0,0 + 80005d04: 10a10723 sb a0,270(sp) + 80005d08: a809 j 80005d1a <.LBB2_75+0xae> + unsafe{ DEVICE_LIST.table[self.major as usize].write as usize == 0 } { + 80005d0a: 756a ld a0,184(sp) + 80005d0c: 02e51503 lh a0,46(a0) + 80005d10: e12a sd a0,128(sp) + 80005d12: 45a9 li a1,10 + 80005d14: 02b56c63 bltu a0,a1,80005d4c <.LBB2_75+0xe0> + 80005d18: ac61 j 80005fb0 <.LBB2_82+0x58> + if self.major < 0 || + 80005d1a: 10e14503 lbu a0,270(sp) + 80005d1e: 8905 andi a0,a0,1 + 80005d20: e139 bnez a0,80005d66 <.LBB2_76+0x14> + 80005d22: a8a9 j 80005d7c <.LBB2_77+0x14> + 80005d24: 4505 li a0,1 + 80005d26: 10a107a3 sb a0,271(sp) + 80005d2a: a821 j 80005d42 <.LBB2_75+0xd6> + 80005d2c: 4501 li a0,0 + 80005d2e: 10a107a3 sb a0,271(sp) + 80005d32: a801 j 80005d42 <.LBB2_75+0xd6> + self.major as usize >= NDEV || + 80005d34: 756a ld a0,184(sp) + 80005d36: 02e51583 lh a1,46(a0) + 80005d3a: 4525 li a0,9 + if self.major < 0 || + 80005d3c: feb564e3 bltu a0,a1,80005d24 <.LBB2_75+0xb8> + 80005d40: b7f5 j 80005d2c <.LBB2_75+0xc0> + 80005d42: 10f14503 lbu a0,271(sp) + 80005d46: 8905 andi a0,a0,1 + 80005d48: f94d bnez a0,80005cfa <.LBB2_75+0x8e> + 80005d4a: b7c1 j 80005d0a <.LBB2_75+0x9e> + unsafe{ DEVICE_LIST.table[self.major as usize].write as usize == 0 } { + 80005d4c: 650a ld a0,128(sp) + 80005d4e: 00451593 slli a1,a0,0x4 + +0000000080005d52 <.LBB2_76>: + 80005d52: 0005e517 auipc a0,0x5e + 80005d56: 2ae50513 addi a0,a0,686 # 80064000 <_ZN6kernel2fs7devices11DEVICE_LIST17h17b7683da24e3570E> + 80005d5a: 952e add a0,a0,a1 + 80005d5c: 6508 ld a0,8(a0) + 80005d5e: 4581 li a1,0 + if self.major < 0 || + 80005d60: f8b50de3 beq a0,a1,80005cfa <.LBB2_75+0x8e> + 80005d64: bf79 j 80005d02 <.LBB2_75+0x96> + return Err("Fail to write to device") + 80005d66: 658e ld a1,192(sp) + +0000000080005d68 <.LBB2_77>: + 80005d68: 00021517 auipc a0,0x21 + 80005d6c: 7e850513 addi a0,a0,2024 # 80027550 <.L__unnamed_17> + 80005d70: e588 sd a0,8(a1) + 80005d72: 455d li a0,23 + 80005d74: e988 sd a0,16(a1) + 80005d76: 4505 li a0,1 + 80005d78: e188 sd a0,0(a1) + 80005d7a: a435 j 80005fa6 <.LBB2_82+0x4e> + DEVICE_LIST.table[self.major as usize].write() + 80005d7c: 756a ld a0,184(sp) + 80005d7e: 02e51583 lh a1,46(a0) + 80005d82: fcae sd a1,120(sp) + 80005d84: 4525 li a0,9 + 80005d86: 24b56063 bltu a0,a1,80005fc6 <.LBB2_83+0x14> + 80005d8a: a009 j 80005d8c <.LBB2_77+0x24> + 80005d8c: 7566 ld a0,120(sp) + 80005d8e: 0512 slli a0,a0,0x4 + +0000000080005d90 <.LBB2_78>: + 80005d90: 0005e597 auipc a1,0x5e + 80005d94: 27058593 addi a1,a1,624 # 80064000 <_ZN6kernel2fs7devices11DEVICE_LIST17h17b7683da24e3570E> + 80005d98: 952e add a0,a0,a1 + 80005d9a: fffff097 auipc ra,0xfffff + 80005d9e: 664080e7 jalr 1636(ra) # 800053fe <_ZN6kernel2fs7devices6Device5write17hdacd5bd8b779c8b1E> + 80005da2: 85aa mv a1,a0 + 80005da4: f8ae sd a1,112(sp) + 80005da6: f72a sd a0,424(sp) + 80005da8: a009 j 80005daa <.LBB2_78+0x1a> + ret = write(true, addr, len).ok_or("Fail to write device")?; + 80005daa: 76c6 ld a3,112(sp) + 80005dac: 762a ld a2,168(sp) + 80005dae: 75ca ld a1,176(sp) + 80005db0: 4505 li a0,1 + 80005db2: 9682 jalr a3 + 80005db4: f0aa sd a0,96(sp) + 80005db6: f4ae sd a1,104(sp) + 80005db8: a009 j 80005dba <.LBB2_78+0x2a> + 80005dba: 7626 ld a2,104(sp) + 80005dbc: 7586 ld a1,96(sp) + +0000000080005dbe <.LBB2_79>: + 80005dbe: 00021697 auipc a3,0x21 + 80005dc2: 7c268693 addi a3,a3,1986 # 80027580 <.L__unnamed_18> + 80005dc6: 1228 addi a0,sp,296 + 80005dc8: 4751 li a4,20 + 80005dca: 00009097 auipc ra,0x9 + 80005dce: 2d6080e7 jalr 726(ra) # 8000f0a0 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E> + 80005dd2: a009 j 80005dd4 <.LBB2_79+0x16> + 80005dd4: 0a08 addi a0,sp,272 + 80005dd6: 122c addi a1,sp,296 + 80005dd8: 00008097 auipc ra,0x8 + 80005ddc: cbc080e7 jalr -836(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 80005de0: a009 j 80005de2 <.LBB2_79+0x24> + 80005de2: 6552 ld a0,272(sp) + 80005de4: 4581 li a1,0 + 80005de6: 00b50463 beq a0,a1,80005dee <.LBB2_79+0x30> + 80005dea: a009 j 80005dec <.LBB2_79+0x2e> + 80005dec: a811 j 80005e00 <.LBB2_79+0x42> + 80005dee: 658e ld a1,192(sp) + 80005df0: 6572 ld a0,280(sp) + 80005df2: e3aa sd a0,448(sp) + 80005df4: e9aa sd a0,208(sp) + Ok(ret) + 80005df6: e588 sd a0,8(a1) + 80005df8: 4501 li a0,0 + 80005dfa: e188 sd a0,0(a1) + match self.ftype { + 80005dfc: a26d j 80005fa6 <.LBB2_82+0x4e> + ret = write(true, addr, len).ok_or("Fail to write device")?; + 80005dfe: 0000 unimp + 80005e00: 6572 ld a0,280(sp) + 80005e02: 7592 ld a1,288(sp) + 80005e04: fb2a sd a0,432(sp) + 80005e06: ff2e sd a1,440(sp) + 80005e08: 00006097 auipc ra,0x6 + 80005e0c: 57e080e7 jalr 1406(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 80005e10: e8aa sd a0,80(sp) + 80005e12: ecae sd a1,88(sp) + 80005e14: a009 j 80005e16 <.LBB2_79+0x58> + 80005e16: 6666 ld a2,88(sp) + 80005e18: 65c6 ld a1,80(sp) + 80005e1a: 650e ld a0,192(sp) + 80005e1c: 00008097 auipc ra,0x8 + 80005e20: baa080e7 jalr -1110(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 80005e24: a249 j 80005fa6 <.LBB2_82+0x4e> + 80005e26: 6505 lui a0,0x1 + 80005e28: c005051b addiw a0,a0,-1024 + let max = ((MAXOPBLOCKS -1 -1 -2) / 2) * BSIZE; + 80005e2c: e7aa sd a0,456(sp) + 80005e2e: 4501 li a0,0 + let mut count = 0; + 80005e30: e2aa sd a0,320(sp) + while count < len { + 80005e32: a009 j 80005e34 <.LBB2_79+0x76> + 80005e34: 75aa ld a1,168(sp) + 80005e36: 6516 ld a0,320(sp) + 80005e38: 00b56a63 bltu a0,a1,80005e4c <.LBB2_79+0x8e> + 80005e3c: a009 j 80005e3e <.LBB2_79+0x80> + ret = count; + 80005e3e: 658e ld a1,192(sp) + 80005e40: 6516 ld a0,320(sp) + 80005e42: e9aa sd a0,208(sp) + Ok(ret) + 80005e44: e588 sd a0,8(a1) + 80005e46: 4501 li a0,0 + 80005e48: e188 sd a0,0(a1) + match self.ftype { + 80005e4a: aab1 j 80005fa6 <.LBB2_82+0x4e> + let mut write_bytes = len - count; + 80005e4c: 752a ld a0,168(sp) + 80005e4e: 6596 ld a1,320(sp) + 80005e50: 40b505b3 sub a1,a0,a1 + 80005e54: e4ae sd a1,72(sp) + 80005e56: 18b56363 bltu a0,a1,80005fdc <.LBB2_85> + 80005e5a: a009 j 80005e5c <.LBB2_79+0x9e> + 80005e5c: 6526 ld a0,72(sp) + 80005e5e: e6aa sd a0,328(sp) + 80005e60: 6585 lui a1,0x1 + 80005e62: c015859b addiw a1,a1,-1023 + if write_bytes > max { write_bytes = max; } + 80005e66: 00b56863 bltu a0,a1,80005e76 <.LBB2_79+0xb8> + 80005e6a: a009 j 80005e6c <.LBB2_79+0xae> + 80005e6c: 6505 lui a0,0x1 + 80005e6e: c005051b addiw a0,a0,-1024 + 80005e72: e6aa sd a0,328(sp) + 80005e74: a011 j 80005e78 <.LBB2_80> + 80005e76: a009 j 80005e78 <.LBB2_80> + +0000000080005e78 <.LBB2_80>: + LOG.begin_op(); + 80005e78: 00055517 auipc a0,0x55 + 80005e7c: 66050513 addi a0,a0,1632 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80005e80: 00003097 auipc ra,0x3 + 80005e84: 55a080e7 jalr 1370(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 80005e88: a009 j 80005e8a <.LBB2_80+0x12> + let inode = self.inode.as_ref().unwrap(); + 80005e8a: 756a ld a0,184(sp) + 80005e8c: 0541 addi a0,a0,16 + 80005e8e: 00009097 auipc ra,0x9 + 80005e92: 516080e7 jalr 1302(ra) # 8000f3a4 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E> + 80005e96: e0aa sd a0,64(sp) + 80005e98: a009 j 80005e9a <.LBB2_80+0x22> + 80005e9a: 6506 ld a0,64(sp) + +0000000080005e9c <.LBB2_81>: + 80005e9c: 00021597 auipc a1,0x21 + 80005ea0: 73c58593 addi a1,a1,1852 # 800275d8 <.L__unnamed_19> + 80005ea4: 0000a097 auipc ra,0xa + 80005ea8: 814080e7 jalr -2028(ra) # 8000f6b8 <_ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E> + 80005eac: 85aa mv a1,a0 + 80005eae: fc2e sd a1,56(sp) + 80005eb0: ebaa sd a0,464(sp) + 80005eb2: a009 j 80005eb4 <.LBB2_81+0x18> + let mut inode_guard = inode.lock(); + 80005eb4: 7562 ld a0,56(sp) + 80005eb6: 00016097 auipc ra,0x16 + 80005eba: db6080e7 jalr -586(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 80005ebe: eaaa sd a0,336(sp) + 80005ec0: eeae sd a1,344(sp) + 80005ec2: a009 j 80005ec4 <.LBB2_81+0x28> + 80005ec4: 0a88 addi a0,sp,336 + inode_guard.write( + 80005ec6: 00018097 auipc ra,0x18 + 80005eca: 5e0080e7 jalr 1504(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80005ece: f82a sd a0,48(sp) + 80005ed0: a009 j 80005ed2 <.LBB2_81+0x36> + addr + count, + 80005ed2: 75ca ld a1,176(sp) + 80005ed4: 6516 ld a0,320(sp) + 80005ed6: 952e add a0,a0,a1 + 80005ed8: f42a sd a0,40(sp) + 80005eda: 12b56063 bltu a0,a1,80005ffa <.LBB2_87> + 80005ede: a009 j 80005ee0 <.LBB2_81+0x44> + write_bytes as u32 + 80005ee0: 76a2 ld a3,40(sp) + 80005ee2: 75c2 ld a1,48(sp) + 80005ee4: 756a ld a0,184(sp) + 80005ee6: 67b6 ld a5,328(sp) + inode_guard.write( + 80005ee8: 5518 lw a4,40(a0) + 80005eea: 1aa8 addi a0,sp,376 + 80005eec: 4605 li a2,1 + 80005eee: 00015097 auipc ra,0x15 + 80005ef2: 4e0080e7 jalr 1248(ra) # 8001b3ce <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E> + 80005ef6: a009 j 80005ef8 <.LBB2_81+0x5c> + 80005ef8: 1288 addi a0,sp,352 + 80005efa: 1aac addi a1,sp,376 + 80005efc: 00008097 auipc ra,0x8 + 80005f00: b98080e7 jalr -1128(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 80005f04: a009 j 80005f06 <.LBB2_81+0x6a> + )?; + 80005f06: 7516 ld a0,352(sp) + 80005f08: 4581 li a1,0 + 80005f0a: 00b50463 beq a0,a1,80005f12 <.LBB2_81+0x76> + 80005f0e: a009 j 80005f10 <.LBB2_81+0x74> + 80005f10: a819 j 80005f26 <.LBB2_81+0x8a> + inode_guard.write( + 80005f12: 7536 ld a0,360(sp) + 80005f14: f7aa sd a0,488(sp) + drop(inode_guard); + 80005f16: 6556 ld a0,336(sp) + 80005f18: 65f6 ld a1,344(sp) + 80005f1a: 00018097 auipc ra,0x18 + 80005f1e: f20080e7 jalr -224(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80005f22: a81d j 80005f58 <.LBB2_82> + inode_guard.write( + 80005f24: 0000 unimp + )?; + 80005f26: 7536 ld a0,360(sp) + 80005f28: 75d6 ld a1,368(sp) + 80005f2a: efaa sd a0,472(sp) + 80005f2c: f3ae sd a1,480(sp) + 80005f2e: 00006097 auipc ra,0x6 + 80005f32: 458080e7 jalr 1112(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 80005f36: ec2a sd a0,24(sp) + 80005f38: f02e sd a1,32(sp) + 80005f3a: a009 j 80005f3c <.LBB2_81+0xa0> + inode_guard.write( + 80005f3c: 7602 ld a2,32(sp) + 80005f3e: 65e2 ld a1,24(sp) + 80005f40: 650e ld a0,192(sp) + 80005f42: 00008097 auipc ra,0x8 + 80005f46: a84080e7 jalr -1404(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 80005f4a: a009 j 80005f4c <.LBB2_81+0xb0> + 80005f4c: 0a88 addi a0,sp,336 + } + 80005f4e: 00001097 auipc ra,0x1 + 80005f52: 2ec080e7 jalr 748(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 80005f56: a881 j 80005fa6 <.LBB2_82+0x4e> + +0000000080005f58 <.LBB2_82>: + LOG.end_op(); + 80005f58: 00055517 auipc a0,0x55 + 80005f5c: 58050513 addi a0,a0,1408 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80005f60: 00004097 auipc ra,0x4 + 80005f64: a60080e7 jalr -1440(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80005f68: a009 j 80005f6a <.LBB2_82+0x12> + let offset = unsafe{ &mut *(&self.offset as *const _ as *mut u32) }; + 80005f6a: 756a ld a0,184(sp) + 80005f6c: 02850593 addi a1,a0,40 + 80005f70: e42e sd a1,8(sp) + 80005f72: fbae sd a1,496(sp) + *offset += write_bytes as u32; + 80005f74: 14816583 lwu a1,328(sp) + 80005f78: 02856503 lwu a0,40(a0) + 80005f7c: 95aa add a1,a1,a0 + 80005f7e: e82e sd a1,16(sp) + 80005f80: 02059513 slli a0,a1,0x20 + 80005f84: 9101 srli a0,a0,0x20 + 80005f86: 08b51863 bne a0,a1,80006016 <.LBB2_89> + 80005f8a: a009 j 80005f8c <.LBB2_82+0x34> + 80005f8c: 6542 ld a0,16(sp) + 80005f8e: 65a2 ld a1,8(sp) + 80005f90: c188 sw a0,0(a1) + count += write_bytes; + 80005f92: 6536 ld a0,328(sp) + 80005f94: 6596 ld a1,320(sp) + 80005f96: 952e add a0,a0,a1 + 80005f98: e02a sd a0,0(sp) + 80005f9a: 08b56c63 bltu a0,a1,80006032 <.LBB2_91> + 80005f9e: a009 j 80005fa0 <.LBB2_82+0x48> + 80005fa0: 6502 ld a0,0(sp) + 80005fa2: e2aa sd a0,320(sp) + while count < len { + 80005fa4: bd41 j 80005e34 <.LBB2_79+0x76> + } + } + + } + 80005fa6: 21813083 ld ra,536(sp) + 80005faa: 22010113 addi sp,sp,544 + 80005fae: 8082 ret + unsafe{ DEVICE_LIST.table[self.major as usize].write as usize == 0 } { + 80005fb0: 650a ld a0,128(sp) + +0000000080005fb2 <.LBB2_83>: + 80005fb2: 00021617 auipc a2,0x21 + 80005fb6: 58660613 addi a2,a2,1414 # 80027538 <.L__unnamed_20> + 80005fba: 45a9 li a1,10 + 80005fbc: 0001d097 auipc ra,0x1d + 80005fc0: 1b4080e7 jalr 436(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80005fc4: 0000 unimp + DEVICE_LIST.table[self.major as usize].write() + 80005fc6: 7566 ld a0,120(sp) + +0000000080005fc8 <.LBB2_84>: + 80005fc8: 00021617 auipc a2,0x21 + 80005fcc: 5a060613 addi a2,a2,1440 # 80027568 <.L__unnamed_21> + 80005fd0: 45a9 li a1,10 + 80005fd2: 0001d097 auipc ra,0x1d + 80005fd6: 19e080e7 jalr 414(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080005fdc <.LBB2_85>: + let mut write_bytes = len - count; + 80005fdc: 00021517 auipc a0,0x21 + 80005fe0: 5d450513 addi a0,a0,1492 # 800275b0 + +0000000080005fe4 <.LBB2_86>: + 80005fe4: 00021617 auipc a2,0x21 + 80005fe8: 5b460613 addi a2,a2,1460 # 80027598 <.L__unnamed_22> + 80005fec: 02100593 li a1,33 + 80005ff0: 0001d097 auipc ra,0x1d + 80005ff4: 154080e7 jalr 340(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080005ffa <.LBB2_87>: + addr + count, + 80005ffa: 00021517 auipc a0,0x21 + 80005ffe: 4a650513 addi a0,a0,1190 # 800274a0 + +0000000080006002 <.LBB2_88>: + 80006002: 00021617 auipc a2,0x21 + 80006006: 5ee60613 addi a2,a2,1518 # 800275f0 <.L__unnamed_23> + 8000600a: 45f1 li a1,28 + 8000600c: 0001d097 auipc ra,0x1d + 80006010: 138080e7 jalr 312(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006016 <.LBB2_89>: + *offset += write_bytes as u32; + 80006016: 00021517 auipc a0,0x21 + 8000601a: 48a50513 addi a0,a0,1162 # 800274a0 + +000000008000601e <.LBB2_90>: + 8000601e: 00021617 auipc a2,0x21 + 80006022: 5ea60613 addi a2,a2,1514 # 80027608 <.L__unnamed_24> + 80006026: 45f1 li a1,28 + 80006028: 0001d097 auipc ra,0x1d + 8000602c: 11c080e7 jalr 284(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006032 <.LBB2_91>: + count += write_bytes; + 80006032: 00021517 auipc a0,0x21 + 80006036: 46e50513 addi a0,a0,1134 # 800274a0 + +000000008000603a <.LBB2_92>: + 8000603a: 00021617 auipc a2,0x21 + 8000603e: 5e660613 addi a2,a2,1510 # 80027620 <.L__unnamed_25> + 80006042: 45f1 li a1,28 + 80006044: 0001d097 auipc ra,0x1d + 80006048: 100080e7 jalr 256(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs4file5VFile8readable17h4e596856d12086d6E: + +000000008000604e <_ZN6kernel2fs4file5VFile8readable17h4e596856d12086d6E>: + + fn readable(&self) -> bool { + 8000604e: 1141 addi sp,sp,-16 + 80006050: e42a sd a0,8(sp) + self.readable + 80006052: 03054503 lbu a0,48(a0) + } + 80006056: 0141 addi sp,sp,16 + 80006058: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4file5VFile9writeable17h876bce4459deb027E: + +000000008000605a <_ZN6kernel2fs4file5VFile9writeable17h876bce4459deb027E>: + + fn writeable(&self) -> bool { + 8000605a: 1141 addi sp,sp,-16 + 8000605c: e42a sd a0,8(sp) + self.writeable + 8000605e: 03154503 lbu a0,49(a0) + } + 80006062: 0141 addi sp,sp,16 + 80006064: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4file5VFile4stat17heebdb0d64a039b86E: + +0000000080006066 <_ZN6kernel2fs4file5VFile4stat17heebdb0d64a039b86E>: + + /// Get metadata about file f. + /// addr is a user virtual address, pointing to a struct stat. + pub fn stat(&self, addr: usize) -> Result<(), &'static str> { + 80006066: 7111 addi sp,sp,-256 + 80006068: fd86 sd ra,248(sp) + 8000606a: ecae sd a1,88(sp) + 8000606c: f0aa sd a0,96(sp) + 8000606e: fd2a sd a0,184(sp) + 80006070: e1ae sd a1,192(sp) + +0000000080006072 <.LBB5_21>: + let p = unsafe{ CPU_MANAGER.myproc().unwrap() }; + 80006072: 00060517 auipc a0,0x60 + 80006076: 0ce50513 addi a0,a0,206 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000607a: 0000c097 auipc ra,0xc + 8000607e: 3de080e7 jalr 990(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80006082: f4aa sd a0,104(sp) + 80006084: a009 j 80006086 <.LBB5_21+0x14> + 80006086: 7526 ld a0,104(sp) + +0000000080006088 <.LBB5_22>: + 80006088: 00021597 auipc a1,0x21 + 8000608c: 5c858593 addi a1,a1,1480 # 80027650 <.L__unnamed_26> + 80006090: 00009097 auipc ra,0x9 + 80006094: 700080e7 jalr 1792(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80006098: e8aa sd a0,80(sp) + 8000609a: a009 j 8000609c <.LBB5_22+0x14> + 8000609c: 6546 ld a0,80(sp) + 8000609e: e9aa sd a0,208(sp) + 800060a0: 0108 addi a0,sp,128 + let mut stat: Stat = Stat::new(); + 800060a2: 00019097 auipc ra,0x19 + 800060a6: 50a080e7 jalr 1290(ra) # 8001f5ac <_ZN6kernel2fs4stat4Stat3new17h349e191f39203f6dE> + 800060aa: a009 j 800060ac <.LBB5_22+0x24> + match self.ftype { + FileType::Device | FileType::Inode => { + 800060ac: 7506 ld a0,96(sp) + 800060ae: 02c51503 lh a0,44(a0) + 800060b2: 1579 addi a0,a0,-2 + 800060b4: 65c1 lui a1,0x10 + 800060b6: 35fd addiw a1,a1,-1 + 800060b8: 8d6d and a0,a0,a1 + 800060ba: 4589 li a1,2 + 800060bc: 00b56b63 bltu a0,a1,800060d2 <.LBB5_23+0x10> + 800060c0: a009 j 800060c2 <.LBB5_23> + +00000000800060c2 <.LBB5_23>: + page_table.copy_out(addr, (&stat) as *const Stat as *const u8, size_of::())?; + Ok(()) + }, + + _ => { + Err("") + 800060c2: 00021517 auipc a0,0x21 + 800060c6: 5a650513 addi a0,a0,1446 # 80027668 <.L__unnamed_28> + 800060ca: f8aa sd a0,112(sp) + 800060cc: 4501 li a0,0 + 800060ce: fcaa sd a0,120(sp) + match self.ftype { + 800060d0: a8f1 j 800061ac <.LBB5_24+0xc8> + let inode = self.inode.as_ref().unwrap(); + 800060d2: 7506 ld a0,96(sp) + 800060d4: 0541 addi a0,a0,16 + 800060d6: 00009097 auipc ra,0x9 + 800060da: 2ce080e7 jalr 718(ra) # 8000f3a4 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E> + 800060de: e4aa sd a0,72(sp) + 800060e0: a009 j 800060e2 <.LBB5_23+0x20> + 800060e2: 6526 ld a0,72(sp) + +00000000800060e4 <.LBB5_24>: + 800060e4: 00021597 auipc a1,0x21 + 800060e8: 58458593 addi a1,a1,1412 # 80027668 <.L__unnamed_28> + 800060ec: 00009097 auipc ra,0x9 + 800060f0: 5cc080e7 jalr 1484(ra) # 8000f6b8 <_ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E> + 800060f4: 85aa mv a1,a0 + 800060f6: e0ae sd a1,64(sp) + 800060f8: edaa sd a0,216(sp) + 800060fa: a009 j 800060fc <.LBB5_24+0x18> + let inode_guard = inode.lock(); + 800060fc: 6506 ld a0,64(sp) + 800060fe: 00016097 auipc ra,0x16 + 80006102: b6e080e7 jalr -1170(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 80006106: ed2a sd a0,152(sp) + 80006108: f12e sd a1,160(sp) + 8000610a: a009 j 8000610c <.LBB5_24+0x28> + 8000610c: 0928 addi a0,sp,152 + inode_guard.stat(&mut stat); + 8000610e: 00018097 auipc ra,0x18 + 80006112: 384080e7 jalr 900(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80006116: fc2a sd a0,56(sp) + 80006118: a009 j 8000611a <.LBB5_24+0x36> + 8000611a: 7562 ld a0,56(sp) + 8000611c: 010c addi a1,sp,128 + 8000611e: 00015097 auipc ra,0x15 + 80006122: 9aa080e7 jalr -1622(ra) # 8001aac8 <_ZN6kernel2fs5inode9InodeData4stat17h1253d1c76b7156e3E> + 80006126: a009 j 80006128 <.LBB5_24+0x44> + drop(inode_guard); + 80006128: 656a ld a0,152(sp) + 8000612a: 758a ld a1,160(sp) + 8000612c: 00018097 auipc ra,0x18 + 80006130: d0e080e7 jalr -754(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80006134: a009 j 80006136 <.LBB5_24+0x52> + let page_table = unsafe { &mut *p.pagetable }; + 80006136: 6546 ld a0,80(sp) + 80006138: 6d08 ld a0,24(a0) + 8000613a: f42a sd a0,40(sp) + 8000613c: f1aa sd a0,224(sp) + 8000613e: 0108 addi a0,sp,128 + page_table.copy_out(addr, (&stat) as *const Stat as *const u8, size_of::())?; + 80006140: f82a sd a0,48(sp) + 80006142: a009 j 80006144 <.LBB5_24+0x60> + 80006144: 7642 ld a2,48(sp) + 80006146: 65e6 ld a1,88(sp) + 80006148: 7522 ld a0,40(sp) + 8000614a: 46e1 li a3,24 + 8000614c: 00013097 auipc ra,0x13 + 80006150: 832080e7 jalr -1998(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 80006154: ec2a sd a0,24(sp) + 80006156: f02e sd a1,32(sp) + 80006158: a009 j 8000615a <.LBB5_24+0x76> + 8000615a: 7582 ld a1,32(sp) + 8000615c: 6562 ld a0,24(sp) + 8000615e: 00008097 auipc ra,0x8 + 80006162: 9da080e7 jalr -1574(ra) # 8000db38 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb12176fc822fec8fE> + 80006166: f52a sd a0,168(sp) + 80006168: f92e sd a1,176(sp) + 8000616a: a009 j 8000616c <.LBB5_24+0x88> + 8000616c: 752a ld a0,168(sp) + 8000616e: 00a035b3 snez a1,a0 + 80006172: 4581 li a1,0 + 80006174: 00b50463 beq a0,a1,8000617c <.LBB5_24+0x98> + 80006178: a009 j 8000617a <.LBB5_24+0x96> + 8000617a: a029 j 80006184 <.LBB5_24+0xa0> + 8000617c: 4501 li a0,0 + Ok(()) + 8000617e: f8aa sd a0,112(sp) + match self.ftype { + 80006180: a035 j 800061ac <.LBB5_24+0xc8> + page_table.copy_out(addr, (&stat) as *const Stat as *const u8, size_of::())?; + 80006182: 0000 unimp + 80006184: 752a ld a0,168(sp) + 80006186: 75ca ld a1,176(sp) + 80006188: f5aa sd a0,232(sp) + 8000618a: f9ae sd a1,240(sp) + 8000618c: 00006097 auipc ra,0x6 + 80006190: 1fa080e7 jalr 506(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 80006194: e42a sd a0,8(sp) + 80006196: e82e sd a1,16(sp) + 80006198: a009 j 8000619a <.LBB5_24+0xb6> + 8000619a: 65c2 ld a1,16(sp) + 8000619c: 6522 ld a0,8(sp) + 8000619e: 00008097 auipc ra,0x8 + 800061a2: 89e080e7 jalr -1890(ra) # 8000da3c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h9d11a50f8e490b2eE> + 800061a6: f8aa sd a0,112(sp) + 800061a8: fcae sd a1,120(sp) + 800061aa: a009 j 800061ac <.LBB5_24+0xc8> + } + } + } + 800061ac: 7546 ld a0,112(sp) + 800061ae: 75e6 ld a1,120(sp) + 800061b0: 70ee ld ra,248(sp) + 800061b2: 6111 addi sp,sp,256 + 800061b4: 8082 ret + +Disassembly of section .text._ZN65_$LT$kernel..fs..file..FileType$u20$as$u20$core..clone..Clone$GT$5clone17h661efdf789c282d2E: + +00000000800061b6 <_ZN65_$LT$kernel..fs..file..FileType$u20$as$u20$core..clone..Clone$GT$5clone17h661efdf789c282d2E>: +#[derive(Clone, Copy, Debug, PartialEq)] + 800061b6: 1141 addi sp,sp,-16 + 800061b8: e42a sd a0,8(sp) + 800061ba: 00051503 lh a0,0(a0) + 800061be: 0141 addi sp,sp,16 + 800061c0: 8082 ret + +Disassembly of section .text._ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E: + +00000000800061c2 <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E>: +#[derive(Clone, Debug)] + 800061c2: 7115 addi sp,sp,-224 + 800061c4: ed86 sd ra,216(sp) + 800061c6: fc2e sd a1,56(sp) + 800061c8: e0aa sd a0,64(sp) + 800061ca: ed2e sd a1,152(sp) + pub(crate) ftype: FileType, + 800061cc: 02c58513 addi a0,a1,44 + 800061d0: f12a sd a0,160(sp) + pub(crate) readable: bool, + 800061d2: 03058613 addi a2,a1,48 + 800061d6: e4b2 sd a2,72(sp) + 800061d8: f532 sd a2,168(sp) + pub(crate) writeable: bool, + 800061da: 03158613 addi a2,a1,49 + 800061de: e8b2 sd a2,80(sp) + 800061e0: f932 sd a2,176(sp) + pub(crate) pipe: Option<*mut Pipe>, + 800061e2: 862e mv a2,a1 + 800061e4: ecb2 sd a2,88(sp) + 800061e6: fd2e sd a1,184(sp) + pub(crate) inode: Option, + 800061e8: 01058613 addi a2,a1,16 + 800061ec: f0b2 sd a2,96(sp) + 800061ee: e1b2 sd a2,192(sp) + pub(crate) offset: u32, + 800061f0: 02858613 addi a2,a1,40 + 800061f4: f4b2 sd a2,104(sp) + 800061f6: e5b2 sd a2,200(sp) + pub(crate) major: i16 + 800061f8: 02e58593 addi a1,a1,46 + 800061fc: f8ae sd a1,112(sp) + 800061fe: e9ae sd a1,208(sp) + pub(crate) ftype: FileType, + 80006200: 00000097 auipc ra,0x0 + 80006204: fb6080e7 jalr -74(ra) # 800061b6 <_ZN65_$LT$kernel..fs..file..FileType$u20$as$u20$core..clone..Clone$GT$5clone17h661efdf789c282d2E> + 80006208: 65c1 lui a1,0x10 + 8000620a: 35fd addiw a1,a1,-1 + 8000620c: 8d6d and a0,a0,a1 + 8000620e: fcaa sd a0,120(sp) + 80006210: a009 j 80006212 <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E+0x50> + pub(crate) readable: bool, + 80006212: 6526 ld a0,72(sp) + 80006214: 00018097 auipc ra,0x18 + 80006218: 4a4080e7 jalr 1188(ra) # 8001e6b8 <_ZN4core5clone5impls53_$LT$impl$u20$core..clone..Clone$u20$for$u20$bool$GT$5clone17hd6e1e19c635da345E> + 8000621c: f82a sd a0,48(sp) + 8000621e: a009 j 80006220 <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E+0x5e> + pub(crate) writeable: bool, + 80006220: 6546 ld a0,80(sp) + 80006222: 00018097 auipc ra,0x18 + 80006226: 496080e7 jalr 1174(ra) # 8001e6b8 <_ZN4core5clone5impls53_$LT$impl$u20$core..clone..Clone$u20$for$u20$bool$GT$5clone17hd6e1e19c635da345E> + 8000622a: f42a sd a0,40(sp) + 8000622c: a009 j 8000622e <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E+0x6c> + pub(crate) pipe: Option<*mut Pipe>, + 8000622e: 6566 ld a0,88(sp) + 80006230: 0000a097 auipc ra,0xa + 80006234: 81a080e7 jalr -2022(ra) # 8000fa4a <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E> + 80006238: ec2a sd a0,24(sp) + 8000623a: f02e sd a1,32(sp) + 8000623c: a009 j 8000623e <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E+0x7c> + pub(crate) inode: Option, + 8000623e: 7586 ld a1,96(sp) + 80006240: 0108 addi a0,sp,128 + 80006242: 0000a097 auipc ra,0xa + 80006246: 84a080e7 jalr -1974(ra) # 8000fa8c <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE> + 8000624a: a009 j 8000624c <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E+0x8a> + pub(crate) offset: u32, + 8000624c: 7526 ld a0,104(sp) + 8000624e: 00018097 auipc ra,0x18 + 80006252: 460080e7 jalr 1120(ra) # 8001e6ae <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u32$GT$5clone17ha1019ce9fdc4d620E> + 80006256: e82a sd a0,16(sp) + 80006258: a009 j 8000625a <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E+0x98> + pub(crate) major: i16 + 8000625a: 7546 ld a0,112(sp) + 8000625c: 00018097 auipc ra,0x18 + 80006260: 43a080e7 jalr 1082(ra) # 8001e696 <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$i16$GT$5clone17h91da98197f473cc1E> + 80006264: e42a sd a0,8(sp) + 80006266: a009 j 80006268 <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E+0xa6> +#[derive(Clone, Debug)] + 80006268: 6522 ld a0,8(sp) + 8000626a: 6586 ld a1,64(sp) + 8000626c: 6642 ld a2,16(sp) + 8000626e: 7682 ld a3,32(sp) + 80006270: 6762 ld a4,24(sp) + 80006272: 77a2 ld a5,40(sp) + 80006274: 7842 ld a6,48(sp) + 80006276: 78e6 ld a7,120(sp) + 80006278: 03159623 sh a7,44(a1) # 1002c <.Lline_table_start0+0x1c9> + 8000627c: 03058823 sb a6,48(a1) + 80006280: 02f588a3 sb a5,49(a1) + 80006284: e198 sd a4,0(a1) + 80006286: e594 sd a3,8(a1) + 80006288: 668a ld a3,128(sp) + 8000628a: e994 sd a3,16(a1) + 8000628c: 66aa ld a3,136(sp) + 8000628e: ed94 sd a3,24(a1) + 80006290: 66ca ld a3,144(sp) + 80006292: f194 sd a3,32(a1) + 80006294: d590 sw a2,40(a1) + 80006296: 02a59723 sh a0,46(a1) + 8000629a: 60ee ld ra,216(sp) + 8000629c: 612d addi sp,sp,224 + 8000629e: 8082 ret + +Disassembly of section .text._ZN6kernel4trap14trap_init_hart17h35cf9f3a8bf40f94E: + +00000000800062a0 <_ZN6kernel4trap14trap_init_hart17h35cf9f3a8bf40f94E>: +use super::*; + +pub static mut TICKS_LOCK:Spinlock = Spinlock::new(0, "time"); + +/// Set up to take exceptions and traps while in the kernel. +pub unsafe fn trap_init_hart() { + 800062a0: 1141 addi sp,sp,-16 + extern "C" { + fn kernelvec(); + } + stvec::write(kernelvec as usize); + 800062a2: e406 sd ra,8(sp) + +00000000800062a4 <.LBB0_2>: + 800062a4: ffffa517 auipc a0,0xffffa + 800062a8: d7c50513 addi a0,a0,-644 # 80000020 + 800062ac: 00006097 auipc ra,0x6 + 800062b0: 368080e7 jalr 872(ra) # 8000c614 <_ZN6kernel4arch5riscv8register5stvec5write17ha770434f21f9bf27E> + 800062b4: a009 j 800062b6 <.LBB0_2+0x12> +} + 800062b6: 60a2 ld ra,8(sp) + 800062b8: 0141 addi sp,sp,16 + 800062ba: 8082 ret + +Disassembly of section .text.user_trap: + +00000000800062bc : + + +/// handle an interrupt, exception, or system call from user space. +/// called from trampoline.S +#[no_mangle] +pub unsafe fn user_trap() { + 800062bc: 7101 addi sp,sp,-512 + let sepc = sepc::read(); + 800062be: ff86 sd ra,504(sp) + 800062c0: fffff097 auipc ra,0xfffff + 800062c4: a64080e7 jalr -1436(ra) # 80004d24 <_ZN6kernel4arch5riscv8register4sepc4read17hcaa3e2a818646c19E> + 800062c8: e1aa sd a0,192(sp) + 800062ca: a009 j 800062cc + let scause = Scause::new(scause::read()); + 800062cc: 00002097 auipc ra,0x2 + 800062d0: a2a080e7 jalr -1494(ra) # 80007cf6 <_ZN6kernel4arch5riscv8register6scause4read17h6f388cd664aa7885E> + 800062d4: fd2a sd a0,184(sp) + 800062d6: a009 j 800062d8 + 800062d8: 756a ld a0,184(sp) + 800062da: 00002097 auipc ra,0x2 + 800062de: b1c080e7 jalr -1252(ra) # 80007df6 <_ZN6kernel4arch5riscv8register6scause6Scause3new17hf1aad0ee6c83efd3E> + 800062e2: e5aa sd a0,200(sp) + 800062e4: a009 j 800062e6 + + if !sstatus::is_from_user() { + 800062e6: 00019097 auipc ra,0x19 + 800062ea: eea080e7 jalr -278(ra) # 8001f1d0 <_ZN6kernel4arch5riscv8register7sstatus12is_from_user17hfa7a30a57661c561E> + 800062ee: f92a sd a0,176(sp) + 800062f0: a009 j 800062f2 + 800062f2: 754a ld a0,176(sp) + 800062f4: e105 bnez a0,80006314 <.LBB1_67> + 800062f6: a009 j 800062f8 <.LBB1_65> + +00000000800062f8 <.LBB1_65>: + panic!("user_trap(): not from user mode"); + 800062f8: 00021517 auipc a0,0x21 + 800062fc: 41050513 addi a0,a0,1040 # 80027708 <.L__unnamed_1> + +0000000080006300 <.LBB1_66>: + 80006300: 00021617 auipc a2,0x21 + 80006304: 43860613 addi a2,a2,1080 # 80027738 <.L__unnamed_2> + 80006308: 45fd li a1,31 + 8000630a: 0001d097 auipc ra,0x1d + 8000630e: e3a080e7 jalr -454(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006314 <.LBB1_67>: + // send interrupts and exceptions to kerneltrap(), + // since we're now in the kernel. + extern "C" { + fn kernelvec(); + } + stvec::write(kernelvec as usize); + 80006314: ffffa517 auipc a0,0xffffa + 80006318: d0c50513 addi a0,a0,-756 # 80000020 + 8000631c: 00006097 auipc ra,0x6 + 80006320: 2f8080e7 jalr 760(ra) # 8000c614 <_ZN6kernel4arch5riscv8register5stvec5write17ha770434f21f9bf27E> + 80006324: a009 j 80006326 <.LBB1_68> + +0000000080006326 <.LBB1_68>: + + let my_proc = CPU_MANAGER.myproc().unwrap(); + 80006326: 00060517 auipc a0,0x60 + 8000632a: e1a50513 addi a0,a0,-486 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000632e: 0000c097 auipc ra,0xc + 80006332: 12a080e7 jalr 298(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80006336: f52a sd a0,168(sp) + 80006338: a009 j 8000633a <.LBB1_68+0x14> + 8000633a: 752a ld a0,168(sp) + +000000008000633c <.LBB1_69>: + 8000633c: 00021597 auipc a1,0x21 + 80006340: 41458593 addi a1,a1,1044 # 80027750 <.L__unnamed_3> + 80006344: 00009097 auipc ra,0x9 + 80006348: 44c080e7 jalr 1100(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8000634c: 85aa mv a1,a0 + 8000634e: f12e sd a1,160(sp) + 80006350: e3aa sd a0,448(sp) + 80006352: a009 j 80006354 <.LBB1_69+0x18> + let tf = &mut *my_proc.trapframe; + 80006354: 750a ld a0,160(sp) + 80006356: 710c ld a1,32(a0) + 80006358: ed2e sd a1,152(sp) + 8000635a: e7ae sd a1,456(sp) + tf.epc = sepc; + 8000635c: 650e ld a0,192(sp) + 8000635e: ed88 sd a0,24(a1) + 80006360: 01a8 addi a0,sp,200 + // println!("{}", sepc); + match scause.cause() { + 80006362: 00002097 auipc ra,0x2 + 80006366: b42080e7 jalr -1214(ra) # 80007ea4 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E> + 8000636a: 0ca10823 sb a0,208(sp) + 8000636e: 0cb108a3 sb a1,209(sp) + 80006372: a009 j 80006374 <.LBB1_69+0x38> + + Trap::Exception(Exception::UserEnvCall) => { + 80006374: 0d014503 lbu a0,208(sp) + 80006378: e92a sd a0,144(sp) + 8000637a: 8905 andi a0,a0,1 + 8000637c: 4581 li a1,0 + 8000637e: 00b50863 beq a0,a1,8000638e <.LBB1_69+0x52> + 80006382: a009 j 80006384 <.LBB1_69+0x48> + 80006384: 654a ld a0,144(sp) + 80006386: 4585 li a1,1 + 80006388: 02b50963 beq a0,a1,800063ba <.LBB1_69+0x7e> + 8000638c: a829 j 800063a6 <.LBB1_69+0x6a> + handle_syscall(); + + }, + + // Device interrupt + Trap::Interrupt(Interrupt::SupervisorExternal) => { + 8000638e: 0d114503 lbu a0,209(sp) + 80006392: e52a sd a0,136(sp) + 80006394: 4585 li a1,1 + 80006396: 12b50a63 beq a0,a1,800064ca <.LBB1_74+0x22> + 8000639a: a009 j 8000639c <.LBB1_69+0x60> + 8000639c: 652a ld a0,136(sp) + 8000639e: 4595 li a1,5 + 800063a0: 06b50a63 beq a0,a1,80006414 <.LBB1_70+0x36> + 800063a4: a009 j 800063a6 <.LBB1_69+0x6a> + 800063a6: 01a8 addi a0,sp,200 + // yield up the CPU if this is a timer interrupt + my_proc.yielding(); + }, + + _ => { + println!("usertrap: unexpected scacuse: {:?}\n pid: {}", scause.cause(), my_proc.pid()); + 800063a8: 00002097 auipc ra,0x2 + 800063ac: afc080e7 jalr -1284(ra) # 80007ea4 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E> + 800063b0: 14a10423 sb a0,328(sp) + 800063b4: 14b104a3 sb a1,329(sp) + 800063b8: aaad j 80006532 <.LBB1_75+0x22> + Trap::Exception(Exception::UserEnvCall) => { + 800063ba: 0d114503 lbu a0,209(sp) + 800063be: 459d li a1,7 + 800063c0: feb513e3 bne a0,a1,800063a6 <.LBB1_69+0x6a> + 800063c4: a009 j 800063c6 <.LBB1_69+0x8a> + if my_proc.killed() { + 800063c6: 750a ld a0,160(sp) + 800063c8: 00011097 auipc ra,0x11 + 800063cc: 9da080e7 jalr -1574(ra) # 80016da2 <_ZN6kernel7process7process11task_struct6killed17h6ef392cf7098b250E> + 800063d0: e12a sd a0,128(sp) + 800063d2: a009 j 800063d4 <.LBB1_69+0x98> + 800063d4: 650a ld a0,128(sp) + 800063d6: 4581 li a1,0 + 800063d8: 00b50d63 beq a0,a1,800063f2 <.LBB1_70+0x14> + 800063dc: a009 j 800063de <.LBB1_70> + +00000000800063de <.LBB1_70>: + PROC_MANAGER.exit(1); + 800063de: 00053517 auipc a0,0x53 + 800063e2: ff250513 addi a0,a0,-14 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 800063e6: 4585 li a1,1 + 800063e8: 00008097 auipc ra,0x8 + 800063ec: fa2080e7 jalr -94(ra) # 8000e38a <_ZN6kernel7process7manager11ProcManager4exit17hfa49a8445fc58f81E> + 800063f0: 0000 unimp + tf.update_epc(); + 800063f2: 656a ld a0,152(sp) + 800063f4: ffffc097 auipc ra,0xffffc + 800063f8: 362080e7 jalr 866(ra) # 80002756 <_ZN6kernel7process9trapframe9Trapframe10update_epc17h24874241e4b03020E> + 800063fc: a009 j 800063fe <.LBB1_70+0x20> + sstatus::intr_on(); + 800063fe: 00019097 auipc ra,0x19 + 80006402: df2080e7 jalr -526(ra) # 8001f1f0 <_ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E> + 80006406: a009 j 80006408 <.LBB1_70+0x2a> + handle_syscall(); + 80006408: 0000f097 auipc ra,0xf + 8000640c: 668080e7 jalr 1640(ra) # 80015a70 + 80006410: a009 j 80006412 <.LBB1_70+0x34> + match scause.cause() { + 80006412: a43d j 80006640 <.LBB1_81+0x36> + if let Some(interrupt) = plic_claim() { + 80006414: 00018097 auipc ra,0x18 + 80006418: 562080e7 jalr 1378(ra) # 8001e976 <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E> + 8000641c: cdaa sw a0,216(sp) + 8000641e: cfae sw a1,220(sp) + 80006420: a009 j 80006422 <.LBB1_70+0x44> + 80006422: 456e lw a0,216(sp) + 80006424: 4581 li a1,0 + 80006426: 00b51463 bne a0,a1,8000642e <.LBB1_70+0x50> + 8000642a: a009 j 8000642c <.LBB1_70+0x4e> + 8000642c: ac11 j 80006640 <.LBB1_81+0x36> + 8000642e: 457e lw a0,220(sp) + 80006430: 02051593 slli a1,a0,0x20 + 80006434: 9181 srli a1,a1,0x20 + 80006436: fcae sd a1,120(sp) + 80006438: 1ea12a23 sw a0,500(sp) + 8000643c: 4585 li a1,1 + VIRTIO0_IRQ => { + 8000643e: 02b50763 beq a0,a1,8000646c <.LBB1_73> + 80006442: a009 j 80006444 <.LBB1_70+0x66> + 80006444: 7566 ld a0,120(sp) + 80006446: 2501 sext.w a0,a0 + 80006448: 45a9 li a1,10 + 8000644a: 04b50f63 beq a0,a1,800064a8 <.LBB1_74> + 8000644e: a009 j 80006450 <.LBB1_71> + +0000000080006450 <.LBB1_71>: + panic!("Unresolved interrupt"); + 80006450: 00021517 auipc a0,0x21 + 80006454: 48050513 addi a0,a0,1152 # 800278d0 <.L__unnamed_4> + +0000000080006458 <.LBB1_72>: + 80006458: 00021617 auipc a2,0x21 + 8000645c: 49060613 addi a2,a2,1168 # 800278e8 <.L__unnamed_5> + 80006460: 45d1 li a1,20 + 80006462: 0001d097 auipc ra,0x1d + 80006466: ce2080e7 jalr -798(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000646c <.LBB1_73>: + DISK.acquire().intr(); + 8000646c: 00059517 auipc a0,0x59 + 80006470: b9450513 addi a0,a0,-1132 # 8005f000 <_ZN6kernel6driver11virtio_disk4DISK17h9e8917083150b34aE> + 80006474: 0000b097 auipc ra,0xb + 80006478: aee080e7 jalr -1298(ra) # 80010f62 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E> + 8000647c: f1aa sd a0,224(sp) + 8000647e: a009 j 80006480 <.LBB1_73+0x14> + 80006480: 1188 addi a0,sp,224 + 80006482: 0000c097 auipc ra,0xc + 80006486: 8fc080e7 jalr -1796(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000648a: f8aa sd a0,112(sp) + 8000648c: a009 j 8000648e <.LBB1_73+0x22> + 8000648e: 7546 ld a0,112(sp) + 80006490: 0001a097 auipc ra,0x1a + 80006494: d02080e7 jalr -766(ra) # 80020192 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E> + 80006498: a009 j 8000649a <.LBB1_73+0x2e> + 8000649a: 1188 addi a0,sp,224 + 8000649c: 00001097 auipc ra,0x1 + 800064a0: dca080e7 jalr -566(ra) # 80007266 <_ZN4core3ptr99drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..virtio_disk..Disk$GT$$GT$17h4fc01c278f0bfe6cE> + 800064a4: a009 j 800064a6 <.LBB1_73+0x3a> + match interrupt { + 800064a6: a819 j 800064bc <.LBB1_74+0x14> + +00000000800064a8 <.LBB1_74>: + UART.intr(); + 800064a8: 00057517 auipc a0,0x57 + 800064ac: ea850513 addi a0,a0,-344 # 8005d350 <_ZN6kernel6driver4uart4UART17h0708b3e179d548ddE> + 800064b0: 00004097 auipc ra,0x4 + 800064b4: 084080e7 jalr 132(ra) # 8000a534 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E> + 800064b8: a009 j 800064ba <.LBB1_74+0x12> + match interrupt { + 800064ba: a009 j 800064bc <.LBB1_74+0x14> + plic_complete(interrupt); + 800064bc: 7566 ld a0,120(sp) + 800064be: 00018097 auipc ra,0x18 + 800064c2: 512080e7 jalr 1298(ra) # 8001e9d0 <_ZN6kernel6driver4plic13plic_complete17hc3a23eee8594fbc3E> + 800064c6: a009 j 800064c8 <.LBB1_74+0x20> + if let Some(interrupt) = plic_claim() { + 800064c8: aaa5 j 80006640 <.LBB1_81+0x36> + if cpu::cpuid() == 0{ + 800064ca: 0000c097 auipc ra,0xc + 800064ce: f26080e7 jalr -218(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 800064d2: f4aa sd a0,104(sp) + 800064d4: a009 j 800064d6 <.LBB1_74+0x2e> + 800064d6: 7526 ld a0,104(sp) + 800064d8: 4581 li a1,0 + 800064da: 00b51863 bne a0,a1,800064ea <.LBB1_74+0x42> + 800064de: a009 j 800064e0 <.LBB1_74+0x38> + clock_intr(); + 800064e0: 00001097 auipc ra,0x1 + 800064e4: 9e6080e7 jalr -1562(ra) # 80006ec6 <_ZN6kernel4trap10clock_intr17h80b4decf617479a4E> + 800064e8: a011 j 800064ec <.LBB1_74+0x44> + if cpu::cpuid() == 0{ + 800064ea: a011 j 800064ee <.LBB1_74+0x46> + 800064ec: a009 j 800064ee <.LBB1_74+0x46> + sip::clear_ssip(); + 800064ee: 00018097 auipc ra,0x18 + 800064f2: 29c080e7 jalr 668(ra) # 8001e78a <_ZN6kernel4arch5riscv8register3sip10clear_ssip17h3546c4610df6574fE> + 800064f6: a009 j 800064f8 <.LBB1_74+0x50> + if my_proc.killed() { + 800064f8: 750a ld a0,160(sp) + 800064fa: 00011097 auipc ra,0x11 + 800064fe: 8a8080e7 jalr -1880(ra) # 80016da2 <_ZN6kernel7process7process11task_struct6killed17h6ef392cf7098b250E> + 80006502: f0aa sd a0,96(sp) + 80006504: a009 j 80006506 <.LBB1_74+0x5e> + 80006506: 7506 ld a0,96(sp) + 80006508: 4581 li a1,0 + 8000650a: 00b50d63 beq a0,a1,80006524 <.LBB1_75+0x14> + 8000650e: a009 j 80006510 <.LBB1_75> + +0000000080006510 <.LBB1_75>: + PROC_MANAGER.exit(1); + 80006510: 00053517 auipc a0,0x53 + 80006514: ec050513 addi a0,a0,-320 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80006518: 4585 li a1,1 + 8000651a: 00008097 auipc ra,0x8 + 8000651e: e70080e7 jalr -400(ra) # 8000e38a <_ZN6kernel7process7manager11ProcManager4exit17hfa49a8445fc58f81E> + 80006522: 0000 unimp + my_proc.yielding(); + 80006524: 750a ld a0,160(sp) + 80006526: 00011097 auipc ra,0x11 + 8000652a: bea080e7 jalr -1046(ra) # 80017110 <_ZN6kernel7process7process11task_struct8yielding17ha01fb6496bdc4c3eE> + 8000652e: a009 j 80006530 <.LBB1_75+0x20> + match scause.cause() { + 80006530: aa01 j 80006640 <.LBB1_81+0x36> + println!("usertrap: unexpected scacuse: {:?}\n pid: {}", scause.cause(), my_proc.pid()); + 80006532: 750a ld a0,160(sp) + 80006534: 00011097 auipc ra,0x11 + 80006538: 87a080e7 jalr -1926(ra) # 80016dae <_ZN6kernel7process7process11task_struct3pid17h731646b24aa3a8ceE> + 8000653c: eaaa sd a0,336(sp) + 8000653e: a009 j 80006540 <.LBB1_75+0x30> + 80006540: 02a8 addi a0,sp,328 + 80006542: fe2a sd a0,312(sp) + 80006544: 0a8c addi a1,sp,336 + 80006546: e4ae sd a1,72(sp) + 80006548: e2ae sd a1,320(sp) + 8000654a: ebaa sd a0,464(sp) + 8000654c: efae sd a1,472(sp) + +000000008000654e <.LBB1_76>: + 8000654e: 00002597 auipc a1,0x2 + 80006552: a5658593 addi a1,a1,-1450 # 80007fa4 <_ZN80_$LT$kernel..arch..riscv..register..scause..Trap$u20$as$u20$core..fmt..Debug$GT$3fmt17haf633180146f5b80E> + 80006556: 00019097 auipc ra,0x19 + 8000655a: fd8080e7 jalr -40(ra) # 8001f52e <_ZN4core3fmt10ArgumentV13new17hc1ed914d10380b65E> + 8000655e: e8aa sd a0,80(sp) + 80006560: ecae sd a1,88(sp) + 80006562: a009 j 80006564 <.LBB1_76+0x16> + 80006564: 6526 ld a0,72(sp) + +0000000080006566 <.LBB1_77>: + 80006566: 0001f597 auipc a1,0x1f + 8000656a: 33a58593 addi a1,a1,826 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8000656e: 0001a097 auipc ra,0x1a + 80006572: 000080e7 jalr ra # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006576: fc2a sd a0,56(sp) + 80006578: e0ae sd a1,64(sp) + 8000657a: a009 j 8000657c <.LBB1_77+0x16> + 8000657c: 6506 ld a0,64(sp) + 8000657e: 75e2 ld a1,56(sp) + 80006580: 6666 ld a2,88(sp) + 80006582: 66c6 ld a3,80(sp) + 80006584: ee36 sd a3,280(sp) + 80006586: f232 sd a2,288(sp) + 80006588: f62e sd a1,296(sp) + 8000658a: fa2a sd a0,304(sp) + +000000008000658c <.LBB1_78>: + 8000658c: 00021597 auipc a1,0x21 + 80006590: 20458593 addi a1,a1,516 # 80027790 <.L__unnamed_6> + 80006594: 11a8 addi a0,sp,232 + 80006596: 460d li a2,3 + 80006598: 0a34 addi a3,sp,280 + 8000659a: 4709 li a4,2 + 8000659c: fffff097 auipc ra,0xfffff + 800065a0: fee080e7 jalr -18(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800065a4: a009 j 800065a6 <.LBB1_78+0x1a> + 800065a6: 11a8 addi a0,sp,232 + 800065a8: 00018097 auipc ra,0x18 + 800065ac: 650080e7 jalr 1616(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800065b0: a009 j 800065b2 <.LBB1_78+0x26> + println!("sepc: 0x{:x}, stval: 0x{:x}", sepc, stval::read()); + 800065b2: fffff097 auipc ra,0xfffff + 800065b6: e60080e7 jalr -416(ra) # 80005412 <_ZN6kernel4arch5riscv8register5stval4read17h328c9da49d53d19fE> + 800065ba: ff2a sd a0,440(sp) + 800065bc: a009 j 800065be <.LBB1_78+0x32> + 800065be: 0188 addi a0,sp,192 + 800065c0: f72a sd a0,424(sp) + 800065c2: 1b2c addi a1,sp,440 + 800065c4: f02e sd a1,32(sp) + 800065c6: fb2e sd a1,432(sp) + 800065c8: f3aa sd a0,480(sp) + 800065ca: f7ae sd a1,488(sp) + +00000000800065cc <.LBB1_79>: + 800065cc: 0001f597 auipc a1,0x1f + 800065d0: cb658593 addi a1,a1,-842 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 800065d4: 0001a097 auipc ra,0x1a + 800065d8: f9a080e7 jalr -102(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800065dc: f42a sd a0,40(sp) + 800065de: f82e sd a1,48(sp) + 800065e0: a009 j 800065e2 <.LBB1_79+0x16> + 800065e2: 7502 ld a0,32(sp) + +00000000800065e4 <.LBB1_80>: + 800065e4: 0001f597 auipc a1,0x1f + 800065e8: c9e58593 addi a1,a1,-866 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 800065ec: 0001a097 auipc ra,0x1a + 800065f0: f82080e7 jalr -126(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800065f4: e82a sd a0,16(sp) + 800065f6: ec2e sd a1,24(sp) + 800065f8: a009 j 800065fa <.LBB1_80+0x16> + 800065fa: 6562 ld a0,24(sp) + 800065fc: 65c2 ld a1,16(sp) + 800065fe: 7642 ld a2,48(sp) + 80006600: 76a2 ld a3,40(sp) + 80006602: e736 sd a3,392(sp) + 80006604: eb32 sd a2,400(sp) + 80006606: ef2e sd a1,408(sp) + 80006608: f32a sd a0,416(sp) + +000000008000660a <.LBB1_81>: + 8000660a: 00021597 auipc a1,0x21 + 8000660e: 29658593 addi a1,a1,662 # 800278a0 <.L__unnamed_7> + 80006612: 0aa8 addi a0,sp,344 + 80006614: 460d li a2,3 + 80006616: 0334 addi a3,sp,392 + 80006618: 4709 li a4,2 + 8000661a: fffff097 auipc ra,0xfffff + 8000661e: f70080e7 jalr -144(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006622: a009 j 80006624 <.LBB1_81+0x1a> + 80006624: 0aa8 addi a0,sp,344 + 80006626: 00018097 auipc ra,0x18 + 8000662a: 5d2080e7 jalr 1490(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000662e: a009 j 80006630 <.LBB1_81+0x26> + my_proc.modify_kill(true); + 80006630: 750a ld a0,160(sp) + 80006632: 4585 li a1,1 + 80006634: 00010097 auipc ra,0x10 + 80006638: 7dc080e7 jalr 2012(ra) # 80016e10 <_ZN6kernel7process7process11task_struct11modify_kill17h9fdb297017f75e37E> + 8000663c: a009 j 8000663e <.LBB1_81+0x34> + match scause.cause() { + 8000663e: a009 j 80006640 <.LBB1_81+0x36> + } + + } + + if my_proc.killed() { + 80006640: 750a ld a0,160(sp) + 80006642: 00010097 auipc ra,0x10 + 80006646: 760080e7 jalr 1888(ra) # 80016da2 <_ZN6kernel7process7process11task_struct6killed17h6ef392cf7098b250E> + 8000664a: e42a sd a0,8(sp) + 8000664c: a009 j 8000664e <.LBB1_81+0x44> + 8000664e: 6522 ld a0,8(sp) + 80006650: 4581 li a1,0 + 80006652: 00b50d63 beq a0,a1,8000666c <.LBB1_82+0x14> + 80006656: a009 j 80006658 <.LBB1_82> + +0000000080006658 <.LBB1_82>: + PROC_MANAGER.exit(1); + 80006658: 00053517 auipc a0,0x53 + 8000665c: d7850513 addi a0,a0,-648 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80006660: 4585 li a1,1 + 80006662: 00008097 auipc ra,0x8 + 80006666: d28080e7 jalr -728(ra) # 8000e38a <_ZN6kernel7process7manager11ProcManager4exit17hfa49a8445fc58f81E> + 8000666a: 0000 unimp + } + + // if tf.a7 == 40 { + // println!("In user_trap, pid {} epc {} sp {}", my_proc.pid, tf.epc, tf.sp); + // } + user_trap_ret(); + 8000666c: 00000097 auipc ra,0x0 + 80006670: 00a080e7 jalr 10(ra) # 80006676 + ... + +Disassembly of section .text.user_trap_ret: + +0000000080006676 : +} + + +/// return to user space +#[no_mangle] +pub unsafe fn user_trap_ret() -> ! { + 80006676: 7115 addi sp,sp,-224 + fn trampoline(); + fn userret(); + fn etext(); + } + + let my_proc = CPU_MANAGER.myproc().unwrap(); + 80006678: ed86 sd ra,216(sp) + +000000008000667a <.LBB2_31>: + 8000667a: 00060517 auipc a0,0x60 + 8000667e: ac650513 addi a0,a0,-1338 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80006682: 0000c097 auipc ra,0xc + 80006686: dd6080e7 jalr -554(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000668a: ed2a sd a0,152(sp) + 8000668c: a009 j 8000668e <.LBB2_31+0x14> + 8000668e: 656a ld a0,152(sp) + +0000000080006690 <.LBB2_32>: + 80006690: 00021597 auipc a1,0x21 + 80006694: 27058593 addi a1,a1,624 # 80027900 <.L__unnamed_8> + 80006698: 00009097 auipc ra,0x9 + 8000669c: 0f8080e7 jalr 248(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 800066a0: 85aa mv a1,a0 + 800066a2: e92e sd a1,144(sp) + 800066a4: f52a sd a0,168(sp) + 800066a6: a009 j 800066a8 <.LBB2_32+0x18> + + // we're about to switch the destination of traps from + // kerneltrap() to usertrap(), so turn off interrupts until + // we're back in user space, where usertrap() is correct. + sstatus::intr_off(); + 800066a8: 00019097 auipc ra,0x19 + 800066ac: b6e080e7 jalr -1170(ra) # 8001f216 <_ZN6kernel4arch5riscv8register7sstatus8intr_off17hed3f5b43b53e6556E> + 800066b0: a009 j 800066b2 <.LBB2_33> + +00000000800066b2 <.LBB2_33>: + + // send syscalls, interrupts, and exceptions to trampoline.S + stvec::write(TRAMPOLINE + (uservec as usize - trampoline as usize)); + 800066b2: ffffb597 auipc a1,0xffffb + 800066b6: 94e58593 addi a1,a1,-1714 # 80001000 + +00000000800066ba <.LBB2_34>: + 800066ba: ffffb517 auipc a0,0xffffb + 800066be: 94650513 addi a0,a0,-1722 # 80001000 + 800066c2: 40b505b3 sub a1,a0,a1 + 800066c6: e52e sd a1,136(sp) + 800066c8: 16b56763 bltu a0,a1,80006836 <.LBB2_39> + 800066cc: a009 j 800066ce <.LBB2_34+0x14> + 800066ce: 65aa ld a1,136(sp) + 800066d0: 04000537 lui a0,0x4000 + 800066d4: 357d addiw a0,a0,-1 + 800066d6: 0532 slli a0,a0,0xc + 800066d8: 952e add a0,a0,a1 + 800066da: e12a sd a0,128(sp) + 800066dc: 16b56c63 bltu a0,a1,80006854 <.LBB2_41> + 800066e0: a009 j 800066e2 <.LBB2_34+0x28> + 800066e2: 650a ld a0,128(sp) + 800066e4: 00006097 auipc ra,0x6 + 800066e8: f30080e7 jalr -208(ra) # 8000c614 <_ZN6kernel4arch5riscv8register5stvec5write17ha770434f21f9bf27E> + 800066ec: a009 j 800066ee <.LBB2_34+0x34> + // set up trapframe values that uservec will need when + // the process next re-enters the kernel. + + // my_proc.user_init(); + + let tf = &mut *my_proc.trapframe; + 800066ee: 654a ld a0,144(sp) + 800066f0: 7108 ld a0,32(a0) + 800066f2: f8aa sd a0,112(sp) + 800066f4: f92a sd a0,176(sp) + // kernel page table + tf.kernel_satp = satp::read(); + 800066f6: 00019097 auipc ra,0x19 + 800066fa: e9e080e7 jalr -354(ra) # 8001f594 <_ZN6kernel4arch5riscv8register4satp4read17h0624a35f6368d5a6E> + 800066fe: fcaa sd a0,120(sp) + 80006700: a009 j 80006702 <.LBB2_34+0x48> + 80006702: 654a ld a0,144(sp) + 80006704: 75e6 ld a1,120(sp) + 80006706: 7646 ld a2,112(sp) + 80006708: e20c sd a1,0(a2) + // process's kernel stack + tf.kernel_sp = my_proc.kstack + PGSIZE * 4; + 8000670a: 610c ld a1,0(a0) + 8000670c: 6511 lui a0,0x4 + 8000670e: 952e add a0,a0,a1 + 80006710: f4aa sd a0,104(sp) + 80006712: 14b56f63 bltu a0,a1,80006870 <.LBB2_43> + 80006716: a009 j 80006718 <.LBB2_34+0x5e> + 80006718: 75c6 ld a1,112(sp) + 8000671a: 7526 ld a0,104(sp) + 8000671c: e588 sd a0,8(a1) + +000000008000671e <.LBB2_35>: + // kernel user trap address + tf.kernel_trap = user_trap as usize; + 8000671e: 00000517 auipc a0,0x0 + 80006722: b9e50513 addi a0,a0,-1122 # 800062bc + 80006726: e988 sd a0,16(a1) + // current process's cpu id. + tf.kernel_hartid = cpu::cpuid(); + 80006728: 0000c097 auipc ra,0xc + 8000672c: cc8080e7 jalr -824(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80006730: f0aa sd a0,96(sp) + 80006732: a009 j 80006734 <.LBB2_35+0x16> + 80006734: 7506 ld a0,96(sp) + 80006736: 75c6 ld a1,112(sp) + 80006738: f188 sd a0,32(a1) + + + // set up the registers that trampoline.S's sret will use + // to get to user space. + // Set S Previous Privilege mode to User. + let mut sstatus = sstatus::read(); + 8000673a: 00019097 auipc ra,0x19 + 8000673e: a60080e7 jalr -1440(ra) # 8001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE> + 80006742: f12a sd a0,160(sp) + 80006744: a009 j 80006746 <.LBB2_35+0x28> + sstatus = sstatus::clear_spp(sstatus); // clear SPP to 0 for user mode + 80006746: 750a ld a0,160(sp) + 80006748: 00019097 auipc ra,0x19 + 8000674c: b12080e7 jalr -1262(ra) # 8001f25a <_ZN6kernel4arch5riscv8register7sstatus9clear_spp17h6421d1a1ec9c8eccE> + 80006750: ecaa sd a0,88(sp) + 80006752: a009 j 80006754 <.LBB2_35+0x36> + 80006754: 6566 ld a0,88(sp) + 80006756: f12a sd a0,160(sp) + sstatus = sstatus::user_intr_on(sstatus); // enable interrupts in user mode + 80006758: 00019097 auipc ra,0x19 + 8000675c: b0e080e7 jalr -1266(ra) # 8001f266 <_ZN6kernel4arch5riscv8register7sstatus12user_intr_on17h1304f970b07c3896E> + 80006760: e8aa sd a0,80(sp) + 80006762: a009 j 80006764 <.LBB2_35+0x46> + 80006764: 6546 ld a0,80(sp) + 80006766: f12a sd a0,160(sp) + sstatus::write(sstatus); + 80006768: 00019097 auipc ra,0x19 + 8000676c: a3e080e7 jalr -1474(ra) # 8001f1a6 <_ZN6kernel4arch5riscv8register7sstatus5write17h2e3a8152fe4defdaE> + 80006770: a009 j 80006772 <.LBB2_35+0x54> + + // set S Exception Program Counter to the saved user pc. + // if tf.a7 == 1 { + // println!("hehe pid {} epc {} ra {}", my_proc.pid, tf.epc, tf.ra); + // } + sepc::write(tf.epc); + 80006772: 7546 ld a0,112(sp) + 80006774: 6d08 ld a0,24(a0) + 80006776: ffffe097 auipc ra,0xffffe + 8000677a: 5ba080e7 jalr 1466(ra) # 80004d30 <_ZN6kernel4arch5riscv8register4sepc5write17h2074fd389defa9f2E> + 8000677e: a009 j 80006780 <.LBB2_35+0x62> + // } + + // println!("------{}", (*my_proc.trapframe).epc); + + // tell trampoline.S the user page table to switch to + let satp = my_proc.pagetable.as_ref().unwrap().as_satp(); + 80006780: 654a ld a0,144(sp) + 80006782: 6d08 ld a0,24(a0) + 80006784: 00007097 auipc ra,0x7 + 80006788: d58080e7 jalr -680(ra) # 8000d4dc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE> + 8000678c: e4aa sd a0,72(sp) + 8000678e: a009 j 80006790 <.LBB2_35+0x72> + 80006790: 6526 ld a0,72(sp) + +0000000080006792 <.LBB2_36>: + 80006792: 00021597 auipc a1,0x21 + 80006796: 21658593 addi a1,a1,534 # 800279a8 <.L__unnamed_9> + 8000679a: 00009097 auipc ra,0x9 + 8000679e: f54080e7 jalr -172(ra) # 8000f6ee <_ZN4core6option15Option$LT$T$GT$6unwrap17h97667cf20f9698d4E> + 800067a2: e0aa sd a0,64(sp) + 800067a4: a009 j 800067a6 <.LBB2_36+0x14> + 800067a6: 6506 ld a0,64(sp) + 800067a8: 00011097 auipc ra,0x11 + 800067ac: 390080e7 jalr 912(ra) # 80017b38 <_ZN6kernel6memory7mapping10page_table9PageTable7as_satp17h97121d8f678f163eE> + 800067b0: 85aa mv a1,a0 + 800067b2: fc2e sd a1,56(sp) + 800067b4: fd2a sd a0,184(sp) + 800067b6: a009 j 800067b8 <.LBB2_37> + +00000000800067b8 <.LBB2_37>: + + // jump to trampoline.S at the top of memory, which + // switches to the user page table, restores user registers, + // and switches to user mode with sret. + let userret_virt = TRAMPOLINE + (userret as usize - trampoline as usize); + 800067b8: ffffb597 auipc a1,0xffffb + 800067bc: 84858593 addi a1,a1,-1976 # 80001000 + +00000000800067c0 <.LBB2_38>: + 800067c0: ffffb517 auipc a0,0xffffb + 800067c4: 8e050513 addi a0,a0,-1824 # 800010a0 + 800067c8: 40b505b3 sub a1,a0,a1 + 800067cc: f82e sd a1,48(sp) + 800067ce: 0ab56f63 bltu a0,a1,8000688c <.LBB2_45> + 800067d2: a009 j 800067d4 <.LBB2_38+0x14> + 800067d4: 75c2 ld a1,48(sp) + 800067d6: 04000537 lui a0,0x4000 + 800067da: 357d addiw a0,a0,-1 + 800067dc: 0532 slli a0,a0,0xc + 800067de: 952e add a0,a0,a1 + 800067e0: f42a sd a0,40(sp) + 800067e2: 0cb56463 bltu a0,a1,800068aa <.LBB2_47> + 800067e6: a009 j 800067e8 <.LBB2_38+0x28> + 800067e8: 7522 ld a0,40(sp) + 800067ea: e1aa sd a0,192(sp) + let userret_virt: extern "C" fn(usize, usize) -> ! = + core::mem::transmute(userret_virt as usize); + 800067ec: e5aa sd a0,200(sp) + 800067ee: 85aa mv a1,a0 + 800067f0: f02e sd a1,32(sp) + 800067f2: e9aa sd a0,208(sp) + 800067f4: a009 j 800067f6 <.LBB2_38+0x36> + + userret_virt(TRAPFRAME + (my_proc.thread * size_of::()), satp); + 800067f6: 654a ld a0,144(sp) + 800067f8: 3f853503 ld a0,1016(a0) # 40003f8 <.Lline_table_start0+0x3fc8f93> + 800067fc: ec2a sd a0,24(sp) + 800067fe: a009 j 80006800 <.LBB2_38+0x40> + 80006800: 6562 ld a0,24(sp) + 80006802: 12000593 li a1,288 + 80006806: 02b50633 mul a2,a0,a1 + 8000680a: e832 sd a2,16(sp) + 8000680c: 02b53533 mulhu a0,a0,a1 + 80006810: 4581 li a1,0 + 80006812: 0ab51a63 bne a0,a1,800068c6 <.LBB2_49> + 80006816: a009 j 80006818 <.LBB2_38+0x58> + 80006818: 65c2 ld a1,16(sp) + 8000681a: 02000537 lui a0,0x2000 + 8000681e: 357d addiw a0,a0,-1 + 80006820: 0536 slli a0,a0,0xd + 80006822: 952e add a0,a0,a1 + 80006824: e42a sd a0,8(sp) + 80006826: 0ab56f63 bltu a0,a1,800068e4 <.LBB2_51> + 8000682a: a009 j 8000682c <.LBB2_38+0x6c> + 8000682c: 7602 ld a2,32(sp) + 8000682e: 75e2 ld a1,56(sp) + 80006830: 6522 ld a0,8(sp) + 80006832: 9602 jalr a2 + ... + +0000000080006836 <.LBB2_39>: + stvec::write(TRAMPOLINE + (uservec as usize - trampoline as usize)); + 80006836: 00021517 auipc a0,0x21 + 8000683a: 0fa50513 addi a0,a0,250 # 80027930 + +000000008000683e <.LBB2_40>: + 8000683e: 00021617 auipc a2,0x21 + 80006842: 0da60613 addi a2,a2,218 # 80027918 <.L__unnamed_10> + 80006846: 02100593 li a1,33 + 8000684a: 0001d097 auipc ra,0x1d + 8000684e: 8fa080e7 jalr -1798(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006854 <.LBB2_41>: + 80006854: 00021517 auipc a0,0x21 + 80006858: 11c50513 addi a0,a0,284 # 80027970 + +000000008000685c <.LBB2_42>: + 8000685c: 00021617 auipc a2,0x21 + 80006860: 0fc60613 addi a2,a2,252 # 80027958 <.L__unnamed_11> + 80006864: 45f1 li a1,28 + 80006866: 0001d097 auipc ra,0x1d + 8000686a: 8de080e7 jalr -1826(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006870 <.LBB2_43>: + tf.kernel_sp = my_proc.kstack + PGSIZE * 4; + 80006870: 00021517 auipc a0,0x21 + 80006874: 10050513 addi a0,a0,256 # 80027970 + +0000000080006878 <.LBB2_44>: + 80006878: 00021617 auipc a2,0x21 + 8000687c: 11860613 addi a2,a2,280 # 80027990 <.L__unnamed_12> + 80006880: 45f1 li a1,28 + 80006882: 0001d097 auipc ra,0x1d + 80006886: 8c2080e7 jalr -1854(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000688c <.LBB2_45>: + let userret_virt = TRAMPOLINE + (userret as usize - trampoline as usize); + 8000688c: 00021517 auipc a0,0x21 + 80006890: 0a450513 addi a0,a0,164 # 80027930 + +0000000080006894 <.LBB2_46>: + 80006894: 00021617 auipc a2,0x21 + 80006898: 12c60613 addi a2,a2,300 # 800279c0 <.L__unnamed_13> + 8000689c: 02100593 li a1,33 + 800068a0: 0001d097 auipc ra,0x1d + 800068a4: 8a4080e7 jalr -1884(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800068aa <.LBB2_47>: + 800068aa: 00021517 auipc a0,0x21 + 800068ae: 0c650513 addi a0,a0,198 # 80027970 + +00000000800068b2 <.LBB2_48>: + 800068b2: 00021617 auipc a2,0x21 + 800068b6: 12660613 addi a2,a2,294 # 800279d8 <.L__unnamed_14> + 800068ba: 45f1 li a1,28 + 800068bc: 0001d097 auipc ra,0x1d + 800068c0: 888080e7 jalr -1912(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800068c6 <.LBB2_49>: + userret_virt(TRAPFRAME + (my_proc.thread * size_of::()), satp); + 800068c6: 00021517 auipc a0,0x21 + 800068ca: 14a50513 addi a0,a0,330 # 80027a10 + +00000000800068ce <.LBB2_50>: + 800068ce: 00021617 auipc a2,0x21 + 800068d2: 12260613 addi a2,a2,290 # 800279f0 <.L__unnamed_15> + 800068d6: 02100593 li a1,33 + 800068da: 0001d097 auipc ra,0x1d + 800068de: 86a080e7 jalr -1942(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800068e4 <.LBB2_51>: + 800068e4: 00021517 auipc a0,0x21 + 800068e8: 08c50513 addi a0,a0,140 # 80027970 + +00000000800068ec <.LBB2_52>: + 800068ec: 00021617 auipc a2,0x21 + 800068f0: 14c60613 addi a2,a2,332 # 80027a38 <.L__unnamed_16> + 800068f4: 45f1 li a1,28 + 800068f6: 0001d097 auipc ra,0x1d + 800068fa: 84e080e7 jalr -1970(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text.kernel_trap: + +0000000080006900 : +} + +/// interrupts and exceptions from kernel code go here via kernelvec, +/// on whatever the current kernel stack is. +#[no_mangle] +pub unsafe fn kernel_trap( + 80006900: c2010113 addi sp,sp,-992 + 80006904: 3c113c23 sd ra,984(sp) + 80006908: f1c6 sd a7,224(sp) + 8000690a: 34a13423 sd a0,840(sp) + 8000690e: 34b13823 sd a1,848(sp) + 80006912: 34c13c23 sd a2,856(sp) + 80006916: 36d13023 sd a3,864(sp) + 8000691a: 36e13423 sd a4,872(sp) + 8000691e: 36f13823 sd a5,880(sp) + 80006922: 37013c23 sd a6,888(sp) + 80006926: 39113023 sd a7,896(sp) + _: usize, _: usize, _: usize, _: usize, + _: usize, _: usize, _: usize, which: usize +) { + let sepc = sepc::read(); + 8000692a: ffffe097 auipc ra,0xffffe + 8000692e: 3fa080e7 jalr 1018(ra) # 80004d24 <_ZN6kernel4arch5riscv8register4sepc4read17hcaa3e2a818646c19E> + 80006932: f5aa sd a0,232(sp) + 80006934: a009 j 80006936 + let sstatus = sstatus::read(); + 80006936: 00019097 auipc ra,0x19 + 8000693a: 864080e7 jalr -1948(ra) # 8001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE> + 8000693e: 85aa mv a1,a0 + 80006940: edae sd a1,216(sp) + 80006942: 38a13423 sd a0,904(sp) + 80006946: a009 j 80006948 + let scause = scause::read(); + 80006948: 00001097 auipc ra,0x1 + 8000694c: 3ae080e7 jalr 942(ra) # 80007cf6 <_ZN6kernel4arch5riscv8register6scause4read17h6f388cd664aa7885E> + 80006950: 85aa mv a1,a0 + 80006952: e9ae sd a1,208(sp) + 80006954: 38a13823 sd a0,912(sp) + 80006958: a009 j 8000695a + let stval = stval::read(); + 8000695a: fffff097 auipc ra,0xfffff + 8000695e: ab8080e7 jalr -1352(ra) # 80005412 <_ZN6kernel4arch5riscv8register5stval4read17h328c9da49d53d19fE> + 80006962: f9aa sd a0,240(sp) + 80006964: a009 j 80006966 + + if !sstatus::is_from_supervisor() { + 80006966: 00019097 auipc ra,0x19 + 8000696a: 84c080e7 jalr -1972(ra) # 8001f1b2 <_ZN6kernel4arch5riscv8register7sstatus18is_from_supervisor17h09ba8119c534748eE> + 8000696e: e5aa sd a0,200(sp) + 80006970: a009 j 80006972 + 80006972: 652e ld a0,200(sp) + 80006974: e105 bnez a0,80006994 <.LBB3_82+0x14> + 80006976: a009 j 80006978 <.LBB3_81> + +0000000080006978 <.LBB3_81>: + panic!("not from supervisor mode"); + 80006978: 00021517 auipc a0,0x21 + 8000697c: 0d850513 addi a0,a0,216 # 80027a50 <.L__unnamed_17> + +0000000080006980 <.LBB3_82>: + 80006980: 00021617 auipc a2,0x21 + 80006984: 0e860613 addi a2,a2,232 # 80027a68 <.L__unnamed_18> + 80006988: 45e1 li a1,24 + 8000698a: 0001c097 auipc ra,0x1c + 8000698e: 7ba080e7 jalr 1978(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80006992: 0000 unimp + } + + if sstatus::intr_get() { + 80006994: 00019097 auipc ra,0x19 + 80006998: 8a6080e7 jalr -1882(ra) # 8001f23a <_ZN6kernel4arch5riscv8register7sstatus8intr_get17h3e12e0f19cb31fd5E> + 8000699c: e1aa sd a0,192(sp) + 8000699e: a009 j 800069a0 <.LBB3_82+0x20> + 800069a0: 650e ld a0,192(sp) + 800069a2: 4581 li a1,0 + 800069a4: 02b50263 beq a0,a1,800069c8 <.LBB3_84+0x16> + 800069a8: a009 j 800069aa <.LBB3_83> + +00000000800069aa <.LBB3_83>: + panic!("kerneltrap(): interrupts enabled"); + 800069aa: 00020517 auipc a0,0x20 + 800069ae: 90050513 addi a0,a0,-1792 # 800262aa <.L__unnamed_11+0x1e> + +00000000800069b2 <.LBB3_84>: + 800069b2: 00021617 auipc a2,0x21 + 800069b6: 0ce60613 addi a2,a2,206 # 80027a80 <.L__unnamed_20> + 800069ba: 02000593 li a1,32 + 800069be: 0001c097 auipc ra,0x1c + 800069c2: 786080e7 jalr 1926(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800069c6: 0000 unimp + } + + let mut local_spec = sepc; + 800069c8: 654e ld a0,208(sp) + 800069ca: 75ae ld a1,232(sp) + 800069cc: fdae sd a1,248(sp) + // Update progrma counter + let scause = Scause::new(scause); + 800069ce: 00001097 auipc ra,0x1 + 800069d2: 428080e7 jalr 1064(ra) # 80007df6 <_ZN6kernel4arch5riscv8register6scause6Scause3new17hf1aad0ee6c83efd3E> + 800069d6: e22a sd a0,256(sp) + 800069d8: a009 j 800069da <.LBB3_84+0x28> + 800069da: 0208 addi a0,sp,256 + match scause.cause() { + 800069dc: 00001097 auipc ra,0x1 + 800069e0: 4c8080e7 jalr 1224(ra) # 80007ea4 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E> + 800069e4: 10a10423 sb a0,264(sp) + 800069e8: 10b104a3 sb a1,265(sp) + 800069ec: a009 j 800069ee <.LBB3_84+0x3c> + Trap::Exception(Exception::Breakpoint) => { + 800069ee: 10814503 lbu a0,264(sp) + 800069f2: fd2a sd a0,184(sp) + 800069f4: 8905 andi a0,a0,1 + 800069f6: 4581 li a1,0 + 800069f8: 00b50863 beq a0,a1,80006a08 <.LBB3_84+0x56> + 800069fc: a009 j 800069fe <.LBB3_84+0x4c> + 800069fe: 756a ld a0,184(sp) + 80006a00: 4585 li a1,1 + 80006a02: 02b50d63 beq a0,a1,80006a3c <.LBB3_86+0x14> + 80006a06: a829 j 80006a20 <.LBB3_16> + println!("stval: 0x{:x}", stval); + panic!(); + }, + + // Device Interruput + Trap::Interrupt(Interrupt::SupervisorExternal) => { + 80006a08: 10914503 lbu a0,265(sp) + 80006a0c: f92a sd a0,176(sp) + 80006a0e: 4585 li a1,1 + 80006a10: 42b50463 beq a0,a1,80006e38 <.LBB3_118+0x22> + 80006a14: a009 j 80006a16 <.LBB3_84+0x64> + 80006a16: 754a ld a0,176(sp) + 80006a18: 4595 li a1,5 + 80006a1a: 34b50f63 beq a0,a1,80006d78 <.LBB3_114+0x14> + 80006a1e: a009 j 80006a20 <.LBB3_16> + +0000000080006a20 <.LBB3_16>: + // give up the cpu. + CPU_MANAGER.mycpu().try_yield_proc(); + } + + _ => { + panic!("Unresolved Trap!"); + 80006a20: 00020517 auipc a0,0x20 + 80006a24: d0050513 addi a0,a0,-768 # 80026720 <.L__unnamed_35+0xe8> + +0000000080006a28 <.LBB3_86>: + 80006a28: 00021617 auipc a2,0x21 + 80006a2c: 30060613 addi a2,a2,768 # 80027d28 <.L__unnamed_22> + 80006a30: 45c1 li a1,16 + 80006a32: 0001c097 auipc ra,0x1c + 80006a36: 712080e7 jalr 1810(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80006a3a: 0000 unimp + Trap::Exception(Exception::Breakpoint) => { + 80006a3c: 10914503 lbu a0,265(sp) + 80006a40: fff50593 addi a1,a0,-1 + 80006a44: f52e sd a1,168(sp) + 80006a46: 4529 li a0,10 + 80006a48: fcb56ce3 bltu a0,a1,80006a20 <.LBB3_16> + 80006a4c: 752a ld a0,168(sp) + 80006a4e: 050e slli a0,a0,0x3 + +0000000080006a50 <.LBB3_87>: + 80006a50: 00021597 auipc a1,0x21 + 80006a54: c3058593 addi a1,a1,-976 # 80027680 <.LJTI3_0> + 80006a58: 952e add a0,a0,a1 + 80006a5a: 6108 ld a0,0(a0) + 80006a5c: 8502 jr a0 + +0000000080006a5e <.LBB3_19>: + local_spec += 2; + 80006a5e: 75ee ld a1,248(sp) + 80006a60: 00258513 addi a0,a1,2 + 80006a64: f12a sd a0,160(sp) + 80006a66: 44b56263 bltu a0,a1,80006eaa <.LBB3_120> + 80006a6a: a009 j 80006a6c <.LBB3_19+0xe> + 80006a6c: 750a ld a0,160(sp) + 80006a6e: fdaa sd a0,248(sp) + +0000000080006a70 <.LBB3_88>: + println!("BreakPoint!"); + 80006a70: 00021597 auipc a1,0x21 + 80006a74: 26058593 addi a1,a1,608 # 80027cd0 <.L__unnamed_23> + +0000000080006a78 <.LBB3_89>: + 80006a78: 00021697 auipc a3,0x21 + 80006a7c: 1e068693 addi a3,a3,480 # 80027c58 <.L__unnamed_56> + 80006a80: 0a08 addi a0,sp,272 + 80006a82: 4605 li a2,1 + 80006a84: 4701 li a4,0 + 80006a86: fffff097 auipc ra,0xfffff + 80006a8a: b04080e7 jalr -1276(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006a8e: a009 j 80006a90 <.LBB3_89+0x18> + 80006a90: 0a08 addi a0,sp,272 + 80006a92: 00018097 auipc ra,0x18 + 80006a96: 166080e7 jalr 358(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80006a9a: a009 j 80006a9c <.LBB3_89+0x24> + match scause.cause() { + 80006a9c: a6f5 j 80006e88 <.LBB3_119+0x22> + +0000000080006a9e <.LBB3_23>: + Trap::Exception(Exception::LoadFault) => panic!("Load Fault!"), + 80006a9e: 00021517 auipc a0,0x21 + 80006aa2: 1e250513 addi a0,a0,482 # 80027c80 <.L__unnamed_25> + +0000000080006aa6 <.LBB3_91>: + 80006aa6: 00021617 auipc a2,0x21 + 80006aaa: 1ea60613 addi a2,a2,490 # 80027c90 <.L__unnamed_26> + 80006aae: 45ad li a1,11 + 80006ab0: 0001c097 auipc ra,0x1c + 80006ab4: 694080e7 jalr 1684(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006aba <.LBB3_24>: + 80006aba: 1988 addi a0,sp,240 + panic!("[Panic] Load Page Fault!\n stval: 0x{:x}\n sepc: 0x{:x}\n", stval, sepc); + 80006abc: eb2a sd a0,400(sp) + 80006abe: 11ac addi a1,sp,232 + 80006ac0: e52e sd a1,136(sp) + 80006ac2: ef2e sd a1,408(sp) + 80006ac4: 3aa13423 sd a0,936(sp) + 80006ac8: 3ab13823 sd a1,944(sp) + +0000000080006acc <.LBB3_92>: + 80006acc: 0001e597 auipc a1,0x1e + 80006ad0: 7b658593 addi a1,a1,1974 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80006ad4: 0001a097 auipc ra,0x1a + 80006ad8: a9a080e7 jalr -1382(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006adc: e92a sd a0,144(sp) + 80006ade: ed2e sd a1,152(sp) + 80006ae0: a009 j 80006ae2 <.LBB3_92+0x16> + 80006ae2: 652a ld a0,136(sp) + +0000000080006ae4 <.LBB3_93>: + 80006ae4: 0001e597 auipc a1,0x1e + 80006ae8: 79e58593 addi a1,a1,1950 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80006aec: 0001a097 auipc ra,0x1a + 80006af0: a82080e7 jalr -1406(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006af4: fcaa sd a0,120(sp) + 80006af6: e12e sd a1,128(sp) + 80006af8: a009 j 80006afa <.LBB3_93+0x16> + 80006afa: 650a ld a0,128(sp) + 80006afc: 75e6 ld a1,120(sp) + 80006afe: 666a ld a2,152(sp) + 80006b00: 66ca ld a3,144(sp) + 80006b02: fab6 sd a3,368(sp) + 80006b04: feb2 sd a2,376(sp) + 80006b06: e32e sd a1,384(sp) + 80006b08: e72a sd a0,392(sp) + +0000000080006b0a <.LBB3_94>: + 80006b0a: 00021597 auipc a1,0x21 + 80006b0e: 02e58593 addi a1,a1,46 # 80027b38 <.L__unnamed_27> + 80006b12: 0288 addi a0,sp,320 + 80006b14: 460d li a2,3 + 80006b16: 1a94 addi a3,sp,368 + 80006b18: 4709 li a4,2 + 80006b1a: fffff097 auipc ra,0xfffff + 80006b1e: a70080e7 jalr -1424(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006b22: a009 j 80006b24 <.LBB3_95> + +0000000080006b24 <.LBB3_95>: + 80006b24: 00021597 auipc a1,0x21 + 80006b28: 04458593 addi a1,a1,68 # 80027b68 <.L__unnamed_28> + 80006b2c: 0288 addi a0,sp,320 + 80006b2e: 0001c097 auipc ra,0x1c + 80006b32: 682080e7 jalr 1666(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +0000000080006b38 <.LBB3_28>: + 80006b38: 1988 addi a0,sp,240 + panic!("[Panic] Store Page Fault!\n stval: 0x{:x}\n sepc: 0x{:x}\n", stval, sepc); + 80006b3a: fbaa sd a0,496(sp) + 80006b3c: 11ac addi a1,sp,232 + 80006b3e: f0ae sd a1,96(sp) + 80006b40: ffae sd a1,504(sp) + 80006b42: 38a13c23 sd a0,920(sp) + 80006b46: 3ab13023 sd a1,928(sp) + +0000000080006b4a <.LBB3_96>: + 80006b4a: 0001e597 auipc a1,0x1e + 80006b4e: 73858593 addi a1,a1,1848 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80006b52: 0001a097 auipc ra,0x1a + 80006b56: a1c080e7 jalr -1508(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006b5a: f4aa sd a0,104(sp) + 80006b5c: f8ae sd a1,112(sp) + 80006b5e: a009 j 80006b60 <.LBB3_96+0x16> + 80006b60: 7506 ld a0,96(sp) + +0000000080006b62 <.LBB3_97>: + 80006b62: 0001e597 auipc a1,0x1e + 80006b66: 72058593 addi a1,a1,1824 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80006b6a: 0001a097 auipc ra,0x1a + 80006b6e: a04080e7 jalr -1532(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006b72: e8aa sd a0,80(sp) + 80006b74: ecae sd a1,88(sp) + 80006b76: a009 j 80006b78 <.LBB3_97+0x16> + 80006b78: 6566 ld a0,88(sp) + 80006b7a: 65c6 ld a1,80(sp) + 80006b7c: 7646 ld a2,112(sp) + 80006b7e: 76a6 ld a3,104(sp) + 80006b80: ebb6 sd a3,464(sp) + 80006b82: efb2 sd a2,472(sp) + 80006b84: f3ae sd a1,480(sp) + 80006b86: f7aa sd a0,488(sp) + +0000000080006b88 <.LBB3_98>: + 80006b88: 00021597 auipc a1,0x21 + 80006b8c: f4058593 addi a1,a1,-192 # 80027ac8 <.L__unnamed_29> + 80006b90: 1308 addi a0,sp,416 + 80006b92: 460d li a2,3 + 80006b94: 0b94 addi a3,sp,464 + 80006b96: 4709 li a4,2 + 80006b98: fffff097 auipc ra,0xfffff + 80006b9c: 9f2080e7 jalr -1550(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006ba0: a009 j 80006ba2 <.LBB3_99> + +0000000080006ba2 <.LBB3_99>: + 80006ba2: 00021597 auipc a1,0x21 + 80006ba6: f5658593 addi a1,a1,-170 # 80027af8 <.L__unnamed_30> + 80006baa: 1308 addi a0,sp,416 + 80006bac: 0001c097 auipc ra,0x1c + 80006bb0: 604080e7 jalr 1540(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +0000000080006bb6 <.LBB3_32>: + 80006bb6: 750e ld a0,224(sp) + 80006bb8: 45a1 li a1,8 + SHUTDOWN => { + 80006bba: 02b50663 beq a0,a1,80006be6 <.LBB3_102> + 80006bbe: a009 j 80006bc0 <.LBB3_32+0xa> + 80006bc0: 750e ld a0,224(sp) + 80006bc2: 45a5 li a1,9 + 80006bc4: 04b50f63 beq a0,a1,80006c22 <.LBB3_104> + 80006bc8: a009 j 80006bca <.LBB3_100> + +0000000080006bca <.LBB3_100>: + panic!("Unresolved Kernel Syscall!"); + 80006bca: 00021517 auipc a0,0x21 + 80006bce: 02e50513 addi a0,a0,46 # 80027bf8 <.L__unnamed_31> + +0000000080006bd2 <.LBB3_101>: + 80006bd2: 00021617 auipc a2,0x21 + 80006bd6: 04660613 addi a2,a2,70 # 80027c18 <.L__unnamed_32> + 80006bda: 45e9 li a1,26 + 80006bdc: 0001c097 auipc ra,0x1c + 80006be0: 568080e7 jalr 1384(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006be6 <.LBB3_102>: + println!("\x1b[1;31mShutdown!\x1b[0m"); + 80006be6: 00021597 auipc a1,0x21 + 80006bea: 08a58593 addi a1,a1,138 # 80027c70 <.L__unnamed_33> + +0000000080006bee <.LBB3_103>: + 80006bee: 00021697 auipc a3,0x21 + 80006bf2: 06a68693 addi a3,a3,106 # 80027c58 <.L__unnamed_56> + 80006bf6: 0408 addi a0,sp,512 + 80006bf8: 4605 li a2,1 + 80006bfa: 4701 li a4,0 + 80006bfc: fffff097 auipc ra,0xfffff + 80006c00: 98e080e7 jalr -1650(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006c04: a009 j 80006c06 <.LBB3_103+0x18> + 80006c06: 0408 addi a0,sp,512 + 80006c08: 00018097 auipc ra,0x18 + 80006c0c: ff0080e7 jalr -16(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80006c10: a009 j 80006c12 <.LBB3_103+0x24> + 80006c12: 4581 li a1,0 + system_reset( + 80006c14: 852e mv a0,a1 + 80006c16: fffff097 auipc ra,0xfffff + 80006c1a: 808080e7 jalr -2040(ra) # 8000541e <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E> + 80006c1e: a009 j 80006c20 <.LBB3_103+0x32> + match which { + 80006c20: a4a5 j 80006e88 <.LBB3_119+0x22> + +0000000080006c22 <.LBB3_104>: + println!("\x1b[1;31mReboot!\x1b[0m"); + 80006c22: 00021597 auipc a1,0x21 + 80006c26: 02658593 addi a1,a1,38 # 80027c48 <.L__unnamed_34> + +0000000080006c2a <.LBB3_105>: + 80006c2a: 00021697 auipc a3,0x21 + 80006c2e: 02e68693 addi a3,a3,46 # 80027c58 <.L__unnamed_56> + 80006c32: 1c08 addi a0,sp,560 + 80006c34: 4605 li a2,1 + 80006c36: 4701 li a4,0 + 80006c38: fffff097 auipc ra,0xfffff + 80006c3c: 952080e7 jalr -1710(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006c40: a009 j 80006c42 <.LBB3_105+0x18> + 80006c42: 1c08 addi a0,sp,560 + 80006c44: 00018097 auipc ra,0x18 + 80006c48: fb4080e7 jalr -76(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80006c4c: a009 j 80006c4e <.LBB3_105+0x24> + 80006c4e: 4505 li a0,1 + 80006c50: 4581 li a1,0 + system_reset( + 80006c52: ffffe097 auipc ra,0xffffe + 80006c56: 7cc080e7 jalr 1996(ra) # 8000541e <_ZN6kernel8shutdown12system_reset17h91571bbff266ab01E> + 80006c5a: a009 j 80006c5c <.LBB3_105+0x32> + match which { + 80006c5c: a435 j 80006e88 <.LBB3_119+0x22> + +0000000080006c5e <.LBB3_43>: + 80006c5e: 11a8 addi a0,sp,232 + Trap::Exception(Exception::InstructionFault) => panic!("Instruction Fault, sepc: 0x{:x}", sepc), + 80006c60: 2aa13023 sd a0,672(sp) + 80006c64: 3ca13423 sd a0,968(sp) + +0000000080006c68 <.LBB3_106>: + 80006c68: 0001e597 auipc a1,0x1e + 80006c6c: 61a58593 addi a1,a1,1562 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80006c70: 0001a097 auipc ra,0x1a + 80006c74: 8fe080e7 jalr -1794(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006c78: e0aa sd a0,64(sp) + 80006c7a: e4ae sd a1,72(sp) + 80006c7c: a009 j 80006c7e <.LBB3_106+0x16> + 80006c7e: 6526 ld a0,72(sp) + 80006c80: 6586 ld a1,64(sp) + 80006c82: 28b13823 sd a1,656(sp) + 80006c86: 28a13c23 sd a0,664(sp) + +0000000080006c8a <.LBB3_107>: + 80006c8a: 00021597 auipc a1,0x21 + 80006c8e: 07658593 addi a1,a1,118 # 80027d00 <.L__unnamed_35> + 80006c92: 1488 addi a0,sp,608 + 80006c94: 0d14 addi a3,sp,656 + 80006c96: 4705 li a4,1 + 80006c98: 863a mv a2,a4 + 80006c9a: fffff097 auipc ra,0xfffff + 80006c9e: 8f0080e7 jalr -1808(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006ca2: a009 j 80006ca4 <.LBB3_108> + +0000000080006ca4 <.LBB3_108>: + 80006ca4: 00021597 auipc a1,0x21 + 80006ca8: 06c58593 addi a1,a1,108 # 80027d10 <.L__unnamed_36> + 80006cac: 1488 addi a0,sp,608 + 80006cae: 0001c097 auipc ra,0x1c + 80006cb2: 502080e7 jalr 1282(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +0000000080006cb8 <.LBB3_46>: + 80006cb8: 11a8 addi a0,sp,232 + println!("sepc: 0x{:x}", sepc); + 80006cba: 2ea13423 sd a0,744(sp) + 80006cbe: 3aa13c23 sd a0,952(sp) + +0000000080006cc2 <.LBB3_109>: + 80006cc2: 0001e597 auipc a1,0x1e + 80006cc6: 5c058593 addi a1,a1,1472 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80006cca: 0001a097 auipc ra,0x1a + 80006cce: 8a4080e7 jalr -1884(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006cd2: f82a sd a0,48(sp) + 80006cd4: fc2e sd a1,56(sp) + 80006cd6: a009 j 80006cd8 <.LBB3_109+0x16> + 80006cd8: 7562 ld a0,56(sp) + 80006cda: 75c2 ld a1,48(sp) + 80006cdc: 2cb13c23 sd a1,728(sp) + 80006ce0: 2ea13023 sd a0,736(sp) + +0000000080006ce4 <.LBB3_110>: + 80006ce4: 00021597 auipc a1,0x21 + 80006ce8: e9c58593 addi a1,a1,-356 # 80027b80 <.L__unnamed_37> + 80006cec: 1528 addi a0,sp,680 + 80006cee: 4609 li a2,2 + 80006cf0: 0db4 addi a3,sp,728 + 80006cf2: 4705 li a4,1 + 80006cf4: fffff097 auipc ra,0xfffff + 80006cf8: 896080e7 jalr -1898(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006cfc: a009 j 80006cfe <.LBB3_110+0x1a> + 80006cfe: 1528 addi a0,sp,680 + 80006d00: 00018097 auipc ra,0x18 + 80006d04: ef8080e7 jalr -264(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80006d08: a009 j 80006d0a <.LBB3_110+0x26> + 80006d0a: 1988 addi a0,sp,240 + println!("stval: 0x{:x}", stval); + 80006d0c: 32a13823 sd a0,816(sp) + 80006d10: 3ca13023 sd a0,960(sp) + +0000000080006d14 <.LBB3_111>: + 80006d14: 0001e597 auipc a1,0x1e + 80006d18: 56e58593 addi a1,a1,1390 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80006d1c: 0001a097 auipc ra,0x1a + 80006d20: 852080e7 jalr -1966(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80006d24: f02a sd a0,32(sp) + 80006d26: f42e sd a1,40(sp) + 80006d28: a009 j 80006d2a <.LBB3_111+0x16> + 80006d2a: 7522 ld a0,40(sp) + 80006d2c: 7582 ld a1,32(sp) + 80006d2e: 32b13023 sd a1,800(sp) + 80006d32: 32a13423 sd a0,808(sp) + +0000000080006d36 <.LBB3_112>: + 80006d36: 00021597 auipc a1,0x21 + 80006d3a: e7a58593 addi a1,a1,-390 # 80027bb0 <.L__unnamed_38> + 80006d3e: 1d88 addi a0,sp,752 + 80006d40: 4609 li a2,2 + 80006d42: 1614 addi a3,sp,800 + 80006d44: 4705 li a4,1 + 80006d46: fffff097 auipc ra,0xfffff + 80006d4a: 844080e7 jalr -1980(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80006d4e: a009 j 80006d50 <.LBB3_112+0x1a> + 80006d50: 1d88 addi a0,sp,752 + 80006d52: 00018097 auipc ra,0x18 + 80006d56: ea6080e7 jalr -346(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80006d5a: a009 j 80006d5c <.LBB3_113> + +0000000080006d5c <.LBB3_113>: + panic!(); + 80006d5c: 00021517 auipc a0,0x21 + 80006d60: e7450513 addi a0,a0,-396 # 80027bd0 <.L__unnamed_39> + +0000000080006d64 <.LBB3_114>: + 80006d64: 00021617 auipc a2,0x21 + 80006d68: e7c60613 addi a2,a2,-388 # 80027be0 <.L__unnamed_40> + 80006d6c: 45b9 li a1,14 + 80006d6e: 0001c097 auipc ra,0x1c + 80006d72: 3d6080e7 jalr 982(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80006d76: 0000 unimp + if let Some(interrupt) = plic_claim() { + 80006d78: 00018097 auipc ra,0x18 + 80006d7c: bfe080e7 jalr -1026(ra) # 8001e976 <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E> + 80006d80: 32a12c23 sw a0,824(sp) + 80006d84: 32b12e23 sw a1,828(sp) + 80006d88: a009 j 80006d8a <.LBB3_114+0x26> + 80006d8a: 33812503 lw a0,824(sp) + 80006d8e: 4581 li a1,0 + 80006d90: 00b51463 bne a0,a1,80006d98 <.LBB3_114+0x34> + 80006d94: a009 j 80006d96 <.LBB3_114+0x32> + 80006d96: a8cd j 80006e88 <.LBB3_119+0x22> + 80006d98: 33c12503 lw a0,828(sp) + 80006d9c: 02051593 slli a1,a0,0x20 + 80006da0: 9181 srli a1,a1,0x20 + 80006da2: ec2e sd a1,24(sp) + 80006da4: 3ca12a23 sw a0,980(sp) + 80006da8: 4585 li a1,1 + VIRTIO0_IRQ => { + 80006daa: 02b50763 beq a0,a1,80006dd8 <.LBB3_117> + 80006dae: a009 j 80006db0 <.LBB3_114+0x4c> + 80006db0: 6562 ld a0,24(sp) + 80006db2: 2501 sext.w a0,a0 + 80006db4: 45a9 li a1,10 + 80006db6: 06b50063 beq a0,a1,80006e16 <.LBB3_118> + 80006dba: a009 j 80006dbc <.LBB3_115> + +0000000080006dbc <.LBB3_115>: + panic!("Unresolved interrupt"); + 80006dbc: 00021517 auipc a0,0x21 + 80006dc0: b1450513 addi a0,a0,-1260 # 800278d0 <.L__unnamed_4> + +0000000080006dc4 <.LBB3_116>: + 80006dc4: 00021617 auipc a2,0x21 + 80006dc8: f7c60613 addi a2,a2,-132 # 80027d40 <.L__unnamed_41> + 80006dcc: 45d1 li a1,20 + 80006dce: 0001c097 auipc ra,0x1c + 80006dd2: 376080e7 jalr 886(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080006dd8 <.LBB3_117>: + DISK.acquire().intr(); + 80006dd8: 00058517 auipc a0,0x58 + 80006ddc: 22850513 addi a0,a0,552 # 8005f000 <_ZN6kernel6driver11virtio_disk4DISK17h9e8917083150b34aE> + 80006de0: 0000a097 auipc ra,0xa + 80006de4: 182080e7 jalr 386(ra) # 80010f62 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E> + 80006de8: 34a13023 sd a0,832(sp) + 80006dec: a009 j 80006dee <.LBB3_117+0x16> + 80006dee: 0688 addi a0,sp,832 + 80006df0: 0000b097 auipc ra,0xb + 80006df4: f8e080e7 jalr -114(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80006df8: e82a sd a0,16(sp) + 80006dfa: a009 j 80006dfc <.LBB3_117+0x24> + 80006dfc: 6542 ld a0,16(sp) + 80006dfe: 00019097 auipc ra,0x19 + 80006e02: 394080e7 jalr 916(ra) # 80020192 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E> + 80006e06: a009 j 80006e08 <.LBB3_117+0x30> + 80006e08: 0688 addi a0,sp,832 + 80006e0a: 00000097 auipc ra,0x0 + 80006e0e: 45c080e7 jalr 1116(ra) # 80007266 <_ZN4core3ptr99drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..virtio_disk..Disk$GT$$GT$17h4fc01c278f0bfe6cE> + 80006e12: a009 j 80006e14 <.LBB3_117+0x3c> + match interrupt { + 80006e14: a819 j 80006e2a <.LBB3_118+0x14> + +0000000080006e16 <.LBB3_118>: + UART.intr(); + 80006e16: 00056517 auipc a0,0x56 + 80006e1a: 53a50513 addi a0,a0,1338 # 8005d350 <_ZN6kernel6driver4uart4UART17h0708b3e179d548ddE> + 80006e1e: 00003097 auipc ra,0x3 + 80006e22: 716080e7 jalr 1814(ra) # 8000a534 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E> + 80006e26: a009 j 80006e28 <.LBB3_118+0x12> + match interrupt { + 80006e28: a009 j 80006e2a <.LBB3_118+0x14> + plic_complete(interrupt); + 80006e2a: 6562 ld a0,24(sp) + 80006e2c: 00018097 auipc ra,0x18 + 80006e30: ba4080e7 jalr -1116(ra) # 8001e9d0 <_ZN6kernel6driver4plic13plic_complete17hc3a23eee8594fbc3E> + 80006e34: a009 j 80006e36 <.LBB3_118+0x20> + if let Some(interrupt) = plic_claim() { + 80006e36: a889 j 80006e88 <.LBB3_119+0x22> + if cpu::cpuid() == 0{ + 80006e38: 0000b097 auipc ra,0xb + 80006e3c: 5b8080e7 jalr 1464(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80006e40: e42a sd a0,8(sp) + 80006e42: a009 j 80006e44 <.LBB3_118+0x2e> + 80006e44: 6522 ld a0,8(sp) + 80006e46: 4581 li a1,0 + 80006e48: 00b51863 bne a0,a1,80006e58 <.LBB3_118+0x42> + 80006e4c: a009 j 80006e4e <.LBB3_118+0x38> + clock_intr(); + 80006e4e: 00000097 auipc ra,0x0 + 80006e52: 078080e7 jalr 120(ra) # 80006ec6 <_ZN6kernel4trap10clock_intr17h80b4decf617479a4E> + 80006e56: a011 j 80006e5a <.LBB3_118+0x44> + if cpu::cpuid() == 0{ + 80006e58: a011 j 80006e5c <.LBB3_118+0x46> + 80006e5a: a009 j 80006e5c <.LBB3_118+0x46> + sip::clear_ssip(); + 80006e5c: 00018097 auipc ra,0x18 + 80006e60: 92e080e7 jalr -1746(ra) # 8001e78a <_ZN6kernel4arch5riscv8register3sip10clear_ssip17h3546c4610df6574fE> + 80006e64: a009 j 80006e66 <.LBB3_119> + +0000000080006e66 <.LBB3_119>: + CPU_MANAGER.mycpu().try_yield_proc(); + 80006e66: 0005f517 auipc a0,0x5f + 80006e6a: 2da50513 addi a0,a0,730 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80006e6e: 0000b097 auipc ra,0xb + 80006e72: 59e080e7 jalr 1438(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 80006e76: e02a sd a0,0(sp) + 80006e78: a009 j 80006e7a <.LBB3_119+0x14> + 80006e7a: 6502 ld a0,0(sp) + 80006e7c: 0000c097 auipc ra,0xc + 80006e80: 98a080e7 jalr -1654(ra) # 80012806 <_ZN6kernel7process3cpu3CPU14try_yield_proc17hdb175aaf084d8a03E> + 80006e84: a009 j 80006e86 <.LBB3_119+0x20> + match scause.cause() { + 80006e86: a009 j 80006e88 <.LBB3_119+0x22> + } + } + // store context + sepc::write(local_spec); + 80006e88: 756e ld a0,248(sp) + 80006e8a: ffffe097 auipc ra,0xffffe + 80006e8e: ea6080e7 jalr -346(ra) # 80004d30 <_ZN6kernel4arch5riscv8register4sepc5write17h2074fd389defa9f2E> + 80006e92: a009 j 80006e94 <.LBB3_119+0x2e> + sstatus::write(sstatus); + 80006e94: 656e ld a0,216(sp) + 80006e96: 00018097 auipc ra,0x18 + 80006e9a: 310080e7 jalr 784(ra) # 8001f1a6 <_ZN6kernel4arch5riscv8register7sstatus5write17h2e3a8152fe4defdaE> + 80006e9e: a009 j 80006ea0 <.LBB3_119+0x3a> + +} + 80006ea0: 3d813083 ld ra,984(sp) + 80006ea4: 3e010113 addi sp,sp,992 + 80006ea8: 8082 ret + +0000000080006eaa <.LBB3_120>: + local_spec += 2; + 80006eaa: 00021517 auipc a0,0x21 + 80006eae: ac650513 addi a0,a0,-1338 # 80027970 + +0000000080006eb2 <.LBB3_121>: + 80006eb2: 00021617 auipc a2,0x21 + 80006eb6: df660613 addi a2,a2,-522 # 80027ca8 <.L__unnamed_42> + 80006eba: 45f1 li a1,28 + 80006ebc: 0001c097 auipc ra,0x1c + 80006ec0: 288080e7 jalr 648(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4trap10clock_intr17h80b4decf617479a4E: + +0000000080006ec6 <_ZN6kernel4trap10clock_intr17h80b4decf617479a4E>: + + +pub unsafe fn clock_intr(){ + 80006ec6: 7179 addi sp,sp,-48 + let mut ticks = TICKS_LOCK.acquire(); + 80006ec8: f406 sd ra,40(sp) + +0000000080006eca <.LBB4_7>: + 80006eca: 00031517 auipc a0,0x31 + 80006ece: 64e50513 addi a0,a0,1614 # 80038518 <_ZN6kernel4trap10TICKS_LOCK17hd80a843c812fe4caE> + 80006ed2: 0000a097 auipc ra,0xa + 80006ed6: 250080e7 jalr 592(ra) # 80011122 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17he33ed4c8b2ffa030E> + 80006eda: f02a sd a0,32(sp) + 80006edc: a009 j 80006ede <.LBB4_7+0x14> + 80006ede: 1008 addi a0,sp,32 + *ticks = *ticks + 1; + 80006ee0: 0000b097 auipc ra,0xb + 80006ee4: de0080e7 jalr -544(ra) # 80011cc0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h570d144f846c2ec7E> + 80006ee8: ec2a sd a0,24(sp) + 80006eea: a009 j 80006eec <.LBB4_7+0x22> + 80006eec: 6562 ld a0,24(sp) + 80006eee: 610c ld a1,0(a0) + 80006ef0: 00158513 addi a0,a1,1 + 80006ef4: e82a sd a0,16(sp) + 80006ef6: 02b56663 bltu a0,a1,80006f22 <.LBB4_8> + 80006efa: a009 j 80006efc <.LBB4_7+0x32> + 80006efc: 1008 addi a0,sp,32 + 80006efe: 0000b097 auipc ra,0xb + 80006f02: f3e080e7 jalr -194(ra) # 80011e3c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h8532990243dc594eE> + 80006f06: e42a sd a0,8(sp) + 80006f08: a009 j 80006f0a <.LBB4_7+0x40> + 80006f0a: 6542 ld a0,16(sp) + 80006f0c: 65a2 ld a1,8(sp) + 80006f0e: e188 sd a0,0(a1) + drop(ticks); + 80006f10: 7502 ld a0,32(sp) + 80006f12: 00017097 auipc ra,0x17 + 80006f16: ebe080e7 jalr -322(ra) # 8001ddd0 <_ZN4core3mem4drop17h0acc999538dd9281E> + 80006f1a: a009 j 80006f1c <.LBB4_7+0x52> +} + 80006f1c: 70a2 ld ra,40(sp) + 80006f1e: 6145 addi sp,sp,48 + 80006f20: 8082 ret + +0000000080006f22 <.LBB4_8>: + *ticks = *ticks + 1; + 80006f22: 00021517 auipc a0,0x21 + 80006f26: a4e50513 addi a0,a0,-1458 # 80027970 + +0000000080006f2a <.LBB4_9>: + 80006f2a: 00021617 auipc a2,0x21 + 80006f2e: e2e60613 addi a2,a2,-466 # 80027d58 <.L__unnamed_43> + 80006f32: 45f1 li a1,28 + 80006f34: 0001c097 auipc ra,0x1c + 80006f38: 210080e7 jalr 528(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core3ops8function6FnOnce9call_once17h5aa9a10c33b479e6E: + +0000000080006f3e <_ZN4core3ops8function6FnOnce9call_once17h5aa9a10c33b479e6E>: + #[stable(feature = "fn_once_output", since = "1.12.0")] + type Output; + + /// Performs the call operation. + #[unstable(feature = "fn_traits", issue = "29625")] + extern "rust-call" fn call_once(self, args: Args) -> Self::Output; + 80006f3e: 7179 addi sp,sp,-48 + 80006f40: f406 sd ra,40(sp) + 80006f42: e82a sd a0,16(sp) + 80006f44: ec2e sd a1,24(sp) + 80006f46: 00015097 auipc ra,0x15 + 80006f4a: 5c8080e7 jalr 1480(ra) # 8001c50e <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE> + 80006f4e: e42a sd a0,8(sp) + 80006f50: a009 j 80006f52 <_ZN4core3ops8function6FnOnce9call_once17h5aa9a10c33b479e6E+0x14> + 80006f52: 6522 ld a0,8(sp) + 80006f54: 70a2 ld ra,40(sp) + 80006f56: 6145 addi sp,sp,48 + 80006f58: 8082 ret + +Disassembly of section .text._ZN4core3ptr116drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$u5b$kernel..fs..inode..InodeMeta$u3b$$u20$50$u5d$$GT$$GT$17h4e8573cf3b362114E: + +0000000080006f5a <_ZN4core3ptr116drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$u5b$kernel..fs..inode..InodeMeta$u3b$$u20$50$u5d$$GT$$GT$17h4e8573cf3b362114E>: +/// i.e., you do not usually have to worry about such issues unless you call `drop_in_place` +/// manually. +#[stable(feature = "drop_in_place", since = "1.8.0")] +#[lang = "drop_in_place"] +#[allow(unconditional_recursion)] +pub unsafe fn drop_in_place(to_drop: *mut T) { + 80006f5a: 1141 addi sp,sp,-16 + 80006f5c: e406 sd ra,8(sp) + 80006f5e: e02a sd a0,0(sp) + 80006f60: 00000097 auipc ra,0x0 + 80006f64: 4f2080e7 jalr 1266(ra) # 80007452 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h1d31607f4cd7f071E> + 80006f68: a009 j 80006f6a <_ZN4core3ptr116drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$u5b$kernel..fs..inode..InodeMeta$u3b$$u20$50$u5d$$GT$$GT$17h4e8573cf3b362114E+0x10> + 80006f6a: 60a2 ld ra,8(sp) + 80006f6c: 0141 addi sp,sp,16 + 80006f6e: 8082 ret + +Disassembly of section .text._ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E: + +0000000080006f70 <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E>: + 80006f70: 7179 addi sp,sp,-48 + 80006f72: f406 sd ra,40(sp) + 80006f74: e02a sd a0,0(sp) + 80006f76: f02a sd a0,32(sp) + 80006f78: 4501 li a0,0 + 80006f7a: e51d bnez a0,80006fa8 <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x38> + 80006f7c: a0b9 j 80006fca <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x5a> + 80006f7e: 70a2 ld ra,40(sp) + 80006f80: 6145 addi sp,sp,48 + 80006f82: 8082 ret + 80006f84: 6502 ld a0,0(sp) + 80006f86: 65a2 ld a1,8(sp) + 80006f88: 00359613 slli a2,a1,0x3 + 80006f8c: 9532 add a0,a0,a2 + 80006f8e: 0585 addi a1,a1,1 + 80006f90: e42e sd a1,8(sp) + 80006f92: 00000097 auipc ra,0x0 + 80006f96: 284080e7 jalr 644(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80006f9a: a009 j 80006f9c <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x2c> + 80006f9c: 6522 ld a0,8(sp) + 80006f9e: 06400593 li a1,100 + 80006fa2: fcb50ee3 beq a0,a1,80006f7e <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0xe> + 80006fa6: bff9 j 80006f84 <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x14> + 80006fa8: 4501 li a0,0 + 80006faa: e42a sd a0,8(sp) + 80006fac: bfc5 j 80006f9c <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x2c> + 80006fae: 6542 ld a0,16(sp) + 80006fb0: 00850593 addi a1,a0,8 + 80006fb4: e82e sd a1,16(sp) + 80006fb6: 00000097 auipc ra,0x0 + 80006fba: 260080e7 jalr 608(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80006fbe: a009 j 80006fc0 <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x50> + 80006fc0: 6542 ld a0,16(sp) + 80006fc2: 65e2 ld a1,24(sp) + 80006fc4: fab50de3 beq a0,a1,80006f7e <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0xe> + 80006fc8: b7dd j 80006fae <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x3e> + 80006fca: 6502 ld a0,0(sp) + 80006fcc: e82a sd a0,16(sp) + 80006fce: 32050513 addi a0,a0,800 + 80006fd2: ec2a sd a0,24(sp) + 80006fd4: b7f5 j 80006fc0 <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E+0x50> + +Disassembly of section .text._ZN4core3ptr120drop_in_place$LT$core..option..Option$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$$GT$17hc3cb66b90ce8c8e9E: + +0000000080006fd6 <_ZN4core3ptr120drop_in_place$LT$core..option..Option$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$$GT$17hc3cb66b90ce8c8e9E>: + 80006fd6: 1101 addi sp,sp,-32 + 80006fd8: ec06 sd ra,24(sp) + 80006fda: e42a sd a0,8(sp) + 80006fdc: e82a sd a0,16(sp) + 80006fde: 6108 ld a0,0(a0) + 80006fe0: 4581 li a1,0 + 80006fe2: 00b51663 bne a0,a1,80006fee <_ZN4core3ptr120drop_in_place$LT$core..option..Option$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$$GT$17hc3cb66b90ce8c8e9E+0x18> + 80006fe6: a009 j 80006fe8 <_ZN4core3ptr120drop_in_place$LT$core..option..Option$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$$GT$17hc3cb66b90ce8c8e9E+0x12> + 80006fe8: 60e2 ld ra,24(sp) + 80006fea: 6105 addi sp,sp,32 + 80006fec: 8082 ret + 80006fee: 6522 ld a0,8(sp) + 80006ff0: 00000097 auipc ra,0x0 + 80006ff4: 1fa080e7 jalr 506(ra) # 800071ea <_ZN4core3ptr92drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$17h537aa9010d3295f9E> + 80006ff8: bfc5 j 80006fe8 <_ZN4core3ptr120drop_in_place$LT$core..option..Option$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$$GT$17hc3cb66b90ce8c8e9E+0x12> + +Disassembly of section .text._ZN4core3ptr28drop_in_place$LT$$RF$str$GT$17h2bbae85ad1a63829E: + +0000000080006ffa <_ZN4core3ptr28drop_in_place$LT$$RF$str$GT$17h2bbae85ad1a63829E>: + 80006ffa: 1141 addi sp,sp,-16 + 80006ffc: e42a sd a0,8(sp) + 80006ffe: 0141 addi sp,sp,16 + 80007000: 8082 ret + +Disassembly of section .text._ZN4core3ptr29drop_in_place$LT$$LP$$RP$$GT$17h051aaaaafca2b588E: + +0000000080007002 <_ZN4core3ptr29drop_in_place$LT$$LP$$RP$$GT$17h051aaaaafca2b588E>: + 80007002: 1141 addi sp,sp,-16 + 80007004: e42a sd a0,8(sp) + 80007006: 0141 addi sp,sp,16 + 80007008: 8082 ret + +Disassembly of section .text._ZN4core3ptr37drop_in_place$LT$core..fmt..Error$GT$17h74512b837ee77bedE: + +000000008000700a <_ZN4core3ptr37drop_in_place$LT$core..fmt..Error$GT$17h74512b837ee77bedE>: + 8000700a: 1141 addi sp,sp,-16 + 8000700c: e42a sd a0,8(sp) + 8000700e: 0141 addi sp,sp,16 + 80007010: 8082 ret + +Disassembly of section .text._ZN4core3ptr41drop_in_place$LT$kernel..fs..bio..Buf$GT$17hc35967244f3e9eb6E: + +0000000080007012 <_ZN4core3ptr41drop_in_place$LT$kernel..fs..bio..Buf$GT$17hc35967244f3e9eb6E>: + 80007012: 1101 addi sp,sp,-32 + 80007014: ec06 sd ra,24(sp) + 80007016: e42a sd a0,8(sp) + 80007018: e82a sd a0,16(sp) + 8000701a: 00000097 auipc ra,0x0 + 8000701e: 528080e7 jalr 1320(ra) # 80007542 <_ZN62_$LT$kernel..fs..bio..Buf$u20$as$u20$core..ops..drop..Drop$GT$4drop17hae787f8a28b7a10dE> + 80007022: a021 j 8000702a <_ZN4core3ptr41drop_in_place$LT$kernel..fs..bio..Buf$GT$17hc35967244f3e9eb6E+0x18> + 80007024: 60e2 ld ra,24(sp) + 80007026: 6105 addi sp,sp,32 + 80007028: 8082 ret + 8000702a: 6522 ld a0,8(sp) + 8000702c: 0541 addi a0,a0,16 + 8000702e: 00000097 auipc ra,0x0 + 80007032: fa8080e7 jalr -88(ra) # 80006fd6 <_ZN4core3ptr120drop_in_place$LT$core..option..Option$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$$GT$17hc3cb66b90ce8c8e9E> + 80007036: b7fd j 80007024 <_ZN4core3ptr41drop_in_place$LT$kernel..fs..bio..Buf$GT$17hc35967244f3e9eb6E+0x12> + +Disassembly of section .text._ZN4core3ptr42drop_in_place$LT$alloc..string..String$GT$17h586f2f4ef42593a1E: + +0000000080007038 <_ZN4core3ptr42drop_in_place$LT$alloc..string..String$GT$17h586f2f4ef42593a1E>: + 80007038: 1141 addi sp,sp,-16 + 8000703a: e406 sd ra,8(sp) + 8000703c: e02a sd a0,0(sp) + 8000703e: 00000097 auipc ra,0x0 + 80007042: 03e080e7 jalr 62(ra) # 8000707c <_ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17hc049a0af331ff31cE> + 80007046: a009 j 80007048 <_ZN4core3ptr42drop_in_place$LT$alloc..string..String$GT$17h586f2f4ef42593a1E+0x10> + 80007048: 60a2 ld ra,8(sp) + 8000704a: 0141 addi sp,sp,16 + 8000704c: 8082 ret + +Disassembly of section .text._ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E: + +000000008000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E>: + 8000704e: 1141 addi sp,sp,-16 + 80007050: e406 sd ra,8(sp) + 80007052: e02a sd a0,0(sp) + 80007054: 0541 addi a0,a0,16 + 80007056: 00000097 auipc ra,0x0 + 8000705a: 0da080e7 jalr 218(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8000705e: a009 j 80007060 <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E+0x12> + 80007060: 60a2 ld ra,8(sp) + 80007062: 0141 addi sp,sp,16 + 80007064: 8082 ret + +Disassembly of section .text._ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E: + +0000000080007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E>: + 80007066: 1141 addi sp,sp,-16 + 80007068: e406 sd ra,8(sp) + 8000706a: e02a sd a0,0(sp) + 8000706c: 00000097 auipc ra,0x0 + 80007070: 518080e7 jalr 1304(ra) # 80007584 <_ZN66_$LT$kernel..fs..inode..Inode$u20$as$u20$core..ops..drop..Drop$GT$4drop17h624968f150cac4e7E> + 80007074: a009 j 80007076 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E+0x10> + 80007076: 60a2 ld ra,8(sp) + 80007078: 0141 addi sp,sp,16 + 8000707a: 8082 ret + +Disassembly of section .text._ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17hc049a0af331ff31cE: + +000000008000707c <_ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17hc049a0af331ff31cE>: + 8000707c: 1101 addi sp,sp,-32 + 8000707e: ec06 sd ra,24(sp) + 80007080: e42a sd a0,8(sp) + 80007082: e82a sd a0,16(sp) + 80007084: 00000097 auipc ra,0x0 + 80007088: 348080e7 jalr 840(ra) # 800073cc <_ZN70_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf7bf84e08f8deec7E> + 8000708c: a021 j 80007094 <_ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17hc049a0af331ff31cE+0x18> + 8000708e: 60e2 ld ra,24(sp) + 80007090: 6105 addi sp,sp,32 + 80007092: 8082 ret + 80007094: 6522 ld a0,8(sp) + 80007096: 00000097 auipc ra,0x0 + 8000709a: 012080e7 jalr 18(ra) # 800070a8 <_ZN4core3ptr53drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$17h43989f6a80c9a285E> + 8000709e: bfc5 j 8000708e <_ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17hc049a0af331ff31cE+0x12> + +Disassembly of section .text._ZN4core3ptr48drop_in_place$LT$core..str..error..Utf8Error$GT$17h597f3c07065c4e0fE: + +00000000800070a0 <_ZN4core3ptr48drop_in_place$LT$core..str..error..Utf8Error$GT$17h597f3c07065c4e0fE>: + 800070a0: 1141 addi sp,sp,-16 + 800070a2: e42a sd a0,8(sp) + 800070a4: 0141 addi sp,sp,16 + 800070a6: 8082 ret + +Disassembly of section .text._ZN4core3ptr53drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$17h43989f6a80c9a285E: + +00000000800070a8 <_ZN4core3ptr53drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$17h43989f6a80c9a285E>: + 800070a8: 1141 addi sp,sp,-16 + 800070aa: e406 sd ra,8(sp) + 800070ac: e02a sd a0,0(sp) + 800070ae: 00000097 auipc ra,0x0 + 800070b2: 34a080e7 jalr 842(ra) # 800073f8 <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E> + 800070b6: a009 j 800070b8 <_ZN4core3ptr53drop_in_place$LT$alloc..raw_vec..RawVec$LT$u8$GT$$GT$17h43989f6a80c9a285E+0x10> + 800070b8: 60a2 ld ra,8(sp) + 800070ba: 0141 addi sp,sp,16 + 800070bc: 8082 ret + +Disassembly of section .text._ZN4core3ptr53drop_in_place$LT$core..alloc..layout..LayoutError$GT$17he06501856409b544E: + +00000000800070be <_ZN4core3ptr53drop_in_place$LT$core..alloc..layout..LayoutError$GT$17he06501856409b544E>: + 800070be: 1141 addi sp,sp,-16 + 800070c0: e42a sd a0,8(sp) + 800070c2: 0141 addi sp,sp,16 + 800070c4: 8082 ret + +Disassembly of section .text._ZN4core3ptr54drop_in_place$LT$$RF$kernel..fs..dinode..InodeType$GT$17h9ce5713d93ac6a07E: + +00000000800070c6 <_ZN4core3ptr54drop_in_place$LT$$RF$kernel..fs..dinode..InodeType$GT$17h9ce5713d93ac6a07E>: + 800070c6: 1141 addi sp,sp,-16 + 800070c8: e42a sd a0,8(sp) + 800070ca: 0141 addi sp,sp,16 + 800070cc: 8082 ret + +Disassembly of section .text._ZN4core3ptr54drop_in_place$LT$core..num..error..TryFromIntError$GT$17hcbff8ea1575fcb6aE: + +00000000800070ce <_ZN4core3ptr54drop_in_place$LT$core..num..error..TryFromIntError$GT$17hcbff8ea1575fcb6aE>: + 800070ce: 1141 addi sp,sp,-16 + 800070d0: e42a sd a0,8(sp) + 800070d2: 0141 addi sp,sp,16 + 800070d4: 8082 ret + +Disassembly of section .text._ZN4core3ptr59drop_in_place$LT$$RF$mut$u20$kernel..driver..uart..Uart$GT$17he0733011476f9c53E: + +00000000800070d6 <_ZN4core3ptr59drop_in_place$LT$$RF$mut$u20$kernel..driver..uart..Uart$GT$17he0733011476f9c53E>: + 800070d6: 1141 addi sp,sp,-16 + 800070d8: e42a sd a0,8(sp) + 800070da: 0141 addi sp,sp,16 + 800070dc: 8082 ret + +Disassembly of section .text._ZN4core3ptr68drop_in_place$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$17h1ebe49ede9a118fdE: + +00000000800070de <_ZN4core3ptr68drop_in_place$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$17h1ebe49ede9a118fdE>: + 800070de: 1141 addi sp,sp,-16 + 800070e0: e406 sd ra,8(sp) + 800070e2: e02a sd a0,0(sp) + 800070e4: 00000097 auipc ra,0x0 + 800070e8: 1de080e7 jalr 478(ra) # 800072c2 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE> + 800070ec: a009 j 800070ee <_ZN4core3ptr68drop_in_place$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$17h1ebe49ede9a118fdE+0x10> + 800070ee: 60a2 ld ra,8(sp) + 800070f0: 0141 addi sp,sp,16 + 800070f2: 8082 ret + +Disassembly of section .text._ZN4core3ptr69drop_in_place$LT$alloc..sync..Weak$LT$kernel..fs..file..VFile$GT$$GT$17hfcb3bca0be736df8E: + +00000000800070f4 <_ZN4core3ptr69drop_in_place$LT$alloc..sync..Weak$LT$kernel..fs..file..VFile$GT$$GT$17hfcb3bca0be736df8E>: + 800070f4: 1141 addi sp,sp,-16 + 800070f6: e406 sd ra,8(sp) + 800070f8: e02a sd a0,0(sp) + 800070fa: 00000097 auipc ra,0x0 + 800070fe: 222080e7 jalr 546(ra) # 8000731c <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E> + 80007102: a009 j 80007104 <_ZN4core3ptr69drop_in_place$LT$alloc..sync..Weak$LT$kernel..fs..file..VFile$GT$$GT$17hfcb3bca0be736df8E+0x10> + 80007104: 60a2 ld ra,8(sp) + 80007106: 0141 addi sp,sp,16 + 80007108: 8082 ret + +Disassembly of section .text._ZN4core3ptr71drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$usize$GT$$GT$17h978f142a914ddf2eE: + +000000008000710a <_ZN4core3ptr71drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$usize$GT$$GT$17h978f142a914ddf2eE>: + 8000710a: 1141 addi sp,sp,-16 + 8000710c: e406 sd ra,8(sp) + 8000710e: e02a sd a0,0(sp) + 80007110: 00000097 auipc ra,0x0 + 80007114: 3ba080e7 jalr 954(ra) # 800074ca <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hbd0d5c90a46c79b0E> + 80007118: a009 j 8000711a <_ZN4core3ptr71drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$usize$GT$$GT$17h978f142a914ddf2eE+0x10> + 8000711a: 60a2 ld ra,8(sp) + 8000711c: 0141 addi sp,sp,16 + 8000711e: 8082 ret + +Disassembly of section .text._ZN4core3ptr73drop_in_place$LT$$RF$kernel..arch..riscv..register..scause..Exception$GT$17h18956ab47fc37e77E: + +0000000080007120 <_ZN4core3ptr73drop_in_place$LT$$RF$kernel..arch..riscv..register..scause..Exception$GT$17h18956ab47fc37e77E>: + 80007120: 1141 addi sp,sp,-16 + 80007122: e42a sd a0,8(sp) + 80007124: 0141 addi sp,sp,16 + 80007126: 8082 ret + +Disassembly of section .text._ZN4core3ptr73drop_in_place$LT$$RF$kernel..arch..riscv..register..scause..Interrupt$GT$17h9a154681bb7a8c38E: + +0000000080007128 <_ZN4core3ptr73drop_in_place$LT$$RF$kernel..arch..riscv..register..scause..Interrupt$GT$17h9a154681bb7a8c38E>: + 80007128: 1141 addi sp,sp,-16 + 8000712a: e42a sd a0,8(sp) + 8000712c: 0141 addi sp,sp,16 + 8000712e: 8082 ret + +Disassembly of section .text._ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE: + +0000000080007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE>: + 80007130: 1101 addi sp,sp,-32 + 80007132: ec06 sd ra,24(sp) + 80007134: e42a sd a0,8(sp) + 80007136: e82a sd a0,16(sp) + 80007138: 6108 ld a0,0(a0) + 8000713a: 4581 li a1,0 + 8000713c: 00b51663 bne a0,a1,80007148 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE+0x18> + 80007140: a009 j 80007142 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE+0x12> + 80007142: 60e2 ld ra,24(sp) + 80007144: 6105 addi sp,sp,32 + 80007146: 8082 ret + 80007148: 6522 ld a0,8(sp) + 8000714a: 0521 addi a0,a0,8 + 8000714c: 00000097 auipc ra,0x0 + 80007150: f1a080e7 jalr -230(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80007154: b7fd j 80007142 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE+0x12> + +Disassembly of section .text._ZN4core3ptr74drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$LP$$RP$$GT$$GT$17he568be727488c8bbE: + +0000000080007156 <_ZN4core3ptr74drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$LP$$RP$$GT$$GT$17he568be727488c8bbE>: + 80007156: 1141 addi sp,sp,-16 + 80007158: e406 sd ra,8(sp) + 8000715a: e02a sd a0,0(sp) + 8000715c: 00000097 auipc ra,0x0 + 80007160: 33e080e7 jalr 830(ra) # 8000749a <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h821d547a3c969c60E> + 80007164: a009 j 80007166 <_ZN4core3ptr74drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$LP$$RP$$GT$$GT$17he568be727488c8bbE+0x10> + 80007166: 60a2 ld ra,8(sp) + 80007168: 0141 addi sp,sp,16 + 8000716a: 8082 ret + +Disassembly of section .text._ZN4core3ptr77drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ElfHeader$GT$$GT$17hf970e769dc617072E: + +000000008000716c <_ZN4core3ptr77drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ElfHeader$GT$$GT$17hf970e769dc617072E>: + 8000716c: 1101 addi sp,sp,-32 + 8000716e: ec06 sd ra,24(sp) + 80007170: e42a sd a0,8(sp) + 80007172: e82a sd a0,16(sp) + 80007174: a021 j 8000717c <_ZN4core3ptr77drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ElfHeader$GT$$GT$17hf970e769dc617072E+0x10> + 80007176: 60e2 ld ra,24(sp) + 80007178: 6105 addi sp,sp,32 + 8000717a: 8082 ret + 8000717c: 6522 ld a0,8(sp) + 8000717e: 6108 ld a0,0(a0) + 80007180: 00002097 auipc ra,0x2 + 80007184: 06c080e7 jalr 108(ra) # 800091ec <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E> + 80007188: b7fd j 80007176 <_ZN4core3ptr77drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ElfHeader$GT$$GT$17hf970e769dc617072E+0xa> + +Disassembly of section .text._ZN4core3ptr78drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ProgHeader$GT$$GT$17h18632e5365e45018E: + +000000008000718a <_ZN4core3ptr78drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ProgHeader$GT$$GT$17h18632e5365e45018E>: + 8000718a: 1101 addi sp,sp,-32 + 8000718c: ec06 sd ra,24(sp) + 8000718e: e42a sd a0,8(sp) + 80007190: e82a sd a0,16(sp) + 80007192: a021 j 8000719a <_ZN4core3ptr78drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ProgHeader$GT$$GT$17h18632e5365e45018E+0x10> + 80007194: 60e2 ld ra,24(sp) + 80007196: 6105 addi sp,sp,32 + 80007198: 8082 ret + 8000719a: 6522 ld a0,8(sp) + 8000719c: 6108 ld a0,0(a0) + 8000719e: 00002097 auipc ra,0x2 + 800071a2: 0d2080e7 jalr 210(ra) # 80009270 <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E> + 800071a6: b7fd j 80007194 <_ZN4core3ptr78drop_in_place$LT$alloc..boxed..Box$LT$kernel..process..elf..ProgHeader$GT$$GT$17h18632e5365e45018E+0xa> + +Disassembly of section .text._ZN4core3ptr86drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..log..Log$GT$$GT$17h3ff4d5b7fa89905aE: + +00000000800071a8 <_ZN4core3ptr86drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..log..Log$GT$$GT$17h3ff4d5b7fa89905aE>: + 800071a8: 1141 addi sp,sp,-16 + 800071aa: e406 sd ra,8(sp) + 800071ac: e02a sd a0,0(sp) + 800071ae: 00000097 auipc ra,0x0 + 800071b2: 28c080e7 jalr 652(ra) # 8000743a <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07564fb2c96981cdE> + 800071b6: a009 j 800071b8 <_ZN4core3ptr86drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..log..Log$GT$$GT$17h3ff4d5b7fa89905aE+0x10> + 800071b8: 60a2 ld ra,8(sp) + 800071ba: 0141 addi sp,sp,16 + 800071bc: 8082 ret + +Disassembly of section .text._ZN4core3ptr88drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$allocator..BuddySystem$GT$$GT$17hd20388e8ca3384f9E: + +00000000800071be <_ZN4core3ptr88drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$allocator..BuddySystem$GT$$GT$17hd20388e8ca3384f9E>: + 800071be: 1141 addi sp,sp,-16 + 800071c0: e406 sd ra,8(sp) + 800071c2: e02a sd a0,0(sp) + 800071c4: 00000097 auipc ra,0x0 + 800071c8: 2be080e7 jalr 702(ra) # 80007482 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h5c638f5071dc4adaE> + 800071cc: a009 j 800071ce <_ZN4core3ptr88drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$allocator..BuddySystem$GT$$GT$17hd20388e8ca3384f9E+0x10> + 800071ce: 60a2 ld ra,8(sp) + 800071d0: 0141 addi sp,sp,16 + 800071d2: 8082 ret + +Disassembly of section .text._ZN4core3ptr89drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..bio..BufLru$GT$$GT$17h9c86fb58887d325bE: + +00000000800071d4 <_ZN4core3ptr89drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..bio..BufLru$GT$$GT$17h9c86fb58887d325bE>: + 800071d4: 1141 addi sp,sp,-16 + 800071d6: e406 sd ra,8(sp) + 800071d8: e02a sd a0,0(sp) + 800071da: 00000097 auipc ra,0x0 + 800071de: 308080e7 jalr 776(ra) # 800074e2 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc0ab90800bd26fd3E> + 800071e2: a009 j 800071e4 <_ZN4core3ptr89drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..bio..BufLru$GT$$GT$17h9c86fb58887d325bE+0x10> + 800071e4: 60a2 ld ra,8(sp) + 800071e6: 0141 addi sp,sp,16 + 800071e8: 8082 ret + +Disassembly of section .text._ZN4core3ptr92drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$17h537aa9010d3295f9E: + +00000000800071ea <_ZN4core3ptr92drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$17h537aa9010d3295f9E>: + 800071ea: 1141 addi sp,sp,-16 + 800071ec: e406 sd ra,8(sp) + 800071ee: e02a sd a0,0(sp) + 800071f0: 00000097 auipc ra,0x0 + 800071f4: 33a080e7 jalr 826(ra) # 8000752a <_ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hd4f2db8ec388cdc1E> + 800071f8: a009 j 800071fa <_ZN4core3ptr92drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$17h537aa9010d3295f9E+0x10> + 800071fa: 60a2 ld ra,8(sp) + 800071fc: 0141 addi sp,sp,16 + 800071fe: 8082 ret + +Disassembly of section .text._ZN4core3ptr92drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..uart..Uart$GT$$GT$17h4785ee23048b5bddE: + +0000000080007200 <_ZN4core3ptr92drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..uart..Uart$GT$$GT$17h4785ee23048b5bddE>: + 80007200: 1141 addi sp,sp,-16 + 80007202: e406 sd ra,8(sp) + 80007204: e02a sd a0,0(sp) + 80007206: 00000097 auipc ra,0x0 + 8000720a: 2f4080e7 jalr 756(ra) # 800074fa <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc6fa91bad8825bc2E> + 8000720e: a009 j 80007210 <_ZN4core3ptr92drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..uart..Uart$GT$$GT$17h4785ee23048b5bddE+0x10> + 80007210: 60a2 ld ra,8(sp) + 80007212: 0141 addi sp,sp,16 + 80007214: 8082 ret + +Disassembly of section .text._ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E: + +0000000080007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E>: + 80007216: 1101 addi sp,sp,-32 + 80007218: ec06 sd ra,24(sp) + 8000721a: e42a sd a0,8(sp) + 8000721c: e82a sd a0,16(sp) + 8000721e: 6108 ld a0,0(a0) + 80007220: 4581 li a1,0 + 80007222: 00b51663 bne a0,a1,8000722e <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E+0x18> + 80007226: a009 j 80007228 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E+0x12> + 80007228: 60e2 ld ra,24(sp) + 8000722a: 6105 addi sp,sp,32 + 8000722c: 8082 ret + 8000722e: 6522 ld a0,8(sp) + 80007230: 00000097 auipc ra,0x0 + 80007234: eae080e7 jalr -338(ra) # 800070de <_ZN4core3ptr68drop_in_place$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$17h1ebe49ede9a118fdE> + 80007238: bfc5 j 80007228 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E+0x12> + +Disassembly of section .text._ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E: + +000000008000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E>: + 8000723a: 1141 addi sp,sp,-16 + 8000723c: e406 sd ra,8(sp) + 8000723e: e02a sd a0,0(sp) + 80007240: 00000097 auipc ra,0x0 + 80007244: 2d2080e7 jalr 722(ra) # 80007512 <_ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17ha2d42db7f65900b8E> + 80007248: a009 j 8000724a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E+0x10> + 8000724a: 60a2 ld ra,8(sp) + 8000724c: 0141 addi sp,sp,16 + 8000724e: 8082 ret + +Disassembly of section .text._ZN4core3ptr98drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..console..Console$GT$$GT$17hbea8b3b0221deadaE: + +0000000080007250 <_ZN4core3ptr98drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..console..Console$GT$$GT$17hbea8b3b0221deadaE>: + 80007250: 1141 addi sp,sp,-16 + 80007252: e406 sd ra,8(sp) + 80007254: e02a sd a0,0(sp) + 80007256: 00000097 auipc ra,0x0 + 8000725a: 25c080e7 jalr 604(ra) # 800074b2 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb3b00b618040e227E> + 8000725e: a009 j 80007260 <_ZN4core3ptr98drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..console..Console$GT$$GT$17hbea8b3b0221deadaE+0x10> + 80007260: 60a2 ld ra,8(sp) + 80007262: 0141 addi sp,sp,16 + 80007264: 8082 ret + +Disassembly of section .text._ZN4core3ptr99drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..virtio_disk..Disk$GT$$GT$17h4fc01c278f0bfe6cE: + +0000000080007266 <_ZN4core3ptr99drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..virtio_disk..Disk$GT$$GT$17h4fc01c278f0bfe6cE>: + 80007266: 1141 addi sp,sp,-16 + 80007268: e406 sd ra,8(sp) + 8000726a: e02a sd a0,0(sp) + 8000726c: 00000097 auipc ra,0x0 + 80007270: 1fe080e7 jalr 510(ra) # 8000746a <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h472d74790cb24d84E> + 80007274: a009 j 80007276 <_ZN4core3ptr99drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..virtio_disk..Disk$GT$$GT$17h4fc01c278f0bfe6cE+0x10> + 80007276: 60a2 ld ra,8(sp) + 80007278: 0141 addi sp,sp,16 + 8000727a: 8082 ret + +Disassembly of section .text._ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE: + +000000008000727c <_ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE>: + /// + /// assert_eq!("Hello", hello.clone()); + /// ``` + #[stable(feature = "rust1", since = "1.0.0")] + #[must_use = "cloning is often expensive and is not expected to have side effects"] + fn clone(&self) -> Self; + 8000727c: 7179 addi sp,sp,-48 + 8000727e: f406 sd ra,40(sp) + 80007280: e42e sd a1,8(sp) + 80007282: e82a sd a0,16(sp) + 80007284: f02e sd a1,32(sp) + 80007286: 4501 li a0,0 + 80007288: ec2a sd a0,24(sp) + 8000728a: a009 j 8000728c <_ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE+0x10> + 8000728c: 6562 ld a0,24(sp) + 8000728e: 06400593 li a1,100 + 80007292: 02b50563 beq a0,a1,800072bc <_ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE+0x40> + 80007296: a009 j 80007298 <_ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE+0x1c> + 80007298: 65c2 ld a1,16(sp) + 8000729a: 6522 ld a0,8(sp) + 8000729c: 6662 ld a2,24(sp) + 8000729e: 060e slli a2,a2,0x3 + 800072a0: 9532 add a0,a0,a2 + 800072a2: 95b2 add a1,a1,a2 + 800072a4: e02e sd a1,0(sp) + 800072a6: 00009097 auipc ra,0x9 + 800072aa: 834080e7 jalr -1996(ra) # 8000fada <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE> + 800072ae: 6582 ld a1,0(sp) + 800072b0: e188 sd a0,0(a1) + 800072b2: a009 j 800072b4 <_ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE+0x38> + 800072b4: 6562 ld a0,24(sp) + 800072b6: 0505 addi a0,a0,1 + 800072b8: ec2a sd a0,24(sp) + 800072ba: bfc9 j 8000728c <_ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE+0x10> + 800072bc: 70a2 ld ra,40(sp) + 800072be: 6145 addi sp,sp,48 + 800072c0: 8082 ret + +Disassembly of section .text._ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE: + +00000000800072c2 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE>: + fn drop(&mut self) { + 800072c2: 7179 addi sp,sp,-48 + 800072c4: f406 sd ra,40(sp) + 800072c6: e42a sd a0,8(sp) + 800072c8: f02a sd a0,32(sp) + if self.inner().strong.fetch_sub(1, Release) != 1 { + 800072ca: ffffb097 auipc ra,0xffffb + 800072ce: 1fa080e7 jalr 506(ra) # 800024c4 <_ZN5alloc4sync12Arc$LT$T$GT$5inner17h9bfe4db1ecae9d98E> + 800072d2: e82a sd a0,16(sp) + 800072d4: a009 j 800072d6 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x14> + 800072d6: 6542 ld a0,16(sp) + 800072d8: 4605 li a2,1 + 800072da: 00c10f23 sb a2,30(sp) + 800072de: 85b2 mv a1,a2 + 800072e0: ffffd097 auipc ra,0xffffd + 800072e4: 530080e7 jalr 1328(ra) # 80004810 <_ZN4core4sync6atomic11AtomicUsize9fetch_sub17h94fe355041184982E> + 800072e8: e02a sd a0,0(sp) + 800072ea: a009 j 800072ec <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x2a> + 800072ec: 6502 ld a0,0(sp) + 800072ee: 4585 li a1,1 + 800072f0: 00b50463 beq a0,a1,800072f8 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x36> + 800072f4: a009 j 800072f6 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x34> + } + 800072f6: a005 j 80007316 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x54> + 800072f8: 4509 li a0,2 + acquire!(self.inner().strong); + 800072fa: 00a10fa3 sb a0,31(sp) + 800072fe: ffffd097 auipc ra,0xffffd + 80007302: 54a080e7 jalr 1354(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80007306: a009 j 80007308 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x46> + self.drop_slow(); + 80007308: 6522 ld a0,8(sp) + 8000730a: ffffb097 auipc ra,0xffffb + 8000730e: 1d4080e7 jalr 468(ra) # 800024de <_ZN5alloc4sync12Arc$LT$T$GT$9drop_slow17hcb02a55d90430c0dE> + 80007312: a009 j 80007314 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x52> + } + 80007314: a009 j 80007316 <_ZN67_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h228396a8880ae9ddE+0x54> + 80007316: 70a2 ld ra,40(sp) + 80007318: 6145 addi sp,sp,48 + 8000731a: 8082 ret + +Disassembly of section .text._ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E: + +000000008000731c <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E>: + /// drop(weak_foo); // Doesn't print anything + /// drop(foo); // Prints "dropped!" + /// + /// assert!(other_weak_foo.upgrade().is_none()); + /// ``` + fn drop(&mut self) { + 8000731c: 7119 addi sp,sp,-128 + 8000731e: fc86 sd ra,120(sp) + 80007320: f42a sd a0,40(sp) + 80007322: e8aa sd a0,80(sp) + // + // It's not necessary to check for the locked state here, because the + // weak count can only be locked if there was precisely one weak ref, + // meaning that drop could only subsequently run ON that remaining weak + // ref, which can only happen after the lock is released. + let inner = if let Some(inner) = self.inner() { inner } else { return }; + 80007324: ffffb097 auipc ra,0xffffb + 80007328: 1f0080e7 jalr 496(ra) # 80002514 <_ZN5alloc4sync13Weak$LT$T$GT$5inner17h5044bfde36c7c45eE> + 8000732c: fc2a sd a0,56(sp) + 8000732e: e0ae sd a1,64(sp) + 80007330: a009 j 80007332 <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x16> + 80007332: 7562 ld a0,56(sp) + 80007334: 4581 li a1,0 + 80007336: 00b51463 bne a0,a1,8000733e <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x22> + 8000733a: a009 j 8000733c <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x20> + + if inner.weak.fetch_sub(1, Release) == 1 { + acquire!(inner.weak); + unsafe { Global.deallocate(self.ptr.cast(), Layout::for_value_raw(self.ptr.as_ptr())) } + } + } + 8000733c: a069 j 800073c6 <.LBB41_14+0x16> + let inner = if let Some(inner) = self.inner() { inner } else { return }; + 8000733e: 7562 ld a0,56(sp) + 80007340: 6586 ld a1,64(sp) + 80007342: ecaa sd a0,88(sp) + 80007344: f0ae sd a1,96(sp) + 80007346: f4aa sd a0,104(sp) + 80007348: f8ae sd a1,112(sp) + 8000734a: 4605 li a2,1 + if inner.weak.fetch_sub(1, Release) == 1 { + 8000734c: 04c10723 sb a2,78(sp) + 80007350: 85b2 mv a1,a2 + 80007352: ffffd097 auipc ra,0xffffd + 80007356: 4be080e7 jalr 1214(ra) # 80004810 <_ZN4core4sync6atomic11AtomicUsize9fetch_sub17h94fe355041184982E> + 8000735a: f02a sd a0,32(sp) + 8000735c: a009 j 8000735e <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x42> + 8000735e: 7502 ld a0,32(sp) + 80007360: 4585 li a1,1 + 80007362: 00b51b63 bne a0,a1,80007378 <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x5c> + 80007366: a009 j 80007368 <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x4c> + 80007368: 4509 li a0,2 + acquire!(inner.weak); + 8000736a: 04a107a3 sb a0,79(sp) + 8000736e: ffffd097 auipc ra,0xffffd + 80007372: 4da080e7 jalr 1242(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80007376: a011 j 8000737a <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x5e> + if inner.weak.fetch_sub(1, Release) == 1 { + 80007378: a0b1 j 800073c4 <.LBB41_14+0x14> + unsafe { Global.deallocate(self.ptr.cast(), Layout::for_value_raw(self.ptr.as_ptr())) } + 8000737a: 7522 ld a0,40(sp) + 8000737c: 6108 ld a0,0(a0) + 8000737e: 00009097 auipc ra,0x9 + 80007382: 9ee080e7 jalr -1554(ra) # 8000fd6c <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h7831112f0067c5f4E> + 80007386: ec2a sd a0,24(sp) + 80007388: a009 j 8000738a <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x6e> + 8000738a: 7522 ld a0,40(sp) + 8000738c: 6108 ld a0,0(a0) + 8000738e: 00009097 auipc ra,0x9 + 80007392: af2080e7 jalr -1294(ra) # 8000fe80 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE> + 80007396: e82a sd a0,16(sp) + 80007398: a009 j 8000739a <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x7e> + 8000739a: 6542 ld a0,16(sp) + 8000739c: 00002097 auipc ra,0x2 + 800073a0: 934080e7 jalr -1740(ra) # 80008cd0 <_ZN4core5alloc6layout6Layout13for_value_raw17h9ddd239d574f5362E> + 800073a4: e02a sd a0,0(sp) + 800073a6: e42e sd a1,8(sp) + 800073a8: a009 j 800073aa <_ZN68_$LT$alloc..sync..Weak$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb23957f9542a4990E+0x8e> + 800073aa: 66a2 ld a3,8(sp) + 800073ac: 6602 ld a2,0(sp) + 800073ae: 65e2 ld a1,24(sp) + +00000000800073b0 <.LBB41_14>: + 800073b0: 00021517 auipc a0,0x21 + 800073b4: 9c050513 addi a0,a0,-1600 # 80027d70 <.L__unnamed_16> + 800073b8: 00005097 auipc ra,0x5 + 800073bc: 7da080e7 jalr 2010(ra) # 8000cb92 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE> + 800073c0: a009 j 800073c2 <.LBB41_14+0x12> + if inner.weak.fetch_sub(1, Release) == 1 { + 800073c2: a009 j 800073c4 <.LBB41_14+0x14> + } + 800073c4: a009 j 800073c6 <.LBB41_14+0x16> + 800073c6: 70e6 ld ra,120(sp) + 800073c8: 6109 addi sp,sp,128 + 800073ca: 8082 ret + +Disassembly of section .text._ZN70_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf7bf84e08f8deec7E: + +00000000800073cc <_ZN70_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf7bf84e08f8deec7E>: + } +} + +#[stable(feature = "rust1", since = "1.0.0")] +unsafe impl<#[may_dangle] T, A: Allocator> Drop for Vec { + fn drop(&mut self) { + 800073cc: 1101 addi sp,sp,-32 + 800073ce: ec06 sd ra,24(sp) + 800073d0: e02a sd a0,0(sp) + 800073d2: e82a sd a0,16(sp) + unsafe { + // use drop for [T] + // use a raw slice to refer to the elements of the vector as weakest necessary type; + // could avoid questions of validity in certain cases + ptr::drop_in_place(ptr::slice_from_raw_parts_mut(self.as_mut_ptr(), self.len)) + 800073d4: 00010097 auipc ra,0x10 + 800073d8: 4f6080e7 jalr 1270(ra) # 800178ca <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE> + 800073dc: e42a sd a0,8(sp) + 800073de: a009 j 800073e0 <_ZN70_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf7bf84e08f8deec7E+0x14> + 800073e0: 6522 ld a0,8(sp) + 800073e2: 6582 ld a1,0(sp) + 800073e4: 698c ld a1,16(a1) + 800073e6: 0001b097 auipc ra,0x1b + 800073ea: 290080e7 jalr 656(ra) # 80022676 <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E> + 800073ee: a009 j 800073f0 <_ZN70_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf7bf84e08f8deec7E+0x24> + 800073f0: a009 j 800073f2 <_ZN70_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hf7bf84e08f8deec7E+0x26> + } + // RawVec handles deallocation + } + 800073f2: 60e2 ld ra,24(sp) + 800073f4: 6105 addi sp,sp,32 + 800073f6: 8082 ret + +Disassembly of section .text._ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E: + +00000000800073f8 <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E>: + +unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec { + /// Frees the memory owned by the `RawVec` *without* trying to drop its contents. + fn drop(&mut self) { + 800073f8: 715d addi sp,sp,-80 + 800073fa: e486 sd ra,72(sp) + 800073fc: 85aa mv a1,a0 + 800073fe: e02e sd a1,0(sp) + 80007400: f42e sd a1,40(sp) + 80007402: 0808 addi a0,sp,16 + if let Some((ptr, layout)) = self.current_memory() { + 80007404: ffffb097 auipc ra,0xffffb + 80007408: 682080e7 jalr 1666(ra) # 80002a86 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$14current_memory17h47d07dfc1131b1d6E> + 8000740c: a009 j 8000740e <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E+0x16> + 8000740e: 6542 ld a0,16(sp) + 80007410: 4581 li a1,0 + 80007412: 00b51463 bne a0,a1,8000741a <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E+0x22> + 80007416: a009 j 80007418 <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E+0x20> + 80007418: a831 j 80007434 <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E+0x3c> + 8000741a: 6502 ld a0,0(sp) + 8000741c: 65c2 ld a1,16(sp) + 8000741e: f82e sd a1,48(sp) + 80007420: 6662 ld a2,24(sp) + 80007422: 7682 ld a3,32(sp) + 80007424: fc32 sd a2,56(sp) + 80007426: e0b6 sd a3,64(sp) + unsafe { self.alloc.deallocate(ptr, layout) } + 80007428: 00005097 auipc ra,0x5 + 8000742c: 76a080e7 jalr 1898(ra) # 8000cb92 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE> + 80007430: a009 j 80007432 <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E+0x3a> + if let Some((ptr, layout)) = self.current_memory() { + 80007432: a009 j 80007434 <_ZN77_$LT$alloc..raw_vec..RawVec$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07f37a6ddf49c648E+0x3c> + } + } + 80007434: 60a6 ld ra,72(sp) + 80007436: 6161 addi sp,sp,80 + 80007438: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07564fb2c96981cdE: + +000000008000743a <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07564fb2c96981cdE>: + } + } +} + +impl Drop for SpinlockGuard<'_, T>{ + fn drop(&mut self){ + 8000743a: 1141 addi sp,sp,-16 + 8000743c: e406 sd ra,8(sp) + 8000743e: e02a sd a0,0(sp) + self.spinlock.release() + 80007440: 6108 ld a0,0(a0) + 80007442: 0000a097 auipc ra,0xa + 80007446: dc0080e7 jalr -576(ra) # 80011202 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h4488adb03f65166cE> + 8000744a: a009 j 8000744c <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h07564fb2c96981cdE+0x12> + } + 8000744c: 60a2 ld ra,8(sp) + 8000744e: 0141 addi sp,sp,16 + 80007450: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h1d31607f4cd7f071E: + +0000000080007452 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h1d31607f4cd7f071E>: + fn drop(&mut self){ + 80007452: 1141 addi sp,sp,-16 + 80007454: e406 sd ra,8(sp) + 80007456: e02a sd a0,0(sp) + self.spinlock.release() + 80007458: 6108 ld a0,0(a0) + 8000745a: 0000a097 auipc ra,0xa + 8000745e: 122080e7 jalr 290(ra) # 8001157c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hd5c81d47b1881bbfE> + 80007462: a009 j 80007464 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h1d31607f4cd7f071E+0x12> + } + 80007464: 60a2 ld ra,8(sp) + 80007466: 0141 addi sp,sp,16 + 80007468: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h472d74790cb24d84E: + +000000008000746a <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h472d74790cb24d84E>: + fn drop(&mut self){ + 8000746a: 1141 addi sp,sp,-16 + 8000746c: e406 sd ra,8(sp) + 8000746e: e02a sd a0,0(sp) + self.spinlock.release() + 80007470: 6108 ld a0,0(a0) + 80007472: 0000a097 auipc ra,0xa + 80007476: 320080e7 jalr 800(ra) # 80011792 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfedbfd7a024c8acfE> + 8000747a: a009 j 8000747c <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h472d74790cb24d84E+0x12> + } + 8000747c: 60a2 ld ra,8(sp) + 8000747e: 0141 addi sp,sp,16 + 80007480: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h5c638f5071dc4adaE: + +0000000080007482 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h5c638f5071dc4adaE>: + fn drop(&mut self){ + 80007482: 1141 addi sp,sp,-16 + 80007484: e406 sd ra,8(sp) + 80007486: e02a sd a0,0(sp) + self.spinlock.release() + 80007488: 6108 ld a0,0(a0) + 8000748a: 0000a097 auipc ra,0xa + 8000748e: f8e080e7 jalr -114(ra) # 80011418 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h84d22e527c35405fE> + 80007492: a009 j 80007494 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h5c638f5071dc4adaE+0x12> + } + 80007494: 60a2 ld ra,8(sp) + 80007496: 0141 addi sp,sp,16 + 80007498: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h821d547a3c969c60E: + +000000008000749a <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h821d547a3c969c60E>: + fn drop(&mut self){ + 8000749a: 1141 addi sp,sp,-16 + 8000749c: e406 sd ra,8(sp) + 8000749e: e02a sd a0,0(sp) + self.spinlock.release() + 800074a0: 6108 ld a0,0(a0) + 800074a2: 0000a097 auipc ra,0xa + 800074a6: 23e080e7 jalr 574(ra) # 800116e0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfda5e7f2f4cdedb7E> + 800074aa: a009 j 800074ac <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17h821d547a3c969c60E+0x12> + } + 800074ac: 60a2 ld ra,8(sp) + 800074ae: 0141 addi sp,sp,16 + 800074b0: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb3b00b618040e227E: + +00000000800074b2 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb3b00b618040e227E>: + fn drop(&mut self){ + 800074b2: 1141 addi sp,sp,-16 + 800074b4: e406 sd ra,8(sp) + 800074b6: e02a sd a0,0(sp) + self.spinlock.release() + 800074b8: 6108 ld a0,0(a0) + 800074ba: 0000a097 auipc ra,0xa + 800074be: 174080e7 jalr 372(ra) # 8001162e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hdd8465c64dcbee95E> + 800074c2: a009 j 800074c4 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hb3b00b618040e227E+0x12> + } + 800074c4: 60a2 ld ra,8(sp) + 800074c6: 0141 addi sp,sp,16 + 800074c8: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hbd0d5c90a46c79b0E: + +00000000800074ca <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hbd0d5c90a46c79b0E>: + fn drop(&mut self){ + 800074ca: 1141 addi sp,sp,-16 + 800074cc: e406 sd ra,8(sp) + 800074ce: e02a sd a0,0(sp) + self.spinlock.release() + 800074d0: 6108 ld a0,0(a0) + 800074d2: 0000a097 auipc ra,0xa + 800074d6: ff8080e7 jalr -8(ra) # 800114ca <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hb6d563787d966a77E> + 800074da: a009 j 800074dc <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hbd0d5c90a46c79b0E+0x12> + } + 800074dc: 60a2 ld ra,8(sp) + 800074de: 0141 addi sp,sp,16 + 800074e0: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc0ab90800bd26fd3E: + +00000000800074e2 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc0ab90800bd26fd3E>: + fn drop(&mut self){ + 800074e2: 1141 addi sp,sp,-16 + 800074e4: e406 sd ra,8(sp) + 800074e6: e02a sd a0,0(sp) + self.spinlock.release() + 800074e8: 6108 ld a0,0(a0) + 800074ea: 0000a097 auipc ra,0xa + 800074ee: dca080e7 jalr -566(ra) # 800112b4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h7f531b2c66469855E> + 800074f2: a009 j 800074f4 <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc0ab90800bd26fd3E+0x12> + } + 800074f4: 60a2 ld ra,8(sp) + 800074f6: 0141 addi sp,sp,16 + 800074f8: 8082 ret + +Disassembly of section .text._ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc6fa91bad8825bc2E: + +00000000800074fa <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc6fa91bad8825bc2E>: + fn drop(&mut self){ + 800074fa: 1141 addi sp,sp,-16 + 800074fc: e406 sd ra,8(sp) + 800074fe: e02a sd a0,0(sp) + self.spinlock.release() + 80007500: 6108 ld a0,0(a0) + 80007502: 0000a097 auipc ra,0xa + 80007506: e64080e7 jalr -412(ra) # 80011366 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h8041517806e423d6E> + 8000750a: a009 j 8000750c <_ZN88_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hc6fa91bad8825bc2E+0x12> + } + 8000750c: 60a2 ld ra,8(sp) + 8000750e: 0141 addi sp,sp,16 + 80007510: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17ha2d42db7f65900b8E: + +0000000080007512 <_ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17ha2d42db7f65900b8E>: +} + +impl<'a, T: ?Sized> Drop for SleepLockGuard<'a, T> { + /// The dropping of the SpinLockGuard will call spinlock's release_lock(), + /// through its reference to its original spinlock. + fn drop(&mut self) { + 80007512: 1141 addi sp,sp,-16 + 80007514: e406 sd ra,8(sp) + 80007516: e02a sd a0,0(sp) + self.lock.unlock(); + 80007518: 6108 ld a0,0(a0) + 8000751a: 00017097 auipc ra,0x17 + 8000751e: e7e080e7 jalr -386(ra) # 8001e398 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h4136b26b6a44129dE> + 80007522: a009 j 80007524 <_ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17ha2d42db7f65900b8E+0x12> + } + 80007524: 60a2 ld ra,8(sp) + 80007526: 0141 addi sp,sp,16 + 80007528: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hd4f2db8ec388cdc1E: + +000000008000752a <_ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hd4f2db8ec388cdc1E>: + fn drop(&mut self) { + 8000752a: 1141 addi sp,sp,-16 + 8000752c: e406 sd ra,8(sp) + 8000752e: e02a sd a0,0(sp) + self.lock.unlock(); + 80007530: 6108 ld a0,0(a0) + 80007532: 00017097 auipc ra,0x17 + 80007536: eae080e7 jalr -338(ra) # 8001e3e0 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h5d72a4d2b4e61b31E> + 8000753a: a009 j 8000753c <_ZN90_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$4drop17hd4f2db8ec388cdc1E+0x12> + } + 8000753c: 60a2 ld ra,8(sp) + 8000753e: 0141 addi sp,sp,16 + 80007540: 8082 ret + +Disassembly of section .text._ZN62_$LT$kernel..fs..bio..Buf$u20$as$u20$core..ops..drop..Drop$GT$4drop17hae787f8a28b7a10dE: + +0000000080007542 <_ZN62_$LT$kernel..fs..bio..Buf$u20$as$u20$core..ops..drop..Drop$GT$4drop17hae787f8a28b7a10dE>: + fn drop(&mut self) { + 80007542: 7179 addi sp,sp,-48 + 80007544: f406 sd ra,40(sp) + 80007546: e42a sd a0,8(sp) + 80007548: f02a sd a0,32(sp) + drop(self.data.take()); + 8000754a: 0541 addi a0,a0,16 + 8000754c: 00008097 auipc ra,0x8 + 80007550: aa0080e7 jalr -1376(ra) # 8000efec <_ZN4core6option15Option$LT$T$GT$4take17h80340c04cecd09beE> + 80007554: e82a sd a0,16(sp) + 80007556: ec2e sd a1,24(sp) + 80007558: a009 j 8000755a <_ZN62_$LT$kernel..fs..bio..Buf$u20$as$u20$core..ops..drop..Drop$GT$4drop17hae787f8a28b7a10dE+0x18> + 8000755a: 65e2 ld a1,24(sp) + 8000755c: 6542 ld a0,16(sp) + 8000755e: 00017097 auipc ra,0x17 + 80007562: 944080e7 jalr -1724(ra) # 8001dea2 <_ZN4core3mem4drop17h8377f059e38e21aaE> + 80007566: a009 j 80007568 <_ZN62_$LT$kernel..fs..bio..Buf$u20$as$u20$core..ops..drop..Drop$GT$4drop17hae787f8a28b7a10dE+0x26> + BCACHE.brelse(self.index); + 80007568: 6522 ld a0,8(sp) + 8000756a: 610c ld a1,0(a0) + +000000008000756c <.LBB55_4>: + 8000756c: 00029517 auipc a0,0x29 + 80007570: a9450513 addi a0,a0,-1388 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 80007574: ffffc097 auipc ra,0xffffc + 80007578: 1f6080e7 jalr 502(ra) # 8000376a <_ZN6kernel2fs3bio6Bcache6brelse17hc59c97ea45d16b39E> + 8000757c: a009 j 8000757e <.LBB55_4+0x12> + } + 8000757e: 70a2 ld ra,40(sp) + 80007580: 6145 addi sp,sp,48 + 80007582: 8082 ret + +Disassembly of section .text._ZN66_$LT$kernel..fs..inode..Inode$u20$as$u20$core..ops..drop..Drop$GT$4drop17h624968f150cac4e7E: + +0000000080007584 <_ZN66_$LT$kernel..fs..inode..Inode$u20$as$u20$core..ops..drop..Drop$GT$4drop17h624968f150cac4e7E>: + +impl Drop for Inode { + /// Done with this inode. + /// If this is the last reference in the inode cache, then is might be recycled. + /// Further, if this inode has no links anymore, free this inode in the disk. + fn drop(&mut self) { + 80007584: 1141 addi sp,sp,-16 + 80007586: e406 sd ra,8(sp) + 80007588: 85aa mv a1,a0 + 8000758a: e02e sd a1,0(sp) + +000000008000758c <.LBB56_2>: + ICACHE.put(self) + 8000758c: 00054517 auipc a0,0x54 + 80007590: ff450513 addi a0,a0,-12 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 80007594: 00012097 auipc ra,0x12 + 80007598: 23c080e7 jalr 572(ra) # 800197d0 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE> + 8000759c: a009 j 8000759e <.LBB56_2+0x12> + } + 8000759e: 60a2 ld ra,8(sp) + 800075a0: 0141 addi sp,sp,16 + 800075a2: 8082 ret + +Disassembly of section .text._ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Add$GT$3add17hc13ca841e8f8e9ddE: + +00000000800075a4 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Add$GT$3add17hc13ca841e8f8e9ddE>: + #[stable(feature = "rust1", since = "1.0.0")] + impl Add for Wrapping<$t> { + type Output = Wrapping<$t>; + + #[inline] + fn add(self, other: Wrapping<$t>) -> Wrapping<$t> { + 800075a4: 7179 addi sp,sp,-48 + 800075a6: f406 sd ra,40(sp) + 800075a8: ec2a sd a0,24(sp) + 800075aa: f02e sd a1,32(sp) + Wrapping(self.0.wrapping_add(other.0)) + 800075ac: 00018097 auipc ra,0x18 + 800075b0: 9b4080e7 jalr -1612(ra) # 8001ef60 <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_add17he0ea74277f4c06b1E> + 800075b4: e42a sd a0,8(sp) + 800075b6: a009 j 800075b8 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Add$GT$3add17hc13ca841e8f8e9ddE+0x14> + 800075b8: 6522 ld a0,8(sp) + 800075ba: e82a sd a0,16(sp) + } + 800075bc: 70a2 ld ra,40(sp) + 800075be: 6145 addi sp,sp,48 + 800075c0: 8082 ret + +Disassembly of section .text._ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Sub$GT$3sub17h09c98f8a3aa1050aE: + +00000000800075c2 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Sub$GT$3sub17h09c98f8a3aa1050aE>: + #[stable(feature = "rust1", since = "1.0.0")] + impl Sub for Wrapping<$t> { + type Output = Wrapping<$t>; + + #[inline] + fn sub(self, other: Wrapping<$t>) -> Wrapping<$t> { + 800075c2: 7179 addi sp,sp,-48 + 800075c4: f406 sd ra,40(sp) + 800075c6: ec2a sd a0,24(sp) + 800075c8: f02e sd a1,32(sp) + Wrapping(self.0.wrapping_sub(other.0)) + 800075ca: 00018097 auipc ra,0x18 + 800075ce: 9a2080e7 jalr -1630(ra) # 8001ef6c <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_sub17h8f077bf007d122c9E> + 800075d2: e42a sd a0,8(sp) + 800075d4: a009 j 800075d6 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Sub$GT$3sub17h09c98f8a3aa1050aE+0x14> + 800075d6: 6522 ld a0,8(sp) + 800075d8: e82a sd a0,16(sp) + } + 800075da: 70a2 ld ra,40(sp) + 800075dc: 6145 addi sp,sp,48 + 800075de: 8082 ret + +Disassembly of section .text._ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..AddAssign$GT$10add_assign17hc731864567f3481aE: + +00000000800075e0 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..AddAssign$GT$10add_assign17hc731864567f3481aE>: + fn add_assign(&mut self, other: Wrapping<$t>) { + 800075e0: 7179 addi sp,sp,-48 + 800075e2: f406 sd ra,40(sp) + 800075e4: e42a sd a0,8(sp) + 800075e6: ec2a sd a0,24(sp) + 800075e8: f02e sd a1,32(sp) + *self = *self + other; + 800075ea: 6108 ld a0,0(a0) + 800075ec: 00000097 auipc ra,0x0 + 800075f0: fb8080e7 jalr -72(ra) # 800075a4 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Add$GT$3add17hc13ca841e8f8e9ddE> + 800075f4: e82a sd a0,16(sp) + 800075f6: a009 j 800075f8 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..AddAssign$GT$10add_assign17hc731864567f3481aE+0x18> + 800075f8: 6542 ld a0,16(sp) + 800075fa: 65a2 ld a1,8(sp) + 800075fc: e188 sd a0,0(a1) + } + 800075fe: 70a2 ld ra,40(sp) + 80007600: 6145 addi sp,sp,48 + 80007602: 8082 ret + +Disassembly of section .text._ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..SubAssign$GT$10sub_assign17h67a53f3fa0ccb70bE: + +0000000080007604 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..SubAssign$GT$10sub_assign17h67a53f3fa0ccb70bE>: + #[stable(feature = "wrapping_ref", since = "1.14.0")] } + + #[stable(feature = "op_assign_traits", since = "1.8.0")] + impl SubAssign for Wrapping<$t> { + #[inline] + fn sub_assign(&mut self, other: Wrapping<$t>) { + 80007604: 7179 addi sp,sp,-48 + 80007606: f406 sd ra,40(sp) + 80007608: e42a sd a0,8(sp) + 8000760a: ec2a sd a0,24(sp) + 8000760c: f02e sd a1,32(sp) + *self = *self - other; + 8000760e: 6108 ld a0,0(a0) + 80007610: 00000097 auipc ra,0x0 + 80007614: fb2080e7 jalr -78(ra) # 800075c2 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Sub$GT$3sub17h09c98f8a3aa1050aE> + 80007618: e82a sd a0,16(sp) + 8000761a: a009 j 8000761c <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..SubAssign$GT$10sub_assign17h67a53f3fa0ccb70bE+0x18> + 8000761c: 6542 ld a0,16(sp) + 8000761e: 65a2 ld a1,8(sp) + 80007620: e188 sd a0,0(a1) + } + 80007622: 70a2 ld ra,40(sp) + 80007624: 6145 addi sp,sp,48 + 80007626: 8082 ret + +Disassembly of section .text._ZN6kernel4misc3min17he96917d05b11cd47E: + +0000000080007628 <_ZN6kernel4misc3min17he96917d05b11cd47E>: +use core::ptr::read; +use core::cmp::Ord; +use core::ptr::{ write, write_bytes }; + +pub fn min(a: T, b: T) -> T + 80007628: 7179 addi sp,sp,-48 + 8000762a: f406 sd ra,40(sp) + 8000762c: e82a sd a0,16(sp) + 8000762e: ec2e sd a1,24(sp) + 80007630: 0808 addi a0,sp,16 + 80007632: 082c addi a1,sp,24 + where T: Ord +{ + if a < b { + 80007634: 00015097 auipc ra,0x15 + 80007638: f8c080e7 jalr -116(ra) # 8001c5c0 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha09858e1dc8f460eE> + 8000763c: e42a sd a0,8(sp) + 8000763e: a009 j 80007640 <_ZN6kernel4misc3min17he96917d05b11cd47E+0x18> + 80007640: 6522 ld a0,8(sp) + 80007642: 4581 li a1,0 + 80007644: 00b50663 beq a0,a1,80007650 <_ZN6kernel4misc3min17he96917d05b11cd47E+0x28> + 80007648: a009 j 8000764a <_ZN6kernel4misc3min17he96917d05b11cd47E+0x22> + return a + 8000764a: 6542 ld a0,16(sp) + 8000764c: f02a sd a0,32(sp) + } + b +} + 8000764e: a021 j 80007656 <_ZN6kernel4misc3min17he96917d05b11cd47E+0x2e> + b + 80007650: 6562 ld a0,24(sp) + 80007652: f02a sd a0,32(sp) +} + 80007654: a009 j 80007656 <_ZN6kernel4misc3min17he96917d05b11cd47E+0x2e> + 80007656: 7502 ld a0,32(sp) + 80007658: 70a2 ld ra,40(sp) + 8000765a: 6145 addi sp,sp,48 + 8000765c: 8082 ret + +Disassembly of section .text._ZN6kernel2fs10superblock10SuperBlock4init17hd314ea22bd8e6757E: + +000000008000765e <_ZN6kernel2fs10superblock10SuperBlock4init17hd314ea22bd8e6757E>: + } + } + + /// Read and init the super block from disk into memory. + /// SAFETY: it should only be called by the first regular process alone. + pub unsafe fn init(&mut self, dev: u32) { + 8000765e: 7125 addi sp,sp,-416 + 80007660: ef06 sd ra,408(sp) + 80007662: ecaa sd a0,88(sp) + 80007664: 862e mv a2,a1 + 80007666: f0b2 sd a2,96(sp) + 80007668: eeaa sd a0,344(sp) + 8000766a: 16b12223 sw a1,356(sp) + 8000766e: 4521 li a0,8 + 80007670: f4aa sd a0,104(sp) + 80007672: feaa sd a0,376(sp) + debug_assert_eq!(mem::align_of::() % mem::align_of::(), 0); + 80007674: a009 j 80007676 <_ZN6kernel2fs10superblock10SuperBlock4init17hd314ea22bd8e6757E+0x18> + 80007676: 4511 li a0,4 + 80007678: e8aa sd a0,80(sp) + 8000767a: eb2a sd a0,400(sp) + 8000767c: a009 j 8000767e <_ZN6kernel2fs10superblock10SuperBlock4init17hd314ea22bd8e6757E+0x20> + 8000767e: 6546 ld a0,80(sp) + 80007680: 4581 li a1,0 + 80007682: 18b50763 beq a0,a1,80007810 <.LBB0_31> + 80007686: a009 j 80007688 <_ZN6kernel2fs10superblock10SuperBlock4init17hd314ea22bd8e6757E+0x2a> + 80007688: 7526 ld a0,104(sp) + 8000768a: 65c6 ld a1,80(sp) + 8000768c: 02b57533 remu a0,a0,a1 + 80007690: e52a sd a0,136(sp) + 80007692: 0130 addi a2,sp,136 + 80007694: e0b2 sd a2,64(sp) + 80007696: fcb2 sd a2,120(sp) + +0000000080007698 <.LBB0_23>: + 80007698: 00020597 auipc a1,0x20 + 8000769c: 1c058593 addi a1,a1,448 # 80027858 <.L__unnamed_6+0xc8> + 800076a0: e4ae sd a1,72(sp) + 800076a2: e12e sd a1,128(sp) + 800076a4: f6b2 sd a2,360(sp) + 800076a6: faae sd a1,368(sp) + 800076a8: 4581 li a1,0 + 800076aa: 02b50363 beq a0,a1,800076d0 <.LBB0_24+0x14> + 800076ae: a009 j 800076b0 <.LBB0_23+0x18> + 800076b0: 6626 ld a2,72(sp) + 800076b2: 6586 ld a1,64(sp) + 800076b4: 4501 li a0,0 + 800076b6: 08a10ba3 sb a0,151(sp) + 800076ba: ed2a sd a0,152(sp) + +00000000800076bc <.LBB0_24>: + 800076bc: 00020717 auipc a4,0x20 + 800076c0: 72470713 addi a4,a4,1828 # 80027de0 <.L__unnamed_2> + 800076c4: 0934 addi a3,sp,152 + 800076c6: 00019097 auipc ra,0x19 + 800076ca: 1ac080e7 jalr 428(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 800076ce: 0000 unimp + if self.initialized.load(Ordering::Relaxed) { + 800076d0: 6566 ld a0,88(sp) + 800076d2: 02050513 addi a0,a0,32 + 800076d6: 4581 li a1,0 + 800076d8: 0cb107a3 sb a1,207(sp) + 800076dc: ffffd097 auipc ra,0xffffd + 800076e0: 02a080e7 jalr 42(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 800076e4: fc2a sd a0,56(sp) + 800076e6: a009 j 800076e8 <.LBB0_24+0x2c> + 800076e8: 7562 ld a0,56(sp) + 800076ea: 4581 li a1,0 + 800076ec: 00b50463 beq a0,a1,800076f4 <.LBB0_24+0x38> + 800076f0: a009 j 800076f2 <.LBB0_24+0x36> + self.initialized.store(true, Ordering::SeqCst); + drop(buf); + + #[cfg(feature = "verbose_init_info")] + println!("super block data: {:?}", self.data.as_ptr().as_ref().unwrap()); + } + 800076f2: aa21 j 8000780a <.LBB0_30+0x4e> + let buf = BCACHE.bread(dev, 1); + 800076f4: 7606 ld a2,96(sp) + +00000000800076f6 <.LBB0_25>: + 800076f6: 00029597 auipc a1,0x29 + 800076fa: 90a58593 addi a1,a1,-1782 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 800076fe: 0988 addi a0,sp,208 + 80007700: 4685 li a3,1 + 80007702: ffffc097 auipc ra,0xffffc + 80007706: f92080e7 jalr -110(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 8000770a: a009 j 8000770c <.LBB0_25+0x16> + 8000770c: 0988 addi a0,sp,208 + buf.raw_data() as *const RawSuperBlock, + 8000770e: ffffc097 auipc ra,0xffffc + 80007712: 0cc080e7 jalr 204(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 80007716: f82a sd a0,48(sp) + 80007718: a009 j 8000771a <.LBB0_25+0x24> + 8000771a: 6566 ld a0,88(sp) + 8000771c: 75c2 ld a1,48(sp) + 8000771e: f02e sd a1,32(sp) + 80007720: e72a sd a0,392(sp) + self.data.as_mut_ptr(), + 80007722: f42a sd a0,40(sp) + 80007724: a009 j 80007726 <.LBB0_25+0x30> + ptr::copy_nonoverlapping( + 80007726: 75a2 ld a1,40(sp) + 80007728: 7502 ld a0,32(sp) + 8000772a: 4d50 lw a2,28(a0) + 8000772c: cdd0 sw a2,28(a1) + 8000772e: 4d10 lw a2,24(a0) + 80007730: cd90 sw a2,24(a1) + 80007732: 4950 lw a2,20(a0) + 80007734: c9d0 sw a2,20(a1) + 80007736: 4910 lw a2,16(a0) + 80007738: c990 sw a2,16(a1) + 8000773a: 4550 lw a2,12(a0) + 8000773c: c5d0 sw a2,12(a1) + 8000773e: 4510 lw a2,8(a0) + 80007740: c590 sw a2,8(a1) + 80007742: 4150 lw a2,4(a0) + 80007744: c1d0 sw a2,4(a1) + 80007746: 4108 lw a0,0(a0) + 80007748: c188 sw a0,0(a1) + +000000008000774a <.LBB0_26>: + println!("check magic number"); + 8000774a: 00020597 auipc a1,0x20 + 8000774e: 6c658593 addi a1,a1,1734 # 80027e10 <.L__unnamed_3> + +0000000080007752 <.LBB0_27>: + 80007752: 00020697 auipc a3,0x20 + 80007756: 6ce68693 addi a3,a3,1742 # 80027e20 <.L__unnamed_5> + 8000775a: 19a8 addi a0,sp,248 + 8000775c: 4605 li a2,1 + 8000775e: 4701 li a4,0 + 80007760: ffffe097 auipc ra,0xffffe + 80007764: e2a080e7 jalr -470(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80007768: a009 j 8000776a <.LBB0_27+0x18> + 8000776a: 19a8 addi a0,sp,248 + 8000776c: 00017097 auipc ra,0x17 + 80007770: 48c080e7 jalr 1164(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80007774: a009 j 80007776 <.LBB0_27+0x24> + 80007776: 6566 ld a0,88(sp) + 80007778: e32a sd a0,384(sp) + if self.data.as_ptr().as_ref().unwrap().magic != FSMAGIC { + 8000777a: ec2a sd a0,24(sp) + 8000777c: a009 j 8000777e <.LBB0_27+0x2c> + 8000777e: 6562 ld a0,24(sp) + 80007780: ffffc097 auipc ra,0xffffc + 80007784: 868080e7 jalr -1944(ra) # 80002fe8 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E> + 80007788: e82a sd a0,16(sp) + 8000778a: a009 j 8000778c <.LBB0_27+0x3a> + 8000778c: 6542 ld a0,16(sp) + +000000008000778e <.LBB0_28>: + 8000778e: 00020597 auipc a1,0x20 + 80007792: 69258593 addi a1,a1,1682 # 80027e20 <.L__unnamed_5> + 80007796: 00008097 auipc ra,0x8 + 8000779a: fc4080e7 jalr -60(ra) # 8000f75a <_ZN4core6option15Option$LT$T$GT$6unwrap17hcaa2b543d69df090E> + 8000779e: e42a sd a0,8(sp) + 800077a0: a009 j 800077a2 <.LBB0_28+0x14> + 800077a2: 6522 ld a0,8(sp) + 800077a4: 4108 lw a0,0(a0) + 800077a6: 102035b7 lui a1,0x10203 + 800077aa: 0405859b addiw a1,a1,64 + 800077ae: 02b50163 beq a0,a1,800077d0 <.LBB0_30+0x14> + 800077b2: a009 j 800077b4 <.LBB0_29> + +00000000800077b4 <.LBB0_29>: + panic!("invalid file system magic num"); + 800077b4: 00020517 auipc a0,0x20 + 800077b8: 68450513 addi a0,a0,1668 # 80027e38 <.L__unnamed_6> + +00000000800077bc <.LBB0_30>: + 800077bc: 00020617 auipc a2,0x20 + 800077c0: 69c60613 addi a2,a2,1692 # 80027e58 <.L__unnamed_7> + 800077c4: 45f5 li a1,29 + 800077c6: 0001c097 auipc ra,0x1c + 800077ca: 97e080e7 jalr -1666(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800077ce: 0000 unimp + self.initialized.store(true, Ordering::SeqCst); + 800077d0: 6566 ld a0,88(sp) + 800077d2: 02050513 addi a0,a0,32 + 800077d6: 4611 li a2,4 + 800077d8: 12c107a3 sb a2,303(sp) + 800077dc: 4585 li a1,1 + 800077de: ffffd097 auipc ra,0xffffd + 800077e2: fa6080e7 jalr -90(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 800077e6: a009 j 800077e8 <.LBB0_30+0x2c> + drop(buf); + 800077e8: 754e ld a0,240(sp) + 800077ea: eaaa sd a0,336(sp) + 800077ec: 752e ld a0,232(sp) + 800077ee: e6aa sd a0,328(sp) + 800077f0: 750e ld a0,224(sp) + 800077f2: e2aa sd a0,320(sp) + 800077f4: 656e ld a0,216(sp) + 800077f6: fe2a sd a0,312(sp) + 800077f8: 654e ld a0,208(sp) + 800077fa: fa2a sd a0,304(sp) + 800077fc: 1a08 addi a0,sp,304 + 800077fe: 00016097 auipc ra,0x16 + 80007802: 720080e7 jalr 1824(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 80007806: a009 j 80007808 <.LBB0_30+0x4c> + } + 80007808: a009 j 8000780a <.LBB0_30+0x4e> + 8000780a: 60fa ld ra,408(sp) + 8000780c: 611d addi sp,sp,416 + 8000780e: 8082 ret + +0000000080007810 <.LBB0_31>: + debug_assert_eq!(mem::align_of::() % mem::align_of::(), 0); + 80007810: 00020517 auipc a0,0x20 + 80007814: 59050513 addi a0,a0,1424 # 80027da0 + +0000000080007818 <.LBB0_32>: + 80007818: 00020617 auipc a2,0x20 + 8000781c: 57060613 addi a2,a2,1392 # 80027d88 <.L__unnamed_8> + 80007820: 03900593 li a1,57 + 80007824: 0001c097 auipc ra,0x1c + 80007828: 920080e7 jalr -1760(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE: + +000000008000782e <_ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE>: + + /// Read the info of super block. + fn read(&self) -> &RawSuperBlock { + 8000782e: 715d addi sp,sp,-80 + 80007830: e486 sd ra,72(sp) + 80007832: f02a sd a0,32(sp) + 80007834: fc2a sd a0,56(sp) + debug_assert!(self.initialized.load(Ordering::Relaxed)); + 80007836: 02050513 addi a0,a0,32 + 8000783a: 4581 li a1,0 + 8000783c: 02b10ba3 sb a1,55(sp) + 80007840: ffffd097 auipc ra,0xffffd + 80007844: ec6080e7 jalr -314(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 80007848: f42a sd a0,40(sp) + 8000784a: a009 j 8000784c <_ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE+0x1e> + 8000784c: 7522 ld a0,40(sp) + 8000784e: e10d bnez a0,80007870 <.LBB1_8+0x16> + 80007850: a009 j 80007852 <.LBB1_7> + +0000000080007852 <.LBB1_7>: + 80007852: 00020517 auipc a0,0x20 + 80007856: 61e50513 addi a0,a0,1566 # 80027e70 <.L__unnamed_9> + +000000008000785a <.LBB1_8>: + 8000785a: 00020617 auipc a2,0x20 + 8000785e: 65660613 addi a2,a2,1622 # 80027eb0 <.L__unnamed_10> + 80007862: 03a00593 li a1,58 + 80007866: 0001c097 auipc ra,0x1c + 8000786a: 8de080e7 jalr -1826(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000786e: 0000 unimp + 80007870: 7502 ld a0,32(sp) + 80007872: e0aa sd a0,64(sp) + unsafe { + self.data.as_ptr().as_ref().unwrap() + 80007874: ec2a sd a0,24(sp) + 80007876: a009 j 80007878 <.LBB1_8+0x1e> + 80007878: 6562 ld a0,24(sp) + 8000787a: ffffb097 auipc ra,0xffffb + 8000787e: 76e080e7 jalr 1902(ra) # 80002fe8 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17he2102635824876d2E> + 80007882: e82a sd a0,16(sp) + 80007884: a009 j 80007886 <.LBB1_8+0x2c> + 80007886: 6542 ld a0,16(sp) + +0000000080007888 <.LBB1_9>: + 80007888: 00020597 auipc a1,0x20 + 8000788c: 64058593 addi a1,a1,1600 # 80027ec8 <.L__unnamed_11> + 80007890: 00008097 auipc ra,0x8 + 80007894: eca080e7 jalr -310(ra) # 8000f75a <_ZN4core6option15Option$LT$T$GT$6unwrap17hcaa2b543d69df090E> + 80007898: e42a sd a0,8(sp) + 8000789a: a009 j 8000789c <.LBB1_9+0x14> + } + } + 8000789c: 6522 ld a0,8(sp) + 8000789e: 60a6 ld ra,72(sp) + 800078a0: 6161 addi sp,sp,80 + 800078a2: 8082 ret + +Disassembly of section .text._ZN6kernel2fs10superblock10SuperBlock8read_log17h7cc8d407eaa9ef0fE: + +00000000800078a4 <_ZN6kernel2fs10superblock10SuperBlock8read_log17h7cc8d407eaa9ef0fE>: + + /// Load the log info of super block. + /// Return starting block and usable blocks for log. + pub fn read_log(&self) -> (u32, u32) { + 800078a4: 7179 addi sp,sp,-48 + 800078a6: f406 sd ra,40(sp) + 800078a8: ec2a sd a0,24(sp) + let sb = self.read(); + 800078aa: 00000097 auipc ra,0x0 + 800078ae: f84080e7 jalr -124(ra) # 8000782e <_ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE> + 800078b2: 85aa mv a1,a0 + 800078b4: e42e sd a1,8(sp) + 800078b6: f02a sd a0,32(sp) + 800078b8: a009 j 800078ba <_ZN6kernel2fs10superblock10SuperBlock8read_log17h7cc8d407eaa9ef0fE+0x16> + (sb.logstart, sb.nlog) + 800078ba: 65a2 ld a1,8(sp) + 800078bc: 49c8 lw a0,20(a1) + 800078be: 498c lw a1,16(a1) + 800078c0: c82a sw a0,16(sp) + 800078c2: ca2e sw a1,20(sp) + } + 800078c4: 70a2 ld ra,40(sp) + 800078c6: 6145 addi sp,sp,48 + 800078c8: 8082 ret + +Disassembly of section .text._ZN6kernel2fs10superblock10SuperBlock4size17hb3cee79658d4a223E: + +00000000800078ca <_ZN6kernel2fs10superblock10SuperBlock4size17hb3cee79658d4a223E>: + + /// The total count of blocks in the disk. + pub fn size(&self) -> u32 { + 800078ca: 1101 addi sp,sp,-32 + 800078cc: ec06 sd ra,24(sp) + 800078ce: e42a sd a0,8(sp) + let sb = self.read(); + 800078d0: 00000097 auipc ra,0x0 + 800078d4: f5e080e7 jalr -162(ra) # 8000782e <_ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE> + 800078d8: 85aa mv a1,a0 + 800078da: e02e sd a1,0(sp) + 800078dc: e82a sd a0,16(sp) + 800078de: a009 j 800078e0 <_ZN6kernel2fs10superblock10SuperBlock4size17hb3cee79658d4a223E+0x16> + sb.size + } + 800078e0: 6502 ld a0,0(sp) + 800078e2: 4148 lw a0,4(a0) + 800078e4: 60e2 ld ra,24(sp) + 800078e6: 6105 addi sp,sp,32 + 800078e8: 8082 ret + +Disassembly of section .text._ZN6kernel2fs10superblock10SuperBlock7ninodes17h32fa650b3c4991daE: + +00000000800078ea <_ZN6kernel2fs10superblock10SuperBlock7ninodes17h32fa650b3c4991daE>: + let sb = self.read(); + sb.bmapstart + } + + /// inode numbers + pub fn ninodes(&self) -> u32 { + 800078ea: 1101 addi sp,sp,-32 + 800078ec: ec06 sd ra,24(sp) + 800078ee: e82a sd a0,16(sp) + self.read().ninodes + 800078f0: 00000097 auipc ra,0x0 + 800078f4: f3e080e7 jalr -194(ra) # 8000782e <_ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE> + 800078f8: e42a sd a0,8(sp) + 800078fa: a009 j 800078fc <_ZN6kernel2fs10superblock10SuperBlock7ninodes17h32fa650b3c4991daE+0x12> + } + 800078fc: 6522 ld a0,8(sp) + 800078fe: 4548 lw a0,12(a0) + 80007900: 60e2 ld ra,24(sp) + 80007902: 6105 addi sp,sp,32 + 80007904: 8082 ret + +Disassembly of section .text._ZN6kernel2fs10superblock10SuperBlock12locate_inode17hc2dbfb20b9411e7cE: + +0000000080007906 <_ZN6kernel2fs10superblock10SuperBlock12locate_inode17hc2dbfb20b9411e7cE>: + + /// Given an inode number. + /// Return the blockno of the block this inode resides. + /// Panic if the queryed inode out of range. + pub fn locate_inode(&self, inum: u32) -> u32 { + 80007906: 7155 addi sp,sp,-208 + 80007908: e586 sd ra,200(sp) + 8000790a: de2e sw a1,60(sp) + 8000790c: f12a sd a0,160(sp) + let sb = self.read(); + 8000790e: 00000097 auipc ra,0x0 + 80007912: f20080e7 jalr -224(ra) # 8000782e <_ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE> + 80007916: 85aa mv a1,a0 + 80007918: f82e sd a1,48(sp) + 8000791a: f52a sd a0,168(sp) + 8000791c: a009 j 8000791e <_ZN6kernel2fs10superblock10SuperBlock12locate_inode17hc2dbfb20b9411e7cE+0x18> + if inum >= sb.ninodes { + 8000791e: 75c2 ld a1,48(sp) + 80007920: 5572 lw a0,60(sp) + 80007922: 45cc lw a1,12(a1) + 80007924: 02b56763 bltu a0,a1,80007952 <.LBB5_9+0x16> + 80007928: a009 j 8000792a <_ZN6kernel2fs10superblock10SuperBlock12locate_inode17hc2dbfb20b9411e7cE+0x24> + panic!("query inum {} larger than maximum inode nums {}", inum, sb.ninodes); + 8000792a: 7542 ld a0,48(sp) + 8000792c: 00c50593 addi a1,a0,12 + 80007930: ec2e sd a1,24(sp) + 80007932: 1868 addi a0,sp,60 + 80007934: e92a sd a0,144(sp) + 80007936: ed2e sd a1,152(sp) + 80007938: f92a sd a0,176(sp) + 8000793a: fd2e sd a1,184(sp) + +000000008000793c <.LBB5_9>: + 8000793c: 0001e597 auipc a1,0x1e + 80007940: da858593 addi a1,a1,-600 # 800256e4 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u32$GT$3fmt17h19c6429b08a072b1E> + 80007944: 0001b097 auipc ra,0x1b + 80007948: 58e080e7 jalr 1422(ra) # 80022ed2 <_ZN4core3fmt10ArgumentV13new17ha67f1954b9155e6dE> + 8000794c: f02a sd a0,32(sp) + 8000794e: f42e sd a1,40(sp) + 80007950: a839 j 8000796e <.LBB5_9+0x32> + } + // println!("[Debug] inum: {}", inum); + let blockno = (inum / (IPB as u32)) + sb.inodestart; + 80007952: 75c2 ld a1,48(sp) + 80007954: 03c16503 lwu a0,60(sp) + 80007958: 8111 srli a0,a0,0x4 + 8000795a: 0185e583 lwu a1,24(a1) + 8000795e: 95aa add a1,a1,a0 + 80007960: e82e sd a1,16(sp) + 80007962: 02059513 slli a0,a1,0x20 + 80007966: 9101 srli a0,a0,0x20 + 80007968: 06b51363 bne a0,a1,800079ce <.LBB5_13> + 8000796c: a8a1 j 800079c4 <.LBB5_12+0x14> + panic!("query inum {} larger than maximum inode nums {}", inum, sb.ninodes); + 8000796e: 6562 ld a0,24(sp) + +0000000080007970 <.LBB5_10>: + 80007970: 0001e597 auipc a1,0x1e + 80007974: d7458593 addi a1,a1,-652 # 800256e4 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u32$GT$3fmt17h19c6429b08a072b1E> + 80007978: 0001b097 auipc ra,0x1b + 8000797c: 55a080e7 jalr 1370(ra) # 80022ed2 <_ZN4core3fmt10ArgumentV13new17ha67f1954b9155e6dE> + 80007980: e02a sd a0,0(sp) + 80007982: e42e sd a1,8(sp) + 80007984: a009 j 80007986 <.LBB5_10+0x16> + 80007986: 6522 ld a0,8(sp) + 80007988: 6582 ld a1,0(sp) + 8000798a: 7622 ld a2,40(sp) + 8000798c: 7682 ld a3,32(sp) + 8000798e: f8b6 sd a3,112(sp) + 80007990: fcb2 sd a2,120(sp) + 80007992: e12e sd a1,128(sp) + 80007994: e52a sd a0,136(sp) + +0000000080007996 <.LBB5_11>: + 80007996: 00020597 auipc a1,0x20 + 8000799a: 55a58593 addi a1,a1,1370 # 80027ef0 <.L__unnamed_12> + 8000799e: 0088 addi a0,sp,64 + 800079a0: 1894 addi a3,sp,112 + 800079a2: 4709 li a4,2 + 800079a4: 863a mv a2,a4 + 800079a6: ffffe097 auipc ra,0xffffe + 800079aa: be4080e7 jalr -1052(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800079ae: a009 j 800079b0 <.LBB5_12> + +00000000800079b0 <.LBB5_12>: + 800079b0: 00020597 auipc a1,0x20 + 800079b4: 56058593 addi a1,a1,1376 # 80027f10 <.L__unnamed_13> + 800079b8: 0088 addi a0,sp,64 + 800079ba: 0001b097 auipc ra,0x1b + 800079be: 7f6080e7 jalr 2038(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 800079c2: 0000 unimp + let blockno = (inum / (IPB as u32)) + sb.inodestart; + 800079c4: 6542 ld a0,16(sp) + 800079c6: c3aa sw a0,196(sp) + // println!("[Debug] block number: {}", blockno); + blockno + } + 800079c8: 60ae ld ra,200(sp) + 800079ca: 6169 addi sp,sp,208 + 800079cc: 8082 ret + +00000000800079ce <.LBB5_13>: + let blockno = (inum / (IPB as u32)) + sb.inodestart; + 800079ce: 00020517 auipc a0,0x20 + 800079d2: 57250513 addi a0,a0,1394 # 80027f40 + +00000000800079d6 <.LBB5_14>: + 800079d6: 00020617 auipc a2,0x20 + 800079da: 55260613 addi a2,a2,1362 # 80027f28 <.L__unnamed_14> + 800079de: 45f1 li a1,28 + 800079e0: 0001b097 auipc ra,0x1b + 800079e4: 764080e7 jalr 1892(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs10superblock10SuperBlock14bitmap_blockno17h010142deb773804aE: + +00000000800079ea <_ZN6kernel2fs10superblock10SuperBlock14bitmap_blockno17h010142deb773804aE>: + + /// Given a block number in the disk. + /// Returns the relevant block number of the (controlling) bitmap block. + pub fn bitmap_blockno(&self, blockno: u32) -> u32 { + 800079ea: 7139 addi sp,sp,-64 + 800079ec: fc06 sd ra,56(sp) + 800079ee: 862e mv a2,a1 + 800079f0: e832 sd a2,16(sp) + 800079f2: f02a sd a0,32(sp) + 800079f4: d62e sw a1,44(sp) + let sb = self.read(); + 800079f6: 00000097 auipc ra,0x0 + 800079fa: e38080e7 jalr -456(ra) # 8000782e <_ZN6kernel2fs10superblock10SuperBlock4read17h8c393935916ac41aE> + 800079fe: 85aa mv a1,a0 + 80007a00: ec2e sd a1,24(sp) + 80007a02: f82a sd a0,48(sp) + 80007a04: a009 j 80007a06 <_ZN6kernel2fs10superblock10SuperBlock14bitmap_blockno17h010142deb773804aE+0x1c> + (blockno / BPB as u32) + sb.bmapstart + 80007a06: 65e2 ld a1,24(sp) + 80007a08: 6542 ld a0,16(sp) + 80007a0a: 00d5551b srliw a0,a0,0xd + 80007a0e: 01c5e583 lwu a1,28(a1) + 80007a12: 95aa add a1,a1,a0 + 80007a14: e42e sd a1,8(sp) + 80007a16: 02059513 slli a0,a1,0x20 + 80007a1a: 9101 srli a0,a0,0x20 + 80007a1c: 00b51763 bne a0,a1,80007a2a <.LBB6_4> + 80007a20: a009 j 80007a22 <_ZN6kernel2fs10superblock10SuperBlock14bitmap_blockno17h010142deb773804aE+0x38> + } + 80007a22: 6522 ld a0,8(sp) + 80007a24: 70e2 ld ra,56(sp) + 80007a26: 6121 addi sp,sp,64 + 80007a28: 8082 ret + +0000000080007a2a <.LBB6_4>: + (blockno / BPB as u32) + sb.bmapstart + 80007a2a: 00020517 auipc a0,0x20 + 80007a2e: 51650513 addi a0,a0,1302 # 80027f40 + +0000000080007a32 <.LBB6_5>: + 80007a32: 00020617 auipc a2,0x20 + 80007a36: 52e60613 addi a2,a2,1326 # 80027f60 <.L__unnamed_15> + 80007a3a: 45f1 li a1,28 + 80007a3c: 0001b097 auipc ra,0x1b + 80007a40: 708080e7 jalr 1800(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4arch5riscv8register7mhartid4read17hb0a253df4f0869d8E: + +0000000080007a46 <_ZN6kernel4arch5riscv8register7mhartid4read17hb0a253df4f0869d8E>: +// which hart (core) is this? +#[inline] +pub unsafe fn read() -> usize{ + 80007a46: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, mhartid":"=r"(ret):::"volatile"); + 80007a48: f1402573 csrr a0,mhartid + 80007a4c: e42a sd a0,8(sp) + ret + 80007a4e: 0141 addi sp,sp,16 + 80007a50: 8082 ret + +Disassembly of section .text._ZN6kernel4misc7str_len17h64928e428ab71413E: + +0000000080007a52 <_ZN6kernel4misc7str_len17h64928e428ab71413E>: + +pub fn str_len(str: *const u8) -> usize { + 80007a52: 715d addi sp,sp,-80 + 80007a54: e486 sd ra,72(sp) + 80007a56: f02a sd a0,32(sp) + 80007a58: f82a sd a0,48(sp) + 80007a5a: 4501 li a0,0 + let mut i:usize = 0; + 80007a5c: f42a sd a0,40(sp) + loop { + 80007a5e: a009 j 80007a60 <_ZN6kernel4misc7str_len17h64928e428ab71413E+0xe> + let ptr = (str as usize + i) as *const u8; + 80007a60: 7582 ld a1,32(sp) + 80007a62: 7522 ld a0,40(sp) + 80007a64: 952e add a0,a0,a1 + 80007a66: ec2a sd a0,24(sp) + 80007a68: 04b56363 bltu a0,a1,80007aae <.LBB0_9> + 80007a6c: a009 j 80007a6e <_ZN6kernel4misc7str_len17h64928e428ab71413E+0x1c> + 80007a6e: 6562 ld a0,24(sp) + 80007a70: fc2a sd a0,56(sp) + let c = unsafe { + read(ptr) + 80007a72: 00012097 auipc ra,0x12 + 80007a76: 980080e7 jalr -1664(ra) # 800193f2 <_ZN4core3ptr4read17h018161c0cd37b3fbE> + 80007a7a: 85aa mv a1,a0 + 80007a7c: e82e sd a1,16(sp) + 80007a7e: 04a103a3 sb a0,71(sp) + 80007a82: a009 j 80007a84 <_ZN6kernel4misc7str_len17h64928e428ab71413E+0x32> + }; + if c != 0 { i += 1; } + 80007a84: 6542 ld a0,16(sp) + 80007a86: 0ff57513 andi a0,a0,255 + 80007a8a: 4581 li a1,0 + 80007a8c: 00b50a63 beq a0,a1,80007aa0 <_ZN6kernel4misc7str_len17h64928e428ab71413E+0x4e> + 80007a90: a009 j 80007a92 <_ZN6kernel4misc7str_len17h64928e428ab71413E+0x40> + 80007a92: 75a2 ld a1,40(sp) + 80007a94: 00158513 addi a0,a1,1 + 80007a98: e42a sd a0,8(sp) + 80007a9a: 02b56863 bltu a0,a1,80007aca <.LBB0_11> + 80007a9e: a029 j 80007aa8 <_ZN6kernel4misc7str_len17h64928e428ab71413E+0x56> + else { break; } + } + i +} + 80007aa0: 7522 ld a0,40(sp) + 80007aa2: 60a6 ld ra,72(sp) + 80007aa4: 6161 addi sp,sp,80 + 80007aa6: 8082 ret + if c != 0 { i += 1; } + 80007aa8: 6522 ld a0,8(sp) + 80007aaa: f42a sd a0,40(sp) + loop { + 80007aac: bf55 j 80007a60 <_ZN6kernel4misc7str_len17h64928e428ab71413E+0xe> + +0000000080007aae <.LBB0_9>: + let ptr = (str as usize + i) as *const u8; + 80007aae: 00020517 auipc a0,0x20 + 80007ab2: 4f250513 addi a0,a0,1266 # 80027fa0 + +0000000080007ab6 <.LBB0_10>: + 80007ab6: 00020617 auipc a2,0x20 + 80007aba: 4d260613 addi a2,a2,1234 # 80027f88 <.L__unnamed_1> + 80007abe: 45f1 li a1,28 + 80007ac0: 0001b097 auipc ra,0x1b + 80007ac4: 684080e7 jalr 1668(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080007aca <.LBB0_11>: + if c != 0 { i += 1; } + 80007aca: 00020517 auipc a0,0x20 + 80007ace: 4d650513 addi a0,a0,1238 # 80027fa0 + +0000000080007ad2 <.LBB0_12>: + 80007ad2: 00020617 auipc a2,0x20 + 80007ad6: 4ee60613 addi a2,a2,1262 # 80027fc0 <.L__unnamed_2> + 80007ada: 45f1 li a1,28 + 80007adc: 0001b097 auipc ra,0x1b + 80007ae0: 668080e7 jalr 1640(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE: + +0000000080007ae6 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE>: + +/// memory copy, copy memory into other memory. +pub fn mem_copy(dst: usize, src: usize, len: usize) { + 80007ae6: 7131 addi sp,sp,-192 + 80007ae8: fd06 sd ra,184(sp) + 80007aea: f432 sd a2,40(sp) + 80007aec: 862e mv a2,a1 + 80007aee: 75a2 ld a1,40(sp) + 80007af0: f832 sd a2,48(sp) + 80007af2: 862a mv a2,a0 + 80007af4: 7542 ld a0,48(sp) + 80007af6: fc32 sd a2,56(sp) + 80007af8: e132 sd a2,128(sp) + 80007afa: e52a sd a0,136(sp) + 80007afc: e92e sd a1,144(sp) + 80007afe: 4501 li a0,0 + unsafe{ + for i in 0..len { + 80007b00: e8aa sd a0,80(sp) + 80007b02: ecae sd a1,88(sp) + 80007b04: 00019097 auipc ra,0x19 + 80007b08: d0c080e7 jalr -756(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80007b0c: e0aa sd a0,64(sp) + 80007b0e: e4ae sd a1,72(sp) + 80007b10: a009 j 80007b12 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x2c> + 80007b12: 6526 ld a0,72(sp) + 80007b14: 6586 ld a1,64(sp) + 80007b16: f0ae sd a1,96(sp) + 80007b18: f4aa sd a0,104(sp) + 80007b1a: a009 j 80007b1c <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x36> + 80007b1c: 1088 addi a0,sp,96 + 80007b1e: 00019097 auipc ra,0x19 + 80007b22: c84080e7 jalr -892(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80007b26: f8aa sd a0,112(sp) + 80007b28: fcae sd a1,120(sp) + 80007b2a: a009 j 80007b2c <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x46> + 80007b2c: 7546 ld a0,112(sp) + 80007b2e: 4581 li a1,0 + 80007b30: 00b50463 beq a0,a1,80007b38 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x52> + 80007b34: a009 j 80007b36 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x50> + 80007b36: a029 j 80007b40 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x5a> + let val = read((src + i) as *const u8); + write((dst + i) as *mut u8, val); + } + } +} + 80007b38: 70ea ld ra,184(sp) + 80007b3a: 6129 addi sp,sp,192 + 80007b3c: 8082 ret + for i in 0..len { + 80007b3e: 0000 unimp + 80007b40: 75c2 ld a1,48(sp) + 80007b42: 7566 ld a0,120(sp) + 80007b44: ec2a sd a0,24(sp) + 80007b46: ed2a sd a0,152(sp) + 80007b48: f12a sd a0,160(sp) + 80007b4a: f52a sd a0,168(sp) + let val = read((src + i) as *const u8); + 80007b4c: 952e add a0,a0,a1 + 80007b4e: f02a sd a0,32(sp) + 80007b50: 02b56c63 bltu a0,a1,80007b88 <.LBB1_14> + 80007b54: a009 j 80007b56 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x70> + 80007b56: 7502 ld a0,32(sp) + 80007b58: 00012097 auipc ra,0x12 + 80007b5c: 89a080e7 jalr -1894(ra) # 800193f2 <_ZN4core3ptr4read17h018161c0cd37b3fbE> + 80007b60: 85aa mv a1,a0 + 80007b62: e82e sd a1,16(sp) + 80007b64: 0aa10ba3 sb a0,183(sp) + 80007b68: a009 j 80007b6a <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x84> + write((dst + i) as *mut u8, val); + 80007b6a: 75e2 ld a1,56(sp) + 80007b6c: 6562 ld a0,24(sp) + 80007b6e: 952e add a0,a0,a1 + 80007b70: e42a sd a0,8(sp) + 80007b72: 02b56963 bltu a0,a1,80007ba4 <.LBB1_16> + 80007b76: a009 j 80007b78 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x92> + 80007b78: 65c2 ld a1,16(sp) + 80007b7a: 6522 ld a0,8(sp) + 80007b7c: 00012097 auipc ra,0x12 + 80007b80: b00080e7 jalr -1280(ra) # 8001967c <_ZN4core3ptr5write17h0fb1ba83ac2984c7E> + 80007b84: a009 j 80007b86 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0xa0> + for i in 0..len { + 80007b86: bf59 j 80007b1c <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE+0x36> + +0000000080007b88 <.LBB1_14>: + let val = read((src + i) as *const u8); + 80007b88: 00020517 auipc a0,0x20 + 80007b8c: 41850513 addi a0,a0,1048 # 80027fa0 + +0000000080007b90 <.LBB1_15>: + 80007b90: 00020617 auipc a2,0x20 + 80007b94: 44860613 addi a2,a2,1096 # 80027fd8 <.L__unnamed_3> + 80007b98: 45f1 li a1,28 + 80007b9a: 0001b097 auipc ra,0x1b + 80007b9e: 5aa080e7 jalr 1450(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080007ba4 <.LBB1_16>: + write((dst + i) as *mut u8, val); + 80007ba4: 00020517 auipc a0,0x20 + 80007ba8: 3fc50513 addi a0,a0,1020 # 80027fa0 + +0000000080007bac <.LBB1_17>: + 80007bac: 00020617 auipc a2,0x20 + 80007bb0: 44460613 addi a2,a2,1092 # 80027ff0 <.L__unnamed_4> + 80007bb4: 45f1 li a1,28 + 80007bb6: 0001b097 auipc ra,0x1b + 80007bba: 58e080e7 jalr 1422(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4misc7str_cmp17h91115d5ee259e480E: + +0000000080007bc0 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E>: + }; + dst +} + +/// Compare str +pub fn str_cmp(a: &[u8], b: &[u8], max_len: usize) -> bool { + 80007bc0: 7151 addi sp,sp,-240 + 80007bc2: f586 sd ra,232(sp) + 80007bc4: e0ba sd a4,64(sp) + 80007bc6: e4b6 sd a3,72(sp) + 80007bc8: e8b2 sd a2,80(sp) + 80007bca: ecae sd a1,88(sp) + 80007bcc: f0aa sd a0,96(sp) + 80007bce: f52a sd a0,168(sp) + 80007bd0: f92e sd a1,176(sp) + 80007bd2: fd32 sd a2,184(sp) + 80007bd4: e1b6 sd a3,192(sp) + 80007bd6: e5ba sd a4,200(sp) + if a.len() != b.len() { + 80007bd8: 00019097 auipc ra,0x19 + 80007bdc: 8ca080e7 jalr -1846(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80007be0: f4aa sd a0,104(sp) + 80007be2: a009 j 80007be4 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x24> + 80007be4: 65a6 ld a1,72(sp) + 80007be6: 6546 ld a0,80(sp) + 80007be8: 00019097 auipc ra,0x19 + 80007bec: 8ba080e7 jalr -1862(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80007bf0: fc2a sd a0,56(sp) + 80007bf2: a009 j 80007bf4 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x34> + 80007bf4: 7526 ld a0,104(sp) + 80007bf6: 75e2 ld a1,56(sp) + 80007bf8: 00b50763 beq a0,a1,80007c06 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x46> + 80007bfc: a009 j 80007bfe <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x3e> + 80007bfe: 4501 li a0,0 + return false + 80007c00: 06a10ba3 sb a0,119(sp) + 80007c04: a875 j 80007cc0 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x100> + } + + if a.len() > max_len { + 80007c06: 65e6 ld a1,88(sp) + 80007c08: 7506 ld a0,96(sp) + 80007c0a: 00019097 auipc ra,0x19 + 80007c0e: 898080e7 jalr -1896(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80007c12: f82a sd a0,48(sp) + 80007c14: a009 j 80007c16 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x56> + 80007c16: 6506 ld a0,64(sp) + 80007c18: 75c2 ld a1,48(sp) + 80007c1a: 00b57763 bgeu a0,a1,80007c28 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x68> + 80007c1e: a009 j 80007c20 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x60> + 80007c20: 4501 li a0,0 + return false + 80007c22: 06a10ba3 sb a0,119(sp) + 80007c26: a869 j 80007cc0 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x100> + } + + for i in 0..a.len() { + 80007c28: 65e6 ld a1,88(sp) + 80007c2a: 7506 ld a0,96(sp) + 80007c2c: 00019097 auipc ra,0x19 + 80007c30: 876080e7 jalr -1930(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80007c34: f42a sd a0,40(sp) + 80007c36: a009 j 80007c38 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x78> + 80007c38: 75a2 ld a1,40(sp) + 80007c3a: 4501 li a0,0 + 80007c3c: fcaa sd a0,120(sp) + 80007c3e: e12e sd a1,128(sp) + 80007c40: 00019097 auipc ra,0x19 + 80007c44: bd0080e7 jalr -1072(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80007c48: ec2a sd a0,24(sp) + 80007c4a: f02e sd a1,32(sp) + 80007c4c: a009 j 80007c4e <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x8e> + 80007c4e: 7502 ld a0,32(sp) + 80007c50: 65e2 ld a1,24(sp) + 80007c52: e52e sd a1,136(sp) + 80007c54: e92a sd a0,144(sp) + 80007c56: a009 j 80007c58 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x98> + 80007c58: 0128 addi a0,sp,136 + 80007c5a: 00019097 auipc ra,0x19 + 80007c5e: b48080e7 jalr -1208(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80007c62: ed2a sd a0,152(sp) + 80007c64: f12e sd a1,160(sp) + 80007c66: a009 j 80007c68 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xa8> + 80007c68: 656a ld a0,152(sp) + 80007c6a: 4581 li a1,0 + 80007c6c: 00b50463 beq a0,a1,80007c74 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xb4> + 80007c70: a009 j 80007c72 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xb2> + 80007c72: a031 j 80007c7e <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xbe> + 80007c74: 4505 li a0,1 + if a[i] != b[i] { + return false + } + } + true + 80007c76: 06a10ba3 sb a0,119(sp) + 80007c7a: a099 j 80007cc0 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x100> + for i in 0..a.len() { + 80007c7c: 0000 unimp + 80007c7e: 65e6 ld a1,88(sp) + 80007c80: 750a ld a0,160(sp) + 80007c82: e82a sd a0,16(sp) + 80007c84: e9aa sd a0,208(sp) + 80007c86: edaa sd a0,216(sp) + 80007c88: f1aa sd a0,224(sp) + if a[i] != b[i] { + 80007c8a: 04b57063 bgeu a0,a1,80007cca <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x10a> + 80007c8e: a009 j 80007c90 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xd0> + 80007c90: 6542 ld a0,16(sp) + 80007c92: 65a6 ld a1,72(sp) + 80007c94: 7606 ld a2,96(sp) + 80007c96: 962a add a2,a2,a0 + 80007c98: 00064603 lbu a2,0(a2) + 80007c9c: e432 sd a2,8(sp) + 80007c9e: 04b57163 bgeu a0,a1,80007ce0 <.LBB2_23+0x12> + 80007ca2: a009 j 80007ca4 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xe4> + 80007ca4: 6522 ld a0,8(sp) + 80007ca6: 65c6 ld a1,80(sp) + 80007ca8: 6642 ld a2,16(sp) + 80007caa: 95b2 add a1,a1,a2 + 80007cac: 0005c583 lbu a1,0(a1) + 80007cb0: 00b50763 beq a0,a1,80007cbe <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xfe> + 80007cb4: a009 j 80007cb6 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0xf6> + 80007cb6: 4501 li a0,0 + return false + 80007cb8: 06a10ba3 sb a0,119(sp) + 80007cbc: a011 j 80007cc0 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x100> + for i in 0..a.len() { + 80007cbe: bf69 j 80007c58 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E+0x98> + 80007cc0: 07714503 lbu a0,119(sp) + 80007cc4: 70ae ld ra,232(sp) + 80007cc6: 616d addi sp,sp,240 + 80007cc8: 8082 ret + if a[i] != b[i] { + 80007cca: 65e6 ld a1,88(sp) + 80007ccc: 6542 ld a0,16(sp) + +0000000080007cce <.LBB2_23>: + 80007cce: 00020617 auipc a2,0x20 + 80007cd2: 33a60613 addi a2,a2,826 # 80028008 <.L__unnamed_5> + 80007cd6: 0001b097 auipc ra,0x1b + 80007cda: 49a080e7 jalr 1178(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80007cde: 0000 unimp + 80007ce0: 65a6 ld a1,72(sp) + 80007ce2: 6542 ld a0,16(sp) + +0000000080007ce4 <.LBB2_24>: + 80007ce4: 00020617 auipc a2,0x20 + 80007ce8: 33c60613 addi a2,a2,828 # 80028020 <.L__unnamed_6> + 80007cec: 0001b097 auipc ra,0x1b + 80007cf0: 484080e7 jalr 1156(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel4arch5riscv8register6scause4read17h6f388cd664aa7885E: + +0000000080007cf6 <_ZN6kernel4arch5riscv8register6scause4read17h6f388cd664aa7885E>: +use bit_field::BitField; +use core::mem::size_of; + +// Supervisor Trap Cause +#[inline] +pub unsafe fn read() -> usize { + 80007cf6: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, scause":"=r"(ret):::"volatile"); + 80007cf8: 14202573 csrr a0,scause + 80007cfc: e42a sd a0,8(sp) + ret +} + 80007cfe: 0141 addi sp,sp,16 + 80007d00: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register6scause9Interrupt4from17hfa107f1206d46befE: + +0000000080007d02 <_ZN6kernel4arch5riscv8register6scause9Interrupt4from17hfa107f1206d46befE>: + Unknown +} + + +impl Interrupt{ + pub fn from(nr: usize) -> Self { + 80007d02: 1101 addi sp,sp,-32 + 80007d04: 85aa mv a1,a0 + 80007d06: ec2e sd a1,24(sp) + match nr{ + 0 => Interrupt::UserSoft, + 80007d08: 852e mv a0,a1 + 80007d0a: e42a sd a0,8(sp) + 80007d0c: 4525 li a0,9 + 80007d0e: 00b56b63 bltu a0,a1,80007d24 <.LBB1_2> + 80007d12: 6522 ld a0,8(sp) + 80007d14: 050e slli a0,a0,0x3 + +0000000080007d16 <.LBB1_10>: + 80007d16: 00020597 auipc a1,0x20 + 80007d1a: 32258593 addi a1,a1,802 # 80028038 <.LJTI1_0> + 80007d1e: 952e add a0,a0,a1 + 80007d20: 6108 ld a0,0(a0) + 80007d22: 8502 jr a0 + +0000000080007d24 <.LBB1_2>: + 80007d24: 4519 li a0,6 + 1 => Interrupt::SupervisorSoft, + 4 => Interrupt::UserTimer, + 5 => Interrupt::SupervisorTimer, + 8 => Interrupt::UserExternal, + 9 => Interrupt::SupervisorExternal, + _ => Interrupt::Unknown + 80007d26: 00a10ba3 sb a0,23(sp) + match nr{ + 80007d2a: a80d j 80007d5c <.LBB1_8+0x8> + +0000000080007d2c <.LBB1_3>: + 80007d2c: 4501 li a0,0 + 0 => Interrupt::UserSoft, + 80007d2e: 00a10ba3 sb a0,23(sp) + match nr{ + 80007d32: a02d j 80007d5c <.LBB1_8+0x8> + +0000000080007d34 <.LBB1_4>: + 80007d34: 4505 li a0,1 + 1 => Interrupt::SupervisorSoft, + 80007d36: 00a10ba3 sb a0,23(sp) + match nr{ + 80007d3a: a00d j 80007d5c <.LBB1_8+0x8> + +0000000080007d3c <.LBB1_5>: + 80007d3c: 4509 li a0,2 + 4 => Interrupt::UserTimer, + 80007d3e: 00a10ba3 sb a0,23(sp) + match nr{ + 80007d42: a829 j 80007d5c <.LBB1_8+0x8> + +0000000080007d44 <.LBB1_6>: + 80007d44: 450d li a0,3 + 5 => Interrupt::SupervisorTimer, + 80007d46: 00a10ba3 sb a0,23(sp) + match nr{ + 80007d4a: a809 j 80007d5c <.LBB1_8+0x8> + +0000000080007d4c <.LBB1_7>: + 80007d4c: 4511 li a0,4 + 8 => Interrupt::UserExternal, + 80007d4e: 00a10ba3 sb a0,23(sp) + match nr{ + 80007d52: a029 j 80007d5c <.LBB1_8+0x8> + +0000000080007d54 <.LBB1_8>: + 80007d54: 4515 li a0,5 + 9 => Interrupt::SupervisorExternal, + 80007d56: 00a10ba3 sb a0,23(sp) + match nr{ + 80007d5a: a009 j 80007d5c <.LBB1_8+0x8> + } + } + 80007d5c: 01710503 lb a0,23(sp) + 80007d60: 6105 addi sp,sp,32 + 80007d62: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register6scause9Exception4from17hf94bf9ab612e4876E: + +0000000080007d64 <_ZN6kernel4arch5riscv8register6scause9Exception4from17hf94bf9ab612e4876E>: +} + +impl Exception{ + pub fn from(nr: usize) -> Self { + 80007d64: 1101 addi sp,sp,-32 + 80007d66: 85aa mv a1,a0 + 80007d68: ec2e sd a1,24(sp) + match nr { + 0 => Exception::InstructionMisaligned, + 80007d6a: 852e mv a0,a1 + 80007d6c: e42a sd a0,8(sp) + 80007d6e: 453d li a0,15 + 80007d70: 00b56b63 bltu a0,a1,80007d86 <.LBB2_2> + 80007d74: 6522 ld a0,8(sp) + 80007d76: 050e slli a0,a0,0x3 + +0000000080007d78 <.LBB2_16>: + 80007d78: 00020597 auipc a1,0x20 + 80007d7c: 31058593 addi a1,a1,784 # 80028088 <.LJTI2_0> + 80007d80: 952e add a0,a0,a1 + 80007d82: 6108 ld a0,0(a0) + 80007d84: 8502 jr a0 + +0000000080007d86 <.LBB2_2>: + 80007d86: 4531 li a0,12 + 8 => Exception::UserEnvCall, + 9 => Exception::KernelEnvCall, + 12 => Exception::InstructionPageFault, + 13 => Exception::LoadPageFault, + 15 => Exception::StorePageFault, + _ => Exception::Unknown + 80007d88: 00a10ba3 sb a0,23(sp) + match nr { + 80007d8c: a08d j 80007dee <.LBB2_14+0x8> + +0000000080007d8e <.LBB2_3>: + 80007d8e: 4501 li a0,0 + 0 => Exception::InstructionMisaligned, + 80007d90: 00a10ba3 sb a0,23(sp) + match nr { + 80007d94: a8a9 j 80007dee <.LBB2_14+0x8> + +0000000080007d96 <.LBB2_4>: + 80007d96: 4505 li a0,1 + 1 => Exception::InstructionFault, + 80007d98: 00a10ba3 sb a0,23(sp) + match nr { + 80007d9c: a889 j 80007dee <.LBB2_14+0x8> + +0000000080007d9e <.LBB2_5>: + 80007d9e: 4509 li a0,2 + 2 => Exception::IllegalInstruction, + 80007da0: 00a10ba3 sb a0,23(sp) + match nr { + 80007da4: a0a9 j 80007dee <.LBB2_14+0x8> + +0000000080007da6 <.LBB2_6>: + 80007da6: 450d li a0,3 + 3 => Exception::Breakpoint, + 80007da8: 00a10ba3 sb a0,23(sp) + match nr { + 80007dac: a089 j 80007dee <.LBB2_14+0x8> + +0000000080007dae <.LBB2_7>: + 80007dae: 4511 li a0,4 + 5 => Exception::LoadFault, + 80007db0: 00a10ba3 sb a0,23(sp) + match nr { + 80007db4: a82d j 80007dee <.LBB2_14+0x8> + +0000000080007db6 <.LBB2_8>: + 80007db6: 4515 li a0,5 + 6 => Exception::StoreMisaligned, + 80007db8: 00a10ba3 sb a0,23(sp) + match nr { + 80007dbc: a80d j 80007dee <.LBB2_14+0x8> + +0000000080007dbe <.LBB2_9>: + 80007dbe: 4519 li a0,6 + 7 => Exception::StoreFault, + 80007dc0: 00a10ba3 sb a0,23(sp) + match nr { + 80007dc4: a02d j 80007dee <.LBB2_14+0x8> + +0000000080007dc6 <.LBB2_10>: + 80007dc6: 451d li a0,7 + 8 => Exception::UserEnvCall, + 80007dc8: 00a10ba3 sb a0,23(sp) + match nr { + 80007dcc: a00d j 80007dee <.LBB2_14+0x8> + +0000000080007dce <.LBB2_11>: + 80007dce: 4521 li a0,8 + 9 => Exception::KernelEnvCall, + 80007dd0: 00a10ba3 sb a0,23(sp) + match nr { + 80007dd4: a829 j 80007dee <.LBB2_14+0x8> + +0000000080007dd6 <.LBB2_12>: + 80007dd6: 4525 li a0,9 + 12 => Exception::InstructionPageFault, + 80007dd8: 00a10ba3 sb a0,23(sp) + match nr { + 80007ddc: a809 j 80007dee <.LBB2_14+0x8> + +0000000080007dde <.LBB2_13>: + 80007dde: 4529 li a0,10 + 13 => Exception::LoadPageFault, + 80007de0: 00a10ba3 sb a0,23(sp) + match nr { + 80007de4: a029 j 80007dee <.LBB2_14+0x8> + +0000000080007de6 <.LBB2_14>: + 80007de6: 452d li a0,11 + 15 => Exception::StorePageFault, + 80007de8: 00a10ba3 sb a0,23(sp) + match nr { + 80007dec: a009 j 80007dee <.LBB2_14+0x8> + } + } + 80007dee: 01710503 lb a0,23(sp) + 80007df2: 6105 addi sp,sp,32 + 80007df4: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register6scause6Scause3new17hf1aad0ee6c83efd3E: + +0000000080007df6 <_ZN6kernel4arch5riscv8register6scause6Scause3new17hf1aad0ee6c83efd3E>: + +impl Scause{ + + // new a Scause Object by usize + #[inline] + pub fn new(scause: usize) -> Self{ + 80007df6: 1141 addi sp,sp,-16 + 80007df8: e42a sd a0,8(sp) + Self{ + 80007dfa: e02a sd a0,0(sp) + bits: scause + } + } + 80007dfc: 0141 addi sp,sp,16 + 80007dfe: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE: + +0000000080007e00 <_ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE>: + pub fn bits(&self) -> usize{ + self.bits + } + + // Returns the code field + pub fn code(&self) -> usize{ + 80007e00: 7179 addi sp,sp,-48 + 80007e02: ec2a sd a0,24(sp) + 80007e04: f02a sd a0,32(sp) + let bit = 1 << (size_of::() * 8 -1); + 80007e06: a009 j 80007e08 <_ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE+0x8> + 80007e08: 04000513 li a0,64 + 80007e0c: e82a sd a0,16(sp) + 80007e0e: 4501 li a0,0 + 80007e10: ed0d bnez a0,80007e4a <.LBB4_8> + 80007e12: a009 j 80007e14 <_ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE+0x14> + 80007e14: 6542 ld a0,16(sp) + 80007e16: fff50593 addi a1,a0,-1 + 80007e1a: e42e sd a1,8(sp) + 80007e1c: 04b56663 bltu a0,a1,80007e68 <.LBB4_10> + 80007e20: a009 j 80007e22 <_ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE+0x22> + 80007e22: 6622 ld a2,8(sp) + 80007e24: fc067513 andi a0,a2,-64 + 80007e28: 4585 li a1,1 + 80007e2a: 00c595b3 sll a1,a1,a2 + 80007e2e: e02e sd a1,0(sp) + 80007e30: 4581 li a1,0 + 80007e32: 04b51a63 bne a0,a1,80007e86 <.LBB4_12> + 80007e36: a009 j 80007e38 <_ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE+0x38> + 80007e38: 6582 ld a1,0(sp) + 80007e3a: 6562 ld a0,24(sp) + 80007e3c: f42e sd a1,40(sp) + self.bits & !bit + 80007e3e: 6108 ld a0,0(a0) + 80007e40: fff5c593 not a1,a1 + 80007e44: 8d6d and a0,a0,a1 + } + 80007e46: 6145 addi sp,sp,48 + 80007e48: 8082 ret + +0000000080007e4a <.LBB4_8>: + let bit = 1 << (size_of::() * 8 -1); + 80007e4a: 00020517 auipc a0,0x20 + 80007e4e: 3a650513 addi a0,a0,934 # 800281f0 + +0000000080007e52 <.LBB4_9>: + 80007e52: 00020617 auipc a2,0x20 + 80007e56: 37e60613 addi a2,a2,894 # 800281d0 <.L__unnamed_3> + 80007e5a: 02100593 li a1,33 + 80007e5e: 0001b097 auipc ra,0x1b + 80007e62: 2e6080e7 jalr 742(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080007e68 <.LBB4_10>: + 80007e68: 00020517 auipc a0,0x20 + 80007e6c: 3c850513 addi a0,a0,968 # 80028230 + +0000000080007e70 <.LBB4_11>: + 80007e70: 00020617 auipc a2,0x20 + 80007e74: 3a860613 addi a2,a2,936 # 80028218 <.L__unnamed_4> + 80007e78: 02100593 li a1,33 + 80007e7c: 0001b097 auipc ra,0x1b + 80007e80: 2c8080e7 jalr 712(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080007e86 <.LBB4_12>: + 80007e86: 00020517 auipc a0,0x20 + 80007e8a: 3ea50513 addi a0,a0,1002 # 80028270 + +0000000080007e8e <.LBB4_13>: + 80007e8e: 00020617 auipc a2,0x20 + 80007e92: 3ca60613 addi a2,a2,970 # 80028258 <.L__unnamed_5> + 80007e96: 02300593 li a1,35 + 80007e9a: 0001b097 auipc ra,0x1b + 80007e9e: 2aa080e7 jalr 682(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E: + +0000000080007ea4 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E>: + + // Trap Cause + #[inline] + pub fn cause(&self) -> Trap{ + 80007ea4: 715d addi sp,sp,-80 + 80007ea6: e486 sd ra,72(sp) + 80007ea8: f42a sd a0,40(sp) + 80007eaa: e0aa sd a0,64(sp) + if self.is_interrupt() { + 80007eac: 00000097 auipc ra,0x0 + 80007eb0: 080080e7 jalr 128(ra) # 80007f2c <_ZN6kernel4arch5riscv8register6scause6Scause12is_interrupt17ha1f71e688e6e4741E> + 80007eb4: f82a sd a0,48(sp) + 80007eb6: a009 j 80007eb8 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x14> + 80007eb8: 7542 ld a0,48(sp) + 80007eba: 4581 li a1,0 + 80007ebc: 00b50a63 beq a0,a1,80007ed0 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x2c> + 80007ec0: a009 j 80007ec2 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x1e> + Trap::Interrupt(Interrupt::from(self.code())) + 80007ec2: 7522 ld a0,40(sp) + 80007ec4: 00000097 auipc ra,0x0 + 80007ec8: f3c080e7 jalr -196(ra) # 80007e00 <_ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE> + 80007ecc: f02a sd a0,32(sp) + 80007ece: a801 j 80007ede <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x3a> + }else{ + + Trap::Exception(Exception::from(self.code())) + 80007ed0: 7522 ld a0,40(sp) + 80007ed2: 00000097 auipc ra,0x0 + 80007ed6: f2e080e7 jalr -210(ra) # 80007e00 <_ZN6kernel4arch5riscv8register6scause6Scause4code17he6d8ec308b055b2eE> + 80007eda: ec2a sd a0,24(sp) + 80007edc: a00d j 80007efe <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x5a> + Trap::Interrupt(Interrupt::from(self.code())) + 80007ede: 7502 ld a0,32(sp) + 80007ee0: 00000097 auipc ra,0x0 + 80007ee4: e22080e7 jalr -478(ra) # 80007d02 <_ZN6kernel4arch5riscv8register6scause9Interrupt4from17hfa107f1206d46befE> + 80007ee8: 0ff57513 andi a0,a0,255 + 80007eec: e82a sd a0,16(sp) + 80007eee: a009 j 80007ef0 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x4c> + 80007ef0: 6542 ld a0,16(sp) + 80007ef2: 02a10ca3 sb a0,57(sp) + 80007ef6: 4501 li a0,0 + 80007ef8: 02a10c23 sb a0,56(sp) + if self.is_interrupt() { + 80007efc: a00d j 80007f1e <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x7a> + Trap::Exception(Exception::from(self.code())) + 80007efe: 6562 ld a0,24(sp) + 80007f00: 00000097 auipc ra,0x0 + 80007f04: e64080e7 jalr -412(ra) # 80007d64 <_ZN6kernel4arch5riscv8register6scause9Exception4from17hf94bf9ab612e4876E> + 80007f08: 0ff57513 andi a0,a0,255 + 80007f0c: e42a sd a0,8(sp) + 80007f0e: a009 j 80007f10 <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x6c> + 80007f10: 6522 ld a0,8(sp) + 80007f12: 02a10ca3 sb a0,57(sp) + 80007f16: 4505 li a0,1 + 80007f18: 02a10c23 sb a0,56(sp) + if self.is_interrupt() { + 80007f1c: a009 j 80007f1e <_ZN6kernel4arch5riscv8register6scause6Scause5cause17h87ca94701d022899E+0x7a> + } + } + 80007f1e: 03814503 lbu a0,56(sp) + 80007f22: 03910583 lb a1,57(sp) + 80007f26: 60a6 ld ra,72(sp) + 80007f28: 6161 addi sp,sp,80 + 80007f2a: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register6scause6Scause12is_interrupt17ha1f71e688e6e4741E: + +0000000080007f2c <_ZN6kernel4arch5riscv8register6scause6Scause12is_interrupt17ha1f71e688e6e4741E>: + + + // Is trap cause an interrupt + #[inline] + pub fn is_interrupt(&self) -> bool { + 80007f2c: 7179 addi sp,sp,-48 + 80007f2e: f406 sd ra,40(sp) + 80007f30: ec2a sd a0,24(sp) + 80007f32: f02a sd a0,32(sp) + self.bits.get_bit(size_of::()*8 - 1) + 80007f34: a009 j 80007f36 <_ZN6kernel4arch5riscv8register6scause6Scause12is_interrupt17ha1f71e688e6e4741E+0xa> + 80007f36: 04000513 li a0,64 + 80007f3a: e82a sd a0,16(sp) + 80007f3c: 4501 li a0,0 + 80007f3e: e50d bnez a0,80007f68 <.LBB6_7> + 80007f40: a009 j 80007f42 <_ZN6kernel4arch5riscv8register6scause6Scause12is_interrupt17ha1f71e688e6e4741E+0x16> + 80007f42: 6542 ld a0,16(sp) + 80007f44: fff50593 addi a1,a0,-1 + 80007f48: e42e sd a1,8(sp) + 80007f4a: 02b56e63 bltu a0,a1,80007f86 <.LBB6_9> + 80007f4e: a009 j 80007f50 <_ZN6kernel4arch5riscv8register6scause6Scause12is_interrupt17ha1f71e688e6e4741E+0x24> + 80007f50: 65a2 ld a1,8(sp) + 80007f52: 6562 ld a0,24(sp) + 80007f54: ffffc097 auipc ra,0xffffc + 80007f58: e60080e7 jalr -416(ra) # 80003db4 <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E> + 80007f5c: e02a sd a0,0(sp) + 80007f5e: a009 j 80007f60 <_ZN6kernel4arch5riscv8register6scause6Scause12is_interrupt17ha1f71e688e6e4741E+0x34> + } + 80007f60: 6502 ld a0,0(sp) + 80007f62: 70a2 ld ra,40(sp) + 80007f64: 6145 addi sp,sp,48 + 80007f66: 8082 ret + +0000000080007f68 <.LBB6_7>: + self.bits.get_bit(size_of::()*8 - 1) + 80007f68: 00020517 auipc a0,0x20 + 80007f6c: 28850513 addi a0,a0,648 # 800281f0 + +0000000080007f70 <.LBB6_8>: + 80007f70: 00020617 auipc a2,0x20 + 80007f74: 32860613 addi a2,a2,808 # 80028298 <.L__unnamed_6> + 80007f78: 02100593 li a1,33 + 80007f7c: 0001b097 auipc ra,0x1b + 80007f80: 1c8080e7 jalr 456(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080007f86 <.LBB6_9>: + 80007f86: 00020517 auipc a0,0x20 + 80007f8a: 2aa50513 addi a0,a0,682 # 80028230 + +0000000080007f8e <.LBB6_10>: + 80007f8e: 00020617 auipc a2,0x20 + 80007f92: 30a60613 addi a2,a2,778 # 80028298 <.L__unnamed_6> + 80007f96: 02100593 li a1,33 + 80007f9a: 0001b097 auipc ra,0x1b + 80007f9e: 1aa080e7 jalr 426(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN80_$LT$kernel..arch..riscv..register..scause..Trap$u20$as$u20$core..fmt..Debug$GT$3fmt17haf633180146f5b80E: + +0000000080007fa4 <_ZN80_$LT$kernel..arch..riscv..register..scause..Trap$u20$as$u20$core..fmt..Debug$GT$3fmt17haf633180146f5b80E>: +#[derive(Copy, Clone, Debug, Eq, PartialEq)] + 80007fa4: 7135 addi sp,sp,-160 + 80007fa6: ed06 sd ra,152(sp) + 80007fa8: e82e sd a1,16(sp) + 80007faa: f4aa sd a0,104(sp) + 80007fac: f8ae sd a1,112(sp) + 80007fae: f02a sd a0,32(sp) + 80007fb0: 00054503 lbu a0,0(a0) + 80007fb4: 8905 andi a0,a0,1 + 80007fb6: 4581 li a1,0 + 80007fb8: 02b50463 beq a0,a1,80007fe0 <.LBB7_10+0x18> + 80007fbc: a009 j 80007fbe <_ZN80_$LT$kernel..arch..riscv..register..scause..Trap$u20$as$u20$core..fmt..Debug$GT$3fmt17haf633180146f5b80E+0x1a> + Exception(Exception), + 80007fbe: 65c2 ld a1,16(sp) + 80007fc0: 7502 ld a0,32(sp) + 80007fc2: 0505 addi a0,a0,1 + 80007fc4: e42a sd a0,8(sp) + 80007fc6: fcaa sd a0,120(sp) + +0000000080007fc8 <.LBB7_10>: +#[derive(Copy, Clone, Debug, Eq, PartialEq)] + 80007fc8: 00020617 auipc a2,0x20 + 80007fcc: 2e860613 addi a2,a2,744 # 800282b0 <.L__unnamed_7> + 80007fd0: 00a8 addi a0,sp,72 + 80007fd2: 46a5 li a3,9 + 80007fd4: 0001c097 auipc ra,0x1c + 80007fd8: 0ee080e7 jalr 238(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80007fdc: a881 j 8000802c <.LBB7_12+0x24> + 80007fde: 0000 unimp + Interrupt(Interrupt), + 80007fe0: 65c2 ld a1,16(sp) + 80007fe2: 7502 ld a0,32(sp) + 80007fe4: 0505 addi a0,a0,1 + 80007fe6: e02a sd a0,0(sp) + 80007fe8: e52a sd a0,136(sp) + +0000000080007fea <.LBB7_11>: +#[derive(Copy, Clone, Debug, Eq, PartialEq)] + 80007fea: 00020617 auipc a2,0x20 + 80007fee: 2f660613 addi a2,a2,758 # 800282e0 <.L__unnamed_8> + 80007ff2: 1028 addi a0,sp,40 + 80007ff4: 46a5 li a3,9 + 80007ff6: 0001c097 auipc ra,0x1c + 80007ffa: 0cc080e7 jalr 204(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80007ffe: a009 j 80008000 <.LBB7_11+0x16> + 80008000: 6582 ld a1,0(sp) + 80008002: 1028 addi a0,sp,40 + 80008004: e92a sd a0,144(sp) + Interrupt(Interrupt), + 80008006: e0ae sd a1,64(sp) + +0000000080008008 <.LBB7_12>: +#[derive(Copy, Clone, Debug, Eq, PartialEq)] + 80008008: 00020617 auipc a2,0x20 + 8000800c: 2e860613 addi a2,a2,744 # 800282f0 <.L__unnamed_2> + 80008010: 008c addi a1,sp,64 + 80008012: 0001b097 auipc ra,0x1b + 80008016: 5e8080e7 jalr 1512(ra) # 800235fa <_ZN4core3fmt8builders10DebugTuple5field17h5bd338b8cb98b948E> + 8000801a: a009 j 8000801c <.LBB7_12+0x14> + 8000801c: 1028 addi a0,sp,40 + 8000801e: 0001b097 auipc ra,0x1b + 80008022: 6fc080e7 jalr 1788(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008026: 00a10fa3 sb a0,31(sp) + 8000802a: a03d j 80008058 <.LBB7_13+0x24> + 8000802c: 65a2 ld a1,8(sp) + 8000802e: 00a8 addi a0,sp,72 + 80008030: e12a sd a0,128(sp) + Exception(Exception), + 80008032: f0ae sd a1,96(sp) + +0000000080008034 <.LBB7_13>: +#[derive(Copy, Clone, Debug, Eq, PartialEq)] + 80008034: 00020617 auipc a2,0x20 + 80008038: 28c60613 addi a2,a2,652 # 800282c0 <.L__unnamed_1> + 8000803c: 108c addi a1,sp,96 + 8000803e: 0001b097 auipc ra,0x1b + 80008042: 5bc080e7 jalr 1468(ra) # 800235fa <_ZN4core3fmt8builders10DebugTuple5field17h5bd338b8cb98b948E> + 80008046: a009 j 80008048 <.LBB7_13+0x14> + 80008048: 00a8 addi a0,sp,72 + 8000804a: 0001b097 auipc ra,0x1b + 8000804e: 6d0080e7 jalr 1744(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008052: 00a10fa3 sb a0,31(sp) + 80008056: a009 j 80008058 <.LBB7_13+0x24> + 80008058: 01f14503 lbu a0,31(sp) + 8000805c: 60ea ld ra,152(sp) + 8000805e: 610d addi sp,sp,160 + 80008060: 8082 ret + +Disassembly of section .text._ZN85_$LT$kernel..arch..riscv..register..scause..Interrupt$u20$as$u20$core..fmt..Debug$GT$3fmt17h96992b3c4ed41ad9E: + +0000000080008062 <_ZN85_$LT$kernel..arch..riscv..register..scause..Interrupt$u20$as$u20$core..fmt..Debug$GT$3fmt17h96992b3c4ed41ad9E>: +#[derive(Copy, Clone, Debug, Eq, PartialEq)] + 80008062: 712d addi sp,sp,-288 + 80008064: ee06 sd ra,280(sp) + 80008066: e42e sd a1,8(sp) + 80008068: e9aa sd a0,208(sp) + 8000806a: edae sd a1,216(sp) + 8000806c: f02a sd a0,32(sp) + 8000806e: 00054503 lbu a0,0(a0) + 80008072: e82a sd a0,16(sp) + 80008074: 6542 ld a0,16(sp) + 80008076: 050e slli a0,a0,0x3 + +0000000080008078 <.LBB8_18>: + 80008078: 00020597 auipc a1,0x20 + 8000807c: 09058593 addi a1,a1,144 # 80028108 <.LJTI8_0> + 80008080: 952e add a0,a0,a1 + 80008082: 6108 ld a0,0(a0) + 80008084: 8502 jr a0 + +0000000080008086 <.LBB8_2>: + 80008086: 65a2 ld a1,8(sp) + +0000000080008088 <.LBB8_19>: + 80008088: 00020617 auipc a2,0x20 + 8000808c: 28860613 addi a2,a2,648 # 80028310 <.L__unnamed_9> + 80008090: 1928 addi a0,sp,184 + 80008092: 469d li a3,7 + 80008094: 0001c097 auipc ra,0x1c + 80008098: 02e080e7 jalr 46(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8000809c: a201 j 8000819c <.LBB8_25+0x28> + ... + +00000000800080a0 <.LBB8_4>: + 800080a0: 65a2 ld a1,8(sp) + +00000000800080a2 <.LBB8_20>: + 800080a2: 0001f617 auipc a2,0x1f + 800080a6: 75e60613 addi a2,a2,1886 # 80027800 <.L__unnamed_6+0x70> + 800080aa: 1028 addi a0,sp,40 + 800080ac: 46a1 li a3,8 + 800080ae: 0001c097 auipc ra,0x1c + 800080b2: 014080e7 jalr 20(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800080b6: a009 j 800080b8 <.LBB8_20+0x16> + 800080b8: 1028 addi a0,sp,40 + 800080ba: ea2a sd a0,272(sp) + 800080bc: 0001b097 auipc ra,0x1b + 800080c0: 65e080e7 jalr 1630(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800080c4: 00a10fa3 sb a0,31(sp) + 800080c8: a0dd j 800081ae <.LBB8_25+0x3a> + +00000000800080ca <.LBB8_6>: + 800080ca: 65a2 ld a1,8(sp) + +00000000800080cc <.LBB8_21>: + 800080cc: 00020617 auipc a2,0x20 + 800080d0: 28160613 addi a2,a2,641 # 8002834d <.L__unnamed_11> + 800080d4: 0088 addi a0,sp,64 + 800080d6: 46b9 li a3,14 + 800080d8: 0001c097 auipc ra,0x1c + 800080dc: fea080e7 jalr -22(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800080e0: a009 j 800080e2 <.LBB8_21+0x16> + 800080e2: 0088 addi a0,sp,64 + 800080e4: e62a sd a0,264(sp) + 800080e6: 0001b097 auipc ra,0x1b + 800080ea: 634080e7 jalr 1588(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800080ee: 00a10fa3 sb a0,31(sp) + 800080f2: a875 j 800081ae <.LBB8_25+0x3a> + +00000000800080f4 <.LBB8_8>: + 800080f4: 65a2 ld a1,8(sp) + +00000000800080f6 <.LBB8_22>: + 800080f6: 00020617 auipc a2,0x20 + 800080fa: 24e60613 addi a2,a2,590 # 80028344 <.L__unnamed_12> + 800080fe: 08a8 addi a0,sp,88 + 80008100: 46a5 li a3,9 + 80008102: 0001c097 auipc ra,0x1c + 80008106: fc0080e7 jalr -64(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8000810a: a009 j 8000810c <.LBB8_22+0x16> + 8000810c: 08a8 addi a0,sp,88 + 8000810e: e22a sd a0,256(sp) + 80008110: 0001b097 auipc ra,0x1b + 80008114: 60a080e7 jalr 1546(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008118: 00a10fa3 sb a0,31(sp) + 8000811c: a849 j 800081ae <.LBB8_25+0x3a> + +000000008000811e <.LBB8_10>: + 8000811e: 65a2 ld a1,8(sp) + +0000000080008120 <.LBB8_23>: + 80008120: 00020617 auipc a2,0x20 + 80008124: 21560613 addi a2,a2,533 # 80028335 <.L__unnamed_13> + 80008128: 1888 addi a0,sp,112 + 8000812a: 46bd li a3,15 + 8000812c: 0001c097 auipc ra,0x1c + 80008130: f96080e7 jalr -106(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008134: a009 j 80008136 <.LBB8_23+0x16> + 80008136: 1888 addi a0,sp,112 + 80008138: fdaa sd a0,248(sp) + 8000813a: 0001b097 auipc ra,0x1b + 8000813e: 5e0080e7 jalr 1504(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008142: 00a10fa3 sb a0,31(sp) + 80008146: a0a5 j 800081ae <.LBB8_25+0x3a> + +0000000080008148 <.LBB8_12>: + 80008148: 65a2 ld a1,8(sp) + +000000008000814a <.LBB8_24>: + 8000814a: 00020617 auipc a2,0x20 + 8000814e: 1df60613 addi a2,a2,479 # 80028329 <.L__unnamed_14> + 80008152: 0128 addi a0,sp,136 + 80008154: 46b1 li a3,12 + 80008156: 0001c097 auipc ra,0x1c + 8000815a: f6c080e7 jalr -148(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8000815e: a009 j 80008160 <.LBB8_24+0x16> + 80008160: 0128 addi a0,sp,136 + 80008162: f9aa sd a0,240(sp) + 80008164: 0001b097 auipc ra,0x1b + 80008168: 5b6080e7 jalr 1462(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8000816c: 00a10fa3 sb a0,31(sp) + 80008170: a83d j 800081ae <.LBB8_25+0x3a> + +0000000080008172 <.LBB8_14>: + 80008172: 65a2 ld a1,8(sp) + +0000000080008174 <.LBB8_25>: + 80008174: 00020617 auipc a2,0x20 + 80008178: 1a360613 addi a2,a2,419 # 80028317 <.L__unnamed_15> + 8000817c: 1108 addi a0,sp,160 + 8000817e: 46c9 li a3,18 + 80008180: 0001c097 auipc ra,0x1c + 80008184: f42080e7 jalr -190(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008188: a009 j 8000818a <.LBB8_25+0x16> + 8000818a: 1108 addi a0,sp,160 + 8000818c: f5aa sd a0,232(sp) + 8000818e: 0001b097 auipc ra,0x1b + 80008192: 58c080e7 jalr 1420(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008196: 00a10fa3 sb a0,31(sp) + 8000819a: a811 j 800081ae <.LBB8_25+0x3a> + 8000819c: 1928 addi a0,sp,184 + 8000819e: f1aa sd a0,224(sp) + 800081a0: 0001b097 auipc ra,0x1b + 800081a4: 57a080e7 jalr 1402(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800081a8: 00a10fa3 sb a0,31(sp) + 800081ac: a009 j 800081ae <.LBB8_25+0x3a> + 800081ae: 01f14503 lbu a0,31(sp) + 800081b2: 60f2 ld ra,280(sp) + 800081b4: 6115 addi sp,sp,288 + 800081b6: 8082 ret + +Disassembly of section .text._ZN85_$LT$kernel..arch..riscv..register..scause..Exception$u20$as$u20$core..fmt..Debug$GT$3fmt17h4deffc5a3158ed01E: + +00000000800081b8 <_ZN85_$LT$kernel..arch..riscv..register..scause..Exception$u20$as$u20$core..fmt..Debug$GT$3fmt17h4deffc5a3158ed01E>: +#[derive(Copy, Clone, Debug, Eq, PartialEq)] + 800081b8: 7105 addi sp,sp,-480 + 800081ba: ef86 sd ra,472(sp) + 800081bc: e42e sd a1,8(sp) + 800081be: f2aa sd a0,352(sp) + 800081c0: f6ae sd a1,360(sp) + 800081c2: f02a sd a0,32(sp) + 800081c4: 00054503 lbu a0,0(a0) + 800081c8: e82a sd a0,16(sp) + 800081ca: 6542 ld a0,16(sp) + 800081cc: 050e slli a0,a0,0x3 + +00000000800081ce <.LBB9_30>: + 800081ce: 00020597 auipc a1,0x20 + 800081d2: f7258593 addi a1,a1,-142 # 80028140 <.LJTI9_0> + 800081d6: 952e add a0,a0,a1 + 800081d8: 6108 ld a0,0(a0) + 800081da: 8502 jr a0 + +00000000800081dc <.LBB9_2>: + 800081dc: 65a2 ld a1,8(sp) + +00000000800081de <.LBB9_31>: + 800081de: 00020617 auipc a2,0x20 + 800081e2: 13260613 addi a2,a2,306 # 80028310 <.L__unnamed_9> + 800081e6: 02a8 addi a0,sp,328 + 800081e8: 469d li a3,7 + 800081ea: 0001c097 auipc ra,0x1c + 800081ee: ed8080e7 jalr -296(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800081f2: aaf5 j 800083ee <.LBB9_43+0x28> + ... + +00000000800081f6 <.LBB9_4>: + 800081f6: 65a2 ld a1,8(sp) + +00000000800081f8 <.LBB9_32>: + 800081f8: 00020617 auipc a2,0x20 + 800081fc: 1e860613 addi a2,a2,488 # 800283e0 <.L__unnamed_16> + 80008200: 1028 addi a0,sp,40 + 80008202: 46d5 li a3,21 + 80008204: 0001c097 auipc ra,0x1c + 80008208: ebe080e7 jalr -322(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8000820c: a009 j 8000820e <.LBB9_32+0x16> + 8000820e: 1028 addi a0,sp,40 + 80008210: ebaa sd a0,464(sp) + 80008212: 0001b097 auipc ra,0x1b + 80008216: 508080e7 jalr 1288(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8000821a: 00a10fa3 sb a0,31(sp) + 8000821e: a2cd j 80008400 <.LBB9_43+0x3a> + +0000000080008220 <.LBB9_6>: + 80008220: 65a2 ld a1,8(sp) + +0000000080008222 <.LBB9_33>: + 80008222: 0001e617 auipc a2,0x1e + 80008226: 4ee60613 addi a2,a2,1262 # 80026710 <.L__unnamed_35+0xd8> + 8000822a: 0088 addi a0,sp,64 + 8000822c: 46c1 li a3,16 + 8000822e: 0001c097 auipc ra,0x1c + 80008232: e94080e7 jalr -364(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008236: a009 j 80008238 <.LBB9_33+0x16> + 80008238: 0088 addi a0,sp,64 + 8000823a: e7aa sd a0,456(sp) + 8000823c: 0001b097 auipc ra,0x1b + 80008240: 4de080e7 jalr 1246(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008244: 00a10fa3 sb a0,31(sp) + 80008248: aa65 j 80008400 <.LBB9_43+0x3a> + +000000008000824a <.LBB9_8>: + 8000824a: 65a2 ld a1,8(sp) + +000000008000824c <.LBB9_34>: + 8000824c: 00020617 auipc a2,0x20 + 80008250: 18260613 addi a2,a2,386 # 800283ce <.L__unnamed_18> + 80008254: 08a8 addi a0,sp,88 + 80008256: 46c9 li a3,18 + 80008258: 0001c097 auipc ra,0x1c + 8000825c: e6a080e7 jalr -406(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008260: a009 j 80008262 <.LBB9_34+0x16> + 80008262: 08a8 addi a0,sp,88 + 80008264: e3aa sd a0,448(sp) + 80008266: 0001b097 auipc ra,0x1b + 8000826a: 4b4080e7 jalr 1204(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8000826e: 00a10fa3 sb a0,31(sp) + 80008272: a279 j 80008400 <.LBB9_43+0x3a> + +0000000080008274 <.LBB9_10>: + 80008274: 65a2 ld a1,8(sp) + +0000000080008276 <.LBB9_35>: + 80008276: 00020617 auipc a2,0x20 + 8000827a: 14e60613 addi a2,a2,334 # 800283c4 <.L__unnamed_19> + 8000827e: 1888 addi a0,sp,112 + 80008280: 46a9 li a3,10 + 80008282: 0001c097 auipc ra,0x1c + 80008286: e40080e7 jalr -448(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8000828a: a009 j 8000828c <.LBB9_35+0x16> + 8000828c: 1888 addi a0,sp,112 + 8000828e: ff2a sd a0,440(sp) + 80008290: 0001b097 auipc ra,0x1b + 80008294: 48a080e7 jalr 1162(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008298: 00a10fa3 sb a0,31(sp) + 8000829c: a295 j 80008400 <.LBB9_43+0x3a> + +000000008000829e <.LBB9_12>: + 8000829e: 65a2 ld a1,8(sp) + +00000000800082a0 <.LBB9_36>: + 800082a0: 00020617 auipc a2,0x20 + 800082a4: 11b60613 addi a2,a2,283 # 800283bb <.L__unnamed_20> + 800082a8: 0128 addi a0,sp,136 + 800082aa: 46a5 li a3,9 + 800082ac: 0001c097 auipc ra,0x1c + 800082b0: e16080e7 jalr -490(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800082b4: a009 j 800082b6 <.LBB9_36+0x16> + 800082b6: 0128 addi a0,sp,136 + 800082b8: fb2a sd a0,432(sp) + 800082ba: 0001b097 auipc ra,0x1b + 800082be: 460080e7 jalr 1120(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800082c2: 00a10fa3 sb a0,31(sp) + 800082c6: aa2d j 80008400 <.LBB9_43+0x3a> + +00000000800082c8 <.LBB9_14>: + 800082c8: 65a2 ld a1,8(sp) + +00000000800082ca <.LBB9_37>: + 800082ca: 00020617 auipc a2,0x20 + 800082ce: 0e260613 addi a2,a2,226 # 800283ac <.L__unnamed_21> + 800082d2: 1108 addi a0,sp,160 + 800082d4: 46bd li a3,15 + 800082d6: 0001c097 auipc ra,0x1c + 800082da: dec080e7 jalr -532(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800082de: a009 j 800082e0 <.LBB9_37+0x16> + 800082e0: 1108 addi a0,sp,160 + 800082e2: f72a sd a0,424(sp) + 800082e4: 0001b097 auipc ra,0x1b + 800082e8: 436080e7 jalr 1078(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800082ec: 00a10fa3 sb a0,31(sp) + 800082f0: aa01 j 80008400 <.LBB9_43+0x3a> + +00000000800082f2 <.LBB9_16>: + 800082f2: 65a2 ld a1,8(sp) + +00000000800082f4 <.LBB9_38>: + 800082f4: 00020617 auipc a2,0x20 + 800082f8: 0ae60613 addi a2,a2,174 # 800283a2 <.L__unnamed_22> + 800082fc: 1928 addi a0,sp,184 + 800082fe: 46a9 li a3,10 + 80008300: 0001c097 auipc ra,0x1c + 80008304: dc2080e7 jalr -574(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008308: a009 j 8000830a <.LBB9_38+0x16> + 8000830a: 1928 addi a0,sp,184 + 8000830c: f32a sd a0,416(sp) + 8000830e: 0001b097 auipc ra,0x1b + 80008312: 40c080e7 jalr 1036(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008316: 00a10fa3 sb a0,31(sp) + 8000831a: a0dd j 80008400 <.LBB9_43+0x3a> + +000000008000831c <.LBB9_18>: + 8000831c: 65a2 ld a1,8(sp) + +000000008000831e <.LBB9_39>: + 8000831e: 00020617 auipc a2,0x20 + 80008322: 07960613 addi a2,a2,121 # 80028397 <.L__unnamed_23> + 80008326: 0988 addi a0,sp,208 + 80008328: 46ad li a3,11 + 8000832a: 0001c097 auipc ra,0x1c + 8000832e: d98080e7 jalr -616(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008332: a009 j 80008334 <.LBB9_39+0x16> + 80008334: 0988 addi a0,sp,208 + 80008336: ef2a sd a0,408(sp) + 80008338: 0001b097 auipc ra,0x1b + 8000833c: 3e2080e7 jalr 994(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008340: 00a10fa3 sb a0,31(sp) + 80008344: a875 j 80008400 <.LBB9_43+0x3a> + +0000000080008346 <.LBB9_20>: + 80008346: 65a2 ld a1,8(sp) + +0000000080008348 <.LBB9_40>: + 80008348: 00020617 auipc a2,0x20 + 8000834c: 04260613 addi a2,a2,66 # 8002838a <.L__unnamed_24> + 80008350: 11a8 addi a0,sp,232 + 80008352: 46b5 li a3,13 + 80008354: 0001c097 auipc ra,0x1c + 80008358: d6e080e7 jalr -658(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8000835c: a009 j 8000835e <.LBB9_40+0x16> + 8000835e: 11a8 addi a0,sp,232 + 80008360: eb2a sd a0,400(sp) + 80008362: 0001b097 auipc ra,0x1b + 80008366: 3b8080e7 jalr 952(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8000836a: 00a10fa3 sb a0,31(sp) + 8000836e: a849 j 80008400 <.LBB9_43+0x3a> + +0000000080008370 <.LBB9_22>: + 80008370: 65a2 ld a1,8(sp) + +0000000080008372 <.LBB9_41>: + 80008372: 00020617 auipc a2,0x20 + 80008376: 00460613 addi a2,a2,4 # 80028376 <.L__unnamed_25> + 8000837a: 0208 addi a0,sp,256 + 8000837c: 46d1 li a3,20 + 8000837e: 0001c097 auipc ra,0x1c + 80008382: d44080e7 jalr -700(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008386: a009 j 80008388 <.LBB9_41+0x16> + 80008388: 0208 addi a0,sp,256 + 8000838a: e72a sd a0,392(sp) + 8000838c: 0001b097 auipc ra,0x1b + 80008390: 38e080e7 jalr 910(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008394: 00a10fa3 sb a0,31(sp) + 80008398: a0a5 j 80008400 <.LBB9_43+0x3a> + +000000008000839a <.LBB9_24>: + 8000839a: 65a2 ld a1,8(sp) + +000000008000839c <.LBB9_42>: + 8000839c: 00020617 auipc a2,0x20 + 800083a0: fcd60613 addi a2,a2,-51 # 80028369 <.L__unnamed_26> + 800083a4: 0a28 addi a0,sp,280 + 800083a6: 46b5 li a3,13 + 800083a8: 0001c097 auipc ra,0x1c + 800083ac: d1a080e7 jalr -742(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800083b0: a009 j 800083b2 <.LBB9_42+0x16> + 800083b2: 0a28 addi a0,sp,280 + 800083b4: e32a sd a0,384(sp) + 800083b6: 0001b097 auipc ra,0x1b + 800083ba: 364080e7 jalr 868(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800083be: 00a10fa3 sb a0,31(sp) + 800083c2: a83d j 80008400 <.LBB9_43+0x3a> + +00000000800083c4 <.LBB9_26>: + 800083c4: 65a2 ld a1,8(sp) + +00000000800083c6 <.LBB9_43>: + 800083c6: 00020617 auipc a2,0x20 + 800083ca: f9560613 addi a2,a2,-107 # 8002835b <.L__unnamed_27> + 800083ce: 1a08 addi a0,sp,304 + 800083d0: 46b9 li a3,14 + 800083d2: 0001c097 auipc ra,0x1c + 800083d6: cf0080e7 jalr -784(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800083da: a009 j 800083dc <.LBB9_43+0x16> + 800083dc: 1a08 addi a0,sp,304 + 800083de: feaa sd a0,376(sp) + 800083e0: 0001b097 auipc ra,0x1b + 800083e4: 33a080e7 jalr 826(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800083e8: 00a10fa3 sb a0,31(sp) + 800083ec: a811 j 80008400 <.LBB9_43+0x3a> + 800083ee: 02a8 addi a0,sp,328 + 800083f0: faaa sd a0,368(sp) + 800083f2: 0001b097 auipc ra,0x1b + 800083f6: 328080e7 jalr 808(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800083fa: 00a10fa3 sb a0,31(sp) + 800083fe: a009 j 80008400 <.LBB9_43+0x3a> + 80008400: 01f14503 lbu a0,31(sp) + 80008404: 60fe ld ra,472(sp) + 80008406: 613d addi sp,sp,480 + 80008408: 8082 ret + +Disassembly of section .text._ZN6kernel2fs6dinode9DiskInode9try_alloc17h945d9012d7c3db98E: + +000000008000840a <_ZN6kernel2fs6dinode9DiskInode9try_alloc17h945d9012d7c3db98E>: + size: 0, + addrs: [0; NDIRECT+1] + } + } + + pub fn try_alloc(&mut self, itype: InodeType) -> Result<(), ()> { + 8000840a: 7139 addi sp,sp,-64 + 8000840c: fc06 sd ra,56(sp) + 8000840e: e42a sd a0,8(sp) + 80008410: 862e mv a2,a1 + 80008412: e832 sd a2,16(sp) + 80008414: f42a sd a0,40(sp) + 80008416: 02b11b23 sh a1,54(sp) + +000000008000841a <.LBB0_6>: + if self.itype == InodeType::Empty { + 8000841a: 00020597 auipc a1,0x20 + 8000841e: 00658593 addi a1,a1,6 # 80028420 <.L__unnamed_1> + 80008422: 00000097 auipc ra,0x0 + 80008426: 176080e7 jalr 374(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 8000842a: ec2a sd a0,24(sp) + 8000842c: a009 j 8000842e <.LBB0_6+0x14> + 8000842e: 6562 ld a0,24(sp) + 80008430: 4581 li a1,0 + 80008432: 00b50b63 beq a0,a1,80008448 <.LBB0_6+0x2e> + 80008436: a009 j 80008438 <.LBB0_6+0x1e> + unsafe { ptr::write_bytes(self, 0, 1); } + 80008438: 6522 ld a0,8(sp) + 8000843a: 4581 li a1,0 + 8000843c: 4605 li a2,1 + 8000843e: 00004097 auipc ra,0x4 + 80008442: 1e2080e7 jalr 482(ra) # 8000c620 <_ZN4core10intrinsics11write_bytes17h11bbad1db2a3ea1bE> + 80008446: a029 j 80008450 <.LBB0_6+0x36> + 80008448: 4505 li a0,1 + self.itype = itype; + Ok(()) + } else { + Err(()) + 8000844a: 02a103a3 sb a0,39(sp) + if self.itype == InodeType::Empty { + 8000844e: a809 j 80008460 <.LBB0_6+0x46> + self.itype = itype; + 80008450: 6542 ld a0,16(sp) + 80008452: 65a2 ld a1,8(sp) + 80008454: 00a59023 sh a0,0(a1) + 80008458: 4501 li a0,0 + Ok(()) + 8000845a: 02a103a3 sb a0,39(sp) + if self.itype == InodeType::Empty { + 8000845e: a009 j 80008460 <.LBB0_6+0x46> + } + } + 80008460: 02714503 lbu a0,39(sp) + 80008464: 70e2 ld ra,56(sp) + 80008466: 6121 addi sp,sp,64 + 80008468: 8082 ret + +Disassembly of section .text._ZN6kernel2fs6dinode8DirEntry3new17h74e849d4398bb7e4E: + +000000008000846a <_ZN6kernel2fs6dinode8DirEntry3new17h74e849d4398bb7e4E>: +} + +impl DirEntry { + pub const fn new() -> Self { + 8000846a: 7179 addi sp,sp,-48 + 8000846c: f406 sd ra,40(sp) + 8000846e: 4501 li a0,0 + Self { + inum: 0, + name: [0;DIRSIZ] + 80008470: 02a11223 sh a0,36(sp) + 80008474: d02a sw a0,32(sp) + 80008476: ec2a sd a0,24(sp) + Self { + 80008478: 00a11423 sh a0,8(sp) + 8000847c: 00a10513 addi a0,sp,10 + 80008480: 082c addi a1,sp,24 + 80008482: 4639 li a2,14 + 80008484: 0001e097 auipc ra,0x1e + 80008488: bfe080e7 jalr -1026(ra) # 80026082 + } + } + 8000848c: 6522 ld a0,8(sp) + 8000848e: 65c2 ld a1,16(sp) + 80008490: 70a2 ld ra,40(sp) + 80008492: 6145 addi sp,sp,48 + 80008494: 8082 ret + +Disassembly of section .text._ZN66_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..fmt..Debug$GT$3fmt17hb18bbbb2274bc1adE: + +0000000080008496 <_ZN66_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..fmt..Debug$GT$3fmt17hb18bbbb2274bc1adE>: +#[derive(Clone, Copy, PartialEq, Eq, Debug)] + 80008496: 7115 addi sp,sp,-224 + 80008498: ed86 sd ra,216(sp) + 8000849a: e42e sd a1,8(sp) + 8000849c: f12a sd a0,160(sp) + 8000849e: f52e sd a1,168(sp) + 800084a0: f02a sd a0,32(sp) + 800084a2: 00055503 lhu a0,0(a0) + 800084a6: e82a sd a0,16(sp) + 800084a8: 6542 ld a0,16(sp) + 800084aa: 050e slli a0,a0,0x3 + +00000000800084ac <.LBB2_14>: + 800084ac: 00020597 auipc a1,0x20 + 800084b0: f4c58593 addi a1,a1,-180 # 800283f8 <.LJTI2_0> + 800084b4: 952e add a0,a0,a1 + 800084b6: 6108 ld a0,0(a0) + 800084b8: 8502 jr a0 + +00000000800084ba <.LBB2_2>: + 800084ba: 65a2 ld a1,8(sp) + +00000000800084bc <.LBB2_15>: + 800084bc: 0001f617 auipc a2,0x1f + 800084c0: 24060613 addi a2,a2,576 # 800276fc <.LJTI3_0+0x7c> + 800084c4: 0128 addi a0,sp,136 + 800084c6: 4691 li a3,4 + 800084c8: 0001c097 auipc ra,0x1c + 800084cc: bfa080e7 jalr -1030(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800084d0: a075 j 8000857c <.LBB2_19+0x28> + ... + +00000000800084d4 <.LBB2_4>: + 800084d4: 65a2 ld a1,8(sp) + +00000000800084d6 <.LBB2_16>: + 800084d6: 00020617 auipc a2,0x20 + 800084da: f5b60613 addi a2,a2,-165 # 80028431 <.L__unnamed_3> + 800084de: 1028 addi a0,sp,40 + 800084e0: 4695 li a3,5 + 800084e2: 0001c097 auipc ra,0x1c + 800084e6: be0080e7 jalr -1056(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800084ea: a009 j 800084ec <.LBB2_16+0x16> + 800084ec: 1028 addi a0,sp,40 + 800084ee: e9aa sd a0,208(sp) + 800084f0: 0001b097 auipc ra,0x1b + 800084f4: 22a080e7 jalr 554(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800084f8: 00a10fa3 sb a0,31(sp) + 800084fc: a849 j 8000858e <.LBB2_19+0x3a> + +00000000800084fe <.LBB2_6>: + 800084fe: 65a2 ld a1,8(sp) + +0000000080008500 <.LBB2_17>: + 80008500: 00020617 auipc a2,0x20 + 80008504: f2860613 addi a2,a2,-216 # 80028428 <.L__unnamed_4> + 80008508: 0088 addi a0,sp,64 + 8000850a: 46a5 li a3,9 + 8000850c: 0001c097 auipc ra,0x1c + 80008510: bb6080e7 jalr -1098(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008514: a009 j 80008516 <.LBB2_17+0x16> + 80008516: 0088 addi a0,sp,64 + 80008518: e5aa sd a0,200(sp) + 8000851a: 0001b097 auipc ra,0x1b + 8000851e: 200080e7 jalr 512(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008522: 00a10fa3 sb a0,31(sp) + 80008526: a0a5 j 8000858e <.LBB2_19+0x3a> + +0000000080008528 <.LBB2_8>: + 80008528: 65a2 ld a1,8(sp) + +000000008000852a <.LBB2_18>: + 8000852a: 0001f617 auipc a2,0x1f + 8000852e: 1c660613 addi a2,a2,454 # 800276f0 <.LJTI3_0+0x70> + 80008532: 08a8 addi a0,sp,88 + 80008534: 4691 li a3,4 + 80008536: 0001c097 auipc ra,0x1c + 8000853a: b8c080e7 jalr -1140(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8000853e: a009 j 80008540 <.LBB2_18+0x16> + 80008540: 08a8 addi a0,sp,88 + 80008542: e1aa sd a0,192(sp) + 80008544: 0001b097 auipc ra,0x1b + 80008548: 1d6080e7 jalr 470(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8000854c: 00a10fa3 sb a0,31(sp) + 80008550: a83d j 8000858e <.LBB2_19+0x3a> + +0000000080008552 <.LBB2_10>: + 80008552: 65a2 ld a1,8(sp) + +0000000080008554 <.LBB2_19>: + 80008554: 00020617 auipc a2,0x20 + 80008558: ece60613 addi a2,a2,-306 # 80028422 <.L__unnamed_6> + 8000855c: 1888 addi a0,sp,112 + 8000855e: 4699 li a3,6 + 80008560: 0001c097 auipc ra,0x1c + 80008564: b62080e7 jalr -1182(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80008568: a009 j 8000856a <.LBB2_19+0x16> + 8000856a: 1888 addi a0,sp,112 + 8000856c: fd2a sd a0,184(sp) + 8000856e: 0001b097 auipc ra,0x1b + 80008572: 1ac080e7 jalr 428(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008576: 00a10fa3 sb a0,31(sp) + 8000857a: a811 j 8000858e <.LBB2_19+0x3a> + 8000857c: 0128 addi a0,sp,136 + 8000857e: f92a sd a0,176(sp) + 80008580: 0001b097 auipc ra,0x1b + 80008584: 19a080e7 jalr 410(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80008588: 00a10fa3 sb a0,31(sp) + 8000858c: a009 j 8000858e <.LBB2_19+0x3a> + 8000858e: 01f14503 lbu a0,31(sp) + 80008592: 60ee ld ra,216(sp) + 80008594: 612d addi sp,sp,224 + 80008596: 8082 ret + +Disassembly of section .text._ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE: + +0000000080008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE>: + 80008598: 1101 addi sp,sp,-32 + 8000859a: e42a sd a0,8(sp) + 8000859c: e82e sd a1,16(sp) + 8000859e: 00055503 lhu a0,0(a0) + 800085a2: 00a11e23 sh a0,28(sp) + 800085a6: 0005d583 lhu a1,0(a1) + 800085aa: 00b11f23 sh a1,30(sp) + 800085ae: 00b51763 bne a0,a1,800085bc <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x24> + 800085b2: a009 j 800085b4 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x1c> + 800085b4: 4505 li a0,1 + 800085b6: 00a103a3 sb a0,7(sp) + 800085ba: a029 j 800085c4 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x2c> + 800085bc: 4501 li a0,0 + 800085be: 00a103a3 sb a0,7(sp) + 800085c2: a009 j 800085c4 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x2c> + 800085c4: 00714503 lbu a0,7(sp) + 800085c8: 8905 andi a0,a0,1 + 800085ca: 4581 li a1,0 + 800085cc: 00b50763 beq a0,a1,800085da <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x42> + 800085d0: a009 j 800085d2 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x3a> + 800085d2: 4505 li a0,1 + 800085d4: 00a10323 sb a0,6(sp) + 800085d8: a029 j 800085e2 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x4a> + 800085da: 4501 li a0,0 + 800085dc: 00a10323 sb a0,6(sp) + 800085e0: a009 j 800085e2 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE+0x4a> + 800085e2: 00614503 lbu a0,6(sp) + 800085e6: 6105 addi sp,sp,32 + 800085e8: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc4fifo6Fifo_t4read17hbc09cc8bbfbda575E: + +00000000800085ea <_ZN6kernel3ipc4fifo6Fifo_t4read17hbc09cc8bbfbda575E>: + // fifo: Some(&mut pipe as *mut Pipe), + // name: s + // } + // } + + pub fn read(& self, addr: usize, len: usize) -> Result { + 800085ea: 7119 addi sp,sp,-128 + 800085ec: fc86 sd ra,120(sp) + 800085ee: e436 sd a3,8(sp) + 800085f0: e832 sd a2,16(sp) + 800085f2: ec2a sd a0,24(sp) + 800085f4: ecae sd a1,88(sp) + 800085f6: f0b2 sd a2,96(sp) + 800085f8: f4b6 sd a3,104(sp) + let pipe = unsafe{&mut *self.pipe.unwrap()}; + 800085fa: 6188 ld a0,0(a1) + 800085fc: 658c ld a1,8(a1) + +00000000800085fe <.LBB0_5>: + 800085fe: 00020617 auipc a2,0x20 + 80008602: e4a60613 addi a2,a2,-438 # 80028448 <.L__unnamed_1> + 80008606: 00007097 auipc ra,0x7 + 8000860a: fa4080e7 jalr -92(ra) # 8000f5aa <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E> + 8000860e: f02a sd a0,32(sp) + 80008610: a009 j 80008612 <.LBB0_5+0x14> + 80008612: 7502 ld a0,32(sp) + 80008614: f8aa sd a0,112(sp) + +0000000080008616 <.LBB0_6>: + + println!("In Fifo_t read"); + 80008616: 00020597 auipc a1,0x20 + 8000861a: e5a58593 addi a1,a1,-422 # 80028470 <.L__unnamed_2> + +000000008000861e <.LBB0_7>: + 8000861e: 00020697 auipc a3,0x20 + 80008622: e6268693 addi a3,a3,-414 # 80028480 <.L__unnamed_4> + 80008626: 1028 addi a0,sp,40 + 80008628: 4605 li a2,1 + 8000862a: 4701 li a4,0 + 8000862c: ffffd097 auipc ra,0xffffd + 80008630: f5e080e7 jalr -162(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80008634: a009 j 80008636 <.LBB0_7+0x18> + 80008636: 1028 addi a0,sp,40 + 80008638: 00016097 auipc ra,0x16 + 8000863c: 5c0080e7 jalr 1472(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80008640: a009 j 80008642 <.LBB0_7+0x24> + pipe.read(addr, len) + 80008642: 66a2 ld a3,8(sp) + 80008644: 6642 ld a2,16(sp) + 80008646: 7582 ld a1,32(sp) + 80008648: 6562 ld a0,24(sp) + 8000864a: 00002097 auipc ra,0x2 + 8000864e: 304080e7 jalr 772(ra) # 8000a94e <_ZN6kernel2fs4pipe4Pipe4read17h2c2acb00d7827debE> + 80008652: a009 j 80008654 <.LBB0_7+0x36> + } + 80008654: 70e6 ld ra,120(sp) + 80008656: 6109 addi sp,sp,128 + 80008658: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc4fifo6Fifo_t5write17h48134ffed519361eE: + +000000008000865a <_ZN6kernel3ipc4fifo6Fifo_t5write17h48134ffed519361eE>: + + pub fn write(&self, addr: usize, len: usize) -> Result { + 8000865a: 7119 addi sp,sp,-128 + 8000865c: fc86 sd ra,120(sp) + 8000865e: e436 sd a3,8(sp) + 80008660: e832 sd a2,16(sp) + 80008662: ec2a sd a0,24(sp) + 80008664: ecae sd a1,88(sp) + 80008666: f0b2 sd a2,96(sp) + 80008668: f4b6 sd a3,104(sp) + let pipe = unsafe{&mut *self.pipe.unwrap()}; + 8000866a: 6188 ld a0,0(a1) + 8000866c: 658c ld a1,8(a1) + +000000008000866e <.LBB1_5>: + 8000866e: 00020617 auipc a2,0x20 + 80008672: e1260613 addi a2,a2,-494 # 80028480 <.L__unnamed_4> + 80008676: 00007097 auipc ra,0x7 + 8000867a: f34080e7 jalr -204(ra) # 8000f5aa <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E> + 8000867e: f02a sd a0,32(sp) + 80008680: a009 j 80008682 <.LBB1_5+0x14> + 80008682: 7502 ld a0,32(sp) + 80008684: f8aa sd a0,112(sp) + +0000000080008686 <.LBB1_6>: + + println!("In Fifo_t write"); + 80008686: 00020597 auipc a1,0x20 + 8000868a: e1258593 addi a1,a1,-494 # 80028498 <.L__unnamed_5> + +000000008000868e <.LBB1_7>: + 8000868e: 00020697 auipc a3,0x20 + 80008692: df268693 addi a3,a3,-526 # 80028480 <.L__unnamed_4> + 80008696: 1028 addi a0,sp,40 + 80008698: 4605 li a2,1 + 8000869a: 4701 li a4,0 + 8000869c: ffffd097 auipc ra,0xffffd + 800086a0: eee080e7 jalr -274(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800086a4: a009 j 800086a6 <.LBB1_7+0x18> + 800086a6: 1028 addi a0,sp,40 + 800086a8: 00016097 auipc ra,0x16 + 800086ac: 550080e7 jalr 1360(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800086b0: a009 j 800086b2 <.LBB1_7+0x24> + pipe.write(addr, len) + 800086b2: 66a2 ld a3,8(sp) + 800086b4: 6642 ld a2,16(sp) + 800086b6: 7582 ld a1,32(sp) + 800086b8: 6562 ld a0,24(sp) + 800086ba: 00002097 auipc ra,0x2 + 800086be: 52a080e7 jalr 1322(ra) # 8000abe4 <_ZN6kernel2fs4pipe4Pipe5write17h441574030d245cddE> + 800086c2: a009 j 800086c4 <.LBB1_7+0x36> + } + 800086c4: 70e6 ld ra,120(sp) + 800086c6: 6109 addi sp,sp,128 + 800086c8: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc4fifo6Fifo_t5close17ha4763e9d080061b5E: + +00000000800086ca <_ZN6kernel3ipc4fifo6Fifo_t5close17ha4763e9d080061b5E>: + + pub fn close(&self){ + 800086ca: 711d addi sp,sp,-96 + 800086cc: ec86 sd ra,88(sp) + 800086ce: 85aa mv a1,a0 + 800086d0: e42e sd a1,8(sp) + 800086d2: e4ae sd a1,72(sp) + let pipe = unsafe{&mut *self.pipe.unwrap()}; + 800086d4: 6188 ld a0,0(a1) + 800086d6: 658c ld a1,8(a1) + +00000000800086d8 <.LBB2_7>: + 800086d8: 00020617 auipc a2,0x20 + 800086dc: dd060613 addi a2,a2,-560 # 800284a8 <.L__unnamed_6> + 800086e0: 00007097 auipc ra,0x7 + 800086e4: eca080e7 jalr -310(ra) # 8000f5aa <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E> + 800086e8: e82a sd a0,16(sp) + 800086ea: a009 j 800086ec <.LBB2_7+0x14> + 800086ec: 6542 ld a0,16(sp) + 800086ee: e8aa sd a0,80(sp) + +00000000800086f0 <.LBB2_8>: + + println!("In Fifo_t close"); + 800086f0: 00020597 auipc a1,0x20 + 800086f4: dd058593 addi a1,a1,-560 # 800284c0 <.L__unnamed_7> + +00000000800086f8 <.LBB2_9>: + 800086f8: 00020697 auipc a3,0x20 + 800086fc: d8868693 addi a3,a3,-632 # 80028480 <.L__unnamed_4> + 80008700: 0828 addi a0,sp,24 + 80008702: 4605 li a2,1 + 80008704: 4701 li a4,0 + 80008706: ffffd097 auipc ra,0xffffd + 8000870a: e84080e7 jalr -380(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000870e: a009 j 80008710 <.LBB2_9+0x18> + 80008710: 0828 addi a0,sp,24 + 80008712: 00016097 auipc ra,0x16 + 80008716: 4e6080e7 jalr 1254(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000871a: a009 j 8000871c <.LBB2_9+0x24> + pipe.close(true); + 8000871c: 6542 ld a0,16(sp) + 8000871e: 4585 li a1,1 + 80008720: 00002097 auipc ra,0x2 + 80008724: 738080e7 jalr 1848(ra) # 8000ae58 <_ZN6kernel2fs4pipe4Pipe5close17h80469b7219759a66E> + 80008728: a009 j 8000872a <.LBB2_9+0x32> + pipe.close(false); + 8000872a: 6542 ld a0,16(sp) + 8000872c: 4581 li a1,0 + 8000872e: 00002097 auipc ra,0x2 + 80008732: 72a080e7 jalr 1834(ra) # 8000ae58 <_ZN6kernel2fs4pipe4Pipe5close17h80469b7219759a66E> + 80008736: a009 j 80008738 <.LBB2_9+0x40> + + drop(self); + 80008738: 6522 ld a0,8(sp) + 8000873a: 00015097 auipc ra,0x15 + 8000873e: 6f6080e7 jalr 1782(ra) # 8001de30 <_ZN4core3mem4drop17h391b2d12871564bdE> + 80008742: a009 j 80008744 <.LBB2_9+0x4c> + } + 80008744: 60e6 ld ra,88(sp) + 80008746: 6125 addi sp,sp,96 + 80008748: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE: + +000000008000874a <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE>: + fifos_lock: Spinlock::new((), "fifos_lock"), + fifoID: 5 + } + } + + pub fn alloc(&mut self, s: [u8; NAME_LEN]) -> Option{ + 8000874a: 7115 addi sp,sp,-224 + 8000874c: ed86 sd ra,216(sp) + 8000874e: e0ae sd a1,64(sp) + 80008750: e4aa sd a0,72(sp) + 80008752: f52a sd a0,168(sp) + + let pipe = Pipe::init(); + 80008754: 00002097 auipc ra,0x2 + 80008758: 072080e7 jalr 114(ra) # 8000a7c6 <_ZN6kernel2fs4pipe4Pipe4init17he2ee825996c6e406E> + 8000875c: 85aa mv a1,a0 + 8000875e: e8ae sd a1,80(sp) + 80008760: f92a sd a0,176(sp) + 80008762: a009 j 80008764 <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x1a> + // let pipe_guard = unsafe{ *PipeGuard::alloc() }; + // let mut pipe = Self { + // guard: Spinlock::new(pipe_guard, "pipe") + // }; + + let guard = self.fifos_lock.acquire(); + 80008764: 6526 ld a0,72(sp) + 80008766: 70050513 addi a0,a0,1792 + 8000876a: 70050513 addi a0,a0,1792 + 8000876e: 00009097 auipc ra,0x9 + 80008772: 8d4080e7 jalr -1836(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80008776: 85aa mv a1,a0 + 80008778: fc2e sd a1,56(sp) + 8000877a: fd2a sd a0,184(sp) + 8000877c: a009 j 8000877e <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x34> + + + for fifo_iter in self.fifos.iter_mut() { + 8000877e: 6526 ld a0,72(sp) + 80008780: 04000593 li a1,64 + 80008784: ffffa097 auipc ra,0xffffa + 80008788: fb2080e7 jalr -78(ra) # 80002736 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hac04d36b27f3ea4eE> + 8000878c: f42a sd a0,40(sp) + 8000878e: f82e sd a1,48(sp) + 80008790: a009 j 80008792 <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x48> + 80008792: 75c2 ld a1,48(sp) + 80008794: 7522 ld a0,40(sp) + 80008796: 00003097 auipc ra,0x3 + 8000879a: 12a080e7 jalr 298(ra) # 8000b8c0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h8c969beb07468abbE> + 8000879e: ec2a sd a0,24(sp) + 800087a0: f02e sd a1,32(sp) + 800087a2: a009 j 800087a4 <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x5a> + 800087a4: 7502 ld a0,32(sp) + 800087a6: 65e2 ld a1,24(sp) + 800087a8: f4ae sd a1,104(sp) + 800087aa: f8aa sd a0,112(sp) + 800087ac: a009 j 800087ae <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x64> + 800087ae: 10a8 addi a0,sp,104 + 800087b0: 00003097 auipc ra,0x3 + 800087b4: 35a080e7 jalr 858(ra) # 8000bb0a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E> + 800087b8: fcaa sd a0,120(sp) + 800087ba: a009 j 800087bc <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x72> + 800087bc: 7566 ld a0,120(sp) + 800087be: 00a035b3 snez a1,a0 + 800087c2: 4581 li a1,0 + 800087c4: 00b50463 beq a0,a1,800087cc <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x82> + 800087c8: a009 j 800087ca <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x80> + 800087ca: a801 j 800087da <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x90> + + drop(guard); + return Some(fifo_iter.ID); + } + } + drop(guard); + 800087cc: 7562 ld a0,56(sp) + 800087ce: 00015097 auipc ra,0x15 + 800087d2: 61a080e7 jalr 1562(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 800087d6: aa3d j 80008914 <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x1ca> + for fifo_iter in self.fifos.iter_mut() { + 800087d8: 0000 unimp + 800087da: 7566 ld a0,120(sp) + 800087dc: e82a sd a0,16(sp) + 800087de: e1aa sd a0,192(sp) + 800087e0: e5aa sd a0,200(sp) + 800087e2: e9aa sd a0,208(sp) + if fifo_iter.used == false { + 800087e4: 03054503 lbu a0,48(a0) + 800087e8: 8905 andi a0,a0,1 + 800087ea: 10051263 bnez a0,800088ee <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x1a4> + 800087ee: a009 j 800087f0 <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0xa6> + fifo_iter.pipe = Some(pipe); + 800087f0: 6542 ld a0,16(sp) + 800087f2: 6586 ld a1,64(sp) + 800087f4: 6646 ld a2,80(sp) + 800087f6: e532 sd a2,136(sp) + 800087f8: 4685 li a3,1 + 800087fa: e036 sd a3,0(sp) + 800087fc: e136 sd a3,128(sp) + 800087fe: e114 sd a3,0(a0) + 80008800: e510 sd a2,8(a0) + fifo_iter.name = s; + 80008802: 0105c683 lbu a3,16(a1) + 80008806: 0115c603 lbu a2,17(a1) + 8000880a: 0622 slli a2,a2,0x8 + 8000880c: 8ed1 or a3,a3,a2 + 8000880e: 0125c703 lbu a4,18(a1) + 80008812: 0135c603 lbu a2,19(a1) + 80008816: 0622 slli a2,a2,0x8 + 80008818: 8e59 or a2,a2,a4 + 8000881a: 0642 slli a2,a2,0x10 + 8000881c: 8ed1 or a3,a3,a2 + 8000881e: 0145c703 lbu a4,20(a1) + 80008822: 0155c603 lbu a2,21(a1) + 80008826: 0622 slli a2,a2,0x8 + 80008828: 8f51 or a4,a4,a2 + 8000882a: 0165c783 lbu a5,22(a1) + 8000882e: 0175c603 lbu a2,23(a1) + 80008832: 0622 slli a2,a2,0x8 + 80008834: 8e5d or a2,a2,a5 + 80008836: 0642 slli a2,a2,0x10 + 80008838: 8e59 or a2,a2,a4 + 8000883a: 1602 slli a2,a2,0x20 + 8000883c: 8e55 or a2,a2,a3 + 8000883e: f132 sd a2,160(sp) + 80008840: 0085c683 lbu a3,8(a1) + 80008844: 0095c603 lbu a2,9(a1) + 80008848: 0622 slli a2,a2,0x8 + 8000884a: 8ed1 or a3,a3,a2 + 8000884c: 00a5c703 lbu a4,10(a1) + 80008850: 00b5c603 lbu a2,11(a1) + 80008854: 0622 slli a2,a2,0x8 + 80008856: 8e59 or a2,a2,a4 + 80008858: 0642 slli a2,a2,0x10 + 8000885a: 8ed1 or a3,a3,a2 + 8000885c: 00c5c703 lbu a4,12(a1) + 80008860: 00d5c603 lbu a2,13(a1) + 80008864: 0622 slli a2,a2,0x8 + 80008866: 8f51 or a4,a4,a2 + 80008868: 00e5c783 lbu a5,14(a1) + 8000886c: 00f5c603 lbu a2,15(a1) + 80008870: 0622 slli a2,a2,0x8 + 80008872: 8e5d or a2,a2,a5 + 80008874: 0642 slli a2,a2,0x10 + 80008876: 8e59 or a2,a2,a4 + 80008878: 1602 slli a2,a2,0x20 + 8000887a: 8e55 or a2,a2,a3 + 8000887c: ed32 sd a2,152(sp) + 8000887e: 0005c683 lbu a3,0(a1) + 80008882: 0015c603 lbu a2,1(a1) + 80008886: 0622 slli a2,a2,0x8 + 80008888: 8ed1 or a3,a3,a2 + 8000888a: 0025c703 lbu a4,2(a1) + 8000888e: 0035c603 lbu a2,3(a1) + 80008892: 0622 slli a2,a2,0x8 + 80008894: 8e59 or a2,a2,a4 + 80008896: 0642 slli a2,a2,0x10 + 80008898: 8e55 or a2,a2,a3 + 8000889a: 0045c703 lbu a4,4(a1) + 8000889e: 0055c683 lbu a3,5(a1) + 800088a2: 06a2 slli a3,a3,0x8 + 800088a4: 8ed9 or a3,a3,a4 + 800088a6: 0065c703 lbu a4,6(a1) + 800088aa: 0075c583 lbu a1,7(a1) + 800088ae: 05a2 slli a1,a1,0x8 + 800088b0: 8dd9 or a1,a1,a4 + 800088b2: 05c2 slli a1,a1,0x10 + 800088b4: 8dd5 or a1,a1,a3 + 800088b6: 1582 slli a1,a1,0x20 + 800088b8: 8dd1 or a1,a1,a2 + 800088ba: e92e sd a1,144(sp) + 800088bc: 0561 addi a0,a0,24 + 800088be: 090c addi a1,sp,144 + 800088c0: 4661 li a2,24 + 800088c2: 0001d097 auipc ra,0x1d + 800088c6: 7c0080e7 jalr 1984(ra) # 80026082 + 800088ca: 6582 ld a1,0(sp) + 800088cc: 6642 ld a2,16(sp) + fifo_iter.used = true; + 800088ce: 6526 ld a0,72(sp) + 800088d0: 02b60823 sb a1,48(a2) + fifo_iter.ID = self.fifoID; + 800088d4: 71050513 addi a0,a0,1808 + 800088d8: 71053583 ld a1,1808(a0) + 800088dc: ea0c sd a1,16(a2) + self.fifoID += 1; + 800088de: 71053583 ld a1,1808(a0) + 800088e2: 00158513 addi a0,a1,1 + 800088e6: e42a sd a0,8(sp) + 800088e8: 02b56e63 bltu a0,a1,80008924 <.LBB3_18> + 800088ec: a011 j 800088f0 <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x1a6> + for fifo_iter in self.fifos.iter_mut() { + 800088ee: b5c1 j 800087ae <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x64> + self.fifoID += 1; + 800088f0: 7562 ld a0,56(sp) + 800088f2: 65a2 ld a1,8(sp) + 800088f4: 6626 ld a2,72(sp) + 800088f6: 71060613 addi a2,a2,1808 + 800088fa: 70b63823 sd a1,1808(a2) + drop(guard); + 800088fe: 00015097 auipc ra,0x15 + 80008902: 4ea080e7 jalr 1258(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80008906: a009 j 80008908 <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x1be> + return Some(fifo_iter.ID); + 80008908: 6542 ld a0,16(sp) + 8000890a: 6908 ld a0,16(a0) + 8000890c: f0aa sd a0,96(sp) + 8000890e: 4505 li a0,1 + 80008910: ecaa sd a0,88(sp) + None + } + 80008912: a021 j 8000891a <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x1d0> + 80008914: 4501 li a0,0 + None + 80008916: ecaa sd a0,88(sp) + } + 80008918: a009 j 8000891a <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE+0x1d0> + 8000891a: 6566 ld a0,88(sp) + 8000891c: 7586 ld a1,96(sp) + 8000891e: 60ee ld ra,216(sp) + 80008920: 612d addi sp,sp,224 + 80008922: 8082 ret + +0000000080008924 <.LBB3_18>: + self.fifoID += 1; + 80008924: 00020517 auipc a0,0x20 + 80008928: bdc50513 addi a0,a0,-1060 # 80028500 + +000000008000892c <.LBB3_19>: + 8000892c: 00020617 auipc a2,0x20 + 80008930: bb460613 addi a2,a2,-1100 # 800284e0 <.L__unnamed_8> + 80008934: 45f1 li a1,28 + 80008936: 0001b097 auipc ra,0x1b + 8000893a: 80e080e7 jalr -2034(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E: + +0000000080008940 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E>: + + pub fn get(&mut self, name: [u8; NAME_LEN]) -> Option { + 80008940: 7111 addi sp,sp,-256 + 80008942: fd86 sd ra,248(sp) + 80008944: e0ae sd a1,64(sp) + 80008946: e4aa sd a0,72(sp) + 80008948: e5aa sd a0,200(sp) + let fifo_guard = self.fifos_lock.acquire(); + 8000894a: 70050513 addi a0,a0,1792 + 8000894e: 70050513 addi a0,a0,1792 + 80008952: 00008097 auipc ra,0x8 + 80008956: 6f0080e7 jalr 1776(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000895a: 85aa mv a1,a0 + 8000895c: e8ae sd a1,80(sp) + 8000895e: e9aa sd a0,208(sp) + 80008960: a009 j 80008962 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x22> + + // let fifo_ret: &mut Fifo_t; + for fifo_iter in self.fifos.iter_mut() { + 80008962: 6526 ld a0,72(sp) + 80008964: 04000593 li a1,64 + 80008968: ffffa097 auipc ra,0xffffa + 8000896c: dce080e7 jalr -562(ra) # 80002736 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hac04d36b27f3ea4eE> + 80008970: f82a sd a0,48(sp) + 80008972: fc2e sd a1,56(sp) + 80008974: a009 j 80008976 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x36> + 80008976: 75e2 ld a1,56(sp) + 80008978: 7542 ld a0,48(sp) + 8000897a: 00003097 auipc ra,0x3 + 8000897e: f46080e7 jalr -186(ra) # 8000b8c0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h8c969beb07468abbE> + 80008982: f02a sd a0,32(sp) + 80008984: f42e sd a1,40(sp) + 80008986: a009 j 80008988 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x48> + 80008988: 7522 ld a0,40(sp) + 8000898a: 7582 ld a1,32(sp) + 8000898c: f4ae sd a1,104(sp) + 8000898e: f8aa sd a0,112(sp) + 80008990: a009 j 80008992 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x52> + 80008992: 10a8 addi a0,sp,104 + 80008994: 00003097 auipc ra,0x3 + 80008998: 176080e7 jalr 374(ra) # 8000bb0a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E> + 8000899c: fcaa sd a0,120(sp) + 8000899e: a009 j 800089a0 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x60> + 800089a0: 7566 ld a0,120(sp) + 800089a2: 00a035b3 snez a1,a0 + 800089a6: 4581 li a1,0 + 800089a8: 00b50463 beq a0,a1,800089b0 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x70> + 800089ac: a009 j 800089ae <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x6e> + 800089ae: a801 j 800089be <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x7e> + println!("In FifoTable get, the id is {}", fifo_iter.ID); + drop(fifo_guard); + return Some(fifo_iter.ID); + } + } + drop(fifo_guard); + 800089b0: 6546 ld a0,80(sp) + 800089b2: 00015097 auipc ra,0x15 + 800089b6: 436080e7 jalr 1078(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 800089ba: a079 j 80008a48 <.LBB4_20+0x3e> + for fifo_iter in self.fifos.iter_mut() { + 800089bc: 0000 unimp + 800089be: 6586 ld a1,64(sp) + 800089c0: 7566 ld a0,120(sp) + 800089c2: e82a sd a0,16(sp) + 800089c4: edaa sd a0,216(sp) + 800089c6: f1aa sd a0,224(sp) + 800089c8: f5aa sd a0,232(sp) + if fifo_iter.name == name { + 800089ca: 0561 addi a0,a0,24 + 800089cc: 0000e097 auipc ra,0xe + 800089d0: e52080e7 jalr -430(ra) # 8001681e <_ZN4core5array103_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$B$u3b$$u20$N$u5d$$GT$$u20$for$u20$$u5b$A$u3b$$u20$N$u5d$$GT$2eq17h3cd1f867d341989fE> + 800089d4: ec2a sd a0,24(sp) + 800089d6: a009 j 800089d8 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x98> + 800089d8: 6562 ld a0,24(sp) + 800089da: 4581 li a1,0 + 800089dc: 02b50263 beq a0,a1,80008a00 <.LBB4_19+0x16> + 800089e0: a009 j 800089e2 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0xa2> + println!("In FifoTable get, the id is {}", fifo_iter.ID); + 800089e2: 6542 ld a0,16(sp) + 800089e4: 0541 addi a0,a0,16 + 800089e6: e1aa sd a0,192(sp) + 800089e8: f9aa sd a0,240(sp) + +00000000800089ea <.LBB4_19>: + 800089ea: 0001d597 auipc a1,0x1d + 800089ee: eb658593 addi a1,a1,-330 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800089f2: 00018097 auipc ra,0x18 + 800089f6: b7c080e7 jalr -1156(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800089fa: e02a sd a0,0(sp) + 800089fc: e42e sd a1,8(sp) + 800089fe: a011 j 80008a02 <.LBB4_19+0x18> + for fifo_iter in self.fifos.iter_mut() { + 80008a00: bf49 j 80008992 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E+0x52> + println!("In FifoTable get, the id is {}", fifo_iter.ID); + 80008a02: 6522 ld a0,8(sp) + 80008a04: 6582 ld a1,0(sp) + 80008a06: f92e sd a1,176(sp) + 80008a08: fd2a sd a0,184(sp) + +0000000080008a0a <.LBB4_20>: + 80008a0a: 00020597 auipc a1,0x20 + 80008a0e: b3658593 addi a1,a1,-1226 # 80028540 <.L__unnamed_9> + 80008a12: 0108 addi a0,sp,128 + 80008a14: 4609 li a2,2 + 80008a16: 1914 addi a3,sp,176 + 80008a18: 4705 li a4,1 + 80008a1a: ffffd097 auipc ra,0xffffd + 80008a1e: b70080e7 jalr -1168(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80008a22: a009 j 80008a24 <.LBB4_20+0x1a> + 80008a24: 0108 addi a0,sp,128 + 80008a26: 00016097 auipc ra,0x16 + 80008a2a: 1d2080e7 jalr 466(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80008a2e: a009 j 80008a30 <.LBB4_20+0x26> + drop(fifo_guard); + 80008a30: 6546 ld a0,80(sp) + 80008a32: 00015097 auipc ra,0x15 + 80008a36: 3b6080e7 jalr 950(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80008a3a: a009 j 80008a3c <.LBB4_20+0x32> + return Some(fifo_iter.ID); + 80008a3c: 6542 ld a0,16(sp) + 80008a3e: 6908 ld a0,16(a0) + 80008a40: f0aa sd a0,96(sp) + 80008a42: 4505 li a0,1 + 80008a44: ecaa sd a0,88(sp) + None + } + 80008a46: a021 j 80008a4e <.LBB4_20+0x44> + 80008a48: 4501 li a0,0 + None + 80008a4a: ecaa sd a0,88(sp) + } + 80008a4c: a009 j 80008a4e <.LBB4_20+0x44> + 80008a4e: 6566 ld a0,88(sp) + 80008a50: 7586 ld a1,96(sp) + 80008a52: 70ee ld ra,248(sp) + 80008a54: 6111 addi sp,sp,256 + 80008a56: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E: + +0000000080008a58 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E>: + + pub fn getByID(&mut self, id: usize) -> Option<*mut Fifo_t>{ + 80008a58: 7135 addi sp,sp,-160 + 80008a5a: ed06 sd ra,152(sp) + 80008a5c: f42e sd a1,40(sp) + 80008a5e: f82a sd a0,48(sp) + 80008a60: f4aa sd a0,104(sp) + 80008a62: f8ae sd a1,112(sp) + let guard = self.fifos_lock.acquire(); + 80008a64: 70050513 addi a0,a0,1792 + 80008a68: 70050513 addi a0,a0,1792 + 80008a6c: 00008097 auipc ra,0x8 + 80008a70: 5d6080e7 jalr 1494(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80008a74: 85aa mv a1,a0 + 80008a76: fc2e sd a1,56(sp) + 80008a78: fcaa sd a0,120(sp) + 80008a7a: a009 j 80008a7c <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x24> + for it in self.fifos.iter_mut() { + 80008a7c: 7542 ld a0,48(sp) + 80008a7e: 04000593 li a1,64 + 80008a82: ffffa097 auipc ra,0xffffa + 80008a86: cb4080e7 jalr -844(ra) # 80002736 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hac04d36b27f3ea4eE> + 80008a8a: ec2a sd a0,24(sp) + 80008a8c: f02e sd a1,32(sp) + 80008a8e: a009 j 80008a90 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x38> + 80008a90: 7582 ld a1,32(sp) + 80008a92: 6562 ld a0,24(sp) + 80008a94: 00003097 auipc ra,0x3 + 80008a98: e2c080e7 jalr -468(ra) # 8000b8c0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h8c969beb07468abbE> + 80008a9c: e42a sd a0,8(sp) + 80008a9e: e82e sd a1,16(sp) + 80008aa0: a009 j 80008aa2 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x4a> + 80008aa2: 6542 ld a0,16(sp) + 80008aa4: 65a2 ld a1,8(sp) + 80008aa6: e8ae sd a1,80(sp) + 80008aa8: ecaa sd a0,88(sp) + 80008aaa: a009 j 80008aac <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x54> + 80008aac: 0888 addi a0,sp,80 + 80008aae: 00003097 auipc ra,0x3 + 80008ab2: 05c080e7 jalr 92(ra) # 8000bb0a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E> + 80008ab6: f0aa sd a0,96(sp) + 80008ab8: a009 j 80008aba <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x62> + 80008aba: 7506 ld a0,96(sp) + 80008abc: 00a035b3 snez a1,a0 + 80008ac0: 4581 li a1,0 + 80008ac2: 00b50463 beq a0,a1,80008aca <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x72> + 80008ac6: a009 j 80008ac8 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x70> + 80008ac8: a801 j 80008ad8 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x80> + if it.ID == id { + drop(guard); + return Some(it as *mut Fifo_t); + } + } + drop(guard); + 80008aca: 7562 ld a0,56(sp) + 80008acc: 00015097 auipc ra,0x15 + 80008ad0: 31c080e7 jalr 796(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80008ad4: a805 j 80008b04 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0xac> + for it in self.fifos.iter_mut() { + 80008ad6: 0000 unimp + 80008ad8: 75a2 ld a1,40(sp) + 80008ada: 7506 ld a0,96(sp) + 80008adc: e02a sd a0,0(sp) + 80008ade: e12a sd a0,128(sp) + 80008ae0: e52a sd a0,136(sp) + 80008ae2: e92a sd a0,144(sp) + if it.ID == id { + 80008ae4: 6908 ld a0,16(a0) + 80008ae6: 00b51963 bne a0,a1,80008af8 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0xa0> + 80008aea: a009 j 80008aec <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x94> + drop(guard); + 80008aec: 7562 ld a0,56(sp) + 80008aee: 00015097 auipc ra,0x15 + 80008af2: 2fa080e7 jalr 762(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80008af6: a011 j 80008afa <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0xa2> + for it in self.fifos.iter_mut() { + 80008af8: bf55 j 80008aac <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0x54> + return Some(it as *mut Fifo_t); + 80008afa: 6502 ld a0,0(sp) + 80008afc: e4aa sd a0,72(sp) + 80008afe: 4505 li a0,1 + 80008b00: e0aa sd a0,64(sp) + None + } + 80008b02: a021 j 80008b0a <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0xb2> + 80008b04: 4501 li a0,0 + None + 80008b06: e0aa sd a0,64(sp) + } + 80008b08: a009 j 80008b0a <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E+0xb2> + 80008b0a: 6506 ld a0,64(sp) + 80008b0c: 65a6 ld a1,72(sp) + 80008b0e: 60ea ld ra,152(sp) + 80008b10: 610d addi sp,sp,160 + 80008b12: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E: + +0000000080008b14 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E>: + + pub fn put(&mut self, id: usize) -> Option{ + 80008b14: 716d addi sp,sp,-272 + 80008b16: e606 sd ra,264(sp) + 80008b18: e0aa sd a0,64(sp) + 80008b1a: e8ae sd a1,80(sp) + 80008b1c: edaa sd a0,216(sp) + let fifo_guard = self.fifos_lock.acquire(); + 80008b1e: 70050513 addi a0,a0,1792 + 80008b22: 70050513 addi a0,a0,1792 + 80008b26: 00008097 auipc ra,0x8 + 80008b2a: 51c080e7 jalr 1308(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80008b2e: 85aa mv a1,a0 + 80008b30: e4ae sd a1,72(sp) + 80008b32: f1aa sd a0,224(sp) + 80008b34: a009 j 80008b36 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x22> + + for fifo_iter in self.fifos.iter_mut() { + 80008b36: 6506 ld a0,64(sp) + 80008b38: 04000593 li a1,64 + 80008b3c: ffffa097 auipc ra,0xffffa + 80008b40: bfa080e7 jalr -1030(ra) # 80002736 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hac04d36b27f3ea4eE> + 80008b44: f82a sd a0,48(sp) + 80008b46: fc2e sd a1,56(sp) + 80008b48: a009 j 80008b4a <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x36> + 80008b4a: 75e2 ld a1,56(sp) + 80008b4c: 7542 ld a0,48(sp) + 80008b4e: 00003097 auipc ra,0x3 + 80008b52: d72080e7 jalr -654(ra) # 8000b8c0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h8c969beb07468abbE> + 80008b56: f02a sd a0,32(sp) + 80008b58: f42e sd a1,40(sp) + 80008b5a: a009 j 80008b5c <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x48> + 80008b5c: 7522 ld a0,40(sp) + 80008b5e: 7582 ld a1,32(sp) + 80008b60: f4ae sd a1,104(sp) + 80008b62: f8aa sd a0,112(sp) + 80008b64: a009 j 80008b66 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x52> + 80008b66: 10a8 addi a0,sp,104 + 80008b68: 00003097 auipc ra,0x3 + 80008b6c: fa2080e7 jalr -94(ra) # 8000bb0a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E> + 80008b70: fcaa sd a0,120(sp) + 80008b72: a009 j 80008b74 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x60> + 80008b74: 7566 ld a0,120(sp) + 80008b76: 00a035b3 snez a1,a0 + 80008b7a: 4581 li a1,0 + 80008b7c: 00b50463 beq a0,a1,80008b84 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x70> + 80008b80: a009 j 80008b82 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x6e> + 80008b82: a801 j 80008b92 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x7e> + + drop(fifo_guard); + return Some(0); + } + } + drop(fifo_guard); + 80008b84: 6526 ld a0,72(sp) + 80008b86: 00015097 auipc ra,0x15 + 80008b8a: 262080e7 jalr 610(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80008b8e: a879 j 80008c2c <.LBB6_20+0x3c> + for fifo_iter in self.fifos.iter_mut() { + 80008b90: 0000 unimp + 80008b92: 7566 ld a0,120(sp) + 80008b94: ec2a sd a0,24(sp) + 80008b96: f5aa sd a0,232(sp) + 80008b98: f9aa sd a0,240(sp) + 80008b9a: fdaa sd a0,248(sp) + if fifo_iter.ID == id { + 80008b9c: 6908 ld a0,16(a0) + 80008b9e: 65c6 ld a1,80(sp) + 80008ba0: 00b51963 bne a0,a1,80008bb2 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x9e> + 80008ba4: a009 j 80008ba6 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x92> + fifo_iter.close(); + 80008ba6: 6562 ld a0,24(sp) + 80008ba8: 00000097 auipc ra,0x0 + 80008bac: b22080e7 jalr -1246(ra) # 800086ca <_ZN6kernel3ipc4fifo6Fifo_t5close17ha4763e9d080061b5E> + 80008bb0: a011 j 80008bb4 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0xa0> + for fifo_iter in self.fifos.iter_mut() { + 80008bb2: bf55 j 80008b66 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E+0x52> + 80008bb4: 65e2 ld a1,24(sp) + 80008bb6: 4501 li a0,0 + fifo_iter.pipe = None; + 80008bb8: e12a sd a0,128(sp) + 80008bba: 662a ld a2,136(sp) + 80008bbc: e188 sd a0,0(a1) + 80008bbe: e590 sd a2,8(a1) + fifo_iter.name = [0; NAME_LEN]; + 80008bc0: ed88 sd a0,24(a1) + 80008bc2: f188 sd a0,32(a1) + 80008bc4: f588 sd a0,40(a1) + fifo_iter.used = false; + 80008bc6: 02a58823 sb a0,48(a1) + fifo_iter.ID = 0; + 80008bca: e988 sd a0,16(a1) + 80008bcc: 0888 addi a0,sp,80 + println!("In FifoTable put, the id is {}", id); + 80008bce: e9aa sd a0,208(sp) + 80008bd0: e22a sd a0,256(sp) + +0000000080008bd2 <.LBB6_19>: + 80008bd2: 0001d597 auipc a1,0x1d + 80008bd6: cce58593 addi a1,a1,-818 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80008bda: 00018097 auipc ra,0x18 + 80008bde: 994080e7 jalr -1644(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80008be2: e42a sd a0,8(sp) + 80008be4: e82e sd a1,16(sp) + 80008be6: a009 j 80008be8 <.LBB6_19+0x16> + 80008be8: 6542 ld a0,16(sp) + 80008bea: 65a2 ld a1,8(sp) + 80008bec: e1ae sd a1,192(sp) + 80008bee: e5aa sd a0,200(sp) + +0000000080008bf0 <.LBB6_20>: + 80008bf0: 00020597 auipc a1,0x20 + 80008bf4: 99058593 addi a1,a1,-1648 # 80028580 <.L__unnamed_10> + 80008bf8: 0908 addi a0,sp,144 + 80008bfa: 4609 li a2,2 + 80008bfc: 0194 addi a3,sp,192 + 80008bfe: 4705 li a4,1 + 80008c00: ffffd097 auipc ra,0xffffd + 80008c04: 98a080e7 jalr -1654(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80008c08: a009 j 80008c0a <.LBB6_20+0x1a> + 80008c0a: 0908 addi a0,sp,144 + 80008c0c: 00016097 auipc ra,0x16 + 80008c10: fec080e7 jalr -20(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80008c14: a009 j 80008c16 <.LBB6_20+0x26> + drop(fifo_guard); + 80008c16: 6526 ld a0,72(sp) + 80008c18: 00015097 auipc ra,0x15 + 80008c1c: 1d0080e7 jalr 464(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80008c20: a009 j 80008c22 <.LBB6_20+0x32> + 80008c22: 4501 li a0,0 + return Some(0); + 80008c24: f0aa sd a0,96(sp) + 80008c26: 4505 li a0,1 + 80008c28: ecaa sd a0,88(sp) + None + } + 80008c2a: a021 j 80008c32 <.LBB6_20+0x42> + 80008c2c: 4501 li a0,0 + None + 80008c2e: ecaa sd a0,88(sp) + } + 80008c30: a009 j 80008c32 <.LBB6_20+0x42> + 80008c32: 6566 ld a0,88(sp) + 80008c34: 7586 ld a1,96(sp) + 80008c36: 60b2 ld ra,264(sp) + 80008c38: 6151 addi sp,sp,272 + 80008c3a: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout10size_align17h358c0d001efe79fbE: + +0000000080008c3c <_ZN4core5alloc6layout10size_align17h358c0d001efe79fbE>: +// could be inlined, the previous attempts to do so made rustc +// slower: +// +// * https://github.com/rust-lang/rust/pull/72189 +// * https://github.com/rust-lang/rust/pull/79827 +const fn size_align() -> (usize, usize) { + 80008c3c: 1101 addi sp,sp,-32 + (mem::size_of::(), mem::align_of::()) + 80008c3e: a009 j 80008c40 <_ZN4core5alloc6layout10size_align17h358c0d001efe79fbE+0x4> + 80008c40: 6505 lui a0,0x1 + 80008c42: e02a sd a0,0(sp) + 80008c44: ec2a sd a0,24(sp) + 80008c46: a009 j 80008c48 <_ZN4core5alloc6layout10size_align17h358c0d001efe79fbE+0xc> + 80008c48: 6582 ld a1,0(sp) + 80008c4a: 6511 lui a0,0x4 + 80008c4c: e42a sd a0,8(sp) + 80008c4e: e82e sd a1,16(sp) +} + 80008c50: 6105 addi sp,sp,32 + 80008c52: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout10size_align17h455ca6349ebf1183E: + +0000000080008c54 <_ZN4core5alloc6layout10size_align17h455ca6349ebf1183E>: +const fn size_align() -> (usize, usize) { + 80008c54: 1101 addi sp,sp,-32 + (mem::size_of::(), mem::align_of::()) + 80008c56: a009 j 80008c58 <_ZN4core5alloc6layout10size_align17h455ca6349ebf1183E+0x4> + 80008c58: 4505 li a0,1 + 80008c5a: e02a sd a0,0(sp) + 80008c5c: ec2a sd a0,24(sp) + 80008c5e: a009 j 80008c60 <_ZN4core5alloc6layout10size_align17h455ca6349ebf1183E+0xc> + 80008c60: 6582 ld a1,0(sp) + 80008c62: 4505 li a0,1 + 80008c64: e42a sd a0,8(sp) + 80008c66: e82e sd a1,16(sp) +} + 80008c68: 6105 addi sp,sp,32 + 80008c6a: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout10size_align17h799b388dcefa2425E: + +0000000080008c6c <_ZN4core5alloc6layout10size_align17h799b388dcefa2425E>: +const fn size_align() -> (usize, usize) { + 80008c6c: 1101 addi sp,sp,-32 + (mem::size_of::(), mem::align_of::()) + 80008c6e: a009 j 80008c70 <_ZN4core5alloc6layout10size_align17h799b388dcefa2425E+0x4> + 80008c70: 4521 li a0,8 + 80008c72: e02a sd a0,0(sp) + 80008c74: ec2a sd a0,24(sp) + 80008c76: a009 j 80008c78 <_ZN4core5alloc6layout10size_align17h799b388dcefa2425E+0xc> + 80008c78: 6582 ld a1,0(sp) + 80008c7a: 04000513 li a0,64 + 80008c7e: e42a sd a0,8(sp) + 80008c80: e82e sd a1,16(sp) +} + 80008c82: 6105 addi sp,sp,32 + 80008c84: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout10size_align17h813b5ff13136f8feE: + +0000000080008c86 <_ZN4core5alloc6layout10size_align17h813b5ff13136f8feE>: +const fn size_align() -> (usize, usize) { + 80008c86: 1101 addi sp,sp,-32 + (mem::size_of::(), mem::align_of::()) + 80008c88: a009 j 80008c8a <_ZN4core5alloc6layout10size_align17h813b5ff13136f8feE+0x4> + 80008c8a: 4521 li a0,8 + 80008c8c: e02a sd a0,0(sp) + 80008c8e: ec2a sd a0,24(sp) + 80008c90: a009 j 80008c92 <_ZN4core5alloc6layout10size_align17h813b5ff13136f8feE+0xc> + 80008c92: 6582 ld a1,0(sp) + 80008c94: 03800513 li a0,56 + 80008c98: e42a sd a0,8(sp) + 80008c9a: e82e sd a1,16(sp) +} + 80008c9c: 6105 addi sp,sp,32 + 80008c9e: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout10size_align17ha6efdca072762e51E: + +0000000080008ca0 <_ZN4core5alloc6layout10size_align17ha6efdca072762e51E>: +const fn size_align() -> (usize, usize) { + 80008ca0: 1101 addi sp,sp,-32 + (mem::size_of::(), mem::align_of::()) + 80008ca2: a009 j 80008ca4 <_ZN4core5alloc6layout10size_align17ha6efdca072762e51E+0x4> + 80008ca4: 6505 lui a0,0x1 + 80008ca6: e02a sd a0,0(sp) + 80008ca8: ec2a sd a0,24(sp) + 80008caa: a009 j 80008cac <_ZN4core5alloc6layout10size_align17ha6efdca072762e51E+0xc> + 80008cac: 6582 ld a1,0(sp) + 80008cae: 6505 lui a0,0x1 + 80008cb0: e42a sd a0,8(sp) + 80008cb2: e82e sd a1,16(sp) +} + 80008cb4: 6105 addi sp,sp,32 + 80008cb6: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout10size_align17hfd583a9e66514f54E: + +0000000080008cb8 <_ZN4core5alloc6layout10size_align17hfd583a9e66514f54E>: +const fn size_align() -> (usize, usize) { + 80008cb8: 1101 addi sp,sp,-32 + (mem::size_of::(), mem::align_of::()) + 80008cba: a009 j 80008cbc <_ZN4core5alloc6layout10size_align17hfd583a9e66514f54E+0x4> + 80008cbc: 6505 lui a0,0x1 + 80008cbe: e02a sd a0,0(sp) + 80008cc0: ec2a sd a0,24(sp) + 80008cc2: a009 j 80008cc4 <_ZN4core5alloc6layout10size_align17hfd583a9e66514f54E+0xc> + 80008cc4: 6582 ld a1,0(sp) + 80008cc6: 6505 lui a0,0x1 + 80008cc8: e42a sd a0,8(sp) + 80008cca: e82e sd a1,16(sp) +} + 80008ccc: 6105 addi sp,sp,32 + 80008cce: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout13for_value_raw17h9ddd239d574f5362E: + +0000000080008cd0 <_ZN4core5alloc6layout6Layout13for_value_raw17h9ddd239d574f5362E>: + /// - otherwise, it is conservatively not allowed to call this function. + /// + /// [trait object]: ../../book/ch17-02-trait-objects.html + /// [extern type]: ../../unstable-book/language-features/extern-types.html + #[unstable(feature = "layout_for_ptr", issue = "69835")] + pub unsafe fn for_value_raw(t: *const T) -> Self { + 80008cd0: 711d addi sp,sp,-96 + 80008cd2: ec86 sd ra,88(sp) + 80008cd4: f02a sd a0,32(sp) + 80008cd6: e0aa sd a0,64(sp) + // SAFETY: we pass along the prerequisites of these functions to the caller + let (size, align) = unsafe { (mem::size_of_val_raw(t), mem::align_of_val_raw(t)) }; + 80008cd8: 00015097 auipc ra,0x15 + 80008cdc: 0c6080e7 jalr 198(ra) # 8001dd9e <_ZN4core3mem15size_of_val_raw17h1bfec9c80578f181E> + 80008ce0: f42a sd a0,40(sp) + 80008ce2: a009 j 80008ce4 <_ZN4core5alloc6layout6Layout13for_value_raw17h9ddd239d574f5362E+0x14> + 80008ce4: 7502 ld a0,32(sp) + 80008ce6: 00015097 auipc ra,0x15 + 80008cea: 0cc080e7 jalr 204(ra) # 8001ddb2 <_ZN4core3mem16align_of_val_raw17hadcb67548ac99edfE> + 80008cee: ec2a sd a0,24(sp) + 80008cf0: a009 j 80008cf2 <_ZN4core5alloc6layout6Layout13for_value_raw17h9ddd239d574f5362E+0x22> + 80008cf2: 65e2 ld a1,24(sp) + 80008cf4: 7522 ld a0,40(sp) + 80008cf6: f82a sd a0,48(sp) + 80008cf8: fc2e sd a1,56(sp) + 80008cfa: e4aa sd a0,72(sp) + 80008cfc: e8ae sd a1,80(sp) + debug_assert!(Layout::from_size_align(size, align).is_ok()); + // SAFETY: see rationale in `new` for why this is using the unsafe variant + unsafe { Layout::from_size_align_unchecked(size, align) } + 80008cfe: 00017097 auipc ra,0x17 + 80008d02: b34080e7 jalr -1228(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80008d06: e42a sd a0,8(sp) + 80008d08: e82e sd a1,16(sp) + 80008d0a: a009 j 80008d0c <_ZN4core5alloc6layout6Layout13for_value_raw17h9ddd239d574f5362E+0x3c> + } + 80008d0c: 65c2 ld a1,16(sp) + 80008d0e: 6522 ld a0,8(sp) + 80008d10: 60e6 ld ra,88(sp) + 80008d12: 6125 addi sp,sp,96 + 80008d14: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout3new17h00440f750a953d15E: + +0000000080008d16 <_ZN4core5alloc6layout6Layout3new17h00440f750a953d15E>: + pub const fn new() -> Self { + 80008d16: 7139 addi sp,sp,-64 + let (size, align) = size_align::(); + 80008d18: fc06 sd ra,56(sp) + 80008d1a: 00000097 auipc ra,0x0 + 80008d1e: f9e080e7 jalr -98(ra) # 80008cb8 <_ZN4core5alloc6layout10size_align17hfd583a9e66514f54E> + 80008d22: ec2a sd a0,24(sp) + 80008d24: f02e sd a1,32(sp) + 80008d26: a009 j 80008d28 <_ZN4core5alloc6layout6Layout3new17h00440f750a953d15E+0x12> + 80008d28: 7582 ld a1,32(sp) + 80008d2a: 6562 ld a0,24(sp) + 80008d2c: f42a sd a0,40(sp) + 80008d2e: f82e sd a1,48(sp) + unsafe { Layout::from_size_align_unchecked(size, align) } + 80008d30: 00017097 auipc ra,0x17 + 80008d34: b02080e7 jalr -1278(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80008d38: e42a sd a0,8(sp) + 80008d3a: e82e sd a1,16(sp) + 80008d3c: a009 j 80008d3e <_ZN4core5alloc6layout6Layout3new17h00440f750a953d15E+0x28> + } + 80008d3e: 65c2 ld a1,16(sp) + 80008d40: 6522 ld a0,8(sp) + 80008d42: 70e2 ld ra,56(sp) + 80008d44: 6121 addi sp,sp,64 + 80008d46: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout3new17h0cabd46b2af96281E: + +0000000080008d48 <_ZN4core5alloc6layout6Layout3new17h0cabd46b2af96281E>: + pub const fn new() -> Self { + 80008d48: 7139 addi sp,sp,-64 + let (size, align) = size_align::(); + 80008d4a: fc06 sd ra,56(sp) + 80008d4c: 00000097 auipc ra,0x0 + 80008d50: ef0080e7 jalr -272(ra) # 80008c3c <_ZN4core5alloc6layout10size_align17h358c0d001efe79fbE> + 80008d54: ec2a sd a0,24(sp) + 80008d56: f02e sd a1,32(sp) + 80008d58: a009 j 80008d5a <_ZN4core5alloc6layout6Layout3new17h0cabd46b2af96281E+0x12> + 80008d5a: 7582 ld a1,32(sp) + 80008d5c: 6562 ld a0,24(sp) + 80008d5e: f42a sd a0,40(sp) + 80008d60: f82e sd a1,48(sp) + unsafe { Layout::from_size_align_unchecked(size, align) } + 80008d62: 00017097 auipc ra,0x17 + 80008d66: ad0080e7 jalr -1328(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80008d6a: e42a sd a0,8(sp) + 80008d6c: e82e sd a1,16(sp) + 80008d6e: a009 j 80008d70 <_ZN4core5alloc6layout6Layout3new17h0cabd46b2af96281E+0x28> + } + 80008d70: 65c2 ld a1,16(sp) + 80008d72: 6522 ld a0,8(sp) + 80008d74: 70e2 ld ra,56(sp) + 80008d76: 6121 addi sp,sp,64 + 80008d78: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout3new17h2e48cf004fc4e008E: + +0000000080008d7a <_ZN4core5alloc6layout6Layout3new17h2e48cf004fc4e008E>: + pub const fn new() -> Self { + 80008d7a: 7139 addi sp,sp,-64 + let (size, align) = size_align::(); + 80008d7c: fc06 sd ra,56(sp) + 80008d7e: 00000097 auipc ra,0x0 + 80008d82: ed6080e7 jalr -298(ra) # 80008c54 <_ZN4core5alloc6layout10size_align17h455ca6349ebf1183E> + 80008d86: ec2a sd a0,24(sp) + 80008d88: f02e sd a1,32(sp) + 80008d8a: a009 j 80008d8c <_ZN4core5alloc6layout6Layout3new17h2e48cf004fc4e008E+0x12> + 80008d8c: 7582 ld a1,32(sp) + 80008d8e: 6562 ld a0,24(sp) + 80008d90: f42a sd a0,40(sp) + 80008d92: f82e sd a1,48(sp) + unsafe { Layout::from_size_align_unchecked(size, align) } + 80008d94: 00017097 auipc ra,0x17 + 80008d98: a9e080e7 jalr -1378(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80008d9c: e42a sd a0,8(sp) + 80008d9e: e82e sd a1,16(sp) + 80008da0: a009 j 80008da2 <_ZN4core5alloc6layout6Layout3new17h2e48cf004fc4e008E+0x28> + } + 80008da2: 65c2 ld a1,16(sp) + 80008da4: 6522 ld a0,8(sp) + 80008da6: 70e2 ld ra,56(sp) + 80008da8: 6121 addi sp,sp,64 + 80008daa: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout3new17h728acb0ef5b915afE: + +0000000080008dac <_ZN4core5alloc6layout6Layout3new17h728acb0ef5b915afE>: + pub const fn new() -> Self { + 80008dac: 7139 addi sp,sp,-64 + let (size, align) = size_align::(); + 80008dae: fc06 sd ra,56(sp) + 80008db0: 00000097 auipc ra,0x0 + 80008db4: ef0080e7 jalr -272(ra) # 80008ca0 <_ZN4core5alloc6layout10size_align17ha6efdca072762e51E> + 80008db8: ec2a sd a0,24(sp) + 80008dba: f02e sd a1,32(sp) + 80008dbc: a009 j 80008dbe <_ZN4core5alloc6layout6Layout3new17h728acb0ef5b915afE+0x12> + 80008dbe: 7582 ld a1,32(sp) + 80008dc0: 6562 ld a0,24(sp) + 80008dc2: f42a sd a0,40(sp) + 80008dc4: f82e sd a1,48(sp) + unsafe { Layout::from_size_align_unchecked(size, align) } + 80008dc6: 00017097 auipc ra,0x17 + 80008dca: a6c080e7 jalr -1428(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80008dce: e42a sd a0,8(sp) + 80008dd0: e82e sd a1,16(sp) + 80008dd2: a009 j 80008dd4 <_ZN4core5alloc6layout6Layout3new17h728acb0ef5b915afE+0x28> + } + 80008dd4: 65c2 ld a1,16(sp) + 80008dd6: 6522 ld a0,8(sp) + 80008dd8: 70e2 ld ra,56(sp) + 80008dda: 6121 addi sp,sp,64 + 80008ddc: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout3new17h9329aa50601ba1ffE: + +0000000080008dde <_ZN4core5alloc6layout6Layout3new17h9329aa50601ba1ffE>: + pub const fn new() -> Self { + 80008dde: 7139 addi sp,sp,-64 + let (size, align) = size_align::(); + 80008de0: fc06 sd ra,56(sp) + 80008de2: 00000097 auipc ra,0x0 + 80008de6: ea4080e7 jalr -348(ra) # 80008c86 <_ZN4core5alloc6layout10size_align17h813b5ff13136f8feE> + 80008dea: ec2a sd a0,24(sp) + 80008dec: f02e sd a1,32(sp) + 80008dee: a009 j 80008df0 <_ZN4core5alloc6layout6Layout3new17h9329aa50601ba1ffE+0x12> + 80008df0: 7582 ld a1,32(sp) + 80008df2: 6562 ld a0,24(sp) + 80008df4: f42a sd a0,40(sp) + 80008df6: f82e sd a1,48(sp) + unsafe { Layout::from_size_align_unchecked(size, align) } + 80008df8: 00017097 auipc ra,0x17 + 80008dfc: a3a080e7 jalr -1478(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80008e00: e42a sd a0,8(sp) + 80008e02: e82e sd a1,16(sp) + 80008e04: a009 j 80008e06 <_ZN4core5alloc6layout6Layout3new17h9329aa50601ba1ffE+0x28> + } + 80008e06: 65c2 ld a1,16(sp) + 80008e08: 6522 ld a0,8(sp) + 80008e0a: 70e2 ld ra,56(sp) + 80008e0c: 6121 addi sp,sp,64 + 80008e0e: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout3new17hfb4102c77959cfa1E: + +0000000080008e10 <_ZN4core5alloc6layout6Layout3new17hfb4102c77959cfa1E>: + pub const fn new() -> Self { + 80008e10: 7139 addi sp,sp,-64 + let (size, align) = size_align::(); + 80008e12: fc06 sd ra,56(sp) + 80008e14: 00000097 auipc ra,0x0 + 80008e18: e58080e7 jalr -424(ra) # 80008c6c <_ZN4core5alloc6layout10size_align17h799b388dcefa2425E> + 80008e1c: ec2a sd a0,24(sp) + 80008e1e: f02e sd a1,32(sp) + 80008e20: a009 j 80008e22 <_ZN4core5alloc6layout6Layout3new17hfb4102c77959cfa1E+0x12> + 80008e22: 7582 ld a1,32(sp) + 80008e24: 6562 ld a0,24(sp) + 80008e26: f42a sd a0,40(sp) + 80008e28: f82e sd a1,48(sp) + unsafe { Layout::from_size_align_unchecked(size, align) } + 80008e2a: 00017097 auipc ra,0x17 + 80008e2e: a08080e7 jalr -1528(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 80008e32: e42a sd a0,8(sp) + 80008e34: e82e sd a1,16(sp) + 80008e36: a009 j 80008e38 <_ZN4core5alloc6layout6Layout3new17hfb4102c77959cfa1E+0x28> + } + 80008e38: 65c2 ld a1,16(sp) + 80008e3a: 6522 ld a0,8(sp) + 80008e3c: 70e2 ld ra,56(sp) + 80008e3e: 6121 addi sp,sp,64 + 80008e40: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E: + +0000000080008e42 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E>: + /// Creates a layout describing the record for a `[T; n]`. + /// + /// On arithmetic overflow, returns `LayoutError`. + #[stable(feature = "alloc_layout_manipulation", since = "1.44.0")] + #[inline] + pub fn array(n: usize) -> Result { + 80008e42: 7155 addi sp,sp,-208 + 80008e44: e586 sd ra,200(sp) + 80008e46: ec2a sd a0,24(sp) + 80008e48: f92a sd a0,176(sp) + let (layout, offset) = Layout::new::().repeat(n)?; + 80008e4a: 00000097 auipc ra,0x0 + 80008e4e: f30080e7 jalr -208(ra) # 80008d7a <_ZN4core5alloc6layout6Layout3new17h2e48cf004fc4e008E> + 80008e52: e52a sd a0,136(sp) + 80008e54: e92e sd a1,144(sp) + 80008e56: a009 j 80008e58 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x16> + 80008e58: 6662 ld a2,24(sp) + 80008e5a: 1888 addi a0,sp,112 + 80008e5c: 012c addi a1,sp,136 + 80008e5e: 00017097 auipc ra,0x17 + 80008e62: a24080e7 jalr -1500(ra) # 8001f882 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE> + 80008e66: a009 j 80008e68 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x26> + 80008e68: 08a8 addi a0,sp,88 + 80008e6a: 188c addi a1,sp,112 + 80008e6c: 00005097 auipc ra,0x5 + 80008e70: d0a080e7 jalr -758(ra) # 8000db76 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17heda032b26dd469a1E> + 80008e74: a009 j 80008e76 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x34> + 80008e76: 7506 ld a0,96(sp) + 80008e78: 00153593 seqz a1,a0 + 80008e7c: 4581 li a1,0 + 80008e7e: 00b51463 bne a0,a1,80008e86 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x44> + 80008e82: a009 j 80008e84 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x42> + 80008e84: a035 j 80008eb0 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x6e> + 80008e86: 7526 ld a0,104(sp) + 80008e88: f52a sd a0,168(sp) + 80008e8a: 7586 ld a1,96(sp) + 80008e8c: f12e sd a1,160(sp) + 80008e8e: 6666 ld a2,88(sp) + 80008e90: ed32 sd a2,152(sp) + 80008e92: e0b2 sd a2,64(sp) + 80008e94: e4ae sd a1,72(sp) + 80008e96: e8aa sd a0,80(sp) + 80008e98: f832 sd a2,48(sp) + 80008e9a: fc2e sd a1,56(sp) + 80008e9c: e1aa sd a0,192(sp) + 80008e9e: 1808 addi a0,sp,48 + debug_assert_eq!(offset, mem::size_of::()); + Ok(layout.pad_to_align()) + 80008ea0: 00017097 auipc ra,0x17 + 80008ea4: 840080e7 jalr -1984(ra) # 8001f6e0 <_ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E> + 80008ea8: e42a sd a0,8(sp) + 80008eaa: e82e sd a1,16(sp) + 80008eac: a839 j 80008eca <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x88> + let (layout, offset) = Layout::new::().repeat(n)?; + 80008eae: 0000 unimp + 80008eb0: 00000097 auipc ra,0x0 + 80008eb4: 02e080e7 jalr 46(ra) # 80008ede <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2a9aee2c044310b7E> + 80008eb8: a009 j 80008eba <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x78> + 80008eba: 00005097 auipc ra,0x5 + 80008ebe: b24080e7 jalr -1244(ra) # 8000d9de <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h5591b1c718d6dce1E> + 80008ec2: f02a sd a0,32(sp) + 80008ec4: f42e sd a1,40(sp) + 80008ec6: a009 j 80008ec8 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x86> + } + 80008ec8: a031 j 80008ed4 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x92> + Ok(layout.pad_to_align()) + 80008eca: 6542 ld a0,16(sp) + 80008ecc: 65a2 ld a1,8(sp) + 80008ece: f02e sd a1,32(sp) + 80008ed0: f42a sd a0,40(sp) + } + 80008ed2: a009 j 80008ed4 <_ZN4core5alloc6layout6Layout5array17h33220460c7f786e0E+0x92> + 80008ed4: 7502 ld a0,32(sp) + 80008ed6: 75a2 ld a1,40(sp) + 80008ed8: 60ae ld ra,200(sp) + 80008eda: 6169 addi sp,sp,208 + 80008edc: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2a9aee2c044310b7E: + +0000000080008ede <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2a9aee2c044310b7E>: +} + +// From (and thus Into) is reflexive +#[stable(feature = "rust1", since = "1.0.0")] +impl From for T { + fn from(t: T) -> T { + 80008ede: 1141 addi sp,sp,-16 + t + } + 80008ee0: 0141 addi sp,sp,16 + 80008ee2: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry8PteFlags3new17h46b0ea84c5bd5a31E: + +0000000080008ee4 <_ZN6kernel6memory7mapping16page_table_entry8PteFlags3new17h46b0ea84c5bd5a31E>: + } + +} + +impl PteFlags { + pub fn new(x: usize) -> Self { + 80008ee4: 1141 addi sp,sp,-16 + 80008ee6: e42a sd a0,8(sp) + Self{ + 80008ee8: e02a sd a0,0(sp) + bits: x + } + } + 80008eea: 0141 addi sp,sp,16 + 80008eec: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_usize17h85d0d27e00f735b4E: + +0000000080008eee <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_usize17h85d0d27e00f735b4E>: + let addr = self.as_usize() as *mut u8; + addr + } + + #[inline] + pub fn as_usize(&self) -> usize{ + 80008eee: 1141 addi sp,sp,-16 + 80008ef0: e42a sd a0,8(sp) + self.0 + 80008ef2: 6108 ld a0,0(a0) + } + 80008ef4: 0141 addi sp,sp,16 + 80008ef6: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E: + +0000000080008ef8 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E>: + + #[inline] + pub fn is_valid(&self) -> bool{ + 80008ef8: 1101 addi sp,sp,-32 + 80008efa: ec06 sd ra,24(sp) + 80008efc: e82a sd a0,16(sp) + (self.0 & (PteFlags::V.bits())) > 0 + 80008efe: 6108 ld a0,0(a0) + 80008f00: e02a sd a0,0(sp) + +0000000080008f02 <.LBB2_2>: + 80008f02: 0001f517 auipc a0,0x1f + 80008f06: 92e50513 addi a0,a0,-1746 # 80027830 <.L__unnamed_6+0xa0> + 80008f0a: 00000097 auipc ra,0x0 + 80008f0e: 164080e7 jalr 356(ra) # 8000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E> + 80008f12: e42a sd a0,8(sp) + 80008f14: a009 j 80008f16 <.LBB2_2+0x14> + 80008f16: 6502 ld a0,0(sp) + 80008f18: 65a2 ld a1,8(sp) + 80008f1a: 8d6d and a0,a0,a1 + 80008f1c: 00a03533 snez a0,a0 + } + 80008f20: 60e2 ld ra,24(sp) + 80008f22: 6105 addi sp,sp,32 + 80008f24: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_user17ha81b2d62b11ea775E: + +0000000080008f26 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_user17ha81b2d62b11ea775E>: + + #[inline] + pub fn is_user(&self) -> bool { + 80008f26: 1101 addi sp,sp,-32 + 80008f28: ec06 sd ra,24(sp) + 80008f2a: e82a sd a0,16(sp) + (self.0 & (PteFlags::V.bits())) > 0 + 80008f2c: 6108 ld a0,0(a0) + 80008f2e: e02a sd a0,0(sp) + +0000000080008f30 <.LBB3_2>: + 80008f30: 0001f517 auipc a0,0x1f + 80008f34: 90050513 addi a0,a0,-1792 # 80027830 <.L__unnamed_6+0xa0> + 80008f38: 00000097 auipc ra,0x0 + 80008f3c: 136080e7 jalr 310(ra) # 8000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E> + 80008f40: e42a sd a0,8(sp) + 80008f42: a009 j 80008f44 <.LBB3_2+0x14> + 80008f44: 6502 ld a0,0(sp) + 80008f46: 65a2 ld a1,8(sp) + 80008f48: 8d6d and a0,a0,a1 + 80008f4a: 00a03533 snez a0,a0 + } + 80008f4e: 60e2 ld ra,24(sp) + 80008f50: 6105 addi sp,sp,32 + 80008f52: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_leaf17h30d4b7c99c6d4286E: + +0000000080008f54 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_leaf17h30d4b7c99c6d4286E>: + pub fn is_execute(&self) -> bool { + (self.0 & (PteFlags::X.bits())) > 0 + } + + #[inline] + pub fn is_leaf(&self) -> bool { + 80008f54: 7139 addi sp,sp,-64 + 80008f56: fc06 sd ra,56(sp) + 80008f58: f42a sd a0,40(sp) + let flag_bits = self.0 & (PteFlags::R | PteFlags::W | PteFlags::X).bits(); + 80008f5a: 6108 ld a0,0(a0) + 80008f5c: e82a sd a0,16(sp) + 80008f5e: 4509 li a0,2 + 80008f60: 4591 li a1,4 + 80008f62: 00000097 auipc ra,0x0 + 80008f66: 116080e7 jalr 278(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80008f6a: ec2a sd a0,24(sp) + 80008f6c: a009 j 80008f6e <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_leaf17h30d4b7c99c6d4286E+0x1a> + 80008f6e: 6562 ld a0,24(sp) + 80008f70: 45a1 li a1,8 + 80008f72: 00000097 auipc ra,0x0 + 80008f76: 106080e7 jalr 262(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80008f7a: f02a sd a0,32(sp) + 80008f7c: a009 j 80008f7e <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_leaf17h30d4b7c99c6d4286E+0x2a> + 80008f7e: 1008 addi a0,sp,32 + 80008f80: 00000097 auipc ra,0x0 + 80008f84: 0ee080e7 jalr 238(ra) # 8000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E> + 80008f88: e42a sd a0,8(sp) + 80008f8a: a009 j 80008f8c <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_leaf17h30d4b7c99c6d4286E+0x38> + 80008f8c: 6542 ld a0,16(sp) + 80008f8e: 65a2 ld a1,8(sp) + 80008f90: 8d6d and a0,a0,a1 + 80008f92: f82a sd a0,48(sp) + !(flag_bits == 0) + 80008f94: 00a03533 snez a0,a0 + } + 80008f98: 70e2 ld ra,56(sp) + 80008f9a: 6121 addi sp,sp,64 + 80008f9c: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry11rm_user_bit17hf6078e39c3f185baE: + +0000000080008f9e <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry11rm_user_bit17hf6078e39c3f185baE>: + let pte = self.as_usize() | (PteFlags::U.bits()); + Self(pte) + } + + #[inline] + pub fn rm_user_bit(&mut self) { + 80008f9e: 1101 addi sp,sp,-32 + 80008fa0: ec06 sd ra,24(sp) + 80008fa2: e02a sd a0,0(sp) + 80008fa4: e82a sd a0,16(sp) + +0000000080008fa6 <.LBB5_2>: + self.0 &= !(PteFlags::U.bits()); + 80008fa6: 0001f517 auipc a0,0x1f + 80008faa: 8ba50513 addi a0,a0,-1862 # 80027860 <.L__unnamed_6+0xd0> + 80008fae: 00000097 auipc ra,0x0 + 80008fb2: 0c0080e7 jalr 192(ra) # 8000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E> + 80008fb6: e42a sd a0,8(sp) + 80008fb8: a009 j 80008fba <.LBB5_2+0x14> + 80008fba: 6582 ld a1,0(sp) + 80008fbc: 6522 ld a0,8(sp) + 80008fbe: fff54613 not a2,a0 + 80008fc2: 6188 ld a0,0(a1) + 80008fc4: 8d71 and a0,a0,a2 + 80008fc6: e188 sd a0,0(a1) + } + 80008fc8: 60e2 ld ra,24(sp) + 80008fca: 6105 addi sp,sp,32 + 80008fcc: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE: + +0000000080008fce <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE>: + + // implement PTE2PA + #[inline] + pub fn as_pagetable(&self) -> *mut PageTable{ + 80008fce: 1101 addi sp,sp,-32 + 80008fd0: e82a sd a0,16(sp) + let ret = ((self.0 >> 10) << 12) as *mut PageTable; + 80008fd2: 6108 ld a0,0(a0) + 80008fd4: 8129 srli a0,a0,0xa + 80008fd6: e42a sd a0,8(sp) + 80008fd8: a009 j 80008fda <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE+0xc> + 80008fda: 6522 ld a0,8(sp) + 80008fdc: 0532 slli a0,a0,0xc + 80008fde: e02a sd a0,0(sp) + 80008fe0: a009 j 80008fe2 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE+0x14> + 80008fe2: 6502 ld a0,0(sp) + 80008fe4: ec2a sd a0,24(sp) + ret + } + 80008fe6: 6105 addi sp,sp,32 + 80008fe8: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_flags17hf18e3bbee6201d61E: + +0000000080008fea <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_flags17hf18e3bbee6201d61E>: + Self((addr >> 12) << 10) + } + + // implement PTE_FLAGES + #[inline] + pub fn as_flags(&self) -> usize { + 80008fea: 1101 addi sp,sp,-32 + 80008fec: ec06 sd ra,24(sp) + 80008fee: e82a sd a0,16(sp) + self.as_usize() & 0x3FF + 80008ff0: 00000097 auipc ra,0x0 + 80008ff4: efe080e7 jalr -258(ra) # 80008eee <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_usize17h85d0d27e00f735b4E> + 80008ff8: e42a sd a0,8(sp) + 80008ffa: a009 j 80008ffc <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_flags17hf18e3bbee6201d61E+0x12> + 80008ffc: 6522 ld a0,8(sp) + 80008ffe: 3ff57513 andi a0,a0,1023 + } + 80009002: 60e2 ld ra,24(sp) + 80009004: 6105 addi sp,sp,32 + 80009006: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E: + +0000000080009008 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E>: + pub fn write_zero(&mut self){ + self.0 = 0; + } + + #[inline] + pub fn write_perm(&mut self, pa:PhysicalAddress, perm: PteFlags){ + 80009008: 711d addi sp,sp,-96 + 8000900a: ec86 sd ra,88(sp) + 8000900c: f032 sd a2,32(sp) + 8000900e: f42a sd a0,40(sp) + 80009010: fc2e sd a1,56(sp) + 80009012: e4aa sd a0,72(sp) + 80009014: e8b2 sd a2,80(sp) + 80009016: 1828 addi a0,sp,56 + self.0 = ((pa.as_usize() >> 12) << 10) | (perm | PteFlags::V).bits() + 80009018: 00009097 auipc ra,0x9 + 8000901c: f1c080e7 jalr -228(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 80009020: f82a sd a0,48(sp) + 80009022: a009 j 80009024 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E+0x1c> + 80009024: 7542 ld a0,48(sp) + 80009026: 8131 srli a0,a0,0xc + 80009028: ec2a sd a0,24(sp) + 8000902a: a009 j 8000902c <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E+0x24> + 8000902c: 6562 ld a0,24(sp) + 8000902e: 052a slli a0,a0,0xa + 80009030: e82a sd a0,16(sp) + 80009032: a009 j 80009034 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E+0x2c> + 80009034: 7502 ld a0,32(sp) + 80009036: 4585 li a1,1 + 80009038: 00000097 auipc ra,0x0 + 8000903c: 040080e7 jalr 64(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80009040: e0aa sd a0,64(sp) + 80009042: a009 j 80009044 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E+0x3c> + 80009044: 0088 addi a0,sp,64 + 80009046: 00000097 auipc ra,0x0 + 8000904a: 028080e7 jalr 40(ra) # 8000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E> + 8000904e: e42a sd a0,8(sp) + 80009050: a009 j 80009052 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E+0x4a> + 80009052: 75a2 ld a1,40(sp) + 80009054: 6542 ld a0,16(sp) + 80009056: 6622 ld a2,8(sp) + 80009058: 8d51 or a0,a0,a2 + 8000905a: e188 sd a0,0(a1) + } + 8000905c: 60e6 ld ra,88(sp) + 8000905e: 6125 addi sp,sp,96 + 80009060: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry14PageTableEntry5write17h80740d4aa6720343E: + +0000000080009062 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry5write17h80740d4aa6720343E>: + + #[inline] + pub fn write(&mut self, addr: usize) { + 80009062: 1141 addi sp,sp,-16 + 80009064: e02a sd a0,0(sp) + 80009066: e42e sd a1,8(sp) + self.0 = addr + 80009068: e10c sd a1,0(a0) + } + 8000906a: 0141 addi sp,sp,16 + 8000906c: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E: + +000000008000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E>: + } + } + + /// Returns the raw value of the flags currently stored. + #[inline] + pub const fn bits(&self) -> $T { + 8000906e: 1141 addi sp,sp,-16 + 80009070: e42a sd a0,8(sp) + self.bits + 80009072: 6108 ld a0,0(a0) + } + 80009074: 0141 addi sp,sp,16 + 80009076: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E: + +0000000080009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E>: + impl $crate::_core::ops::BitOr for $BitFlags { + type Output = Self; + + /// Returns the union of the two sets of flags. + #[inline] + fn bitor(self, other: $BitFlags) -> Self { + 80009078: 1101 addi sp,sp,-32 + 8000907a: e82a sd a0,16(sp) + 8000907c: ec2e sd a1,24(sp) + Self { bits: self.bits | other.bits } + 8000907e: 8d4d or a0,a0,a1 + 80009080: e42a sd a0,8(sp) + } + 80009082: 6105 addi sp,sp,32 + 80009084: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$11write_bytes17h89eca677f2a46e73E: + +0000000080009086 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$11write_bytes17h89eca677f2a46e73E>: + /// See [`ptr::write_bytes`] for safety concerns and examples. + /// + /// [`ptr::write_bytes`]: crate::ptr::write_bytes() + #[stable(feature = "pointer_methods", since = "1.26.0")] + #[inline] + pub unsafe fn write_bytes(self, val: u8, count: usize) + 80009086: 1101 addi sp,sp,-32 + 80009088: ec06 sd ra,24(sp) + 8000908a: e02a sd a0,0(sp) + 8000908c: 00b107a3 sb a1,15(sp) + 80009090: e832 sd a2,16(sp) + where + T: Sized, + { + // SAFETY: the caller must uphold the safety contract for `write_bytes`. + unsafe { write_bytes(self, val, count) } + 80009092: 0001a097 auipc ra,0x1a + 80009096: 96c080e7 jalr -1684(ra) # 800229fe <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E> + 8000909a: a009 j 8000909c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$11write_bytes17h89eca677f2a46e73E+0x16> + } + 8000909c: 60e2 ld ra,24(sp) + 8000909e: 6105 addi sp,sp,32 + 800090a0: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE: + +00000000800090a2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE>: + pub const fn wrapping_add(self, count: usize) -> Self + 800090a2: 1101 addi sp,sp,-32 + 800090a4: ec06 sd ra,24(sp) + 800090a6: e42a sd a0,8(sp) + 800090a8: e82e sd a1,16(sp) + self.wrapping_offset(count as isize) + 800090aa: 00000097 auipc ra,0x0 + 800090ae: 048080e7 jalr 72(ra) # 800090f2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$15wrapping_offset17h01aa229f802838f9E> + 800090b2: e02a sd a0,0(sp) + 800090b4: a009 j 800090b6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE+0x14> + } + 800090b6: 6502 ld a0,0(sp) + 800090b8: 60e2 ld ra,24(sp) + 800090ba: 6105 addi sp,sp,32 + 800090bc: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13read_volatile17h74b3a7ca48b9b2b5E: + +00000000800090be <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13read_volatile17h74b3a7ca48b9b2b5E>: + pub unsafe fn read_volatile(self) -> T + 800090be: 1101 addi sp,sp,-32 + 800090c0: ec06 sd ra,24(sp) + 800090c2: e82a sd a0,16(sp) + unsafe { read_volatile(self) } + 800090c4: 00010097 auipc ra,0x10 + 800090c8: 264080e7 jalr 612(ra) # 80019328 <_ZN4core3ptr13read_volatile17h48a61fef837248f4E> + 800090cc: e42a sd a0,8(sp) + 800090ce: a009 j 800090d0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13read_volatile17h74b3a7ca48b9b2b5E+0x12> + } + 800090d0: 6522 ld a0,8(sp) + 800090d2: 60e2 ld ra,24(sp) + 800090d4: 6105 addi sp,sp,32 + 800090d6: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$14write_volatile17h3132c1bed6ef07b7E: + +00000000800090d8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$14write_volatile17h3132c1bed6ef07b7E>: + /// See [`ptr::write_volatile`] for safety concerns and examples. + /// + /// [`ptr::write_volatile`]: crate::ptr::write_volatile() + #[stable(feature = "pointer_methods", since = "1.26.0")] + #[inline] + pub unsafe fn write_volatile(self, val: T) + 800090d8: 1101 addi sp,sp,-32 + 800090da: ec06 sd ra,24(sp) + 800090dc: e42a sd a0,8(sp) + 800090de: 00b10ba3 sb a1,23(sp) + where + T: Sized, + { + // SAFETY: the caller must uphold the safety contract for `write_volatile`. + unsafe { write_volatile(self, val) } + 800090e2: 00010097 auipc ra,0x10 + 800090e6: 28a080e7 jalr 650(ra) # 8001936c <_ZN4core3ptr14write_volatile17ha922d8ced3e01de5E> + 800090ea: a009 j 800090ec <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$14write_volatile17h3132c1bed6ef07b7E+0x14> + } + 800090ec: 60e2 ld ra,24(sp) + 800090ee: 6105 addi sp,sp,32 + 800090f0: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$15wrapping_offset17h01aa229f802838f9E: + +00000000800090f2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$15wrapping_offset17h01aa229f802838f9E>: + pub const fn wrapping_offset(self, count: isize) -> *mut T + 800090f2: 1101 addi sp,sp,-32 + 800090f4: e42a sd a0,8(sp) + 800090f6: e82e sd a1,16(sp) + unsafe { intrinsics::arith_offset(self, count) as *mut T } + 800090f8: 952e add a0,a0,a1 + 800090fa: e02a sd a0,0(sp) + 800090fc: ec2a sd a0,24(sp) + 800090fe: a009 j 80009100 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$15wrapping_offset17h01aa229f802838f9E+0xe> + } + 80009100: 6502 ld a0,0(sp) + 80009102: 6105 addi sp,sp,32 + 80009104: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1fdb3e6f0b8b1c65E: + +0000000080009106 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1fdb3e6f0b8b1c65E>: + pub const unsafe fn add(self, count: usize) -> Self + 80009106: 1101 addi sp,sp,-32 + 80009108: ec06 sd ra,24(sp) + 8000910a: e42a sd a0,8(sp) + 8000910c: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 8000910e: 00000097 auipc ra,0x0 + 80009112: 014080e7 jalr 20(ra) # 80009122 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h07753d2a365b8ea9E> + 80009116: e02a sd a0,0(sp) + 80009118: a009 j 8000911a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1fdb3e6f0b8b1c65E+0x14> + } + 8000911a: 6502 ld a0,0(sp) + 8000911c: 60e2 ld ra,24(sp) + 8000911e: 6105 addi sp,sp,32 + 80009120: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h07753d2a365b8ea9E: + +0000000080009122 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h07753d2a365b8ea9E>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 80009122: 1101 addi sp,sp,-32 + 80009124: e42a sd a0,8(sp) + 80009126: e82e sd a1,16(sp) + unsafe { intrinsics::offset(self, count) as *mut T } + 80009128: 952e add a0,a0,a1 + 8000912a: e02a sd a0,0(sp) + 8000912c: ec2a sd a0,24(sp) + 8000912e: a009 j 80009130 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h07753d2a365b8ea9E+0xe> + } + 80009130: 6502 ld a0,0(sp) + 80009132: 6105 addi sp,sp,32 + 80009134: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h9889ec684d0da599E: + +0000000080009136 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h9889ec684d0da599E>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 80009136: 1101 addi sp,sp,-32 + 80009138: e42a sd a0,8(sp) + 8000913a: e82e sd a1,16(sp) + unsafe { intrinsics::offset(self, count) as *mut T } + 8000913c: 058a slli a1,a1,0x2 + 8000913e: 952e add a0,a0,a1 + 80009140: e02a sd a0,0(sp) + 80009142: ec2a sd a0,24(sp) + 80009144: a009 j 80009146 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h9889ec684d0da599E+0x10> + } + 80009146: 6502 ld a0,0(sp) + 80009148: 6105 addi sp,sp,32 + 8000914a: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc49b20e03dc897f6E: + +000000008000914c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc49b20e03dc897f6E>: + pub const fn is_null(self) -> bool { + 8000914c: 1101 addi sp,sp,-32 + 8000914e: ec06 sd ra,24(sp) + 80009150: e42a sd a0,8(sp) + 80009152: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 80009154: a009 j 80009156 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc49b20e03dc897f6E+0xa> + 80009156: 6522 ld a0,8(sp) + 80009158: 4581 li a1,0 + 8000915a: 0001a097 auipc ra,0x1a + 8000915e: db0080e7 jalr -592(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 80009162: e02a sd a0,0(sp) + 80009164: a009 j 80009166 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc49b20e03dc897f6E+0x1a> + } + 80009166: 6502 ld a0,0(sp) + 80009168: 60e2 ld ra,24(sp) + 8000916a: 6105 addi sp,sp,32 + 8000916c: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$3len17hf44174276422642dE: + +000000008000916e <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$3len17hf44174276422642dE>: + /// assert_eq!(slice.len(), 3); + /// ``` + #[inline] + #[unstable(feature = "slice_ptr_len", issue = "71146")] + #[rustc_const_unstable(feature = "const_slice_ptr_len", issue = "71146")] + pub const fn len(self) -> usize { + 8000916e: 1101 addi sp,sp,-32 + 80009170: ec06 sd ra,24(sp) + 80009172: e42a sd a0,8(sp) + 80009174: e82e sd a1,16(sp) + // SAFETY: this is safe because `*const [T]` and `FatPtr` have the same layout. + // Only `std` can make this guarantee. + unsafe { Repr { rust_mut: self }.raw }.len + } + #[cfg(not(bootstrap))] + metadata(self) + 80009176: 00013097 auipc ra,0x13 + 8000917a: d1e080e7 jalr -738(ra) # 8001be94 <_ZN4core3ptr8metadata8metadata17h8c3e19bdf44a2913E> + 8000917e: e02a sd a0,0(sp) + 80009180: a009 j 80009182 <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$3len17hf44174276422642dE+0x14> + } + 80009182: 6502 ld a0,0(sp) + 80009184: 60e2 ld ra,24(sp) + 80009186: 6105 addi sp,sp,32 + 80009188: 8082 ret + +Disassembly of section .text._ZN4core3str11validations11unwrap_or_017haab6baa99207da23E: + +000000008000918a <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E>: +fn unwrap_or_0(opt: Option<&u8>) -> u8 { + 8000918a: 1141 addi sp,sp,-16 + 8000918c: e02a sd a0,0(sp) + Some(&byte) => byte, + 8000918e: 00a035b3 snez a1,a0 + 80009192: 4581 li a1,0 + 80009194: 00b50463 beq a0,a1,8000919c <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E+0x12> + 80009198: a009 j 8000919a <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E+0x10> + 8000919a: a031 j 800091a6 <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E+0x1c> + 8000919c: 4501 li a0,0 + None => 0, + 8000919e: 00a10723 sb a0,14(sp) + match opt { + 800091a2: a811 j 800091b6 <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E+0x2c> + 800091a4: 0000 unimp + Some(&byte) => byte, + 800091a6: 6502 ld a0,0(sp) + 800091a8: 00050503 lb a0,0(a0) + 800091ac: 00a107a3 sb a0,15(sp) + 800091b0: 00a10723 sb a0,14(sp) + match opt { + 800091b4: a009 j 800091b6 <_ZN4core3str11validations11unwrap_or_017haab6baa99207da23E+0x2c> +} + 800091b6: 00e10503 lb a0,14(sp) + 800091ba: 0141 addi sp,sp,16 + 800091bc: 8082 ret + +Disassembly of section .text._ZN4core3str11validations15utf8_first_byte17h336ce196ba99428fE: + +00000000800091be <_ZN4core3str11validations15utf8_first_byte17h336ce196ba99428fE>: +fn utf8_first_byte(byte: u8, width: u32) -> u32 { + 800091be: 1141 addi sp,sp,-16 + 800091c0: 00a105a3 sb a0,11(sp) + 800091c4: c62e sw a1,12(sp) + (byte & (0x7F >> width)) as u32 + 800091c6: 0075f613 andi a2,a1,7 + 800091ca: 07f00593 li a1,127 + 800091ce: 00c5d5b3 srl a1,a1,a2 + 800091d2: 8d6d and a0,a0,a1 +} + 800091d4: 0141 addi sp,sp,16 + 800091d6: 8082 ret + +Disassembly of section .text._ZN4core3str11validations18utf8_acc_cont_byte17h8689eb325a5b266aE: + +00000000800091d8 <_ZN4core3str11validations18utf8_acc_cont_byte17h8689eb325a5b266aE>: +fn utf8_acc_cont_byte(ch: u32, byte: u8) -> u32 { + 800091d8: 1141 addi sp,sp,-16 + 800091da: c42a sw a0,8(sp) + 800091dc: 00b107a3 sb a1,15(sp) + (ch << 6) | (byte & CONT_MASK) as u32 + 800091e0: 051a slli a0,a0,0x6 + 800091e2: 03f5f593 andi a1,a1,63 + 800091e6: 8d4d or a0,a0,a1 +} + 800091e8: 0141 addi sp,sp,16 + 800091ea: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E: + +00000000800091ec <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E>: +// This signature has to be the same as `Box`, otherwise an ICE will happen. +// When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as +// well. +// For example if `Box` is changed to `struct Box(Unique, A)`, +// this function has to be changed to `fn box_free(Unique, A)` as well. +pub(crate) unsafe fn box_free(ptr: Unique, alloc: A) { + 800091ec: 7119 addi sp,sp,-128 + 800091ee: fc86 sd ra,120(sp) + 800091f0: fc2a sd a0,56(sp) + 800091f2: 1828 addi a0,sp,56 + unsafe { + let size = size_of_val(ptr.as_ref()); + 800091f4: 00003097 auipc ra,0x3 + 800091f8: 378080e7 jalr 888(ra) # 8000c56c <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hf6739c76b33ed63aE> + 800091fc: a009 j 800091fe <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x12> + 800091fe: 04000513 li a0,64 + 80009202: f82a sd a0,48(sp) + 80009204: e4aa sd a0,72(sp) + 80009206: e8aa sd a0,80(sp) + 80009208: a009 j 8000920a <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x1e> + 8000920a: 1828 addi a0,sp,56 + let align = min_align_of_val(ptr.as_ref()); + 8000920c: 00003097 auipc ra,0x3 + 80009210: 360080e7 jalr 864(ra) # 8000c56c <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hf6739c76b33ed63aE> + 80009214: a009 j 80009216 <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x2a> + 80009216: 4521 li a0,8 + 80009218: f42a sd a0,40(sp) + 8000921a: ecaa sd a0,88(sp) + 8000921c: f0aa sd a0,96(sp) + 8000921e: a009 j 80009220 <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x34> + let layout = Layout::from_size_align_unchecked(size, align); + 80009220: 75a2 ld a1,40(sp) + 80009222: 7542 ld a0,48(sp) + 80009224: 00016097 auipc ra,0x16 + 80009228: 60e080e7 jalr 1550(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8000922c: 862a mv a2,a0 + 8000922e: ec32 sd a2,24(sp) + 80009230: 862e mv a2,a1 + 80009232: f032 sd a2,32(sp) + 80009234: f4aa sd a0,104(sp) + 80009236: f8ae sd a1,112(sp) + 80009238: a009 j 8000923a <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x4e> + alloc.deallocate(ptr.cast().into(), layout) + 8000923a: 7562 ld a0,56(sp) + 8000923c: 00003097 auipc ra,0x3 + 80009240: 28c080e7 jalr 652(ra) # 8000c4c8 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h6eaa84e8f5e764c2E> + 80009244: e82a sd a0,16(sp) + 80009246: a009 j 80009248 <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x5c> + 80009248: 6542 ld a0,16(sp) + 8000924a: 00003097 auipc ra,0x3 + 8000924e: 360080e7 jalr 864(ra) # 8000c5aa <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17h6726b37a43d030b4E> + 80009252: e42a sd a0,8(sp) + 80009254: a009 j 80009256 <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x6a> + 80009256: 7682 ld a3,32(sp) + 80009258: 6662 ld a2,24(sp) + 8000925a: 65a2 ld a1,8(sp) + 8000925c: 0088 addi a0,sp,64 + 8000925e: 00004097 auipc ra,0x4 + 80009262: 934080e7 jalr -1740(ra) # 8000cb92 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE> + 80009266: a009 j 80009268 <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x7c> + } +} + 80009268: a009 j 8000926a <_ZN5alloc5alloc8box_free17h9496fa4d23b2ebc8E+0x7e> + 8000926a: 70e6 ld ra,120(sp) + 8000926c: 6109 addi sp,sp,128 + 8000926e: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E: + +0000000080009270 <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E>: +pub(crate) unsafe fn box_free(ptr: Unique, alloc: A) { + 80009270: 7119 addi sp,sp,-128 + 80009272: fc86 sd ra,120(sp) + 80009274: fc2a sd a0,56(sp) + 80009276: 1828 addi a0,sp,56 + let size = size_of_val(ptr.as_ref()); + 80009278: 00003097 auipc ra,0x3 + 8000927c: 2d8080e7 jalr 728(ra) # 8000c550 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hc8563a91a04f7babE> + 80009280: a009 j 80009282 <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x12> + 80009282: 03800513 li a0,56 + 80009286: f82a sd a0,48(sp) + 80009288: e4aa sd a0,72(sp) + 8000928a: e8aa sd a0,80(sp) + 8000928c: a009 j 8000928e <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x1e> + 8000928e: 1828 addi a0,sp,56 + let align = min_align_of_val(ptr.as_ref()); + 80009290: 00003097 auipc ra,0x3 + 80009294: 2c0080e7 jalr 704(ra) # 8000c550 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hc8563a91a04f7babE> + 80009298: a009 j 8000929a <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x2a> + 8000929a: 4521 li a0,8 + 8000929c: f42a sd a0,40(sp) + 8000929e: ecaa sd a0,88(sp) + 800092a0: f0aa sd a0,96(sp) + 800092a2: a009 j 800092a4 <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x34> + let layout = Layout::from_size_align_unchecked(size, align); + 800092a4: 75a2 ld a1,40(sp) + 800092a6: 7542 ld a0,48(sp) + 800092a8: 00016097 auipc ra,0x16 + 800092ac: 58a080e7 jalr 1418(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 800092b0: 862a mv a2,a0 + 800092b2: ec32 sd a2,24(sp) + 800092b4: 862e mv a2,a1 + 800092b6: f032 sd a2,32(sp) + 800092b8: f4aa sd a0,104(sp) + 800092ba: f8ae sd a1,112(sp) + 800092bc: a009 j 800092be <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x4e> + alloc.deallocate(ptr.cast().into(), layout) + 800092be: 7562 ld a0,56(sp) + 800092c0: 00003097 auipc ra,0x3 + 800092c4: 1b8080e7 jalr 440(ra) # 8000c478 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h0df13c1b672cf8a2E> + 800092c8: e82a sd a0,16(sp) + 800092ca: a009 j 800092cc <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x5c> + 800092cc: 6542 ld a0,16(sp) + 800092ce: 00003097 auipc ra,0x3 + 800092d2: 2dc080e7 jalr 732(ra) # 8000c5aa <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17h6726b37a43d030b4E> + 800092d6: e42a sd a0,8(sp) + 800092d8: a009 j 800092da <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x6a> + 800092da: 7682 ld a3,32(sp) + 800092dc: 6662 ld a2,24(sp) + 800092de: 65a2 ld a1,8(sp) + 800092e0: 0088 addi a0,sp,64 + 800092e2: 00004097 auipc ra,0x4 + 800092e6: 8b0080e7 jalr -1872(ra) # 8000cb92 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE> + 800092ea: a009 j 800092ec <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x7c> +} + 800092ec: a009 j 800092ee <_ZN5alloc5alloc8box_free17hc9fdd8b40dd668b4E+0x7e> + 800092ee: 70e6 ld ra,120(sp) + 800092f0: 6109 addi sp,sp,128 + 800092f2: 8082 ret + +Disassembly of section .text._ZN4core5clone5Clone10clone_from17h4153b3cb0b8f3e29E: + +00000000800092f4 <_ZN4core5clone5Clone10clone_from17h4153b3cb0b8f3e29E>: + /// `a.clone_from(&b)` is equivalent to `a = b.clone()` in functionality, + /// but can be overridden to reuse the resources of `a` to avoid unnecessary + /// allocations. + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + fn clone_from(&mut self, source: &Self) { + 800092f4: 715d addi sp,sp,-80 + 800092f6: e486 sd ra,72(sp) + 800092f8: e02e sd a1,0(sp) + 800092fa: 85aa mv a1,a0 + 800092fc: 6502 ld a0,0(sp) + 800092fe: e42e sd a1,8(sp) + 80009300: f02e sd a1,32(sp) + 80009302: f42a sd a0,40(sp) + *self = source.clone() + 80009304: 00013097 auipc ra,0x13 + 80009308: 93c080e7 jalr -1732(ra) # 8001bc40 <_ZN63_$LT$kernel..fs..inode..Inode$u20$as$u20$core..clone..Clone$GT$5clone17hdd0850fb54e2bc6cE> + 8000930c: f82a sd a0,48(sp) + 8000930e: fc2e sd a1,56(sp) + 80009310: e82a sd a0,16(sp) + 80009312: ec2e sd a1,24(sp) + 80009314: a009 j 80009316 <_ZN4core5clone5Clone10clone_from17h4153b3cb0b8f3e29E+0x22> + 80009316: 6522 ld a0,8(sp) + 80009318: ffffe097 auipc ra,0xffffe + 8000931c: d4e080e7 jalr -690(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80009320: a009 j 80009322 <_ZN4core5clone5Clone10clone_from17h4153b3cb0b8f3e29E+0x2e> + 80009322: 65a2 ld a1,8(sp) + 80009324: 6562 ld a0,24(sp) + 80009326: e588 sd a0,8(a1) + 80009328: 6542 ld a0,16(sp) + 8000932a: e188 sd a0,0(a1) + } + 8000932c: 60a6 ld ra,72(sp) + 8000932e: 6161 addi sp,sp,80 + 80009330: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE: + +0000000080009332 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE>: + pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> { + 80009332: 7179 addi sp,sp,-48 + 80009334: f406 sd ra,40(sp) + 80009336: e42a sd a0,8(sp) + 80009338: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&mut *self) } } + 8000933a: 00000097 auipc ra,0x0 + 8000933e: 05c080e7 jalr 92(ra) # 80009396 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17ha54fba030ecf9049E> + 80009342: e82a sd a0,16(sp) + 80009344: a009 j 80009346 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE+0x14> + 80009346: 6542 ld a0,16(sp) + 80009348: 4581 li a1,0 + 8000934a: 00b50663 beq a0,a1,80009356 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE+0x24> + 8000934e: a009 j 80009350 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE+0x1e> + 80009350: 4501 li a0,0 + 80009352: ec2a sd a0,24(sp) + 80009354: a021 j 8000935c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE+0x2a> + 80009356: 6522 ld a0,8(sp) + 80009358: ec2a sd a0,24(sp) + 8000935a: a009 j 8000935c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE+0x2a> + } + 8000935c: 6562 ld a0,24(sp) + 8000935e: 70a2 ld ra,40(sp) + 80009360: 6145 addi sp,sp,48 + 80009362: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE: + +0000000080009364 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE>: + pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> { + 80009364: 7179 addi sp,sp,-48 + 80009366: f406 sd ra,40(sp) + 80009368: e42a sd a0,8(sp) + 8000936a: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&mut *self) } } + 8000936c: 00000097 auipc ra,0x0 + 80009370: 04c080e7 jalr 76(ra) # 800093b8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hcdcddf7362d728f0E> + 80009374: e82a sd a0,16(sp) + 80009376: a009 j 80009378 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE+0x14> + 80009378: 6542 ld a0,16(sp) + 8000937a: 4581 li a1,0 + 8000937c: 00b50663 beq a0,a1,80009388 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE+0x24> + 80009380: a009 j 80009382 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE+0x1e> + 80009382: 4501 li a0,0 + 80009384: ec2a sd a0,24(sp) + 80009386: a021 j 8000938e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE+0x2a> + 80009388: 6522 ld a0,8(sp) + 8000938a: ec2a sd a0,24(sp) + 8000938c: a009 j 8000938e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE+0x2a> + } + 8000938e: 6562 ld a0,24(sp) + 80009390: 70a2 ld ra,40(sp) + 80009392: 6145 addi sp,sp,48 + 80009394: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17ha54fba030ecf9049E: + +0000000080009396 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17ha54fba030ecf9049E>: + pub const fn is_null(self) -> bool { + 80009396: 1101 addi sp,sp,-32 + 80009398: ec06 sd ra,24(sp) + 8000939a: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 8000939c: e42a sd a0,8(sp) + 8000939e: a009 j 800093a0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17ha54fba030ecf9049E+0xa> + 800093a0: 6522 ld a0,8(sp) + 800093a2: 4581 li a1,0 + 800093a4: 0001a097 auipc ra,0x1a + 800093a8: b66080e7 jalr -1178(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 800093ac: e02a sd a0,0(sp) + 800093ae: a009 j 800093b0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17ha54fba030ecf9049E+0x1a> + } + 800093b0: 6502 ld a0,0(sp) + 800093b2: 60e2 ld ra,24(sp) + 800093b4: 6105 addi sp,sp,32 + 800093b6: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hcdcddf7362d728f0E: + +00000000800093b8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hcdcddf7362d728f0E>: + pub const fn is_null(self) -> bool { + 800093b8: 1101 addi sp,sp,-32 + 800093ba: ec06 sd ra,24(sp) + 800093bc: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 800093be: e42a sd a0,8(sp) + 800093c0: a009 j 800093c2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hcdcddf7362d728f0E+0xa> + 800093c2: 6522 ld a0,8(sp) + 800093c4: 4581 li a1,0 + 800093c6: 0001a097 auipc ra,0x1a + 800093ca: b44080e7 jalr -1212(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 800093ce: e02a sd a0,0(sp) + 800093d0: a009 j 800093d2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hcdcddf7362d728f0E+0x1a> + } + 800093d2: 6502 ld a0,0(sp) + 800093d4: 60e2 ld ra,24(sp) + 800093d6: 6105 addi sp,sp,32 + 800093d8: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E: + +00000000800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E>: + } +} + +impl Spinlock { + /// It should be called at the start of file system call. + pub fn begin_op(&self) { + 800093da: 7135 addi sp,sp,-160 + 800093dc: ed06 sd ra,152(sp) + 800093de: f8aa sd a0,112(sp) + 800093e0: e52a sd a0,136(sp) + let mut guard = self.acquire(); + 800093e2: 00008097 auipc ra,0x8 + 800093e6: 800080e7 jalr -2048(ra) # 80010be2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E> + 800093ea: fcaa sd a0,120(sp) + 800093ec: a009 j 800093ee <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x14> + 800093ee: 18a8 addi a0,sp,120 + loop { + if guard.committing || + 800093f0: 00009097 auipc ra,0x9 + 800093f4: 910080e7 jalr -1776(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 800093f8: f4aa sd a0,104(sp) + 800093fa: a02d j 80009424 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x4a> + 800093fc: 4505 li a0,1 + 800093fe: 08a103a3 sb a0,135(sp) + 80009402: a821 j 8000941a <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x40> + 80009404: 4501 li a0,0 + 80009406: 08a103a3 sb a0,135(sp) + 8000940a: a801 j 8000941a <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x40> + 8000940c: 18a8 addi a0,sp,120 + 1 + guard.lh.len as usize + + 8000940e: 00009097 auipc ra,0x9 + 80009412: 8f2080e7 jalr -1806(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009416: f0aa sd a0,96(sp) + 80009418: a821 j 80009430 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x56> + if guard.committing || + 8000941a: 08714503 lbu a0,135(sp) + 8000941e: 8905 andi a0,a0,1 + 80009420: ed35 bnez a0,8000949c <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0xc2> + 80009422: a061 j 800094aa <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0xd0> + 80009424: 7526 ld a0,104(sp) + 80009426: 08854503 lbu a0,136(a0) + 8000942a: 8905 andi a0,a0,1 + 8000942c: f961 bnez a0,800093fc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x22> + 8000942e: bff9 j 8000940c <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x32> + 1 + guard.lh.len as usize + + 80009430: 7506 ld a0,96(sp) + 80009432: 01056503 lwu a0,16(a0) + 80009436: 0505 addi a0,a0,1 + 80009438: ecaa sd a0,88(sp) + 8000943a: 4501 li a0,0 + 8000943c: 10051163 bnez a0,8000953e <.LBB0_30> + 80009440: a009 j 80009442 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x68> + 80009442: 18a8 addi a0,sp,120 + (guard.outstanding+1) as usize * MAXOPBLOCKS > LOGSIZE + 80009444: 00009097 auipc ra,0x9 + 80009448: 8bc080e7 jalr -1860(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 8000944c: e8aa sd a0,80(sp) + 8000944e: a009 j 80009450 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x76> + 80009450: 6546 ld a0,80(sp) + 80009452: 00c56503 lwu a0,12(a0) + 80009456: 00150593 addi a1,a0,1 + 8000945a: e4ae sd a1,72(sp) + 8000945c: 02059513 slli a0,a1,0x20 + 80009460: 9101 srli a0,a0,0x20 + 80009462: 0eb51c63 bne a0,a1,8000955a <.LBB0_32> + 80009466: a009 j 80009468 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x8e> + 80009468: 6526 ld a0,72(sp) + 8000946a: 1502 slli a0,a0,0x20 + 8000946c: 9101 srli a0,a0,0x20 + 8000946e: 45a9 li a1,10 + 80009470: 02b50633 mul a2,a0,a1 + 80009474: e0b2 sd a2,64(sp) + 80009476: 02b53533 mulhu a0,a0,a1 + 8000947a: 4581 li a1,0 + 8000947c: 0eb51d63 bne a0,a1,80009576 <.LBB0_34> + 80009480: a009 j 80009482 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0xa8> + 1 + guard.lh.len as usize + + 80009482: 6566 ld a0,88(sp) + 80009484: 6586 ld a1,64(sp) + 80009486: 952e add a0,a0,a1 + 80009488: fc2a sd a0,56(sp) + 8000948a: 4501 li a0,0 + 8000948c: 10051463 bnez a0,80009594 <.LBB0_36> + 80009490: a009 j 80009492 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0xb8> + 80009492: 75e2 ld a1,56(sp) + 80009494: 4579 li a0,30 + if guard.committing || + 80009496: f6b563e3 bltu a0,a1,800093fc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x22> + 8000949a: b7ad j 80009404 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x2a> + 8000949c: 18a8 addi a0,sp,120 + { + let channel = guard.deref() as *const Log as usize; + 8000949e: 00009097 auipc ra,0x9 + 800094a2: 862080e7 jalr -1950(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 800094a6: f82a sd a0,48(sp) + 800094a8: a801 j 800094b8 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0xde> + 800094aa: 18a8 addi a0,sp,120 + unsafe { CPU_MANAGER.myproc().unwrap().sleep(channel, guard); } + guard = self.acquire(); + } else { + guard.outstanding += 1; + 800094ac: 00009097 auipc ra,0x9 + 800094b0: 912080e7 jalr -1774(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 800094b4: f42a sd a0,40(sp) + 800094b6: a8a1 j 8000950e <.LBB0_29+0x38> + let channel = guard.deref() as *const Log as usize; + 800094b8: 7542 ld a0,48(sp) + 800094ba: 85aa mv a1,a0 + 800094bc: ec2e sd a1,24(sp) + 800094be: e92a sd a0,144(sp) + +00000000800094c0 <.LBB0_28>: + unsafe { CPU_MANAGER.myproc().unwrap().sleep(channel, guard); } + 800094c0: 0005d517 auipc a0,0x5d + 800094c4: c8050513 addi a0,a0,-896 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 800094c8: 00009097 auipc ra,0x9 + 800094cc: f90080e7 jalr -112(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 800094d0: f02a sd a0,32(sp) + 800094d2: a009 j 800094d4 <.LBB0_28+0x14> + 800094d4: 7502 ld a0,32(sp) + +00000000800094d6 <.LBB0_29>: + 800094d6: 0001f597 auipc a1,0x1f + 800094da: 16258593 addi a1,a1,354 # 80028638 <.L__unnamed_1> + 800094de: 00006097 auipc ra,0x6 + 800094e2: 2b2080e7 jalr 690(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 800094e6: e82a sd a0,16(sp) + 800094e8: a009 j 800094ea <.LBB0_29+0x14> + 800094ea: 65e2 ld a1,24(sp) + 800094ec: 6542 ld a0,16(sp) + 800094ee: 7666 ld a2,120(sp) + 800094f0: 00009097 auipc ra,0x9 + 800094f4: cd0080e7 jalr -816(ra) # 800121c0 <_ZN6kernel7process7process11task_struct5sleep17h6aeb0e2d2de445aaE> + 800094f8: a009 j 800094fa <.LBB0_29+0x24> + guard = self.acquire(); + 800094fa: 7546 ld a0,112(sp) + 800094fc: 00007097 auipc ra,0x7 + 80009500: 6e6080e7 jalr 1766(ra) # 80010be2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E> + 80009504: e42a sd a0,8(sp) + 80009506: a009 j 80009508 <.LBB0_29+0x32> + 80009508: 6522 ld a0,8(sp) + 8000950a: fcaa sd a0,120(sp) + loop { + 8000950c: b5cd j 800093ee <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E+0x14> + guard.outstanding += 1; + 8000950e: 7522 ld a0,40(sp) + 80009510: 00c56503 lwu a0,12(a0) + 80009514: 00150593 addi a1,a0,1 + 80009518: e02e sd a1,0(sp) + 8000951a: 02059513 slli a0,a1,0x20 + 8000951e: 9101 srli a0,a0,0x20 + 80009520: 08b51863 bne a0,a1,800095b0 <.LBB0_38> + 80009524: a009 j 80009526 <.LBB0_29+0x50> + 80009526: 6502 ld a0,0(sp) + 80009528: 75a2 ld a1,40(sp) + 8000952a: c5c8 sw a0,12(a1) + drop(guard); + 8000952c: 7566 ld a0,120(sp) + 8000952e: 00015097 auipc ra,0x15 + 80009532: 9ba080e7 jalr -1606(ra) # 8001dee8 <_ZN4core3mem4drop17haa2d2dc72bd2e81bE> + 80009536: a009 j 80009538 <.LBB0_29+0x62> + break; + } + } + } + 80009538: 60ea ld ra,152(sp) + 8000953a: 610d addi sp,sp,160 + 8000953c: 8082 ret + +000000008000953e <.LBB0_30>: + 1 + guard.lh.len as usize + + 8000953e: 0001f517 auipc a0,0x1f + 80009542: 09250513 addi a0,a0,146 # 800285d0 + +0000000080009546 <.LBB0_31>: + 80009546: 0001f617 auipc a2,0x1f + 8000954a: 06a60613 addi a2,a2,106 # 800285b0 <.L__unnamed_2> + 8000954e: 45f1 li a1,28 + 80009550: 0001a097 auipc ra,0x1a + 80009554: bf4080e7 jalr -1036(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000955a <.LBB0_32>: + (guard.outstanding+1) as usize * MAXOPBLOCKS > LOGSIZE + 8000955a: 0001f517 auipc a0,0x1f + 8000955e: 07650513 addi a0,a0,118 # 800285d0 + +0000000080009562 <.LBB0_33>: + 80009562: 0001f617 auipc a2,0x1f + 80009566: 08e60613 addi a2,a2,142 # 800285f0 <.L__unnamed_3> + 8000956a: 45f1 li a1,28 + 8000956c: 0001a097 auipc ra,0x1a + 80009570: bd8080e7 jalr -1064(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080009576 <.LBB0_34>: + 80009576: 0001f517 auipc a0,0x1f + 8000957a: 09a50513 addi a0,a0,154 # 80028610 + +000000008000957e <.LBB0_35>: + 8000957e: 0001f617 auipc a2,0x1f + 80009582: 07260613 addi a2,a2,114 # 800285f0 <.L__unnamed_3> + 80009586: 02100593 li a1,33 + 8000958a: 0001a097 auipc ra,0x1a + 8000958e: bba080e7 jalr -1094(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080009594 <.LBB0_36>: + 1 + guard.lh.len as usize + + 80009594: 0001f517 auipc a0,0x1f + 80009598: 03c50513 addi a0,a0,60 # 800285d0 + +000000008000959c <.LBB0_37>: + 8000959c: 0001f617 auipc a2,0x1f + 800095a0: 01460613 addi a2,a2,20 # 800285b0 <.L__unnamed_2> + 800095a4: 45f1 li a1,28 + 800095a6: 0001a097 auipc ra,0x1a + 800095aa: b9e080e7 jalr -1122(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800095b0 <.LBB0_38>: + guard.outstanding += 1; + 800095b0: 0001f517 auipc a0,0x1f + 800095b4: 02050513 addi a0,a0,32 # 800285d0 + +00000000800095b8 <.LBB0_39>: + 800095b8: 0001f617 auipc a2,0x1f + 800095bc: 09860613 addi a2,a2,152 # 80028650 <.L__unnamed_4> + 800095c0: 45f1 li a1,28 + 800095c2: 0001a097 auipc ra,0x1a + 800095c6: b82080e7 jalr -1150(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE: + +00000000800095cc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE>: + + /// Accept a buffer, write it into the log and then release the buffer. + /// This function will pin this buf in the cache until the log commits. + pub fn write(&self, buf: Buf<'_>) { + 800095cc: 7109 addi sp,sp,-384 + 800095ce: fe86 sd ra,376(sp) + 800095d0: e5ae sd a1,200(sp) + 800095d2: eeaa sd a0,344(sp) + let mut guard = self.acquire(); + 800095d4: 00007097 auipc ra,0x7 + 800095d8: 60e080e7 jalr 1550(ra) # 80010be2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E> + 800095dc: edaa sd a0,216(sp) + 800095de: a009 j 800095e0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x14> + 800095e0: 09a8 addi a0,sp,216 + + if (guard.lh.len+1) as usize >= LOGSIZE || guard.lh.len+1 >= guard.size { + 800095e2: 00008097 auipc ra,0x8 + 800095e6: 71e080e7 jalr 1822(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 800095ea: e1aa sd a0,192(sp) + 800095ec: a02d j 80009616 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x4a> + 800095ee: 4505 li a0,1 + 800095f0: 0ea103a3 sb a0,231(sp) + 800095f4: a821 j 8000960c <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x40> + 800095f6: 4501 li a0,0 + 800095f8: 0ea103a3 sb a0,231(sp) + 800095fc: a801 j 8000960c <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x40> + 800095fe: 09a8 addi a0,sp,216 + 80009600: 00008097 auipc ra,0x8 + 80009604: 700080e7 jalr 1792(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009608: fd2a sd a0,184(sp) + 8000960a: a80d j 8000963c <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x70> + 8000960c: 0e714503 lbu a0,231(sp) + 80009610: 8905 andi a0,a0,1 + 80009612: ed39 bnez a0,80009670 <.LBB1_59> + 80009614: a8ad j 8000968e <.LBB1_60+0x16> + 80009616: 650e ld a0,192(sp) + 80009618: 01056503 lwu a0,16(a0) + 8000961c: 00150593 addi a1,a0,1 + 80009620: f92e sd a1,176(sp) + 80009622: 02059513 slli a0,a1,0x20 + 80009626: 9101 srli a0,a0,0x20 + 80009628: 2eb51063 bne a0,a1,80009908 <.LBB1_65> + 8000962c: a009 j 8000962e <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x62> + 8000962e: 754a ld a0,176(sp) + 80009630: 0005059b sext.w a1,a0 + 80009634: 4575 li a0,29 + 80009636: fab56ce3 bltu a0,a1,800095ee <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x22> + 8000963a: b7d1 j 800095fe <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x32> + 8000963c: 756a ld a0,184(sp) + 8000963e: 01056503 lwu a0,16(a0) + 80009642: 00150593 addi a1,a0,1 + 80009646: f52e sd a1,168(sp) + 80009648: 02059513 slli a0,a1,0x20 + 8000964c: 9101 srli a0,a0,0x20 + 8000964e: 2cb51b63 bne a0,a1,80009924 <.LBB1_67> + 80009652: a009 j 80009654 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x88> + 80009654: 09a8 addi a0,sp,216 + 80009656: 00008097 auipc ra,0x8 + 8000965a: 6aa080e7 jalr 1706(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 8000965e: f12a sd a0,160(sp) + 80009660: a009 j 80009662 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x96> + 80009662: 752a ld a0,168(sp) + 80009664: 758a ld a1,160(sp) + 80009666: 41cc lw a1,4(a1) + 80009668: 2501 sext.w a0,a0 + 8000966a: f8b572e3 bgeu a0,a1,800095ee <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x22> + 8000966e: b761 j 800095f6 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE+0x2a> + +0000000080009670 <.LBB1_59>: + panic!("log: not enough space for ongoing transactions"); + 80009670: 0001f517 auipc a0,0x1f + 80009674: 02850513 addi a0,a0,40 # 80028698 <.L__unnamed_5> + +0000000080009678 <.LBB1_60>: + 80009678: 0001f617 auipc a2,0x1f + 8000967c: 05060613 addi a2,a2,80 # 800286c8 <.L__unnamed_6> + 80009680: 02e00593 li a1,46 + 80009684: 0001a097 auipc ra,0x1a + 80009688: ac0080e7 jalr -1344(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000968c: 0000 unimp + 8000968e: 09a8 addi a0,sp,216 + } + if guard.outstanding < 1 { + 80009690: 00008097 auipc ra,0x8 + 80009694: 670080e7 jalr 1648(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009698: ed2a sd a0,152(sp) + 8000969a: a009 j 8000969c <.LBB1_60+0x24> + 8000969c: 656a ld a0,152(sp) + 8000969e: 4548 lw a0,12(a0) + 800096a0: 4581 li a1,0 + 800096a2: 02b51263 bne a0,a1,800096c6 <.LBB1_62+0x16> + 800096a6: a009 j 800096a8 <.LBB1_61> + +00000000800096a8 <.LBB1_61>: + panic!("log: this log write is out of recording"); + 800096a8: 0001f517 auipc a0,0x1f + 800096ac: 03850513 addi a0,a0,56 # 800286e0 <.L__unnamed_7> + +00000000800096b0 <.LBB1_62>: + 800096b0: 0001f617 auipc a2,0x1f + 800096b4: 05860613 addi a2,a2,88 # 80028708 <.L__unnamed_8> + 800096b8: 02700593 li a1,39 + 800096bc: 0001a097 auipc ra,0x1a + 800096c0: a88080e7 jalr -1400(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800096c4: 0000 unimp + 800096c6: 09a8 addi a0,sp,216 + } + + // record the buf's blockno in the log header + for i in 0..guard.lh.len { + 800096c8: 00008097 auipc ra,0x8 + 800096cc: 638080e7 jalr 1592(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 800096d0: e92a sd a0,144(sp) + 800096d2: a009 j 800096d4 <.LBB1_62+0x24> + 800096d4: 654a ld a0,144(sp) + 800096d6: 490c lw a1,16(a0) + 800096d8: 4501 li a0,0 + 800096da: d5aa sw a0,232(sp) + 800096dc: d7ae sw a1,236(sp) + 800096de: 00003097 auipc ra,0x3 + 800096e2: c76080e7 jalr -906(ra) # 8000c354 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h2819071fbc006758E> + 800096e6: e12a sd a0,128(sp) + 800096e8: e52e sd a1,136(sp) + 800096ea: a009 j 800096ec <.LBB1_62+0x3c> + 800096ec: 652a ld a0,136(sp) + 800096ee: 658a ld a1,128(sp) + 800096f0: d9ae sw a1,240(sp) + 800096f2: dbaa sw a0,244(sp) + 800096f4: a009 j 800096f6 <.LBB1_62+0x46> + 800096f6: 1988 addi a0,sp,240 + 800096f8: 00003097 auipc ra,0x3 + 800096fc: aee080e7 jalr -1298(ra) # 8000c1e6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE> + 80009700: ddaa sw a0,248(sp) + 80009702: dfae sw a1,252(sp) + 80009704: a009 j 80009706 <.LBB1_62+0x56> + 80009706: 0f816503 lwu a0,248(sp) + 8000970a: 4581 li a1,0 + 8000970c: 00b50463 beq a0,a1,80009714 <.LBB1_62+0x64> + 80009710: a009 j 80009712 <.LBB1_62+0x62> + 80009712: a809 j 80009724 <.LBB1_62+0x74> + 80009714: 09a8 addi a0,sp,216 + drop(guard); + drop(buf); + return; + } + } + if (guard.lh.len+2) as usize >= LOGSIZE || guard.lh.len+2 >= guard.size { + 80009716: 00008097 auipc ra,0x8 + 8000971a: 5ea080e7 jalr 1514(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 8000971e: fcaa sd a0,120(sp) + 80009720: a865 j 800097d8 <.LBB1_62+0x128> + for i in 0..guard.lh.len { + 80009722: 0000 unimp + 80009724: 0fc16503 lwu a0,252(sp) + 80009728: f4aa sd a0,104(sp) + 8000972a: 16a12223 sw a0,356(sp) + 8000972e: 16a12423 sw a0,360(sp) + 80009732: 16a12623 sw a0,364(sp) + 80009736: 09a8 addi a0,sp,216 + if guard.lh.blocknos[i as usize] == buf.read_blockno() { + 80009738: 00008097 auipc ra,0x8 + 8000973c: 5c8080e7 jalr 1480(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009740: f8aa sd a0,112(sp) + 80009742: a009 j 80009744 <.LBB1_62+0x94> + 80009744: 7526 ld a0,104(sp) + 80009746: 0005059b sext.w a1,a0 + 8000974a: f0aa sd a0,96(sp) + 8000974c: 4571 li a0,28 + 8000974e: 1eb56963 bltu a0,a1,80009940 <.LBB1_68+0x14> + 80009752: a009 j 80009754 <.LBB1_62+0xa4> + 80009754: 652e ld a0,200(sp) + 80009756: 75c6 ld a1,112(sp) + 80009758: 7606 ld a2,96(sp) + 8000975a: 060a slli a2,a2,0x2 + 8000975c: 95b2 add a1,a1,a2 + 8000975e: 0145e583 lwu a1,20(a1) + 80009762: e8ae sd a1,80(sp) + 80009764: ffffa097 auipc ra,0xffffa + 80009768: 04a080e7 jalr 74(ra) # 800037ae <_ZN6kernel2fs3bio3Buf12read_blockno17ha2cb61f265147e82E> + 8000976c: ecaa sd a0,88(sp) + 8000976e: a009 j 80009770 <.LBB1_62+0xc0> + 80009770: 6546 ld a0,80(sp) + 80009772: 65e6 ld a1,88(sp) + 80009774: 2581 sext.w a1,a1 + 80009776: 2501 sext.w a0,a0 + 80009778: 00b51963 bne a0,a1,8000978a <.LBB1_62+0xda> + 8000977c: a009 j 8000977e <.LBB1_62+0xce> + drop(guard); + 8000977e: 656e ld a0,216(sp) + 80009780: 00014097 auipc ra,0x14 + 80009784: 768080e7 jalr 1896(ra) # 8001dee8 <_ZN4core3mem4drop17haa2d2dc72bd2e81bE> + 80009788: a011 j 8000978c <.LBB1_62+0xdc> + for i in 0..guard.lh.len { + 8000978a: b7b5 j 800096f6 <.LBB1_62+0x46> + drop(buf); + 8000978c: 652e ld a0,200(sp) + 8000978e: 710c ld a1,32(a0) + 80009790: f22e sd a1,288(sp) + 80009792: 6d0c ld a1,24(a0) + 80009794: ee2e sd a1,280(sp) + 80009796: 690c ld a1,16(a0) + 80009798: ea2e sd a1,272(sp) + 8000979a: 650c ld a1,8(a0) + 8000979c: e62e sd a1,264(sp) + 8000979e: 6108 ld a0,0(a0) + 800097a0: e22a sd a0,256(sp) + 800097a2: 0208 addi a0,sp,256 + 800097a4: 00014097 auipc ra,0x14 + 800097a8: 77a080e7 jalr 1914(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 800097ac: a009 j 800097ae <.LBB1_62+0xfe> + let len = guard.lh.len as usize; + guard.lh.blocknos[len] = buf.read_blockno(); + guard.lh.len += 1; + drop(guard); + drop(buf); + } + 800097ae: aa91 j 80009902 <.LBB1_64+0xc8> + 800097b0: 4505 li a0,1 + if (guard.lh.len+2) as usize >= LOGSIZE || guard.lh.len+2 >= guard.size { + 800097b2: 12a107a3 sb a0,303(sp) + 800097b6: a821 j 800097ce <.LBB1_62+0x11e> + 800097b8: 4501 li a0,0 + 800097ba: 12a107a3 sb a0,303(sp) + 800097be: a801 j 800097ce <.LBB1_62+0x11e> + 800097c0: 09a8 addi a0,sp,216 + 800097c2: 00008097 auipc ra,0x8 + 800097c6: 53e080e7 jalr 1342(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 800097ca: e4aa sd a0,72(sp) + 800097cc: a80d j 800097fe <.LBB1_62+0x14e> + 800097ce: 12f14503 lbu a0,303(sp) + 800097d2: 8905 andi a0,a0,1 + 800097d4: ed39 bnez a0,80009832 <.LBB1_63> + 800097d6: a8ad j 80009850 <.LBB1_64+0x16> + 800097d8: 7566 ld a0,120(sp) + 800097da: 01056503 lwu a0,16(a0) + 800097de: 00250593 addi a1,a0,2 + 800097e2: e0ae sd a1,64(sp) + 800097e4: 02059513 slli a0,a1,0x20 + 800097e8: 9101 srli a0,a0,0x20 + 800097ea: 16b51663 bne a0,a1,80009956 <.LBB1_70> + 800097ee: a009 j 800097f0 <.LBB1_62+0x140> + 800097f0: 6506 ld a0,64(sp) + 800097f2: 0005059b sext.w a1,a0 + 800097f6: 4575 li a0,29 + 800097f8: fab56ce3 bltu a0,a1,800097b0 <.LBB1_62+0x100> + 800097fc: b7d1 j 800097c0 <.LBB1_62+0x110> + 800097fe: 6526 ld a0,72(sp) + 80009800: 01056503 lwu a0,16(a0) + 80009804: 00250593 addi a1,a0,2 + 80009808: fc2e sd a1,56(sp) + 8000980a: 02059513 slli a0,a1,0x20 + 8000980e: 9101 srli a0,a0,0x20 + 80009810: 16b51163 bne a0,a1,80009972 <.LBB1_72> + 80009814: a009 j 80009816 <.LBB1_62+0x166> + 80009816: 09a8 addi a0,sp,216 + 80009818: 00008097 auipc ra,0x8 + 8000981c: 4e8080e7 jalr 1256(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009820: f82a sd a0,48(sp) + 80009822: a009 j 80009824 <.LBB1_62+0x174> + 80009824: 7562 ld a0,56(sp) + 80009826: 75c2 ld a1,48(sp) + 80009828: 41cc lw a1,4(a1) + 8000982a: 2501 sext.w a0,a0 + 8000982c: f8b572e3 bgeu a0,a1,800097b0 <.LBB1_62+0x100> + 80009830: b761 j 800097b8 <.LBB1_62+0x108> + +0000000080009832 <.LBB1_63>: + panic!("log: not enough space for this transaction"); + 80009832: 0001f517 auipc a0,0x1f + 80009836: f3650513 addi a0,a0,-202 # 80028768 <.L__unnamed_9> + +000000008000983a <.LBB1_64>: + 8000983a: 0001f617 auipc a2,0x1f + 8000983e: f5e60613 addi a2,a2,-162 # 80028798 <.L__unnamed_10> + 80009842: 02a00593 li a1,42 + 80009846: 0001a097 auipc ra,0x1a + 8000984a: 8fe080e7 jalr -1794(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000984e: 0000 unimp + unsafe { buf.pin(); } + 80009850: 652e ld a0,200(sp) + 80009852: ffffa097 auipc ra,0xffffa + 80009856: 010080e7 jalr 16(ra) # 80003862 <_ZN6kernel2fs3bio3Buf3pin17hb02a509b70e70322E> + 8000985a: a009 j 8000985c <.LBB1_64+0x22> + 8000985c: 09a8 addi a0,sp,216 + let len = guard.lh.len as usize; + 8000985e: 00008097 auipc ra,0x8 + 80009862: 4a2080e7 jalr 1186(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009866: f42a sd a0,40(sp) + 80009868: a009 j 8000986a <.LBB1_64+0x30> + 8000986a: 652e ld a0,200(sp) + 8000986c: 75a2 ld a1,40(sp) + 8000986e: 0105e583 lwu a1,16(a1) + 80009872: ec2e sd a1,24(sp) + 80009874: faae sd a1,368(sp) + guard.lh.blocknos[len] = buf.read_blockno(); + 80009876: ffffa097 auipc ra,0xffffa + 8000987a: f38080e7 jalr -200(ra) # 800037ae <_ZN6kernel2fs3bio3Buf12read_blockno17ha2cb61f265147e82E> + 8000987e: f02a sd a0,32(sp) + 80009880: a009 j 80009882 <.LBB1_64+0x48> + 80009882: 09a8 addi a0,sp,216 + 80009884: 00008097 auipc ra,0x8 + 80009888: 53a080e7 jalr 1338(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 8000988c: e82a sd a0,16(sp) + 8000988e: a009 j 80009890 <.LBB1_64+0x56> + 80009890: 65e2 ld a1,24(sp) + 80009892: 4571 li a0,28 + 80009894: 0eb56d63 bltu a0,a1,8000998e <.LBB1_73+0x14> + 80009898: a009 j 8000989a <.LBB1_64+0x60> + 8000989a: 7502 ld a0,32(sp) + 8000989c: 65c2 ld a1,16(sp) + 8000989e: 6662 ld a2,24(sp) + 800098a0: 060a slli a2,a2,0x2 + 800098a2: 95b2 add a1,a1,a2 + 800098a4: c9c8 sw a0,20(a1) + 800098a6: 09a8 addi a0,sp,216 + guard.lh.len += 1; + 800098a8: 00008097 auipc ra,0x8 + 800098ac: 516080e7 jalr 1302(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 800098b0: e42a sd a0,8(sp) + 800098b2: a009 j 800098b4 <.LBB1_64+0x7a> + 800098b4: 6522 ld a0,8(sp) + 800098b6: 01056503 lwu a0,16(a0) + 800098ba: 00150593 addi a1,a0,1 + 800098be: e02e sd a1,0(sp) + 800098c0: 02059513 slli a0,a1,0x20 + 800098c4: 9101 srli a0,a0,0x20 + 800098c6: 0cb51f63 bne a0,a1,800099a4 <.LBB1_75> + 800098ca: a009 j 800098cc <.LBB1_64+0x92> + 800098cc: 6502 ld a0,0(sp) + 800098ce: 65a2 ld a1,8(sp) + 800098d0: c988 sw a0,16(a1) + drop(guard); + 800098d2: 656e ld a0,216(sp) + 800098d4: 00014097 auipc ra,0x14 + 800098d8: 614080e7 jalr 1556(ra) # 8001dee8 <_ZN4core3mem4drop17haa2d2dc72bd2e81bE> + 800098dc: a009 j 800098de <.LBB1_64+0xa4> + drop(buf); + 800098de: 652e ld a0,200(sp) + 800098e0: 710c ld a1,32(a0) + 800098e2: eaae sd a1,336(sp) + 800098e4: 6d0c ld a1,24(a0) + 800098e6: e6ae sd a1,328(sp) + 800098e8: 690c ld a1,16(a0) + 800098ea: e2ae sd a1,320(sp) + 800098ec: 650c ld a1,8(a0) + 800098ee: fe2e sd a1,312(sp) + 800098f0: 6108 ld a0,0(a0) + 800098f2: fa2a sd a0,304(sp) + 800098f4: 1a08 addi a0,sp,304 + 800098f6: 00014097 auipc ra,0x14 + 800098fa: 628080e7 jalr 1576(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 800098fe: a009 j 80009900 <.LBB1_64+0xc6> + } + 80009900: a009 j 80009902 <.LBB1_64+0xc8> + 80009902: 70f6 ld ra,376(sp) + 80009904: 6119 addi sp,sp,384 + 80009906: 8082 ret + +0000000080009908 <.LBB1_65>: + if (guard.lh.len+1) as usize >= LOGSIZE || guard.lh.len+1 >= guard.size { + 80009908: 0001f517 auipc a0,0x1f + 8000990c: cc850513 addi a0,a0,-824 # 800285d0 + +0000000080009910 <.LBB1_66>: + 80009910: 0001f617 auipc a2,0x1f + 80009914: d5860613 addi a2,a2,-680 # 80028668 <.L__unnamed_11> + 80009918: 45f1 li a1,28 + 8000991a: 0001a097 auipc ra,0x1a + 8000991e: 82a080e7 jalr -2006(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080009924 <.LBB1_67>: + 80009924: 0001f517 auipc a0,0x1f + 80009928: cac50513 addi a0,a0,-852 # 800285d0 + +000000008000992c <.LBB1_68>: + 8000992c: 0001f617 auipc a2,0x1f + 80009930: d5460613 addi a2,a2,-684 # 80028680 <.L__unnamed_12> + 80009934: 45f1 li a1,28 + 80009936: 0001a097 auipc ra,0x1a + 8000993a: 80e080e7 jalr -2034(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000993e: 0000 unimp + if guard.lh.blocknos[i as usize] == buf.read_blockno() { + 80009940: 7506 ld a0,96(sp) + +0000000080009942 <.LBB1_69>: + 80009942: 0001f617 auipc a2,0x1f + 80009946: dde60613 addi a2,a2,-546 # 80028720 <.L__unnamed_13> + 8000994a: 45f5 li a1,29 + 8000994c: 0001a097 auipc ra,0x1a + 80009950: 824080e7 jalr -2012(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080009956 <.LBB1_70>: + if (guard.lh.len+2) as usize >= LOGSIZE || guard.lh.len+2 >= guard.size { + 80009956: 0001f517 auipc a0,0x1f + 8000995a: c7a50513 addi a0,a0,-902 # 800285d0 + +000000008000995e <.LBB1_71>: + 8000995e: 0001f617 auipc a2,0x1f + 80009962: dda60613 addi a2,a2,-550 # 80028738 <.L__unnamed_14> + 80009966: 45f1 li a1,28 + 80009968: 00019097 auipc ra,0x19 + 8000996c: 7dc080e7 jalr 2012(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080009972 <.LBB1_72>: + 80009972: 0001f517 auipc a0,0x1f + 80009976: c5e50513 addi a0,a0,-930 # 800285d0 + +000000008000997a <.LBB1_73>: + 8000997a: 0001f617 auipc a2,0x1f + 8000997e: dd660613 addi a2,a2,-554 # 80028750 <.L__unnamed_15> + 80009982: 45f1 li a1,28 + 80009984: 00019097 auipc ra,0x19 + 80009988: 7c0080e7 jalr 1984(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000998c: 0000 unimp + guard.lh.blocknos[len] = buf.read_blockno(); + 8000998e: 6562 ld a0,24(sp) + +0000000080009990 <.LBB1_74>: + 80009990: 0001f617 auipc a2,0x1f + 80009994: e2060613 addi a2,a2,-480 # 800287b0 <.L__unnamed_16> + 80009998: 45f5 li a1,29 + 8000999a: 00019097 auipc ra,0x19 + 8000999e: 7d6080e7 jalr 2006(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +00000000800099a4 <.LBB1_75>: + guard.lh.len += 1; + 800099a4: 0001f517 auipc a0,0x1f + 800099a8: c2c50513 addi a0,a0,-980 # 800285d0 + +00000000800099ac <.LBB1_76>: + 800099ac: 0001f617 auipc a2,0x1f + 800099b0: e1c60613 addi a2,a2,-484 # 800287c8 <.L__unnamed_17> + 800099b4: 45f1 li a1,28 + 800099b6: 00019097 auipc ra,0x19 + 800099ba: 78e080e7 jalr 1934(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE: + +00000000800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE>: + + /// It should be called at the end of file system call. + /// It will commit the log if this is the last outstanding op. + pub fn end_op(&self) { + 800099c0: 7171 addi sp,sp,-176 + 800099c2: f506 sd ra,168(sp) + 800099c4: f4aa sd a0,104(sp) + 800099c6: e92a sd a0,144(sp) + 800099c8: 4501 li a0,0 + let mut log_ptr: *mut Log = ptr::null_mut(); + 800099ca: fcaa sd a0,120(sp) + 800099cc: a009 j 800099ce <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE+0xe> + + let mut guard = self.acquire(); + 800099ce: 7526 ld a0,104(sp) + 800099d0: 00007097 auipc ra,0x7 + 800099d4: 212080e7 jalr 530(ra) # 80010be2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E> + 800099d8: e12a sd a0,128(sp) + 800099da: a009 j 800099dc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE+0x1c> + 800099dc: 0108 addi a0,sp,128 + guard.outstanding -= 1; + 800099de: 00008097 auipc ra,0x8 + 800099e2: 3e0080e7 jalr 992(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 800099e6: f0aa sd a0,96(sp) + 800099e8: a009 j 800099ea <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE+0x2a> + 800099ea: 7506 ld a0,96(sp) + 800099ec: 00c56503 lwu a0,12(a0) + 800099f0: fff50593 addi a1,a0,-1 + 800099f4: ecae sd a1,88(sp) + 800099f6: 02059513 slli a0,a1,0x20 + 800099fa: 9101 srli a0,a0,0x20 + 800099fc: 16b51063 bne a0,a1,80009b5c <.LBB2_35> + 80009a00: a009 j 80009a02 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE+0x42> + 80009a02: 6566 ld a0,88(sp) + 80009a04: 7586 ld a1,96(sp) + 80009a06: c5c8 sw a0,12(a1) + 80009a08: 0108 addi a0,sp,128 + if guard.committing { + 80009a0a: 00008097 auipc ra,0x8 + 80009a0e: 2f6080e7 jalr 758(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009a12: e8aa sd a0,80(sp) + 80009a14: a009 j 80009a16 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE+0x56> + 80009a16: 6546 ld a0,80(sp) + 80009a18: 08854503 lbu a0,136(a0) + 80009a1c: 8905 andi a0,a0,1 + 80009a1e: 4581 li a1,0 + 80009a20: 02b50263 beq a0,a1,80009a44 <.LBB2_31+0x16> + 80009a24: a009 j 80009a26 <.LBB2_30> + +0000000080009a26 <.LBB2_30>: + // it is not allowed to start a fs op while the log is commiting + panic!("log: end fs op while the log is committing"); + 80009a26: 0001f517 auipc a0,0x1f + 80009a2a: dfb50513 addi a0,a0,-517 # 80028821 <.L__unnamed_18> + +0000000080009a2e <.LBB2_31>: + 80009a2e: 0001f617 auipc a2,0x1f + 80009a32: e2260613 addi a2,a2,-478 # 80028850 <.L__unnamed_19> + 80009a36: 02a00593 li a1,42 + 80009a3a: 00019097 auipc ra,0x19 + 80009a3e: 70a080e7 jalr 1802(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80009a42: 0000 unimp + 80009a44: 0108 addi a0,sp,128 + } + if guard.outstanding == 0 { + 80009a46: 00008097 auipc ra,0x8 + 80009a4a: 2ba080e7 jalr 698(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009a4e: e4aa sd a0,72(sp) + 80009a50: a009 j 80009a52 <.LBB2_31+0x24> + 80009a52: 6526 ld a0,72(sp) + 80009a54: 4548 lw a0,12(a0) + 80009a56: 4581 li a1,0 + 80009a58: 00b51a63 bne a0,a1,80009a6c <.LBB2_31+0x3e> + 80009a5c: a009 j 80009a5e <.LBB2_31+0x30> + 80009a5e: 0108 addi a0,sp,128 + guard.committing = true; + 80009a60: 00008097 auipc ra,0x8 + 80009a64: 35e080e7 jalr 862(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 80009a68: e0aa sd a0,64(sp) + 80009a6a: a801 j 80009a7a <.LBB2_31+0x4c> + 80009a6c: 0108 addi a0,sp,128 + log_ptr = guard.deref_mut() as *mut Log; + } else { + let channel = guard.deref() as *const Log as usize; + 80009a6e: 00008097 auipc ra,0x8 + 80009a72: 292080e7 jalr 658(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009a76: fc2a sd a0,56(sp) + 80009a78: a839 j 80009a96 <.LBB2_31+0x68> + 80009a7a: 6586 ld a1,64(sp) + 80009a7c: 4505 li a0,1 + guard.committing = true; + 80009a7e: 08a58423 sb a0,136(a1) + 80009a82: 0108 addi a0,sp,128 + log_ptr = guard.deref_mut() as *mut Log; + 80009a84: 00008097 auipc ra,0x8 + 80009a88: 33a080e7 jalr 826(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 80009a8c: f82a sd a0,48(sp) + 80009a8e: a009 j 80009a90 <.LBB2_31+0x62> + 80009a90: 7542 ld a0,48(sp) + 80009a92: fcaa sd a0,120(sp) + if guard.outstanding == 0 { + 80009a94: a829 j 80009aae <.LBB2_32+0x14> + let channel = guard.deref() as *const Log as usize; + 80009a96: 75e2 ld a1,56(sp) + 80009a98: ed2e sd a1,152(sp) + +0000000080009a9a <.LBB2_32>: + unsafe { PROC_MANAGER.wake_up(channel); } + 80009a9a: 00050517 auipc a0,0x50 + 80009a9e: 93650513 addi a0,a0,-1738 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80009aa2: 00004097 auipc ra,0x4 + 80009aa6: 75e080e7 jalr 1886(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 80009aaa: a009 j 80009aac <.LBB2_32+0x12> + if guard.outstanding == 0 { + 80009aac: a009 j 80009aae <.LBB2_32+0x14> + } + drop(guard); + 80009aae: 650a ld a0,128(sp) + 80009ab0: 00014097 auipc ra,0x14 + 80009ab4: 438080e7 jalr 1080(ra) # 8001dee8 <_ZN4core3mem4drop17haa2d2dc72bd2e81bE> + 80009ab8: a009 j 80009aba <.LBB2_32+0x20> + + if !log_ptr.is_null() { + 80009aba: 7566 ld a0,120(sp) + 80009abc: 00000097 auipc ra,0x0 + 80009ac0: 8fc080e7 jalr -1796(ra) # 800093b8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hcdcddf7362d728f0E> + 80009ac4: f42a sd a0,40(sp) + 80009ac6: a009 j 80009ac8 <.LBB2_32+0x2e> + 80009ac8: 7522 ld a0,40(sp) + 80009aca: e909 bnez a0,80009adc <.LBB2_32+0x42> + 80009acc: a009 j 80009ace <.LBB2_32+0x34> + // SAFETY: Call commit without holding any lock. + // And the committing flag protects the log op. + unsafe { log_ptr.as_mut().unwrap().commit(); } + 80009ace: 7566 ld a0,120(sp) + 80009ad0: 00000097 auipc ra,0x0 + 80009ad4: 894080e7 jalr -1900(ra) # 80009364 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE> + 80009ad8: f02a sd a0,32(sp) + 80009ada: a011 j 80009ade <.LBB2_32+0x44> + if !log_ptr.is_null() { + 80009adc: a8ad j 80009b56 <.LBB2_34+0x20> + unsafe { log_ptr.as_mut().unwrap().commit(); } + 80009ade: 7502 ld a0,32(sp) + +0000000080009ae0 <.LBB2_33>: + 80009ae0: 0001f597 auipc a1,0x1f + 80009ae4: d8858593 addi a1,a1,-632 # 80028868 <.L__unnamed_20> + 80009ae8: 00006097 auipc ra,0x6 + 80009aec: c3c080e7 jalr -964(ra) # 8000f724 <_ZN4core6option15Option$LT$T$GT$6unwrap17hc367d03244a4b027E> + 80009af0: ec2a sd a0,24(sp) + 80009af2: a009 j 80009af4 <.LBB2_33+0x14> + 80009af4: 6562 ld a0,24(sp) + 80009af6: 00007097 auipc ra,0x7 + 80009afa: 9ce080e7 jalr -1586(ra) # 800104c4 <_ZN6kernel2fs3log3Log6commit17hb6044c935645b581E> + 80009afe: a009 j 80009b00 <.LBB2_33+0x20> + let mut guard = self.acquire(); + 80009b00: 7526 ld a0,104(sp) + 80009b02: 00007097 auipc ra,0x7 + 80009b06: 0e0080e7 jalr 224(ra) # 80010be2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E> + 80009b0a: e52a sd a0,136(sp) + 80009b0c: a009 j 80009b0e <.LBB2_33+0x2e> + 80009b0e: 0128 addi a0,sp,136 + guard.committing = false; + 80009b10: 00008097 auipc ra,0x8 + 80009b14: 2ae080e7 jalr 686(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 80009b18: e82a sd a0,16(sp) + 80009b1a: a009 j 80009b1c <.LBB2_33+0x3c> + 80009b1c: 65c2 ld a1,16(sp) + 80009b1e: 4501 li a0,0 + 80009b20: 08a58423 sb a0,136(a1) + 80009b24: 0128 addi a0,sp,136 + let channel = guard.deref() as *const Log as usize; + 80009b26: 00008097 auipc ra,0x8 + 80009b2a: 1da080e7 jalr 474(ra) # 80011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE> + 80009b2e: e42a sd a0,8(sp) + 80009b30: a009 j 80009b32 <.LBB2_33+0x52> + 80009b32: 65a2 ld a1,8(sp) + 80009b34: f12e sd a1,160(sp) + +0000000080009b36 <.LBB2_34>: + unsafe { PROC_MANAGER.wake_up(channel); } + 80009b36: 00050517 auipc a0,0x50 + 80009b3a: 89a50513 addi a0,a0,-1894 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80009b3e: 00004097 auipc ra,0x4 + 80009b42: 6c2080e7 jalr 1730(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 80009b46: a009 j 80009b48 <.LBB2_34+0x12> + drop(guard); + 80009b48: 652a ld a0,136(sp) + 80009b4a: 00014097 auipc ra,0x14 + 80009b4e: 39e080e7 jalr 926(ra) # 8001dee8 <_ZN4core3mem4drop17haa2d2dc72bd2e81bE> + 80009b52: a009 j 80009b54 <.LBB2_34+0x1e> + if !log_ptr.is_null() { + 80009b54: a009 j 80009b56 <.LBB2_34+0x20> + } + } + 80009b56: 70aa ld ra,168(sp) + 80009b58: 614d addi sp,sp,176 + 80009b5a: 8082 ret + +0000000080009b5c <.LBB2_35>: + guard.outstanding -= 1; + 80009b5c: 0001f517 auipc a0,0x1f + 80009b60: ca450513 addi a0,a0,-860 # 80028800 + +0000000080009b64 <.LBB2_36>: + 80009b64: 0001f617 auipc a2,0x1f + 80009b68: c7c60613 addi a2,a2,-900 # 800287e0 <.L__unnamed_21> + 80009b6c: 02100593 li a1,33 + 80009b70: 00019097 auipc ra,0x19 + 80009b74: 5d4080e7 jalr 1492(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E: + +0000000080009b7a <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E>: + } +} + +impl Spinlock { + /// Read or write a certain Buf, which is returned after the op is done. + pub fn rw(&self, buf: &mut Buf<'_>, writing: bool) { + 80009b7a: c8010113 addi sp,sp,-896 + 80009b7e: 36113c23 sd ra,888(sp) + 80009b82: 26b13c23 sd a1,632(sp) + 80009b86: 28a13023 sd a0,640(sp) + 80009b8a: 86b2 mv a3,a2 + 80009b8c: 28d13423 sd a3,648(sp) + 80009b90: 32a13423 sd a0,808(sp) + 80009b94: 32b13823 sd a1,816(sp) + 80009b98: 32c10fa3 sb a2,831(sp) + let mut guard = self.acquire(); + 80009b9c: 00007097 auipc ra,0x7 + 80009ba0: 3c6080e7 jalr 966(ra) # 80010f62 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E> + 80009ba4: 28a13823 sd a0,656(sp) + 80009ba8: a009 j 80009baa <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E+0x30> + let buf_raw_data = buf.raw_data_mut(); + 80009baa: 27813503 ld a0,632(sp) + 80009bae: ffffa097 auipc ra,0xffffa + 80009bb2: c70080e7 jalr -912(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 80009bb6: 85aa mv a1,a0 + 80009bb8: 26b13823 sd a1,624(sp) + 80009bbc: 34a13023 sd a0,832(sp) + 80009bc0: a009 j 80009bc2 <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E+0x48> + 80009bc2: 4501 li a0,0 + + let mut idx: [usize; 3] = [0; 3]; + 80009bc4: 2aa13423 sd a0,680(sp) + 80009bc8: 2aa13023 sd a0,672(sp) + 80009bcc: 28a13c23 sd a0,664(sp) + loop { + 80009bd0: a009 j 80009bd2 <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E+0x58> + 80009bd2: 0d08 addi a0,sp,656 + if guard.alloc3_desc(&mut idx) { + 80009bd4: 00008097 auipc ra,0x8 + 80009bd8: 1aa080e7 jalr 426(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009bdc: 26a13423 sd a0,616(sp) + 80009be0: a009 j 80009be2 <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E+0x68> + 80009be2: 26813503 ld a0,616(sp) + 80009be6: 0d2c addi a1,sp,664 + 80009be8: 00016097 auipc ra,0x16 + 80009bec: 14e080e7 jalr 334(ra) # 8001fd36 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E> + 80009bf0: 26a13023 sd a0,608(sp) + 80009bf4: a009 j 80009bf6 <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E+0x7c> + 80009bf6: 26013503 ld a0,608(sp) + 80009bfa: 4581 li a1,0 + 80009bfc: 00b50b63 beq a0,a1,80009c12 <.LBB3_117> + 80009c00: a009 j 80009c02 <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E+0x88> + 80009c02: 0d08 addi a0,sp,656 + } + } + + // format descriptors + // QEMU's virtio block device read them + let buf0 = &mut guard.ops[idx[0]]; + 80009c04: 00008097 auipc ra,0x8 + 80009c08: 17a080e7 jalr 378(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009c0c: 24a13c23 sd a0,600(sp) + 80009c10: a8a5 j 80009c88 <.LBB3_118+0x5c> + +0000000080009c12 <.LBB3_117>: + CPU_MANAGER.myproc().unwrap().sleep(&guard.free[0] as *const bool as usize, guard); + 80009c12: 0005c517 auipc a0,0x5c + 80009c16: 52e50513 addi a0,a0,1326 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80009c1a: 00009097 auipc ra,0x9 + 80009c1e: 83e080e7 jalr -1986(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80009c22: 24a13823 sd a0,592(sp) + 80009c26: a009 j 80009c28 <.LBB3_117+0x16> + 80009c28: 25013503 ld a0,592(sp) + +0000000080009c2c <.LBB3_118>: + 80009c2c: 0001f597 auipc a1,0x1f + 80009c30: f5c58593 addi a1,a1,-164 # 80028b88 <.L__unnamed_22> + 80009c34: 00006097 auipc ra,0x6 + 80009c38: b5c080e7 jalr -1188(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80009c3c: 24a13423 sd a0,584(sp) + 80009c40: a009 j 80009c42 <.LBB3_118+0x16> + 80009c42: 0d08 addi a0,sp,656 + 80009c44: 00008097 auipc ra,0x8 + 80009c48: 09c080e7 jalr 156(ra) # 80011ce0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7eb0b551b3d2dabcE> + 80009c4c: 24a13023 sd a0,576(sp) + 80009c50: a009 j 80009c52 <.LBB3_118+0x26> + 80009c52: 24813503 ld a0,584(sp) + 80009c56: 24013583 ld a1,576(sp) + 80009c5a: 6609 lui a2,0x2 + 80009c5c: 95b2 add a1,a1,a2 + 80009c5e: 29013603 ld a2,656(sp) + 80009c62: 00008097 auipc ra,0x8 + 80009c66: 702080e7 jalr 1794(ra) # 80012364 <_ZN6kernel7process7process11task_struct5sleep17heedb33ddc1916294E> + 80009c6a: a009 j 80009c6c <.LBB3_118+0x40> + guard = self.acquire(); + 80009c6c: 28013503 ld a0,640(sp) + 80009c70: 00007097 auipc ra,0x7 + 80009c74: 2f2080e7 jalr 754(ra) # 80010f62 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E> + 80009c78: 22a13c23 sd a0,568(sp) + 80009c7c: a009 j 80009c7e <.LBB3_118+0x52> + 80009c7e: 23813503 ld a0,568(sp) + 80009c82: 28a13823 sd a0,656(sp) + loop { + 80009c86: b7b1 j 80009bd2 <_ZN6kernel6driver11virtio_disk91_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..virtio_disk..Disk$GT$$GT$2rw17h4aaaa8090d764af5E+0x58> + let buf0 = &mut guard.ops[idx[0]]; + 80009c88: 29813583 ld a1,664(sp) + 80009c8c: 22b13823 sd a1,560(sp) + 80009c90: 451d li a0,7 + 80009c92: 68b56b63 bltu a0,a1,8000a328 <.LBB3_127+0x4a> + 80009c96: a009 j 80009c98 <.LBB3_118+0x6c> + 80009c98: 28813503 ld a0,648(sp) + 80009c9c: 25813583 ld a1,600(sp) + 80009ca0: 23013603 ld a2,560(sp) + 80009ca4: 0612 slli a2,a2,0x4 + 80009ca6: 95b2 add a1,a1,a2 + 80009ca8: 6609 lui a2,0x2 + 80009caa: 0d06061b addiw a2,a2,208 + 80009cae: 95b2 add a1,a1,a2 + 80009cb0: 22b13423 sd a1,552(sp) + 80009cb4: 34b13423 sd a1,840(sp) + 80009cb8: 4581 li a1,0 + buf0.type_ = if writing { VIRTIO_BLK_T_OUT } else { VIRTIO_BLK_T_IN }; + 80009cba: 00b50763 beq a0,a1,80009cc8 <.LBB3_118+0x9c> + 80009cbe: a009 j 80009cc0 <.LBB3_118+0x94> + 80009cc0: 4505 li a0,1 + 80009cc2: 2aa12823 sw a0,688(sp) + 80009cc6: a029 j 80009cd0 <.LBB3_118+0xa4> + 80009cc8: 4501 li a0,0 + 80009cca: 2aa12823 sw a0,688(sp) + 80009cce: a009 j 80009cd0 <.LBB3_118+0xa4> + 80009cd0: 27813503 ld a0,632(sp) + 80009cd4: 22813603 ld a2,552(sp) + 80009cd8: 2b012583 lw a1,688(sp) + 80009cdc: c20c sw a1,0(a2) + 80009cde: 4581 li a1,0 + buf0.reserved = 0; + 80009ce0: c24c sw a1,4(a2) + buf0.sector = (buf.read_blockno() as usize * (BSIZE / 512)) as u64; + 80009ce2: ffffa097 auipc ra,0xffffa + 80009ce6: acc080e7 jalr -1332(ra) # 800037ae <_ZN6kernel2fs3bio3Buf12read_blockno17ha2cb61f265147e82E> + 80009cea: 22a13023 sd a0,544(sp) + 80009cee: a009 j 80009cf0 <.LBB3_118+0xc4> + 80009cf0: 22013503 ld a0,544(sp) + 80009cf4: 1502 slli a0,a0,0x20 + 80009cf6: 9101 srli a0,a0,0x20 + 80009cf8: 952a add a0,a0,a0 + 80009cfa: 20a13c23 sd a0,536(sp) + 80009cfe: 4501 li a0,0 + 80009d00: 64051063 bnez a0,8000a340 <.LBB3_129> + 80009d04: a009 j 80009d06 <.LBB3_118+0xda> + 80009d06: 21813503 ld a0,536(sp) + 80009d0a: 22813583 ld a1,552(sp) + 80009d0e: e588 sd a0,8(a1) + 80009d10: 0d08 addi a0,sp,656 + + guard.desc[idx[0]].addr = buf0 as *mut _ as u64; + 80009d12: 00008097 auipc ra,0x8 + 80009d16: 06c080e7 jalr 108(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009d1a: 20a13823 sd a0,528(sp) + 80009d1e: a009 j 80009d20 <.LBB3_118+0xf4> + 80009d20: 29813583 ld a1,664(sp) + 80009d24: 20b13423 sd a1,520(sp) + 80009d28: 451d li a0,7 + 80009d2a: 62b56a63 bltu a0,a1,8000a35e <.LBB3_130+0x16> + 80009d2e: a009 j 80009d30 <.LBB3_118+0x104> + 80009d30: 22813503 ld a0,552(sp) + 80009d34: 21013583 ld a1,528(sp) + 80009d38: 20813603 ld a2,520(sp) + 80009d3c: 0612 slli a2,a2,0x4 + 80009d3e: 95b2 add a1,a1,a2 + 80009d40: e188 sd a0,0(a1) + guard.desc[idx[0]].len = core::mem::size_of::().try_into().unwrap(); + 80009d42: a009 j 80009d44 <.LBB3_118+0x118> + 80009d44: 4541 li a0,16 + 80009d46: 00002097 auipc ra,0x2 + 80009d4a: 688080e7 jalr 1672(ra) # 8000c3ce <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h168ef583366b1bfdE> + 80009d4e: ffaa sd a0,504(sp) + 80009d50: 20b13023 sd a1,512(sp) + 80009d54: a009 j 80009d56 <.LBB3_118+0x12a> + 80009d56: 20013583 ld a1,512(sp) + 80009d5a: 757e ld a0,504(sp) + +0000000080009d5c <.LBB3_119>: + 80009d5c: 0001f617 auipc a2,0x1f + 80009d60: b8c60613 addi a2,a2,-1140 # 800288e8 <.L__unnamed_23> + 80009d64: 00004097 auipc ra,0x4 + 80009d68: 994080e7 jalr -1644(ra) # 8000d6f8 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h07a2a3bbe53a0b92E> + 80009d6c: fbaa sd a0,496(sp) + 80009d6e: a009 j 80009d70 <.LBB3_119+0x14> + 80009d70: 0d08 addi a0,sp,656 + 80009d72: 00008097 auipc ra,0x8 + 80009d76: 00c080e7 jalr 12(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009d7a: f7aa sd a0,488(sp) + 80009d7c: a009 j 80009d7e <.LBB3_119+0x22> + 80009d7e: 29813583 ld a1,664(sp) + 80009d82: f3ae sd a1,480(sp) + 80009d84: 451d li a0,7 + 80009d86: 5eb56863 bltu a0,a1,8000a376 <.LBB3_131+0x14> + 80009d8a: a009 j 80009d8c <.LBB3_119+0x30> + 80009d8c: 755e ld a0,496(sp) + 80009d8e: 75be ld a1,488(sp) + 80009d90: 761e ld a2,480(sp) + 80009d92: 0612 slli a2,a2,0x4 + 80009d94: 95b2 add a1,a1,a2 + 80009d96: c588 sw a0,8(a1) + 80009d98: 0d08 addi a0,sp,656 + guard.desc[idx[0]].flags = VRING_DESC_F_NEXT; + 80009d9a: 00008097 auipc ra,0x8 + 80009d9e: fe4080e7 jalr -28(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009da2: efaa sd a0,472(sp) + 80009da4: a009 j 80009da6 <.LBB3_119+0x4a> + 80009da6: 29813583 ld a1,664(sp) + 80009daa: ebae sd a1,464(sp) + 80009dac: 451d li a0,7 + 80009dae: 5cb56f63 bltu a0,a1,8000a38c <.LBB3_132+0x14> + 80009db2: a009 j 80009db4 <.LBB3_119+0x58> + 80009db4: 657e ld a0,472(sp) + 80009db6: 65de ld a1,464(sp) + 80009db8: 0592 slli a1,a1,0x4 + 80009dba: 95aa add a1,a1,a0 + 80009dbc: 4505 li a0,1 + 80009dbe: 00a59623 sh a0,12(a1) + guard.desc[idx[0]].next = idx[1].try_into().unwrap(); + 80009dc2: 2a013503 ld a0,672(sp) + 80009dc6: 00002097 auipc ra,0x2 + 80009dca: 626080e7 jalr 1574(ra) # 8000c3ec <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h79444d549eeb58faE> + 80009dce: e3aa sd a0,448(sp) + 80009dd0: e7ae sd a1,456(sp) + 80009dd2: a009 j 80009dd4 <.LBB3_119+0x78> + 80009dd4: 65be ld a1,456(sp) + 80009dd6: 651e ld a0,448(sp) + +0000000080009dd8 <.LBB3_120>: + 80009dd8: 0001f617 auipc a2,0x1f + 80009ddc: b5860613 addi a2,a2,-1192 # 80028930 <.L__unnamed_24> + 80009de0: 00004097 auipc ra,0x4 + 80009de4: 990080e7 jalr -1648(ra) # 8000d770 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h42e1173662da7b7dE> + 80009de8: ff2a sd a0,440(sp) + 80009dea: a009 j 80009dec <.LBB3_120+0x14> + 80009dec: 0d08 addi a0,sp,656 + 80009dee: 00008097 auipc ra,0x8 + 80009df2: f90080e7 jalr -112(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009df6: fb2a sd a0,432(sp) + 80009df8: a009 j 80009dfa <.LBB3_120+0x22> + 80009dfa: 29813583 ld a1,664(sp) + 80009dfe: f72e sd a1,424(sp) + 80009e00: 451d li a0,7 + 80009e02: 5ab56063 bltu a0,a1,8000a3a2 <.LBB3_133+0x14> + 80009e06: a009 j 80009e08 <.LBB3_120+0x30> + 80009e08: 757a ld a0,440(sp) + 80009e0a: 75da ld a1,432(sp) + 80009e0c: 763a ld a2,424(sp) + 80009e0e: 0612 slli a2,a2,0x4 + 80009e10: 95b2 add a1,a1,a2 + 80009e12: 00a59723 sh a0,14(a1) + 80009e16: 0d08 addi a0,sp,656 + + guard.desc[idx[1]].addr = buf_raw_data as u64; + 80009e18: 00008097 auipc ra,0x8 + 80009e1c: f66080e7 jalr -154(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009e20: f32a sd a0,416(sp) + 80009e22: a009 j 80009e24 <.LBB3_120+0x4c> + 80009e24: 2a013583 ld a1,672(sp) + 80009e28: ef2e sd a1,408(sp) + 80009e2a: 451d li a0,7 + 80009e2c: 58b56663 bltu a0,a1,8000a3b8 <.LBB3_134+0x14> + 80009e30: a009 j 80009e32 <.LBB3_120+0x5a> + 80009e32: 27013503 ld a0,624(sp) + 80009e36: 759a ld a1,416(sp) + 80009e38: 667a ld a2,408(sp) + 80009e3a: 0612 slli a2,a2,0x4 + 80009e3c: 95b2 add a1,a1,a2 + 80009e3e: e188 sd a0,0(a1) + 80009e40: 40000513 li a0,1024 + guard.desc[idx[1]].len = BSIZE.try_into().unwrap(); + 80009e44: 00002097 auipc ra,0x2 + 80009e48: 58a080e7 jalr 1418(ra) # 8000c3ce <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h168ef583366b1bfdE> + 80009e4c: e72a sd a0,392(sp) + 80009e4e: eb2e sd a1,400(sp) + 80009e50: a009 j 80009e52 <.LBB3_120+0x7a> + 80009e52: 65da ld a1,400(sp) + 80009e54: 653a ld a0,392(sp) + +0000000080009e56 <.LBB3_121>: + 80009e56: 0001f617 auipc a2,0x1f + 80009e5a: b2260613 addi a2,a2,-1246 # 80028978 <.L__unnamed_25> + 80009e5e: 00004097 auipc ra,0x4 + 80009e62: 89a080e7 jalr -1894(ra) # 8000d6f8 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h07a2a3bbe53a0b92E> + 80009e66: e32a sd a0,384(sp) + 80009e68: a009 j 80009e6a <.LBB3_121+0x14> + 80009e6a: 0d08 addi a0,sp,656 + 80009e6c: 00008097 auipc ra,0x8 + 80009e70: f12080e7 jalr -238(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009e74: feaa sd a0,376(sp) + 80009e76: a009 j 80009e78 <.LBB3_121+0x22> + 80009e78: 2a013583 ld a1,672(sp) + 80009e7c: faae sd a1,368(sp) + 80009e7e: 451d li a0,7 + 80009e80: 54b56763 bltu a0,a1,8000a3ce <.LBB3_135+0x14> + 80009e84: a009 j 80009e86 <.LBB3_121+0x30> + 80009e86: 28813503 ld a0,648(sp) + 80009e8a: 659a ld a1,384(sp) + 80009e8c: 7676 ld a2,376(sp) + 80009e8e: 76d6 ld a3,368(sp) + 80009e90: 0692 slli a3,a3,0x4 + 80009e92: 9636 add a2,a2,a3 + 80009e94: c60c sw a1,8(a2) + 80009e96: 4581 li a1,0 + guard.desc[idx[1]].flags = if writing { 0 } else { VRING_DESC_F_WRITE }; + 80009e98: 00b50763 beq a0,a1,80009ea6 <.LBB3_121+0x50> + 80009e9c: a009 j 80009e9e <.LBB3_121+0x48> + 80009e9e: 4501 li a0,0 + 80009ea0: 2aa11b23 sh a0,694(sp) + 80009ea4: a029 j 80009eae <.LBB3_121+0x58> + 80009ea6: 4509 li a0,2 + 80009ea8: 2aa11b23 sh a0,694(sp) + 80009eac: a009 j 80009eae <.LBB3_121+0x58> + 80009eae: 0d08 addi a0,sp,656 + 80009eb0: 00008097 auipc ra,0x8 + 80009eb4: ece080e7 jalr -306(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009eb8: f6aa sd a0,360(sp) + 80009eba: a009 j 80009ebc <.LBB3_121+0x66> + 80009ebc: 2a013583 ld a1,672(sp) + 80009ec0: f2ae sd a1,352(sp) + 80009ec2: 451d li a0,7 + 80009ec4: 52b56063 bltu a0,a1,8000a3e4 <.LBB3_136+0x14> + 80009ec8: a009 j 80009eca <.LBB3_121+0x74> + 80009eca: 7536 ld a0,360(sp) + 80009ecc: 7596 ld a1,352(sp) + 80009ece: 0592 slli a1,a1,0x4 + 80009ed0: 95aa add a1,a1,a0 + 80009ed2: 2b611503 lh a0,694(sp) + 80009ed6: 00a59623 sh a0,12(a1) + 80009eda: 0d08 addi a0,sp,656 + guard.desc[idx[1]].flags |= VRING_DESC_F_NEXT; + 80009edc: 00008097 auipc ra,0x8 + 80009ee0: ea2080e7 jalr -350(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009ee4: eeaa sd a0,344(sp) + 80009ee6: a009 j 80009ee8 <.LBB3_121+0x92> + 80009ee8: 2a013583 ld a1,672(sp) + 80009eec: eaae sd a1,336(sp) + 80009eee: 451d li a0,7 + 80009ef0: 50b56563 bltu a0,a1,8000a3fa <.LBB3_137+0x14> + 80009ef4: a009 j 80009ef6 <.LBB3_121+0xa0> + 80009ef6: 6576 ld a0,344(sp) + 80009ef8: 65d6 ld a1,336(sp) + 80009efa: 0592 slli a1,a1,0x4 + 80009efc: 95aa add a1,a1,a0 + 80009efe: 00c59503 lh a0,12(a1) + 80009f02: 00156513 ori a0,a0,1 + 80009f06: 00a59623 sh a0,12(a1) + guard.desc[idx[1]].next = idx[2].try_into().unwrap(); + 80009f0a: 2a813503 ld a0,680(sp) + 80009f0e: 00002097 auipc ra,0x2 + 80009f12: 4de080e7 jalr 1246(ra) # 8000c3ec <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h79444d549eeb58faE> + 80009f16: e2aa sd a0,320(sp) + 80009f18: e6ae sd a1,328(sp) + 80009f1a: a009 j 80009f1c <.LBB3_121+0xc6> + 80009f1c: 65b6 ld a1,328(sp) + 80009f1e: 6516 ld a0,320(sp) + +0000000080009f20 <.LBB3_122>: + 80009f20: 0001f617 auipc a2,0x1f + 80009f24: ab860613 addi a2,a2,-1352 # 800289d8 <.L__unnamed_26> + 80009f28: 00004097 auipc ra,0x4 + 80009f2c: 848080e7 jalr -1976(ra) # 8000d770 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h42e1173662da7b7dE> + 80009f30: fe2a sd a0,312(sp) + 80009f32: a009 j 80009f34 <.LBB3_122+0x14> + 80009f34: 0d08 addi a0,sp,656 + 80009f36: 00008097 auipc ra,0x8 + 80009f3a: e48080e7 jalr -440(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009f3e: fa2a sd a0,304(sp) + 80009f40: a009 j 80009f42 <.LBB3_122+0x22> + 80009f42: 2a013583 ld a1,672(sp) + 80009f46: f62e sd a1,296(sp) + 80009f48: 451d li a0,7 + 80009f4a: 4cb56363 bltu a0,a1,8000a410 <.LBB3_138+0x14> + 80009f4e: a009 j 80009f50 <.LBB3_122+0x30> + 80009f50: 7572 ld a0,312(sp) + 80009f52: 75d2 ld a1,304(sp) + 80009f54: 7632 ld a2,296(sp) + 80009f56: 0612 slli a2,a2,0x4 + 80009f58: 95b2 add a1,a1,a2 + 80009f5a: 00a59723 sh a0,14(a1) + 80009f5e: 0d08 addi a0,sp,656 + + guard.info[idx[0]].status = 0xff; + 80009f60: 00008097 auipc ra,0x8 + 80009f64: e1e080e7 jalr -482(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009f68: f22a sd a0,288(sp) + 80009f6a: a009 j 80009f6c <.LBB3_122+0x4c> + 80009f6c: 29813583 ld a1,664(sp) + 80009f70: ee2e sd a1,280(sp) + 80009f72: 451d li a0,7 + 80009f74: 4ab56963 bltu a0,a1,8000a426 <.LBB3_139+0x14> + 80009f78: a009 j 80009f7a <.LBB3_122+0x5a> + 80009f7a: 7512 ld a0,288(sp) + 80009f7c: 65f2 ld a1,280(sp) + 80009f7e: 4661 li a2,24 + 80009f80: 02c585b3 mul a1,a1,a2 + 80009f84: 952e add a0,a0,a1 + 80009f86: 6589 lui a1,0x2 + 80009f88: 0205859b addiw a1,a1,32 + 80009f8c: 95aa add a1,a1,a0 + 80009f8e: 0ff00513 li a0,255 + 80009f92: 00a58023 sb a0,0(a1) # 2000 <.Lline_table_start0+0x2a4> + 80009f96: 0d08 addi a0,sp,656 + guard.desc[idx[2]].addr = &mut guard.info[idx[0]].status as *mut _ as u64; + 80009f98: 00008097 auipc ra,0x8 + 80009f9c: de6080e7 jalr -538(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009fa0: ea2a sd a0,272(sp) + 80009fa2: a009 j 80009fa4 <.LBB3_122+0x84> + 80009fa4: 29813583 ld a1,664(sp) + 80009fa8: e62e sd a1,264(sp) + 80009faa: 451d li a0,7 + 80009fac: 48b56863 bltu a0,a1,8000a43c <.LBB3_140+0x14> + 80009fb0: a009 j 80009fb2 <.LBB3_122+0x92> + 80009fb2: 6552 ld a0,272(sp) + 80009fb4: 65b2 ld a1,264(sp) + 80009fb6: 4661 li a2,24 + 80009fb8: 02c585b3 mul a1,a1,a2 + 80009fbc: 952e add a0,a0,a1 + 80009fbe: 6589 lui a1,0x2 + 80009fc0: 0205859b addiw a1,a1,32 + 80009fc4: 952e add a0,a0,a1 + 80009fc6: fdaa sd a0,248(sp) + 80009fc8: 0d08 addi a0,sp,656 + 80009fca: 00008097 auipc ra,0x8 + 80009fce: db4080e7 jalr -588(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009fd2: e22a sd a0,256(sp) + 80009fd4: a009 j 80009fd6 <.LBB3_122+0xb6> + 80009fd6: 2a813583 ld a1,680(sp) + 80009fda: f9ae sd a1,240(sp) + 80009fdc: 451d li a0,7 + 80009fde: 46b56a63 bltu a0,a1,8000a452 <.LBB3_141+0x14> + 80009fe2: a009 j 80009fe4 <.LBB3_122+0xc4> + 80009fe4: 756e ld a0,248(sp) + 80009fe6: 6592 ld a1,256(sp) + 80009fe8: 764e ld a2,240(sp) + 80009fea: 0612 slli a2,a2,0x4 + 80009fec: 95b2 add a1,a1,a2 + 80009fee: e188 sd a0,0(a1) + 80009ff0: 0d08 addi a0,sp,656 + guard.desc[idx[2]].len = 1; + 80009ff2: 00008097 auipc ra,0x8 + 80009ff6: d8c080e7 jalr -628(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 80009ffa: f5aa sd a0,232(sp) + 80009ffc: a009 j 80009ffe <.LBB3_122+0xde> + 80009ffe: 2a813583 ld a1,680(sp) + 8000a002: f1ae sd a1,224(sp) + 8000a004: 451d li a0,7 + 8000a006: 46b56163 bltu a0,a1,8000a468 <.LBB3_142+0x14> + 8000a00a: a009 j 8000a00c <.LBB3_122+0xec> + 8000a00c: 752e ld a0,232(sp) + 8000a00e: 758e ld a1,224(sp) + 8000a010: 0592 slli a1,a1,0x4 + 8000a012: 95aa add a1,a1,a0 + 8000a014: 4505 li a0,1 + 8000a016: c588 sw a0,8(a1) + 8000a018: 0d08 addi a0,sp,656 + guard.desc[idx[2]].flags = VRING_DESC_F_WRITE; + 8000a01a: 00008097 auipc ra,0x8 + 8000a01e: d64080e7 jalr -668(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a022: edaa sd a0,216(sp) + 8000a024: a009 j 8000a026 <.LBB3_122+0x106> + 8000a026: 2a813583 ld a1,680(sp) + 8000a02a: e9ae sd a1,208(sp) + 8000a02c: 451d li a0,7 + 8000a02e: 44b56863 bltu a0,a1,8000a47e <.LBB3_143+0x14> + 8000a032: a009 j 8000a034 <.LBB3_122+0x114> + 8000a034: 656e ld a0,216(sp) + 8000a036: 65ce ld a1,208(sp) + 8000a038: 0592 slli a1,a1,0x4 + 8000a03a: 95aa add a1,a1,a0 + 8000a03c: 4509 li a0,2 + 8000a03e: 00a59623 sh a0,12(a1) # 200c <.Lline_table_start0+0x2b0> + 8000a042: 0d08 addi a0,sp,656 + guard.desc[idx[2]].next = 0; + 8000a044: 00008097 auipc ra,0x8 + 8000a048: d3a080e7 jalr -710(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a04c: e5aa sd a0,200(sp) + 8000a04e: a009 j 8000a050 <.LBB3_122+0x130> + 8000a050: 2a813583 ld a1,680(sp) + 8000a054: e1ae sd a1,192(sp) + 8000a056: 451d li a0,7 + 8000a058: 42b56e63 bltu a0,a1,8000a494 <.LBB3_144+0x14> + 8000a05c: a009 j 8000a05e <.LBB3_122+0x13e> + 8000a05e: 652e ld a0,200(sp) + 8000a060: 658e ld a1,192(sp) + 8000a062: 0592 slli a1,a1,0x4 + 8000a064: 95aa add a1,a1,a0 + 8000a066: 4501 li a0,0 + 8000a068: 00a59723 sh a0,14(a1) + 8000a06c: 0d08 addi a0,sp,656 + + // record the buf + // retrieve it back when the disk finishes with the raw buf data + guard.info[idx[0]].disk = true; + 8000a06e: 00008097 auipc ra,0x8 + 8000a072: d10080e7 jalr -752(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a076: fd2a sd a0,184(sp) + 8000a078: a009 j 8000a07a <.LBB3_122+0x15a> + 8000a07a: 29813583 ld a1,664(sp) + 8000a07e: f92e sd a1,176(sp) + 8000a080: 451d li a0,7 + 8000a082: 42b56463 bltu a0,a1,8000a4aa <.LBB3_145+0x14> + 8000a086: a009 j 8000a088 <.LBB3_122+0x168> + 8000a088: 27013583 ld a1,624(sp) + 8000a08c: 756a ld a0,184(sp) + 8000a08e: 764a ld a2,176(sp) + 8000a090: 46e1 li a3,24 + 8000a092: 02d60633 mul a2,a2,a3 + 8000a096: 9532 add a0,a0,a2 + 8000a098: 6609 lui a2,0x2 + 8000a09a: 0216061b addiw a2,a2,33 + 8000a09e: 962a add a2,a2,a0 + 8000a0a0: 4505 li a0,1 + 8000a0a2: 00a60023 sb a0,0(a2) # 2000 <.Lline_table_start0+0x2a4> + guard.info[idx[0]].buf_channel = Some(buf_raw_data as usize); + 8000a0a6: 2cb13023 sd a1,704(sp) + 8000a0aa: 2aa13c23 sd a0,696(sp) + 8000a0ae: 0d08 addi a0,sp,656 + 8000a0b0: 00008097 auipc ra,0x8 + 8000a0b4: cce080e7 jalr -818(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a0b8: f52a sd a0,168(sp) + 8000a0ba: a009 j 8000a0bc <.LBB3_122+0x19c> + 8000a0bc: 29813583 ld a1,664(sp) + 8000a0c0: f12e sd a1,160(sp) + 8000a0c2: 451d li a0,7 + 8000a0c4: 3eb56e63 bltu a0,a1,8000a4c0 <.LBB3_146+0x14> + 8000a0c8: a009 j 8000a0ca <.LBB3_122+0x1aa> + 8000a0ca: 752a ld a0,168(sp) + 8000a0cc: 758a ld a1,160(sp) + 8000a0ce: 4661 li a2,24 + 8000a0d0: 02c585b3 mul a1,a1,a2 + 8000a0d4: 952e add a0,a0,a1 + 8000a0d6: 6589 lui a1,0x2 + 8000a0d8: 25c1 addiw a1,a1,16 + 8000a0da: 95aa add a1,a1,a0 + 8000a0dc: 2b813603 ld a2,696(sp) + 8000a0e0: 2c013503 ld a0,704(sp) + 8000a0e4: e190 sd a2,0(a1) + 8000a0e6: e588 sd a0,8(a1) + 8000a0e8: 0d08 addi a0,sp,656 + + { + let i = guard.avail.idx as usize % NUM; + 8000a0ea: 00008097 auipc ra,0x8 + 8000a0ee: bf6080e7 jalr -1034(ra) # 80011ce0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7eb0b551b3d2dabcE> + 8000a0f2: ed2a sd a0,152(sp) + 8000a0f4: a009 j 8000a0f6 <.LBB3_122+0x1d6> + 8000a0f6: 656a ld a0,152(sp) + 8000a0f8: 08255503 lhu a0,130(a0) + 8000a0fc: 891d andi a0,a0,7 + 8000a0fe: e12a sd a0,128(sp) + 8000a100: 34a13823 sd a0,848(sp) + guard.avail.ring[i] = idx[0].try_into().unwrap(); + 8000a104: 29813503 ld a0,664(sp) + 8000a108: 00002097 auipc ra,0x2 + 8000a10c: 2e4080e7 jalr 740(ra) # 8000c3ec <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h79444d549eeb58faE> + 8000a110: e52a sd a0,136(sp) + 8000a112: e92e sd a1,144(sp) + 8000a114: a009 j 8000a116 <.LBB3_122+0x1f6> + 8000a116: 65ca ld a1,144(sp) + 8000a118: 652a ld a0,136(sp) + +000000008000a11a <.LBB3_123>: + 8000a11a: 0001f617 auipc a2,0x1f + 8000a11e: 9ae60613 addi a2,a2,-1618 # 80028ac8 <.L__unnamed_27> + 8000a122: 00003097 auipc ra,0x3 + 8000a126: 64e080e7 jalr 1614(ra) # 8000d770 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h42e1173662da7b7dE> + 8000a12a: fcaa sd a0,120(sp) + 8000a12c: a009 j 8000a12e <.LBB3_123+0x14> + 8000a12e: 0d08 addi a0,sp,656 + 8000a130: 00008097 auipc ra,0x8 + 8000a134: c4e080e7 jalr -946(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a138: f8aa sd a0,112(sp) + 8000a13a: a009 j 8000a13c <.LBB3_123+0x22> + 8000a13c: 658a ld a1,128(sp) + 8000a13e: 451d li a0,7 + 8000a140: 38b56b63 bltu a0,a1,8000a4d6 <.LBB3_147+0x14> + 8000a144: a009 j 8000a146 <.LBB3_123+0x2c> + 8000a146: 7566 ld a0,120(sp) + 8000a148: 75c6 ld a1,112(sp) + 8000a14a: 660a ld a2,128(sp) + 8000a14c: 0606 slli a2,a2,0x1 + 8000a14e: 95b2 add a1,a1,a2 + 8000a150: 08a59223 sh a0,132(a1) # 2084 <.Lline_table_start0+0x328> + 8000a154: 4511 li a0,4 + } + + fence(Ordering::SeqCst); + 8000a156: 2ca10723 sb a0,718(sp) + 8000a15a: ffffa097 auipc ra,0xffffa + 8000a15e: 6ee080e7 jalr 1774(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 8000a162: a009 j 8000a164 <.LBB3_123+0x4a> + 8000a164: 0d08 addi a0,sp,656 + + guard.avail.idx += 1; + 8000a166: 00008097 auipc ra,0x8 + 8000a16a: c18080e7 jalr -1000(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a16e: f4aa sd a0,104(sp) + 8000a170: a009 j 8000a172 <.LBB3_123+0x58> + 8000a172: 7526 ld a0,104(sp) + 8000a174: 08255503 lhu a0,130(a0) + 8000a178: 00150593 addi a1,a0,1 + 8000a17c: f0ae sd a1,96(sp) + 8000a17e: 6541 lui a0,0x10 + 8000a180: 357d addiw a0,a0,-1 + 8000a182: 8d6d and a0,a0,a1 + 8000a184: 36b51463 bne a0,a1,8000a4ec <.LBB3_149> + 8000a188: a009 j 8000a18a <.LBB3_123+0x70> + 8000a18a: 7506 ld a0,96(sp) + 8000a18c: 75a6 ld a1,104(sp) + 8000a18e: 08a59123 sh a0,130(a1) + 8000a192: 4511 li a0,4 + + fence(Ordering::SeqCst); + 8000a194: 2ca107a3 sb a0,719(sp) + 8000a198: ffffa097 auipc ra,0xffffa + 8000a19c: 6b0080e7 jalr 1712(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 8000a1a0: a009 j 8000a1a2 <.LBB3_123+0x88> + 8000a1a2: 05000513 li a0,80 + 8000a1a6: 4581 li a1,0 + + unsafe { write(VIRTIO_MMIO_QUEUE_NOTIFY, 0); } + 8000a1a8: 00016097 auipc ra,0x16 + 8000a1ac: 256080e7 jalr 598(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8000a1b0: a009 j 8000a1b2 <.LBB3_123+0x98> + + // wait for the disk to handle the buf data + while guard.info[idx[0]].disk { + 8000a1b2: a009 j 8000a1b4 <.LBB3_123+0x9a> + 8000a1b4: 0d08 addi a0,sp,656 + 8000a1b6: 00008097 auipc ra,0x8 + 8000a1ba: b2a080e7 jalr -1238(ra) # 80011ce0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7eb0b551b3d2dabcE> + 8000a1be: ecaa sd a0,88(sp) + 8000a1c0: a009 j 8000a1c2 <.LBB3_123+0xa8> + 8000a1c2: 29813583 ld a1,664(sp) + 8000a1c6: e8ae sd a1,80(sp) + 8000a1c8: 451d li a0,7 + 8000a1ca: 32b56f63 bltu a0,a1,8000a508 <.LBB3_150+0x14> + 8000a1ce: a009 j 8000a1d0 <.LBB3_123+0xb6> + 8000a1d0: 6566 ld a0,88(sp) + 8000a1d2: 65c6 ld a1,80(sp) + 8000a1d4: 4661 li a2,24 + 8000a1d6: 02c585b3 mul a1,a1,a2 + 8000a1da: 952e add a0,a0,a1 + 8000a1dc: 6589 lui a1,0x2 + 8000a1de: 0215859b addiw a1,a1,33 + 8000a1e2: 952e add a0,a0,a1 + 8000a1e4: 00054503 lbu a0,0(a0) # 10000 <.Lline_table_start0+0x19d> + 8000a1e8: 8905 andi a0,a0,1 + 8000a1ea: e909 bnez a0,8000a1fc <.LBB3_124> + 8000a1ec: a009 j 8000a1ee <.LBB3_123+0xd4> + 8000a1ee: 0d08 addi a0,sp,656 + // choose the raw buf data as channel + unsafe { CPU_MANAGER.myproc().unwrap().sleep(buf_raw_data as usize, guard); } + guard = self.acquire(); + } + + let buf_channel = guard.info[idx[0]].buf_channel.take(); + 8000a1f0: 00008097 auipc ra,0x8 + 8000a1f4: b8e080e7 jalr -1138(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a1f8: e4aa sd a0,72(sp) + 8000a1fa: a8a1 j 8000a252 <.LBB3_125+0x40> + +000000008000a1fc <.LBB3_124>: + unsafe { CPU_MANAGER.myproc().unwrap().sleep(buf_raw_data as usize, guard); } + 8000a1fc: 0005c517 auipc a0,0x5c + 8000a200: f4450513 addi a0,a0,-188 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000a204: 00008097 auipc ra,0x8 + 8000a208: 254080e7 jalr 596(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000a20c: e0aa sd a0,64(sp) + 8000a20e: a009 j 8000a210 <.LBB3_124+0x14> + 8000a210: 6506 ld a0,64(sp) + +000000008000a212 <.LBB3_125>: + 8000a212: 0001f597 auipc a1,0x1f + 8000a216: 91658593 addi a1,a1,-1770 # 80028b28 <.L__unnamed_28> + 8000a21a: 00005097 auipc ra,0x5 + 8000a21e: 576080e7 jalr 1398(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8000a222: fc2a sd a0,56(sp) + 8000a224: a009 j 8000a226 <.LBB3_125+0x14> + 8000a226: 27013583 ld a1,624(sp) + 8000a22a: 7562 ld a0,56(sp) + 8000a22c: 29013603 ld a2,656(sp) + 8000a230: 00008097 auipc ra,0x8 + 8000a234: 134080e7 jalr 308(ra) # 80012364 <_ZN6kernel7process7process11task_struct5sleep17heedb33ddc1916294E> + 8000a238: a009 j 8000a23a <.LBB3_125+0x28> + guard = self.acquire(); + 8000a23a: 28013503 ld a0,640(sp) + 8000a23e: 00007097 auipc ra,0x7 + 8000a242: d24080e7 jalr -732(ra) # 80010f62 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E> + 8000a246: f82a sd a0,48(sp) + 8000a248: a009 j 8000a24a <.LBB3_125+0x38> + 8000a24a: 7542 ld a0,48(sp) + 8000a24c: 28a13823 sd a0,656(sp) + while guard.info[idx[0]].disk { + 8000a250: b795 j 8000a1b4 <.LBB3_123+0x9a> + let buf_channel = guard.info[idx[0]].buf_channel.take(); + 8000a252: 29813583 ld a1,664(sp) + 8000a256: f42e sd a1,40(sp) + 8000a258: 451d li a0,7 + 8000a25a: 2cb56263 bltu a0,a1,8000a51e <.LBB3_151+0x14> + 8000a25e: a009 j 8000a260 <.LBB3_125+0x4e> + 8000a260: 6526 ld a0,72(sp) + 8000a262: 75a2 ld a1,40(sp) + 8000a264: 4661 li a2,24 + 8000a266: 02c585b3 mul a1,a1,a2 + 8000a26a: 952e add a0,a0,a1 + 8000a26c: 6589 lui a1,0x2 + 8000a26e: 25c1 addiw a1,a1,16 + 8000a270: 952e add a0,a0,a1 + 8000a272: 00005097 auipc ra,0x5 + 8000a276: d5c080e7 jalr -676(ra) # 8000efce <_ZN4core6option15Option$LT$T$GT$4take17h3f0477f04f3bf4c3E> + 8000a27a: 862a mv a2,a0 + 8000a27c: ec32 sd a2,24(sp) + 8000a27e: 862e mv a2,a1 + 8000a280: f032 sd a2,32(sp) + 8000a282: 34a13c23 sd a0,856(sp) + 8000a286: 36b13023 sd a1,864(sp) + 8000a28a: a009 j 8000a28c <.LBB3_125+0x7a> + debug_assert_eq!(buf_channel.unwrap(), buf_raw_data as usize); + 8000a28c: 7582 ld a1,32(sp) + 8000a28e: 6562 ld a0,24(sp) + +000000008000a290 <.LBB3_126>: + 8000a290: 0001f617 auipc a2,0x1f + 8000a294: 8c860613 addi a2,a2,-1848 # 80028b58 <.L__unnamed_29> + 8000a298: 00005097 auipc ra,0x5 + 8000a29c: 52e080e7 jalr 1326(ra) # 8000f7c6 <_ZN4core6option15Option$LT$T$GT$6unwrap17he97e68f5d459b5f2E> + 8000a2a0: 2ea13023 sd a0,736(sp) + 8000a2a4: a009 j 8000a2a6 <.LBB3_126+0x16> + 8000a2a6: 27013583 ld a1,624(sp) + 8000a2aa: 2eb13423 sd a1,744(sp) + 8000a2ae: 1590 addi a2,sp,736 + 8000a2b0: e432 sd a2,8(sp) + 8000a2b2: 2cc13823 sd a2,720(sp) + 8000a2b6: 15a8 addi a0,sp,744 + 8000a2b8: e82a sd a0,16(sp) + 8000a2ba: 2ca13c23 sd a0,728(sp) + 8000a2be: 36c13423 sd a2,872(sp) + 8000a2c2: 36a13823 sd a0,880(sp) + 8000a2c6: 2e013503 ld a0,736(sp) + 8000a2ca: 02b50463 beq a0,a1,8000a2f2 <.LBB3_127+0x14> + 8000a2ce: a009 j 8000a2d0 <.LBB3_126+0x40> + 8000a2d0: 6642 ld a2,16(sp) + 8000a2d2: 65a2 ld a1,8(sp) + 8000a2d4: 4501 li a0,0 + 8000a2d6: 2ea10ba3 sb a0,759(sp) + 8000a2da: 2ea13c23 sd a0,760(sp) + +000000008000a2de <.LBB3_127>: + 8000a2de: 0001f717 auipc a4,0x1f + 8000a2e2: 89270713 addi a4,a4,-1902 # 80028b70 <.L__unnamed_30> + 8000a2e6: 1db4 addi a3,sp,760 + 8000a2e8: 00016097 auipc ra,0x16 + 8000a2ec: 58a080e7 jalr 1418(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 8000a2f0: 0000 unimp + 8000a2f2: 0d08 addi a0,sp,656 + guard.free_chain(idx[0]); + 8000a2f4: 00008097 auipc ra,0x8 + 8000a2f8: a8a080e7 jalr -1398(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000a2fc: e02a sd a0,0(sp) + 8000a2fe: a009 j 8000a300 <.LBB3_127+0x22> + 8000a300: 6502 ld a0,0(sp) + 8000a302: 29813583 ld a1,664(sp) + 8000a306: 00016097 auipc ra,0x16 + 8000a30a: df4080e7 jalr -524(ra) # 800200fa <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E> + 8000a30e: a009 j 8000a310 <.LBB3_127+0x32> + + drop(guard); + 8000a310: 29013503 ld a0,656(sp) + 8000a314: 00014097 auipc ra,0x14 + 8000a318: c28080e7 jalr -984(ra) # 8001df3c <_ZN4core3mem4drop17hf5d8d4b62719f1bfE> + 8000a31c: a009 j 8000a31e <.LBB3_127+0x40> + } + 8000a31e: 37813083 ld ra,888(sp) + 8000a322: 38010113 addi sp,sp,896 + 8000a326: 8082 ret + let buf0 = &mut guard.ops[idx[0]]; + 8000a328: 23013503 ld a0,560(sp) + +000000008000a32c <.LBB3_128>: + 8000a32c: 0001e617 auipc a2,0x1e + 8000a330: 57460613 addi a2,a2,1396 # 800288a0 <.L__unnamed_31> + 8000a334: 45a1 li a1,8 + 8000a336: 00019097 auipc ra,0x19 + 8000a33a: e3a080e7 jalr -454(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000a340 <.LBB3_129>: + buf0.sector = (buf.read_blockno() as usize * (BSIZE / 512)) as u64; + 8000a340: 0001e517 auipc a0,0x1e + 8000a344: 2d050513 addi a0,a0,720 # 80028610 + +000000008000a348 <.LBB3_130>: + 8000a348: 0001e617 auipc a2,0x1e + 8000a34c: 57060613 addi a2,a2,1392 # 800288b8 <.L__unnamed_32> + 8000a350: 02100593 li a1,33 + 8000a354: 00019097 auipc ra,0x19 + 8000a358: df0080e7 jalr -528(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000a35c: 0000 unimp + guard.desc[idx[0]].addr = buf0 as *mut _ as u64; + 8000a35e: 20813503 ld a0,520(sp) + +000000008000a362 <.LBB3_131>: + 8000a362: 0001e617 auipc a2,0x1e + 8000a366: 56e60613 addi a2,a2,1390 # 800288d0 <.L__unnamed_33> + 8000a36a: 45a1 li a1,8 + 8000a36c: 00019097 auipc ra,0x19 + 8000a370: e04080e7 jalr -508(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a374: 0000 unimp + guard.desc[idx[0]].len = core::mem::size_of::().try_into().unwrap(); + 8000a376: 751e ld a0,480(sp) + +000000008000a378 <.LBB3_132>: + 8000a378: 0001e617 auipc a2,0x1e + 8000a37c: 58860613 addi a2,a2,1416 # 80028900 <.L__unnamed_34> + 8000a380: 45a1 li a1,8 + 8000a382: 00019097 auipc ra,0x19 + 8000a386: dee080e7 jalr -530(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a38a: 0000 unimp + guard.desc[idx[0]].flags = VRING_DESC_F_NEXT; + 8000a38c: 655e ld a0,464(sp) + +000000008000a38e <.LBB3_133>: + 8000a38e: 0001e617 auipc a2,0x1e + 8000a392: 58a60613 addi a2,a2,1418 # 80028918 <.L__unnamed_35> + 8000a396: 45a1 li a1,8 + 8000a398: 00019097 auipc ra,0x19 + 8000a39c: dd8080e7 jalr -552(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a3a0: 0000 unimp + guard.desc[idx[0]].next = idx[1].try_into().unwrap(); + 8000a3a2: 753a ld a0,424(sp) + +000000008000a3a4 <.LBB3_134>: + 8000a3a4: 0001e617 auipc a2,0x1e + 8000a3a8: 5a460613 addi a2,a2,1444 # 80028948 <.L__unnamed_36> + 8000a3ac: 45a1 li a1,8 + 8000a3ae: 00019097 auipc ra,0x19 + 8000a3b2: dc2080e7 jalr -574(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a3b6: 0000 unimp + guard.desc[idx[1]].addr = buf_raw_data as u64; + 8000a3b8: 657a ld a0,408(sp) + +000000008000a3ba <.LBB3_135>: + 8000a3ba: 0001e617 auipc a2,0x1e + 8000a3be: 5a660613 addi a2,a2,1446 # 80028960 <.L__unnamed_37> + 8000a3c2: 45a1 li a1,8 + 8000a3c4: 00019097 auipc ra,0x19 + 8000a3c8: dac080e7 jalr -596(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a3cc: 0000 unimp + guard.desc[idx[1]].len = BSIZE.try_into().unwrap(); + 8000a3ce: 7556 ld a0,368(sp) + +000000008000a3d0 <.LBB3_136>: + 8000a3d0: 0001e617 auipc a2,0x1e + 8000a3d4: 5c060613 addi a2,a2,1472 # 80028990 <.L__unnamed_38> + 8000a3d8: 45a1 li a1,8 + 8000a3da: 00019097 auipc ra,0x19 + 8000a3de: d96080e7 jalr -618(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a3e2: 0000 unimp + guard.desc[idx[1]].flags = if writing { 0 } else { VRING_DESC_F_WRITE }; + 8000a3e4: 7516 ld a0,352(sp) + +000000008000a3e6 <.LBB3_137>: + 8000a3e6: 0001e617 auipc a2,0x1e + 8000a3ea: 5c260613 addi a2,a2,1474 # 800289a8 <.L__unnamed_39> + 8000a3ee: 45a1 li a1,8 + 8000a3f0: 00019097 auipc ra,0x19 + 8000a3f4: d80080e7 jalr -640(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a3f8: 0000 unimp + guard.desc[idx[1]].flags |= VRING_DESC_F_NEXT; + 8000a3fa: 6556 ld a0,336(sp) + +000000008000a3fc <.LBB3_138>: + 8000a3fc: 0001e617 auipc a2,0x1e + 8000a400: 5c460613 addi a2,a2,1476 # 800289c0 <.L__unnamed_40> + 8000a404: 45a1 li a1,8 + 8000a406: 00019097 auipc ra,0x19 + 8000a40a: d6a080e7 jalr -662(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a40e: 0000 unimp + guard.desc[idx[1]].next = idx[2].try_into().unwrap(); + 8000a410: 7532 ld a0,296(sp) + +000000008000a412 <.LBB3_139>: + 8000a412: 0001e617 auipc a2,0x1e + 8000a416: 5de60613 addi a2,a2,1502 # 800289f0 <.L__unnamed_41> + 8000a41a: 45a1 li a1,8 + 8000a41c: 00019097 auipc ra,0x19 + 8000a420: d54080e7 jalr -684(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a424: 0000 unimp + guard.info[idx[0]].status = 0xff; + 8000a426: 6572 ld a0,280(sp) + +000000008000a428 <.LBB3_140>: + 8000a428: 0001e617 auipc a2,0x1e + 8000a42c: 5e060613 addi a2,a2,1504 # 80028a08 <.L__unnamed_42> + 8000a430: 45a1 li a1,8 + 8000a432: 00019097 auipc ra,0x19 + 8000a436: d3e080e7 jalr -706(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a43a: 0000 unimp + guard.desc[idx[2]].addr = &mut guard.info[idx[0]].status as *mut _ as u64; + 8000a43c: 6532 ld a0,264(sp) + +000000008000a43e <.LBB3_141>: + 8000a43e: 0001e617 auipc a2,0x1e + 8000a442: 5e260613 addi a2,a2,1506 # 80028a20 <.L__unnamed_43> + 8000a446: 45a1 li a1,8 + 8000a448: 00019097 auipc ra,0x19 + 8000a44c: d28080e7 jalr -728(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a450: 0000 unimp + 8000a452: 754e ld a0,240(sp) + +000000008000a454 <.LBB3_142>: + 8000a454: 0001e617 auipc a2,0x1e + 8000a458: 5e460613 addi a2,a2,1508 # 80028a38 <.L__unnamed_44> + 8000a45c: 45a1 li a1,8 + 8000a45e: 00019097 auipc ra,0x19 + 8000a462: d12080e7 jalr -750(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a466: 0000 unimp + guard.desc[idx[2]].len = 1; + 8000a468: 750e ld a0,224(sp) + +000000008000a46a <.LBB3_143>: + 8000a46a: 0001e617 auipc a2,0x1e + 8000a46e: 5e660613 addi a2,a2,1510 # 80028a50 <.L__unnamed_45> + 8000a472: 45a1 li a1,8 + 8000a474: 00019097 auipc ra,0x19 + 8000a478: cfc080e7 jalr -772(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a47c: 0000 unimp + guard.desc[idx[2]].flags = VRING_DESC_F_WRITE; + 8000a47e: 654e ld a0,208(sp) + +000000008000a480 <.LBB3_144>: + 8000a480: 0001e617 auipc a2,0x1e + 8000a484: 5e860613 addi a2,a2,1512 # 80028a68 <.L__unnamed_46> + 8000a488: 45a1 li a1,8 + 8000a48a: 00019097 auipc ra,0x19 + 8000a48e: ce6080e7 jalr -794(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a492: 0000 unimp + guard.desc[idx[2]].next = 0; + 8000a494: 650e ld a0,192(sp) + +000000008000a496 <.LBB3_145>: + 8000a496: 0001e617 auipc a2,0x1e + 8000a49a: 5ea60613 addi a2,a2,1514 # 80028a80 <.L__unnamed_47> + 8000a49e: 45a1 li a1,8 + 8000a4a0: 00019097 auipc ra,0x19 + 8000a4a4: cd0080e7 jalr -816(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a4a8: 0000 unimp + guard.info[idx[0]].disk = true; + 8000a4aa: 754a ld a0,176(sp) + +000000008000a4ac <.LBB3_146>: + 8000a4ac: 0001e617 auipc a2,0x1e + 8000a4b0: 5ec60613 addi a2,a2,1516 # 80028a98 <.L__unnamed_48> + 8000a4b4: 45a1 li a1,8 + 8000a4b6: 00019097 auipc ra,0x19 + 8000a4ba: cba080e7 jalr -838(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a4be: 0000 unimp + guard.info[idx[0]].buf_channel = Some(buf_raw_data as usize); + 8000a4c0: 750a ld a0,160(sp) + +000000008000a4c2 <.LBB3_147>: + 8000a4c2: 0001e617 auipc a2,0x1e + 8000a4c6: 5ee60613 addi a2,a2,1518 # 80028ab0 <.L__unnamed_49> + 8000a4ca: 45a1 li a1,8 + 8000a4cc: 00019097 auipc ra,0x19 + 8000a4d0: ca4080e7 jalr -860(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a4d4: 0000 unimp + guard.avail.ring[i] = idx[0].try_into().unwrap(); + 8000a4d6: 650a ld a0,128(sp) + +000000008000a4d8 <.LBB3_148>: + 8000a4d8: 0001e617 auipc a2,0x1e + 8000a4dc: 60860613 addi a2,a2,1544 # 80028ae0 <.L__unnamed_50> + 8000a4e0: 45a1 li a1,8 + 8000a4e2: 00019097 auipc ra,0x19 + 8000a4e6: c8e080e7 jalr -882(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000a4ec <.LBB3_149>: + guard.avail.idx += 1; + 8000a4ec: 0001e517 auipc a0,0x1e + 8000a4f0: 0e450513 addi a0,a0,228 # 800285d0 + +000000008000a4f4 <.LBB3_150>: + 8000a4f4: 0001e617 auipc a2,0x1e + 8000a4f8: 60460613 addi a2,a2,1540 # 80028af8 <.L__unnamed_51> + 8000a4fc: 45f1 li a1,28 + 8000a4fe: 00019097 auipc ra,0x19 + 8000a502: c46080e7 jalr -954(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000a506: 0000 unimp + while guard.info[idx[0]].disk { + 8000a508: 6546 ld a0,80(sp) + +000000008000a50a <.LBB3_151>: + 8000a50a: 0001e617 auipc a2,0x1e + 8000a50e: 60660613 addi a2,a2,1542 # 80028b10 <.L__unnamed_52> + 8000a512: 45a1 li a1,8 + 8000a514: 00019097 auipc ra,0x19 + 8000a518: c5c080e7 jalr -932(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000a51c: 0000 unimp + let buf_channel = guard.info[idx[0]].buf_channel.take(); + 8000a51e: 7522 ld a0,40(sp) + +000000008000a520 <.LBB3_152>: + 8000a520: 0001e617 auipc a2,0x1e + 8000a524: 62060613 addi a2,a2,1568 # 80028b40 <.L__unnamed_53> + 8000a528: 45a1 li a1,8 + 8000a52a: 00019097 auipc ra,0x19 + 8000a52e: c46080e7 jalr -954(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E: + +000000008000a534 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E>: + +impl Spinlock { + /// Handle a uart interrupt, raised because input has + /// arrived, or the uart is ready for more output, or + /// both, called from trap.rs + pub fn intr(&self) { + 8000a534: 7139 addi sp,sp,-64 + 8000a536: fc06 sd ra,56(sp) + 8000a538: ec2a sd a0,24(sp) + 8000a53a: f42a sd a0,40(sp) + 8000a53c: a009 j 8000a53e <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0xa> + 8000a53e: 10000537 lui a0,0x10000 + 8000a542: 2515 addiw a0,a0,5 + loop { + // read and process incoming characters. + let c: u8; + if read_reg(UART_BASE_ADDR + LSR) & 1 > 0 { + 8000a544: 00012097 auipc ra,0x12 + 8000a548: f1a080e7 jalr -230(ra) # 8001c45e <_ZN6kernel6driver4uart8read_reg17h6cf7d47ea5c47590E> + 8000a54c: e82a sd a0,16(sp) + 8000a54e: a009 j 8000a550 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x1c> + 8000a550: 6542 ld a0,16(sp) + 8000a552: 8905 andi a0,a0,1 + 8000a554: 4581 li a1,0 + 8000a556: 00b50b63 beq a0,a1,8000a56c <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x38> + 8000a55a: a009 j 8000a55c <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x28> + 8000a55c: 10000537 lui a0,0x10000 + c = read_reg(UART_BASE_ADDR + RHR) + 8000a560: 00012097 auipc ra,0x12 + 8000a564: efe080e7 jalr -258(ra) # 8001c45e <_ZN6kernel6driver4uart8read_reg17h6cf7d47ea5c47590E> + 8000a568: e42a sd a0,8(sp) + 8000a56a: a801 j 8000a57a <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x46> + break; + } + console_intr(c); + } + // transmit + self.acquire().transmit(); + 8000a56c: 6562 ld a0,24(sp) + 8000a56e: 00006097 auipc ra,0x6 + 8000a572: 4b4080e7 jalr 1204(ra) # 80010a22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E> + 8000a576: f02a sd a0,32(sp) + 8000a578: a811 j 8000a58c <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x58> + c = read_reg(UART_BASE_ADDR + RHR) + 8000a57a: 6522 ld a0,8(sp) + 8000a57c: 02a10ba3 sb a0,55(sp) + console_intr(c); + 8000a580: ffffa097 auipc ra,0xffffa + 8000a584: d6a080e7 jalr -662(ra) # 800042ea <_ZN6kernel6driver7console12console_intr17hcdedd3169cb49f5fE> + 8000a588: a009 j 8000a58a <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x56> + loop { + 8000a58a: bf55 j 8000a53e <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0xa> + 8000a58c: 1008 addi a0,sp,32 + self.acquire().transmit(); + 8000a58e: 00008097 auipc ra,0x8 + 8000a592: 8ce080e7 jalr -1842(ra) # 80011e5c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE> + 8000a596: e02a sd a0,0(sp) + 8000a598: a009 j 8000a59a <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x66> + 8000a59a: 6502 ld a0,0(sp) + 8000a59c: 00012097 auipc ra,0x12 + 8000a5a0: d4c080e7 jalr -692(ra) # 8001c2e8 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E> + 8000a5a4: a009 j 8000a5a6 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x72> + 8000a5a6: 1008 addi a0,sp,32 + 8000a5a8: ffffd097 auipc ra,0xffffd + 8000a5ac: c58080e7 jalr -936(ra) # 80007200 <_ZN4core3ptr92drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..uart..Uart$GT$$GT$17h4785ee23048b5bddE> + 8000a5b0: a009 j 8000a5b2 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4intr17h862db3ca167d2b66E+0x7e> + } + 8000a5b2: 70e2 ld ra,56(sp) + 8000a5b4: 6121 addi sp,sp,64 + 8000a5b6: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4putc17h6cd19d349a1fe87bE: + +000000008000a5b8 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4putc17h6cd19d349a1fe87bE>: + + + /// Put a u8 to the uart buffer(in the kernel). + /// It might sleep if the buffer is full. + pub fn putc(&self, c: u8) { + 8000a5b8: 7155 addi sp,sp,-208 + 8000a5ba: e586 sd ra,200(sp) + 8000a5bc: f8aa sd a0,112(sp) + 8000a5be: 862e mv a2,a1 + 8000a5c0: fcb2 sd a2,120(sp) + 8000a5c2: f52a sd a0,168(sp) + 8000a5c4: 0ab10ba3 sb a1,183(sp) + let mut uart = self.acquire(); + 8000a5c8: 00006097 auipc ra,0x6 + 8000a5cc: 45a080e7 jalr 1114(ra) # 80010a22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E> + 8000a5d0: e12a sd a0,128(sp) + 8000a5d2: a009 j 8000a5d4 <_ZN6kernel6driver4uart84_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..driver..uart..Uart$GT$$GT$4putc17h6cd19d349a1fe87bE+0x1c> + 8000a5d4: 4581 li a1,0 + + if PANICKED.load(Ordering::Relaxed) { + 8000a5d6: 08b107a3 sb a1,143(sp) + +000000008000a5da <.LBB5_26>: + 8000a5da: 0005c517 auipc a0,0x5c + 8000a5de: fa650513 addi a0,a0,-90 # 80066580 <_ZN6kernel6driver7console8PANICKED17hbdbbad2548440929E> + 8000a5e2: ffffa097 auipc ra,0xffffa + 8000a5e6: 124080e7 jalr 292(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 8000a5ea: f4aa sd a0,104(sp) + 8000a5ec: a009 j 8000a5ee <.LBB5_26+0x14> + 8000a5ee: 7526 ld a0,104(sp) + 8000a5f0: e119 bnez a0,8000a5f6 <.LBB5_26+0x1c> + 8000a5f2: a009 j 8000a5f4 <.LBB5_26+0x1a> + loop{} + } + + loop { + 8000a5f4: a011 j 8000a5f8 <.LBB5_26+0x1e> + loop{} + 8000a5f6: a001 j 8000a5f6 <.LBB5_26+0x1c> + 8000a5f8: 0108 addi a0,sp,128 + if uart.write_index == uart.read_index + Wrapping(UART_BUF_SIZE) { + 8000a5fa: 00007097 auipc ra,0x7 + 8000a5fe: 744080e7 jalr 1860(ra) # 80011d3e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h9affced61e721535E> + 8000a602: f0aa sd a0,96(sp) + 8000a604: a009 j 8000a606 <.LBB5_26+0x2c> + 8000a606: 7506 ld a0,96(sp) + 8000a608: e8aa sd a0,80(sp) + 8000a60a: 0108 addi a0,sp,128 + 8000a60c: 00007097 auipc ra,0x7 + 8000a610: 732080e7 jalr 1842(ra) # 80011d3e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h9affced61e721535E> + 8000a614: ecaa sd a0,88(sp) + 8000a616: a009 j 8000a618 <.LBB5_26+0x3e> + 8000a618: 6566 ld a0,88(sp) + 8000a61a: 6508 ld a0,8(a0) + 8000a61c: 02000593 li a1,32 + 8000a620: ed2e sd a1,152(sp) + 8000a622: ffffd097 auipc ra,0xffffd + 8000a626: f82080e7 jalr -126(ra) # 800075a4 <_ZN84_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..Add$GT$3add17hc13ca841e8f8e9ddE> + 8000a62a: e92a sd a0,144(sp) + 8000a62c: a009 j 8000a62e <.LBB5_26+0x54> + 8000a62e: 6546 ld a0,80(sp) + 8000a630: 090c addi a1,sp,144 + 8000a632: 00006097 auipc ra,0x6 + 8000a636: 964080e7 jalr -1692(ra) # 8000ff96 <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2eq17h94523e3cd63d6752E> + 8000a63a: e4aa sd a0,72(sp) + 8000a63c: a009 j 8000a63e <.LBB5_26+0x64> + 8000a63e: 6526 ld a0,72(sp) + 8000a640: 4581 li a1,0 + 8000a642: 00b50d63 beq a0,a1,8000a65c <.LBB5_27+0x14> + 8000a646: a009 j 8000a648 <.LBB5_27> + +000000008000a648 <.LBB5_27>: + let p = unsafe { + CPU_MANAGER.myproc().expect("Fail to get my process.") + 8000a648: 0005c517 auipc a0,0x5c + 8000a64c: af850513 addi a0,a0,-1288 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000a650: 00008097 auipc ra,0x8 + 8000a654: e08080e7 jalr -504(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000a658: e0aa sd a0,64(sp) + 8000a65a: a801 j 8000a66a <.LBB5_27+0x22> + 8000a65c: 0108 addi a0,sp,128 + }; + + p.sleep(&uart.read_index as *const _ as usize, uart); + uart = self.acquire(); + } else { + let write_index = uart.write_index.0 % UART_BUF_SIZE; + 8000a65e: 00007097 auipc ra,0x7 + 8000a662: 6e0080e7 jalr 1760(ra) # 80011d3e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h9affced61e721535E> + 8000a666: fc2a sd a0,56(sp) + 8000a668: a8a9 j 8000a6c2 <.LBB5_29+0x4e> + CPU_MANAGER.myproc().expect("Fail to get my process.") + 8000a66a: 6506 ld a0,64(sp) + +000000008000a66c <.LBB5_28>: + 8000a66c: 0001e597 auipc a1,0x1e + 8000a670: 53458593 addi a1,a1,1332 # 80028ba0 <.L__unnamed_54> + +000000008000a674 <.LBB5_29>: + 8000a674: 0001e697 auipc a3,0x1e + 8000a678: 55c68693 addi a3,a3,1372 # 80028bd0 <.L__unnamed_55> + 8000a67c: 465d li a2,23 + 8000a67e: 00005097 auipc ra,0x5 + 8000a682: d7c080e7 jalr -644(ra) # 8000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE> + 8000a686: f82a sd a0,48(sp) + 8000a688: a009 j 8000a68a <.LBB5_29+0x16> + 8000a68a: 7542 ld a0,48(sp) + 8000a68c: fd2a sd a0,184(sp) + 8000a68e: 0108 addi a0,sp,128 + p.sleep(&uart.read_index as *const _ as usize, uart); + 8000a690: 00007097 auipc ra,0x7 + 8000a694: 6ae080e7 jalr 1710(ra) # 80011d3e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h9affced61e721535E> + 8000a698: f42a sd a0,40(sp) + 8000a69a: a009 j 8000a69c <.LBB5_29+0x28> + 8000a69c: 7542 ld a0,48(sp) + 8000a69e: 75a2 ld a1,40(sp) + 8000a6a0: 05a1 addi a1,a1,8 + 8000a6a2: 660a ld a2,128(sp) + 8000a6a4: 00008097 auipc ra,0x8 + 8000a6a8: c34080e7 jalr -972(ra) # 800122d8 <_ZN6kernel7process7process11task_struct5sleep17hbec20003601a1a02E> + 8000a6ac: a009 j 8000a6ae <.LBB5_29+0x3a> + uart = self.acquire(); + 8000a6ae: 7546 ld a0,112(sp) + 8000a6b0: 00006097 auipc ra,0x6 + 8000a6b4: 372080e7 jalr 882(ra) # 80010a22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E> + 8000a6b8: f02a sd a0,32(sp) + 8000a6ba: a009 j 8000a6bc <.LBB5_29+0x48> + 8000a6bc: 7502 ld a0,32(sp) + 8000a6be: e12a sd a0,128(sp) + loop { + 8000a6c0: bf25 j 8000a5f8 <.LBB5_26+0x1e> + let write_index = uart.write_index.0 % UART_BUF_SIZE; + 8000a6c2: 7562 ld a0,56(sp) + 8000a6c4: 6108 ld a0,0(a0) + 8000a6c6: 897d andi a0,a0,31 + 8000a6c8: e82a sd a0,16(sp) + 8000a6ca: e1aa sd a0,192(sp) + 8000a6cc: 0108 addi a0,sp,128 + uart.buf[write_index] = c; + 8000a6ce: 00007097 auipc ra,0x7 + 8000a6d2: 78e080e7 jalr 1934(ra) # 80011e5c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE> + 8000a6d6: ec2a sd a0,24(sp) + 8000a6d8: a009 j 8000a6da <.LBB5_29+0x66> + 8000a6da: 65c2 ld a1,16(sp) + 8000a6dc: 457d li a0,31 + 8000a6de: 04b56e63 bltu a0,a1,8000a73a <.LBB5_29+0xc6> + 8000a6e2: a009 j 8000a6e4 <.LBB5_29+0x70> + 8000a6e4: 7566 ld a0,120(sp) + 8000a6e6: 65e2 ld a1,24(sp) + 8000a6e8: 6642 ld a2,16(sp) + 8000a6ea: 95b2 add a1,a1,a2 + 8000a6ec: 00a58823 sb a0,16(a1) + 8000a6f0: 0108 addi a0,sp,128 + uart.write_index += Wrapping(1); + 8000a6f2: 00007097 auipc ra,0x7 + 8000a6f6: 76a080e7 jalr 1898(ra) # 80011e5c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE> + 8000a6fa: e42a sd a0,8(sp) + 8000a6fc: a009 j 8000a6fe <.LBB5_29+0x8a> + 8000a6fe: 6522 ld a0,8(sp) + 8000a700: 4585 li a1,1 + 8000a702: f12e sd a1,160(sp) + 8000a704: ffffd097 auipc ra,0xffffd + 8000a708: edc080e7 jalr -292(ra) # 800075e0 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..AddAssign$GT$10add_assign17hc731864567f3481aE> + 8000a70c: a009 j 8000a70e <.LBB5_29+0x9a> + 8000a70e: 0108 addi a0,sp,128 + uart.transmit(); + 8000a710: 00007097 auipc ra,0x7 + 8000a714: 74c080e7 jalr 1868(ra) # 80011e5c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE> + 8000a718: e02a sd a0,0(sp) + 8000a71a: a009 j 8000a71c <.LBB5_29+0xa8> + 8000a71c: 6502 ld a0,0(sp) + 8000a71e: 00012097 auipc ra,0x12 + 8000a722: bca080e7 jalr -1078(ra) # 8001c2e8 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E> + 8000a726: a009 j 8000a728 <.LBB5_29+0xb4> + 8000a728: 0108 addi a0,sp,128 + break; + } + } + } + 8000a72a: ffffd097 auipc ra,0xffffd + 8000a72e: ad6080e7 jalr -1322(ra) # 80007200 <_ZN4core3ptr92drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..uart..Uart$GT$$GT$17h4785ee23048b5bddE> + 8000a732: a009 j 8000a734 <.LBB5_29+0xc0> + 8000a734: 60ae ld ra,200(sp) + 8000a736: 6169 addi sp,sp,208 + 8000a738: 8082 ret + uart.buf[write_index] = c; + 8000a73a: 6542 ld a0,16(sp) + +000000008000a73c <.LBB5_30>: + 8000a73c: 0001e617 auipc a2,0x1e + 8000a740: 4ac60613 addi a2,a2,1196 # 80028be8 <.L__unnamed_56> + 8000a744: 02000593 li a1,32 + 8000a748: 00019097 auipc ra,0x19 + 8000a74c: a28080e7 jalr -1496(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6memory13PageAllocator10new_zeroed17h849e935775a724f6E: + +000000008000a752 <_ZN6kernel6memory13PageAllocator10new_zeroed17h849e935775a724f6E>: +use crate::misc::mem_copy; + +use alloc::{boxed::Box, vec}; + +pub trait PageAllocator: Sized { + unsafe fn new_zeroed() -> usize { + 8000a752: 7179 addi sp,sp,-48 + let boxed_page = Box::::new_zeroed().assume_init(); + 8000a754: f406 sd ra,40(sp) + 8000a756: 00012097 auipc ra,0x12 + 8000a75a: ed0080e7 jalr -304(ra) # 8001c626 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17h2dc288bcc805675fE> + 8000a75e: e82a sd a0,16(sp) + 8000a760: a009 j 8000a762 <_ZN6kernel6memory13PageAllocator10new_zeroed17h849e935775a724f6E+0x10> + 8000a762: 6542 ld a0,16(sp) + 8000a764: 00013097 auipc ra,0x13 + 8000a768: aa6080e7 jalr -1370(ra) # 8001d20a <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h35c82a9a8f43ab52E> + 8000a76c: 85aa mv a1,a0 + 8000a76e: e42e sd a1,8(sp) + 8000a770: ec2a sd a0,24(sp) + 8000a772: a009 j 8000a774 <_ZN6kernel6memory13PageAllocator10new_zeroed17h849e935775a724f6E+0x22> + let ptr = Box::into_raw(boxed_page) as usize; + 8000a774: 6522 ld a0,8(sp) + 8000a776: 00013097 auipc ra,0x13 + 8000a77a: a00080e7 jalr -1536(ra) # 8001d176 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h4b72114c3b8b546bE> + 8000a77e: e02a sd a0,0(sp) + 8000a780: a009 j 8000a782 <_ZN6kernel6memory13PageAllocator10new_zeroed17h849e935775a724f6E+0x30> + 8000a782: 6502 ld a0,0(sp) + 8000a784: f02a sd a0,32(sp) + ptr + } + 8000a786: 70a2 ld ra,40(sp) + 8000a788: 6145 addi sp,sp,48 + 8000a78a: 8082 ret + +Disassembly of section .text._ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E: + +000000008000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E>: + unsafe fn new_zeroed() -> usize { + 8000a78c: 7179 addi sp,sp,-48 + let boxed_page = Box::::new_zeroed().assume_init(); + 8000a78e: f406 sd ra,40(sp) + 8000a790: 00012097 auipc ra,0x12 + 8000a794: eae080e7 jalr -338(ra) # 8001c63e <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17ha7605ec5087df013E> + 8000a798: e82a sd a0,16(sp) + 8000a79a: a009 j 8000a79c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E+0x10> + 8000a79c: 6542 ld a0,16(sp) + 8000a79e: 00013097 auipc ra,0x13 + 8000a7a2: a18080e7 jalr -1512(ra) # 8001d1b6 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h22cceebd78df14b7E> + 8000a7a6: 85aa mv a1,a0 + 8000a7a8: e42e sd a1,8(sp) + 8000a7aa: ec2a sd a0,24(sp) + 8000a7ac: a009 j 8000a7ae <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E+0x22> + let ptr = Box::into_raw(boxed_page) as usize; + 8000a7ae: 6522 ld a0,8(sp) + 8000a7b0: 00013097 auipc ra,0x13 + 8000a7b4: 9e6080e7 jalr -1562(ra) # 8001d196 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17hcc7ebe92239a3cf2E> + 8000a7b8: e02a sd a0,0(sp) + 8000a7ba: a009 j 8000a7bc <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E+0x30> + 8000a7bc: 6502 ld a0,0(sp) + 8000a7be: f02a sd a0,32(sp) + } + 8000a7c0: 70a2 ld ra,40(sp) + 8000a7c2: 6145 addi sp,sp,48 + 8000a7c4: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4pipe4Pipe4init17he2ee825996c6e406E: + +000000008000a7c6 <_ZN6kernel2fs4pipe4Pipe4init17he2ee825996c6e406E>: +// /// write fd is still open +// write_open: bool +// } + +impl Pipe { + pub fn init() -> *mut Pipe{ + 8000a7c6: 715d addi sp,sp,-80 + let pipe_ptr = unsafe{ RawPage::new_zeroed() as *mut Pipe }; + 8000a7c8: e486 sd ra,72(sp) + 8000a7ca: 00000097 auipc ra,0x0 + 8000a7ce: fc2080e7 jalr -62(ra) # 8000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E> + 8000a7d2: e82a sd a0,16(sp) + 8000a7d4: a009 j 8000a7d6 <_ZN6kernel2fs4pipe4Pipe4init17he2ee825996c6e406E+0x10> + 8000a7d6: 65c2 ld a1,16(sp) + 8000a7d8: 852e mv a0,a1 + 8000a7da: e42a sd a0,8(sp) + 8000a7dc: fc2e sd a1,56(sp) + let pipe = unsafe { &mut *pipe_ptr }; + 8000a7de: e0ae sd a1,64(sp) + 8000a7e0: 10100513 li a0,257 + pipe.read_open = true; + 8000a7e4: 20a59823 sh a0,528(a1) + 8000a7e8: 4501 li a0,0 + pipe.write_open = true; + pipe.nread = 0; + 8000a7ea: 20a5b023 sd a0,512(a1) + pipe.nwrite = 0; + 8000a7ee: 20a5b423 sd a0,520(a1) + +000000008000a7f2 <.LBB0_3>: + pipe.pipe_lock = Spinlock::new((), "pipelock"); + 8000a7f2: 0001d597 auipc a1,0x1d + 8000a7f6: 07658593 addi a1,a1,118 # 80027868 <.L__unnamed_6+0xd8> + 8000a7fa: 0828 addi a0,sp,24 + 8000a7fc: 4621 li a2,8 + 8000a7fe: 00006097 auipc ra,0x6 + 8000a802: 1ce080e7 jalr 462(ra) # 800109cc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$3new17h56b5f93ca614e897E> + 8000a806: a009 j 8000a808 <.LBB0_3+0x16> + 8000a808: 6522 ld a0,8(sp) + 8000a80a: 75c2 ld a1,48(sp) + 8000a80c: 22b53823 sd a1,560(a0) + 8000a810: 75a2 ld a1,40(sp) + 8000a812: 22b53423 sd a1,552(a0) + 8000a816: 7582 ld a1,32(sp) + 8000a818: 22b53023 sd a1,544(a0) + 8000a81c: 65e2 ld a1,24(sp) + 8000a81e: 20b53c23 sd a1,536(a0) + + pipe_ptr + } + 8000a822: 60a6 ld ra,72(sp) + 8000a824: 6161 addi sp,sp,80 + 8000a826: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4pipe4Pipe5alloc17h34f49160398961fbE: + +000000008000a828 <_ZN6kernel2fs4pipe4Pipe5alloc17h34f49160398961fbE>: + + pub unsafe fn alloc(rf: *mut *mut VFile, wf: *mut *mut VFile) -> *mut Pipe { + 8000a828: 716d addi sp,sp,-272 + 8000a82a: e606 sd ra,264(sp) + 8000a82c: e82e sd a1,16(sp) + 8000a82e: ec2a sd a0,24(sp) + 8000a830: f5aa sd a0,232(sp) + 8000a832: f9ae sd a1,240(sp) + let pipe_ptr = unsafe{ RawPage::new_zeroed() as *mut Pipe }; + 8000a834: 00000097 auipc ra,0x0 + 8000a838: f58080e7 jalr -168(ra) # 8000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E> + 8000a83c: f02a sd a0,32(sp) + 8000a83e: a009 j 8000a840 <_ZN6kernel2fs4pipe4Pipe5alloc17h34f49160398961fbE+0x18> + 8000a840: 7582 ld a1,32(sp) + 8000a842: 852e mv a0,a1 + 8000a844: e42a sd a0,8(sp) + 8000a846: fdae sd a1,248(sp) + // let pipedata = unsafe{ *PipeData::alloc() }; + // let mut pipe = Self { + // pipe: PipeData::alloc(), + // pipe_lock: Spinlock::new((), "pipe") + // }; + let pipe = &mut *pipe_ptr; + 8000a848: e22e sd a1,256(sp) + 8000a84a: 10100513 li a0,257 + pipe.read_open = true; + 8000a84e: 20a59823 sh a0,528(a1) + 8000a852: 4501 li a0,0 + pipe.write_open = true; + pipe.nread = 0; + 8000a854: 20a5b023 sd a0,512(a1) + pipe.nwrite = 0; + 8000a858: 20a5b423 sd a0,520(a1) + +000000008000a85c <.LBB1_7>: + pipe.pipe_lock = Spinlock::new((), "pipelock"); + 8000a85c: 0001d597 auipc a1,0x1d + 8000a860: 00c58593 addi a1,a1,12 # 80027868 <.L__unnamed_6+0xd8> + 8000a864: 1028 addi a0,sp,40 + 8000a866: 4621 li a2,8 + 8000a868: 00006097 auipc ra,0x6 + 8000a86c: 164080e7 jalr 356(ra) # 800109cc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$3new17h56b5f93ca614e897E> + 8000a870: a009 j 8000a872 <.LBB1_7+0x16> + 8000a872: 65a2 ld a1,8(sp) + 8000a874: 6506 ld a0,64(sp) + 8000a876: 22a5b823 sd a0,560(a1) + 8000a87a: 7562 ld a0,56(sp) + 8000a87c: 22a5b423 sd a0,552(a1) + 8000a880: 7542 ld a0,48(sp) + 8000a882: 22a5b023 sd a0,544(a1) + 8000a886: 7522 ld a0,40(sp) + 8000a888: 20a5bc23 sd a0,536(a1) + 8000a88c: 00a8 addi a0,sp,72 + + **rf = VFile::init(); + 8000a88e: ffffb097 auipc ra,0xffffb + 8000a892: f9c080e7 jalr -100(ra) # 8000582a <_ZN6kernel2fs4file5VFile4init17h000c38ec0bf103cfE> + 8000a896: a009 j 8000a898 <.LBB1_7+0x3c> + 8000a898: 6562 ld a0,24(sp) + 8000a89a: 6108 ld a0,0(a0) + 8000a89c: ffffc097 auipc ra,0xffffc + 8000a8a0: 7b2080e7 jalr 1970(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 8000a8a4: a801 j 8000a8b4 <.LBB1_7+0x58> + **wf = VFile::init(); + 8000a8a6: 6542 ld a0,16(sp) + 8000a8a8: 6108 ld a0,0(a0) + 8000a8aa: ffffc097 auipc ra,0xffffc + 8000a8ae: 7a4080e7 jalr 1956(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 8000a8b2: a03d j 8000a8e0 <.LBB1_7+0x84> + **rf = VFile::init(); + 8000a8b4: 6562 ld a0,24(sp) + 8000a8b6: 610c ld a1,0(a0) + 8000a8b8: 7566 ld a0,120(sp) + 8000a8ba: f988 sd a0,48(a1) + 8000a8bc: 7546 ld a0,112(sp) + 8000a8be: f588 sd a0,40(a1) + 8000a8c0: 7526 ld a0,104(sp) + 8000a8c2: f188 sd a0,32(a1) + 8000a8c4: 7506 ld a0,96(sp) + 8000a8c6: ed88 sd a0,24(a1) + 8000a8c8: 6566 ld a0,88(sp) + 8000a8ca: e988 sd a0,16(a1) + 8000a8cc: 6546 ld a0,80(sp) + 8000a8ce: e588 sd a0,8(a1) + 8000a8d0: 6526 ld a0,72(sp) + 8000a8d2: e188 sd a0,0(a1) + 8000a8d4: 0108 addi a0,sp,128 + **wf = VFile::init(); + 8000a8d6: ffffb097 auipc ra,0xffffb + 8000a8da: f54080e7 jalr -172(ra) # 8000582a <_ZN6kernel2fs4file5VFile4init17h000c38ec0bf103cfE> + 8000a8de: b7e1 j 8000a8a6 <.LBB1_7+0x4a> + 8000a8e0: 6522 ld a0,8(sp) + 8000a8e2: 65c2 ld a1,16(sp) + 8000a8e4: 6762 ld a4,24(sp) + 8000a8e6: 6194 ld a3,0(a1) + 8000a8e8: 764a ld a2,176(sp) + 8000a8ea: fa90 sd a2,48(a3) + 8000a8ec: 762a ld a2,168(sp) + 8000a8ee: f690 sd a2,40(a3) + 8000a8f0: 760a ld a2,160(sp) + 8000a8f2: f290 sd a2,32(a3) + 8000a8f4: 666a ld a2,152(sp) + 8000a8f6: ee90 sd a2,24(a3) + 8000a8f8: 664a ld a2,144(sp) + 8000a8fa: ea90 sd a2,16(a3) + 8000a8fc: 662a ld a2,136(sp) + 8000a8fe: e690 sd a2,8(a3) + 8000a900: 660a ld a2,128(sp) + 8000a902: e290 sd a2,0(a3) + 8000a904: 4605 li a2,1 + (*(*rf)).ftype = FileType::Pipe; + 8000a906: 0ac11f23 sh a2,190(sp) + 8000a90a: 6314 ld a3,0(a4) + 8000a90c: 02c69623 sh a2,44(a3) + (*(*rf)).readable = true; + 8000a910: 6314 ld a3,0(a4) + 8000a912: 02c68823 sb a2,48(a3) + (*(*rf)).writeable = false; + 8000a916: 631c ld a5,0(a4) + 8000a918: 4681 li a3,0 + 8000a91a: 02d788a3 sb a3,49(a5) + (*(*rf)).pipe = Some(pipe as *mut Pipe); + 8000a91e: e5aa sd a0,200(sp) + 8000a920: e1b2 sd a2,192(sp) + 8000a922: 6318 ld a4,0(a4) + 8000a924: e310 sd a2,0(a4) + 8000a926: e708 sd a0,8(a4) + (*(*wf)).ftype = FileType::Pipe; + 8000a928: 0cc11b23 sh a2,214(sp) + 8000a92c: 6198 ld a4,0(a1) + 8000a92e: 02c71623 sh a2,44(a4) + (*(*wf)).readable = false; + 8000a932: 6198 ld a4,0(a1) + 8000a934: 02d70823 sb a3,48(a4) + (*(*wf)).writeable = true; + 8000a938: 6194 ld a3,0(a1) + 8000a93a: 02c688a3 sb a2,49(a3) + (*(*wf)).pipe = Some(pipe as *mut Pipe); + 8000a93e: f1aa sd a0,224(sp) + 8000a940: edb2 sd a2,216(sp) + 8000a942: 618c ld a1,0(a1) + 8000a944: e190 sd a2,0(a1) + 8000a946: e588 sd a0,8(a1) + + pipe_ptr + } + 8000a948: 60b2 ld ra,264(sp) + 8000a94a: 6151 addi sp,sp,272 + 8000a94c: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4pipe4Pipe4read17h2c2acb00d7827debE: + +000000008000a94e <_ZN6kernel2fs4pipe4Pipe4read17h2c2acb00d7827debE>: + + pub fn read(&mut self, addr: usize, len: usize) -> Result { + 8000a94e: 7169 addi sp,sp,-304 + 8000a950: f606 sd ra,296(sp) + 8000a952: f0b6 sd a3,96(sp) + 8000a954: f4b2 sd a2,104(sp) + 8000a956: f8ae sd a1,112(sp) + 8000a958: fcaa sd a0,120(sp) + 8000a95a: f5ae sd a1,232(sp) + 8000a95c: f9b2 sd a2,240(sp) + 8000a95e: fdb6 sd a3,248(sp) + +000000008000a960 <.LBB2_43>: + let my_proc = unsafe { + CPU_MANAGER.myproc().ok_or("Fail to get my process")? + 8000a960: 0005b517 auipc a0,0x5b + 8000a964: 7e050513 addi a0,a0,2016 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000a968: 00008097 auipc ra,0x8 + 8000a96c: af0080e7 jalr -1296(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000a970: e12a sd a0,128(sp) + 8000a972: a009 j 8000a974 <.LBB2_43+0x14> + 8000a974: 658a ld a1,128(sp) + +000000008000a976 <.LBB2_44>: + 8000a976: 0001e617 auipc a2,0x1e + 8000a97a: 28a60613 addi a2,a2,650 # 80028c00 <.L__unnamed_2> + 8000a97e: 1108 addi a0,sp,160 + 8000a980: 46d9 li a3,22 + 8000a982: 00004097 auipc ra,0x4 + 8000a986: 774080e7 jalr 1908(ra) # 8000f0f6 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE> + 8000a98a: a009 j 8000a98c <.LBB2_44+0x16> + 8000a98c: 0128 addi a0,sp,136 + 8000a98e: 110c addi a1,sp,160 + 8000a990: 00003097 auipc ra,0x3 + 8000a994: 13e080e7 jalr 318(ra) # 8000dace <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h2625785248aabe7bE> + 8000a998: a009 j 8000a99a <.LBB2_44+0x24> + 8000a99a: 652a ld a0,136(sp) + 8000a99c: 4581 li a1,0 + 8000a99e: 00b50463 beq a0,a1,8000a9a6 <.LBB2_44+0x30> + 8000a9a2: a009 j 8000a9a4 <.LBB2_44+0x2e> + 8000a9a4: a839 j 8000a9c2 <.LBB2_44+0x4c> + 8000a9a6: 7546 ld a0,112(sp) + 8000a9a8: 65ca ld a1,144(sp) + 8000a9aa: ecae sd a1,88(sp) + 8000a9ac: ea2e sd a1,272(sp) + 8000a9ae: ee2e sd a1,280(sp) + }; + + let mut guard = self.pipe_lock.acquire(); + 8000a9b0: 21850513 addi a0,a0,536 + 8000a9b4: 00006097 auipc ra,0x6 + 8000a9b8: 68e080e7 jalr 1678(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000a9bc: fd2a sd a0,184(sp) + 8000a9be: a02d j 8000a9e8 <.LBB2_44+0x72> + CPU_MANAGER.myproc().ok_or("Fail to get my process")? + 8000a9c0: 0000 unimp + 8000a9c2: 654a ld a0,144(sp) + 8000a9c4: 65ea ld a1,152(sp) + 8000a9c6: e22a sd a0,256(sp) + 8000a9c8: e62e sd a1,264(sp) + 8000a9ca: 00002097 auipc ra,0x2 + 8000a9ce: 9bc080e7 jalr -1604(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8000a9d2: e4aa sd a0,72(sp) + 8000a9d4: e8ae sd a1,80(sp) + 8000a9d6: a009 j 8000a9d8 <.LBB2_44+0x62> + 8000a9d8: 6646 ld a2,80(sp) + 8000a9da: 65a6 ld a1,72(sp) + 8000a9dc: 7566 ld a0,120(sp) + 8000a9de: 00003097 auipc ra,0x3 + 8000a9e2: fe8080e7 jalr -24(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 8000a9e6: a271 j 8000ab72 <.LBB2_46+0x2a> + // let pipe = unsafe { &mut *self.pipe }; + while self.nread == self.nwrite && self.write_open { + 8000a9e8: 75c6 ld a1,112(sp) + 8000a9ea: 2005b503 ld a0,512(a1) + 8000a9ee: 2085b583 ld a1,520(a1) + 8000a9f2: 00b50b63 beq a0,a1,8000aa08 <.LBB2_44+0x92> + 8000a9f6: a029 j 8000aa00 <.LBB2_44+0x8a> + 8000a9f8: 4505 li a0,1 + 8000a9fa: 0ca103a3 sb a0,199(sp) + 8000a9fe: a819 j 8000aa14 <.LBB2_44+0x9e> + 8000aa00: 4501 li a0,0 + 8000aa02: 0ca103a3 sb a0,199(sp) + 8000aa06: a039 j 8000aa14 <.LBB2_44+0x9e> + 8000aa08: 7546 ld a0,112(sp) + 8000aa0a: 21154503 lbu a0,529(a0) + 8000aa0e: 8905 andi a0,a0,1 + 8000aa10: f565 bnez a0,8000a9f8 <.LBB2_44+0x82> + 8000aa12: b7fd j 8000aa00 <.LBB2_44+0x8a> + 8000aa14: 0c714503 lbu a0,199(sp) + 8000aa18: 8905 andi a0,a0,1 + 8000aa1a: e509 bnez a0,8000aa24 <.LBB2_44+0xae> + 8000aa1c: a009 j 8000aa1e <.LBB2_44+0xa8> + 8000aa1e: 4501 li a0,0 + // } + // i = index; + // // pipe_guard.read_number += 1; + + // } + let mut i = 0; + 8000aa20: e5aa sd a0,200(sp) + while i < len { + 8000aa22: a0ad j 8000aa8c <.LBB2_45+0x2e> + if my_proc.killed() { + 8000aa24: 6566 ld a0,88(sp) + 8000aa26: 0000c097 auipc ra,0xc + 8000aa2a: 37c080e7 jalr 892(ra) # 80016da2 <_ZN6kernel7process7process11task_struct6killed17h6ef392cf7098b250E> + 8000aa2e: e0aa sd a0,64(sp) + 8000aa30: a009 j 8000aa32 <.LBB2_44+0xbc> + 8000aa32: 6506 ld a0,64(sp) + 8000aa34: 4581 li a1,0 + 8000aa36: 00b50963 beq a0,a1,8000aa48 <.LBB2_44+0xd2> + 8000aa3a: a009 j 8000aa3c <.LBB2_44+0xc6> + drop(guard); + 8000aa3c: 756a ld a0,184(sp) + 8000aa3e: 00013097 auipc ra,0x13 + 8000aa42: 3aa080e7 jalr 938(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000aa46: a819 j 8000aa5c <.LBB2_44+0xe6> + &self.nread as *const _ as usize, + 8000aa48: 6566 ld a0,88(sp) + 8000aa4a: 75c6 ld a1,112(sp) + 8000aa4c: 20058593 addi a1,a1,512 + guard + 8000aa50: 766a ld a2,184(sp) + my_proc.sleep( + 8000aa52: 00007097 auipc ra,0x7 + 8000aa56: 7fa080e7 jalr 2042(ra) # 8001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E> + 8000aa5a: a829 j 8000aa74 <.LBB2_45+0x16> + return Err("pipe read: current process has been killed") + 8000aa5c: 75e6 ld a1,120(sp) + +000000008000aa5e <.LBB2_45>: + 8000aa5e: 0001e517 auipc a0,0x1e + 8000aa62: 1b850513 addi a0,a0,440 # 80028c16 <.L__unnamed_3> + 8000aa66: e588 sd a0,8(a1) + 8000aa68: 02a00513 li a0,42 + 8000aa6c: e988 sd a0,16(a1) + 8000aa6e: 4505 li a0,1 + 8000aa70: e188 sd a0,0(a1) + 8000aa72: a201 j 8000ab72 <.LBB2_46+0x2a> + guard = self.pipe_lock.acquire(); + 8000aa74: 7546 ld a0,112(sp) + 8000aa76: 21850513 addi a0,a0,536 + 8000aa7a: 00006097 auipc ra,0x6 + 8000aa7e: 5c8080e7 jalr 1480(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000aa82: fc2a sd a0,56(sp) + 8000aa84: a009 j 8000aa86 <.LBB2_45+0x28> + 8000aa86: 7562 ld a0,56(sp) + 8000aa88: fd2a sd a0,184(sp) + while self.nread == self.nwrite && self.write_open { + 8000aa8a: bfb9 j 8000a9e8 <.LBB2_44+0x72> + while i < len { + 8000aa8c: 7586 ld a1,96(sp) + 8000aa8e: 652e ld a0,200(sp) + 8000aa90: 00b56463 bltu a0,a1,8000aa98 <.LBB2_45+0x3a> + 8000aa94: a009 j 8000aa96 <.LBB2_45+0x38> + 8000aa96: a075 j 8000ab42 <.LBB2_45+0xe4> + if self.nread == self.nwrite { + 8000aa98: 75c6 ld a1,112(sp) + 8000aa9a: 2005b503 ld a0,512(a1) + 8000aa9e: 2085b583 ld a1,520(a1) + 8000aaa2: 00b51463 bne a0,a1,8000aaaa <.LBB2_45+0x4c> + 8000aaa6: a009 j 8000aaa8 <.LBB2_45+0x4a> + 8000aaa8: a869 j 8000ab42 <.LBB2_45+0xe4> + break; + } + let ch = self.data[self.nread % PIPE_SIZE]; + 8000aaaa: 7546 ld a0,112(sp) + 8000aaac: 20053503 ld a0,512(a0) + 8000aab0: 1ff57593 andi a1,a0,511 + 8000aab4: f82e sd a1,48(sp) + 8000aab6: 1ff00513 li a0,511 + 8000aaba: 0ab56f63 bltu a0,a1,8000ab78 <.LBB2_46+0x30> + 8000aabe: a009 j 8000aac0 <.LBB2_45+0x62> + 8000aac0: 7546 ld a0,112(sp) + 8000aac2: 75c2 ld a1,48(sp) + 8000aac4: 95aa add a1,a1,a0 + 8000aac6: 00058583 lb a1,0(a1) + 8000aaca: 0cb10ba3 sb a1,215(sp) + self.nread += 1; + 8000aace: 20053583 ld a1,512(a0) + 8000aad2: 00158513 addi a0,a1,1 + 8000aad6: f42a sd a0,40(sp) + 8000aad8: 0ab56c63 bltu a0,a1,8000ab90 <.LBB2_48> + 8000aadc: a009 j 8000aade <.LBB2_45+0x80> + 8000aade: 75a6 ld a1,104(sp) + 8000aae0: 6566 ld a0,88(sp) + 8000aae2: 7622 ld a2,40(sp) + 8000aae4: 76c6 ld a3,112(sp) + 8000aae6: 20c6b023 sd a2,512(a3) + + let pgt = unsafe { &mut *my_proc.pagetable }; + 8000aaea: 6d08 ld a0,24(a0) + 8000aaec: ec2a sd a0,24(sp) + 8000aaee: f22a sd a0,288(sp) + if pgt.copy_out(addr + i, &ch as *const u8, 1).is_err() { + 8000aaf0: 652e ld a0,200(sp) + 8000aaf2: 952e add a0,a0,a1 + 8000aaf4: f02a sd a0,32(sp) + 8000aaf6: 0ab56b63 bltu a0,a1,8000abac <.LBB2_50> + 8000aafa: a009 j 8000aafc <.LBB2_45+0x9e> + 8000aafc: 7582 ld a1,32(sp) + 8000aafe: 6562 ld a0,24(sp) + 8000ab00: 0d710613 addi a2,sp,215 + 8000ab04: 4685 li a3,1 + 8000ab06: 0000e097 auipc ra,0xe + 8000ab0a: e78080e7 jalr -392(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 8000ab0e: edaa sd a0,216(sp) + 8000ab10: f1ae sd a1,224(sp) + 8000ab12: a009 j 8000ab14 <.LBB2_45+0xb6> + 8000ab14: 09a8 addi a0,sp,216 + 8000ab16: 00003097 auipc ra,0x3 + 8000ab1a: b62080e7 jalr -1182(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8000ab1e: e82a sd a0,16(sp) + 8000ab20: a009 j 8000ab22 <.LBB2_45+0xc4> + 8000ab22: 6542 ld a0,16(sp) + 8000ab24: 4581 li a1,0 + 8000ab26: 00b50463 beq a0,a1,8000ab2e <.LBB2_45+0xd0> + 8000ab2a: a009 j 8000ab2c <.LBB2_45+0xce> + 8000ab2c: a819 j 8000ab42 <.LBB2_45+0xe4> + break; + } + i += 1; + 8000ab2e: 65ae ld a1,200(sp) + 8000ab30: 00158513 addi a0,a1,1 + 8000ab34: e42a sd a0,8(sp) + 8000ab36: 08b56963 bltu a0,a1,8000abc8 <.LBB2_52> + 8000ab3a: a009 j 8000ab3c <.LBB2_45+0xde> + 8000ab3c: 6522 ld a0,8(sp) + 8000ab3e: e5aa sd a0,200(sp) + while i < len { + 8000ab40: b7b1 j 8000aa8c <.LBB2_45+0x2e> + } + + unsafe{ PROC_MANAGER.wake_up(&self.nwrite as *const _ as usize) }; + 8000ab42: 7546 ld a0,112(sp) + 8000ab44: 20850593 addi a1,a0,520 + +000000008000ab48 <.LBB2_46>: + 8000ab48: 0004f517 auipc a0,0x4f + 8000ab4c: 88850513 addi a0,a0,-1912 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000ab50: 00003097 auipc ra,0x3 + 8000ab54: 6b0080e7 jalr 1712(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8000ab58: a009 j 8000ab5a <.LBB2_46+0x12> + drop(guard); + 8000ab5a: 756a ld a0,184(sp) + 8000ab5c: 00013097 auipc ra,0x13 + 8000ab60: 28c080e7 jalr 652(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000ab64: a009 j 8000ab66 <.LBB2_46+0x1e> + Ok(i) + 8000ab66: 75e6 ld a1,120(sp) + 8000ab68: 652e ld a0,200(sp) + 8000ab6a: e588 sd a0,8(a1) + 8000ab6c: 4501 li a0,0 + 8000ab6e: e188 sd a0,0(a1) + } + 8000ab70: a009 j 8000ab72 <.LBB2_46+0x2a> + 8000ab72: 70b2 ld ra,296(sp) + 8000ab74: 6155 addi sp,sp,304 + 8000ab76: 8082 ret + let ch = self.data[self.nread % PIPE_SIZE]; + 8000ab78: 7542 ld a0,48(sp) + +000000008000ab7a <.LBB2_47>: + 8000ab7a: 0001e617 auipc a2,0x1e + 8000ab7e: 0d660613 addi a2,a2,214 # 80028c50 <.L__unnamed_4> + 8000ab82: 20000593 li a1,512 + 8000ab86: 00018097 auipc ra,0x18 + 8000ab8a: 5ea080e7 jalr 1514(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000ab90 <.LBB2_48>: + self.nread += 1; + 8000ab90: 0001e517 auipc a0,0x1e + 8000ab94: 0f050513 addi a0,a0,240 # 80028c80 + +000000008000ab98 <.LBB2_49>: + 8000ab98: 0001e617 auipc a2,0x1e + 8000ab9c: 0d060613 addi a2,a2,208 # 80028c68 <.L__unnamed_5> + 8000aba0: 45f1 li a1,28 + 8000aba2: 00018097 auipc ra,0x18 + 8000aba6: 5a2080e7 jalr 1442(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000abac <.LBB2_50>: + if pgt.copy_out(addr + i, &ch as *const u8, 1).is_err() { + 8000abac: 0001e517 auipc a0,0x1e + 8000abb0: 0d450513 addi a0,a0,212 # 80028c80 + +000000008000abb4 <.LBB2_51>: + 8000abb4: 0001e617 auipc a2,0x1e + 8000abb8: 0ec60613 addi a2,a2,236 # 80028ca0 <.L__unnamed_6> + 8000abbc: 45f1 li a1,28 + 8000abbe: 00018097 auipc ra,0x18 + 8000abc2: 586080e7 jalr 1414(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000abc8 <.LBB2_52>: + i += 1; + 8000abc8: 0001e517 auipc a0,0x1e + 8000abcc: 0b850513 addi a0,a0,184 # 80028c80 + +000000008000abd0 <.LBB2_53>: + 8000abd0: 0001e617 auipc a2,0x1e + 8000abd4: 0e860613 addi a2,a2,232 # 80028cb8 <.L__unnamed_7> + 8000abd8: 45f1 li a1,28 + 8000abda: 00018097 auipc ra,0x18 + 8000abde: 56a080e7 jalr 1386(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs4pipe4Pipe5write17h441574030d245cddE: + +000000008000abe4 <_ZN6kernel2fs4pipe4Pipe5write17h441574030d245cddE>: + + pub fn write(&mut self, addr: usize, len: usize) -> Result { + 8000abe4: 7129 addi sp,sp,-320 + 8000abe6: fe06 sd ra,312(sp) + 8000abe8: f8b6 sd a3,112(sp) + 8000abea: fcb2 sd a2,120(sp) + 8000abec: e12e sd a1,128(sp) + 8000abee: e52a sd a0,136(sp) + 8000abf0: f9ae sd a1,240(sp) + 8000abf2: fdb2 sd a2,248(sp) + 8000abf4: e236 sd a3,256(sp) + +000000008000abf6 <.LBB3_36>: + + let my_proc = unsafe { + CPU_MANAGER.myproc().ok_or("Fail to get current process")? + 8000abf6: 0005b517 auipc a0,0x5b + 8000abfa: 54a50513 addi a0,a0,1354 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000abfe: 00008097 auipc ra,0x8 + 8000ac02: 85a080e7 jalr -1958(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000ac06: e92a sd a0,144(sp) + 8000ac08: a009 j 8000ac0a <.LBB3_36+0x14> + 8000ac0a: 65ca ld a1,144(sp) + +000000008000ac0c <.LBB3_37>: + 8000ac0c: 0001e617 auipc a2,0x1e + 8000ac10: 0c460613 addi a2,a2,196 # 80028cd0 <.L__unnamed_8> + 8000ac14: 1908 addi a0,sp,176 + 8000ac16: 46ed li a3,27 + 8000ac18: 00004097 auipc ra,0x4 + 8000ac1c: 4de080e7 jalr 1246(ra) # 8000f0f6 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE> + 8000ac20: a009 j 8000ac22 <.LBB3_37+0x16> + 8000ac22: 0928 addi a0,sp,152 + 8000ac24: 190c addi a1,sp,176 + 8000ac26: 00003097 auipc ra,0x3 + 8000ac2a: ea8080e7 jalr -344(ra) # 8000dace <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h2625785248aabe7bE> + 8000ac2e: a009 j 8000ac30 <.LBB3_37+0x24> + 8000ac30: 656a ld a0,152(sp) + 8000ac32: 4581 li a1,0 + 8000ac34: 00b50463 beq a0,a1,8000ac3c <.LBB3_37+0x30> + 8000ac38: a009 j 8000ac3a <.LBB3_37+0x2e> + 8000ac3a: a839 j 8000ac58 <.LBB3_37+0x4c> + 8000ac3c: 650a ld a0,128(sp) + 8000ac3e: 758a ld a1,160(sp) + 8000ac40: f4ae sd a1,104(sp) + 8000ac42: ee2e sd a1,280(sp) + 8000ac44: f22e sd a1,288(sp) + }; + // println!("$$$"); + + let mut guard = self.pipe_lock.acquire(); + 8000ac46: 21850513 addi a0,a0,536 + 8000ac4a: 00006097 auipc ra,0x6 + 8000ac4e: 3f8080e7 jalr 1016(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000ac52: e5aa sd a0,200(sp) + 8000ac54: a02d j 8000ac7e <.LBB3_37+0x72> + CPU_MANAGER.myproc().ok_or("Fail to get current process")? + 8000ac56: 0000 unimp + 8000ac58: 750a ld a0,160(sp) + 8000ac5a: 75aa ld a1,168(sp) + 8000ac5c: e62a sd a0,264(sp) + 8000ac5e: ea2e sd a1,272(sp) + 8000ac60: 00001097 auipc ra,0x1 + 8000ac64: 726080e7 jalr 1830(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8000ac68: ecaa sd a0,88(sp) + 8000ac6a: f0ae sd a1,96(sp) + 8000ac6c: a009 j 8000ac6e <.LBB3_37+0x62> + 8000ac6e: 7606 ld a2,96(sp) + 8000ac70: 65e6 ld a1,88(sp) + 8000ac72: 652a ld a0,136(sp) + 8000ac74: 00003097 auipc ra,0x3 + 8000ac78: d52080e7 jalr -686(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 8000ac7c: a2b9 j 8000adca <.LBB3_39+0x2a> + 8000ac7e: 4501 li a0,0 + // let pipe = unsafe { &mut *self.pipe }; + let mut i = 0; + 8000ac80: e9aa sd a0,208(sp) + + // println!("$$$"); + + // println!("@{} {}", pipe.write_number, pipe.read_number); + + while i < len { + 8000ac82: a009 j 8000ac84 <.LBB3_37+0x78> + 8000ac84: 75c6 ld a1,112(sp) + 8000ac86: 654e ld a0,208(sp) + 8000ac88: 00b56463 bltu a0,a1,8000ac90 <.LBB3_37+0x84> + 8000ac8c: a009 j 8000ac8e <.LBB3_37+0x82> + 8000ac8e: a231 j 8000ad9a <.LBB3_38+0xe2> + // drop(guard); + // return Err("pipe write: pipe read close or current process has been killed") + // } + // println!("HEHE"); + + if self.nwrite == self.nread + PIPE_SIZE { + 8000ac90: 650a ld a0,128(sp) + 8000ac92: 20853583 ld a1,520(a0) + 8000ac96: e4ae sd a1,72(sp) + 8000ac98: 20053583 ld a1,512(a0) + 8000ac9c: 20058513 addi a0,a1,512 + 8000aca0: e8aa sd a0,80(sp) + 8000aca2: 12b56763 bltu a0,a1,8000add0 <.LBB3_40> + 8000aca6: a009 j 8000aca8 <.LBB3_37+0x9c> + 8000aca8: 6526 ld a0,72(sp) + 8000acaa: 65c6 ld a1,80(sp) + 8000acac: 00b51f63 bne a0,a1,8000acca <.LBB3_38+0x12> + 8000acb0: a009 j 8000acb2 <.LBB3_37+0xa6> + + + unsafe { + PROC_MANAGER.wake_up(&self.nread as *const _ as usize); + 8000acb2: 650a ld a0,128(sp) + 8000acb4: 20050593 addi a1,a0,512 + +000000008000acb8 <.LBB3_38>: + 8000acb8: 0004e517 auipc a0,0x4e + 8000acbc: 71850513 addi a0,a0,1816 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000acc0: 00003097 auipc ra,0x3 + 8000acc4: 540080e7 jalr 1344(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8000acc8: a839 j 8000ace6 <.LBB3_38+0x2e> + 8000acca: 75e6 ld a1,120(sp) + 8000accc: 7526 ld a0,104(sp) + 8000acce: 4601 li a2,0 + } + my_proc.sleep(&self.nwrite as *const _ as usize, guard); + guard = self.pipe_lock.acquire(); + } else { + // println!("HAHA"); + let mut char: u8 = 0; + 8000acd0: 0cc10fa3 sb a2,223(sp) + let pgt = unsafe { &mut *my_proc.pagetable }; + 8000acd4: 6d08 ld a0,24(a0) + 8000acd6: fc2a sd a0,56(sp) + 8000acd8: f62a sd a0,296(sp) + if pgt.copy_in(&mut char as *mut u8, addr + i, 1).is_err() { + 8000acda: 654e ld a0,208(sp) + 8000acdc: 952e add a0,a0,a1 + 8000acde: e0aa sd a0,64(sp) + 8000ace0: 10b56663 bltu a0,a1,8000adec <.LBB3_42> + 8000ace4: a03d j 8000ad12 <.LBB3_38+0x5a> + my_proc.sleep(&self.nwrite as *const _ as usize, guard); + 8000ace6: 7526 ld a0,104(sp) + 8000ace8: 658a ld a1,128(sp) + 8000acea: 20858593 addi a1,a1,520 + 8000acee: 662e ld a2,200(sp) + 8000acf0: 00007097 auipc ra,0x7 + 8000acf4: 55c080e7 jalr 1372(ra) # 8001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E> + 8000acf8: a009 j 8000acfa <.LBB3_38+0x42> + guard = self.pipe_lock.acquire(); + 8000acfa: 650a ld a0,128(sp) + 8000acfc: 21850513 addi a0,a0,536 + 8000ad00: 00006097 auipc ra,0x6 + 8000ad04: 342080e7 jalr 834(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000ad08: f82a sd a0,48(sp) + 8000ad0a: a009 j 8000ad0c <.LBB3_38+0x54> + 8000ad0c: 7542 ld a0,48(sp) + 8000ad0e: e5aa sd a0,200(sp) + if self.nwrite == self.nread + PIPE_SIZE { + 8000ad10: bf95 j 8000ac84 <.LBB3_37+0x78> + if pgt.copy_in(&mut char as *mut u8, addr + i, 1).is_err() { + 8000ad12: 6606 ld a2,64(sp) + 8000ad14: 7562 ld a0,56(sp) + 8000ad16: 0df10593 addi a1,sp,223 + 8000ad1a: 4685 li a3,1 + 8000ad1c: 0000e097 auipc ra,0xe + 8000ad20: e92080e7 jalr -366(ra) # 80018bae <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E> + 8000ad24: f1aa sd a0,224(sp) + 8000ad26: f5ae sd a1,232(sp) + 8000ad28: a009 j 8000ad2a <.LBB3_38+0x72> + 8000ad2a: 1188 addi a0,sp,224 + 8000ad2c: 00003097 auipc ra,0x3 + 8000ad30: 94c080e7 jalr -1716(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8000ad34: f42a sd a0,40(sp) + 8000ad36: a009 j 8000ad38 <.LBB3_38+0x80> + 8000ad38: 7522 ld a0,40(sp) + 8000ad3a: 4581 li a1,0 + 8000ad3c: 00b50463 beq a0,a1,8000ad44 <.LBB3_38+0x8c> + 8000ad40: a009 j 8000ad42 <.LBB3_38+0x8a> + 8000ad42: a8a1 j 8000ad9a <.LBB3_38+0xe2> + break; + } + let write_cursor = self.nwrite % PIPE_SIZE; + 8000ad44: 650a ld a0,128(sp) + 8000ad46: 20853503 ld a0,520(a0) + 8000ad4a: 1ff57593 andi a1,a0,511 + 8000ad4e: ec2e sd a1,24(sp) + 8000ad50: fa2e sd a1,304(sp) + self.data[write_cursor] = char; + 8000ad52: 0df14503 lbu a0,223(sp) + 8000ad56: f02a sd a0,32(sp) + 8000ad58: 1ff00513 li a0,511 + 8000ad5c: 0ab56663 bltu a0,a1,8000ae08 <.LBB3_43+0x14> + 8000ad60: a009 j 8000ad62 <.LBB3_38+0xaa> + 8000ad62: 650a ld a0,128(sp) + 8000ad64: 7582 ld a1,32(sp) + 8000ad66: 6662 ld a2,24(sp) + 8000ad68: 962a add a2,a2,a0 + 8000ad6a: 00b60023 sb a1,0(a2) + // println!("+{}", char); + + self.nwrite += 1; + 8000ad6e: 20853583 ld a1,520(a0) + 8000ad72: 00158513 addi a0,a1,1 + 8000ad76: e82a sd a0,16(sp) + 8000ad78: 0ab56463 bltu a0,a1,8000ae20 <.LBB3_45> + 8000ad7c: a009 j 8000ad7e <.LBB3_38+0xc6> + 8000ad7e: 6542 ld a0,16(sp) + 8000ad80: 658a ld a1,128(sp) + 8000ad82: 20a5b423 sd a0,520(a1) + i += 1; + 8000ad86: 65ce ld a1,208(sp) + 8000ad88: 00158513 addi a0,a1,1 + 8000ad8c: e42a sd a0,8(sp) + 8000ad8e: 0ab56763 bltu a0,a1,8000ae3c <.LBB3_47> + 8000ad92: a009 j 8000ad94 <.LBB3_38+0xdc> + 8000ad94: 6522 ld a0,8(sp) + 8000ad96: e9aa sd a0,208(sp) + if self.nwrite == self.nread + PIPE_SIZE { + 8000ad98: b5f5 j 8000ac84 <.LBB3_37+0x78> + } + + + + unsafe { + PROC_MANAGER.wake_up(&self.nread as *const _ as usize); + 8000ad9a: 650a ld a0,128(sp) + 8000ad9c: 20050593 addi a1,a0,512 + +000000008000ada0 <.LBB3_39>: + 8000ada0: 0004e517 auipc a0,0x4e + 8000ada4: 63050513 addi a0,a0,1584 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000ada8: 00003097 auipc ra,0x3 + 8000adac: 458080e7 jalr 1112(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8000adb0: a009 j 8000adb2 <.LBB3_39+0x12> + } + drop(guard); + 8000adb2: 652e ld a0,200(sp) + 8000adb4: 00013097 auipc ra,0x13 + 8000adb8: 034080e7 jalr 52(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000adbc: a009 j 8000adbe <.LBB3_39+0x1e> + + Ok(i) + 8000adbe: 65aa ld a1,136(sp) + 8000adc0: 654e ld a0,208(sp) + 8000adc2: e588 sd a0,8(a1) + 8000adc4: 4501 li a0,0 + 8000adc6: e188 sd a0,0(a1) + } + 8000adc8: a009 j 8000adca <.LBB3_39+0x2a> + 8000adca: 70f2 ld ra,312(sp) + 8000adcc: 6131 addi sp,sp,320 + 8000adce: 8082 ret + +000000008000add0 <.LBB3_40>: + if self.nwrite == self.nread + PIPE_SIZE { + 8000add0: 0001e517 auipc a0,0x1e + 8000add4: eb050513 addi a0,a0,-336 # 80028c80 + +000000008000add8 <.LBB3_41>: + 8000add8: 0001e617 auipc a2,0x1e + 8000addc: f1860613 addi a2,a2,-232 # 80028cf0 <.L__unnamed_9> + 8000ade0: 45f1 li a1,28 + 8000ade2: 00018097 auipc ra,0x18 + 8000ade6: 362080e7 jalr 866(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000adec <.LBB3_42>: + if pgt.copy_in(&mut char as *mut u8, addr + i, 1).is_err() { + 8000adec: 0001e517 auipc a0,0x1e + 8000adf0: e9450513 addi a0,a0,-364 # 80028c80 + +000000008000adf4 <.LBB3_43>: + 8000adf4: 0001e617 auipc a2,0x1e + 8000adf8: f1460613 addi a2,a2,-236 # 80028d08 <.L__unnamed_10> + 8000adfc: 45f1 li a1,28 + 8000adfe: 00018097 auipc ra,0x18 + 8000ae02: 346080e7 jalr 838(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000ae06: 0000 unimp + self.data[write_cursor] = char; + 8000ae08: 6562 ld a0,24(sp) + +000000008000ae0a <.LBB3_44>: + 8000ae0a: 0001e617 auipc a2,0x1e + 8000ae0e: f1660613 addi a2,a2,-234 # 80028d20 <.L__unnamed_11> + 8000ae12: 20000593 li a1,512 + 8000ae16: 00018097 auipc ra,0x18 + 8000ae1a: 35a080e7 jalr 858(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008000ae20 <.LBB3_45>: + self.nwrite += 1; + 8000ae20: 0001e517 auipc a0,0x1e + 8000ae24: e6050513 addi a0,a0,-416 # 80028c80 + +000000008000ae28 <.LBB3_46>: + 8000ae28: 0001e617 auipc a2,0x1e + 8000ae2c: f1060613 addi a2,a2,-240 # 80028d38 <.L__unnamed_12> + 8000ae30: 45f1 li a1,28 + 8000ae32: 00018097 auipc ra,0x18 + 8000ae36: 312080e7 jalr 786(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000ae3c <.LBB3_47>: + i += 1; + 8000ae3c: 0001e517 auipc a0,0x1e + 8000ae40: e4450513 addi a0,a0,-444 # 80028c80 + +000000008000ae44 <.LBB3_48>: + 8000ae44: 0001e617 auipc a2,0x1e + 8000ae48: f0c60613 addi a2,a2,-244 # 80028d50 <.L__unnamed_13> + 8000ae4c: 45f1 li a1,28 + 8000ae4e: 00018097 auipc ra,0x18 + 8000ae52: 2f6080e7 jalr 758(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs4pipe4Pipe5close17h80469b7219759a66E: + +000000008000ae58 <_ZN6kernel2fs4pipe4Pipe5close17h80469b7219759a66E>: + + pub fn close(&mut self, writeable: bool) { + 8000ae58: 7139 addi sp,sp,-64 + 8000ae5a: fc06 sd ra,56(sp) + 8000ae5c: e02a sd a0,0(sp) + 8000ae5e: 862e mv a2,a1 + 8000ae60: e432 sd a2,8(sp) + 8000ae62: f02a sd a0,32(sp) + 8000ae64: 02b107a3 sb a1,47(sp) + let guard = self.pipe_lock.acquire(); + 8000ae68: 21850513 addi a0,a0,536 + 8000ae6c: 00006097 auipc ra,0x6 + 8000ae70: 1d6080e7 jalr 470(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000ae74: 85aa mv a1,a0 + 8000ae76: e82e sd a1,16(sp) + 8000ae78: f82a sd a0,48(sp) + 8000ae7a: a009 j 8000ae7c <_ZN6kernel2fs4pipe4Pipe5close17h80469b7219759a66E+0x24> + 8000ae7c: 6522 ld a0,8(sp) + 8000ae7e: 4581 li a1,0 + // let self = unsafe { &mut *self.self }; + if writeable { + 8000ae80: 02b50263 beq a0,a1,8000aea4 <.LBB4_17+0x12> + 8000ae84: a009 j 8000ae86 <_ZN6kernel2fs4pipe4Pipe5close17h80469b7219759a66E+0x2e> + 8000ae86: 6502 ld a0,0(sp) + 8000ae88: 4581 li a1,0 + self.write_open = false; + 8000ae8a: 20b508a3 sb a1,529(a0) + unsafe { + PROC_MANAGER.wake_up(&self.nread as *const _ as usize); + 8000ae8e: 20050593 addi a1,a0,512 + +000000008000ae92 <.LBB4_17>: + 8000ae92: 0004e517 auipc a0,0x4e + 8000ae96: 53e50513 addi a0,a0,1342 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000ae9a: 00003097 auipc ra,0x3 + 8000ae9e: 366080e7 jalr 870(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8000aea2: a005 j 8000aec2 <.LBB4_18+0x12> + 8000aea4: 6502 ld a0,0(sp) + 8000aea6: 4581 li a1,0 + } + } else { + self.read_open = false; + 8000aea8: 20b50823 sb a1,528(a0) + unsafe { + PROC_MANAGER.wake_up(&self.nwrite as *const _ as usize); + 8000aeac: 20850593 addi a1,a0,520 + +000000008000aeb0 <.LBB4_18>: + 8000aeb0: 0004e517 auipc a0,0x4e + 8000aeb4: 52050513 addi a0,a0,1312 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000aeb8: 00003097 auipc ra,0x3 + 8000aebc: 348080e7 jalr 840(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8000aec0: a011 j 8000aec4 <.LBB4_18+0x14> + if writeable { + 8000aec2: a011 j 8000aec6 <.LBB4_18+0x16> + 8000aec4: a009 j 8000aec6 <.LBB4_18+0x16> + } + } + + if !self.read_open && !self.write_open { + 8000aec6: 6502 ld a0,0(sp) + 8000aec8: 21054503 lbu a0,528(a0) + 8000aecc: 8905 andi a0,a0,1 + 8000aece: 4581 li a1,0 + 8000aed0: 00b50b63 beq a0,a1,8000aee6 <.LBB4_18+0x36> + 8000aed4: a029 j 8000aede <.LBB4_18+0x2e> + 8000aed6: 4505 li a0,1 + 8000aed8: 00a10fa3 sb a0,31(sp) + 8000aedc: a829 j 8000aef6 <.LBB4_18+0x46> + 8000aede: 4501 li a0,0 + 8000aee0: 00a10fa3 sb a0,31(sp) + 8000aee4: a809 j 8000aef6 <.LBB4_18+0x46> + 8000aee6: 6502 ld a0,0(sp) + 8000aee8: 21154503 lbu a0,529(a0) + 8000aeec: 8905 andi a0,a0,1 + 8000aeee: 4581 li a1,0 + 8000aef0: feb503e3 beq a0,a1,8000aed6 <.LBB4_18+0x26> + 8000aef4: b7ed j 8000aede <.LBB4_18+0x2e> + 8000aef6: 01f14503 lbu a0,31(sp) + 8000aefa: 8905 andi a0,a0,1 + 8000aefc: 4581 li a1,0 + 8000aefe: 00b50963 beq a0,a1,8000af10 <.LBB4_18+0x60> + 8000af02: a009 j 8000af04 <.LBB4_18+0x54> + drop(guard); + 8000af04: 6542 ld a0,16(sp) + 8000af06: 00013097 auipc ra,0x13 + 8000af0a: ee2080e7 jalr -286(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000af0e: a039 j 8000af1c <.LBB4_18+0x6c> + drop(self); + } else { + drop(guard); + 8000af10: 6542 ld a0,16(sp) + 8000af12: 00013097 auipc ra,0x13 + 8000af16: ed6080e7 jalr -298(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000af1a: a801 j 8000af2a <.LBB4_18+0x7a> + drop(self); + 8000af1c: 6502 ld a0,0(sp) + 8000af1e: 00013097 auipc ra,0x13 + 8000af22: f36080e7 jalr -202(ra) # 8001de54 <_ZN4core3mem4drop17h40ca24bdf6be713fE> + 8000af26: a009 j 8000af28 <.LBB4_18+0x78> + if !self.read_open && !self.write_open { + 8000af28: a011 j 8000af2c <.LBB4_18+0x7c> + 8000af2a: a009 j 8000af2c <.LBB4_18+0x7c> + } + } + 8000af2c: 70e2 ld ra,56(sp) + 8000af2e: 6121 addi sp,sp,64 + 8000af30: 8082 ret + +Disassembly of section .text.kvm_init: + +000000008000af32 : + fn trampoline(); +} + +/// Initialize the one kernel_pagetable +#[no_mangle] +pub unsafe fn kvm_init(){ + 8000af32: 7175 addi sp,sp,-144 + // check if RawPage and PageTable have the same memory layout + assert_eq!(size_of::(), PGSIZE); + 8000af34: e506 sd ra,136(sp) + +000000008000af36 <.LBB0_2>: + 8000af36: 0001d517 auipc a0,0x1d + 8000af3a: 94a50513 addi a0,a0,-1718 # 80027880 <.L__unnamed_6+0xf0> + 8000af3e: e02a sd a0,0(sp) + 8000af40: e42a sd a0,8(sp) + 8000af42: e82a sd a0,16(sp) + 8000af44: e4aa sd a0,72(sp) + 8000af46: e8aa sd a0,80(sp) + assert_eq!(align_of::(), PGSIZE); + 8000af48: ec2a sd a0,24(sp) + 8000af4a: f02a sd a0,32(sp) + 8000af4c: ecaa sd a0,88(sp) + 8000af4e: f0aa sd a0,96(sp) + assert_eq!(size_of::(), size_of::()); + 8000af50: f42a sd a0,40(sp) + 8000af52: f82a sd a0,48(sp) + 8000af54: f4aa sd a0,104(sp) + 8000af56: f8aa sd a0,112(sp) + assert_eq!(align_of::(), align_of::()); + 8000af58: fc2a sd a0,56(sp) + 8000af5a: e0aa sd a0,64(sp) + 8000af5c: fcaa sd a0,120(sp) + 8000af5e: e12a sd a0,128(sp) + + kernel_map(); + 8000af60: 00000097 auipc ra,0x0 + 8000af64: 044080e7 jalr 68(ra) # 8000afa4 <_ZN6kernel6memory7mapping10kernel_map10kernel_map17hdb0b29a584d860dbE> + 8000af68: a009 j 8000af6a <.LBB0_2+0x34> +} + 8000af6a: 60aa ld ra,136(sp) + 8000af6c: 6149 addi sp,sp,144 + 8000af6e: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10kernel_map13kvm_init_hart17hca08c717b940e5bcE: + +000000008000af70 <_ZN6kernel6memory7mapping10kernel_map13kvm_init_hart17hca08c717b940e5bcE>: + +/// Switch h/w page table register to the kernel's page table, +/// and enable paging. +pub unsafe fn kvm_init_hart() { + 8000af70: 1141 addi sp,sp,-16 + satp::write(KERNEL_PAGETABLE.as_satp()); + 8000af72: e406 sd ra,8(sp) + +000000008000af74 <.LBB1_4>: + 8000af74: 0005a517 auipc a0,0x5a + 8000af78: 08c50513 addi a0,a0,140 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000af7c: 0000d097 auipc ra,0xd + 8000af80: bbc080e7 jalr -1092(ra) # 80017b38 <_ZN6kernel6memory7mapping10page_table9PageTable7as_satp17h97121d8f678f163eE> + 8000af84: e02a sd a0,0(sp) + 8000af86: a009 j 8000af88 <.LBB1_4+0x14> + 8000af88: 6502 ld a0,0(sp) + 8000af8a: 00014097 auipc ra,0x14 + 8000af8e: 616080e7 jalr 1558(ra) # 8001f5a0 <_ZN6kernel4arch5riscv8register4satp5write17h136481b47a553b1cE> + 8000af92: a009 j 8000af94 <.LBB1_4+0x20> + sfence_vma(); + 8000af94: 0000e097 auipc ra,0xe + 8000af98: 31a080e7 jalr 794(ra) # 800192ae <_ZN6kernel4arch5riscv8register10sfence_vma17h7533c6c75a9febaaE> + 8000af9c: a009 j 8000af9e <.LBB1_4+0x2a> +} + 8000af9e: 60a2 ld ra,8(sp) + 8000afa0: 0141 addi sp,sp,16 + 8000afa2: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10kernel_map10kernel_map17hdb0b29a584d860dbE: + +000000008000afa4 <_ZN6kernel6memory7mapping10kernel_map10kernel_map17hdb0b29a584d860dbE>: + + +/// Make a direct-map page table for the kernel. +unsafe fn kernel_map() { + 8000afa4: 7129 addi sp,sp,-320 + println!("kernel page map"); + 8000afa6: fe06 sd ra,312(sp) + +000000008000afa8 <.LBB2_48>: + 8000afa8: 0001e597 auipc a1,0x1e + 8000afac: dc058593 addi a1,a1,-576 # 80028d68 <.L__unnamed_2> + +000000008000afb0 <.LBB2_49>: + 8000afb0: 0001e697 auipc a3,0x1e + 8000afb4: dc868693 addi a3,a3,-568 # 80028d78 <.L__unnamed_4> + 8000afb8: 0228 addi a0,sp,264 + 8000afba: 4605 li a2,1 + 8000afbc: 4701 li a4,0 + 8000afbe: ffffa097 auipc ra,0xffffa + 8000afc2: 5cc080e7 jalr 1484(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000afc6: a009 j 8000afc8 <.LBB2_49+0x18> + 8000afc8: 0228 addi a0,sp,264 + 8000afca: 00014097 auipc ra,0x14 + 8000afce: c2e080e7 jalr -978(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000afd2: a009 j 8000afd4 <.LBB2_49+0x24> + 8000afd4: 00100537 lui a0,0x100 + // map VIRT_TEST for shutdown or reboot + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(VIRT_TEST), + 8000afd8: 00007097 auipc ra,0x7 + 8000afdc: f6e080e7 jalr -146(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000afe0: e22a sd a0,256(sp) + 8000afe2: a009 j 8000afe4 <.LBB2_49+0x34> + 8000afe4: 00100537 lui a0,0x100 + PhysicalAddress::new(VIRT_TEST), + 8000afe8: 00007097 auipc ra,0x7 + 8000afec: 00e080e7 jalr 14(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000aff0: fdaa sd a0,248(sp) + 8000aff2: a009 j 8000aff4 <.LBB2_49+0x44> + 8000aff4: 4509 li a0,2 + 8000aff6: 4591 li a1,4 + PGSIZE, + PteFlags::R | PteFlags::W + 8000aff8: ffffe097 auipc ra,0xffffe + 8000affc: 080080e7 jalr 128(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b000: f9aa sd a0,240(sp) + 8000b002: a009 j 8000b004 <.LBB2_49+0x54> + KERNEL_PAGETABLE.kernel_map( + 8000b004: 774e ld a4,240(sp) + 8000b006: 766e ld a2,248(sp) + 8000b008: 6592 ld a1,256(sp) + +000000008000b00a <.LBB2_50>: + 8000b00a: 0005a517 auipc a0,0x5a + 8000b00e: ff650513 addi a0,a0,-10 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b012: 6685 lui a3,0x1 + 8000b014: 0000d097 auipc ra,0xd + 8000b018: 1c4080e7 jalr 452(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b01c: a009 j 8000b01e <.LBB2_50+0x14> + 8000b01e: 10000537 lui a0,0x10000 + ); + + // uart registers + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(UART0), + 8000b022: 00007097 auipc ra,0x7 + 8000b026: f24080e7 jalr -220(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b02a: f5aa sd a0,232(sp) + 8000b02c: a009 j 8000b02e <.LBB2_50+0x24> + 8000b02e: 10000537 lui a0,0x10000 + PhysicalAddress::new(UART0), + 8000b032: 00007097 auipc ra,0x7 + 8000b036: fc4080e7 jalr -60(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b03a: f1aa sd a0,224(sp) + 8000b03c: a009 j 8000b03e <.LBB2_50+0x34> + 8000b03e: 4509 li a0,2 + 8000b040: 4591 li a1,4 + PGSIZE, + PteFlags::R | PteFlags::W, + 8000b042: ffffe097 auipc ra,0xffffe + 8000b046: 036080e7 jalr 54(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b04a: edaa sd a0,216(sp) + 8000b04c: a009 j 8000b04e <.LBB2_50+0x44> + KERNEL_PAGETABLE.kernel_map( + 8000b04e: 676e ld a4,216(sp) + 8000b050: 760e ld a2,224(sp) + 8000b052: 75ae ld a1,232(sp) + +000000008000b054 <.LBB2_51>: + 8000b054: 0005a517 auipc a0,0x5a + 8000b058: fac50513 addi a0,a0,-84 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b05c: 6685 lui a3,0x1 + 8000b05e: 0000d097 auipc ra,0xd + 8000b062: 17a080e7 jalr 378(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b066: a009 j 8000b068 <.LBB2_51+0x14> + 8000b068: 10001537 lui a0,0x10001 + ); + // virtio mmio disk interface + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(VIRTIO0), + 8000b06c: 00007097 auipc ra,0x7 + 8000b070: eda080e7 jalr -294(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b074: e9aa sd a0,208(sp) + 8000b076: a009 j 8000b078 <.LBB2_51+0x24> + 8000b078: 10001537 lui a0,0x10001 + PhysicalAddress::new(VIRTIO0), + 8000b07c: 00007097 auipc ra,0x7 + 8000b080: f7a080e7 jalr -134(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b084: e5aa sd a0,200(sp) + 8000b086: a009 j 8000b088 <.LBB2_51+0x34> + 8000b088: 4509 li a0,2 + 8000b08a: 4591 li a1,4 + PGSIZE, + PteFlags::R | PteFlags::W + 8000b08c: ffffe097 auipc ra,0xffffe + 8000b090: fec080e7 jalr -20(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b094: e1aa sd a0,192(sp) + 8000b096: a009 j 8000b098 <.LBB2_51+0x44> + KERNEL_PAGETABLE.kernel_map( + 8000b098: 670e ld a4,192(sp) + 8000b09a: 662e ld a2,200(sp) + 8000b09c: 65ce ld a1,208(sp) + +000000008000b09e <.LBB2_52>: + 8000b09e: 0005a517 auipc a0,0x5a + 8000b0a2: f6250513 addi a0,a0,-158 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b0a6: 6685 lui a3,0x1 + 8000b0a8: 0000d097 auipc ra,0xd + 8000b0ac: 130080e7 jalr 304(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b0b0: a009 j 8000b0b2 <.LBB2_52+0x14> + 8000b0b2: 30000537 lui a0,0x30000 + ); + + // PCI-E ECAM (configuration space), for pci.rs + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(ECAM), + 8000b0b6: 00007097 auipc ra,0x7 + 8000b0ba: e90080e7 jalr -368(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b0be: fd2a sd a0,184(sp) + 8000b0c0: a009 j 8000b0c2 <.LBB2_52+0x24> + 8000b0c2: 30000537 lui a0,0x30000 + PhysicalAddress::new(ECAM), + 8000b0c6: 00007097 auipc ra,0x7 + 8000b0ca: f30080e7 jalr -208(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b0ce: f92a sd a0,176(sp) + 8000b0d0: a009 j 8000b0d2 <.LBB2_52+0x34> + 8000b0d2: 4509 li a0,2 + 8000b0d4: 4591 li a1,4 + 0x10000000, + PteFlags::R | PteFlags::W + 8000b0d6: ffffe097 auipc ra,0xffffe + 8000b0da: fa2080e7 jalr -94(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b0de: f52a sd a0,168(sp) + 8000b0e0: a009 j 8000b0e2 <.LBB2_52+0x44> + KERNEL_PAGETABLE.kernel_map( + 8000b0e2: 772a ld a4,168(sp) + 8000b0e4: 764a ld a2,176(sp) + 8000b0e6: 75ea ld a1,184(sp) + +000000008000b0e8 <.LBB2_53>: + 8000b0e8: 0005a517 auipc a0,0x5a + 8000b0ec: f1850513 addi a0,a0,-232 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b0f0: 100006b7 lui a3,0x10000 + 8000b0f4: 0000d097 auipc ra,0xd + 8000b0f8: 0e4080e7 jalr 228(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b0fc: a009 j 8000b0fe <.LBB2_53+0x16> + 8000b0fe: 40000537 lui a0,0x40000 + ); + + // pci maps the e1000's registers here. + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(E1000_REGS), + 8000b102: 00007097 auipc ra,0x7 + 8000b106: e44080e7 jalr -444(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b10a: f12a sd a0,160(sp) + 8000b10c: a009 j 8000b10e <.LBB2_53+0x26> + 8000b10e: 40000537 lui a0,0x40000 + PhysicalAddress::new(E1000_REGS), + 8000b112: 00007097 auipc ra,0x7 + 8000b116: ee4080e7 jalr -284(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b11a: ed2a sd a0,152(sp) + 8000b11c: a009 j 8000b11e <.LBB2_53+0x36> + 8000b11e: 4509 li a0,2 + 8000b120: 4591 li a1,4 + 0x20000, + PteFlags::R | PteFlags::W + 8000b122: ffffe097 auipc ra,0xffffe + 8000b126: f56080e7 jalr -170(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b12a: e92a sd a0,144(sp) + 8000b12c: a009 j 8000b12e <.LBB2_53+0x46> + KERNEL_PAGETABLE.kernel_map( + 8000b12e: 674a ld a4,144(sp) + 8000b130: 666a ld a2,152(sp) + 8000b132: 758a ld a1,160(sp) + +000000008000b134 <.LBB2_54>: + 8000b134: 0005a517 auipc a0,0x5a + 8000b138: ecc50513 addi a0,a0,-308 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b13c: 000206b7 lui a3,0x20 + 8000b140: 0000d097 auipc ra,0xd + 8000b144: 098080e7 jalr 152(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b148: a009 j 8000b14a <.LBB2_54+0x16> + 8000b14a: 02000537 lui a0,0x2000 + ); + + // CLINT + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(CLINT), + 8000b14e: 00007097 auipc ra,0x7 + 8000b152: df8080e7 jalr -520(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b156: e52a sd a0,136(sp) + 8000b158: a009 j 8000b15a <.LBB2_54+0x26> + 8000b15a: 02000537 lui a0,0x2000 + PhysicalAddress::new(CLINT), + 8000b15e: 00007097 auipc ra,0x7 + 8000b162: e98080e7 jalr -360(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b166: e12a sd a0,128(sp) + 8000b168: a009 j 8000b16a <.LBB2_54+0x36> + 8000b16a: 4509 li a0,2 + 8000b16c: 4591 li a1,4 + 0x10000, + PteFlags::R | PteFlags::W + 8000b16e: ffffe097 auipc ra,0xffffe + 8000b172: f0a080e7 jalr -246(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b176: fcaa sd a0,120(sp) + 8000b178: a009 j 8000b17a <.LBB2_54+0x46> + KERNEL_PAGETABLE.kernel_map( + 8000b17a: 7766 ld a4,120(sp) + 8000b17c: 660a ld a2,128(sp) + 8000b17e: 65aa ld a1,136(sp) + +000000008000b180 <.LBB2_55>: + 8000b180: 0005a517 auipc a0,0x5a + 8000b184: e8050513 addi a0,a0,-384 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b188: 66c1 lui a3,0x10 + 8000b18a: 0000d097 auipc ra,0xd + 8000b18e: 04e080e7 jalr 78(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b192: a009 j 8000b194 <.LBB2_55+0x14> + 8000b194: 0c000537 lui a0,0xc000 + ); + + // PLIC + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(PLIC_BASE), + 8000b198: 00007097 auipc ra,0x7 + 8000b19c: dae080e7 jalr -594(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b1a0: f8aa sd a0,112(sp) + 8000b1a2: a009 j 8000b1a4 <.LBB2_55+0x24> + 8000b1a4: 0c000537 lui a0,0xc000 + PhysicalAddress::new(PLIC_BASE), + 8000b1a8: 00007097 auipc ra,0x7 + 8000b1ac: e4e080e7 jalr -434(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b1b0: f4aa sd a0,104(sp) + 8000b1b2: a009 j 8000b1b4 <.LBB2_55+0x34> + 8000b1b4: 4509 li a0,2 + 8000b1b6: 4591 li a1,4 + 0x400000, + PteFlags::R | PteFlags::W + 8000b1b8: ffffe097 auipc ra,0xffffe + 8000b1bc: ec0080e7 jalr -320(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b1c0: f0aa sd a0,96(sp) + 8000b1c2: a009 j 8000b1c4 <.LBB2_55+0x44> + KERNEL_PAGETABLE.kernel_map( + 8000b1c4: 7706 ld a4,96(sp) + 8000b1c6: 7626 ld a2,104(sp) + 8000b1c8: 75c6 ld a1,112(sp) + +000000008000b1ca <.LBB2_56>: + 8000b1ca: 0005a517 auipc a0,0x5a + 8000b1ce: e3650513 addi a0,a0,-458 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b1d2: 004006b7 lui a3,0x400 + 8000b1d6: 0000d097 auipc ra,0xd + 8000b1da: 002080e7 jalr 2(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b1de: a009 j 8000b1e0 <.LBB2_56+0x16> + 8000b1e0: 4505 li a0,1 + 8000b1e2: 057e slli a0,a0,0x1f + ); + + // map kernel text exectuable and read-only + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(KERNEL_BASE), + 8000b1e4: 00007097 auipc ra,0x7 + 8000b1e8: d62080e7 jalr -670(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b1ec: ecaa sd a0,88(sp) + 8000b1ee: a009 j 8000b1f0 <.LBB2_56+0x26> + 8000b1f0: 4505 li a0,1 + 8000b1f2: 057e slli a0,a0,0x1f + PhysicalAddress::new(KERNEL_BASE), + 8000b1f4: 00007097 auipc ra,0x7 + 8000b1f8: e02080e7 jalr -510(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b1fc: e8aa sd a0,80(sp) + 8000b1fe: a009 j 8000b200 <.LBB2_57> + +000000008000b200 <.LBB2_57>: + etext as usize - KERNEL_BASE, + 8000b200: 00025517 auipc a0,0x25 + 8000b204: e0050513 addi a0,a0,-512 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8000b208: 800005b7 lui a1,0x80000 + 8000b20c: 95aa add a1,a1,a0 + 8000b20e: e4ae sd a1,72(sp) + 8000b210: 10b56263 bltu a0,a1,8000b314 <.LBB2_66> + 8000b214: a009 j 8000b216 <.LBB2_57+0x16> + 8000b216: 4509 li a0,2 + 8000b218: 45a1 li a1,8 + PteFlags::R | PteFlags::X + 8000b21a: ffffe097 auipc ra,0xffffe + 8000b21e: e5e080e7 jalr -418(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b222: e0aa sd a0,64(sp) + 8000b224: a009 j 8000b226 <.LBB2_57+0x26> + KERNEL_PAGETABLE.kernel_map( + 8000b226: 6706 ld a4,64(sp) + 8000b228: 66a6 ld a3,72(sp) + 8000b22a: 6646 ld a2,80(sp) + 8000b22c: 65e6 ld a1,88(sp) + +000000008000b22e <.LBB2_58>: + 8000b22e: 0005a517 auipc a0,0x5a + 8000b232: dd250513 addi a0,a0,-558 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b236: 0000d097 auipc ra,0xd + 8000b23a: fa2080e7 jalr -94(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b23e: a009 j 8000b240 <.LBB2_59> + +000000008000b240 <.LBB2_59>: + ); + + // map kernel data and the physical RAM we'll make use of + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(etext as usize), + 8000b240: 00025517 auipc a0,0x25 + 8000b244: dc050513 addi a0,a0,-576 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8000b248: 00007097 auipc ra,0x7 + 8000b24c: cfe080e7 jalr -770(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b250: fc2a sd a0,56(sp) + 8000b252: a009 j 8000b254 <.LBB2_60> + +000000008000b254 <.LBB2_60>: + PhysicalAddress::new(etext as usize), + 8000b254: 00025517 auipc a0,0x25 + 8000b258: dac50513 addi a0,a0,-596 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8000b25c: 00007097 auipc ra,0x7 + 8000b260: d9a080e7 jalr -614(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b264: f82a sd a0,48(sp) + 8000b266: a009 j 8000b268 <.LBB2_61> + +000000008000b268 <.LBB2_61>: + PHYSTOP - etext as usize, + 8000b268: 00025597 auipc a1,0x25 + 8000b26c: d9858593 addi a1,a1,-616 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8000b270: 4545 li a0,17 + 8000b272: 056e slli a0,a0,0x1b + 8000b274: 40b505b3 sub a1,a0,a1 + 8000b278: f42e sd a1,40(sp) + 8000b27a: 0ab56c63 bltu a0,a1,8000b332 <.LBB2_68> + 8000b27e: a009 j 8000b280 <.LBB2_61+0x18> + 8000b280: 4509 li a0,2 + 8000b282: 4591 li a1,4 + PteFlags::R | PteFlags::W + 8000b284: ffffe097 auipc ra,0xffffe + 8000b288: df4080e7 jalr -524(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b28c: f02a sd a0,32(sp) + 8000b28e: a009 j 8000b290 <.LBB2_61+0x28> + KERNEL_PAGETABLE.kernel_map( + 8000b290: 7702 ld a4,32(sp) + 8000b292: 76a2 ld a3,40(sp) + 8000b294: 7642 ld a2,48(sp) + 8000b296: 75e2 ld a1,56(sp) + +000000008000b298 <.LBB2_62>: + 8000b298: 0005a517 auipc a0,0x5a + 8000b29c: d6850513 addi a0,a0,-664 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b2a0: 0000d097 auipc ra,0xd + 8000b2a4: f38080e7 jalr -200(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b2a8: a009 j 8000b2aa <.LBB2_62+0x12> + 8000b2aa: 04000537 lui a0,0x4000 + 8000b2ae: 357d addiw a0,a0,-1 + 8000b2b0: 0532 slli a0,a0,0xc + ); + + // map the trampoline for trap entry/exit + // the highest virtual address in the kernel + KERNEL_PAGETABLE.kernel_map( + VirtualAddress::new(TRAMPOLINE), + 8000b2b2: 00007097 auipc ra,0x7 + 8000b2b6: c94080e7 jalr -876(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000b2ba: ec2a sd a0,24(sp) + 8000b2bc: a009 j 8000b2be <.LBB2_63> + +000000008000b2be <.LBB2_63>: + PhysicalAddress::new(trampoline as usize), + 8000b2be: ffff6517 auipc a0,0xffff6 + 8000b2c2: d4250513 addi a0,a0,-702 # 80001000 + 8000b2c6: 00007097 auipc ra,0x7 + 8000b2ca: d30080e7 jalr -720(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000b2ce: e82a sd a0,16(sp) + 8000b2d0: a009 j 8000b2d2 <.LBB2_63+0x14> + 8000b2d2: 4509 li a0,2 + 8000b2d4: 45a1 li a1,8 + PGSIZE, + PteFlags::R | PteFlags::X + 8000b2d6: ffffe097 auipc ra,0xffffe + 8000b2da: da2080e7 jalr -606(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000b2de: e42a sd a0,8(sp) + 8000b2e0: a009 j 8000b2e2 <.LBB2_63+0x24> + KERNEL_PAGETABLE.kernel_map( + 8000b2e2: 6722 ld a4,8(sp) + 8000b2e4: 6642 ld a2,16(sp) + 8000b2e6: 65e2 ld a1,24(sp) + +000000008000b2e8 <.LBB2_64>: + 8000b2e8: 0005a517 auipc a0,0x5a + 8000b2ec: d1850513 addi a0,a0,-744 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000b2f0: 6685 lui a3,0x1 + 8000b2f2: 0000d097 auipc ra,0xd + 8000b2f6: ee6080e7 jalr -282(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000b2fa: a009 j 8000b2fc <.LBB2_65> + +000000008000b2fc <.LBB2_65>: + ); + + // 映射不同进程的内核栈 + PROC_MANAGER.proc_mapstacks(); + 8000b2fc: 0004e517 auipc a0,0x4e + 8000b300: 0d450513 addi a0,a0,212 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000b304: 00003097 auipc ra,0x3 + 8000b308: 9b4080e7 jalr -1612(ra) # 8000dcb8 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E> + 8000b30c: a009 j 8000b30e <.LBB2_65+0x12> +} + 8000b30e: 70f2 ld ra,312(sp) + 8000b310: 6131 addi sp,sp,320 + 8000b312: 8082 ret + +000000008000b314 <.LBB2_66>: + etext as usize - KERNEL_BASE, + 8000b314: 0001e517 auipc a0,0x1e + 8000b318: a7c50513 addi a0,a0,-1412 # 80028d90 + +000000008000b31c <.LBB2_67>: + 8000b31c: 0001e617 auipc a2,0x1e + 8000b320: a5c60613 addi a2,a2,-1444 # 80028d78 <.L__unnamed_4> + 8000b324: 02100593 li a1,33 + 8000b328: 00018097 auipc ra,0x18 + 8000b32c: e1c080e7 jalr -484(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000b332 <.LBB2_68>: + PHYSTOP - etext as usize, + 8000b332: 0001e517 auipc a0,0x1e + 8000b336: a5e50513 addi a0,a0,-1442 # 80028d90 + +000000008000b33a <.LBB2_69>: + 8000b33a: 0001e617 auipc a2,0x1e + 8000b33e: a7e60613 addi a2,a2,-1410 # 80028db8 <.L__unnamed_5> + 8000b342: 02100593 li a1,33 + 8000b346: 00018097 auipc ra,0x18 + 8000b34a: dfe080e7 jalr -514(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN11array_macro19__Capacity$LT$_$GT$3get17hecfc1cf2bb733562E: + +000000008000b350 <_ZN11array_macro19__Capacity$LT$_$GT$3get17hecfc1cf2bb733562E>: + +#[doc(hidden)] +pub struct __Capacity; + +impl __Capacity { + pub const fn get(&self) -> usize { + 8000b350: 1141 addi sp,sp,-16 + 8000b352: e42a sd a0,8(sp) + 8000b354: 06400513 li a0,100 + N + } + 8000b358: 0141 addi sp,sp,16 + 8000b35a: 8082 ret + +Disassembly of section .text._ZN11array_macro28__ArrayVecInner$LT$T$C$_$GT$3new17h8c73fc7516a84ce9E: + +000000008000b35c <_ZN11array_macro28__ArrayVecInner$LT$T$C$_$GT$3new17h8c73fc7516a84ce9E>: + pub const unsafe fn new(arr: [MaybeUninit; N]) -> Self { + 8000b35c: cc010113 addi sp,sp,-832 + arr, + 8000b360: 32113c23 sd ra,824(sp) + 8000b364: e82a sd a0,16(sp) + 8000b366: 0828 addi a0,sp,24 + 8000b368: e02a sd a0,0(sp) + 8000b36a: 32000613 li a2,800 + 8000b36e: e432 sd a2,8(sp) + 8000b370: 0001b097 auipc ra,0x1b + 8000b374: d12080e7 jalr -750(ra) # 80026082 + 8000b378: 6582 ld a1,0(sp) + 8000b37a: 6622 ld a2,8(sp) + Self { + 8000b37c: 6542 ld a0,16(sp) + 8000b37e: 0001b097 auipc ra,0x1b + 8000b382: d04080e7 jalr -764(ra) # 80026082 + 8000b386: 65c2 ld a1,16(sp) + 8000b388: 4501 li a0,0 + 8000b38a: 32a5b023 sd a0,800(a1) + } + 8000b38e: 33813083 ld ra,824(sp) + 8000b392: 34010113 addi sp,sp,832 + 8000b396: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E: + +000000008000b398 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E>: + /// [`reduce()`]: Iterator::reduce + #[doc(alias = "reduce")] + #[doc(alias = "inject")] + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + fn fold(mut self, init: B, mut f: F) -> B + 8000b398: 715d addi sp,sp,-80 + 8000b39a: e486 sd ra,72(sp) + 8000b39c: e42a sd a0,8(sp) + 8000b39e: e82e sd a1,16(sp) + 8000b3a0: ec32 sd a2,24(sp) + where + Self: Sized, + F: FnMut(B, Self::Item) -> B, + { + let mut accum = init; + while let Some(x) = self.next() { + 8000b3a2: a009 j 8000b3a4 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0xc> + 8000b3a4: 0028 addi a0,sp,8 + 8000b3a6: 00001097 auipc ra,0x1 + 8000b3aa: 81a080e7 jalr -2022(ra) # 8000bbc0 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE> + 8000b3ae: f42a sd a0,40(sp) + 8000b3b0: a009 j 8000b3b2 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0x1a> + 8000b3b2: 7522 ld a0,40(sp) + 8000b3b4: 4581 li a1,0 + 8000b3b6: 00b51463 bne a0,a1,8000b3be <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0x26> + 8000b3ba: a009 j 8000b3bc <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0x24> + accum = f(accum, x); + } + 8000b3bc: a819 j 8000b3d2 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0x3a> + while let Some(x) = self.next() { + 8000b3be: 75a2 ld a1,40(sp) + 8000b3c0: e0ae sd a1,64(sp) + accum = f(accum, x); + 8000b3c2: f82e sd a1,48(sp) + 8000b3c4: 0828 addi a0,sp,24 + 8000b3c6: 00007097 auipc ra,0x7 + 8000b3ca: 662080e7 jalr 1634(ra) # 80012a28 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate28_$u7b$$u7b$closure$u7d$$u7d$17hd0c93bb900581135E> + 8000b3ce: a009 j 8000b3d0 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0x38> + while let Some(x) = self.next() { + 8000b3d0: bfd1 j 8000b3a4 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0xc> + accum + } + 8000b3d2: a009 j 8000b3d4 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0x3c> + 8000b3d4: a009 j 8000b3d6 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E+0x3e> + 8000b3d6: 60a6 ld ra,72(sp) + 8000b3d8: 6161 addi sp,sp,80 + 8000b3da: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator6copied17hc4f54d9039c4545bE: + +000000008000b3dc <_ZN4core4iter6traits8iterator8Iterator6copied17hc4f54d9039c4545bE>: + /// + /// assert_eq!(v_copied, vec![1, 2, 3]); + /// assert_eq!(v_map, vec![1, 2, 3]); + /// ``` + #[stable(feature = "iter_copied", since = "1.36.0")] + fn copied<'a, T: 'a>(self) -> Copied + 8000b3dc: 7179 addi sp,sp,-48 + 8000b3de: f406 sd ra,40(sp) + 8000b3e0: ec2a sd a0,24(sp) + 8000b3e2: f02e sd a1,32(sp) + where + Self: Sized + Iterator, + T: Copy, + { + Copied::new(self) + 8000b3e4: ffff9097 auipc ra,0xffff9 + 8000b3e8: 760080e7 jalr 1888(ra) # 80004b44 <_ZN4core4iter8adapters6copied15Copied$LT$I$GT$3new17h07d9127b76ff3571E> + 8000b3ec: e42a sd a0,8(sp) + 8000b3ee: e82e sd a1,16(sp) + 8000b3f0: a009 j 8000b3f2 <_ZN4core4iter6traits8iterator8Iterator6copied17hc4f54d9039c4545bE+0x16> + } + 8000b3f2: 65c2 ld a1,16(sp) + 8000b3f4: 6522 ld a0,8(sp) + 8000b3f6: 70a2 ld ra,40(sp) + 8000b3f8: 6145 addi sp,sp,48 + 8000b3fa: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator9enumerate17h42a569d91d49dc41E: + +000000008000b3fc <_ZN4core4iter6traits8iterator8Iterator9enumerate17h42a569d91d49dc41E>: + fn enumerate(self) -> Enumerate + 8000b3fc: 1101 addi sp,sp,-32 + 8000b3fe: ec06 sd ra,24(sp) + 8000b400: e42e sd a1,8(sp) + 8000b402: e832 sd a2,16(sp) + Enumerate::new(self) + 8000b404: 00007097 auipc ra,0x7 + 8000b408: 766080e7 jalr 1894(ra) # 80012b6a <_ZN4core4iter8adapters9enumerate18Enumerate$LT$I$GT$3new17h6d37c7662d298f80E> + 8000b40c: a009 j 8000b40e <_ZN4core4iter6traits8iterator8Iterator9enumerate17h42a569d91d49dc41E+0x12> + } + 8000b40e: 60e2 ld ra,24(sp) + 8000b410: 6105 addi sp,sp,32 + 8000b412: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator9enumerate17hc3c1c2808e21f1bfE: + +000000008000b414 <_ZN4core4iter6traits8iterator8Iterator9enumerate17hc3c1c2808e21f1bfE>: + fn enumerate(self) -> Enumerate + 8000b414: 1101 addi sp,sp,-32 + 8000b416: ec06 sd ra,24(sp) + 8000b418: e42e sd a1,8(sp) + 8000b41a: e832 sd a2,16(sp) + Enumerate::new(self) + 8000b41c: 00007097 auipc ra,0x7 + 8000b420: 736080e7 jalr 1846(ra) # 80012b52 <_ZN4core4iter8adapters9enumerate18Enumerate$LT$I$GT$3new17h24261d7743f82d90E> + 8000b424: a009 j 8000b426 <_ZN4core4iter6traits8iterator8Iterator9enumerate17hc3c1c2808e21f1bfE+0x12> + } + 8000b426: 60e2 ld ra,24(sp) + 8000b428: 6105 addi sp,sp,32 + 8000b42a: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE: + +000000008000b42c <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE>: +#[stable(feature = "rust1", since = "1.0.0")] +unsafe impl Send for Iter<'_, T> {} + +impl<'a, T> Iter<'a, T> { + #[inline] + pub(super) fn new(slice: &'a [T]) -> Self { + 8000b42c: 7159 addi sp,sp,-112 + 8000b42e: f486 sd ra,104(sp) + 8000b430: f02e sd a1,32(sp) + 8000b432: f42a sd a0,40(sp) + 8000b434: e8aa sd a0,80(sp) + 8000b436: ecae sd a1,88(sp) + let ptr = slice.as_ptr(); + 8000b438: 00015097 auipc ra,0x15 + 8000b43c: 0c6080e7 jalr 198(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 8000b440: 85aa mv a1,a0 + 8000b442: f82e sd a1,48(sp) + 8000b444: f0aa sd a0,96(sp) + 8000b446: a009 j 8000b448 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x1c> + // SAFETY: Similar to `IterMut::new`. + unsafe { + assume(!ptr.is_null()); + 8000b448: 7542 ld a0,48(sp) + 8000b44a: 00015097 auipc ra,0x15 + 8000b44e: 2d4080e7 jalr 724(ra) # 8002071e <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h309eb733b6984dd5E> + 8000b452: a009 j 8000b454 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x28> + 8000b454: a009 j 8000b456 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x2a> + + let end = if mem::size_of::() == 0 { + 8000b456: a009 j 8000b458 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x2c> + 8000b458: 4505 li a0,1 + 8000b45a: e911 bnez a0,8000b46e <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x42> + 8000b45c: a009 j 8000b45e <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x32> + (ptr as *const u8).wrapping_add(slice.len()) as *const T + 8000b45e: 7582 ld a1,32(sp) + 8000b460: 7522 ld a0,40(sp) + 8000b462: 00015097 auipc ra,0x15 + 8000b466: 040080e7 jalr 64(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 8000b46a: ec2a sd a0,24(sp) + 8000b46c: a809 j 8000b47e <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x52> + } else { + ptr.add(slice.len()) + 8000b46e: 7582 ld a1,32(sp) + 8000b470: 7522 ld a0,40(sp) + 8000b472: 00015097 auipc ra,0x15 + 8000b476: 030080e7 jalr 48(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 8000b47a: e82a sd a0,16(sp) + 8000b47c: a821 j 8000b494 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x68> + (ptr as *const u8).wrapping_add(slice.len()) as *const T + 8000b47e: 65e2 ld a1,24(sp) + 8000b480: 7542 ld a0,48(sp) + 8000b482: ffff9097 auipc ra,0xffff9 + 8000b486: 420080e7 jalr 1056(ra) # 800048a2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$12wrapping_add17h10470fd1e83789bbE> + 8000b48a: e42a sd a0,8(sp) + 8000b48c: a009 j 8000b48e <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x62> + 8000b48e: 6522 ld a0,8(sp) + 8000b490: e4aa sd a0,72(sp) + let end = if mem::size_of::() == 0 { + 8000b492: a811 j 8000b4a6 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x7a> + ptr.add(slice.len()) + 8000b494: 65c2 ld a1,16(sp) + 8000b496: 7542 ld a0,48(sp) + 8000b498: 00015097 auipc ra,0x15 + 8000b49c: 224080e7 jalr 548(ra) # 800206bc <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17h3ef2f165a29b2365E> + 8000b4a0: e4aa sd a0,72(sp) + 8000b4a2: a009 j 8000b4a4 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x78> + let end = if mem::size_of::() == 0 { + 8000b4a4: a009 j 8000b4a6 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x7a> + }; + + Self { ptr: NonNull::new_unchecked(ptr as *mut T), end, _marker: PhantomData } + 8000b4a6: 7542 ld a0,48(sp) + 8000b4a8: 00004097 auipc ra,0x4 + 8000b4ac: 788080e7 jalr 1928(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8000b4b0: e02a sd a0,0(sp) + 8000b4b2: a009 j 8000b4b4 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE+0x88> + 8000b4b4: 6502 ld a0,0(sp) + 8000b4b6: 65a6 ld a1,72(sp) + 8000b4b8: fc2a sd a0,56(sp) + 8000b4ba: e0ae sd a1,64(sp) + } + } + 8000b4bc: 70a6 ld ra,104(sp) + 8000b4be: 6165 addi sp,sp,112 + 8000b4c0: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE: + +000000008000b4c2 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE>: + pub(super) fn new(slice: &'a [T]) -> Self { + 8000b4c2: 7119 addi sp,sp,-128 + 8000b4c4: fc86 sd ra,120(sp) + 8000b4c6: f82e sd a1,48(sp) + 8000b4c8: fc2a sd a0,56(sp) + 8000b4ca: f0aa sd a0,96(sp) + 8000b4cc: f4ae sd a1,104(sp) + let ptr = slice.as_ptr(); + 8000b4ce: 00007097 auipc ra,0x7 + 8000b4d2: c3c080e7 jalr -964(ra) # 8001210a <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17h96d6be25d539a858E> + 8000b4d6: 85aa mv a1,a0 + 8000b4d8: e0ae sd a1,64(sp) + 8000b4da: f8aa sd a0,112(sp) + 8000b4dc: a009 j 8000b4de <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x1c> + assume(!ptr.is_null()); + 8000b4de: 6506 ld a0,64(sp) + 8000b4e0: 00007097 auipc ra,0x7 + 8000b4e4: bca080e7 jalr -1078(ra) # 800120aa <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h3d65bc1db9cfc841E> + 8000b4e8: a009 j 8000b4ea <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x28> + 8000b4ea: a009 j 8000b4ec <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x2a> + let end = if mem::size_of::() == 0 { + 8000b4ec: a009 j 8000b4ee <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x2c> + 8000b4ee: 4505 li a0,1 + 8000b4f0: ed01 bnez a0,8000b508 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x46> + 8000b4f2: a009 j 8000b4f4 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x32> + (ptr as *const u8).wrapping_add(slice.len()) as *const T + 8000b4f4: 75c2 ld a1,48(sp) + 8000b4f6: 7562 ld a0,56(sp) + 8000b4f8: 6606 ld a2,64(sp) + 8000b4fa: f032 sd a2,32(sp) + 8000b4fc: 00007097 auipc ra,0x7 + 8000b500: bda080e7 jalr -1062(ra) # 800120d6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E> + 8000b504: f42a sd a0,40(sp) + 8000b506: a809 j 8000b518 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x56> + ptr.add(slice.len()) + 8000b508: 75c2 ld a1,48(sp) + 8000b50a: 7562 ld a0,56(sp) + 8000b50c: 00007097 auipc ra,0x7 + 8000b510: bca080e7 jalr -1078(ra) # 800120d6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E> + 8000b514: ec2a sd a0,24(sp) + 8000b516: a821 j 8000b52e <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x6c> + (ptr as *const u8).wrapping_add(slice.len()) as *const T + 8000b518: 75a2 ld a1,40(sp) + 8000b51a: 7502 ld a0,32(sp) + 8000b51c: ffff9097 auipc ra,0xffff9 + 8000b520: 386080e7 jalr 902(ra) # 800048a2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$12wrapping_add17h10470fd1e83789bbE> + 8000b524: e82a sd a0,16(sp) + 8000b526: a009 j 8000b528 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x66> + 8000b528: 6542 ld a0,16(sp) + 8000b52a: ecaa sd a0,88(sp) + let end = if mem::size_of::() == 0 { + 8000b52c: a811 j 8000b540 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x7e> + ptr.add(slice.len()) + 8000b52e: 65e2 ld a1,24(sp) + 8000b530: 6506 ld a0,64(sp) + 8000b532: 00007097 auipc ra,0x7 + 8000b536: b40080e7 jalr -1216(ra) # 80012072 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17ha1c03feaee4d8d14E> + 8000b53a: ecaa sd a0,88(sp) + 8000b53c: a009 j 8000b53e <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x7c> + let end = if mem::size_of::() == 0 { + 8000b53e: a009 j 8000b540 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x7e> + Self { ptr: NonNull::new_unchecked(ptr as *mut T), end, _marker: PhantomData } + 8000b540: 6506 ld a0,64(sp) + 8000b542: 00004097 auipc ra,0x4 + 8000b546: 6d6080e7 jalr 1750(ra) # 8000fc18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h4fef4ea805603accE> + 8000b54a: e42a sd a0,8(sp) + 8000b54c: a009 j 8000b54e <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE+0x8c> + 8000b54e: 6522 ld a0,8(sp) + 8000b550: 65e6 ld a1,88(sp) + 8000b552: e4aa sd a0,72(sp) + 8000b554: e8ae sd a1,80(sp) + } + 8000b556: 70e6 ld ra,120(sp) + 8000b558: 6109 addi sp,sp,128 + 8000b55a: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter13Iter$LT$T$GT$8as_slice17hddf2d5a72581ec8fE: + +000000008000b55c <_ZN4core5slice4iter13Iter$LT$T$GT$8as_slice17hddf2d5a72581ec8fE>: + /// iter.next(); + /// // Now `as_slice` returns "[2, 3]": + /// println!("{:?}", iter.as_slice()); + /// ``` + #[stable(feature = "iter_to_slice", since = "1.4.0")] + pub fn as_slice(&self) -> &'a [T] { + 8000b55c: 7119 addi sp,sp,-128 + 8000b55e: fc86 sd ra,120(sp) + 8000b560: e42a sd a0,8(sp) + 8000b562: fc2a sd a0,56(sp) + 8000b564: e4aa sd a0,72(sp) + #[inline(always)] + fn make_slice(&self) -> &'a [T] { + // SAFETY: the iterator was created from a slice with pointer + // `self.ptr` and length `len!(self)`. This guarantees that all + // the prerequisites for `from_raw_parts` are fulfilled. + unsafe { from_raw_parts(self.ptr.as_ptr(), len!(self)) } + 8000b566: 6108 ld a0,0(a0) + 8000b568: 00005097 auipc ra,0x5 + 8000b56c: 8e6080e7 jalr -1818(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000b570: 85aa mv a1,a0 + 8000b572: 6522 ld a0,8(sp) + 8000b574: f02e sd a1,32(sp) + 8000b576: 6108 ld a0,0(a0) + 8000b578: e82a sd a0,16(sp) + 8000b57a: e8aa sd a0,80(sp) + 8000b57c: 00005097 auipc ra,0x5 + 8000b580: 8d2080e7 jalr -1838(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000b584: 65a2 ld a1,8(sp) + 8000b586: 862a mv a2,a0 + 8000b588: 6542 ld a0,16(sp) + 8000b58a: f8b2 sd a2,112(sp) + 8000b58c: 4605 li a2,1 + 8000b58e: ecb2 sd a2,88(sp) + 8000b590: 658c ld a1,8(a1) + 8000b592: ec2e sd a1,24(sp) + 8000b594: 00005097 auipc ra,0x5 + 8000b598: 8ba080e7 jalr -1862(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000b59c: 65e2 ld a1,24(sp) + 8000b59e: 862a mv a2,a0 + 8000b5a0: 7502 ld a0,32(sp) + 8000b5a2: 8d91 sub a1,a1,a2 + 8000b5a4: f0ae sd a1,96(sp) + 8000b5a6: f4ae sd a1,104(sp) + 8000b5a8: e0ae sd a1,64(sp) + 8000b5aa: ffffa097 auipc ra,0xffffa + 8000b5ae: f44080e7 jalr -188(ra) # 800054ee <_ZN4core5slice3raw14from_raw_parts17hf1accf0e45b69f71E> + self.make_slice() + 8000b5b2: f42a sd a0,40(sp) + 8000b5b4: f82e sd a1,48(sp) + 8000b5b6: a009 j 8000b5b8 <_ZN4core5slice4iter13Iter$LT$T$GT$8as_slice17hddf2d5a72581ec8fE+0x5c> + } + 8000b5b8: 75c2 ld a1,48(sp) + 8000b5ba: 7522 ld a0,40(sp) + 8000b5bc: 70e6 ld ra,120(sp) + 8000b5be: 6109 addi sp,sp,128 + 8000b5c0: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E: + +000000008000b5c2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E>: +#[stable(feature = "rust1", since = "1.0.0")] +unsafe impl Send for IterMut<'_, T> {} + +impl<'a, T> IterMut<'a, T> { + #[inline] + pub(super) fn new(slice: &'a mut [T]) -> Self { + 8000b5c2: 7119 addi sp,sp,-128 + 8000b5c4: fc86 sd ra,120(sp) + 8000b5c6: f82e sd a1,48(sp) + 8000b5c8: fc2a sd a0,56(sp) + 8000b5ca: f0aa sd a0,96(sp) + 8000b5cc: f4ae sd a1,104(sp) + let ptr = slice.as_mut_ptr(); + 8000b5ce: ffffa097 auipc ra,0xffffa + 8000b5d2: 1de080e7 jalr 478(ra) # 800057ac <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h37e95d8a2d6ca634E> + 8000b5d6: 85aa mv a1,a0 + 8000b5d8: e0ae sd a1,64(sp) + 8000b5da: f8aa sd a0,112(sp) + 8000b5dc: a009 j 8000b5de <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x1c> + // the length, to also allows for the fast `ptr == end` check. + // + // See the `next_unchecked!` and `is_empty!` macros as well as the + // `post_inc_start` method for more informations. + unsafe { + assume(!ptr.is_null()); + 8000b5de: 6506 ld a0,64(sp) + 8000b5e0: ffffa097 auipc ra,0xffffa + 8000b5e4: 1aa080e7 jalr 426(ra) # 8000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E> + 8000b5e8: a009 j 8000b5ea <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x28> + 8000b5ea: a009 j 8000b5ec <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x2a> + + let end = if mem::size_of::() == 0 { + 8000b5ec: a009 j 8000b5ee <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x2c> + 8000b5ee: 4505 li a0,1 + 8000b5f0: ed01 bnez a0,8000b608 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x46> + 8000b5f2: a009 j 8000b5f4 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x32> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b5f4: 75c2 ld a1,48(sp) + 8000b5f6: 7562 ld a0,56(sp) + 8000b5f8: 6606 ld a2,64(sp) + 8000b5fa: f032 sd a2,32(sp) + 8000b5fc: ffffa097 auipc ra,0xffffa + 8000b600: 1ba080e7 jalr 442(ra) # 800057b6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h0b5a743241a7cbfaE> + 8000b604: f42a sd a0,40(sp) + 8000b606: a809 j 8000b618 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x56> + } else { + ptr.add(slice.len()) + 8000b608: 75c2 ld a1,48(sp) + 8000b60a: 7562 ld a0,56(sp) + 8000b60c: ffffa097 auipc ra,0xffffa + 8000b610: 1aa080e7 jalr 426(ra) # 800057b6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h0b5a743241a7cbfaE> + 8000b614: ec2a sd a0,24(sp) + 8000b616: a821 j 8000b62e <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x6c> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b618: 75a2 ld a1,40(sp) + 8000b61a: 7502 ld a0,32(sp) + 8000b61c: ffffe097 auipc ra,0xffffe + 8000b620: a86080e7 jalr -1402(ra) # 800090a2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE> + 8000b624: e82a sd a0,16(sp) + 8000b626: a009 j 8000b628 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x66> + 8000b628: 6542 ld a0,16(sp) + 8000b62a: ecaa sd a0,88(sp) + let end = if mem::size_of::() == 0 { + 8000b62c: a811 j 8000b640 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x7e> + ptr.add(slice.len()) + 8000b62e: 65e2 ld a1,24(sp) + 8000b630: 6506 ld a0,64(sp) + 8000b632: ffffa097 auipc ra,0xffffa + 8000b636: 0ee080e7 jalr 238(ra) # 80005720 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17hffa57d7c8ffaba34E> + 8000b63a: ecaa sd a0,88(sp) + 8000b63c: a009 j 8000b63e <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x7c> + let end = if mem::size_of::() == 0 { + 8000b63e: a009 j 8000b640 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x7e> + }; + + Self { ptr: NonNull::new_unchecked(ptr), end, _marker: PhantomData } + 8000b640: 6506 ld a0,64(sp) + 8000b642: 00004097 auipc ra,0x4 + 8000b646: 60c080e7 jalr 1548(ra) # 8000fc4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hd62713267129dcbeE> + 8000b64a: e42a sd a0,8(sp) + 8000b64c: a009 j 8000b64e <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h018b863ac427b524E+0x8c> + 8000b64e: 6522 ld a0,8(sp) + 8000b650: 65e6 ld a1,88(sp) + 8000b652: e4aa sd a0,72(sp) + 8000b654: e8ae sd a1,80(sp) + } + } + 8000b656: 70e6 ld ra,120(sp) + 8000b658: 6109 addi sp,sp,128 + 8000b65a: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E: + +000000008000b65c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E>: + pub(super) fn new(slice: &'a mut [T]) -> Self { + 8000b65c: 7119 addi sp,sp,-128 + 8000b65e: fc86 sd ra,120(sp) + 8000b660: f82e sd a1,48(sp) + 8000b662: fc2a sd a0,56(sp) + 8000b664: f0aa sd a0,96(sp) + 8000b666: f4ae sd a1,104(sp) + let ptr = slice.as_mut_ptr(); + 8000b668: 00013097 auipc ra,0x13 + 8000b66c: fe6080e7 jalr -26(ra) # 8001e64e <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17hb34fa5c829e1d9f2E> + 8000b670: 85aa mv a1,a0 + 8000b672: e0ae sd a1,64(sp) + 8000b674: f8aa sd a0,112(sp) + 8000b676: a009 j 8000b678 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x1c> + assume(!ptr.is_null()); + 8000b678: 6506 ld a0,64(sp) + 8000b67a: 00013097 auipc ra,0x13 + 8000b67e: fb2080e7 jalr -78(ra) # 8001e62c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h1d4bdf7317c60b96E> + 8000b682: a009 j 8000b684 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x28> + 8000b684: a009 j 8000b686 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x2a> + let end = if mem::size_of::() == 0 { + 8000b686: a009 j 8000b688 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x2c> + 8000b688: 4505 li a0,1 + 8000b68a: ed01 bnez a0,8000b6a2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x46> + 8000b68c: a009 j 8000b68e <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x32> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b68e: 75c2 ld a1,48(sp) + 8000b690: 7562 ld a0,56(sp) + 8000b692: 6606 ld a2,64(sp) + 8000b694: f032 sd a2,32(sp) + 8000b696: 00013097 auipc ra,0x13 + 8000b69a: fc2080e7 jalr -62(ra) # 8001e658 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h5af32af5d380fccdE> + 8000b69e: f42a sd a0,40(sp) + 8000b6a0: a809 j 8000b6b2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x56> + ptr.add(slice.len()) + 8000b6a2: 75c2 ld a1,48(sp) + 8000b6a4: 7562 ld a0,56(sp) + 8000b6a6: 00013097 auipc ra,0x13 + 8000b6aa: fb2080e7 jalr -78(ra) # 8001e658 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h5af32af5d380fccdE> + 8000b6ae: ec2a sd a0,24(sp) + 8000b6b0: a821 j 8000b6c8 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x6c> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b6b2: 75a2 ld a1,40(sp) + 8000b6b4: 7502 ld a0,32(sp) + 8000b6b6: ffffe097 auipc ra,0xffffe + 8000b6ba: 9ec080e7 jalr -1556(ra) # 800090a2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE> + 8000b6be: e82a sd a0,16(sp) + 8000b6c0: a009 j 8000b6c2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x66> + 8000b6c2: 6542 ld a0,16(sp) + 8000b6c4: ecaa sd a0,88(sp) + let end = if mem::size_of::() == 0 { + 8000b6c6: a811 j 8000b6da <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x7e> + ptr.add(slice.len()) + 8000b6c8: 65e2 ld a1,24(sp) + 8000b6ca: 6506 ld a0,64(sp) + 8000b6cc: 00013097 auipc ra,0x13 + 8000b6d0: f28080e7 jalr -216(ra) # 8001e5f4 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h3a39754d1b9c54a7E> + 8000b6d4: ecaa sd a0,88(sp) + 8000b6d6: a009 j 8000b6d8 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x7c> + let end = if mem::size_of::() == 0 { + 8000b6d8: a009 j 8000b6da <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x7e> + Self { ptr: NonNull::new_unchecked(ptr), end, _marker: PhantomData } + 8000b6da: 6506 ld a0,64(sp) + 8000b6dc: 00004097 auipc ra,0x4 + 8000b6e0: 586080e7 jalr 1414(ra) # 8000fc62 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hf41e3912db402547E> + 8000b6e4: e42a sd a0,8(sp) + 8000b6e6: a009 j 8000b6e8 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E+0x8c> + 8000b6e8: 6522 ld a0,8(sp) + 8000b6ea: 65e6 ld a1,88(sp) + 8000b6ec: e4aa sd a0,72(sp) + 8000b6ee: e8ae sd a1,80(sp) + } + 8000b6f0: 70e6 ld ra,120(sp) + 8000b6f2: 6109 addi sp,sp,128 + 8000b6f4: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E: + +000000008000b6f6 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E>: + pub(super) fn new(slice: &'a mut [T]) -> Self { + 8000b6f6: 7119 addi sp,sp,-128 + 8000b6f8: fc86 sd ra,120(sp) + 8000b6fa: f82e sd a1,48(sp) + 8000b6fc: fc2a sd a0,56(sp) + 8000b6fe: f0aa sd a0,96(sp) + 8000b700: f4ae sd a1,104(sp) + let ptr = slice.as_mut_ptr(); + 8000b702: 00007097 auipc ra,0x7 + 8000b706: 9ca080e7 jalr -1590(ra) # 800120cc <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17hb97ee0bcc69dbfd1E> + 8000b70a: 85aa mv a1,a0 + 8000b70c: e0ae sd a1,64(sp) + 8000b70e: f8aa sd a0,112(sp) + 8000b710: a009 j 8000b712 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x1c> + assume(!ptr.is_null()); + 8000b712: 6506 ld a0,64(sp) + 8000b714: 00007097 auipc ra,0x7 + 8000b718: 93c080e7 jalr -1732(ra) # 80012050 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E> + 8000b71c: a009 j 8000b71e <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x28> + 8000b71e: a009 j 8000b720 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x2a> + let end = if mem::size_of::() == 0 { + 8000b720: a009 j 8000b722 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x2c> + 8000b722: 4505 li a0,1 + 8000b724: ed01 bnez a0,8000b73c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x46> + 8000b726: a009 j 8000b728 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x32> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b728: 75c2 ld a1,48(sp) + 8000b72a: 7562 ld a0,56(sp) + 8000b72c: 6606 ld a2,64(sp) + 8000b72e: f032 sd a2,32(sp) + 8000b730: 00007097 auipc ra,0x7 + 8000b734: 9a6080e7 jalr -1626(ra) # 800120d6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E> + 8000b738: f42a sd a0,40(sp) + 8000b73a: a809 j 8000b74c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x56> + ptr.add(slice.len()) + 8000b73c: 75c2 ld a1,48(sp) + 8000b73e: 7562 ld a0,56(sp) + 8000b740: 00007097 auipc ra,0x7 + 8000b744: 996080e7 jalr -1642(ra) # 800120d6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E> + 8000b748: ec2a sd a0,24(sp) + 8000b74a: a821 j 8000b762 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x6c> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b74c: 75a2 ld a1,40(sp) + 8000b74e: 7502 ld a0,32(sp) + 8000b750: ffffe097 auipc ra,0xffffe + 8000b754: 952080e7 jalr -1710(ra) # 800090a2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE> + 8000b758: e82a sd a0,16(sp) + 8000b75a: a009 j 8000b75c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x66> + 8000b75c: 6542 ld a0,16(sp) + 8000b75e: ecaa sd a0,88(sp) + let end = if mem::size_of::() == 0 { + 8000b760: a811 j 8000b774 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x7e> + ptr.add(slice.len()) + 8000b762: 65e2 ld a1,24(sp) + 8000b764: 6506 ld a0,64(sp) + 8000b766: 00007097 auipc ra,0x7 + 8000b76a: 8b2080e7 jalr -1870(ra) # 80012018 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h92628fd5b4e20f4bE> + 8000b76e: ecaa sd a0,88(sp) + 8000b770: a009 j 8000b772 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x7c> + let end = if mem::size_of::() == 0 { + 8000b772: a009 j 8000b774 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x7e> + Self { ptr: NonNull::new_unchecked(ptr), end, _marker: PhantomData } + 8000b774: 6506 ld a0,64(sp) + 8000b776: 00004097 auipc ra,0x4 + 8000b77a: 4a2080e7 jalr 1186(ra) # 8000fc18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h4fef4ea805603accE> + 8000b77e: e42a sd a0,8(sp) + 8000b780: a009 j 8000b782 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E+0x8c> + 8000b782: 6522 ld a0,8(sp) + 8000b784: 65e6 ld a1,88(sp) + 8000b786: e4aa sd a0,72(sp) + 8000b788: e8ae sd a1,80(sp) + } + 8000b78a: 70e6 ld ra,120(sp) + 8000b78c: 6109 addi sp,sp,128 + 8000b78e: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E: + +000000008000b790 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E>: + pub(super) fn new(slice: &'a mut [T]) -> Self { + 8000b790: 7159 addi sp,sp,-112 + 8000b792: f486 sd ra,104(sp) + 8000b794: f02e sd a1,32(sp) + 8000b796: f42a sd a0,40(sp) + 8000b798: e8aa sd a0,80(sp) + 8000b79a: ecae sd a1,88(sp) + let ptr = slice.as_mut_ptr(); + 8000b79c: 00015097 auipc ra,0x15 + 8000b7a0: cca080e7 jalr -822(ra) # 80020466 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h752c0d8417c49952E> + 8000b7a4: 85aa mv a1,a0 + 8000b7a6: f82e sd a1,48(sp) + 8000b7a8: f0aa sd a0,96(sp) + 8000b7aa: a009 j 8000b7ac <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x1c> + assume(!ptr.is_null()); + 8000b7ac: 7542 ld a0,48(sp) + 8000b7ae: ffffe097 auipc ra,0xffffe + 8000b7b2: 99e080e7 jalr -1634(ra) # 8000914c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc49b20e03dc897f6E> + 8000b7b6: a009 j 8000b7b8 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x28> + 8000b7b8: a009 j 8000b7ba <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x2a> + let end = if mem::size_of::() == 0 { + 8000b7ba: a009 j 8000b7bc <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x2c> + 8000b7bc: 4505 li a0,1 + 8000b7be: e911 bnez a0,8000b7d2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x42> + 8000b7c0: a009 j 8000b7c2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x32> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b7c2: 7582 ld a1,32(sp) + 8000b7c4: 7522 ld a0,40(sp) + 8000b7c6: 00015097 auipc ra,0x15 + 8000b7ca: cb4080e7 jalr -844(ra) # 8002047a <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h040db97216f8ec10E> + 8000b7ce: ec2a sd a0,24(sp) + 8000b7d0: a809 j 8000b7e2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x52> + ptr.add(slice.len()) + 8000b7d2: 7582 ld a1,32(sp) + 8000b7d4: 7522 ld a0,40(sp) + 8000b7d6: 00015097 auipc ra,0x15 + 8000b7da: ca4080e7 jalr -860(ra) # 8002047a <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h040db97216f8ec10E> + 8000b7de: e82a sd a0,16(sp) + 8000b7e0: a821 j 8000b7f8 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x68> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b7e2: 65e2 ld a1,24(sp) + 8000b7e4: 7542 ld a0,48(sp) + 8000b7e6: ffffe097 auipc ra,0xffffe + 8000b7ea: 8bc080e7 jalr -1860(ra) # 800090a2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE> + 8000b7ee: e42a sd a0,8(sp) + 8000b7f0: a009 j 8000b7f2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x62> + 8000b7f2: 6522 ld a0,8(sp) + 8000b7f4: e4aa sd a0,72(sp) + let end = if mem::size_of::() == 0 { + 8000b7f6: a811 j 8000b80a <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x7a> + ptr.add(slice.len()) + 8000b7f8: 65c2 ld a1,16(sp) + 8000b7fa: 7542 ld a0,48(sp) + 8000b7fc: ffffe097 auipc ra,0xffffe + 8000b800: 90a080e7 jalr -1782(ra) # 80009106 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1fdb3e6f0b8b1c65E> + 8000b804: e4aa sd a0,72(sp) + 8000b806: a009 j 8000b808 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x78> + let end = if mem::size_of::() == 0 { + 8000b808: a009 j 8000b80a <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x7a> + Self { ptr: NonNull::new_unchecked(ptr), end, _marker: PhantomData } + 8000b80a: 7542 ld a0,48(sp) + 8000b80c: 00004097 auipc ra,0x4 + 8000b810: 44c080e7 jalr 1100(ra) # 8000fc58 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17he8eb4f7b6f10823eE> + 8000b814: e02a sd a0,0(sp) + 8000b816: a009 j 8000b818 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E+0x88> + 8000b818: 6502 ld a0,0(sp) + 8000b81a: 65a6 ld a1,72(sp) + 8000b81c: fc2a sd a0,56(sp) + 8000b81e: e0ae sd a1,64(sp) + } + 8000b820: 70a6 ld ra,104(sp) + 8000b822: 6165 addi sp,sp,112 + 8000b824: 8082 ret + +Disassembly of section .text._ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE: + +000000008000b826 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE>: + pub(super) fn new(slice: &'a mut [T]) -> Self { + 8000b826: 7119 addi sp,sp,-128 + 8000b828: fc86 sd ra,120(sp) + 8000b82a: f82e sd a1,48(sp) + 8000b82c: fc2a sd a0,56(sp) + 8000b82e: f0aa sd a0,96(sp) + 8000b830: f4ae sd a1,104(sp) + let ptr = slice.as_mut_ptr(); + 8000b832: ffff7097 auipc ra,0xffff7 + 8000b836: ee6080e7 jalr -282(ra) # 80002718 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h183dec752c293806E> + 8000b83a: 85aa mv a1,a0 + 8000b83c: e0ae sd a1,64(sp) + 8000b83e: f8aa sd a0,112(sp) + 8000b840: a009 j 8000b842 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x1c> + assume(!ptr.is_null()); + 8000b842: 6506 ld a0,64(sp) + 8000b844: ffff7097 auipc ra,0xffff7 + 8000b848: eb2080e7 jalr -334(ra) # 800026f6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17heba1b469892184ceE> + 8000b84c: a009 j 8000b84e <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x28> + 8000b84e: a009 j 8000b850 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x2a> + let end = if mem::size_of::() == 0 { + 8000b850: a009 j 8000b852 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x2c> + 8000b852: 4505 li a0,1 + 8000b854: ed01 bnez a0,8000b86c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x46> + 8000b856: a009 j 8000b858 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x32> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b858: 75c2 ld a1,48(sp) + 8000b85a: 7562 ld a0,56(sp) + 8000b85c: 6606 ld a2,64(sp) + 8000b85e: f032 sd a2,32(sp) + 8000b860: ffff7097 auipc ra,0xffff7 + 8000b864: ec2080e7 jalr -318(ra) # 80002722 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h9f8bef1b1861f62bE> + 8000b868: f42a sd a0,40(sp) + 8000b86a: a809 j 8000b87c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x56> + ptr.add(slice.len()) + 8000b86c: 75c2 ld a1,48(sp) + 8000b86e: 7562 ld a0,56(sp) + 8000b870: ffff7097 auipc ra,0xffff7 + 8000b874: eb2080e7 jalr -334(ra) # 80002722 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h9f8bef1b1861f62bE> + 8000b878: ec2a sd a0,24(sp) + 8000b87a: a821 j 8000b892 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x6c> + (ptr as *mut u8).wrapping_add(slice.len()) as *mut T + 8000b87c: 75a2 ld a1,40(sp) + 8000b87e: 7502 ld a0,32(sp) + 8000b880: ffffe097 auipc ra,0xffffe + 8000b884: 822080e7 jalr -2014(ra) # 800090a2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$12wrapping_add17hef81cac2ef53321bE> + 8000b888: e82a sd a0,16(sp) + 8000b88a: a009 j 8000b88c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x66> + 8000b88c: 6542 ld a0,16(sp) + 8000b88e: ecaa sd a0,88(sp) + let end = if mem::size_of::() == 0 { + 8000b890: a811 j 8000b8a4 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x7e> + ptr.add(slice.len()) + 8000b892: 65e2 ld a1,24(sp) + 8000b894: 6506 ld a0,64(sp) + 8000b896: ffff7097 auipc ra,0xffff7 + 8000b89a: e28080e7 jalr -472(ra) # 800026be <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h40dcf832be5517eaE> + 8000b89e: ecaa sd a0,88(sp) + 8000b8a0: a009 j 8000b8a2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x7c> + let end = if mem::size_of::() == 0 { + 8000b8a2: a009 j 8000b8a4 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x7e> + Self { ptr: NonNull::new_unchecked(ptr), end, _marker: PhantomData } + 8000b8a4: 6506 ld a0,64(sp) + 8000b8a6: 00004097 auipc ra,0x4 + 8000b8aa: 354080e7 jalr 852(ra) # 8000fbfa <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h04fc63e3eb51e989E> + 8000b8ae: e42a sd a0,8(sp) + 8000b8b0: a009 j 8000b8b2 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17hcf4df4b85b3597afE+0x8c> + 8000b8b2: 6522 ld a0,8(sp) + 8000b8b4: 65e6 ld a1,88(sp) + 8000b8b6: e4aa sd a0,72(sp) + 8000b8b8: e8ae sd a1,80(sp) + } + 8000b8ba: 70e6 ld ra,120(sp) + 8000b8bc: 6109 addi sp,sp,128 + 8000b8be: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h8c969beb07468abbE: + +000000008000b8c0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h8c969beb07468abbE>: +#[stable(feature = "rust1", since = "1.0.0")] +impl IntoIterator for I { + type Item = I::Item; + type IntoIter = I; + + fn into_iter(self) -> I { + 8000b8c0: 1141 addi sp,sp,-16 + 8000b8c2: e02a sd a0,0(sp) + 8000b8c4: e42e sd a1,8(sp) + self + } + 8000b8c6: 0141 addi sp,sp,16 + 8000b8c8: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h9e69dea96ab82809E: + +000000008000b8ca <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h9e69dea96ab82809E>: + fn into_iter(self) -> I { + 8000b8ca: 1141 addi sp,sp,-16 + 8000b8cc: e02a sd a0,0(sp) + 8000b8ce: e42e sd a1,8(sp) + } + 8000b8d0: 0141 addi sp,sp,16 + 8000b8d2: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17had1f1a546667c559E: + +000000008000b8d4 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17had1f1a546667c559E>: + fn into_iter(self) -> I { + 8000b8d4: 1141 addi sp,sp,-16 + 8000b8d6: e02a sd a0,0(sp) + 8000b8d8: e42e sd a1,8(sp) + } + 8000b8da: 0141 addi sp,sp,16 + 8000b8dc: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hca1289a056d9e0bbE: + +000000008000b8de <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hca1289a056d9e0bbE>: + fn into_iter(self) -> I { + 8000b8de: 1141 addi sp,sp,-16 + 8000b8e0: e02a sd a0,0(sp) + 8000b8e2: e42e sd a1,8(sp) + } + 8000b8e4: 0141 addi sp,sp,16 + 8000b8e6: 8082 ret + +Disassembly of section .text._ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E: + +000000008000b8e8 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E>: + #[stable(feature = "rust1", since = "1.0.0")] + impl<'a, T> Iterator for $name<'a, T> { + type Item = $elem; + + #[inline] + fn next(&mut self) -> Option<$elem> { + 8000b8e8: 7159 addi sp,sp,-112 + 8000b8ea: f486 sd ra,104(sp) + 8000b8ec: f42a sd a0,40(sp) + 8000b8ee: e0aa sd a0,64(sp) + // SAFETY: `assume` calls are safe since a slice's start pointer + // must be non-null, and slices over non-ZSTs must also have a + // non-null end pointer. The call to `next_unchecked!` is safe + // since we check if the iterator is empty first. + unsafe { + assume(!self.ptr.as_ptr().is_null()); + 8000b8f0: 6108 ld a0,0(a0) + 8000b8f2: 00004097 auipc ra,0x4 + 8000b8f6: 544080e7 jalr 1348(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000b8fa: f82a sd a0,48(sp) + 8000b8fc: a009 j 8000b8fe <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x16> + 8000b8fe: 7542 ld a0,48(sp) + 8000b900: 00006097 auipc ra,0x6 + 8000b904: 750080e7 jalr 1872(ra) # 80012050 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E> + 8000b908: a009 j 8000b90a <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x22> + 8000b90a: a009 j 8000b90c <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x24> + if mem::size_of::() != 0 { + 8000b90c: a009 j 8000b90e <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x26> + 8000b90e: 4501 li a0,0 + 8000b910: e909 bnez a0,8000b922 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x3a> + 8000b912: a009 j 8000b914 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x2c> + assume(!self.end.is_null()); + 8000b914: 7522 ld a0,40(sp) + 8000b916: 6508 ld a0,8(a0) + 8000b918: 00006097 auipc ra,0x6 + 8000b91c: 792080e7 jalr 1938(ra) # 800120aa <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h3d65bc1db9cfc841E> + 8000b920: a011 j 8000b924 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x3c> + if mem::size_of::() != 0 { + 8000b922: a019 j 8000b928 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x40> + assume(!self.end.is_null()); + 8000b924: a009 j 8000b926 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x3e> + if mem::size_of::() != 0 { + 8000b926: a009 j 8000b928 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x40> + } + if is_empty!(self) { + 8000b928: 7522 ld a0,40(sp) + 8000b92a: 6108 ld a0,0(a0) + 8000b92c: 00004097 auipc ra,0x4 + 8000b930: 50a080e7 jalr 1290(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000b934: f02a sd a0,32(sp) + 8000b936: a009 j 8000b938 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x50> + 8000b938: 7502 ld a0,32(sp) + 8000b93a: 75a2 ld a1,40(sp) + 8000b93c: 658c ld a1,8(a1) + 8000b93e: 00b51663 bne a0,a1,8000b94a <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x62> + 8000b942: a009 j 8000b944 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0x5c> + 8000b944: 4501 li a0,0 + None + 8000b946: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000b948: a0b9 j 8000b996 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0xae> + 8000b94a: 7522 ld a0,40(sp) + 8000b94c: e8aa sd a0,80(sp) + 8000b94e: 4585 li a1,1 + 8000b950: e42e sd a1,8(sp) + 8000b952: ecae sd a1,88(sp) + let old = self.ptr.as_ptr(); + 8000b954: 6108 ld a0,0(a0) + 8000b956: 00004097 auipc ra,0x4 + 8000b95a: 4e0080e7 jalr 1248(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000b95e: 85aa mv a1,a0 + 8000b960: 7522 ld a0,40(sp) + 8000b962: e82e sd a1,16(sp) + 8000b964: f0ae sd a1,96(sp) + self.ptr = unsafe { NonNull::new_unchecked(self.ptr.as_ptr().offset(offset)) }; + 8000b966: 6108 ld a0,0(a0) + 8000b968: 00004097 auipc ra,0x4 + 8000b96c: 4ce080e7 jalr 1230(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000b970: 65a2 ld a1,8(sp) + 8000b972: 00006097 auipc ra,0x6 + 8000b976: 6c2080e7 jalr 1730(ra) # 80012034 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h2e4c04da2e1cf416E> + 8000b97a: 00004097 auipc ra,0x4 + 8000b97e: 29e080e7 jalr 670(ra) # 8000fc18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h4fef4ea805603accE> + 8000b982: 7622 ld a2,40(sp) + 8000b984: 85aa mv a1,a0 + 8000b986: 6542 ld a0,16(sp) + 8000b988: e20c sd a1,0(a2) + old + 8000b98a: e4aa sd a0,72(sp) + } else { + Some(next_unchecked!(self)) + 8000b98c: ec2a sd a0,24(sp) + 8000b98e: a009 j 8000b990 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0xa8> + 8000b990: 6562 ld a0,24(sp) + 8000b992: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000b994: a009 j 8000b996 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E+0xae> + } + } + } + 8000b996: 7562 ld a0,56(sp) + 8000b998: 70a6 ld ra,104(sp) + 8000b99a: 6165 addi sp,sp,112 + 8000b99c: 8082 ret + +Disassembly of section .text._ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE: + +000000008000b99e <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE>: + fn next(&mut self) -> Option<$elem> { + 8000b99e: 7159 addi sp,sp,-112 + 8000b9a0: f486 sd ra,104(sp) + 8000b9a2: f42a sd a0,40(sp) + 8000b9a4: e0aa sd a0,64(sp) + assume(!self.ptr.as_ptr().is_null()); + 8000b9a6: 6108 ld a0,0(a0) + 8000b9a8: 00004097 auipc ra,0x4 + 8000b9ac: 4a6080e7 jalr 1190(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000b9b0: f82a sd a0,48(sp) + 8000b9b2: a009 j 8000b9b4 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x16> + 8000b9b4: 7542 ld a0,48(sp) + 8000b9b6: 00015097 auipc ra,0x15 + 8000b9ba: c9a080e7 jalr -870(ra) # 80020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E> + 8000b9be: a009 j 8000b9c0 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x22> + 8000b9c0: a009 j 8000b9c2 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x24> + if mem::size_of::() != 0 { + 8000b9c2: a009 j 8000b9c4 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x26> + 8000b9c4: 4501 li a0,0 + 8000b9c6: e909 bnez a0,8000b9d8 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x3a> + 8000b9c8: a009 j 8000b9ca <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x2c> + assume(!self.end.is_null()); + 8000b9ca: 7522 ld a0,40(sp) + 8000b9cc: 6508 ld a0,8(a0) + 8000b9ce: 00015097 auipc ra,0x15 + 8000b9d2: d50080e7 jalr -688(ra) # 8002071e <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h309eb733b6984dd5E> + 8000b9d6: a011 j 8000b9da <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x3c> + if mem::size_of::() != 0 { + 8000b9d8: a019 j 8000b9de <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x40> + assume(!self.end.is_null()); + 8000b9da: a009 j 8000b9dc <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x3e> + if mem::size_of::() != 0 { + 8000b9dc: a009 j 8000b9de <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x40> + if is_empty!(self) { + 8000b9de: 7522 ld a0,40(sp) + 8000b9e0: 6108 ld a0,0(a0) + 8000b9e2: 00004097 auipc ra,0x4 + 8000b9e6: 46c080e7 jalr 1132(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000b9ea: f02a sd a0,32(sp) + 8000b9ec: a009 j 8000b9ee <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x50> + 8000b9ee: 7502 ld a0,32(sp) + 8000b9f0: 75a2 ld a1,40(sp) + 8000b9f2: 658c ld a1,8(a1) + 8000b9f4: 00b51663 bne a0,a1,8000ba00 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x62> + 8000b9f8: a009 j 8000b9fa <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0x5c> + 8000b9fa: 4501 li a0,0 + None + 8000b9fc: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000b9fe: a0b9 j 8000ba4c <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0xae> + 8000ba00: 7522 ld a0,40(sp) + 8000ba02: e8aa sd a0,80(sp) + 8000ba04: 4585 li a1,1 + 8000ba06: e42e sd a1,8(sp) + 8000ba08: ecae sd a1,88(sp) + let old = self.ptr.as_ptr(); + 8000ba0a: 6108 ld a0,0(a0) + 8000ba0c: 00004097 auipc ra,0x4 + 8000ba10: 442080e7 jalr 1090(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000ba14: 85aa mv a1,a0 + 8000ba16: 7522 ld a0,40(sp) + 8000ba18: e82e sd a1,16(sp) + 8000ba1a: f0ae sd a1,96(sp) + self.ptr = unsafe { NonNull::new_unchecked(self.ptr.as_ptr().offset(offset)) }; + 8000ba1c: 6108 ld a0,0(a0) + 8000ba1e: 00004097 auipc ra,0x4 + 8000ba22: 430080e7 jalr 1072(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000ba26: 65a2 ld a1,8(sp) + 8000ba28: 00015097 auipc ra,0x15 + 8000ba2c: c14080e7 jalr -1004(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 8000ba30: 00004097 auipc ra,0x4 + 8000ba34: 200080e7 jalr 512(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8000ba38: 7622 ld a2,40(sp) + 8000ba3a: 85aa mv a1,a0 + 8000ba3c: 6542 ld a0,16(sp) + 8000ba3e: e20c sd a1,0(a2) + old + 8000ba40: e4aa sd a0,72(sp) + Some(next_unchecked!(self)) + 8000ba42: ec2a sd a0,24(sp) + 8000ba44: a009 j 8000ba46 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0xa8> + 8000ba46: 6562 ld a0,24(sp) + 8000ba48: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000ba4a: a009 j 8000ba4c <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hbe39990052f1389dE+0xae> + } + 8000ba4c: 7562 ld a0,56(sp) + 8000ba4e: 70a6 ld ra,104(sp) + 8000ba50: 6165 addi sp,sp,112 + 8000ba52: 8082 ret + +Disassembly of section .text._ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E: + +000000008000ba54 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E>: + fn next(&mut self) -> Option<$elem> { + 8000ba54: 7159 addi sp,sp,-112 + 8000ba56: f486 sd ra,104(sp) + 8000ba58: f42a sd a0,40(sp) + 8000ba5a: e0aa sd a0,64(sp) + assume(!self.ptr.as_ptr().is_null()); + 8000ba5c: 6108 ld a0,0(a0) + 8000ba5e: 00004097 auipc ra,0x4 + 8000ba62: 432080e7 jalr 1074(ra) # 8000fe90 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hfb12dd33ea904ed8E> + 8000ba66: f82a sd a0,48(sp) + 8000ba68: a009 j 8000ba6a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x16> + 8000ba6a: 7542 ld a0,48(sp) + 8000ba6c: ffffd097 auipc ra,0xffffd + 8000ba70: 6e0080e7 jalr 1760(ra) # 8000914c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc49b20e03dc897f6E> + 8000ba74: a009 j 8000ba76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x22> + 8000ba76: a009 j 8000ba78 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x24> + if mem::size_of::() != 0 { + 8000ba78: a009 j 8000ba7a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x26> + 8000ba7a: 4501 li a0,0 + 8000ba7c: e909 bnez a0,8000ba8e <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x3a> + 8000ba7e: a009 j 8000ba80 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x2c> + assume(!self.end.is_null()); + 8000ba80: 7522 ld a0,40(sp) + 8000ba82: 6508 ld a0,8(a0) + 8000ba84: ffffd097 auipc ra,0xffffd + 8000ba88: 6c8080e7 jalr 1736(ra) # 8000914c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc49b20e03dc897f6E> + 8000ba8c: a011 j 8000ba90 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x3c> + if mem::size_of::() != 0 { + 8000ba8e: a019 j 8000ba94 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x40> + assume(!self.end.is_null()); + 8000ba90: a009 j 8000ba92 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x3e> + if mem::size_of::() != 0 { + 8000ba92: a009 j 8000ba94 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x40> + if is_empty!(self) { + 8000ba94: 7522 ld a0,40(sp) + 8000ba96: 6108 ld a0,0(a0) + 8000ba98: 00004097 auipc ra,0x4 + 8000ba9c: 3f8080e7 jalr 1016(ra) # 8000fe90 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hfb12dd33ea904ed8E> + 8000baa0: f02a sd a0,32(sp) + 8000baa2: a009 j 8000baa4 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x50> + 8000baa4: 7502 ld a0,32(sp) + 8000baa6: 75a2 ld a1,40(sp) + 8000baa8: 658c ld a1,8(a1) + 8000baaa: 00b51663 bne a0,a1,8000bab6 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x62> + 8000baae: a009 j 8000bab0 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0x5c> + 8000bab0: 4501 li a0,0 + None + 8000bab2: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bab4: a0b9 j 8000bb02 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0xae> + 8000bab6: 7522 ld a0,40(sp) + 8000bab8: e8aa sd a0,80(sp) + 8000baba: 4585 li a1,1 + 8000babc: e42e sd a1,8(sp) + 8000babe: ecae sd a1,88(sp) + let old = self.ptr.as_ptr(); + 8000bac0: 6108 ld a0,0(a0) + 8000bac2: 00004097 auipc ra,0x4 + 8000bac6: 3ce080e7 jalr 974(ra) # 8000fe90 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hfb12dd33ea904ed8E> + 8000baca: 85aa mv a1,a0 + 8000bacc: 7522 ld a0,40(sp) + 8000bace: e82e sd a1,16(sp) + 8000bad0: f0ae sd a1,96(sp) + self.ptr = unsafe { NonNull::new_unchecked(self.ptr.as_ptr().offset(offset)) }; + 8000bad2: 6108 ld a0,0(a0) + 8000bad4: 00004097 auipc ra,0x4 + 8000bad8: 3bc080e7 jalr 956(ra) # 8000fe90 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hfb12dd33ea904ed8E> + 8000badc: 65a2 ld a1,8(sp) + 8000bade: ffffd097 auipc ra,0xffffd + 8000bae2: 644080e7 jalr 1604(ra) # 80009122 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h07753d2a365b8ea9E> + 8000bae6: 00004097 auipc ra,0x4 + 8000baea: 172080e7 jalr 370(ra) # 8000fc58 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17he8eb4f7b6f10823eE> + 8000baee: 7622 ld a2,40(sp) + 8000baf0: 85aa mv a1,a0 + 8000baf2: 6542 ld a0,16(sp) + 8000baf4: e20c sd a1,0(a2) + old + 8000baf6: e4aa sd a0,72(sp) + Some(next_unchecked!(self)) + 8000baf8: ec2a sd a0,24(sp) + 8000bafa: a009 j 8000bafc <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0xa8> + 8000bafc: 6562 ld a0,24(sp) + 8000bafe: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bb00: a009 j 8000bb02 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E+0xae> + } + 8000bb02: 7562 ld a0,56(sp) + 8000bb04: 70a6 ld ra,104(sp) + 8000bb06: 6165 addi sp,sp,112 + 8000bb08: 8082 ret + +Disassembly of section .text._ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E: + +000000008000bb0a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E>: + fn next(&mut self) -> Option<$elem> { + 8000bb0a: 7159 addi sp,sp,-112 + 8000bb0c: f486 sd ra,104(sp) + 8000bb0e: f42a sd a0,40(sp) + 8000bb10: e0aa sd a0,64(sp) + assume(!self.ptr.as_ptr().is_null()); + 8000bb12: 6108 ld a0,0(a0) + 8000bb14: 00004097 auipc ra,0x4 + 8000bb18: 332080e7 jalr 818(ra) # 8000fe46 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h6e70ae75457a689cE> + 8000bb1c: f82a sd a0,48(sp) + 8000bb1e: a009 j 8000bb20 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x16> + 8000bb20: 7542 ld a0,48(sp) + 8000bb22: ffff7097 auipc ra,0xffff7 + 8000bb26: bd4080e7 jalr -1068(ra) # 800026f6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17heba1b469892184ceE> + 8000bb2a: a009 j 8000bb2c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x22> + 8000bb2c: a009 j 8000bb2e <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x24> + if mem::size_of::() != 0 { + 8000bb2e: a009 j 8000bb30 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x26> + 8000bb30: 4501 li a0,0 + 8000bb32: e909 bnez a0,8000bb44 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x3a> + 8000bb34: a009 j 8000bb36 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x2c> + assume(!self.end.is_null()); + 8000bb36: 7522 ld a0,40(sp) + 8000bb38: 6508 ld a0,8(a0) + 8000bb3a: ffff7097 auipc ra,0xffff7 + 8000bb3e: bbc080e7 jalr -1092(ra) # 800026f6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17heba1b469892184ceE> + 8000bb42: a011 j 8000bb46 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x3c> + if mem::size_of::() != 0 { + 8000bb44: a019 j 8000bb4a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x40> + assume(!self.end.is_null()); + 8000bb46: a009 j 8000bb48 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x3e> + if mem::size_of::() != 0 { + 8000bb48: a009 j 8000bb4a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x40> + if is_empty!(self) { + 8000bb4a: 7522 ld a0,40(sp) + 8000bb4c: 6108 ld a0,0(a0) + 8000bb4e: 00004097 auipc ra,0x4 + 8000bb52: 2f8080e7 jalr 760(ra) # 8000fe46 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h6e70ae75457a689cE> + 8000bb56: f02a sd a0,32(sp) + 8000bb58: a009 j 8000bb5a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x50> + 8000bb5a: 7502 ld a0,32(sp) + 8000bb5c: 75a2 ld a1,40(sp) + 8000bb5e: 658c ld a1,8(a1) + 8000bb60: 00b51663 bne a0,a1,8000bb6c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x62> + 8000bb64: a009 j 8000bb66 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0x5c> + 8000bb66: 4501 li a0,0 + None + 8000bb68: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bb6a: a0b9 j 8000bbb8 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0xae> + 8000bb6c: 7522 ld a0,40(sp) + 8000bb6e: e8aa sd a0,80(sp) + 8000bb70: 4585 li a1,1 + 8000bb72: e42e sd a1,8(sp) + 8000bb74: ecae sd a1,88(sp) + let old = self.ptr.as_ptr(); + 8000bb76: 6108 ld a0,0(a0) + 8000bb78: 00004097 auipc ra,0x4 + 8000bb7c: 2ce080e7 jalr 718(ra) # 8000fe46 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h6e70ae75457a689cE> + 8000bb80: 85aa mv a1,a0 + 8000bb82: 7522 ld a0,40(sp) + 8000bb84: e82e sd a1,16(sp) + 8000bb86: f0ae sd a1,96(sp) + self.ptr = unsafe { NonNull::new_unchecked(self.ptr.as_ptr().offset(offset)) }; + 8000bb88: 6108 ld a0,0(a0) + 8000bb8a: 00004097 auipc ra,0x4 + 8000bb8e: 2bc080e7 jalr 700(ra) # 8000fe46 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h6e70ae75457a689cE> + 8000bb92: 65a2 ld a1,8(sp) + 8000bb94: ffff7097 auipc ra,0xffff7 + 8000bb98: b46080e7 jalr -1210(ra) # 800026da <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf87d8bdf4eec6bc8E> + 8000bb9c: 00004097 auipc ra,0x4 + 8000bba0: 05e080e7 jalr 94(ra) # 8000fbfa <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h04fc63e3eb51e989E> + 8000bba4: 7622 ld a2,40(sp) + 8000bba6: 85aa mv a1,a0 + 8000bba8: 6542 ld a0,16(sp) + 8000bbaa: e20c sd a1,0(a2) + old + 8000bbac: e4aa sd a0,72(sp) + Some(next_unchecked!(self)) + 8000bbae: ec2a sd a0,24(sp) + 8000bbb0: a009 j 8000bbb2 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0xa8> + 8000bbb2: 6562 ld a0,24(sp) + 8000bbb4: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bbb6: a009 j 8000bbb8 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h62cceabe9174b414E+0xae> + } + 8000bbb8: 7562 ld a0,56(sp) + 8000bbba: 70a6 ld ra,104(sp) + 8000bbbc: 6165 addi sp,sp,112 + 8000bbbe: 8082 ret + +Disassembly of section .text._ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE: + +000000008000bbc0 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE>: + fn next(&mut self) -> Option<$elem> { + 8000bbc0: 7159 addi sp,sp,-112 + 8000bbc2: f486 sd ra,104(sp) + 8000bbc4: f42a sd a0,40(sp) + 8000bbc6: e0aa sd a0,64(sp) + assume(!self.ptr.as_ptr().is_null()); + 8000bbc8: 6108 ld a0,0(a0) + 8000bbca: 00004097 auipc ra,0x4 + 8000bbce: 296080e7 jalr 662(ra) # 8000fe60 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h911cddd192dc1ebbE> + 8000bbd2: f82a sd a0,48(sp) + 8000bbd4: a009 j 8000bbd6 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x16> + 8000bbd6: 7542 ld a0,48(sp) + 8000bbd8: ffffa097 auipc ra,0xffffa + 8000bbdc: bb2080e7 jalr -1102(ra) # 8000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E> + 8000bbe0: a009 j 8000bbe2 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x22> + 8000bbe2: a009 j 8000bbe4 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x24> + if mem::size_of::() != 0 { + 8000bbe4: a009 j 8000bbe6 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x26> + 8000bbe6: 4501 li a0,0 + 8000bbe8: e909 bnez a0,8000bbfa <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x3a> + 8000bbea: a009 j 8000bbec <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x2c> + assume(!self.end.is_null()); + 8000bbec: 7522 ld a0,40(sp) + 8000bbee: 6508 ld a0,8(a0) + 8000bbf0: ffffa097 auipc ra,0xffffa + 8000bbf4: b9a080e7 jalr -1126(ra) # 8000578a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hee9a0b1c2395b573E> + 8000bbf8: a011 j 8000bbfc <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x3c> + if mem::size_of::() != 0 { + 8000bbfa: a019 j 8000bc00 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x40> + assume(!self.end.is_null()); + 8000bbfc: a009 j 8000bbfe <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x3e> + if mem::size_of::() != 0 { + 8000bbfe: a009 j 8000bc00 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x40> + if is_empty!(self) { + 8000bc00: 7522 ld a0,40(sp) + 8000bc02: 6108 ld a0,0(a0) + 8000bc04: 00004097 auipc ra,0x4 + 8000bc08: 25c080e7 jalr 604(ra) # 8000fe60 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h911cddd192dc1ebbE> + 8000bc0c: f02a sd a0,32(sp) + 8000bc0e: a009 j 8000bc10 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x50> + 8000bc10: 7502 ld a0,32(sp) + 8000bc12: 75a2 ld a1,40(sp) + 8000bc14: 658c ld a1,8(a1) + 8000bc16: 00b51663 bne a0,a1,8000bc22 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x62> + 8000bc1a: a009 j 8000bc1c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0x5c> + 8000bc1c: 4501 li a0,0 + None + 8000bc1e: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bc20: a0b9 j 8000bc6e <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0xae> + 8000bc22: 7522 ld a0,40(sp) + 8000bc24: e8aa sd a0,80(sp) + 8000bc26: 4585 li a1,1 + 8000bc28: e42e sd a1,8(sp) + 8000bc2a: ecae sd a1,88(sp) + let old = self.ptr.as_ptr(); + 8000bc2c: 6108 ld a0,0(a0) + 8000bc2e: 00004097 auipc ra,0x4 + 8000bc32: 232080e7 jalr 562(ra) # 8000fe60 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h911cddd192dc1ebbE> + 8000bc36: 85aa mv a1,a0 + 8000bc38: 7522 ld a0,40(sp) + 8000bc3a: e82e sd a1,16(sp) + 8000bc3c: f0ae sd a1,96(sp) + self.ptr = unsafe { NonNull::new_unchecked(self.ptr.as_ptr().offset(offset)) }; + 8000bc3e: 6108 ld a0,0(a0) + 8000bc40: 00004097 auipc ra,0x4 + 8000bc44: 220080e7 jalr 544(ra) # 8000fe60 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h911cddd192dc1ebbE> + 8000bc48: 65a2 ld a1,8(sp) + 8000bc4a: ffffa097 auipc ra,0xffffa + 8000bc4e: b24080e7 jalr -1244(ra) # 8000576e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h6150def6e470518fE> + 8000bc52: 00004097 auipc ra,0x4 + 8000bc56: ffc080e7 jalr -4(ra) # 8000fc4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hd62713267129dcbeE> + 8000bc5a: 7622 ld a2,40(sp) + 8000bc5c: 85aa mv a1,a0 + 8000bc5e: 6542 ld a0,16(sp) + 8000bc60: e20c sd a1,0(a2) + old + 8000bc62: e4aa sd a0,72(sp) + Some(next_unchecked!(self)) + 8000bc64: ec2a sd a0,24(sp) + 8000bc66: a009 j 8000bc68 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0xa8> + 8000bc68: 6562 ld a0,24(sp) + 8000bc6a: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bc6c: a009 j 8000bc6e <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb379e12fde7ef54dE+0xae> + } + 8000bc6e: 7562 ld a0,56(sp) + 8000bc70: 70a6 ld ra,104(sp) + 8000bc72: 6165 addi sp,sp,112 + 8000bc74: 8082 ret + +Disassembly of section .text._ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E: + +000000008000bc76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E>: + fn next(&mut self) -> Option<$elem> { + 8000bc76: 7159 addi sp,sp,-112 + 8000bc78: f486 sd ra,104(sp) + 8000bc7a: f42a sd a0,40(sp) + 8000bc7c: e0aa sd a0,64(sp) + assume(!self.ptr.as_ptr().is_null()); + 8000bc7e: 6108 ld a0,0(a0) + 8000bc80: 00004097 auipc ra,0x4 + 8000bc84: 1b6080e7 jalr 438(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000bc88: f82a sd a0,48(sp) + 8000bc8a: a009 j 8000bc8c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x16> + 8000bc8c: 7542 ld a0,48(sp) + 8000bc8e: 00006097 auipc ra,0x6 + 8000bc92: 3c2080e7 jalr 962(ra) # 80012050 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E> + 8000bc96: a009 j 8000bc98 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x22> + 8000bc98: a009 j 8000bc9a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x24> + if mem::size_of::() != 0 { + 8000bc9a: a009 j 8000bc9c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x26> + 8000bc9c: 4501 li a0,0 + 8000bc9e: e909 bnez a0,8000bcb0 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x3a> + 8000bca0: a009 j 8000bca2 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x2c> + assume(!self.end.is_null()); + 8000bca2: 7522 ld a0,40(sp) + 8000bca4: 6508 ld a0,8(a0) + 8000bca6: 00006097 auipc ra,0x6 + 8000bcaa: 3aa080e7 jalr 938(ra) # 80012050 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E> + 8000bcae: a011 j 8000bcb2 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x3c> + if mem::size_of::() != 0 { + 8000bcb0: a019 j 8000bcb6 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x40> + assume(!self.end.is_null()); + 8000bcb2: a009 j 8000bcb4 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x3e> + if mem::size_of::() != 0 { + 8000bcb4: a009 j 8000bcb6 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x40> + if is_empty!(self) { + 8000bcb6: 7522 ld a0,40(sp) + 8000bcb8: 6108 ld a0,0(a0) + 8000bcba: 00004097 auipc ra,0x4 + 8000bcbe: 17c080e7 jalr 380(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000bcc2: f02a sd a0,32(sp) + 8000bcc4: a009 j 8000bcc6 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x50> + 8000bcc6: 7502 ld a0,32(sp) + 8000bcc8: 75a2 ld a1,40(sp) + 8000bcca: 658c ld a1,8(a1) + 8000bccc: 00b51663 bne a0,a1,8000bcd8 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x62> + 8000bcd0: a009 j 8000bcd2 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0x5c> + 8000bcd2: 4501 li a0,0 + None + 8000bcd4: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bcd6: a0b9 j 8000bd24 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0xae> + 8000bcd8: 7522 ld a0,40(sp) + 8000bcda: e8aa sd a0,80(sp) + 8000bcdc: 4585 li a1,1 + 8000bcde: e42e sd a1,8(sp) + 8000bce0: ecae sd a1,88(sp) + let old = self.ptr.as_ptr(); + 8000bce2: 6108 ld a0,0(a0) + 8000bce4: 00004097 auipc ra,0x4 + 8000bce8: 152080e7 jalr 338(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000bcec: 85aa mv a1,a0 + 8000bcee: 7522 ld a0,40(sp) + 8000bcf0: e82e sd a1,16(sp) + 8000bcf2: f0ae sd a1,96(sp) + self.ptr = unsafe { NonNull::new_unchecked(self.ptr.as_ptr().offset(offset)) }; + 8000bcf4: 6108 ld a0,0(a0) + 8000bcf6: 00004097 auipc ra,0x4 + 8000bcfa: 140080e7 jalr 320(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000bcfe: 65a2 ld a1,8(sp) + 8000bd00: 00006097 auipc ra,0x6 + 8000bd04: 334080e7 jalr 820(ra) # 80012034 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h2e4c04da2e1cf416E> + 8000bd08: 00004097 auipc ra,0x4 + 8000bd0c: f10080e7 jalr -240(ra) # 8000fc18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h4fef4ea805603accE> + 8000bd10: 7622 ld a2,40(sp) + 8000bd12: 85aa mv a1,a0 + 8000bd14: 6542 ld a0,16(sp) + 8000bd16: e20c sd a1,0(a2) + old + 8000bd18: e4aa sd a0,72(sp) + Some(next_unchecked!(self)) + 8000bd1a: ec2a sd a0,24(sp) + 8000bd1c: a009 j 8000bd1e <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0xa8> + 8000bd1e: 6562 ld a0,24(sp) + 8000bd20: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bd22: a009 j 8000bd24 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E+0xae> + } + 8000bd24: 7562 ld a0,56(sp) + 8000bd26: 70a6 ld ra,104(sp) + 8000bd28: 6165 addi sp,sp,112 + 8000bd2a: 8082 ret + +Disassembly of section .text._ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE: + +000000008000bd2c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE>: + fn next(&mut self) -> Option<$elem> { + 8000bd2c: 7159 addi sp,sp,-112 + 8000bd2e: f486 sd ra,104(sp) + 8000bd30: f42a sd a0,40(sp) + 8000bd32: e0aa sd a0,64(sp) + assume(!self.ptr.as_ptr().is_null()); + 8000bd34: 6108 ld a0,0(a0) + 8000bd36: 00004097 auipc ra,0x4 + 8000bd3a: 132080e7 jalr 306(ra) # 8000fe68 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h9b02cb35a46880f1E> + 8000bd3e: f82a sd a0,48(sp) + 8000bd40: a009 j 8000bd42 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x16> + 8000bd42: 7542 ld a0,48(sp) + 8000bd44: 00013097 auipc ra,0x13 + 8000bd48: 8e8080e7 jalr -1816(ra) # 8001e62c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h1d4bdf7317c60b96E> + 8000bd4c: a009 j 8000bd4e <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x22> + 8000bd4e: a009 j 8000bd50 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x24> + if mem::size_of::() != 0 { + 8000bd50: a009 j 8000bd52 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x26> + 8000bd52: 4501 li a0,0 + 8000bd54: e909 bnez a0,8000bd66 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x3a> + 8000bd56: a009 j 8000bd58 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x2c> + assume(!self.end.is_null()); + 8000bd58: 7522 ld a0,40(sp) + 8000bd5a: 6508 ld a0,8(a0) + 8000bd5c: 00013097 auipc ra,0x13 + 8000bd60: 8d0080e7 jalr -1840(ra) # 8001e62c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h1d4bdf7317c60b96E> + 8000bd64: a011 j 8000bd68 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x3c> + if mem::size_of::() != 0 { + 8000bd66: a019 j 8000bd6c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x40> + assume(!self.end.is_null()); + 8000bd68: a009 j 8000bd6a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x3e> + if mem::size_of::() != 0 { + 8000bd6a: a009 j 8000bd6c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x40> + if is_empty!(self) { + 8000bd6c: 7522 ld a0,40(sp) + 8000bd6e: 6108 ld a0,0(a0) + 8000bd70: 00004097 auipc ra,0x4 + 8000bd74: 0f8080e7 jalr 248(ra) # 8000fe68 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h9b02cb35a46880f1E> + 8000bd78: f02a sd a0,32(sp) + 8000bd7a: a009 j 8000bd7c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x50> + 8000bd7c: 7502 ld a0,32(sp) + 8000bd7e: 75a2 ld a1,40(sp) + 8000bd80: 658c ld a1,8(a1) + 8000bd82: 00b51663 bne a0,a1,8000bd8e <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x62> + 8000bd86: a009 j 8000bd88 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0x5c> + 8000bd88: 4501 li a0,0 + None + 8000bd8a: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bd8c: a0b9 j 8000bdda <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0xae> + 8000bd8e: 7522 ld a0,40(sp) + 8000bd90: e8aa sd a0,80(sp) + 8000bd92: 4585 li a1,1 + 8000bd94: e42e sd a1,8(sp) + 8000bd96: ecae sd a1,88(sp) + let old = self.ptr.as_ptr(); + 8000bd98: 6108 ld a0,0(a0) + 8000bd9a: 00004097 auipc ra,0x4 + 8000bd9e: 0ce080e7 jalr 206(ra) # 8000fe68 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h9b02cb35a46880f1E> + 8000bda2: 85aa mv a1,a0 + 8000bda4: 7522 ld a0,40(sp) + 8000bda6: e82e sd a1,16(sp) + 8000bda8: f0ae sd a1,96(sp) + self.ptr = unsafe { NonNull::new_unchecked(self.ptr.as_ptr().offset(offset)) }; + 8000bdaa: 6108 ld a0,0(a0) + 8000bdac: 00004097 auipc ra,0x4 + 8000bdb0: 0bc080e7 jalr 188(ra) # 8000fe68 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h9b02cb35a46880f1E> + 8000bdb4: 65a2 ld a1,8(sp) + 8000bdb6: 00013097 auipc ra,0x13 + 8000bdba: 85a080e7 jalr -1958(ra) # 8001e610 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17he4f714b54e872ab3E> + 8000bdbe: 00004097 auipc ra,0x4 + 8000bdc2: ea4080e7 jalr -348(ra) # 8000fc62 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hf41e3912db402547E> + 8000bdc6: 7622 ld a2,40(sp) + 8000bdc8: 85aa mv a1,a0 + 8000bdca: 6542 ld a0,16(sp) + 8000bdcc: e20c sd a1,0(a2) + old + 8000bdce: e4aa sd a0,72(sp) + Some(next_unchecked!(self)) + 8000bdd0: ec2a sd a0,24(sp) + 8000bdd2: a009 j 8000bdd4 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0xa8> + 8000bdd4: 6562 ld a0,24(sp) + 8000bdd6: fc2a sd a0,56(sp) + if is_empty!(self) { + 8000bdd8: a009 j 8000bdda <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE+0xae> + } + 8000bdda: 7562 ld a0,56(sp) + 8000bddc: 70a6 ld ra,104(sp) + 8000bdde: 6165 addi sp,sp,112 + 8000bde0: 8082 ret + +Disassembly of section .text._ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E: + +000000008000bde2 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E>: + + // We override the default implementation, which uses `try_fold`, + // because this simple implementation generates less LLVM IR and is + // faster to compile. + #[inline] + fn for_each(mut self, mut f: F) + 8000bde2: 7139 addi sp,sp,-64 + 8000bde4: fc06 sd ra,56(sp) + 8000bde6: e42a sd a0,8(sp) + 8000bde8: e82e sd a1,16(sp) + 8000bdea: a009 j 8000bdec <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E+0xa> + 8000bdec: 0028 addi a0,sp,8 + where + Self: Sized, + F: FnMut(Self::Item), + { + while let Some(x) = self.next() { + 8000bdee: 00000097 auipc ra,0x0 + 8000bdf2: c66080e7 jalr -922(ra) # 8000ba54 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h1ffaf15da7599f33E> + 8000bdf6: f02a sd a0,32(sp) + 8000bdf8: a009 j 8000bdfa <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E+0x18> + 8000bdfa: 7502 ld a0,32(sp) + 8000bdfc: 4581 li a1,0 + 8000bdfe: 00b51463 bne a0,a1,8000be06 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E+0x24> + 8000be02: a009 j 8000be04 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E+0x22> + f(x); + } + } + 8000be04: a819 j 8000be1a <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E+0x38> + while let Some(x) = self.next() { + 8000be06: 7582 ld a1,32(sp) + 8000be08: f82e sd a1,48(sp) + f(x); + 8000be0a: f42e sd a1,40(sp) + 8000be0c: 0828 addi a0,sp,24 + 8000be0e: 00001097 auipc ra,0x1 + 8000be12: 636080e7 jalr 1590(ra) # 8000d444 <_ZN6kernel6driver11virtio_disk4Disk4init28_$u7b$$u7b$closure$u7d$$u7d$17h8a5adb868ad71917E> + 8000be16: a009 j 8000be18 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E+0x36> + while let Some(x) = self.next() { + 8000be18: bfd1 j 8000bdec <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E+0xa> + } + 8000be1a: 70e2 ld ra,56(sp) + 8000be1c: 6121 addi sp,sp,64 + 8000be1e: 8082 ret + +Disassembly of section .text._ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17h375e002d3a518d66E: + +000000008000be20 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17h375e002d3a518d66E>: + // so the call to `add` is safe. + unsafe { ptr::slice_from_raw_parts(slice.as_ptr().add(self.start), self.end - self.start) } + } + + #[inline] + unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut [T] { + 8000be20: 7159 addi sp,sp,-112 + 8000be22: f486 sd ra,104(sp) + 8000be24: f036 sd a3,32(sp) + 8000be26: f832 sd a2,48(sp) + 8000be28: 862e mv a2,a1 + 8000be2a: 7582 ld a1,32(sp) + 8000be2c: f432 sd a2,40(sp) + 8000be2e: 86aa mv a3,a0 + 8000be30: 7542 ld a0,48(sp) + 8000be32: fc36 sd a3,56(sp) + 8000be34: e4b6 sd a3,72(sp) + 8000be36: e8b2 sd a2,80(sp) + 8000be38: ecaa sd a0,88(sp) + 8000be3a: f0ae sd a1,96(sp) + // SAFETY: see comments for `get_unchecked` above. + unsafe { + ptr::slice_from_raw_parts_mut(slice.as_mut_ptr().add(self.start), self.end - self.start) + 8000be3c: 00015097 auipc ra,0x15 + 8000be40: 836080e7 jalr -1994(ra) # 80020672 <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h80398cc0098c8b0fE> + 8000be44: e0aa sd a0,64(sp) + 8000be46: a009 j 8000be48 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17h375e002d3a518d66E+0x28> + 8000be48: 75e2 ld a1,56(sp) + 8000be4a: 6506 ld a0,64(sp) + 8000be4c: 00014097 auipc ra,0x14 + 8000be50: 780080e7 jalr 1920(ra) # 800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E> + 8000be54: ec2a sd a0,24(sp) + 8000be56: a009 j 8000be58 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17h375e002d3a518d66E+0x38> + 8000be58: 6562 ld a0,24(sp) + 8000be5a: 75a2 ld a1,40(sp) + 8000be5c: 7662 ld a2,56(sp) + 8000be5e: 8d91 sub a1,a1,a2 + 8000be60: 00017097 auipc ra,0x17 + 8000be64: 816080e7 jalr -2026(ra) # 80022676 <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E> + 8000be68: e42a sd a0,8(sp) + 8000be6a: e82e sd a1,16(sp) + 8000be6c: a009 j 8000be6e <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17h375e002d3a518d66E+0x4e> + } + } + 8000be6e: 65c2 ld a1,16(sp) + 8000be70: 6522 ld a0,8(sp) + 8000be72: 70a6 ld ra,104(sp) + 8000be74: 6165 addi sp,sp,112 + 8000be76: 8082 ret + +Disassembly of section .text._ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E: + +000000008000be78 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E>: + // SAFETY: `self` is checked to be valid and in bounds above. + unsafe { &*self.get_unchecked(slice) } + } + + #[inline] + fn index_mut(self, slice: &mut [T]) -> &mut [T] { + 8000be78: 7159 addi sp,sp,-112 + 8000be7a: f486 sd ra,104(sp) + 8000be7c: f03a sd a4,32(sp) + 8000be7e: f436 sd a3,40(sp) + 8000be80: f832 sd a2,48(sp) + 8000be82: fc2e sd a1,56(sp) + 8000be84: e0aa sd a0,64(sp) + 8000be86: e4aa sd a0,72(sp) + 8000be88: e8ae sd a1,80(sp) + 8000be8a: ecb2 sd a2,88(sp) + 8000be8c: f0b6 sd a3,96(sp) + if self.start > self.end { + 8000be8e: 00a5fb63 bgeu a1,a0,8000bea4 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E+0x2c> + 8000be92: a009 j 8000be94 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E+0x1c> + slice_index_order_fail(self.start, self.end); + 8000be94: 7602 ld a2,32(sp) + 8000be96: 75e2 ld a1,56(sp) + 8000be98: 6506 ld a0,64(sp) + 8000be9a: 00019097 auipc ra,0x19 + 8000be9e: ab8080e7 jalr -1352(ra) # 80024952 <_ZN4core5slice5index22slice_index_order_fail17h8c18576576dbf4e3E> + 8000bea2: 0000 unimp + } else if self.end > slice.len() { + 8000bea4: 75a2 ld a1,40(sp) + 8000bea6: 7542 ld a0,48(sp) + 8000bea8: 00014097 auipc ra,0x14 + 8000beac: 5fa080e7 jalr 1530(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 8000beb0: ec2a sd a0,24(sp) + 8000beb2: a009 j 8000beb4 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E+0x3c> + 8000beb4: 6562 ld a0,24(sp) + 8000beb6: 75e2 ld a1,56(sp) + 8000beb8: 00b57b63 bgeu a0,a1,8000bece <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E+0x56> + 8000bebc: a009 j 8000bebe <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E+0x46> + slice_end_index_len_fail(self.end, slice.len()); + 8000bebe: 75a2 ld a1,40(sp) + 8000bec0: 7542 ld a0,48(sp) + 8000bec2: 00014097 auipc ra,0x14 + 8000bec6: 5e0080e7 jalr 1504(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 8000beca: e82a sd a0,16(sp) + 8000becc: a821 j 8000bee4 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E+0x6c> + } + // SAFETY: `self` is checked to be valid and in bounds above. + unsafe { &mut *self.get_unchecked_mut(slice) } + 8000bece: 76a2 ld a3,40(sp) + 8000bed0: 7642 ld a2,48(sp) + 8000bed2: 75e2 ld a1,56(sp) + 8000bed4: 6506 ld a0,64(sp) + 8000bed6: 00000097 auipc ra,0x0 + 8000beda: f4a080e7 jalr -182(ra) # 8000be20 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17h375e002d3a518d66E> + 8000bede: e02a sd a0,0(sp) + 8000bee0: e42e sd a1,8(sp) + 8000bee2: a809 j 8000bef4 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E+0x7c> + slice_end_index_len_fail(self.end, slice.len()); + 8000bee4: 7602 ld a2,32(sp) + 8000bee6: 65c2 ld a1,16(sp) + 8000bee8: 7562 ld a0,56(sp) + 8000beea: 00019097 auipc ra,0x19 + 8000beee: a28080e7 jalr -1496(ra) # 80024912 <_ZN4core5slice5index24slice_end_index_len_fail17hbdcbb59c061b5014E> + 8000bef2: 0000 unimp + } + 8000bef4: 65a2 ld a1,8(sp) + 8000bef6: 6502 ld a0,0(sp) + 8000bef8: 70a6 ld ra,104(sp) + 8000befa: 6165 addi sp,sp,112 + 8000befc: 8082 ret + +Disassembly of section .text._ZN108_$LT$core..ops..range..RangeTo$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17h6e1483f88545dbc6E: + +000000008000befe <_ZN108_$LT$core..ops..range..RangeTo$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17h6e1483f88545dbc6E>: + fn index(self, slice: &[T]) -> &[T] { + (0..self.end).index(slice) + } + + #[inline] + fn index_mut(self, slice: &mut [T]) -> &mut [T] { + 8000befe: 7139 addi sp,sp,-64 + 8000bf00: fc06 sd ra,56(sp) + 8000bf02: 8736 mv a4,a3 + 8000bf04: 86b2 mv a3,a2 + 8000bf06: 862e mv a2,a1 + 8000bf08: 85aa mv a1,a0 + 8000bf0a: f02e sd a1,32(sp) + 8000bf0c: f432 sd a2,40(sp) + 8000bf0e: f836 sd a3,48(sp) + 8000bf10: 4501 li a0,0 + (0..self.end).index_mut(slice) + 8000bf12: e82a sd a0,16(sp) + 8000bf14: ec2e sd a1,24(sp) + 8000bf16: 00000097 auipc ra,0x0 + 8000bf1a: f62080e7 jalr -158(ra) # 8000be78 <_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hbf20116633f62746E> + 8000bf1e: e02a sd a0,0(sp) + 8000bf20: e42e sd a1,8(sp) + 8000bf22: a009 j 8000bf24 <_ZN108_$LT$core..ops..range..RangeTo$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17h6e1483f88545dbc6E+0x26> + } + 8000bf24: 65a2 ld a1,8(sp) + 8000bf26: 6502 ld a0,0(sp) + 8000bf28: 70e2 ld ra,56(sp) + 8000bf2a: 6121 addi sp,sp,64 + 8000bf2c: 8082 ret + +Disassembly of section .text._ZN4core3ops5range25RangeInclusive$LT$Idx$GT$3new17h55e0942ec6ff79cbE: + +000000008000bf2e <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$3new17h55e0942ec6ff79cbE>: + #[lang = "range_inclusive_new"] + #[stable(feature = "inclusive_range_methods", since = "1.27.0")] + #[inline] + #[rustc_promotable] + #[rustc_const_stable(feature = "const_range_new", since = "1.32.0")] + pub const fn new(start: Idx, end: Idx) -> Self { + 8000bf2e: 1101 addi sp,sp,-32 + 8000bf30: e42e sd a1,8(sp) + 8000bf32: 85aa mv a1,a0 + 8000bf34: 6522 ld a0,8(sp) + 8000bf36: e82a sd a0,16(sp) + 8000bf38: ec32 sd a2,24(sp) + Self { start, end, exhausted: false } + 8000bf3a: e188 sd a0,0(a1) + 8000bf3c: e590 sd a2,8(a1) + 8000bf3e: 4501 li a0,0 + 8000bf40: 00a58823 sb a0,16(a1) + } + 8000bf44: 6105 addi sp,sp,32 + 8000bf46: 8082 ret + +Disassembly of section .text._ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE: + +000000008000bf48 <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE>: + /// // Precise field values are unspecified here + /// assert!(r.is_empty()); + /// ``` + #[stable(feature = "range_is_empty", since = "1.47.0")] + #[inline] + pub fn is_empty(&self) -> bool { + 8000bf48: 7179 addi sp,sp,-48 + 8000bf4a: f406 sd ra,40(sp) + 8000bf4c: e82a sd a0,16(sp) + 8000bf4e: f02a sd a0,32(sp) + self.exhausted || !(self.start <= self.end) + 8000bf50: 01054503 lbu a0,16(a0) + 8000bf54: 8905 andi a0,a0,1 + 8000bf56: 4581 li a1,0 + 8000bf58: 00b50b63 beq a0,a1,8000bf6e <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE+0x26> + 8000bf5c: a009 j 8000bf5e <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE+0x16> + 8000bf5e: 4505 li a0,1 + 8000bf60: 00a10fa3 sb a0,31(sp) + 8000bf64: a831 j 8000bf80 <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE+0x38> + 8000bf66: 4501 li a0,0 + 8000bf68: 00a10fa3 sb a0,31(sp) + 8000bf6c: a811 j 8000bf80 <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE+0x38> + 8000bf6e: 6542 ld a0,16(sp) + 8000bf70: 00850593 addi a1,a0,8 + 8000bf74: 00010097 auipc ra,0x10 + 8000bf78: 630080e7 jalr 1584(ra) # 8001c5a4 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2le17hf6519ff85d133637E> + 8000bf7c: e42a sd a0,8(sp) + 8000bf7e: a031 j 8000bf8a <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE+0x42> + } + 8000bf80: 01f14503 lbu a0,31(sp) + 8000bf84: 70a2 ld ra,40(sp) + 8000bf86: 6145 addi sp,sp,48 + 8000bf88: 8082 ret + 8000bf8a: 6522 ld a0,8(sp) + 8000bf8c: 4581 li a1,0 + self.exhausted || !(self.start <= self.end) + 8000bf8e: fcb508e3 beq a0,a1,8000bf5e <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE+0x16> + 8000bf92: bfd1 j 8000bf66 <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE+0x1e> + +Disassembly of section .text._ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E: + +000000008000bf94 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E>: + (0, Some(0)) + } + } + + #[inline] + fn nth(&mut self, n: usize) -> Option { + 8000bf94: 7119 addi sp,sp,-128 + 8000bf96: fc86 sd ra,120(sp) + 8000bf98: f02e sd a1,32(sp) + 8000bf9a: f42a sd a0,40(sp) + 8000bf9c: f4aa sd a0,104(sp) + 8000bf9e: f8ae sd a1,112(sp) + 8000bfa0: 4581 li a1,0 + if let Some(plus_n) = Step::forward_checked(self.start.clone(), n) { + 8000bfa2: 06b103a3 sb a1,103(sp) + 8000bfa6: 00012097 auipc ra,0x12 + 8000bfaa: 71e080e7 jalr 1822(ra) # 8001e6c4 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E> + 8000bfae: f82a sd a0,48(sp) + 8000bfb0: a009 j 8000bfb2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x1e> + 8000bfb2: 7582 ld a1,32(sp) + 8000bfb4: 7542 ld a0,48(sp) + 8000bfb6: 4605 li a2,1 + 8000bfb8: 06c103a3 sb a2,103(sp) + 8000bfbc: 00013097 auipc ra,0x13 + 8000bfc0: 16c080e7 jalr 364(ra) # 8001f128 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h89a22c0b5326f750E> + 8000bfc4: e4aa sd a0,72(sp) + 8000bfc6: e8ae sd a1,80(sp) + 8000bfc8: a009 j 8000bfca <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x36> + 8000bfca: 6526 ld a0,72(sp) + 8000bfcc: 4581 li a1,0 + 8000bfce: 00b51463 bne a0,a1,8000bfd6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x42> + 8000bfd2: a009 j 8000bfd4 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x40> + 8000bfd4: a859 j 8000c06a <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xd6> + 8000bfd6: 7522 ld a0,40(sp) + 8000bfd8: 4581 li a1,0 + 8000bfda: 06b103a3 sb a1,103(sp) + 8000bfde: 65c6 ld a1,80(sp) + 8000bfe0: ecae sd a1,88(sp) + if plus_n < self.end { + 8000bfe2: 00850593 addi a1,a0,8 + 8000bfe6: 08a8 addi a0,sp,88 + 8000bfe8: 00010097 auipc ra,0x10 + 8000bfec: 5d8080e7 jalr 1496(ra) # 8001c5c0 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha09858e1dc8f460eE> + 8000bff0: ec2a sd a0,24(sp) + 8000bff2: a009 j 8000bff4 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x60> + 8000bff4: 6562 ld a0,24(sp) + 8000bff6: 4581 li a1,0 + 8000bff8: 00b50a63 beq a0,a1,8000c00c <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x78> + 8000bffc: a009 j 8000bffe <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x6a> + 8000bffe: 08a8 addi a0,sp,88 + // SAFETY: just checked precondition + self.start = unsafe { Step::forward_unchecked(plus_n.clone(), 1) }; + 8000c000: 00012097 auipc ra,0x12 + 8000c004: 6c4080e7 jalr 1732(ra) # 8001e6c4 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E> + 8000c008: e82a sd a0,16(sp) + 8000c00a: a011 j 8000c00e <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x7a> + return Some(plus_n); + } + } + 8000c00c: a811 j 8000c020 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x8c> + self.start = unsafe { Step::forward_unchecked(plus_n.clone(), 1) }; + 8000c00e: 6542 ld a0,16(sp) + 8000c010: 4585 li a1,1 + 8000c012: 00013097 auipc ra,0x13 + 8000c016: 150080e7 jalr 336(ra) # 8001f162 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h4b00136ef7a8c813E> + 8000c01a: e42a sd a0,8(sp) + 8000c01c: a009 j 8000c01e <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x8a> + 8000c01e: a801 j 8000c02e <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x9a> + if let Some(plus_n) = Step::forward_checked(self.start.clone(), n) { + 8000c020: a0a9 j 8000c06a <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xd6> + + self.start = self.end.clone(); + 8000c022: a889 j 8000c074 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xe0> + None + } + 8000c024: 7562 ld a0,56(sp) + 8000c026: 6586 ld a1,64(sp) + 8000c028: 70e6 ld ra,120(sp) + 8000c02a: 6109 addi sp,sp,128 + 8000c02c: 8082 ret + self.start = unsafe { Step::forward_unchecked(plus_n.clone(), 1) }; + 8000c02e: 6522 ld a0,8(sp) + 8000c030: 75a2 ld a1,40(sp) + 8000c032: e188 sd a0,0(a1) + return Some(plus_n); + 8000c034: 6566 ld a0,88(sp) + 8000c036: e0aa sd a0,64(sp) + 8000c038: 4505 li a0,1 + 8000c03a: fc2a sd a0,56(sp) + 8000c03c: 4501 li a0,0 + } + 8000c03e: 06a103a3 sb a0,103(sp) + } + 8000c042: b7cd j 8000c024 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x90> + 8000c044: 7522 ld a0,40(sp) + 8000c046: 4581 li a1,0 + } + 8000c048: 06b103a3 sb a1,103(sp) + self.start = self.end.clone(); + 8000c04c: 0521 addi a0,a0,8 + 8000c04e: 00012097 auipc ra,0x12 + 8000c052: 676080e7 jalr 1654(ra) # 8001e6c4 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E> + 8000c056: e02a sd a0,0(sp) + 8000c058: b7e9 j 8000c022 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x8e> + } + 8000c05a: 06714503 lbu a0,103(sp) + 8000c05e: 8905 andi a0,a0,1 + 8000c060: 4581 li a1,0 + 8000c062: feb501e3 beq a0,a1,8000c044 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xb0> + 8000c066: a009 j 8000c068 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xd4> + 8000c068: bff1 j 8000c044 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xb0> + 8000c06a: 6526 ld a0,72(sp) + 8000c06c: 4581 li a1,0 + 8000c06e: feb516e3 bne a0,a1,8000c05a <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xc6> + 8000c072: bfc9 j 8000c044 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0xb0> + self.start = self.end.clone(); + 8000c074: 6502 ld a0,0(sp) + 8000c076: 75a2 ld a1,40(sp) + 8000c078: e188 sd a0,0(a1) + 8000c07a: 4501 li a0,0 + None + 8000c07c: fc2a sd a0,56(sp) + } + 8000c07e: b75d j 8000c024 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E+0x90> + +Disassembly of section .text._ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E: + +000000008000c080 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E>: + fn nth(&mut self, n: usize) -> Option { + 8000c080: 7159 addi sp,sp,-112 + 8000c082: f486 sd ra,104(sp) + 8000c084: f42e sd a1,40(sp) + 8000c086: f82a sd a0,48(sp) + 8000c088: ecaa sd a0,88(sp) + 8000c08a: f0ae sd a1,96(sp) + 8000c08c: 4581 li a1,0 + if let Some(plus_n) = Step::forward_checked(self.start.clone(), n) { + 8000c08e: 04b10ba3 sb a1,87(sp) + 8000c092: 00012097 auipc ra,0x12 + 8000c096: 61c080e7 jalr 1564(ra) # 8001e6ae <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u32$GT$5clone17ha1019ce9fdc4d620E> + 8000c09a: fc2a sd a0,56(sp) + 8000c09c: a009 j 8000c09e <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x1e> + 8000c09e: 75a2 ld a1,40(sp) + 8000c0a0: 7562 ld a0,56(sp) + 8000c0a2: 4605 li a2,1 + 8000c0a4: 04c10ba3 sb a2,87(sp) + 8000c0a8: 00013097 auipc ra,0x13 + 8000c0ac: 010080e7 jalr 16(ra) # 8001f0b8 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E> + 8000c0b0: c4aa sw a0,72(sp) + 8000c0b2: c6ae sw a1,76(sp) + 8000c0b4: a009 j 8000c0b6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x36> + 8000c0b6: 4526 lw a0,72(sp) + 8000c0b8: 4581 li a1,0 + 8000c0ba: 00b51463 bne a0,a1,8000c0c2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x42> + 8000c0be: a009 j 8000c0c0 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x40> + 8000c0c0: a859 j 8000c156 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xd6> + 8000c0c2: 7542 ld a0,48(sp) + 8000c0c4: 4581 li a1,0 + 8000c0c6: 04b10ba3 sb a1,87(sp) + 8000c0ca: 45b6 lw a1,76(sp) + 8000c0cc: c8ae sw a1,80(sp) + if plus_n < self.end { + 8000c0ce: 00450593 addi a1,a0,4 + 8000c0d2: 0888 addi a0,sp,80 + 8000c0d4: 00010097 auipc ra,0x10 + 8000c0d8: 496080e7 jalr 1174(ra) # 8001c56a <_ZN4core3cmp5impls55_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$u32$GT$2lt17h9cf9ff1045241cdfE> + 8000c0dc: f02a sd a0,32(sp) + 8000c0de: a009 j 8000c0e0 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x60> + 8000c0e0: 7502 ld a0,32(sp) + 8000c0e2: 4581 li a1,0 + 8000c0e4: 00b50a63 beq a0,a1,8000c0f8 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x78> + 8000c0e8: a009 j 8000c0ea <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x6a> + 8000c0ea: 0888 addi a0,sp,80 + self.start = unsafe { Step::forward_unchecked(plus_n.clone(), 1) }; + 8000c0ec: 00012097 auipc ra,0x12 + 8000c0f0: 5c2080e7 jalr 1474(ra) # 8001e6ae <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u32$GT$5clone17ha1019ce9fdc4d620E> + 8000c0f4: ec2a sd a0,24(sp) + 8000c0f6: a011 j 8000c0fa <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x7a> + } + 8000c0f8: a811 j 8000c10c <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x8c> + self.start = unsafe { Step::forward_unchecked(plus_n.clone(), 1) }; + 8000c0fa: 6562 ld a0,24(sp) + 8000c0fc: 4585 li a1,1 + 8000c0fe: 00013097 auipc ra,0x13 + 8000c102: 00e080e7 jalr 14(ra) # 8001f10c <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17hd82fe8ce42e2d29dE> + 8000c106: e82a sd a0,16(sp) + 8000c108: a009 j 8000c10a <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x8a> + 8000c10a: a801 j 8000c11a <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x9a> + if let Some(plus_n) = Step::forward_checked(self.start.clone(), n) { + 8000c10c: a0a9 j 8000c156 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xd6> + self.start = self.end.clone(); + 8000c10e: a889 j 8000c160 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xe0> + } + 8000c110: 4506 lw a0,64(sp) + 8000c112: 4596 lw a1,68(sp) + 8000c114: 70a6 ld ra,104(sp) + 8000c116: 6165 addi sp,sp,112 + 8000c118: 8082 ret + self.start = unsafe { Step::forward_unchecked(plus_n.clone(), 1) }; + 8000c11a: 6542 ld a0,16(sp) + 8000c11c: 75c2 ld a1,48(sp) + 8000c11e: c188 sw a0,0(a1) + return Some(plus_n); + 8000c120: 4546 lw a0,80(sp) + 8000c122: c2aa sw a0,68(sp) + 8000c124: 4505 li a0,1 + 8000c126: c0aa sw a0,64(sp) + 8000c128: 4501 li a0,0 + } + 8000c12a: 04a10ba3 sb a0,87(sp) + } + 8000c12e: b7cd j 8000c110 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x90> + 8000c130: 7542 ld a0,48(sp) + 8000c132: 4581 li a1,0 + } + 8000c134: 04b10ba3 sb a1,87(sp) + self.start = self.end.clone(); + 8000c138: 0511 addi a0,a0,4 + 8000c13a: 00012097 auipc ra,0x12 + 8000c13e: 574080e7 jalr 1396(ra) # 8001e6ae <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u32$GT$5clone17ha1019ce9fdc4d620E> + 8000c142: e42a sd a0,8(sp) + 8000c144: b7e9 j 8000c10e <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x8e> + } + 8000c146: 05714503 lbu a0,87(sp) + 8000c14a: 8905 andi a0,a0,1 + 8000c14c: 4581 li a1,0 + 8000c14e: feb501e3 beq a0,a1,8000c130 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xb0> + 8000c152: a009 j 8000c154 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xd4> + 8000c154: bff1 j 8000c130 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xb0> + 8000c156: 4526 lw a0,72(sp) + 8000c158: 4581 li a1,0 + 8000c15a: feb516e3 bne a0,a1,8000c146 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xc6> + 8000c15e: bfc9 j 8000c130 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0xb0> + self.start = self.end.clone(); + 8000c160: 6522 ld a0,8(sp) + 8000c162: 75c2 ld a1,48(sp) + 8000c164: c188 sw a0,0(a1) + 8000c166: 4501 li a0,0 + None + 8000c168: c0aa sw a0,64(sp) + } + 8000c16a: b75d j 8000c110 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E+0x90> + +Disassembly of section .text._ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE: + +000000008000c16c <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE>: + fn next(&mut self) -> Option { + 8000c16c: 715d addi sp,sp,-80 + 8000c16e: e486 sd ra,72(sp) + 8000c170: f02a sd a0,32(sp) + 8000c172: fc2a sd a0,56(sp) + if self.start < self.end { + 8000c174: 00250593 addi a1,a0,2 + 8000c178: 00010097 auipc ra,0x10 + 8000c17c: 3dc080e7 jalr 988(ra) # 8001c554 <_ZN4core3cmp5impls55_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$u16$GT$2lt17h2ba0f37fe46e7bafE> + 8000c180: f42a sd a0,40(sp) + 8000c182: a009 j 8000c184 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x18> + 8000c184: 7522 ld a0,40(sp) + 8000c186: 4581 li a1,0 + 8000c188: 00b50a63 beq a0,a1,8000c19c <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x30> + 8000c18c: a009 j 8000c18e <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x22> + let n = unsafe { Step::forward_unchecked(self.start.clone(), 1) }; + 8000c18e: 7502 ld a0,32(sp) + 8000c190: 00012097 auipc ra,0x12 + 8000c194: 512080e7 jalr 1298(ra) # 8001e6a2 <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u16$GT$5clone17h7947cab6b7dc7abbE> + 8000c198: ec2a sd a0,24(sp) + 8000c19a: a029 j 8000c1a4 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x38> + 8000c19c: 4501 li a0,0 + None + 8000c19e: 02a11823 sh a0,48(sp) + if self.start < self.end { + 8000c1a2: a81d j 8000c1d8 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x6c> + let n = unsafe { Step::forward_unchecked(self.start.clone(), 1) }; + 8000c1a4: 6562 ld a0,24(sp) + 8000c1a6: 4585 li a1,1 + 8000c1a8: 00013097 auipc ra,0x13 + 8000c1ac: ef2080e7 jalr -270(ra) # 8001f09a <_ZN47_$LT$u16$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h3535906832610659E> + 8000c1b0: 85aa mv a1,a0 + 8000c1b2: e82e sd a1,16(sp) + 8000c1b4: 04a11323 sh a0,70(sp) + 8000c1b8: a009 j 8000c1ba <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x4e> + Some(mem::replace(&mut self.start, n)) + 8000c1ba: 65c2 ld a1,16(sp) + 8000c1bc: 7502 ld a0,32(sp) + 8000c1be: 00012097 auipc ra,0x12 + 8000c1c2: e8e080e7 jalr -370(ra) # 8001e04c <_ZN4core3mem7replace17h57a15db6942c9267E> + 8000c1c6: e42a sd a0,8(sp) + 8000c1c8: a009 j 8000c1ca <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x5e> + 8000c1ca: 6522 ld a0,8(sp) + 8000c1cc: 02a11923 sh a0,50(sp) + 8000c1d0: 4505 li a0,1 + 8000c1d2: 02a11823 sh a0,48(sp) + if self.start < self.end { + 8000c1d6: a009 j 8000c1d8 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h1063a80d56ceadabE+0x6c> + } + 8000c1d8: 03011503 lh a0,48(sp) + 8000c1dc: 03211583 lh a1,50(sp) + 8000c1e0: 60a6 ld ra,72(sp) + 8000c1e2: 6161 addi sp,sp,80 + 8000c1e4: 8082 ret + +Disassembly of section .text._ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE: + +000000008000c1e6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE>: + fn next(&mut self) -> Option { + 8000c1e6: 715d addi sp,sp,-80 + 8000c1e8: e486 sd ra,72(sp) + 8000c1ea: f02a sd a0,32(sp) + 8000c1ec: fc2a sd a0,56(sp) + if self.start < self.end { + 8000c1ee: 00450593 addi a1,a0,4 + 8000c1f2: 00010097 auipc ra,0x10 + 8000c1f6: 378080e7 jalr 888(ra) # 8001c56a <_ZN4core3cmp5impls55_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$u32$GT$2lt17h9cf9ff1045241cdfE> + 8000c1fa: f42a sd a0,40(sp) + 8000c1fc: a009 j 8000c1fe <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x18> + 8000c1fe: 7522 ld a0,40(sp) + 8000c200: 4581 li a1,0 + 8000c202: 00b50a63 beq a0,a1,8000c216 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x30> + 8000c206: a009 j 8000c208 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x22> + let n = unsafe { Step::forward_unchecked(self.start.clone(), 1) }; + 8000c208: 7502 ld a0,32(sp) + 8000c20a: 00012097 auipc ra,0x12 + 8000c20e: 4a4080e7 jalr 1188(ra) # 8001e6ae <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u32$GT$5clone17ha1019ce9fdc4d620E> + 8000c212: ec2a sd a0,24(sp) + 8000c214: a021 j 8000c21c <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x36> + 8000c216: 4501 li a0,0 + None + 8000c218: d82a sw a0,48(sp) + if self.start < self.end { + 8000c21a: a805 j 8000c24a <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x64> + let n = unsafe { Step::forward_unchecked(self.start.clone(), 1) }; + 8000c21c: 6562 ld a0,24(sp) + 8000c21e: 4585 li a1,1 + 8000c220: 00013097 auipc ra,0x13 + 8000c224: eec080e7 jalr -276(ra) # 8001f10c <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17hd82fe8ce42e2d29dE> + 8000c228: 85aa mv a1,a0 + 8000c22a: e82e sd a1,16(sp) + 8000c22c: c2aa sw a0,68(sp) + 8000c22e: a009 j 8000c230 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x4a> + Some(mem::replace(&mut self.start, n)) + 8000c230: 65c2 ld a1,16(sp) + 8000c232: 7502 ld a0,32(sp) + 8000c234: 00012097 auipc ra,0x12 + 8000c238: f6a080e7 jalr -150(ra) # 8001e19e <_ZN4core3mem7replace17hcd75ca48f5a8a8f5E> + 8000c23c: e42a sd a0,8(sp) + 8000c23e: a009 j 8000c240 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x5a> + 8000c240: 6522 ld a0,8(sp) + 8000c242: da2a sw a0,52(sp) + 8000c244: 4505 li a0,1 + 8000c246: d82a sw a0,48(sp) + if self.start < self.end { + 8000c248: a009 j 8000c24a <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE+0x64> + } + 8000c24a: 5542 lw a0,48(sp) + 8000c24c: 55d2 lw a1,52(sp) + 8000c24e: 60a6 ld ra,72(sp) + 8000c250: 6161 addi sp,sp,80 + 8000c252: 8082 ret + +Disassembly of section .text._ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E: + +000000008000c254 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E>: +} + +#[stable(feature = "inclusive_range", since = "1.26.0")] +impl DoubleEndedIterator for ops::RangeInclusive { + #[inline] + fn next_back(&mut self) -> Option { + 8000c254: 711d addi sp,sp,-96 + 8000c256: ec86 sd ra,88(sp) + 8000c258: ec2a sd a0,24(sp) + 8000c25a: e0aa sd a0,64(sp) + if self.is_empty() { + 8000c25c: 00000097 auipc ra,0x0 + 8000c260: cec080e7 jalr -788(ra) # 8000bf48 <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$8is_empty17h217535e9c22b3affE> + 8000c264: f02a sd a0,32(sp) + 8000c266: a009 j 8000c268 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x14> + 8000c268: 7502 ld a0,32(sp) + 8000c26a: 4581 li a1,0 + 8000c26c: 00b50663 beq a0,a1,8000c278 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x24> + 8000c270: a009 j 8000c272 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x1e> + 8000c272: 4501 li a0,0 + return None; + 8000c274: f42a sd a0,40(sp) + mem::replace(&mut self.end, n) + } else { + self.exhausted = true; + self.end.clone() + }) + } + 8000c276: a8bd j 8000c2f4 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0xa0> + let is_iterating = self.start < self.end; + 8000c278: 6562 ld a0,24(sp) + 8000c27a: 00850593 addi a1,a0,8 + 8000c27e: 00010097 auipc ra,0x10 + 8000c282: 342080e7 jalr 834(ra) # 8001c5c0 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha09858e1dc8f460eE> + 8000c286: 85aa mv a1,a0 + 8000c288: e82e sd a1,16(sp) + 8000c28a: 04a107a3 sb a0,79(sp) + 8000c28e: a009 j 8000c290 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x3c> + 8000c290: 6542 ld a0,16(sp) + 8000c292: 4581 li a1,0 + Some(if is_iterating { + 8000c294: 00b50b63 beq a0,a1,8000c2aa <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x56> + 8000c298: a009 j 8000c29a <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x46> + let n = unsafe { Step::backward_unchecked(self.end.clone(), 1) }; + 8000c29a: 6562 ld a0,24(sp) + 8000c29c: 0521 addi a0,a0,8 + 8000c29e: 00012097 auipc ra,0x12 + 8000c2a2: 426080e7 jalr 1062(ra) # 8001e6c4 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E> + 8000c2a6: e42a sd a0,8(sp) + 8000c2a8: a821 j 8000c2c0 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x6c> + 8000c2aa: 6562 ld a0,24(sp) + 8000c2ac: 4585 li a1,1 + self.exhausted = true; + 8000c2ae: 00b50823 sb a1,16(a0) + self.end.clone() + 8000c2b2: 0521 addi a0,a0,8 + 8000c2b4: 00012097 auipc ra,0x12 + 8000c2b8: 410080e7 jalr 1040(ra) # 8001e6c4 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E> + 8000c2bc: fc2a sd a0,56(sp) + 8000c2be: a02d j 8000c2e8 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x94> + let n = unsafe { Step::backward_unchecked(self.end.clone(), 1) }; + 8000c2c0: 6522 ld a0,8(sp) + 8000c2c2: 4585 li a1,1 + 8000c2c4: 00013097 auipc ra,0x13 + 8000c2c8: eba080e7 jalr -326(ra) # 8001f17e <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$18backward_unchecked17h149195b805b2849bE> + 8000c2cc: 85aa mv a1,a0 + 8000c2ce: e02e sd a1,0(sp) + 8000c2d0: e8aa sd a0,80(sp) + 8000c2d2: a009 j 8000c2d4 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x80> + mem::replace(&mut self.end, n) + 8000c2d4: 6582 ld a1,0(sp) + 8000c2d6: 6562 ld a0,24(sp) + 8000c2d8: 0521 addi a0,a0,8 + 8000c2da: 00014097 auipc ra,0x14 + 8000c2de: 496080e7 jalr 1174(ra) # 80020770 <_ZN4core3mem7replace17h718d2b5d4e2666b3E> + 8000c2e2: fc2a sd a0,56(sp) + 8000c2e4: a009 j 8000c2e6 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x92> + Some(if is_iterating { + 8000c2e6: a011 j 8000c2ea <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x96> + 8000c2e8: a009 j 8000c2ea <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0x96> + 8000c2ea: 7562 ld a0,56(sp) + 8000c2ec: f82a sd a0,48(sp) + 8000c2ee: 4505 li a0,1 + 8000c2f0: f42a sd a0,40(sp) + } + 8000c2f2: a009 j 8000c2f4 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E+0xa0> + 8000c2f4: 7522 ld a0,40(sp) + 8000c2f6: 75c2 ld a1,48(sp) + 8000c2f8: 60e6 ld ra,88(sp) + 8000c2fa: 6125 addi sp,sp,96 + 8000c2fc: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator3rev17h6d9067942ad94ebeE: + +000000008000c2fe <_ZN4core4iter6traits8iterator8Iterator3rev17h6d9067942ad94ebeE>: + fn rev(self) -> Rev + 8000c2fe: 1101 addi sp,sp,-32 + Rev::new(self) + 8000c300: ec06 sd ra,24(sp) + 8000c302: 6990 ld a2,16(a1) + 8000c304: e832 sd a2,16(sp) + 8000c306: 6590 ld a2,8(a1) + 8000c308: e432 sd a2,8(sp) + 8000c30a: 618c ld a1,0(a1) + 8000c30c: e02e sd a1,0(sp) + 8000c30e: 858a mv a1,sp + 8000c310: 00010097 auipc ra,0x10 + 8000c314: 2c2080e7 jalr 706(ra) # 8001c5d2 <_ZN4core4iter8adapters3rev12Rev$LT$T$GT$3new17h2d10195152fc735dE> + 8000c318: a009 j 8000c31a <_ZN4core4iter6traits8iterator8Iterator3rev17h6d9067942ad94ebeE+0x1c> + } + 8000c31a: 60e2 ld ra,24(sp) + 8000c31c: 6105 addi sp,sp,32 + 8000c31e: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator7step_by17ha7dfda23787d2a26E: + +000000008000c320 <_ZN4core4iter6traits8iterator8Iterator7step_by17ha7dfda23787d2a26E>: + fn step_by(self, step: usize) -> StepBy + 8000c320: 1101 addi sp,sp,-32 + 8000c322: ec06 sd ra,24(sp) + 8000c324: c42e sw a1,8(sp) + 8000c326: c632 sw a2,12(sp) + 8000c328: e836 sd a3,16(sp) + StepBy::new(self, step) + 8000c32a: 00012097 auipc ra,0x12 + 8000c32e: 9ca080e7 jalr -1590(ra) # 8001dcf4 <_ZN4core4iter8adapters7step_by15StepBy$LT$I$GT$3new17h6692f5ddcbcdc828E> + 8000c332: a009 j 8000c334 <_ZN4core4iter6traits8iterator8Iterator7step_by17ha7dfda23787d2a26E+0x14> + } + 8000c334: 60e2 ld ra,24(sp) + 8000c336: 6105 addi sp,sp,32 + 8000c338: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator7step_by17hcae6c74a630fccd6E: + +000000008000c33a <_ZN4core4iter6traits8iterator8Iterator7step_by17hcae6c74a630fccd6E>: + fn step_by(self, step: usize) -> StepBy + 8000c33a: 1101 addi sp,sp,-32 + 8000c33c: ec06 sd ra,24(sp) + 8000c33e: e02e sd a1,0(sp) + 8000c340: e432 sd a2,8(sp) + 8000c342: e836 sd a3,16(sp) + StepBy::new(self, step) + 8000c344: 00012097 auipc ra,0x12 + 8000c348: 962080e7 jalr -1694(ra) # 8001dca6 <_ZN4core4iter8adapters7step_by15StepBy$LT$I$GT$3new17h4faa8304472101dfE> + 8000c34c: a009 j 8000c34e <_ZN4core4iter6traits8iterator8Iterator7step_by17hcae6c74a630fccd6E+0x14> + } + 8000c34e: 60e2 ld ra,24(sp) + 8000c350: 6105 addi sp,sp,32 + 8000c352: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h2819071fbc006758E: + +000000008000c354 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h2819071fbc006758E>: + fn into_iter(self) -> I { + 8000c354: 1141 addi sp,sp,-16 + 8000c356: c42a sw a0,8(sp) + 8000c358: c62e sw a1,12(sp) + } + 8000c35a: 0141 addi sp,sp,16 + 8000c35c: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he12a3ecdd35a2d32E: + +000000008000c35e <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he12a3ecdd35a2d32E>: + fn into_iter(self) -> I { + 8000c35e: 1141 addi sp,sp,-16 + 8000c360: 00a11423 sh a0,8(sp) + 8000c364: 00b11523 sh a1,10(sp) + } + 8000c368: 0141 addi sp,sp,16 + 8000c36a: 8082 ret + +Disassembly of section .text._ZN97_$LT$core..ops..range..RangeFull$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hf9cc134d1ddb7793E: + +000000008000c36c <_ZN97_$LT$core..ops..range..RangeFull$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hf9cc134d1ddb7793E>: + unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut [T] { + slice + } + + #[inline] + fn index(self, slice: &[T]) -> &[T] { + 8000c36c: 1101 addi sp,sp,-32 + 8000c36e: e82a sd a0,16(sp) + 8000c370: ec2e sd a1,24(sp) + slice + } + 8000c372: 6105 addi sp,sp,32 + 8000c374: 8082 ret + +Disassembly of section .text._ZN97_$LT$core..ops..range..RangeFull$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hf4f8ccbc08517323E: + +000000008000c376 <_ZN97_$LT$core..ops..range..RangeFull$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hf4f8ccbc08517323E>: + + #[inline] + fn index_mut(self, slice: &mut [T]) -> &mut [T] { + 8000c376: 1101 addi sp,sp,-32 + 8000c378: e82a sd a0,16(sp) + 8000c37a: ec2e sd a1,24(sp) + slice + } + 8000c37c: 6105 addi sp,sp,32 + 8000c37e: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E: + +000000008000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E>: + fn from(t: T) -> T { + 8000c380: 1141 addi sp,sp,-16 + } + 8000c382: 0141 addi sp,sp,16 + 8000c384: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE: + +000000008000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE>: + fn from(t: T) -> T { + 8000c386: 1141 addi sp,sp,-16 + 8000c388: e02a sd a0,0(sp) + 8000c38a: e42e sd a1,8(sp) + } + 8000c38c: 0141 addi sp,sp,16 + 8000c38e: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h78163b68f4cb081dE: + +000000008000c390 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h78163b68f4cb081dE>: + fn from(t: T) -> T { + 8000c390: 1141 addi sp,sp,-16 + 8000c392: e42a sd a0,8(sp) + } + 8000c394: 0141 addi sp,sp,16 + 8000c396: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E: + +000000008000c398 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E>: + fn into(self) -> U { + 8000c398: 1101 addi sp,sp,-32 + 8000c39a: ec06 sd ra,24(sp) + 8000c39c: e82a sd a0,16(sp) + U::from(self) + 8000c39e: 00000097 auipc ra,0x0 + 8000c3a2: ff2080e7 jalr -14(ra) # 8000c390 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h78163b68f4cb081dE> + 8000c3a6: e42a sd a0,8(sp) + 8000c3a8: a009 j 8000c3aa <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E+0x12> + } + 8000c3aa: 6522 ld a0,8(sp) + 8000c3ac: 60e2 ld ra,24(sp) + 8000c3ae: 6105 addi sp,sp,32 + 8000c3b0: 8082 ret + +Disassembly of section .text._ZN53_$LT$T$u20$as$u20$core..convert..TryFrom$LT$U$GT$$GT$8try_from17heab1f3c6250d8edbE: + +000000008000c3b2 <_ZN53_$LT$T$u20$as$u20$core..convert..TryFrom$LT$U$GT$$GT$8try_from17heab1f3c6250d8edbE>: +where + U: Into, +{ + type Error = Infallible; + + fn try_from(value: U) -> Result { + 8000c3b2: 1101 addi sp,sp,-32 + 8000c3b4: ec06 sd ra,24(sp) + 8000c3b6: e82a sd a0,16(sp) + Ok(U::into(value)) + 8000c3b8: 00000097 auipc ra,0x0 + 8000c3bc: fe0080e7 jalr -32(ra) # 8000c398 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E> + 8000c3c0: e02a sd a0,0(sp) + 8000c3c2: a009 j 8000c3c4 <_ZN53_$LT$T$u20$as$u20$core..convert..TryFrom$LT$U$GT$$GT$8try_from17heab1f3c6250d8edbE+0x12> + 8000c3c4: 6502 ld a0,0(sp) + 8000c3c6: e42a sd a0,8(sp) + } + 8000c3c8: 60e2 ld ra,24(sp) + 8000c3ca: 6105 addi sp,sp,32 + 8000c3cc: 8082 ret + +Disassembly of section .text._ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h168ef583366b1bfdE: + +000000008000c3ce <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h168ef583366b1bfdE>: + fn try_into(self) -> Result { + 8000c3ce: 1101 addi sp,sp,-32 + 8000c3d0: ec06 sd ra,24(sp) + 8000c3d2: e82a sd a0,16(sp) + U::try_from(self) + 8000c3d4: 00013097 auipc ra,0x13 + 8000c3d8: edc080e7 jalr -292(ra) # 8001f2b0 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE> + 8000c3dc: e02a sd a0,0(sp) + 8000c3de: e42e sd a1,8(sp) + 8000c3e0: a009 j 8000c3e2 <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h168ef583366b1bfdE+0x14> + } + 8000c3e2: 65a2 ld a1,8(sp) + 8000c3e4: 6502 ld a0,0(sp) + 8000c3e6: 60e2 ld ra,24(sp) + 8000c3e8: 6105 addi sp,sp,32 + 8000c3ea: 8082 ret + +Disassembly of section .text._ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h79444d549eeb58faE: + +000000008000c3ec <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h79444d549eeb58faE>: + fn try_into(self) -> Result { + 8000c3ec: 1101 addi sp,sp,-32 + 8000c3ee: ec06 sd ra,24(sp) + 8000c3f0: e82a sd a0,16(sp) + U::try_from(self) + 8000c3f2: 00013097 auipc ra,0x13 + 8000c3f6: e8c080e7 jalr -372(ra) # 8001f27e <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u16$GT$8try_from17h9165284bf6d163adE> + 8000c3fa: e02a sd a0,0(sp) + 8000c3fc: e42e sd a1,8(sp) + 8000c3fe: a009 j 8000c400 <_ZN53_$LT$T$u20$as$u20$core..convert..TryInto$LT$U$GT$$GT$8try_into17h79444d549eeb58faE+0x14> + } + 8000c400: 65a2 ld a1,8(sp) + 8000c402: 6502 ld a0,0(sp) + 8000c404: 60e2 ld ra,24(sp) + 8000c406: 6105 addi sp,sp,32 + 8000c408: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h0d12a57a76d0850fE: + +000000008000c40a <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h0d12a57a76d0850fE>: + /// + /// # Safety + /// + /// `ptr` must be non-null. + #[inline] + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c40a: 1141 addi sp,sp,-16 + 8000c40c: e42a sd a0,8(sp) + // SAFETY: the caller must guarantee that `ptr` is non-null. + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c40e: e02a sd a0,0(sp) + } + 8000c410: 0141 addi sp,sp,16 + 8000c412: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h20d3eb97294874feE: + +000000008000c414 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h20d3eb97294874feE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c414: 1141 addi sp,sp,-16 + 8000c416: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c418: e02a sd a0,0(sp) + } + 8000c41a: 0141 addi sp,sp,16 + 8000c41c: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h21d50a45a5a242bbE: + +000000008000c41e <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h21d50a45a5a242bbE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c41e: 1141 addi sp,sp,-16 + 8000c420: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c422: e02a sd a0,0(sp) + } + 8000c424: 0141 addi sp,sp,16 + 8000c426: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E: + +000000008000c428 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c428: 1141 addi sp,sp,-16 + 8000c42a: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c42c: e02a sd a0,0(sp) + } + 8000c42e: 0141 addi sp,sp,16 + 8000c430: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h802ec2c42c5b54adE: + +000000008000c432 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h802ec2c42c5b54adE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c432: 1141 addi sp,sp,-16 + 8000c434: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c436: e02a sd a0,0(sp) + } + 8000c438: 0141 addi sp,sp,16 + 8000c43a: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17ha8b21015e9411210E: + +000000008000c43c <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17ha8b21015e9411210E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c43c: 1141 addi sp,sp,-16 + 8000c43e: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c440: e02a sd a0,0(sp) + } + 8000c442: 0141 addi sp,sp,16 + 8000c444: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hb5a9e5725254bb89E: + +000000008000c446 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hb5a9e5725254bb89E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c446: 1141 addi sp,sp,-16 + 8000c448: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c44a: e02a sd a0,0(sp) + } + 8000c44c: 0141 addi sp,sp,16 + 8000c44e: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hcb5e8bc8059451d1E: + +000000008000c450 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hcb5e8bc8059451d1E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c450: 1141 addi sp,sp,-16 + 8000c452: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c454: e02a sd a0,0(sp) + } + 8000c456: 0141 addi sp,sp,16 + 8000c458: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17he1ff65b054541f9aE: + +000000008000c45a <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17he1ff65b054541f9aE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c45a: 1141 addi sp,sp,-16 + 8000c45c: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c45e: e02a sd a0,0(sp) + } + 8000c460: 0141 addi sp,sp,16 + 8000c462: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17he38725f417943878E: + +000000008000c464 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17he38725f417943878E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c464: 1141 addi sp,sp,-16 + 8000c466: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c468: e02a sd a0,0(sp) + } + 8000c46a: 0141 addi sp,sp,16 + 8000c46c: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hffcbfd9b9a15cee1E: + +000000008000c46e <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hffcbfd9b9a15cee1E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000c46e: 1141 addi sp,sp,-16 + 8000c470: e42a sd a0,8(sp) + unsafe { Unique { pointer: ptr as _, _marker: PhantomData } } + 8000c472: e02a sd a0,0(sp) + } + 8000c474: 0141 addi sp,sp,16 + 8000c476: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h0df13c1b672cf8a2E: + +000000008000c478 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h0df13c1b672cf8a2E>: + unsafe { &mut *self.as_ptr() } + } + + /// Casts to a pointer of another type. + #[inline] + pub const fn cast(self) -> Unique { + 8000c478: 1101 addi sp,sp,-32 + 8000c47a: ec06 sd ra,24(sp) + 8000c47c: e82a sd a0,16(sp) + // SAFETY: Unique::new_unchecked() creates a new unique and needs + // the given pointer to not be null. + // Since we are passing self as a pointer, it cannot be null. + unsafe { Unique::new_unchecked(self.as_ptr() as *mut U) } + 8000c47e: 00000097 auipc ra,0x0 + 8000c482: 09a080e7 jalr 154(ra) # 8000c518 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h98e034e84104bb8fE> + 8000c486: e42a sd a0,8(sp) + 8000c488: a009 j 8000c48a <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h0df13c1b672cf8a2E+0x12> + 8000c48a: 6522 ld a0,8(sp) + 8000c48c: 00000097 auipc ra,0x0 + 8000c490: f9c080e7 jalr -100(ra) # 8000c428 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E> + 8000c494: e02a sd a0,0(sp) + 8000c496: a009 j 8000c498 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h0df13c1b672cf8a2E+0x20> + } + 8000c498: 6502 ld a0,0(sp) + 8000c49a: 60e2 ld ra,24(sp) + 8000c49c: 6105 addi sp,sp,32 + 8000c49e: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h63879fc8651a3d59E: + +000000008000c4a0 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h63879fc8651a3d59E>: + pub const fn cast(self) -> Unique { + 8000c4a0: 1101 addi sp,sp,-32 + 8000c4a2: ec06 sd ra,24(sp) + 8000c4a4: e82a sd a0,16(sp) + unsafe { Unique::new_unchecked(self.as_ptr() as *mut U) } + 8000c4a6: 00000097 auipc ra,0x0 + 8000c4aa: 092080e7 jalr 146(ra) # 8000c538 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hc428d38b809aa8c2E> + 8000c4ae: e42a sd a0,8(sp) + 8000c4b0: a009 j 8000c4b2 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h63879fc8651a3d59E+0x12> + 8000c4b2: 6522 ld a0,8(sp) + 8000c4b4: 00000097 auipc ra,0x0 + 8000c4b8: f74080e7 jalr -140(ra) # 8000c428 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E> + 8000c4bc: e02a sd a0,0(sp) + 8000c4be: a009 j 8000c4c0 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h63879fc8651a3d59E+0x20> + } + 8000c4c0: 6502 ld a0,0(sp) + 8000c4c2: 60e2 ld ra,24(sp) + 8000c4c4: 6105 addi sp,sp,32 + 8000c4c6: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h6eaa84e8f5e764c2E: + +000000008000c4c8 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h6eaa84e8f5e764c2E>: + pub const fn cast(self) -> Unique { + 8000c4c8: 1101 addi sp,sp,-32 + 8000c4ca: ec06 sd ra,24(sp) + 8000c4cc: e82a sd a0,16(sp) + unsafe { Unique::new_unchecked(self.as_ptr() as *mut U) } + 8000c4ce: 00000097 auipc ra,0x0 + 8000c4d2: 052080e7 jalr 82(ra) # 8000c520 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb36dfd1ef749fd26E> + 8000c4d6: e42a sd a0,8(sp) + 8000c4d8: a009 j 8000c4da <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h6eaa84e8f5e764c2E+0x12> + 8000c4da: 6522 ld a0,8(sp) + 8000c4dc: 00000097 auipc ra,0x0 + 8000c4e0: f4c080e7 jalr -180(ra) # 8000c428 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E> + 8000c4e4: e02a sd a0,0(sp) + 8000c4e6: a009 j 8000c4e8 <_ZN4core3ptr6unique15Unique$LT$T$GT$4cast17h6eaa84e8f5e764c2E+0x20> + } + 8000c4e8: 6502 ld a0,0(sp) + 8000c4ea: 60e2 ld ra,24(sp) + 8000c4ec: 6105 addi sp,sp,32 + 8000c4ee: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h3d727d33388c5225E: + +000000008000c4f0 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h3d727d33388c5225E>: + pub const fn as_ptr(self) -> *mut T { + 8000c4f0: 1141 addi sp,sp,-16 + 8000c4f2: e42a sd a0,8(sp) + } + 8000c4f4: 0141 addi sp,sp,16 + 8000c4f6: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h43259d2d16140eb2E: + +000000008000c4f8 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h43259d2d16140eb2E>: + pub const fn as_ptr(self) -> *mut T { + 8000c4f8: 1141 addi sp,sp,-16 + 8000c4fa: e42a sd a0,8(sp) + } + 8000c4fc: 0141 addi sp,sp,16 + 8000c4fe: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h54727a4650ef71dfE: + +000000008000c500 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h54727a4650ef71dfE>: + pub const fn as_ptr(self) -> *mut T { + 8000c500: 1141 addi sp,sp,-16 + 8000c502: e42a sd a0,8(sp) + } + 8000c504: 0141 addi sp,sp,16 + 8000c506: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h7e93959e8a601ed4E: + +000000008000c508 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h7e93959e8a601ed4E>: + pub const fn as_ptr(self) -> *mut T { + 8000c508: 1141 addi sp,sp,-16 + 8000c50a: e42a sd a0,8(sp) + } + 8000c50c: 0141 addi sp,sp,16 + 8000c50e: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h9702a6a3d13a07b5E: + +000000008000c510 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h9702a6a3d13a07b5E>: + pub const fn as_ptr(self) -> *mut T { + 8000c510: 1141 addi sp,sp,-16 + 8000c512: e42a sd a0,8(sp) + } + 8000c514: 0141 addi sp,sp,16 + 8000c516: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h98e034e84104bb8fE: + +000000008000c518 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h98e034e84104bb8fE>: + pub const fn as_ptr(self) -> *mut T { + 8000c518: 1141 addi sp,sp,-16 + 8000c51a: e42a sd a0,8(sp) + } + 8000c51c: 0141 addi sp,sp,16 + 8000c51e: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb36dfd1ef749fd26E: + +000000008000c520 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb36dfd1ef749fd26E>: + pub const fn as_ptr(self) -> *mut T { + 8000c520: 1141 addi sp,sp,-16 + 8000c522: e42a sd a0,8(sp) + } + 8000c524: 0141 addi sp,sp,16 + 8000c526: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb43ff2a43bd415faE: + +000000008000c528 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb43ff2a43bd415faE>: + pub const fn as_ptr(self) -> *mut T { + 8000c528: 1141 addi sp,sp,-16 + 8000c52a: e42a sd a0,8(sp) + } + 8000c52c: 0141 addi sp,sp,16 + 8000c52e: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb57b3bcaa3bdd3f9E: + +000000008000c530 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb57b3bcaa3bdd3f9E>: + pub const fn as_ptr(self) -> *mut T { + 8000c530: 1141 addi sp,sp,-16 + 8000c532: e42a sd a0,8(sp) + } + 8000c534: 0141 addi sp,sp,16 + 8000c536: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hc428d38b809aa8c2E: + +000000008000c538 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hc428d38b809aa8c2E>: + pub const fn as_ptr(self) -> *mut T { + 8000c538: 1141 addi sp,sp,-16 + 8000c53a: e42a sd a0,8(sp) + } + 8000c53c: 0141 addi sp,sp,16 + 8000c53e: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hd1144efb36e37b5fE: + +000000008000c540 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hd1144efb36e37b5fE>: + pub const fn as_ptr(self) -> *mut T { + 8000c540: 1141 addi sp,sp,-16 + 8000c542: e42a sd a0,8(sp) + } + 8000c544: 0141 addi sp,sp,16 + 8000c546: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hf99ed61581dd6ee2E: + +000000008000c548 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hf99ed61581dd6ee2E>: + pub const fn as_ptr(self) -> *mut T { + 8000c548: 1141 addi sp,sp,-16 + 8000c54a: e42a sd a0,8(sp) + } + 8000c54c: 0141 addi sp,sp,16 + 8000c54e: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hc8563a91a04f7babE: + +000000008000c550 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hc8563a91a04f7babE>: + pub unsafe fn as_ref(&self) -> &T { + 8000c550: 1101 addi sp,sp,-32 + 8000c552: ec06 sd ra,24(sp) + 8000c554: e82a sd a0,16(sp) + unsafe { &*self.as_ptr() } + 8000c556: 6108 ld a0,0(a0) + 8000c558: 00000097 auipc ra,0x0 + 8000c55c: fc0080e7 jalr -64(ra) # 8000c518 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h98e034e84104bb8fE> + 8000c560: e42a sd a0,8(sp) + 8000c562: a009 j 8000c564 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hc8563a91a04f7babE+0x14> + } + 8000c564: 6522 ld a0,8(sp) + 8000c566: 60e2 ld ra,24(sp) + 8000c568: 6105 addi sp,sp,32 + 8000c56a: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hf6739c76b33ed63aE: + +000000008000c56c <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hf6739c76b33ed63aE>: + pub unsafe fn as_ref(&self) -> &T { + 8000c56c: 1101 addi sp,sp,-32 + 8000c56e: ec06 sd ra,24(sp) + 8000c570: e82a sd a0,16(sp) + unsafe { &*self.as_ptr() } + 8000c572: 6108 ld a0,0(a0) + 8000c574: 00000097 auipc ra,0x0 + 8000c578: fac080e7 jalr -84(ra) # 8000c520 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb36dfd1ef749fd26E> + 8000c57c: e42a sd a0,8(sp) + 8000c57e: a009 j 8000c580 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ref17hf6739c76b33ed63aE+0x14> + } + 8000c580: 6522 ld a0,8(sp) + 8000c582: 60e2 ld ra,24(sp) + 8000c584: 6105 addi sp,sp,32 + 8000c586: 8082 ret + +Disassembly of section .text._ZN4core3ptr6unique15Unique$LT$T$GT$8dangling17h9486dd80fcd97a92E: + +000000008000c588 <_ZN4core3ptr6unique15Unique$LT$T$GT$8dangling17h9486dd80fcd97a92E>: + pub const fn dangling() -> Self { + 8000c588: 1101 addi sp,sp,-32 + 8000c58a: ec06 sd ra,24(sp) + 8000c58c: 4505 li a0,1 + 8000c58e: e42a sd a0,8(sp) + 8000c590: e82a sd a0,16(sp) + unsafe { Unique::new_unchecked(mem::align_of::() as *mut T) } + 8000c592: a009 j 8000c594 <_ZN4core3ptr6unique15Unique$LT$T$GT$8dangling17h9486dd80fcd97a92E+0xc> + 8000c594: 6522 ld a0,8(sp) + 8000c596: 00000097 auipc ra,0x0 + 8000c59a: e92080e7 jalr -366(ra) # 8000c428 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h620617f59cddd065E> + 8000c59e: e02a sd a0,0(sp) + 8000c5a0: a009 j 8000c5a2 <_ZN4core3ptr6unique15Unique$LT$T$GT$8dangling17h9486dd80fcd97a92E+0x1a> + } + 8000c5a2: 6502 ld a0,0(sp) + 8000c5a4: 60e2 ld ra,24(sp) + 8000c5a6: 6105 addi sp,sp,32 + 8000c5a8: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17h6726b37a43d030b4E: + +000000008000c5aa <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17h6726b37a43d030b4E>: + fn into(self) -> U { + 8000c5aa: 1101 addi sp,sp,-32 + 8000c5ac: ec06 sd ra,24(sp) + 8000c5ae: e82a sd a0,16(sp) + U::from(self) + 8000c5b0: 00003097 auipc ra,0x3 + 8000c5b4: 622080e7 jalr 1570(ra) # 8000fbd2 <_ZN119_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$core..ptr..unique..Unique$LT$T$GT$$GT$$GT$4from17h163e90b2907f9865E> + 8000c5b8: e42a sd a0,8(sp) + 8000c5ba: a009 j 8000c5bc <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17h6726b37a43d030b4E+0x12> + } + 8000c5bc: 6522 ld a0,8(sp) + 8000c5be: 60e2 ld ra,24(sp) + 8000c5c0: 6105 addi sp,sp,32 + 8000c5c2: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h45361f1294fceae9E: + +000000008000c5c4 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h45361f1294fceae9E>: +} + +#[unstable(feature = "ptr_internals", issue = "none")] +impl From<&mut T> for Unique { + #[inline] + fn from(reference: &mut T) -> Self { + 8000c5c4: 1141 addi sp,sp,-16 + 8000c5c6: e42a sd a0,8(sp) + // SAFETY: A mutable reference cannot be null + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c5c8: e02a sd a0,0(sp) + } + 8000c5ca: 0141 addi sp,sp,16 + 8000c5cc: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h7ca19f4bf209b680E: + +000000008000c5ce <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h7ca19f4bf209b680E>: + fn from(reference: &mut T) -> Self { + 8000c5ce: 1141 addi sp,sp,-16 + 8000c5d0: e42a sd a0,8(sp) + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c5d2: e02a sd a0,0(sp) + } + 8000c5d4: 0141 addi sp,sp,16 + 8000c5d6: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h938709fab973920cE: + +000000008000c5d8 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h938709fab973920cE>: + fn from(reference: &mut T) -> Self { + 8000c5d8: 1141 addi sp,sp,-16 + 8000c5da: e42a sd a0,8(sp) + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c5dc: e02a sd a0,0(sp) + } + 8000c5de: 0141 addi sp,sp,16 + 8000c5e0: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h961fb5f3bbf04d92E: + +000000008000c5e2 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h961fb5f3bbf04d92E>: + fn from(reference: &mut T) -> Self { + 8000c5e2: 1141 addi sp,sp,-16 + 8000c5e4: e42a sd a0,8(sp) + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c5e6: e02a sd a0,0(sp) + } + 8000c5e8: 0141 addi sp,sp,16 + 8000c5ea: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17haf9e918ffbbde4a1E: + +000000008000c5ec <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17haf9e918ffbbde4a1E>: + fn from(reference: &mut T) -> Self { + 8000c5ec: 1141 addi sp,sp,-16 + 8000c5ee: e42a sd a0,8(sp) + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c5f0: e02a sd a0,0(sp) + } + 8000c5f2: 0141 addi sp,sp,16 + 8000c5f4: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hbd7fdd10f6dec294E: + +000000008000c5f6 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hbd7fdd10f6dec294E>: + fn from(reference: &mut T) -> Self { + 8000c5f6: 1141 addi sp,sp,-16 + 8000c5f8: e42a sd a0,8(sp) + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c5fa: e02a sd a0,0(sp) + } + 8000c5fc: 0141 addi sp,sp,16 + 8000c5fe: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hd2fb1fd1ad0aa985E: + +000000008000c600 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hd2fb1fd1ad0aa985E>: + fn from(reference: &mut T) -> Self { + 8000c600: 1141 addi sp,sp,-16 + 8000c602: e42a sd a0,8(sp) + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c604: e02a sd a0,0(sp) + } + 8000c606: 0141 addi sp,sp,16 + 8000c608: 8082 ret + +Disassembly of section .text._ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hdb52ac7756946cf1E: + +000000008000c60a <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hdb52ac7756946cf1E>: + fn from(reference: &mut T) -> Self { + 8000c60a: 1141 addi sp,sp,-16 + 8000c60c: e42a sd a0,8(sp) + unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } } + 8000c60e: e02a sd a0,0(sp) + } + 8000c610: 0141 addi sp,sp,16 + 8000c612: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register5stvec5write17ha770434f21f9bf27E: + +000000008000c614 <_ZN6kernel4arch5riscv8register5stvec5write17ha770434f21f9bf27E>: + llvm_asm!("csrr $0, stvec":"=r"(ret):::"volatile"); + ret +} + +#[inline] +pub unsafe fn write(x:usize){ + 8000c614: 1141 addi sp,sp,-16 + 8000c616: e42a sd a0,8(sp) + llvm_asm!("csrw stvec, $0"::"r"(x)::"volatile"); + 8000c618: 10551073 csrw stvec,a0 + 8000c61c: 0141 addi sp,sp,16 + 8000c61e: 8082 ret + +Disassembly of section .text._ZN4core10intrinsics11write_bytes17h11bbad1db2a3ea1bE: + +000000008000c620 <_ZN4core10intrinsics11write_bytes17h11bbad1db2a3ea1bE>: +/// // Now the box is fine +/// assert_eq!(*v, 42); +/// ``` +#[stable(feature = "rust1", since = "1.0.0")] +#[inline] +pub unsafe fn write_bytes(dst: *mut T, val: u8, count: usize) { + 8000c620: 1101 addi sp,sp,-32 + 8000c622: ec06 sd ra,24(sp) + 8000c624: e02a sd a0,0(sp) + 8000c626: 00b107a3 sb a1,15(sp) + 8000c62a: e832 sd a2,16(sp) + } + + debug_assert!(is_aligned_and_not_null(dst), "attempt to write to unaligned or null pointer"); + + // SAFETY: the safety contract for `write_bytes` must be upheld by the caller. + unsafe { write_bytes(dst, val, count) } + 8000c62c: 061a slli a2,a2,0x6 + 8000c62e: 0001a097 auipc ra,0x1a + 8000c632: aa6080e7 jalr -1370(ra) # 800260d4 + 8000c636: a009 j 8000c638 <_ZN4core10intrinsics11write_bytes17h11bbad1db2a3ea1bE+0x18> +} + 8000c638: 60e2 ld ra,24(sp) + 8000c63a: 6105 addi sp,sp,32 + 8000c63c: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4init17h0544bbe6b6556f7eE: + +000000008000c63e <_ZN6kernel2fs4init17h0544bbe6b6556f7eE>: +use crate::lock::sleeplock::SleepLockGuard; + +/// Init fs. +/// Read super block info. +/// Init log info and recover if necessary. +pub unsafe fn init(dev: u32) { + 8000c63e: 7159 addi sp,sp,-112 + 8000c640: f486 sd ra,104(sp) + 8000c642: 85aa mv a1,a0 + 8000c644: 852e mv a0,a1 + 8000c646: ec2a sd a0,24(sp) + 8000c648: ceae sw a1,92(sp) + +000000008000c64a <.LBB0_10>: + SUPER_BLOCK.init(dev); + 8000c64a: 00058517 auipc a0,0x58 + 8000c64e: a5650513 addi a0,a0,-1450 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 8000c652: ffffb097 auipc ra,0xffffb + 8000c656: 00c080e7 jalr 12(ra) # 8000765e <_ZN6kernel2fs10superblock10SuperBlock4init17hd314ea22bd8e6757E> + 8000c65a: a009 j 8000c65c <.LBB0_11> + +000000008000c65c <.LBB0_11>: + let log_ptr = LOG.acquire().deref_mut() as *mut Log; + 8000c65c: 0004f517 auipc a0,0x4f + 8000c660: e7c50513 addi a0,a0,-388 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8000c664: 00004097 auipc ra,0x4 + 8000c668: 57e080e7 jalr 1406(ra) # 80010be2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E> + 8000c66c: f02a sd a0,32(sp) + 8000c66e: a009 j 8000c670 <.LBB0_11+0x14> + 8000c670: 1008 addi a0,sp,32 + 8000c672: 00005097 auipc ra,0x5 + 8000c676: 74c080e7 jalr 1868(ra) # 80011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE> + 8000c67a: e82a sd a0,16(sp) + 8000c67c: a009 j 8000c67e <.LBB0_11+0x22> + 8000c67e: 6542 ld a0,16(sp) + 8000c680: f0aa sd a0,96(sp) + 8000c682: 1008 addi a0,sp,32 + 8000c684: ffffb097 auipc ra,0xffffb + 8000c688: b24080e7 jalr -1244(ra) # 800071a8 <_ZN4core3ptr86drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..log..Log$GT$$GT$17h3ff4d5b7fa89905aE> + 8000c68c: a009 j 8000c68e <.LBB0_11+0x32> + log_ptr.as_mut().unwrap().init(dev); + 8000c68e: 6542 ld a0,16(sp) + 8000c690: ffffd097 auipc ra,0xffffd + 8000c694: cd4080e7 jalr -812(ra) # 80009364 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17ha6d203c03ed13dfdE> + 8000c698: e42a sd a0,8(sp) + 8000c69a: a009 j 8000c69c <.LBB0_11+0x40> + 8000c69c: 6522 ld a0,8(sp) + +000000008000c69e <.LBB0_12>: + 8000c69e: 0001c597 auipc a1,0x1c + 8000c6a2: 74258593 addi a1,a1,1858 # 80028de0 <.L__unnamed_1> + 8000c6a6: 00003097 auipc ra,0x3 + 8000c6aa: 07e080e7 jalr 126(ra) # 8000f724 <_ZN4core6option15Option$LT$T$GT$6unwrap17hc367d03244a4b027E> + 8000c6ae: e02a sd a0,0(sp) + 8000c6b0: a009 j 8000c6b2 <.LBB0_12+0x14> + 8000c6b2: 65e2 ld a1,24(sp) + 8000c6b4: 6502 ld a0,0(sp) + 8000c6b6: 00004097 auipc ra,0x4 + 8000c6ba: 922080e7 jalr -1758(ra) # 8000ffd8 <_ZN6kernel2fs3log3Log4init17h739bf7c5bf880a35E> + 8000c6be: a009 j 8000c6c0 <.LBB0_13> + +000000008000c6c0 <.LBB0_13>: + println!("file system: setup done"); + 8000c6c0: 0001c597 auipc a1,0x1c + 8000c6c4: 75058593 addi a1,a1,1872 # 80028e10 <.L__unnamed_2> + +000000008000c6c8 <.LBB0_14>: + 8000c6c8: 0001c697 auipc a3,0x1c + 8000c6cc: 75868693 addi a3,a3,1880 # 80028e20 <.L__unnamed_9> + 8000c6d0: 1028 addi a0,sp,40 + 8000c6d2: 4605 li a2,1 + 8000c6d4: 4701 li a4,0 + 8000c6d6: ffff9097 auipc ra,0xffff9 + 8000c6da: eb4080e7 jalr -332(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000c6de: a009 j 8000c6e0 <.LBB0_14+0x18> + 8000c6e0: 1028 addi a0,sp,40 + 8000c6e2: 00012097 auipc ra,0x12 + 8000c6e6: 516080e7 jalr 1302(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000c6ea: a009 j 8000c6ec <.LBB0_14+0x24> +} + 8000c6ec: 70a6 ld ra,104(sp) + 8000c6ee: 6165 addi sp,sp,112 + 8000c6f0: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc12alloc_zeroed17h1e07741da5ebd770E: + +000000008000c6f2 <_ZN5alloc5alloc12alloc_zeroed17h1e07741da5ebd770E>: +pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 { + 8000c6f2: 7179 addi sp,sp,-48 + 8000c6f4: f406 sd ra,40(sp) + 8000c6f6: ec2a sd a0,24(sp) + 8000c6f8: f02e sd a1,32(sp) + 8000c6fa: 0828 addi a0,sp,24 + unsafe { __rust_alloc_zeroed(layout.size(), layout.align()) } + 8000c6fc: 00013097 auipc ra,0x13 + 8000c700: 160080e7 jalr 352(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000c704: e82a sd a0,16(sp) + 8000c706: a009 j 8000c708 <_ZN5alloc5alloc12alloc_zeroed17h1e07741da5ebd770E+0x16> + 8000c708: 0828 addi a0,sp,24 + 8000c70a: 00013097 auipc ra,0x13 + 8000c70e: 15c080e7 jalr 348(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8000c712: e42a sd a0,8(sp) + 8000c714: a009 j 8000c716 <_ZN5alloc5alloc12alloc_zeroed17h1e07741da5ebd770E+0x24> + 8000c716: 65a2 ld a1,8(sp) + 8000c718: 6542 ld a0,16(sp) + 8000c71a: 00014097 auipc ra,0x14 + 8000c71e: e26080e7 jalr -474(ra) # 80020540 <__rust_alloc_zeroed> + 8000c722: e02a sd a0,0(sp) + 8000c724: a009 j 8000c726 <_ZN5alloc5alloc12alloc_zeroed17h1e07741da5ebd770E+0x34> +} + 8000c726: 6502 ld a0,0(sp) + 8000c728: 70a2 ld ra,40(sp) + 8000c72a: 6145 addi sp,sp,48 + 8000c72c: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc15exchange_malloc17hc8acd7fb5c1fe184E: + +000000008000c72e <_ZN5alloc5alloc15exchange_malloc17hc8acd7fb5c1fe184E>: +unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { + 8000c72e: 711d addi sp,sp,-96 + 8000c730: ec86 sd ra,88(sp) + 8000c732: f42a sd a0,40(sp) + 8000c734: f82e sd a1,48(sp) + let layout = unsafe { Layout::from_size_align_unchecked(size, align) }; + 8000c736: 00013097 auipc ra,0x13 + 8000c73a: 0fc080e7 jalr 252(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8000c73e: 862a mv a2,a0 + 8000c740: e432 sd a2,8(sp) + 8000c742: 862e mv a2,a1 + 8000c744: e832 sd a2,16(sp) + 8000c746: fc2a sd a0,56(sp) + 8000c748: e0ae sd a1,64(sp) + 8000c74a: a009 j 8000c74c <_ZN5alloc5alloc15exchange_malloc17hc8acd7fb5c1fe184E+0x1e> + match Global.allocate(layout) { + 8000c74c: 6642 ld a2,16(sp) + 8000c74e: 65a2 ld a1,8(sp) + +000000008000c750 <.LBB1_8>: + 8000c750: 0001c517 auipc a0,0x1c + 8000c754: 6d050513 addi a0,a0,1744 # 80028e20 <.L__unnamed_9> + 8000c758: 00000097 auipc ra,0x0 + 8000c75c: 4d6080e7 jalr 1238(ra) # 8000cc2e <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17ha3ee32ed39eb82efE> + 8000c760: ec2a sd a0,24(sp) + 8000c762: f02e sd a1,32(sp) + 8000c764: a009 j 8000c766 <.LBB1_8+0x16> + Ok(ptr) => ptr.as_mut_ptr(), + 8000c766: 6562 ld a0,24(sp) + 8000c768: 00153593 seqz a1,a0 + 8000c76c: 4581 li a1,0 + 8000c76e: 00b51b63 bne a0,a1,8000c784 <.LBB1_8+0x34> + 8000c772: a009 j 8000c774 <.LBB1_8+0x24> + Err(_) => handle_alloc_error(layout), + 8000c774: 65c2 ld a1,16(sp) + 8000c776: 6522 ld a0,8(sp) + 8000c778: 00016097 auipc ra,0x16 + 8000c77c: 7c6080e7 jalr 1990(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + 8000c780: 0000 unimp + match Global.allocate(layout) { + 8000c782: 0000 unimp + Ok(ptr) => ptr.as_mut_ptr(), + 8000c784: 6562 ld a0,24(sp) + 8000c786: 7582 ld a1,32(sp) + 8000c788: e4aa sd a0,72(sp) + 8000c78a: e8ae sd a1,80(sp) + 8000c78c: 00003097 auipc ra,0x3 + 8000c790: 728080e7 jalr 1832(ra) # 8000feb4 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$10as_mut_ptr17h1a3f7b42026c1de6E> + 8000c794: e02a sd a0,0(sp) + 8000c796: a009 j 8000c798 <.LBB1_8+0x48> +} + 8000c798: 6502 ld a0,0(sp) + 8000c79a: 60e6 ld ra,88(sp) + 8000c79c: 6125 addi sp,sp,96 + 8000c79e: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc5alloc17hd4c58b08d1932008E: + +000000008000c7a0 <_ZN5alloc5alloc5alloc17hd4c58b08d1932008E>: +pub unsafe fn alloc(layout: Layout) -> *mut u8 { + 8000c7a0: 7179 addi sp,sp,-48 + 8000c7a2: f406 sd ra,40(sp) + 8000c7a4: ec2a sd a0,24(sp) + 8000c7a6: f02e sd a1,32(sp) + 8000c7a8: 0828 addi a0,sp,24 + unsafe { __rust_alloc(layout.size(), layout.align()) } + 8000c7aa: 00013097 auipc ra,0x13 + 8000c7ae: 0b2080e7 jalr 178(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000c7b2: e82a sd a0,16(sp) + 8000c7b4: a009 j 8000c7b6 <_ZN5alloc5alloc5alloc17hd4c58b08d1932008E+0x16> + 8000c7b6: 0828 addi a0,sp,24 + 8000c7b8: 00013097 auipc ra,0x13 + 8000c7bc: 0ae080e7 jalr 174(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8000c7c0: e42a sd a0,8(sp) + 8000c7c2: a009 j 8000c7c4 <_ZN5alloc5alloc5alloc17hd4c58b08d1932008E+0x24> + 8000c7c4: 65a2 ld a1,8(sp) + 8000c7c6: 6542 ld a0,16(sp) + 8000c7c8: 00014097 auipc ra,0x14 + 8000c7cc: d60080e7 jalr -672(ra) # 80020528 <__rust_alloc> + 8000c7d0: e02a sd a0,0(sp) + 8000c7d2: a009 j 8000c7d4 <_ZN5alloc5alloc5alloc17hd4c58b08d1932008E+0x34> +} + 8000c7d4: 6502 ld a0,0(sp) + 8000c7d6: 70a2 ld ra,40(sp) + 8000c7d8: 6145 addi sp,sp,48 + 8000c7da: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE: + +000000008000c7dc <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE>: + fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result, AllocError> { + 8000c7dc: 7171 addi sp,sp,-176 + 8000c7de: f506 sd ra,168(sp) + 8000c7e0: 8736 mv a4,a3 + 8000c7e2: fc3a sd a4,56(sp) + 8000c7e4: e4ae sd a1,72(sp) + 8000c7e6: e8b2 sd a2,80(sp) + 8000c7e8: fcaa sd a0,120(sp) + 8000c7ea: 08d103a3 sb a3,135(sp) + 8000c7ee: 00a8 addi a0,sp,72 + match layout.size() { + 8000c7f0: 00013097 auipc ra,0x13 + 8000c7f4: 06c080e7 jalr 108(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000c7f8: e0aa sd a0,64(sp) + 8000c7fa: a009 j 8000c7fc <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x20> + 8000c7fc: 6506 ld a0,64(sp) + 8000c7fe: 4581 li a1,0 + 0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)), + 8000c800: 00b50863 beq a0,a1,8000c810 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x34> + 8000c804: a009 j 8000c806 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x2a> + size => unsafe { + 8000c806: 7562 ld a0,56(sp) + 8000c808: 6586 ld a1,64(sp) + 8000c80a: e92e sd a1,144(sp) + let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) }; + 8000c80c: e51d bnez a0,8000c83a <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x5e> + 8000c80e: a835 j 8000c84a <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x6e> + 8000c810: 00a8 addi a0,sp,72 + 0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)), + 8000c812: 00013097 auipc ra,0x13 + 8000c816: 154080e7 jalr 340(ra) # 8001f966 <_ZN4core5alloc6layout6Layout8dangling17h635528e7b5a013bbE> + 8000c81a: f82a sd a0,48(sp) + 8000c81c: a009 j 8000c81e <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x42> + 8000c81e: 7542 ld a0,48(sp) + 8000c820: 4581 li a1,0 + 8000c822: 00003097 auipc ra,0x3 + 8000c826: 6f8080e7 jalr 1784(ra) # 8000ff1a <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E> + 8000c82a: f02a sd a0,32(sp) + 8000c82c: f42e sd a1,40(sp) + 8000c82e: a009 j 8000c830 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x54> + 8000c830: 7522 ld a0,40(sp) + 8000c832: 7582 ld a1,32(sp) + 8000c834: ecae sd a1,88(sp) + 8000c836: f0aa sd a0,96(sp) + match layout.size() { + 8000c838: a871 j 8000c8d4 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xf8> + let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) }; + 8000c83a: 6526 ld a0,72(sp) + 8000c83c: 65c6 ld a1,80(sp) + 8000c83e: 00000097 auipc ra,0x0 + 8000c842: eb4080e7 jalr -332(ra) # 8000c6f2 <_ZN5alloc5alloc12alloc_zeroed17h1e07741da5ebd770E> + 8000c846: f4aa sd a0,104(sp) + 8000c848: a809 j 8000c85a <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x7e> + 8000c84a: 6526 ld a0,72(sp) + 8000c84c: 65c6 ld a1,80(sp) + 8000c84e: 00000097 auipc ra,0x0 + 8000c852: f52080e7 jalr -174(ra) # 8000c7a0 <_ZN5alloc5alloc5alloc17hd4c58b08d1932008E> + 8000c856: f4aa sd a0,104(sp) + 8000c858: a011 j 8000c85c <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x80> + 8000c85a: a011 j 8000c85e <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x82> + 8000c85c: a009 j 8000c85e <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x82> + let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?; + 8000c85e: 7526 ld a0,104(sp) + 8000c860: 00003097 auipc ra,0x3 + 8000c864: 416080e7 jalr 1046(ra) # 8000fc76 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E> + 8000c868: ec2a sd a0,24(sp) + 8000c86a: a009 j 8000c86c <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x90> + 8000c86c: 6562 ld a0,24(sp) + 8000c86e: 00003097 auipc ra,0x3 + 8000c872: 97a080e7 jalr -1670(ra) # 8000f1e8 <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E> + 8000c876: e82a sd a0,16(sp) + 8000c878: a009 j 8000c87a <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0x9e> + 8000c87a: 6542 ld a0,16(sp) + 8000c87c: 00001097 auipc ra,0x1 + 8000c880: 210080e7 jalr 528(ra) # 8000da8c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h01dd6c02021cf1cdE> + 8000c884: f8aa sd a0,112(sp) + 8000c886: a009 j 8000c888 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xac> + 8000c888: 7546 ld a0,112(sp) + 8000c88a: 00153593 seqz a1,a0 + 8000c88e: 4581 li a1,0 + 8000c890: 00b51463 bne a0,a1,8000c898 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xbc> + 8000c894: a009 j 8000c896 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xba> + 8000c896: a829 j 8000c8b0 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xd4> + 8000c898: 6586 ld a1,64(sp) + 8000c89a: 7546 ld a0,112(sp) + 8000c89c: ed2a sd a0,152(sp) + 8000c89e: f12a sd a0,160(sp) + Ok(NonNull::slice_from_raw_parts(ptr, size)) + 8000c8a0: 00003097 auipc ra,0x3 + 8000c8a4: 67a080e7 jalr 1658(ra) # 8000ff1a <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E> + 8000c8a8: e02a sd a0,0(sp) + 8000c8aa: e42e sd a1,8(sp) + 8000c8ac: a839 j 8000c8ca <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xee> + let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?; + 8000c8ae: 0000 unimp + 8000c8b0: 00001097 auipc ra,0x1 + 8000c8b4: ba4080e7 jalr -1116(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8000c8b8: a009 j 8000c8ba <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xde> + 8000c8ba: 00001097 auipc ra,0x1 + 8000c8be: 190080e7 jalr 400(ra) # 8000da4a <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17ha082cd91ce3eeff8E> + 8000c8c2: ecaa sd a0,88(sp) + 8000c8c4: f0ae sd a1,96(sp) + 8000c8c6: a009 j 8000c8c8 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xec> + } + 8000c8c8: a039 j 8000c8d6 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xfa> + Ok(NonNull::slice_from_raw_parts(ptr, size)) + 8000c8ca: 6522 ld a0,8(sp) + 8000c8cc: 6582 ld a1,0(sp) + 8000c8ce: ecae sd a1,88(sp) + 8000c8d0: f0aa sd a0,96(sp) + match layout.size() { + 8000c8d2: a009 j 8000c8d4 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xf8> + } + 8000c8d4: a009 j 8000c8d6 <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE+0xfa> + 8000c8d6: 6566 ld a0,88(sp) + 8000c8d8: 7586 ld a1,96(sp) + 8000c8da: 70aa ld ra,168(sp) + 8000c8dc: 614d addi sp,sp,176 + 8000c8de: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE: + +000000008000c8e0 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE>: + unsafe fn grow_impl( + 8000c8e0: 7165 addi sp,sp,-400 + 8000c8e2: e706 sd ra,392(sp) + 8000c8e4: f12e sd a1,160(sp) + 8000c8e6: f52a sd a0,168(sp) + 8000c8e8: 88c2 mv a7,a6 + 8000c8ea: f946 sd a7,176(sp) + 8000c8ec: fd32 sd a2,184(sp) + 8000c8ee: e1b6 sd a3,192(sp) + 8000c8f0: e5ba sd a4,200(sp) + 8000c8f2: e9be sd a5,208(sp) + 8000c8f4: e62a sd a0,264(sp) + 8000c8f6: ea2e sd a1,272(sp) + 8000c8f8: 11010fa3 sb a6,287(sp) + 8000c8fc: 1928 addi a0,sp,184 + match old_layout.size() { + 8000c8fe: 00013097 auipc ra,0x13 + 8000c902: f5e080e7 jalr -162(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000c906: f5aa sd a0,232(sp) + 8000c908: a009 j 8000c90a <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x2a> + 0 => self.alloc_impl(new_layout, zeroed), + 8000c90a: 752e ld a0,232(sp) + 8000c90c: 4581 li a1,0 + 8000c90e: 00b51f63 bne a0,a1,8000c92c <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x4c> + 8000c912: a009 j 8000c914 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x34> + 8000c914: 76ca ld a3,176(sp) + 8000c916: 752a ld a0,168(sp) + 8000c918: 65ae ld a1,200(sp) + 8000c91a: 664e ld a2,208(sp) + 8000c91c: 00000097 auipc ra,0x0 + 8000c920: ec0080e7 jalr -320(ra) # 8000c7dc <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE> + 8000c924: edaa sd a0,216(sp) + 8000c926: f1ae sd a1,224(sp) + 8000c928: a009 j 8000c92a <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x4a> + match old_layout.size() { + 8000c92a: aad1 j 8000cafe <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x21e> + 8000c92c: 11a8 addi a0,sp,232 + old_size if old_layout.align() == new_layout.align() => unsafe { + 8000c92e: fa2a sd a0,304(sp) + 8000c930: 1928 addi a0,sp,184 + 8000c932: 00013097 auipc ra,0x13 + 8000c936: f34080e7 jalr -204(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8000c93a: ed2a sd a0,152(sp) + 8000c93c: a009 j 8000c93e <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x5e> + 8000c93e: 01a8 addi a0,sp,200 + 8000c940: 00013097 auipc ra,0x13 + 8000c944: f26080e7 jalr -218(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8000c948: e92a sd a0,144(sp) + 8000c94a: a009 j 8000c94c <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x6c> + 8000c94c: 656a ld a0,152(sp) + 8000c94e: 65ca ld a1,144(sp) + 8000c950: 00b51f63 bne a0,a1,8000c96e <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x8e> + 8000c954: a009 j 8000c956 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x76> + 8000c956: 752e ld a0,232(sp) + 8000c958: e12a sd a0,128(sp) + 8000c95a: fe2a sd a0,312(sp) + 8000c95c: 01a8 addi a0,sp,200 + let new_size = new_layout.size(); + 8000c95e: 00013097 auipc ra,0x13 + 8000c962: efe080e7 jalr -258(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000c966: 85aa mv a1,a0 + 8000c968: e52e sd a1,136(sp) + 8000c96a: e2aa sd a0,320(sp) + 8000c96c: a839 j 8000c98a <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0xaa> + old_size => unsafe { + 8000c96e: 76ca ld a3,176(sp) + 8000c970: 752a ld a0,168(sp) + 8000c972: 75ae ld a1,232(sp) + 8000c974: f4ae sd a1,104(sp) + 8000c976: f2ae sd a1,352(sp) + let new_ptr = self.alloc_impl(new_layout, zeroed)?; + 8000c978: 65ae ld a1,200(sp) + 8000c97a: 664e ld a2,208(sp) + 8000c97c: 00000097 auipc ra,0x0 + 8000c980: e60080e7 jalr -416(ra) # 8000c7dc <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE> + 8000c984: f8aa sd a0,112(sp) + 8000c986: fcae sd a1,120(sp) + 8000c988: a0c5 j 8000ca68 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x188> + 8000c98a: 1928 addi a0,sp,184 + intrinsics::assume(new_size >= old_layout.size()); + 8000c98c: 00013097 auipc ra,0x13 + 8000c990: ed0080e7 jalr -304(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000c994: a009 j 8000c996 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0xb6> + 8000c996: a009 j 8000c998 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0xb8> + let raw_ptr = realloc(ptr.as_ptr(), old_layout, new_size); + 8000c998: 750a ld a0,160(sp) + 8000c99a: 00003097 auipc ra,0x3 + 8000c99e: 4b4080e7 jalr 1204(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000c9a2: f0aa sd a0,96(sp) + 8000c9a4: a009 j 8000c9a6 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0xc6> + 8000c9a6: 66aa ld a3,136(sp) + 8000c9a8: 7506 ld a0,96(sp) + 8000c9aa: 75ea ld a1,184(sp) + 8000c9ac: 660e ld a2,192(sp) + 8000c9ae: 00000097 auipc ra,0x0 + 8000c9b2: 19c080e7 jalr 412(ra) # 8000cb4a <_ZN5alloc5alloc7realloc17hcf6ed4b0bd028c82E> + 8000c9b6: 85aa mv a1,a0 + 8000c9b8: ecae sd a1,88(sp) + 8000c9ba: e6aa sd a0,328(sp) + 8000c9bc: a009 j 8000c9be <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0xde> + let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?; + 8000c9be: 6566 ld a0,88(sp) + 8000c9c0: 00003097 auipc ra,0x3 + 8000c9c4: 2b6080e7 jalr 694(ra) # 8000fc76 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E> + 8000c9c8: e8aa sd a0,80(sp) + 8000c9ca: a009 j 8000c9cc <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0xec> + 8000c9cc: 6546 ld a0,80(sp) + 8000c9ce: 00003097 auipc ra,0x3 + 8000c9d2: 81a080e7 jalr -2022(ra) # 8000f1e8 <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E> + 8000c9d6: e4aa sd a0,72(sp) + 8000c9d8: a009 j 8000c9da <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0xfa> + 8000c9da: 6526 ld a0,72(sp) + 8000c9dc: 00001097 auipc ra,0x1 + 8000c9e0: 0b0080e7 jalr 176(ra) # 8000da8c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h01dd6c02021cf1cdE> + 8000c9e4: f9aa sd a0,240(sp) + 8000c9e6: a009 j 8000c9e8 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x108> + 8000c9e8: 754e ld a0,240(sp) + 8000c9ea: 00153593 seqz a1,a0 + 8000c9ee: 4581 li a1,0 + 8000c9f0: 00b51463 bne a0,a1,8000c9f8 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x118> + 8000c9f4: a009 j 8000c9f6 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x116> + 8000c9f6: a809 j 8000ca08 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x128> + 8000c9f8: 754a ld a0,176(sp) + 8000c9fa: 75ce ld a1,240(sp) + 8000c9fc: e0ae sd a1,64(sp) + 8000c9fe: eaae sd a1,336(sp) + 8000ca00: eeae sd a1,344(sp) + if zeroed { + 8000ca02: e105 bnez a0,8000ca22 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x142> + 8000ca04: a03d j 8000ca32 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x152> + let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?; + 8000ca06: 0000 unimp + 8000ca08: 00001097 auipc ra,0x1 + 8000ca0c: a4c080e7 jalr -1460(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8000ca10: a009 j 8000ca12 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x132> + 8000ca12: 00001097 auipc ra,0x1 + 8000ca16: 038080e7 jalr 56(ra) # 8000da4a <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17ha082cd91ce3eeff8E> + 8000ca1a: edaa sd a0,216(sp) + 8000ca1c: f1ae sd a1,224(sp) + 8000ca1e: a009 j 8000ca20 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x140> + 8000ca20: a0c5 j 8000cb00 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x220> + raw_ptr.add(old_size).write_bytes(0, new_size - old_size); + 8000ca22: 658a ld a1,128(sp) + 8000ca24: 6566 ld a0,88(sp) + 8000ca26: 00014097 auipc ra,0x14 + 8000ca2a: ba6080e7 jalr -1114(ra) # 800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E> + 8000ca2e: fc2a sd a0,56(sp) + 8000ca30: a011 j 8000ca34 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x154> + if zeroed { + 8000ca32: a829 j 8000ca4c <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x16c> + raw_ptr.add(old_size).write_bytes(0, new_size - old_size); + 8000ca34: 7562 ld a0,56(sp) + 8000ca36: 65aa ld a1,136(sp) + 8000ca38: 660a ld a2,128(sp) + 8000ca3a: 40c58633 sub a2,a1,a2 + 8000ca3e: 4581 li a1,0 + 8000ca40: ffffc097 auipc ra,0xffffc + 8000ca44: 646080e7 jalr 1606(ra) # 80009086 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$11write_bytes17h89eca677f2a46e73E> + 8000ca48: a009 j 8000ca4a <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x16a> + if zeroed { + 8000ca4a: a009 j 8000ca4c <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x16c> + Ok(NonNull::slice_from_raw_parts(ptr, new_size)) + 8000ca4c: 65aa ld a1,136(sp) + 8000ca4e: 6506 ld a0,64(sp) + 8000ca50: 00003097 auipc ra,0x3 + 8000ca54: 4ca080e7 jalr 1226(ra) # 8000ff1a <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E> + 8000ca58: f42a sd a0,40(sp) + 8000ca5a: f82e sd a1,48(sp) + 8000ca5c: a009 j 8000ca5e <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x17e> + 8000ca5e: 7542 ld a0,48(sp) + 8000ca60: 75a2 ld a1,40(sp) + 8000ca62: edae sd a1,216(sp) + 8000ca64: f1aa sd a0,224(sp) + match old_layout.size() { + 8000ca66: a861 j 8000cafe <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x21e> + let new_ptr = self.alloc_impl(new_layout, zeroed)?; + 8000ca68: 75e6 ld a1,120(sp) + 8000ca6a: 7546 ld a0,112(sp) + 8000ca6c: 00001097 auipc ra,0x1 + 8000ca70: 040080e7 jalr 64(ra) # 8000daac <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E> + 8000ca74: fdaa sd a0,248(sp) + 8000ca76: e22e sd a1,256(sp) + 8000ca78: a009 j 8000ca7a <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x19a> + 8000ca7a: 756e ld a0,248(sp) + 8000ca7c: 00153593 seqz a1,a0 + 8000ca80: 4581 li a1,0 + 8000ca82: 00b51463 bne a0,a1,8000ca8a <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x1aa> + 8000ca86: a009 j 8000ca88 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x1a8> + 8000ca88: a00d j 8000caaa <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x1ca> + 8000ca8a: 750a ld a0,160(sp) + 8000ca8c: 766e ld a2,248(sp) + 8000ca8e: e832 sd a2,16(sp) + 8000ca90: 6592 ld a1,256(sp) + 8000ca92: ec2e sd a1,24(sp) + 8000ca94: f6b2 sd a2,360(sp) + 8000ca96: faae sd a1,368(sp) + 8000ca98: feb2 sd a2,376(sp) + 8000ca9a: e32e sd a1,384(sp) + ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_mut_ptr(), old_size); + 8000ca9c: 00003097 auipc ra,0x3 + 8000caa0: 3b2080e7 jalr 946(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000caa4: f02a sd a0,32(sp) + 8000caa6: a839 j 8000cac4 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x1e4> + let new_ptr = self.alloc_impl(new_layout, zeroed)?; + 8000caa8: 0000 unimp + 8000caaa: 00001097 auipc ra,0x1 + 8000caae: 9aa080e7 jalr -1622(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8000cab2: a009 j 8000cab4 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x1d4> + 8000cab4: 00001097 auipc ra,0x1 + 8000cab8: f96080e7 jalr -106(ra) # 8000da4a <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17ha082cd91ce3eeff8E> + 8000cabc: edaa sd a0,216(sp) + 8000cabe: f1ae sd a1,224(sp) + 8000cac0: a009 j 8000cac2 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x1e2> + 8000cac2: a83d j 8000cb00 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x220> + ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_mut_ptr(), old_size); + 8000cac4: 65e2 ld a1,24(sp) + 8000cac6: 6542 ld a0,16(sp) + 8000cac8: 00003097 auipc ra,0x3 + 8000cacc: 3ec080e7 jalr 1004(ra) # 8000feb4 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$10as_mut_ptr17h1a3f7b42026c1de6E> + 8000cad0: e42a sd a0,8(sp) + 8000cad2: a009 j 8000cad4 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x1f4> + 8000cad4: 7626 ld a2,104(sp) + 8000cad6: 7582 ld a1,32(sp) + 8000cad8: 6522 ld a0,8(sp) + 8000cada: 00019097 auipc ra,0x19 + 8000cade: 5a8080e7 jalr 1448(ra) # 80026082 + 8000cae2: 758a ld a1,160(sp) + self.deallocate(ptr, old_layout); + 8000cae4: 752a ld a0,168(sp) + 8000cae6: 766a ld a2,184(sp) + 8000cae8: 668e ld a3,192(sp) + 8000caea: 00000097 auipc ra,0x0 + 8000caee: 0a8080e7 jalr 168(ra) # 8000cb92 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE> + 8000caf2: a009 j 8000caf4 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x214> + Ok(new_ptr) + 8000caf4: 6562 ld a0,24(sp) + 8000caf6: 65c2 ld a1,16(sp) + 8000caf8: edae sd a1,216(sp) + 8000cafa: f1aa sd a0,224(sp) + match old_layout.size() { + 8000cafc: a009 j 8000cafe <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x21e> + } + 8000cafe: a011 j 8000cb02 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x222> + 8000cb00: a009 j 8000cb02 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE+0x222> + 8000cb02: 656e ld a0,216(sp) + 8000cb04: 758e ld a1,224(sp) + 8000cb06: 60ba ld ra,392(sp) + 8000cb08: 6159 addi sp,sp,400 + 8000cb0a: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc7dealloc17ha462d27313510349E: + +000000008000cb0c <_ZN5alloc5alloc7dealloc17ha462d27313510349E>: +pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) { + 8000cb0c: 7139 addi sp,sp,-64 + 8000cb0e: fc06 sd ra,56(sp) + 8000cb10: e82a sd a0,16(sp) + 8000cb12: f02e sd a1,32(sp) + 8000cb14: f432 sd a2,40(sp) + 8000cb16: f82a sd a0,48(sp) + 8000cb18: 1008 addi a0,sp,32 + unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) } + 8000cb1a: 00013097 auipc ra,0x13 + 8000cb1e: d42080e7 jalr -702(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000cb22: ec2a sd a0,24(sp) + 8000cb24: a009 j 8000cb26 <_ZN5alloc5alloc7dealloc17ha462d27313510349E+0x1a> + 8000cb26: 1008 addi a0,sp,32 + 8000cb28: 00013097 auipc ra,0x13 + 8000cb2c: d3e080e7 jalr -706(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8000cb30: e42a sd a0,8(sp) + 8000cb32: a009 j 8000cb34 <_ZN5alloc5alloc7dealloc17ha462d27313510349E+0x28> + 8000cb34: 6622 ld a2,8(sp) + 8000cb36: 65e2 ld a1,24(sp) + 8000cb38: 6542 ld a0,16(sp) + 8000cb3a: 00014097 auipc ra,0x14 + 8000cb3e: 9f6080e7 jalr -1546(ra) # 80020530 <__rust_dealloc> + 8000cb42: a009 j 8000cb44 <_ZN5alloc5alloc7dealloc17ha462d27313510349E+0x38> +} + 8000cb44: 70e2 ld ra,56(sp) + 8000cb46: 6121 addi sp,sp,64 + 8000cb48: 8082 ret + +Disassembly of section .text._ZN5alloc5alloc7realloc17hcf6ed4b0bd028c82E: + +000000008000cb4a <_ZN5alloc5alloc7realloc17hcf6ed4b0bd028c82E>: +pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { + 8000cb4a: 715d addi sp,sp,-80 + 8000cb4c: e486 sd ra,72(sp) + 8000cb4e: e836 sd a3,16(sp) + 8000cb50: ec2a sd a0,24(sp) + 8000cb52: f42e sd a1,40(sp) + 8000cb54: f832 sd a2,48(sp) + 8000cb56: fc2a sd a0,56(sp) + 8000cb58: e0b6 sd a3,64(sp) + 8000cb5a: 1028 addi a0,sp,40 + unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) } + 8000cb5c: 00013097 auipc ra,0x13 + 8000cb60: d00080e7 jalr -768(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000cb64: f02a sd a0,32(sp) + 8000cb66: a009 j 8000cb68 <_ZN5alloc5alloc7realloc17hcf6ed4b0bd028c82E+0x1e> + 8000cb68: 1028 addi a0,sp,40 + 8000cb6a: 00013097 auipc ra,0x13 + 8000cb6e: cfc080e7 jalr -772(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8000cb72: e42a sd a0,8(sp) + 8000cb74: a009 j 8000cb76 <_ZN5alloc5alloc7realloc17hcf6ed4b0bd028c82E+0x2c> + 8000cb76: 66c2 ld a3,16(sp) + 8000cb78: 6622 ld a2,8(sp) + 8000cb7a: 7582 ld a1,32(sp) + 8000cb7c: 6562 ld a0,24(sp) + 8000cb7e: 00014097 auipc ra,0x14 + 8000cb82: 9ba080e7 jalr -1606(ra) # 80020538 <__rust_realloc> + 8000cb86: e02a sd a0,0(sp) + 8000cb88: a009 j 8000cb8a <_ZN5alloc5alloc7realloc17hcf6ed4b0bd028c82E+0x40> +} + 8000cb8a: 6502 ld a0,0(sp) + 8000cb8c: 60a6 ld ra,72(sp) + 8000cb8e: 6161 addi sp,sp,80 + 8000cb90: 8082 ret + +Disassembly of section .text._ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE: + +000000008000cb92 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE>: + unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { + 8000cb92: 715d addi sp,sp,-80 + 8000cb94: e486 sd ra,72(sp) + 8000cb96: e82e sd a1,16(sp) + 8000cb98: f032 sd a2,32(sp) + 8000cb9a: f436 sd a3,40(sp) + 8000cb9c: fc2a sd a0,56(sp) + 8000cb9e: e0ae sd a1,64(sp) + 8000cba0: 1008 addi a0,sp,32 + if layout.size() != 0 { + 8000cba2: 00013097 auipc ra,0x13 + 8000cba6: cba080e7 jalr -838(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8000cbaa: ec2a sd a0,24(sp) + 8000cbac: a009 j 8000cbae <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE+0x1c> + 8000cbae: 6562 ld a0,24(sp) + 8000cbb0: 4581 li a1,0 + 8000cbb2: 00b50a63 beq a0,a1,8000cbc6 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE+0x34> + 8000cbb6: a009 j 8000cbb8 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE+0x26> + unsafe { dealloc(ptr.as_ptr(), layout) } + 8000cbb8: 6542 ld a0,16(sp) + 8000cbba: 00003097 auipc ra,0x3 + 8000cbbe: 294080e7 jalr 660(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000cbc2: e42a sd a0,8(sp) + 8000cbc4: a011 j 8000cbc8 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE+0x36> + if layout.size() != 0 { + 8000cbc6: a811 j 8000cbda <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE+0x48> + unsafe { dealloc(ptr.as_ptr(), layout) } + 8000cbc8: 6522 ld a0,8(sp) + 8000cbca: 7582 ld a1,32(sp) + 8000cbcc: 7622 ld a2,40(sp) + 8000cbce: 00000097 auipc ra,0x0 + 8000cbd2: f3e080e7 jalr -194(ra) # 8000cb0c <_ZN5alloc5alloc7dealloc17ha462d27313510349E> + 8000cbd6: a009 j 8000cbd8 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE+0x46> + if layout.size() != 0 { + 8000cbd8: a009 j 8000cbda <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$10deallocate17hd299418f64a2b74eE+0x48> + } + 8000cbda: 60a6 ld ra,72(sp) + 8000cbdc: 6161 addi sp,sp,80 + 8000cbde: 8082 ret + +Disassembly of section .text._ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE: + +000000008000cbe0 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE>: + fn allocate_zeroed(&self, layout: Layout) -> Result, AllocError> { + 8000cbe0: 7179 addi sp,sp,-48 + 8000cbe2: f406 sd ra,40(sp) + 8000cbe4: e82a sd a0,16(sp) + 8000cbe6: ec2e sd a1,24(sp) + 8000cbe8: f032 sd a2,32(sp) + 8000cbea: 4685 li a3,1 + self.alloc_impl(layout, true) + 8000cbec: 00000097 auipc ra,0x0 + 8000cbf0: bf0080e7 jalr -1040(ra) # 8000c7dc <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE> + 8000cbf4: e02a sd a0,0(sp) + 8000cbf6: e42e sd a1,8(sp) + 8000cbf8: a009 j 8000cbfa <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE+0x1a> + } + 8000cbfa: 65a2 ld a1,8(sp) + 8000cbfc: 6502 ld a0,0(sp) + 8000cbfe: 70a2 ld ra,40(sp) + 8000cc00: 6145 addi sp,sp,48 + 8000cc02: 8082 ret + +Disassembly of section .text._ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$4grow17h7670efcd8d0be277E: + +000000008000cc04 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$4grow17h7670efcd8d0be277E>: + unsafe fn grow( + 8000cc04: 715d addi sp,sp,-80 + 8000cc06: e486 sd ra,72(sp) + 8000cc08: ec2a sd a0,24(sp) + 8000cc0a: f02e sd a1,32(sp) + 8000cc0c: f432 sd a2,40(sp) + 8000cc0e: f836 sd a3,48(sp) + 8000cc10: fc3a sd a4,56(sp) + 8000cc12: e0be sd a5,64(sp) + 8000cc14: 4801 li a6,0 + unsafe { self.grow_impl(ptr, old_layout, new_layout, false) } + 8000cc16: 00000097 auipc ra,0x0 + 8000cc1a: cca080e7 jalr -822(ra) # 8000c8e0 <_ZN5alloc5alloc6Global9grow_impl17h51438424dec2606aE> + 8000cc1e: e42a sd a0,8(sp) + 8000cc20: e82e sd a1,16(sp) + 8000cc22: a009 j 8000cc24 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$4grow17h7670efcd8d0be277E+0x20> + } + 8000cc24: 65c2 ld a1,16(sp) + 8000cc26: 6522 ld a0,8(sp) + 8000cc28: 60a6 ld ra,72(sp) + 8000cc2a: 6161 addi sp,sp,80 + 8000cc2c: 8082 ret + +Disassembly of section .text._ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17ha3ee32ed39eb82efE: + +000000008000cc2e <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17ha3ee32ed39eb82efE>: + fn allocate(&self, layout: Layout) -> Result, AllocError> { + 8000cc2e: 7179 addi sp,sp,-48 + 8000cc30: f406 sd ra,40(sp) + 8000cc32: e82a sd a0,16(sp) + 8000cc34: ec2e sd a1,24(sp) + 8000cc36: f032 sd a2,32(sp) + 8000cc38: 4681 li a3,0 + self.alloc_impl(layout, false) + 8000cc3a: 00000097 auipc ra,0x0 + 8000cc3e: ba2080e7 jalr -1118(ra) # 8000c7dc <_ZN5alloc5alloc6Global10alloc_impl17h58679304960bb1eaE> + 8000cc42: e02a sd a0,0(sp) + 8000cc44: e42e sd a1,8(sp) + 8000cc46: a009 j 8000cc48 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$8allocate17ha3ee32ed39eb82efE+0x1a> + } + 8000cc48: 65a2 ld a1,8(sp) + 8000cc4a: 6502 ld a0,0(sp) + 8000cc4c: 70a2 ld ra,40(sp) + 8000cc4e: 6145 addi sp,sp,48 + 8000cc50: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7mstatus4read17h128130238af49ec4E: + +000000008000cc52 <_ZN6kernel4arch5riscv8register7mstatus4read17h128130238af49ec4E>: +use bit_field::BitField; + + +// read register from M mode +#[inline] +unsafe fn read() -> usize { + 8000cc52: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, mstatus":"=r"(ret):::"volatile"); + 8000cc54: 30002573 csrr a0,mstatus + 8000cc58: e42a sd a0,8(sp) + ret +} + 8000cc5a: 0141 addi sp,sp,16 + 8000cc5c: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7mstatus5write17h42ac5b0466add1d5E: + +000000008000cc5e <_ZN6kernel4arch5riscv8register7mstatus5write17h42ac5b0466add1d5E>: + +// Write into register in M mode +#[inline] +unsafe fn write(x: usize) { + 8000cc5e: 1141 addi sp,sp,-16 + 8000cc60: e42a sd a0,8(sp) + llvm_asm!("csrw mstatus, $0"::"r"(x)::"volatile"); + 8000cc62: 30051073 csrw mstatus,a0 +} + 8000cc66: 0141 addi sp,sp,16 + 8000cc68: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7mstatus7set_mpp17h9778cbd7fe9ad41aE: + +000000008000cc6a <_ZN6kernel4arch5riscv8register7mstatus7set_mpp17h9778cbd7fe9ad41aE>: + +// set M Previous Privilege mode to Supervisor, for mret. +pub unsafe fn set_mpp(){ + 8000cc6a: 1141 addi sp,sp,-16 + let mut x = read(); + 8000cc6c: e406 sd ra,8(sp) + 8000cc6e: 00000097 auipc ra,0x0 + 8000cc72: fe4080e7 jalr -28(ra) # 8000cc52 <_ZN6kernel4arch5riscv8register7mstatus4read17h128130238af49ec4E> + 8000cc76: e02a sd a0,0(sp) + 8000cc78: a009 j 8000cc7a <_ZN6kernel4arch5riscv8register7mstatus7set_mpp17h9778cbd7fe9ad41aE+0x10> + x &= !MSTATUS_MPP_MASK; + 8000cc7a: 6502 ld a0,0(sp) + 8000cc7c: 75f9 lui a1,0xffffe + 8000cc7e: 7ff5859b addiw a1,a1,2047 + 8000cc82: 8d6d and a0,a0,a1 + 8000cc84: 6585 lui a1,0x1 + 8000cc86: 8005859b addiw a1,a1,-2048 + x |= MSTATUS_MPP_S; + 8000cc8a: 8d4d or a0,a0,a1 + 8000cc8c: e02a sd a0,0(sp) + write(x); + 8000cc8e: 00000097 auipc ra,0x0 + 8000cc92: fd0080e7 jalr -48(ra) # 8000cc5e <_ZN6kernel4arch5riscv8register7mstatus5write17h42ac5b0466add1d5E> + 8000cc96: a009 j 8000cc98 <_ZN6kernel4arch5riscv8register7mstatus7set_mpp17h9778cbd7fe9ad41aE+0x2e> +} + 8000cc98: 60a2 ld ra,8(sp) + 8000cc9a: 0141 addi sp,sp,16 + 8000cc9c: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7mstatus16enable_interrupt17hf0a2d533b14eb99bE: + +000000008000cc9e <_ZN6kernel4arch5riscv8register7mstatus16enable_interrupt17hf0a2d533b14eb99bE>: + +// enable machine-mode interrupts. +pub unsafe fn enable_interrupt(){ + 8000cc9e: 1141 addi sp,sp,-16 + let mut mstatus = read(); + 8000cca0: e406 sd ra,8(sp) + 8000cca2: 00000097 auipc ra,0x0 + 8000cca6: fb0080e7 jalr -80(ra) # 8000cc52 <_ZN6kernel4arch5riscv8register7mstatus4read17h128130238af49ec4E> + 8000ccaa: e02a sd a0,0(sp) + 8000ccac: a009 j 8000ccae <_ZN6kernel4arch5riscv8register7mstatus16enable_interrupt17hf0a2d533b14eb99bE+0x10> + 8000ccae: 850a mv a0,sp + 8000ccb0: 458d li a1,3 + 8000ccb2: 4605 li a2,1 + mstatus.set_bit(3, true); + 8000ccb4: ffff7097 auipc ra,0xffff7 + 8000ccb8: 17a080e7 jalr 378(ra) # 80003e2e <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7set_bit17h956504fd5d951209E> + 8000ccbc: a009 j 8000ccbe <_ZN6kernel4arch5riscv8register7mstatus16enable_interrupt17hf0a2d533b14eb99bE+0x20> + write(mstatus); + 8000ccbe: 6502 ld a0,0(sp) + 8000ccc0: 00000097 auipc ra,0x0 + 8000ccc4: f9e080e7 jalr -98(ra) # 8000cc5e <_ZN6kernel4arch5riscv8register7mstatus5write17h42ac5b0466add1d5E> + 8000ccc8: a009 j 8000ccca <_ZN6kernel4arch5riscv8register7mstatus16enable_interrupt17hf0a2d533b14eb99bE+0x2c> +} + 8000ccca: 60a2 ld ra,8(sp) + 8000cccc: 0141 addi sp,sp,16 + 8000ccce: 8082 ret + +Disassembly of section .text.start: + +000000008000ccd0 : +static mut TIMER_SCRATCH:[[u64; 5]; NCPU] = [[0u64; 5]; NCPU]; +static STARTED:AtomicBool = AtomicBool::new(false); + +/// 引导启动程序,进行寄存器的初始化操作 +#[no_mangle] +pub unsafe fn start() -> !{ + 8000ccd0: 1101 addi sp,sp,-32 + // Set M Previlege mode to Supervisor, for mret + mstatus::set_mpp(); + 8000ccd2: ec06 sd ra,24(sp) + 8000ccd4: 00000097 auipc ra,0x0 + 8000ccd8: f96080e7 jalr -106(ra) # 8000cc6a <_ZN6kernel4arch5riscv8register7mstatus7set_mpp17h9778cbd7fe9ad41aE> + 8000ccdc: a009 j 8000ccde <.LBB0_11> + +000000008000ccde <.LBB0_11>: + + // set M Exception Program Counter to main, for mret. + // requires gcc -mcmodel=medany + mepc::write(rust_main as usize); + 8000ccde: 00000517 auipc a0,0x0 + 8000cce2: 1a850513 addi a0,a0,424 # 8000ce86 + 8000cce6: ffff6097 auipc ra,0xffff6 + 8000ccea: 9cc080e7 jalr -1588(ra) # 800026b2 <_ZN6kernel4arch5riscv8register4mepc5write17h048707cbba437631E> + 8000ccee: a009 j 8000ccf0 <.LBB0_11+0x12> + 8000ccf0: 4501 li a0,0 + + // disable paging for now. + satp::write(0); + 8000ccf2: 00013097 auipc ra,0x13 + 8000ccf6: 8ae080e7 jalr -1874(ra) # 8001f5a0 <_ZN6kernel4arch5riscv8register4satp5write17h136481b47a553b1cE> + 8000ccfa: a009 j 8000ccfc <.LBB0_11+0x1e> + 8000ccfc: 6541 lui a0,0x10 + 8000ccfe: 357d addiw a0,a0,-1 + + // delegate all interrupts and exceptions to supervisor mode. + medeleg::write(0xffff); + 8000cd00: 00012097 auipc ra,0x12 + 8000cd04: 00a080e7 jalr 10(ra) # 8001ed0a <_ZN6kernel4arch5riscv8register7medeleg5write17h087038b3215eaf8cE> + 8000cd08: a009 j 8000cd0a <.LBB0_11+0x2c> + 8000cd0a: 6541 lui a0,0x10 + 8000cd0c: 357d addiw a0,a0,-1 + mideleg::write(0xffff); + 8000cd0e: 00012097 auipc ra,0x12 + 8000cd12: fbe080e7 jalr -66(ra) # 8001eccc <_ZN6kernel4arch5riscv8register7mideleg5write17hf36c8c211297ea03E> + 8000cd16: a009 j 8000cd18 <.LBB0_11+0x3a> + sie::intr_on(); + 8000cd18: 00012097 auipc ra,0x12 + 8000cd1c: a32080e7 jalr -1486(ra) # 8001e74a <_ZN6kernel4arch5riscv8register3sie7intr_on17ha44057f13b8cbd2fE> + 8000cd20: a009 j 8000cd22 <.LBB0_11+0x44> + + // ask for clock interrupts. + timer_init(); + 8000cd22: 00000097 auipc ra,0x0 + 8000cd26: 02e080e7 jalr 46(ra) # 8000cd50 <_ZN6kernel10timer_init17h23308923add8e035E> + 8000cd2a: a009 j 8000cd2c <.LBB0_11+0x4e> + + // keep each CPU's hartid in its tp register, for cpuid(). + let id:usize = mhartid::read(); + 8000cd2c: ffffb097 auipc ra,0xffffb + 8000cd30: d1a080e7 jalr -742(ra) # 80007a46 <_ZN6kernel4arch5riscv8register7mhartid4read17hb0a253df4f0869d8E> + 8000cd34: 85aa mv a1,a0 + 8000cd36: e42e sd a1,8(sp) + 8000cd38: e82a sd a0,16(sp) + 8000cd3a: a009 j 8000cd3c <.LBB0_11+0x5e> + tp::write(id); + 8000cd3c: 6522 ld a0,8(sp) + 8000cd3e: 00013097 auipc ra,0x13 + 8000cd42: 976080e7 jalr -1674(ra) # 8001f6b4 <_ZN6kernel4arch5riscv8register2tp5write17hac520d82928ad2ddE> + 8000cd46: a009 j 8000cd48 <.LBB0_11+0x6a> + + // switch to supervisor mode and jump to main(). + llvm_asm!("mret"::::"volatile"); + 8000cd48: 30200073 mret + + loop{} + 8000cd4c: a009 j 8000cd4e <.LBB0_11+0x70> + 8000cd4e: a001 j 8000cd4e <.LBB0_11+0x70> + +Disassembly of section .text._ZN6kernel10timer_init17h23308923add8e035E: + +000000008000cd50 <_ZN6kernel10timer_init17h23308923add8e035E>: +/// set up to receive timer interrupts in machine mode, +/// which arrive at timervec in kernelvec.S, +/// which turns them into software interrupts for +/// devintr() in trap.rs. +/// 启动时钟中断 +unsafe fn timer_init(){ + 8000cd50: 7139 addi sp,sp,-64 + // each CPU has a separate source of timer interrupts. + let id = mhartid::read(); + 8000cd52: fc06 sd ra,56(sp) + 8000cd54: ffffb097 auipc ra,0xffffb + 8000cd58: cf2080e7 jalr -782(ra) # 80007a46 <_ZN6kernel4arch5riscv8register7mhartid4read17hb0a253df4f0869d8E> + 8000cd5c: 85aa mv a1,a0 + 8000cd5e: f02e sd a1,32(sp) + 8000cd60: f42a sd a0,40(sp) + 8000cd62: a009 j 8000cd64 <_ZN6kernel10timer_init17h23308923add8e035E+0x14> + 8000cd64: 7502 ld a0,32(sp) + 8000cd66: 000f45b7 lui a1,0xf4 + 8000cd6a: 2405859b addiw a1,a1,576 + + // ask the CLINT for a timer interrupt. + let interval = 1000000;// cycles; about 1/10th second in qemu. + 8000cd6e: f82e sd a1,48(sp) + clint::add_mtimecmp(id, interval); + 8000cd70: ffff6097 auipc ra,0xffff6 + 8000cd74: 174080e7 jalr 372(ra) # 80002ee4 <_ZN6kernel4arch5riscv8register5clint12add_mtimecmp17hca3030d0d062e6f9E> + 8000cd78: a009 j 8000cd7a <_ZN6kernel10timer_init17h23308923add8e035E+0x2a> + + // prepare information in scratch[] for timervec. + // scratch[0..2] : space for timervec to save registers. + // scratch[3] : address of CLINT MTIMECMP register. + // scratch[4] : desired interval (in cycles) between timer interrupts. + TIMER_SCRATCH[id][3] = clint::count_mtiecmp(id) as u64; + 8000cd7a: 7502 ld a0,32(sp) + 8000cd7c: ffff6097 auipc ra,0xffff6 + 8000cd80: 1c2080e7 jalr 450(ra) # 80002f3e <_ZN6kernel4arch5riscv8register5clint13count_mtiecmp17h29e162b64ddfbfccE> + 8000cd84: ec2a sd a0,24(sp) + 8000cd86: a009 j 8000cd88 <_ZN6kernel10timer_init17h23308923add8e035E+0x38> + 8000cd88: 7582 ld a1,32(sp) + 8000cd8a: 451d li a0,7 + 8000cd8c: 0ab56c63 bltu a0,a1,8000ce44 <.LBB1_19+0x3e> + 8000cd90: a009 j 8000cd92 <_ZN6kernel10timer_init17h23308923add8e035E+0x42> + 8000cd92: 7582 ld a1,32(sp) + 8000cd94: 6562 ld a0,24(sp) + 8000cd96: 02800613 li a2,40 + 8000cd9a: 02c586b3 mul a3,a1,a2 + +000000008000cd9e <.LBB1_16>: + 8000cd9e: 00059617 auipc a2,0x59 + 8000cda2: 26260613 addi a2,a2,610 # 80066000 <_ZN6kernel13TIMER_SCRATCH17hc054732b4283b1caE> + 8000cda6: 9636 add a2,a2,a3 + 8000cda8: ee08 sd a0,24(a2) + 8000cdaa: 451d li a0,7 + TIMER_SCRATCH[id][4] = interval; + 8000cdac: 0ab56763 bltu a0,a1,8000ce5a <.LBB1_20+0x14> + 8000cdb0: a009 j 8000cdb2 <.LBB1_16+0x14> + 8000cdb2: 7582 ld a1,32(sp) + 8000cdb4: 02800513 li a0,40 + 8000cdb8: 02a58633 mul a2,a1,a0 + +000000008000cdbc <.LBB1_17>: + 8000cdbc: 00059517 auipc a0,0x59 + 8000cdc0: 24450513 addi a0,a0,580 # 80066000 <_ZN6kernel13TIMER_SCRATCH17hc054732b4283b1caE> + 8000cdc4: 962a add a2,a2,a0 + 8000cdc6: 000f4537 lui a0,0xf4 + 8000cdca: 2405051b addiw a0,a0,576 + 8000cdce: f208 sd a0,32(a2) + 8000cdd0: 451d li a0,7 + mscratch::write(TIMER_SCRATCH[id].as_ptr() as usize); + 8000cdd2: 08b56f63 bltu a0,a1,8000ce70 <.LBB1_21+0x14> + 8000cdd6: a009 j 8000cdd8 <.LBB1_17+0x1c> + 8000cdd8: 7502 ld a0,32(sp) + 8000cdda: 02800593 li a1,40 + 8000cdde: 02b50533 mul a0,a0,a1 + +000000008000cde2 <.LBB1_18>: + 8000cde2: 00059597 auipc a1,0x59 + 8000cde6: 21e58593 addi a1,a1,542 # 80066000 <_ZN6kernel13TIMER_SCRATCH17hc054732b4283b1caE> + 8000cdea: 952e add a0,a0,a1 + 8000cdec: 4595 li a1,5 + 8000cdee: 00013097 auipc ra,0x13 + 8000cdf2: 6fc080e7 jalr 1788(ra) # 800204ea <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17h1ea05a5f45312d57E> + 8000cdf6: e82a sd a0,16(sp) + 8000cdf8: a009 j 8000cdfa <.LBB1_18+0x18> + 8000cdfa: 6542 ld a0,16(sp) + 8000cdfc: 00012097 auipc ra,0x12 + 8000ce00: 476080e7 jalr 1142(ra) # 8001f272 <_ZN6kernel4arch5riscv8register8mscratch5write17h9d6c8373498c8305E> + 8000ce04: a009 j 8000ce06 <.LBB1_19> + +000000008000ce06 <.LBB1_19>: + // set the machine-mode trap handler. + extern "C" { + fn timervec(); + } + + mtvec::write(timervec as usize); + 8000ce06: ffff3517 auipc a0,0xffff3 + 8000ce0a: 2aa50513 addi a0,a0,682 # 800000b0 + 8000ce0e: 0000b097 auipc ra,0xb + 8000ce12: d00080e7 jalr -768(ra) # 80017b0e <_ZN6kernel4arch5riscv8register5mtvec5write17h0d760c5cb091ccffE> + 8000ce16: a009 j 8000ce18 <.LBB1_19+0x12> + + // enable machine-mode interrupts. + mstatus::enable_interrupt(); + 8000ce18: 00000097 auipc ra,0x0 + 8000ce1c: e86080e7 jalr -378(ra) # 8000cc9e <_ZN6kernel4arch5riscv8register7mstatus16enable_interrupt17hf0a2d533b14eb99bE> + 8000ce20: a009 j 8000ce22 <.LBB1_19+0x1c> + + // enable machine-mode timer interrupts. + mie::write(mie::read() | mie::MIE::MTIE as usize); + 8000ce22: 00000097 auipc ra,0x0 + 8000ce26: 72c080e7 jalr 1836(ra) # 8000d54e <_ZN6kernel4arch5riscv8register3mie4read17h69b673b504f0a30eE> + 8000ce2a: e42a sd a0,8(sp) + 8000ce2c: a009 j 8000ce2e <.LBB1_19+0x28> + 8000ce2e: 6522 ld a0,8(sp) + 8000ce30: 08056513 ori a0,a0,128 + 8000ce34: 00000097 auipc ra,0x0 + 8000ce38: 726080e7 jalr 1830(ra) # 8000d55a <_ZN6kernel4arch5riscv8register3mie5write17hd754beffbe0101f6E> + 8000ce3c: a009 j 8000ce3e <.LBB1_19+0x38> + +} + 8000ce3e: 70e2 ld ra,56(sp) + 8000ce40: 6121 addi sp,sp,64 + 8000ce42: 8082 ret + TIMER_SCRATCH[id][3] = clint::count_mtiecmp(id) as u64; + 8000ce44: 7502 ld a0,32(sp) + +000000008000ce46 <.LBB1_20>: + 8000ce46: 0001c617 auipc a2,0x1c + 8000ce4a: fea60613 addi a2,a2,-22 # 80028e30 <.L__unnamed_1> + 8000ce4e: 45a1 li a1,8 + 8000ce50: 00016097 auipc ra,0x16 + 8000ce54: 320080e7 jalr 800(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000ce58: 0000 unimp + TIMER_SCRATCH[id][4] = interval; + 8000ce5a: 7502 ld a0,32(sp) + +000000008000ce5c <.LBB1_21>: + 8000ce5c: 0001c617 auipc a2,0x1c + 8000ce60: fec60613 addi a2,a2,-20 # 80028e48 <.L__unnamed_2> + 8000ce64: 45a1 li a1,8 + 8000ce66: 00016097 auipc ra,0x16 + 8000ce6a: 30a080e7 jalr 778(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000ce6e: 0000 unimp + mscratch::write(TIMER_SCRATCH[id].as_ptr() as usize); + 8000ce70: 7502 ld a0,32(sp) + +000000008000ce72 <.LBB1_22>: + 8000ce72: 0001c617 auipc a2,0x1c + 8000ce76: fee60613 addi a2,a2,-18 # 80028e60 <.L__unnamed_3> + 8000ce7a: 45a1 li a1,8 + 8000ce7c: 00016097 auipc ra,0x16 + 8000ce80: 2f4080e7 jalr 756(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text.rust_main: + +000000008000ce86 : + +/// 进入内核初始化 +#[no_mangle] +pub unsafe extern "C" fn rust_main() { + 8000ce86: 7169 addi sp,sp,-304 + if cpu::cpuid() == 0 { + 8000ce88: f606 sd ra,296(sp) + 8000ce8a: 00005097 auipc ra,0x5 + 8000ce8e: 566080e7 jalr 1382(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 8000ce92: fc2a sd a0,56(sp) + 8000ce94: a009 j 8000ce96 + 8000ce96: 7562 ld a0,56(sp) + 8000ce98: 4581 li a1,0 + 8000ce9a: 16b51363 bne a0,a1,8000d000 <.LBB2_48+0x20> + 8000ce9e: a009 j 8000cea0 + console_init(); + 8000cea0: ffff8097 auipc ra,0xffff8 + 8000cea4: 816080e7 jalr -2026(ra) # 800046b6 <_ZN6kernel6driver7console12console_init17h6fb79c78956ee465E> + 8000cea8: a009 j 8000ceaa <.LBB2_38> + +000000008000ceaa <.LBB2_38>: + println!("{}",LOGO); + 8000ceaa: 0001c517 auipc a0,0x1c + 8000ceae: 12650513 addi a0,a0,294 # 80028fd0 <.L__unnamed_4> + 8000ceb2: e12a sd a0,128(sp) + 8000ceb4: f22a sd a0,288(sp) + +000000008000ceb6 <.LBB2_39>: + 8000ceb6: 00012597 auipc a1,0x12 + 8000ceba: 5aa58593 addi a1,a1,1450 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8000cebe: 00012097 auipc ra,0x12 + 8000cec2: 5c6080e7 jalr 1478(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 8000cec6: f42a sd a0,40(sp) + 8000cec8: f82e sd a1,48(sp) + 8000ceca: a009 j 8000cecc <.LBB2_39+0x16> + 8000cecc: 7542 ld a0,48(sp) + 8000cece: 75a2 ld a1,40(sp) + 8000ced0: f8ae sd a1,112(sp) + 8000ced2: fcaa sd a0,120(sp) + +000000008000ced4 <.LBB2_40>: + 8000ced4: 0001c597 auipc a1,0x1c + 8000ced8: fdc58593 addi a1,a1,-36 # 80028eb0 <.L__unnamed_5> + 8000cedc: 0088 addi a0,sp,64 + 8000cede: 4609 li a2,2 + 8000cee0: 1894 addi a3,sp,112 + 8000cee2: 4705 li a4,1 + 8000cee4: ffff8097 auipc ra,0xffff8 + 8000cee8: 6a6080e7 jalr 1702(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000ceec: a009 j 8000ceee <.LBB2_40+0x1a> + 8000ceee: 0088 addi a0,sp,64 + 8000cef0: 00012097 auipc ra,0x12 + 8000cef4: d08080e7 jalr -760(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000cef8: a009 j 8000cefa <.LBB2_41> + +000000008000cefa <.LBB2_41>: + println!("xv6-rust kernel is booting!"); + 8000cefa: 0001c597 auipc a1,0x1c + 8000cefe: 10658593 addi a1,a1,262 # 80029000 <.L__unnamed_6> + +000000008000cf02 <.LBB2_42>: + 8000cf02: 0001c697 auipc a3,0x1c + 8000cf06: fa668693 addi a3,a3,-90 # 80028ea8 <.L__unnamed_12> + 8000cf0a: 0128 addi a0,sp,136 + 8000cf0c: 4605 li a2,1 + 8000cf0e: 4701 li a4,0 + 8000cf10: ffff8097 auipc ra,0xffff8 + 8000cf14: 67a080e7 jalr 1658(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000cf18: a009 j 8000cf1a <.LBB2_42+0x18> + 8000cf1a: 0128 addi a0,sp,136 + 8000cf1c: 00012097 auipc ra,0x12 + 8000cf20: cdc080e7 jalr -804(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000cf24: a009 j 8000cf26 <.LBB2_43> + +000000008000cf26 <.LBB2_43>: + KERNEL_HEAP.kinit(); // physical page allocator + 8000cf26: 0004c517 auipc a0,0x4c + 8000cf2a: 44a50513 addi a0,a0,1098 # 80059370 <_ZN6kernel6memory6kalloc11KERNEL_HEAP17hee4af7794785bdacE> + 8000cf2e: 00000097 auipc ra,0x0 + 8000cf32: 36c080e7 jalr 876(ra) # 8000d29a <_ZN6kernel6memory6kalloc10KernelHeap5kinit17hadc76a3ae98e4bd9E> + 8000cf36: a009 j 8000cf38 <.LBB2_43+0x12> + kvm_init(); // create kernel page table + 8000cf38: ffffe097 auipc ra,0xffffe + 8000cf3c: ffa080e7 jalr -6(ra) # 8000af32 + 8000cf40: a009 j 8000cf42 <.LBB2_43+0x1c> + kvm_init_hart(); // turn on paging + 8000cf42: ffffe097 auipc ra,0xffffe + 8000cf46: 02e080e7 jalr 46(ra) # 8000af70 <_ZN6kernel6memory7mapping10kernel_map13kvm_init_hart17hca08c717b940e5bcE> + 8000cf4a: a009 j 8000cf4c <.LBB2_44> + +000000008000cf4c <.LBB2_44>: + PROC_MANAGER.init(); // process table + 8000cf4c: 0004c517 auipc a0,0x4c + 8000cf50: 48450513 addi a0,a0,1156 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000cf54: 00001097 auipc ra,0x1 + 8000cf58: c9c080e7 jalr -868(ra) # 8000dbf0 <_ZN6kernel7process7manager11ProcManager4init17h6f55d4e0f14b932aE> + 8000cf5c: a009 j 8000cf5e <.LBB2_44+0x12> + trap_init_hart(); // trap vectors + 8000cf5e: ffff9097 auipc ra,0xffff9 + 8000cf62: 342080e7 jalr 834(ra) # 800062a0 <_ZN6kernel4trap14trap_init_hart17h35cf9f3a8bf40f94E> + 8000cf66: a009 j 8000cf68 <.LBB2_44+0x1c> + plic_init(); // set up interrupt controller + 8000cf68: 00012097 auipc ra,0x12 + 8000cf6c: 98a080e7 jalr -1654(ra) # 8001e8f2 <_ZN6kernel6driver4plic9plic_init17he281b1081f5a24ddE> + 8000cf70: a009 j 8000cf72 <.LBB2_44+0x26> + plic_init_hart(); // ask PLIC for device interrupts + 8000cf72: 00012097 auipc ra,0x12 + 8000cf76: 9b0080e7 jalr -1616(ra) # 8001e922 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E> + 8000cf7a: a009 j 8000cf7c <.LBB2_45> + +000000008000cf7c <.LBB2_45>: + BCACHE.binit(); // buffer cache + 8000cf7c: 00023517 auipc a0,0x23 + 8000cf80: 08450513 addi a0,a0,132 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8000cf84: ffff6097 auipc ra,0xffff6 + 8000cf88: 0b8080e7 jalr 184(ra) # 8000303c <_ZN6kernel2fs3bio6Bcache5binit17heeb55dbf2032387dE> + 8000cf8c: a009 j 8000cf8e <.LBB2_46> + +000000008000cf8e <.LBB2_46>: + DISK.acquire().init(); // emulated hard disk + 8000cf8e: 00052517 auipc a0,0x52 + 8000cf92: 07250513 addi a0,a0,114 # 8005f000 <_ZN6kernel6driver11virtio_disk4DISK17h9e8917083150b34aE> + 8000cf96: 00004097 auipc ra,0x4 + 8000cf9a: fcc080e7 jalr -52(ra) # 80010f62 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E> + 8000cf9e: fd2a sd a0,184(sp) + 8000cfa0: a009 j 8000cfa2 <.LBB2_46+0x14> + 8000cfa2: 1928 addi a0,sp,184 + 8000cfa4: 00005097 auipc ra,0x5 + 8000cfa8: dda080e7 jalr -550(ra) # 80011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E> + 8000cfac: f02a sd a0,32(sp) + 8000cfae: a009 j 8000cfb0 <.LBB2_46+0x22> + 8000cfb0: 7502 ld a0,32(sp) + 8000cfb2: 00013097 auipc ra,0x13 + 8000cfb6: 9dc080e7 jalr -1572(ra) # 8001f98e <_ZN6kernel6driver11virtio_disk4Disk4init17h491380cac5f59b4bE> + 8000cfba: a009 j 8000cfbc <.LBB2_46+0x2e> + 8000cfbc: 1928 addi a0,sp,184 + 8000cfbe: ffffa097 auipc ra,0xffffa + 8000cfc2: 2a8080e7 jalr 680(ra) # 80007266 <_ZN4core3ptr99drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..virtio_disk..Disk$GT$$GT$17h4fc01c278f0bfe6cE> + 8000cfc6: a009 j 8000cfc8 <.LBB2_47> + +000000008000cfc8 <.LBB2_47>: + PROC_MANAGER.user_init(); // first user process + 8000cfc8: 0004c517 auipc a0,0x4c + 8000cfcc: 40850513 addi a0,a0,1032 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000cfd0: 00001097 auipc ra,0x1 + 8000cfd4: dcc080e7 jalr -564(ra) # 8000dd9c <_ZN6kernel7process7manager11ProcManager9user_init17h45a7031cbcd11d0fE> + 8000cfd8: a009 j 8000cfda <.LBB2_47+0x12> + 8000cfda: 4611 li a2,4 + STARTED.store(true, Ordering::SeqCst); + 8000cfdc: 0cc10323 sb a2,198(sp) + +000000008000cfe0 <.LBB2_48>: + 8000cfe0: 00059517 auipc a0,0x59 + 8000cfe4: 5a150513 addi a0,a0,1441 # 80066581 <_ZN6kernel7STARTED17h3a2948c645b636c9E> + 8000cfe8: 4585 li a1,1 + 8000cfea: ffff7097 auipc ra,0xffff7 + 8000cfee: 79a080e7 jalr 1946(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 8000cff2: a009 j 8000cff4 <.LBB2_48+0x14> + sstatus::intr_on(); + 8000cff4: 00012097 auipc ra,0x12 + 8000cff8: 1fc080e7 jalr 508(ra) # 8001f1f0 <_ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E> + 8000cffc: a009 j 8000cffe <.LBB2_48+0x1e> + if cpu::cpuid() == 0 { + 8000cffe: a065 j 8000d0a6 <.LBB2_52> + 8000d000: 4591 li a1,4 + } else { + while !STARTED.load(Ordering::SeqCst){} + 8000d002: 0cb103a3 sb a1,199(sp) + +000000008000d006 <.LBB2_49>: + 8000d006: 00059517 auipc a0,0x59 + 8000d00a: 57b50513 addi a0,a0,1403 # 80066581 <_ZN6kernel7STARTED17h3a2948c645b636c9E> + 8000d00e: ffff7097 auipc ra,0xffff7 + 8000d012: 6f8080e7 jalr 1784(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 8000d016: ec2a sd a0,24(sp) + 8000d018: a009 j 8000d01a <.LBB2_49+0x14> + 8000d01a: 6562 ld a0,24(sp) + 8000d01c: 4581 li a1,0 + 8000d01e: 00b50963 beq a0,a1,8000d030 <.LBB2_49+0x2a> + 8000d022: a009 j 8000d024 <.LBB2_49+0x1e> + println!("hart {} starting\n", cpu::cpuid()); + 8000d024: 00005097 auipc ra,0x5 + 8000d028: 3cc080e7 jalr 972(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 8000d02c: ea2a sd a0,272(sp) + 8000d02e: a011 j 8000d032 <.LBB2_49+0x2c> + while !STARTED.load(Ordering::SeqCst){} + 8000d030: bfc1 j 8000d000 <.LBB2_48+0x20> + 8000d032: 0a08 addi a0,sp,272 + println!("hart {} starting\n", cpu::cpuid()); + 8000d034: e62a sd a0,264(sp) + 8000d036: ee2a sd a0,280(sp) + +000000008000d038 <.LBB2_50>: + 8000d038: 00019597 auipc a1,0x19 + 8000d03c: 86858593 addi a1,a1,-1944 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8000d040: 00013097 auipc ra,0x13 + 8000d044: 52e080e7 jalr 1326(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8000d048: e42a sd a0,8(sp) + 8000d04a: e82e sd a1,16(sp) + 8000d04c: a009 j 8000d04e <.LBB2_50+0x16> + 8000d04e: 6542 ld a0,16(sp) + 8000d050: 65a2 ld a1,8(sp) + 8000d052: fdae sd a1,248(sp) + 8000d054: e22a sd a0,256(sp) + +000000008000d056 <.LBB2_51>: + 8000d056: 0001c597 auipc a1,0x1c + 8000d05a: e3258593 addi a1,a1,-462 # 80028e88 <.L__unnamed_8> + 8000d05e: 01a8 addi a0,sp,200 + 8000d060: 4609 li a2,2 + 8000d062: 19b4 addi a3,sp,248 + 8000d064: 4705 li a4,1 + 8000d066: ffff8097 auipc ra,0xffff8 + 8000d06a: 524080e7 jalr 1316(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000d06e: a009 j 8000d070 <.LBB2_51+0x1a> + 8000d070: 01a8 addi a0,sp,200 + 8000d072: 00012097 auipc ra,0x12 + 8000d076: b86080e7 jalr -1146(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000d07a: a009 j 8000d07c <.LBB2_51+0x26> + kvm_init_hart(); // turn on paging + 8000d07c: ffffe097 auipc ra,0xffffe + 8000d080: ef4080e7 jalr -268(ra) # 8000af70 <_ZN6kernel6memory7mapping10kernel_map13kvm_init_hart17hca08c717b940e5bcE> + 8000d084: a009 j 8000d086 <.LBB2_51+0x30> + trap_init_hart(); // install kernel trap vector + 8000d086: ffff9097 auipc ra,0xffff9 + 8000d08a: 21a080e7 jalr 538(ra) # 800062a0 <_ZN6kernel4trap14trap_init_hart17h35cf9f3a8bf40f94E> + 8000d08e: a009 j 8000d090 <.LBB2_51+0x3a> + plic_init(); // set up interrupt controller + 8000d090: 00012097 auipc ra,0x12 + 8000d094: 862080e7 jalr -1950(ra) # 8001e8f2 <_ZN6kernel6driver4plic9plic_init17he281b1081f5a24ddE> + 8000d098: a009 j 8000d09a <.LBB2_51+0x44> + plic_init_hart(); // ask PLIC for device interrupts + 8000d09a: 00012097 auipc ra,0x12 + 8000d09e: 888080e7 jalr -1912(ra) # 8001e922 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E> + 8000d0a2: a009 j 8000d0a4 <.LBB2_51+0x4e> + if cpu::cpuid() == 0 { + 8000d0a4: a009 j 8000d0a6 <.LBB2_52> + +000000008000d0a6 <.LBB2_52>: + } + CPU_MANAGER.scheduler(); + 8000d0a6: 00059517 auipc a0,0x59 + 8000d0aa: 09a50513 addi a0,a0,154 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000d0ae: 00005097 auipc ra,0x5 + 8000d0b2: 410080e7 jalr 1040(ra) # 800124be <_ZN6kernel7process3cpu10CPUManager9scheduler17hecedd2e89c301e93E> + 8000d0b6: a009 j 8000d0b8 <.LBB2_52+0x12> + +} + 8000d0b8: 70b2 ld ra,296(sp) + 8000d0ba: 6155 addi sp,sp,304 + 8000d0bc: 8082 ret + +Disassembly of section .text.rust_oom: + +000000008000d0be : + +#[global_allocator] +pub static KERNEL_HEAP: KernelHeap = KernelHeap::uninit(); + +#[alloc_error_handler] +fn alloc_error_handler(layout: Layout) -> ! { + 8000d0be: 7119 addi sp,sp,-128 + 8000d0c0: fc86 sd ra,120(sp) + 8000d0c2: ec2a sd a0,24(sp) + 8000d0c4: f02e sd a1,32(sp) + 8000d0c6: 0828 addi a0,sp,24 + panic!("alloc error: {:?}", layout); + 8000d0c8: f4aa sd a0,104(sp) + 8000d0ca: f8aa sd a0,112(sp) + +000000008000d0cc <.LBB0_3>: + 8000d0cc: 00019597 auipc a1,0x19 + 8000d0d0: e6e58593 addi a1,a1,-402 # 80025f3a <_ZN64_$LT$core..alloc..layout..Layout$u20$as$u20$core..fmt..Debug$GT$3fmt17h791c624323e1e5daE> + 8000d0d4: 00013097 auipc ra,0x13 + 8000d0d8: 4bc080e7 jalr 1212(ra) # 80020590 <_ZN4core3fmt10ArgumentV13new17hc2eeb6f5565b6dd2E> + 8000d0dc: e42a sd a0,8(sp) + 8000d0de: e82e sd a1,16(sp) + 8000d0e0: a009 j 8000d0e2 <.LBB0_3+0x16> + 8000d0e2: 6542 ld a0,16(sp) + 8000d0e4: 65a2 ld a1,8(sp) + 8000d0e6: ecae sd a1,88(sp) + 8000d0e8: f0aa sd a0,96(sp) + +000000008000d0ea <.LBB0_4>: + 8000d0ea: 0001c597 auipc a1,0x1c + 8000d0ee: f3658593 addi a1,a1,-202 # 80029020 <.L__unnamed_1> + 8000d0f2: 1028 addi a0,sp,40 + 8000d0f4: 08b4 addi a3,sp,88 + 8000d0f6: 4705 li a4,1 + 8000d0f8: 863a mv a2,a4 + 8000d0fa: ffff8097 auipc ra,0xffff8 + 8000d0fe: 490080e7 jalr 1168(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000d102: a009 j 8000d104 <.LBB0_5> + +000000008000d104 <.LBB0_5>: + 8000d104: 0001c597 auipc a1,0x1c + 8000d108: f4458593 addi a1,a1,-188 # 80029048 <.L__unnamed_2> + 8000d10c: 1028 addi a0,sp,40 + 8000d10e: 00016097 auipc ra,0x16 + 8000d112: 0a2080e7 jalr 162(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text._ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E: + +000000008000d118 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E>: + +// kernel heap +pub struct KernelHeap(Spinlock); + +unsafe impl GlobalAlloc for KernelHeap { + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + 8000d118: 715d addi sp,sp,-80 + 8000d11a: e486 sd ra,72(sp) + 8000d11c: ec32 sd a2,24(sp) + 8000d11e: f02e sd a1,32(sp) + 8000d120: f82a sd a0,48(sp) + 8000d122: fc2e sd a1,56(sp) + 8000d124: e0b2 sd a2,64(sp) + self.0.acquire().alloc(layout) + 8000d126: 00004097 auipc ra,0x4 + 8000d12a: 9dc080e7 jalr -1572(ra) # 80010b02 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E> + 8000d12e: f42a sd a0,40(sp) + 8000d130: a009 j 8000d132 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E+0x1a> + 8000d132: 1028 addi a0,sp,40 + 8000d134: 00005097 auipc ra,0x5 + 8000d138: c6a080e7 jalr -918(ra) # 80011d9e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h5eeb9448b47ad682E> + 8000d13c: e82a sd a0,16(sp) + 8000d13e: a009 j 8000d140 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E+0x28> + 8000d140: 6662 ld a2,24(sp) + 8000d142: 7582 ld a1,32(sp) + 8000d144: 6542 ld a0,16(sp) + 8000d146: 00014097 auipc ra,0x14 + 8000d14a: d5c080e7 jalr -676(ra) # 80020ea2 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E> + 8000d14e: e42a sd a0,8(sp) + 8000d150: a009 j 8000d152 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E+0x3a> + 8000d152: 1028 addi a0,sp,40 + } + 8000d154: ffffa097 auipc ra,0xffffa + 8000d158: 06a080e7 jalr 106(ra) # 800071be <_ZN4core3ptr88drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$allocator..BuddySystem$GT$$GT$17hd20388e8ca3384f9E> + 8000d15c: a009 j 8000d15e <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E+0x46> + 8000d15e: 6522 ld a0,8(sp) + 8000d160: 60a6 ld ra,72(sp) + 8000d162: 6161 addi sp,sp,80 + 8000d164: 8082 ret + +Disassembly of section .text._ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E: + +000000008000d166 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E>: + + unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + 8000d166: 715d addi sp,sp,-80 + 8000d168: e486 sd ra,72(sp) + 8000d16a: e436 sd a3,8(sp) + 8000d16c: e832 sd a2,16(sp) + 8000d16e: ec2e sd a1,24(sp) + 8000d170: f42a sd a0,40(sp) + 8000d172: f82e sd a1,48(sp) + 8000d174: fc32 sd a2,56(sp) + 8000d176: e0b6 sd a3,64(sp) + self.0.acquire().dealloc(ptr, layout) + 8000d178: 00004097 auipc ra,0x4 + 8000d17c: 98a080e7 jalr -1654(ra) # 80010b02 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E> + 8000d180: f02a sd a0,32(sp) + 8000d182: a009 j 8000d184 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E+0x1e> + 8000d184: 1008 addi a0,sp,32 + 8000d186: 00005097 auipc ra,0x5 + 8000d18a: c18080e7 jalr -1000(ra) # 80011d9e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h5eeb9448b47ad682E> + 8000d18e: e02a sd a0,0(sp) + 8000d190: a009 j 8000d192 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E+0x2c> + 8000d192: 66a2 ld a3,8(sp) + 8000d194: 6642 ld a2,16(sp) + 8000d196: 65e2 ld a1,24(sp) + 8000d198: 6502 ld a0,0(sp) + 8000d19a: 00014097 auipc ra,0x14 + 8000d19e: 054080e7 jalr 84(ra) # 800211ee <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE> + 8000d1a2: a009 j 8000d1a4 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E+0x3e> + 8000d1a4: 1008 addi a0,sp,32 + } + 8000d1a6: ffffa097 auipc ra,0xffffa + 8000d1aa: 018080e7 jalr 24(ra) # 800071be <_ZN4core3ptr88drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$allocator..BuddySystem$GT$$GT$17hd20388e8ca3384f9E> + 8000d1ae: a009 j 8000d1b0 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E+0x4a> + 8000d1b0: 60a6 ld ra,72(sp) + 8000d1b2: 6161 addi sp,sp,80 + 8000d1b4: 8082 ret + +Disassembly of section .text._ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E: + +000000008000d1b6 <_ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E>: +impl KernelHeap { + const fn uninit() -> Self { + Self(Spinlock::new(BuddySystem::uninit(), "kernel heap")) + } + + unsafe fn init(&self, start: usize, end: usize) { + 8000d1b6: 7111 addi sp,sp,-256 + 8000d1b8: fd86 sd ra,248(sp) + 8000d1ba: f032 sd a2,32(sp) + 8000d1bc: f42e sd a1,40(sp) + 8000d1be: edaa sd a0,216(sp) + 8000d1c0: f1ae sd a1,224(sp) + 8000d1c2: f5b2 sd a2,232(sp) + let res = self.0.acquire().init(start, end, LEAF_SIZE, MAX_ALIGNMENT); + 8000d1c4: 00004097 auipc ra,0x4 + 8000d1c8: 93e080e7 jalr -1730(ra) # 80010b02 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E> + 8000d1cc: e4aa sd a0,72(sp) + 8000d1ce: a009 j 8000d1d0 <_ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E+0x1a> + 8000d1d0: 00a8 addi a0,sp,72 + 8000d1d2: 00005097 auipc ra,0x5 + 8000d1d6: bcc080e7 jalr -1076(ra) # 80011d9e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h5eeb9448b47ad682E> + 8000d1da: ec2a sd a0,24(sp) + 8000d1dc: a009 j 8000d1de <_ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E+0x28> + 8000d1de: 7602 ld a2,32(sp) + 8000d1e0: 75a2 ld a1,40(sp) + 8000d1e2: 6562 ld a0,24(sp) + 8000d1e4: 46c1 li a3,16 + 8000d1e6: 6705 lui a4,0x1 + 8000d1e8: 00013097 auipc ra,0x13 + 8000d1ec: 772080e7 jalr 1906(ra) # 8002095a <_ZN9allocator11BuddySystem4init17h0838f8d4c4026c43E> + 8000d1f0: fc2a sd a0,56(sp) + 8000d1f2: e0ae sd a1,64(sp) + 8000d1f4: a009 j 8000d1f6 <_ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E+0x40> + 8000d1f6: 00a8 addi a0,sp,72 + 8000d1f8: ffffa097 auipc ra,0xffffa + 8000d1fc: fc6080e7 jalr -58(ra) # 800071be <_ZN4core3ptr88drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$allocator..BuddySystem$GT$$GT$17hd20388e8ca3384f9E> + 8000d200: a009 j 8000d202 <_ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E+0x4c> + match res { + Ok(()) => { + 8000d202: 7562 ld a0,56(sp) + 8000d204: 00a035b3 snez a1,a0 + 8000d208: 4581 li a1,0 + 8000d20a: 02b50663 beq a0,a1,8000d236 <.LBB3_16> + 8000d20e: a009 j 8000d210 <_ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E+0x5a> + println!("KernelHeap: success to init."); + }, + + Err(err) => { + 8000d210: 75e2 ld a1,56(sp) + 8000d212: 6506 ld a0,64(sp) + 8000d214: e12e sd a1,128(sp) + 8000d216: e52a sd a0,136(sp) + 8000d218: 0108 addi a0,sp,128 + println!("KernelHeap: init error: {}.", err); + 8000d21a: e9aa sd a0,208(sp) + 8000d21c: f9aa sd a0,240(sp) + +000000008000d21e <.LBB3_15>: + 8000d21e: 00012597 auipc a1,0x12 + 8000d222: 24258593 addi a1,a1,578 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8000d226: 00012097 auipc ra,0x12 + 8000d22a: 25e080e7 jalr 606(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 8000d22e: e42a sd a0,8(sp) + 8000d230: e82e sd a1,16(sp) + 8000d232: a80d j 8000d264 <.LBB3_17+0x26> + ... + +000000008000d236 <.LBB3_16>: + println!("KernelHeap: success to init."); + 8000d236: 0001c597 auipc a1,0x1c + 8000d23a: e8a58593 addi a1,a1,-374 # 800290c0 <.L__unnamed_3> + +000000008000d23e <.LBB3_17>: + 8000d23e: 0001c697 auipc a3,0x1c + 8000d242: e9268693 addi a3,a3,-366 # 800290d0 <.L__unnamed_14> + 8000d246: 0888 addi a0,sp,80 + 8000d248: 4605 li a2,1 + 8000d24a: 4701 li a4,0 + 8000d24c: ffff8097 auipc ra,0xffff8 + 8000d250: 33e080e7 jalr 830(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000d254: a009 j 8000d256 <.LBB3_17+0x18> + 8000d256: 0888 addi a0,sp,80 + 8000d258: 00012097 auipc ra,0x12 + 8000d25c: 9a0080e7 jalr -1632(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000d260: a009 j 8000d262 <.LBB3_17+0x24> + match res { + 8000d262: a80d j 8000d294 <.LBB3_18+0x28> + println!("KernelHeap: init error: {}.", err); + 8000d264: 6542 ld a0,16(sp) + 8000d266: 65a2 ld a1,8(sp) + 8000d268: e1ae sd a1,192(sp) + 8000d26a: e5aa sd a0,200(sp) + +000000008000d26c <.LBB3_18>: + 8000d26c: 0001c597 auipc a1,0x1c + 8000d270: e1458593 addi a1,a1,-492 # 80029080 <.L__unnamed_5> + 8000d274: 0908 addi a0,sp,144 + 8000d276: 4609 li a2,2 + 8000d278: 0194 addi a3,sp,192 + 8000d27a: 4705 li a4,1 + 8000d27c: ffff8097 auipc ra,0xffff8 + 8000d280: 30e080e7 jalr 782(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000d284: a009 j 8000d286 <.LBB3_18+0x1a> + 8000d286: 0908 addi a0,sp,144 + 8000d288: 00012097 auipc ra,0x12 + 8000d28c: 970080e7 jalr -1680(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000d290: a009 j 8000d292 <.LBB3_18+0x26> + match res { + 8000d292: a009 j 8000d294 <.LBB3_18+0x28> + } + } + } + 8000d294: 70ee ld ra,248(sp) + 8000d296: 6111 addi sp,sp,256 + 8000d298: 8082 ret + +Disassembly of section .text._ZN6kernel6memory6kalloc10KernelHeap5kinit17hadc76a3ae98e4bd9E: + +000000008000d29a <_ZN6kernel6memory6kalloc10KernelHeap5kinit17hadc76a3ae98e4bd9E>: + + pub unsafe fn kinit(&self) { + 8000d29a: 7131 addi sp,sp,-192 + 8000d29c: fd06 sd ra,184(sp) + 8000d29e: ec2a sd a0,24(sp) + 8000d2a0: f12a sd a0,160(sp) + +000000008000d2a2 <.LBB4_6>: + extern "C" { + fn end(); + } + let end = end as usize; + 8000d2a2: 00059517 auipc a0,0x59 + 8000d2a6: 2ee50513 addi a0,a0,750 # 80066590 + 8000d2aa: fc2a sd a0,56(sp) + 8000d2ac: 1828 addi a0,sp,56 + println!("KernelHeap: available memory: [{:#x}, {:#x})", end, PHYSTOP); + 8000d2ae: e92a sd a0,144(sp) + +000000008000d2b0 <.LBB4_7>: + 8000d2b0: 0001a597 auipc a1,0x1a + 8000d2b4: 58858593 addi a1,a1,1416 # 80027838 <.L__unnamed_6+0xa8> + 8000d2b8: f02e sd a1,32(sp) + 8000d2ba: ed2e sd a1,152(sp) + 8000d2bc: f52a sd a0,168(sp) + 8000d2be: f92e sd a1,176(sp) + +000000008000d2c0 <.LBB4_8>: + 8000d2c0: 00018597 auipc a1,0x18 + 8000d2c4: fc258593 addi a1,a1,-62 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 8000d2c8: 00013097 auipc ra,0x13 + 8000d2cc: 2a6080e7 jalr 678(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8000d2d0: f42a sd a0,40(sp) + 8000d2d2: f82e sd a1,48(sp) + 8000d2d4: a009 j 8000d2d6 <.LBB4_8+0x16> + 8000d2d6: 7502 ld a0,32(sp) + +000000008000d2d8 <.LBB4_9>: + 8000d2d8: 00018597 auipc a1,0x18 + 8000d2dc: faa58593 addi a1,a1,-86 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 8000d2e0: 00013097 auipc ra,0x13 + 8000d2e4: 28e080e7 jalr 654(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8000d2e8: e42a sd a0,8(sp) + 8000d2ea: e82e sd a1,16(sp) + 8000d2ec: a009 j 8000d2ee <.LBB4_9+0x16> + 8000d2ee: 6542 ld a0,16(sp) + 8000d2f0: 65a2 ld a1,8(sp) + 8000d2f2: 7642 ld a2,48(sp) + 8000d2f4: 76a2 ld a3,40(sp) + 8000d2f6: f8b6 sd a3,112(sp) + 8000d2f8: fcb2 sd a2,120(sp) + 8000d2fa: e12e sd a1,128(sp) + 8000d2fc: e52a sd a0,136(sp) + +000000008000d2fe <.LBB4_10>: + 8000d2fe: 0001c597 auipc a1,0x1c + 8000d302: dfa58593 addi a1,a1,-518 # 800290f8 <.L__unnamed_7> + +000000008000d306 <.LBB4_11>: + 8000d306: 0001c797 auipc a5,0x1c + 8000d30a: e2278793 addi a5,a5,-478 # 80029128 <.L__unnamed_8> + 8000d30e: 0088 addi a0,sp,64 + 8000d310: 460d li a2,3 + 8000d312: 1894 addi a3,sp,112 + 8000d314: 4809 li a6,2 + 8000d316: 8742 mv a4,a6 + 8000d318: ffff8097 auipc ra,0xffff8 + 8000d31c: 24c080e7 jalr 588(ra) # 80005564 <_ZN4core3fmt9Arguments16new_v1_formatted17hf6d3ed0f8e821319E> + 8000d320: a009 j 8000d322 <.LBB4_11+0x1c> + 8000d322: 0088 addi a0,sp,64 + 8000d324: 00012097 auipc ra,0x12 + 8000d328: 8d4080e7 jalr -1836(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000d32c: a009 j 8000d32e <.LBB4_11+0x28> + self.init(end, PHYSTOP); + 8000d32e: 6562 ld a0,24(sp) + 8000d330: 75e2 ld a1,56(sp) + 8000d332: 4645 li a2,17 + 8000d334: 066e slli a2,a2,0x1b + 8000d336: 00000097 auipc ra,0x0 + 8000d33a: e80080e7 jalr -384(ra) # 8000d1b6 <_ZN6kernel6memory6kalloc10KernelHeap4init17he7fa11863b607d55E> + 8000d33e: a009 j 8000d340 <.LBB4_11+0x3a> + } + 8000d340: 70ea ld ra,184(sp) + 8000d342: 6129 addi sp,sp,192 + 8000d344: 8082 ret + +Disassembly of section .text.__rg_alloc: + +000000008000d346 <__rg_alloc>: +pub static KERNEL_HEAP: KernelHeap = KernelHeap::uninit(); + 8000d346: 7179 addi sp,sp,-48 + 8000d348: f406 sd ra,40(sp) + 8000d34a: ec2a sd a0,24(sp) + 8000d34c: f02e sd a1,32(sp) + 8000d34e: 00012097 auipc ra,0x12 + 8000d352: 4e4080e7 jalr 1252(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8000d356: e42a sd a0,8(sp) + 8000d358: e82e sd a1,16(sp) + 8000d35a: a009 j 8000d35c <__rg_alloc+0x16> + 8000d35c: 6642 ld a2,16(sp) + 8000d35e: 65a2 ld a1,8(sp) + +000000008000d360 <.LBB5_3>: + 8000d360: 0004c517 auipc a0,0x4c + 8000d364: 01050513 addi a0,a0,16 # 80059370 <_ZN6kernel6memory6kalloc11KERNEL_HEAP17hee4af7794785bdacE> + 8000d368: 00000097 auipc ra,0x0 + 8000d36c: db0080e7 jalr -592(ra) # 8000d118 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$5alloc17h526e18d88530d166E> + 8000d370: e02a sd a0,0(sp) + 8000d372: a009 j 8000d374 <.LBB5_3+0x14> + 8000d374: 6502 ld a0,0(sp) + 8000d376: 70a2 ld ra,40(sp) + 8000d378: 6145 addi sp,sp,48 + 8000d37a: 8082 ret + +Disassembly of section .text.__rg_dealloc: + +000000008000d37c <__rg_dealloc>: + 8000d37c: 715d addi sp,sp,-80 + 8000d37e: e486 sd ra,72(sp) + 8000d380: e432 sd a2,8(sp) + 8000d382: 862e mv a2,a1 + 8000d384: 65a2 ld a1,8(sp) + 8000d386: e832 sd a2,16(sp) + 8000d388: 862a mv a2,a0 + 8000d38a: 6542 ld a0,16(sp) + 8000d38c: ec32 sd a2,24(sp) + 8000d38e: f832 sd a2,48(sp) + 8000d390: fc2a sd a0,56(sp) + 8000d392: e0ae sd a1,64(sp) + 8000d394: 00012097 auipc ra,0x12 + 8000d398: 49e080e7 jalr 1182(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8000d39c: f02a sd a0,32(sp) + 8000d39e: f42e sd a1,40(sp) + 8000d3a0: a009 j 8000d3a2 <__rg_dealloc+0x26> + 8000d3a2: 76a2 ld a3,40(sp) + 8000d3a4: 7602 ld a2,32(sp) + 8000d3a6: 65e2 ld a1,24(sp) + +000000008000d3a8 <.LBB6_3>: + 8000d3a8: 0004c517 auipc a0,0x4c + 8000d3ac: fc850513 addi a0,a0,-56 # 80059370 <_ZN6kernel6memory6kalloc11KERNEL_HEAP17hee4af7794785bdacE> + 8000d3b0: 00000097 auipc ra,0x0 + 8000d3b4: db6080e7 jalr -586(ra) # 8000d166 <_ZN87_$LT$kernel..memory..kalloc..KernelHeap$u20$as$u20$core..alloc..global..GlobalAlloc$GT$7dealloc17hf9dbc9c2cc300335E> + 8000d3b8: a009 j 8000d3ba <.LBB6_3+0x12> + 8000d3ba: 60a6 ld ra,72(sp) + 8000d3bc: 6161 addi sp,sp,80 + 8000d3be: 8082 ret + +Disassembly of section .text.__rg_realloc: + +000000008000d3c0 <__rg_realloc>: + 8000d3c0: 711d addi sp,sp,-96 + 8000d3c2: ec86 sd ra,88(sp) + 8000d3c4: e436 sd a3,8(sp) + 8000d3c6: e832 sd a2,16(sp) + 8000d3c8: 862e mv a2,a1 + 8000d3ca: 65c2 ld a1,16(sp) + 8000d3cc: ec32 sd a2,24(sp) + 8000d3ce: 862a mv a2,a0 + 8000d3d0: 6562 ld a0,24(sp) + 8000d3d2: f032 sd a2,32(sp) + 8000d3d4: fc32 sd a2,56(sp) + 8000d3d6: e0aa sd a0,64(sp) + 8000d3d8: e4ae sd a1,72(sp) + 8000d3da: e8b6 sd a3,80(sp) + 8000d3dc: 00012097 auipc ra,0x12 + 8000d3e0: 456080e7 jalr 1110(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8000d3e4: f42a sd a0,40(sp) + 8000d3e6: f82e sd a1,48(sp) + 8000d3e8: a009 j 8000d3ea <__rg_realloc+0x2a> + 8000d3ea: 6722 ld a4,8(sp) + 8000d3ec: 76c2 ld a3,48(sp) + 8000d3ee: 7622 ld a2,40(sp) + 8000d3f0: 7582 ld a1,32(sp) + +000000008000d3f2 <.LBB7_3>: + 8000d3f2: 0004c517 auipc a0,0x4c + 8000d3f6: f7e50513 addi a0,a0,-130 # 80059370 <_ZN6kernel6memory6kalloc11KERNEL_HEAP17hee4af7794785bdacE> + 8000d3fa: ffff7097 auipc ra,0xffff7 + 8000d3fe: 7bc080e7 jalr 1980(ra) # 80004bb6 <_ZN4core5alloc6global11GlobalAlloc7realloc17h24a579bea5cb79d9E> + 8000d402: e02a sd a0,0(sp) + 8000d404: a009 j 8000d406 <.LBB7_3+0x14> + 8000d406: 6502 ld a0,0(sp) + 8000d408: 60e6 ld ra,88(sp) + 8000d40a: 6125 addi sp,sp,96 + 8000d40c: 8082 ret + +Disassembly of section .text.__rg_alloc_zeroed: + +000000008000d40e <__rg_alloc_zeroed>: + 8000d40e: 7179 addi sp,sp,-48 + 8000d410: f406 sd ra,40(sp) + 8000d412: ec2a sd a0,24(sp) + 8000d414: f02e sd a1,32(sp) + 8000d416: 00012097 auipc ra,0x12 + 8000d41a: 41c080e7 jalr 1052(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8000d41e: e42a sd a0,8(sp) + 8000d420: e82e sd a1,16(sp) + 8000d422: a009 j 8000d424 <__rg_alloc_zeroed+0x16> + 8000d424: 6642 ld a2,16(sp) + 8000d426: 65a2 ld a1,8(sp) + +000000008000d428 <.LBB8_3>: + 8000d428: 0004c517 auipc a0,0x4c + 8000d42c: f4850513 addi a0,a0,-184 # 80059370 <_ZN6kernel6memory6kalloc11KERNEL_HEAP17hee4af7794785bdacE> + 8000d430: ffff7097 auipc ra,0xffff7 + 8000d434: 722080e7 jalr 1826(ra) # 80004b52 <_ZN4core5alloc6global11GlobalAlloc12alloc_zeroed17h5bb5edba03a2227bE> + 8000d438: e02a sd a0,0(sp) + 8000d43a: a009 j 8000d43c <.LBB8_3+0x14> + 8000d43c: 6502 ld a0,0(sp) + 8000d43e: 70a2 ld ra,40(sp) + 8000d440: 6145 addi sp,sp,48 + 8000d442: 8082 ret + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4Disk4init28_$u7b$$u7b$closure$u7d$$u7d$17h8a5adb868ad71917E: + +000000008000d444 <_ZN6kernel6driver11virtio_disk4Disk4init28_$u7b$$u7b$closure$u7d$$u7d$17h8a5adb868ad71917E>: + self.free.iter_mut().for_each(|f| *f = true); + 8000d444: 1141 addi sp,sp,-16 + 8000d446: e02a sd a0,0(sp) + 8000d448: e42e sd a1,8(sp) + 8000d44a: 4505 li a0,1 + 8000d44c: 00a58023 sb a0,0(a1) + 8000d450: 0141 addi sp,sp,16 + 8000d452: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E: + +000000008000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E>: + fn from(t: T) -> T { + 8000d454: 1141 addi sp,sp,-16 + } + 8000d456: 0141 addi sp,sp,16 + 8000d458: 8082 ret + +Disassembly of section .text._ZN81_$LT$core..str..iter..Bytes$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h47cb47c87defe3efE: + +000000008000d45a <_ZN81_$LT$core..str..iter..Bytes$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h47cb47c87defe3efE>: +#[stable(feature = "rust1", since = "1.0.0")] +impl Iterator for Bytes<'_> { + type Item = u8; + + #[inline] + fn next(&mut self) -> Option { + 8000d45a: 1101 addi sp,sp,-32 + 8000d45c: ec06 sd ra,24(sp) + 8000d45e: e82a sd a0,16(sp) + self.0.next() + 8000d460: ffff7097 auipc ra,0xffff7 + 8000d464: 6b6080e7 jalr 1718(ra) # 80004b16 <_ZN104_$LT$core..iter..adapters..copied..Copied$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h5c47b4a6235bae37E> + 8000d468: e02a sd a0,0(sp) + 8000d46a: e42e sd a1,8(sp) + 8000d46c: a009 j 8000d46e <_ZN81_$LT$core..str..iter..Bytes$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h47cb47c87defe3efE+0x14> + } + 8000d46e: 65a2 ld a1,8(sp) + 8000d470: 6502 ld a0,0(sp) + 8000d472: 8905 andi a0,a0,1 + 8000d474: 60e2 ld ra,24(sp) + 8000d476: 6105 addi sp,sp,32 + 8000d478: 8082 ret + +Disassembly of section .text._ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h562590808242c9ccE: + +000000008000d47a <_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h562590808242c9ccE>: + fn next(&mut self) -> Option { + 8000d47a: 7179 addi sp,sp,-48 + 8000d47c: f406 sd ra,40(sp) + 8000d47e: f02a sd a0,32(sp) + next_code_point(&mut self.iter).map(|ch| { + 8000d480: ffff8097 auipc ra,0xffff8 + 8000d484: 12c080e7 jalr 300(ra) # 800055ac <_ZN4core3str11validations15next_code_point17h7999ea0e8f1f9704E> + 8000d488: e82a sd a0,16(sp) + 8000d48a: ec2e sd a1,24(sp) + 8000d48c: a009 j 8000d48e <_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h562590808242c9ccE+0x14> + 8000d48e: 65e2 ld a1,24(sp) + 8000d490: 6542 ld a0,16(sp) + 8000d492: 00002097 auipc ra,0x2 + 8000d496: 948080e7 jalr -1720(ra) # 8000edda <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E> + 8000d49a: 1502 slli a0,a0,0x20 + 8000d49c: 9101 srli a0,a0,0x20 + 8000d49e: e42a sd a0,8(sp) + 8000d4a0: a009 j 8000d4a2 <_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h562590808242c9ccE+0x28> + } + 8000d4a2: 6522 ld a0,8(sp) + 8000d4a4: 70a2 ld ra,40(sp) + 8000d4a6: 6145 addi sp,sp,48 + 8000d4a8: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E: + +000000008000d4aa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E>: + pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> { + 8000d4aa: 7179 addi sp,sp,-48 + 8000d4ac: f406 sd ra,40(sp) + 8000d4ae: e42a sd a0,8(sp) + 8000d4b0: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&mut *self) } } + 8000d4b2: 00000097 auipc ra,0x0 + 8000d4b6: 05c080e7 jalr 92(ra) # 8000d50e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc6fd4c72115f82d3E> + 8000d4ba: e82a sd a0,16(sp) + 8000d4bc: a009 j 8000d4be <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E+0x14> + 8000d4be: 6542 ld a0,16(sp) + 8000d4c0: 4581 li a1,0 + 8000d4c2: 00b50663 beq a0,a1,8000d4ce <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E+0x24> + 8000d4c6: a009 j 8000d4c8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E+0x1e> + 8000d4c8: 4501 li a0,0 + 8000d4ca: ec2a sd a0,24(sp) + 8000d4cc: a021 j 8000d4d4 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E+0x2a> + 8000d4ce: 6522 ld a0,8(sp) + 8000d4d0: ec2a sd a0,24(sp) + 8000d4d2: a009 j 8000d4d4 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E+0x2a> + } + 8000d4d4: 6562 ld a0,24(sp) + 8000d4d6: 70a2 ld ra,40(sp) + 8000d4d8: 6145 addi sp,sp,48 + 8000d4da: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE: + +000000008000d4dc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE>: + pub unsafe fn as_ref<'a>(self) -> Option<&'a T> { + 8000d4dc: 7179 addi sp,sp,-48 + 8000d4de: f406 sd ra,40(sp) + 8000d4e0: e42a sd a0,8(sp) + 8000d4e2: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&*self) } } + 8000d4e4: 00000097 auipc ra,0x0 + 8000d4e8: 02a080e7 jalr 42(ra) # 8000d50e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc6fd4c72115f82d3E> + 8000d4ec: e82a sd a0,16(sp) + 8000d4ee: a009 j 8000d4f0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE+0x14> + 8000d4f0: 6542 ld a0,16(sp) + 8000d4f2: 4581 li a1,0 + 8000d4f4: 00b50663 beq a0,a1,8000d500 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE+0x24> + 8000d4f8: a009 j 8000d4fa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE+0x1e> + 8000d4fa: 4501 li a0,0 + 8000d4fc: ec2a sd a0,24(sp) + 8000d4fe: a021 j 8000d506 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE+0x2a> + 8000d500: 6522 ld a0,8(sp) + 8000d502: ec2a sd a0,24(sp) + 8000d504: a009 j 8000d506 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_ref17h449f973acae747ffE+0x2a> + } + 8000d506: 6562 ld a0,24(sp) + 8000d508: 70a2 ld ra,40(sp) + 8000d50a: 6145 addi sp,sp,48 + 8000d50c: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc6fd4c72115f82d3E: + +000000008000d50e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc6fd4c72115f82d3E>: + pub const fn is_null(self) -> bool { + 8000d50e: 1101 addi sp,sp,-32 + 8000d510: ec06 sd ra,24(sp) + 8000d512: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 8000d514: e42a sd a0,8(sp) + 8000d516: a009 j 8000d518 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc6fd4c72115f82d3E+0xa> + 8000d518: 6522 ld a0,8(sp) + 8000d51a: 4581 li a1,0 + 8000d51c: 00016097 auipc ra,0x16 + 8000d520: 9ee080e7 jalr -1554(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 8000d524: e02a sd a0,0(sp) + 8000d526: a009 j 8000d528 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hc6fd4c72115f82d3E+0x1a> + } + 8000d528: 6502 ld a0,0(sp) + 8000d52a: 60e2 ld ra,24(sp) + 8000d52c: 6105 addi sp,sp,32 + 8000d52e: 8082 ret + +Disassembly of section .text._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h0a4be43e8f3bcf0dE: + +000000008000d530 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h0a4be43e8f3bcf0dE>: + fn fmt(&self, f: &mut Formatter<'_>) -> Result { $tr::fmt(&**self, f) } + 8000d530: 1101 addi sp,sp,-32 + 8000d532: ec06 sd ra,24(sp) + 8000d534: e42a sd a0,8(sp) + 8000d536: e82e sd a1,16(sp) + 8000d538: 6108 ld a0,0(a0) + 8000d53a: 00016097 auipc ra,0x16 + 8000d53e: b08080e7 jalr -1272(ra) # 80023042 <_ZN61_$LT$core..panic..PanicInfo$u20$as$u20$core..fmt..Display$GT$3fmt17h17913560c4fcc8feE> + 8000d542: e02a sd a0,0(sp) + 8000d544: a009 j 8000d546 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h0a4be43e8f3bcf0dE+0x16> + 8000d546: 6502 ld a0,0(sp) + 8000d548: 60e2 ld ra,24(sp) + 8000d54a: 6105 addi sp,sp,32 + 8000d54c: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register3mie4read17h69b673b504f0a30eE: + +000000008000d54e <_ZN6kernel4arch5riscv8register3mie4read17h69b673b504f0a30eE>: + MTIE = 1 << 7, // timer + MSIE = 1 << 3 // software +} + +#[inline] +pub unsafe fn read() -> usize { + 8000d54e: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, mie":"=r"(ret):::"volatile"); + 8000d550: 30402573 csrr a0,mie + 8000d554: e42a sd a0,8(sp) + ret +} + 8000d556: 0141 addi sp,sp,16 + 8000d558: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register3mie5write17hd754beffbe0101f6E: + +000000008000d55a <_ZN6kernel4arch5riscv8register3mie5write17hd754beffbe0101f6E>: + +#[inline] +pub unsafe fn write(x:usize){ + 8000d55a: 1141 addi sp,sp,-16 + 8000d55c: e42a sd a0,8(sp) + llvm_asm!("csrw mie, $0"::"r"(x)::"volatile"); + 8000d55e: 30451073 csrw mie,a0 + 8000d562: 0141 addi sp,sp,16 + 8000d564: 8082 ret + +Disassembly of section .text._ZN5alloc2rc11is_dangling17hdc2075289302a6eaE: + +000000008000d566 <_ZN5alloc2rc11is_dangling17hdc2075289302a6eaE>: + pub fn new() -> Weak { + Weak { ptr: NonNull::new(usize::MAX as *mut RcBox).expect("MAX is not 0") } + } +} + +pub(crate) fn is_dangling(ptr: *mut T) -> bool { + 8000d566: 1141 addi sp,sp,-16 + 8000d568: e02a sd a0,0(sp) + let address = ptr as *mut () as usize; + 8000d56a: e42a sd a0,8(sp) + address == usize::MAX + 8000d56c: 0505 addi a0,a0,1 + 8000d56e: 00153513 seqz a0,a0 +} + 8000d572: 0141 addi sp,sp,16 + 8000d574: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E: + +000000008000d576 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E>: + /// ``` + #[must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead"] + #[rustc_const_stable(feature = "const_result", since = "1.48.0")] + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + pub const fn is_ok(&self) -> bool { + 8000d576: 1141 addi sp,sp,-16 + 8000d578: e42a sd a0,8(sp) + matches!(*self, Ok(_)) + 8000d57a: 6108 ld a0,0(a0) + 8000d57c: 4581 li a1,0 + 8000d57e: 00b50763 beq a0,a1,8000d58c <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E+0x16> + 8000d582: a009 j 8000d584 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E+0xe> + 8000d584: 4501 li a0,0 + 8000d586: 00a103a3 sb a0,7(sp) + 8000d58a: a029 j 8000d594 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E+0x1e> + 8000d58c: 4505 li a0,1 + 8000d58e: 00a103a3 sb a0,7(sp) + 8000d592: a009 j 8000d594 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E+0x1e> + } + 8000d594: 00714503 lbu a0,7(sp) + 8000d598: 0141 addi sp,sp,16 + 8000d59a: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h2dc3ede719915417E: + +000000008000d59c <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h2dc3ede719915417E>: + pub const fn is_ok(&self) -> bool { + 8000d59c: 1141 addi sp,sp,-16 + 8000d59e: e42a sd a0,8(sp) + matches!(*self, Ok(_)) + 8000d5a0: 00054503 lbu a0,0(a0) + 8000d5a4: 8905 andi a0,a0,1 + 8000d5a6: 4581 li a1,0 + 8000d5a8: 00b50763 beq a0,a1,8000d5b6 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h2dc3ede719915417E+0x1a> + 8000d5ac: a009 j 8000d5ae <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h2dc3ede719915417E+0x12> + 8000d5ae: 4501 li a0,0 + 8000d5b0: 00a103a3 sb a0,7(sp) + 8000d5b4: a029 j 8000d5be <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h2dc3ede719915417E+0x22> + 8000d5b6: 4505 li a0,1 + 8000d5b8: 00a103a3 sb a0,7(sp) + 8000d5bc: a009 j 8000d5be <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h2dc3ede719915417E+0x22> + } + 8000d5be: 00714503 lbu a0,7(sp) + 8000d5c2: 0141 addi sp,sp,16 + 8000d5c4: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E: + +000000008000d5c6 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E>: + pub const fn is_ok(&self) -> bool { + 8000d5c6: 1141 addi sp,sp,-16 + 8000d5c8: e42a sd a0,8(sp) + matches!(*self, Ok(_)) + 8000d5ca: 6108 ld a0,0(a0) + 8000d5cc: 4581 li a1,0 + 8000d5ce: 00b50763 beq a0,a1,8000d5dc <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E+0x16> + 8000d5d2: a009 j 8000d5d4 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E+0xe> + 8000d5d4: 4501 li a0,0 + 8000d5d6: 00a103a3 sb a0,7(sp) + 8000d5da: a029 j 8000d5e4 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E+0x1e> + 8000d5dc: 4505 li a0,1 + 8000d5de: 00a103a3 sb a0,7(sp) + 8000d5e2: a009 j 8000d5e4 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E+0x1e> + } + 8000d5e4: 00714503 lbu a0,7(sp) + 8000d5e8: 0141 addi sp,sp,16 + 8000d5ea: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6expect17h7db20d4970bed50aE: + +000000008000d5ec <_ZN4core6result19Result$LT$T$C$E$GT$6expect17h7db20d4970bed50aE>: + /// x.expect("Testing expect"); // panics with `Testing expect: emergency failure` + /// ``` + #[inline] + #[track_caller] + #[stable(feature = "result_expect", since = "1.4.0")] + pub fn expect(self, msg: &str) -> T { + 8000d5ec: 715d addi sp,sp,-80 + 8000d5ee: e03a sd a4,0(sp) + 8000d5f0: e436 sd a3,8(sp) + 8000d5f2: e832 sd a2,16(sp) + 8000d5f4: ec2a sd a0,24(sp) + 8000d5f6: f02e sd a1,32(sp) + 8000d5f8: e0b2 sd a2,64(sp) + 8000d5fa: e4b6 sd a3,72(sp) + match self { + Ok(t) => t, + 8000d5fc: 00a035b3 snez a1,a0 + 8000d600: 4581 li a1,0 + 8000d602: 02b50563 beq a0,a1,8000d62c <.LBB3_5+0x16> + 8000d606: a009 j 8000d608 <_ZN4core6result19Result$LT$T$C$E$GT$6expect17h7db20d4970bed50aE+0x1c> + Err(e) => unwrap_failed(msg, &e), + 8000d608: 6702 ld a4,0(sp) + 8000d60a: 65a2 ld a1,8(sp) + 8000d60c: 6542 ld a0,16(sp) + 8000d60e: 66e2 ld a3,24(sp) + 8000d610: 7602 ld a2,32(sp) + 8000d612: f436 sd a3,40(sp) + 8000d614: f832 sd a2,48(sp) + +000000008000d616 <.LBB3_5>: + 8000d616: 0001c697 auipc a3,0x1c + 8000d61a: b9268693 addi a3,a3,-1134 # 800291a8 <.L__unnamed_1> + 8000d61e: 1030 addi a2,sp,40 + 8000d620: 00016097 auipc ra,0x16 + 8000d624: ca4080e7 jalr -860(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d628: 0000 unimp + match self { + 8000d62a: 0000 unimp + } + } + 8000d62c: 6161 addi sp,sp,80 + 8000d62e: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6expect17he26db02725b9ae65E: + +000000008000d630 <_ZN4core6result19Result$LT$T$C$E$GT$6expect17he26db02725b9ae65E>: + pub fn expect(self, msg: &str) -> T { + 8000d630: 715d addi sp,sp,-80 + 8000d632: e436 sd a3,8(sp) + 8000d634: e832 sd a2,16(sp) + 8000d636: ec2e sd a1,24(sp) + 8000d638: f02a sd a0,32(sp) + 8000d63a: fc2e sd a1,56(sp) + 8000d63c: e0b2 sd a2,64(sp) + Ok(t) => t, + 8000d63e: 6108 ld a0,0(a0) + 8000d640: 4581 li a1,0 + 8000d642: 02b50663 beq a0,a1,8000d66e <.LBB4_5+0x16> + 8000d646: a009 j 8000d648 <_ZN4core6result19Result$LT$T$C$E$GT$6expect17he26db02725b9ae65E+0x18> + Err(e) => unwrap_failed(msg, &e), + 8000d648: 6722 ld a4,8(sp) + 8000d64a: 65c2 ld a1,16(sp) + 8000d64c: 6562 ld a0,24(sp) + 8000d64e: 7602 ld a2,32(sp) + 8000d650: 6614 ld a3,8(a2) + 8000d652: 6a10 ld a2,16(a2) + 8000d654: f436 sd a3,40(sp) + 8000d656: f832 sd a2,48(sp) + +000000008000d658 <.LBB4_5>: + 8000d658: 0001c697 auipc a3,0x1c + 8000d65c: b5068693 addi a3,a3,-1200 # 800291a8 <.L__unnamed_1> + 8000d660: 1030 addi a2,sp,40 + 8000d662: 00016097 auipc ra,0x16 + 8000d666: c62080e7 jalr -926(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d66a: 0000 unimp + match self { + 8000d66c: 0000 unimp + Ok(t) => t, + 8000d66e: 7502 ld a0,32(sp) + 8000d670: 6508 ld a0,8(a0) + 8000d672: e4aa sd a0,72(sp) + } + 8000d674: 6161 addi sp,sp,80 + 8000d676: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E: + +000000008000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E>: + pub const fn is_err(&self) -> bool { + 8000d678: 1101 addi sp,sp,-32 + 8000d67a: ec06 sd ra,24(sp) + 8000d67c: e82a sd a0,16(sp) + !self.is_ok() + 8000d67e: 00000097 auipc ra,0x0 + 8000d682: f48080e7 jalr -184(ra) # 8000d5c6 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E> + 8000d686: e42a sd a0,8(sp) + 8000d688: a009 j 8000d68a <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E+0x12> + 8000d68a: 6522 ld a0,8(sp) + 8000d68c: 00154513 xori a0,a0,1 + } + 8000d690: 60e2 ld ra,24(sp) + 8000d692: 6105 addi sp,sp,32 + 8000d694: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6is_err17he593c7735b347060E: + +000000008000d696 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17he593c7735b347060E>: + pub const fn is_err(&self) -> bool { + 8000d696: 1101 addi sp,sp,-32 + 8000d698: ec06 sd ra,24(sp) + 8000d69a: e82a sd a0,16(sp) + !self.is_ok() + 8000d69c: 00000097 auipc ra,0x0 + 8000d6a0: eda080e7 jalr -294(ra) # 8000d576 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h0d49413fcec9dcc1E> + 8000d6a4: e42a sd a0,8(sp) + 8000d6a6: a009 j 8000d6a8 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17he593c7735b347060E+0x12> + 8000d6a8: 6522 ld a0,8(sp) + 8000d6aa: 00154513 xori a0,a0,1 + } + 8000d6ae: 60e2 ld ra,24(sp) + 8000d6b0: 6105 addi sp,sp,32 + 8000d6b2: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h01f79eb8d5b769f4E: + +000000008000d6b4 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h01f79eb8d5b769f4E>: + /// x.unwrap(); // panics with `emergency failure` + /// ``` + #[inline] + #[track_caller] + #[stable(feature = "rust1", since = "1.0.0")] + pub fn unwrap(self) -> T { + 8000d6b4: 7179 addi sp,sp,-48 + 8000d6b6: e032 sd a2,0(sp) + 8000d6b8: e42a sd a0,8(sp) + 8000d6ba: e82e sd a1,16(sp) + match self { + Ok(t) => t, + 8000d6bc: 0015b513 seqz a0,a1 + 8000d6c0: 4501 li a0,0 + 8000d6c2: 02a59563 bne a1,a0,8000d6ec <.LBB7_6+0x1a> + 8000d6c6: a009 j 8000d6c8 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h01f79eb8d5b769f4E+0x14> + Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), + 8000d6c8: 6702 ld a4,0(sp) + +000000008000d6ca <.LBB7_5>: + 8000d6ca: 0001c517 auipc a0,0x1c + 8000d6ce: afe50513 addi a0,a0,-1282 # 800291c8 <.L__unnamed_7> + +000000008000d6d2 <.LBB7_6>: + 8000d6d2: 0001c697 auipc a3,0x1c + 8000d6d6: b2668693 addi a3,a3,-1242 # 800291f8 <.L__unnamed_2> + 8000d6da: 02b00593 li a1,43 + 8000d6de: 0830 addi a2,sp,24 + 8000d6e0: 00016097 auipc ra,0x16 + 8000d6e4: be4080e7 jalr -1052(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d6e8: 0000 unimp + match self { + 8000d6ea: 0000 unimp + Ok(t) => t, + 8000d6ec: 6522 ld a0,8(sp) + 8000d6ee: 65c2 ld a1,16(sp) + 8000d6f0: f02a sd a0,32(sp) + 8000d6f2: f42e sd a1,40(sp) + } + } + 8000d6f4: 6145 addi sp,sp,48 + 8000d6f6: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h07a2a3bbe53a0b92E: + +000000008000d6f8 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h07a2a3bbe53a0b92E>: + pub fn unwrap(self) -> T { + 8000d6f8: 1101 addi sp,sp,-32 + 8000d6fa: e432 sd a2,8(sp) + 8000d6fc: c82a sw a0,16(sp) + 8000d6fe: ca2e sw a1,20(sp) + Ok(t) => t, + 8000d700: 1502 slli a0,a0,0x20 + 8000d702: 9101 srli a0,a0,0x20 + 8000d704: 4581 li a1,0 + 8000d706: 02b50563 beq a0,a1,8000d730 <.LBB8_6+0x1a> + 8000d70a: a009 j 8000d70c <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h07a2a3bbe53a0b92E+0x14> + Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), + 8000d70c: 6722 ld a4,8(sp) + +000000008000d70e <.LBB8_5>: + 8000d70e: 0001c517 auipc a0,0x1c + 8000d712: aba50513 addi a0,a0,-1350 # 800291c8 <.L__unnamed_7> + +000000008000d716 <.LBB8_6>: + 8000d716: 0001c697 auipc a3,0x1c + 8000d71a: b0268693 addi a3,a3,-1278 # 80029218 <.L__unnamed_3> + 8000d71e: 02b00593 li a1,43 + 8000d722: 0830 addi a2,sp,24 + 8000d724: 00016097 auipc ra,0x16 + 8000d728: ba0080e7 jalr -1120(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d72c: 0000 unimp + match self { + 8000d72e: 0000 unimp + Ok(t) => t, + 8000d730: 4552 lw a0,20(sp) + 8000d732: ce2a sw a0,28(sp) + } + 8000d734: 6105 addi sp,sp,32 + 8000d736: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h0d39573adfd86ec0E: + +000000008000d738 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h0d39573adfd86ec0E>: + pub fn unwrap(self) -> T { + 8000d738: 1101 addi sp,sp,-32 + 8000d73a: e02e sd a1,0(sp) + 8000d73c: 00a107a3 sb a0,15(sp) + 8000d740: 4581 li a1,0 + Ok(t) => t, + 8000d742: 02b50563 beq a0,a1,8000d76c <.LBB9_6+0x1a> + 8000d746: a009 j 8000d748 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h0d39573adfd86ec0E+0x10> + Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), + 8000d748: 6702 ld a4,0(sp) + +000000008000d74a <.LBB9_5>: + 8000d74a: 0001c517 auipc a0,0x1c + 8000d74e: a7e50513 addi a0,a0,-1410 # 800291c8 <.L__unnamed_7> + +000000008000d752 <.LBB9_6>: + 8000d752: 0001c697 auipc a3,0x1c + 8000d756: ae668693 addi a3,a3,-1306 # 80029238 <.L__unnamed_4> + 8000d75a: 02b00593 li a1,43 + 8000d75e: 0810 addi a2,sp,16 + 8000d760: 00016097 auipc ra,0x16 + 8000d764: b64080e7 jalr -1180(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d768: 0000 unimp + match self { + 8000d76a: 0000 unimp + } + 8000d76c: 6105 addi sp,sp,32 + 8000d76e: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h42e1173662da7b7dE: + +000000008000d770 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h42e1173662da7b7dE>: + pub fn unwrap(self) -> T { + 8000d770: 1101 addi sp,sp,-32 + 8000d772: e432 sd a2,8(sp) + 8000d774: 00a11823 sh a0,16(sp) + 8000d778: 00b11923 sh a1,18(sp) + 8000d77c: 65c1 lui a1,0x10 + 8000d77e: 35fd addiw a1,a1,-1 + Ok(t) => t, + 8000d780: 8d6d and a0,a0,a1 + 8000d782: 4581 li a1,0 + 8000d784: 02b50563 beq a0,a1,8000d7ae <.LBB10_6+0x1a> + 8000d788: a009 j 8000d78a <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h42e1173662da7b7dE+0x1a> + Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), + 8000d78a: 6722 ld a4,8(sp) + +000000008000d78c <.LBB10_5>: + 8000d78c: 0001c517 auipc a0,0x1c + 8000d790: a3c50513 addi a0,a0,-1476 # 800291c8 <.L__unnamed_7> + +000000008000d794 <.LBB10_6>: + 8000d794: 0001c697 auipc a3,0x1c + 8000d798: a8468693 addi a3,a3,-1404 # 80029218 <.L__unnamed_3> + 8000d79c: 02b00593 li a1,43 + 8000d7a0: 0830 addi a2,sp,24 + 8000d7a2: 00016097 auipc ra,0x16 + 8000d7a6: b22080e7 jalr -1246(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d7aa: 0000 unimp + match self { + 8000d7ac: 0000 unimp + Ok(t) => t, + 8000d7ae: 01211503 lh a0,18(sp) + 8000d7b2: 00a11f23 sh a0,30(sp) + } + 8000d7b6: 6105 addi sp,sp,32 + 8000d7b8: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h6115c21749654733E: + +000000008000d7ba <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h6115c21749654733E>: + pub fn unwrap(self) -> T { + 8000d7ba: 7179 addi sp,sp,-48 + 8000d7bc: e42e sd a1,8(sp) + 8000d7be: e82a sd a0,16(sp) + Ok(t) => t, + 8000d7c0: 6108 ld a0,0(a0) + 8000d7c2: 4581 li a1,0 + 8000d7c4: 02b50a63 beq a0,a1,8000d7f8 <.LBB11_6+0x1a> + 8000d7c8: a009 j 8000d7ca <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h6115c21749654733E+0x10> + Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), + 8000d7ca: 6722 ld a4,8(sp) + 8000d7cc: 6542 ld a0,16(sp) + 8000d7ce: 650c ld a1,8(a0) + 8000d7d0: 6908 ld a0,16(a0) + 8000d7d2: ec2e sd a1,24(sp) + 8000d7d4: f02a sd a0,32(sp) + +000000008000d7d6 <.LBB11_5>: + 8000d7d6: 0001c517 auipc a0,0x1c + 8000d7da: 9f250513 addi a0,a0,-1550 # 800291c8 <.L__unnamed_7> + +000000008000d7de <.LBB11_6>: + 8000d7de: 0001c697 auipc a3,0x1c + 8000d7e2: 9ca68693 addi a3,a3,-1590 # 800291a8 <.L__unnamed_1> + 8000d7e6: 02b00593 li a1,43 + 8000d7ea: 0830 addi a2,sp,24 + 8000d7ec: 00016097 auipc ra,0x16 + 8000d7f0: ad8080e7 jalr -1320(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d7f4: 0000 unimp + match self { + 8000d7f6: 0000 unimp + Ok(t) => t, + 8000d7f8: 6542 ld a0,16(sp) + 8000d7fa: 6508 ld a0,8(a0) + 8000d7fc: f42a sd a0,40(sp) + } + 8000d7fe: 6145 addi sp,sp,48 + 8000d800: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6unwrap17he7e280ca90d46427E: + +000000008000d802 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17he7e280ca90d46427E>: + pub fn unwrap(self) -> T { + 8000d802: 7179 addi sp,sp,-48 + 8000d804: e02e sd a1,0(sp) + 8000d806: e42a sd a0,8(sp) + Ok(t) => t, + 8000d808: 6108 ld a0,0(a0) + 8000d80a: 4581 li a1,0 + 8000d80c: 02b50a63 beq a0,a1,8000d840 <.LBB12_6+0x1a> + 8000d810: a009 j 8000d812 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17he7e280ca90d46427E+0x10> + Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), + 8000d812: 6702 ld a4,0(sp) + 8000d814: 6522 ld a0,8(sp) + 8000d816: 690c ld a1,16(a0) + 8000d818: ec2e sd a1,24(sp) + 8000d81a: 6508 ld a0,8(a0) + 8000d81c: e82a sd a0,16(sp) + +000000008000d81e <.LBB12_5>: + 8000d81e: 0001c517 auipc a0,0x1c + 8000d822: 9aa50513 addi a0,a0,-1622 # 800291c8 <.L__unnamed_7> + +000000008000d826 <.LBB12_6>: + 8000d826: 0001c697 auipc a3,0x1c + 8000d82a: a3268693 addi a3,a3,-1486 # 80029258 <.L__unnamed_5> + 8000d82e: 02b00593 li a1,43 + 8000d832: 0810 addi a2,sp,16 + 8000d834: 00016097 auipc ra,0x16 + 8000d838: a90080e7 jalr -1392(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d83c: 0000 unimp + match self { + 8000d83e: 0000 unimp + Ok(t) => t, + 8000d840: 65a2 ld a1,8(sp) + 8000d842: 6588 ld a0,8(a1) + 8000d844: 698c ld a1,16(a1) + 8000d846: f02a sd a0,32(sp) + 8000d848: f42e sd a1,40(sp) + } + 8000d84a: 6145 addi sp,sp,48 + 8000d84c: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$6unwrap17hea14d8d7b2208f82E: + +000000008000d84e <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17hea14d8d7b2208f82E>: + pub fn unwrap(self) -> T { + 8000d84e: 1101 addi sp,sp,-32 + 8000d850: e02e sd a1,0(sp) + 8000d852: 00a107a3 sb a0,15(sp) + 8000d856: 4581 li a1,0 + Ok(t) => t, + 8000d858: 02b50563 beq a0,a1,8000d882 <.LBB13_6+0x1a> + 8000d85c: a009 j 8000d85e <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17hea14d8d7b2208f82E+0x10> + Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), + 8000d85e: 6702 ld a4,0(sp) + +000000008000d860 <.LBB13_5>: + 8000d860: 0001c517 auipc a0,0x1c + 8000d864: 96850513 addi a0,a0,-1688 # 800291c8 <.L__unnamed_7> + +000000008000d868 <.LBB13_6>: + 8000d868: 0001c697 auipc a3,0x1c + 8000d86c: a1068693 addi a3,a3,-1520 # 80029278 <.L__unnamed_6> + 8000d870: 02b00593 li a1,43 + 8000d874: 0810 addi a2,sp,16 + 8000d876: 00016097 auipc ra,0x16 + 8000d87a: a4e080e7 jalr -1458(ra) # 800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E> + 8000d87e: 0000 unimp + match self { + 8000d880: 0000 unimp + } + 8000d882: 6105 addi sp,sp,32 + 8000d884: 8082 ret + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E: + +000000008000d886 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E>: + pub fn map_err F>(self, op: O) -> Result { + 8000d886: 711d addi sp,sp,-96 + 8000d888: ec86 sd ra,88(sp) + 8000d88a: ec2a sd a0,24(sp) + 8000d88c: f02e sd a1,32(sp) + 8000d88e: f432 sd a2,40(sp) + 8000d890: 4505 li a0,1 + Ok(t) => Ok(t), + 8000d892: 02a10ba3 sb a0,55(sp) + 8000d896: 00163513 seqz a0,a2 + 8000d89a: 4501 li a0,0 + 8000d89c: 00a61e63 bne a2,a0,8000d8b8 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x32> + 8000d8a0: a009 j 8000d8a2 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x1c> + 8000d8a2: 4501 li a0,0 + Err(e) => Err(op(e)), + 8000d8a4: 02a10ba3 sb a0,55(sp) + 8000d8a8: ffff5097 auipc ra,0xffff5 + 8000d8ac: 04c080e7 jalr 76(ra) # 800028f4 <_ZN5alloc7raw_vec11finish_grow28_$u7b$$u7b$closure$u7d$$u7d$17h73415ce87cdd3564E> + 8000d8b0: e42a sd a0,8(sp) + 8000d8b2: e82e sd a1,16(sp) + 8000d8b4: a821 j 8000d8cc <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x46> + match self { + 8000d8b6: 0000 unimp + Ok(t) => Ok(t), + 8000d8b8: 65e2 ld a1,24(sp) + 8000d8ba: 7602 ld a2,32(sp) + 8000d8bc: 7522 ld a0,40(sp) + 8000d8be: e4b2 sd a2,72(sp) + 8000d8c0: e8aa sd a0,80(sp) + 8000d8c2: e590 sd a2,8(a1) + 8000d8c4: e988 sd a0,16(a1) + 8000d8c6: 4501 li a0,0 + 8000d8c8: e188 sd a0,0(a1) + match self { + 8000d8ca: a809 j 8000d8dc <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x56> + Err(e) => Err(op(e)), + 8000d8cc: 65e2 ld a1,24(sp) + 8000d8ce: 6542 ld a0,16(sp) + 8000d8d0: 6622 ld a2,8(sp) + 8000d8d2: e590 sd a2,8(a1) + 8000d8d4: e988 sd a0,16(a1) + 8000d8d6: 4505 li a0,1 + 8000d8d8: e188 sd a0,0(a1) + match self { + 8000d8da: a009 j 8000d8dc <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x56> + } + 8000d8dc: 03714503 lbu a0,55(sp) + 8000d8e0: 8905 andi a0,a0,1 + 8000d8e2: e509 bnez a0,8000d8ec <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x66> + 8000d8e4: a009 j 8000d8e6 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x60> + 8000d8e6: 60e6 ld ra,88(sp) + 8000d8e8: 6125 addi sp,sp,96 + 8000d8ea: 8082 ret + 8000d8ec: bfed j 8000d8e6 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h048c451de26fa4b9E+0x60> + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E: + +000000008000d8ee <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E>: + pub fn map_err F>(self, op: O) -> Result { + 8000d8ee: 711d addi sp,sp,-96 + 8000d8f0: ec86 sd ra,88(sp) + 8000d8f2: e836 sd a3,16(sp) + 8000d8f4: ec2a sd a0,24(sp) + 8000d8f6: f02e sd a1,32(sp) + 8000d8f8: f432 sd a2,40(sp) + 8000d8fa: fc36 sd a3,56(sp) + 8000d8fc: 4505 li a0,1 + Ok(t) => Ok(t), + 8000d8fe: 02a10ba3 sb a0,55(sp) + 8000d902: 0015b513 seqz a0,a1 + 8000d906: 4501 li a0,0 + 8000d908: 00a59f63 bne a1,a0,8000d926 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x38> + 8000d90c: a009 j 8000d90e <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x20> + 8000d90e: 6542 ld a0,16(sp) + 8000d910: 4581 li a1,0 + Err(e) => Err(op(e)), + 8000d912: 02b10ba3 sb a1,55(sp) + 8000d916: ffff5097 auipc ra,0xffff5 + 8000d91a: fcc080e7 jalr -52(ra) # 800028e2 <_ZN5alloc7raw_vec11finish_grow28_$u7b$$u7b$closure$u7d$$u7d$17h4102ec07be08fbafE> + 8000d91e: e02a sd a0,0(sp) + 8000d920: e42e sd a1,8(sp) + 8000d922: a821 j 8000d93a <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x4c> + match self { + 8000d924: 0000 unimp + Ok(t) => Ok(t), + 8000d926: 65e2 ld a1,24(sp) + 8000d928: 7602 ld a2,32(sp) + 8000d92a: 7522 ld a0,40(sp) + 8000d92c: e4b2 sd a2,72(sp) + 8000d92e: e8aa sd a0,80(sp) + 8000d930: e590 sd a2,8(a1) + 8000d932: e988 sd a0,16(a1) + 8000d934: 4501 li a0,0 + 8000d936: e188 sd a0,0(a1) + match self { + 8000d938: a809 j 8000d94a <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x5c> + Err(e) => Err(op(e)), + 8000d93a: 65e2 ld a1,24(sp) + 8000d93c: 6522 ld a0,8(sp) + 8000d93e: 6602 ld a2,0(sp) + 8000d940: e590 sd a2,8(a1) + 8000d942: e988 sd a0,16(a1) + 8000d944: 4505 li a0,1 + 8000d946: e188 sd a0,0(a1) + match self { + 8000d948: a009 j 8000d94a <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x5c> + } + 8000d94a: 03714503 lbu a0,55(sp) + 8000d94e: 8905 andi a0,a0,1 + 8000d950: e509 bnez a0,8000d95a <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x6c> + 8000d952: a009 j 8000d954 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x66> + 8000d954: 60e6 ld ra,88(sp) + 8000d956: 6125 addi sp,sp,96 + 8000d958: 8082 ret + 8000d95a: bfed j 8000d954 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17h3706629688909c32E+0x66> + +Disassembly of section .text._ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E: + +000000008000d95c <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E>: + pub fn map_err F>(self, op: O) -> Result { + 8000d95c: 711d addi sp,sp,-96 + 8000d95e: ec86 sd ra,88(sp) + 8000d960: e42a sd a0,8(sp) + 8000d962: 4585 li a1,1 + Ok(t) => Ok(t), + 8000d964: 02b10ba3 sb a1,55(sp) + 8000d968: 6108 ld a0,0(a0) + 8000d96a: 4581 li a1,0 + 8000d96c: 02b50363 beq a0,a1,8000d992 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x36> + 8000d970: a009 j 8000d972 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x16> + Err(e) => Err(op(e)), + 8000d972: 65a2 ld a1,8(sp) + 8000d974: 6588 ld a0,8(a1) + 8000d976: 698c ld a1,16(a1) + 8000d978: e0aa sd a0,64(sp) + 8000d97a: e4ae sd a1,72(sp) + 8000d97c: 4601 li a2,0 + 8000d97e: 02c10ba3 sb a2,55(sp) + 8000d982: f02a sd a0,32(sp) + 8000d984: f42e sd a1,40(sp) + 8000d986: ffff8097 auipc ra,0xffff8 + 8000d98a: ba8080e7 jalr -1112(ra) # 8000552e <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec28_$u7b$$u7b$closure$u7d$$u7d$17hac210036fe7eba45E> + 8000d98e: a809 j 8000d9a0 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x44> + match self { + 8000d990: 0000 unimp + Ok(t) => Ok(t), + 8000d992: 6522 ld a0,8(sp) + 8000d994: 6508 ld a0,8(a0) + 8000d996: e8aa sd a0,80(sp) + 8000d998: ec2a sd a0,24(sp) + 8000d99a: 4501 li a0,0 + 8000d99c: e82a sd a0,16(sp) + match self { + 8000d99e: a021 j 8000d9a6 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x4a> + 8000d9a0: 4505 li a0,1 + Err(e) => Err(op(e)), + 8000d9a2: e82a sd a0,16(sp) + match self { + 8000d9a4: a009 j 8000d9a6 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x4a> + } + 8000d9a6: 03714503 lbu a0,55(sp) + 8000d9aa: 8905 andi a0,a0,1 + 8000d9ac: e519 bnez a0,8000d9ba <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x5e> + 8000d9ae: a009 j 8000d9b0 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x54> + 8000d9b0: 6542 ld a0,16(sp) + 8000d9b2: 65e2 ld a1,24(sp) + 8000d9b4: 60e6 ld ra,88(sp) + 8000d9b6: 6125 addi sp,sp,96 + 8000d9b8: 8082 ret + 8000d9ba: bfdd j 8000d9b0 <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E+0x54> + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h2a54492b2826375dE: + +000000008000d9bc <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h2a54492b2826375dE>: + fn from_ok(v: T) -> Self { + Ok(v) + } + + #[inline] + fn from_error(v: E) -> Self { + 8000d9bc: 1141 addi sp,sp,-16 + 8000d9be: 4501 li a0,0 + Err(v) + 8000d9c0: e02a sd a0,0(sp) + } + 8000d9c2: 0141 addi sp,sp,16 + 8000d9c4: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E: + +000000008000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E>: + fn from_error(v: E) -> Self { + 8000d9c6: 1101 addi sp,sp,-32 + 8000d9c8: e42e sd a1,8(sp) + 8000d9ca: 85aa mv a1,a0 + 8000d9cc: 6522 ld a0,8(sp) + 8000d9ce: e82a sd a0,16(sp) + 8000d9d0: ec32 sd a2,24(sp) + Err(v) + 8000d9d2: e588 sd a0,8(a1) + 8000d9d4: e990 sd a2,16(a1) + 8000d9d6: 4505 li a0,1 + 8000d9d8: e188 sd a0,0(a1) + } + 8000d9da: 6105 addi sp,sp,32 + 8000d9dc: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h5591b1c718d6dce1E: + +000000008000d9de <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h5591b1c718d6dce1E>: + fn from_error(v: E) -> Self { + 8000d9de: 1101 addi sp,sp,-32 + 8000d9e0: 4581 li a1,0 + Err(v) + 8000d9e2: e82e sd a1,16(sp) + } + 8000d9e4: 6522 ld a0,8(sp) + 8000d9e6: 6105 addi sp,sp,32 + 8000d9e8: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h5998e5a20485011cE: + +000000008000d9ea <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h5998e5a20485011cE>: + fn from_error(v: E) -> Self { + 8000d9ea: 1101 addi sp,sp,-32 + 8000d9ec: e42e sd a1,8(sp) + 8000d9ee: 85aa mv a1,a0 + 8000d9f0: 6522 ld a0,8(sp) + 8000d9f2: e82a sd a0,16(sp) + 8000d9f4: ec32 sd a2,24(sp) + Err(v) + 8000d9f6: e588 sd a0,8(a1) + 8000d9f8: e990 sd a2,16(a1) + 8000d9fa: 4505 li a0,1 + 8000d9fc: e188 sd a0,0(a1) + } + 8000d9fe: 6105 addi sp,sp,32 + 8000da00: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E: + +000000008000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E>: + fn from_error(v: E) -> Self { + 8000da02: 1101 addi sp,sp,-32 + 8000da04: 4505 li a0,1 + Err(v) + 8000da06: e42a sd a0,8(sp) + } + 8000da08: 65c2 ld a1,16(sp) + 8000da0a: 6105 addi sp,sp,32 + 8000da0c: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h7458ba93a206fcffE: + +000000008000da0e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h7458ba93a206fcffE>: + fn from_error(v: E) -> Self { + 8000da0e: 1101 addi sp,sp,-32 + 8000da10: e42e sd a1,8(sp) + 8000da12: 85aa mv a1,a0 + 8000da14: 6522 ld a0,8(sp) + 8000da16: e82a sd a0,16(sp) + 8000da18: ec32 sd a2,24(sp) + Err(v) + 8000da1a: e588 sd a0,8(a1) + 8000da1c: e990 sd a2,16(a1) + 8000da1e: 4505 li a0,1 + 8000da20: e188 sd a0,0(a1) + } + 8000da22: 6105 addi sp,sp,32 + 8000da24: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h826a3a4a12863e91E: + +000000008000da26 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h826a3a4a12863e91E>: + fn from_error(v: E) -> Self { + 8000da26: 1141 addi sp,sp,-16 + 8000da28: 85aa mv a1,a0 + 8000da2a: 4501 li a0,0 + Err(v) + 8000da2c: e588 sd a0,8(a1) + } + 8000da2e: 0141 addi sp,sp,16 + 8000da30: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h849eab7baac337bbE: + +000000008000da32 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h849eab7baac337bbE>: + fn from_error(v: E) -> Self { + 8000da32: 1141 addi sp,sp,-16 + 8000da34: 4501 li a0,0 + Err(v) + 8000da36: e02a sd a0,0(sp) + } + 8000da38: 0141 addi sp,sp,16 + 8000da3a: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h9d11a50f8e490b2eE: + +000000008000da3c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h9d11a50f8e490b2eE>: + fn from_error(v: E) -> Self { + 8000da3c: 1101 addi sp,sp,-32 + 8000da3e: e82a sd a0,16(sp) + 8000da40: ec2e sd a1,24(sp) + Err(v) + 8000da42: e02a sd a0,0(sp) + 8000da44: e42e sd a1,8(sp) + } + 8000da46: 6105 addi sp,sp,32 + 8000da48: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17ha082cd91ce3eeff8E: + +000000008000da4a <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17ha082cd91ce3eeff8E>: + fn from_error(v: E) -> Self { + 8000da4a: 1101 addi sp,sp,-32 + 8000da4c: 4501 li a0,0 + Err(v) + 8000da4e: e42a sd a0,8(sp) + } + 8000da50: 65c2 ld a1,16(sp) + 8000da52: 6105 addi sp,sp,32 + 8000da54: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17haeaec5be2c31cee9E: + +000000008000da56 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17haeaec5be2c31cee9E>: + fn from_error(v: E) -> Self { + 8000da56: 1101 addi sp,sp,-32 + 8000da58: e42e sd a1,8(sp) + 8000da5a: 85aa mv a1,a0 + 8000da5c: 6522 ld a0,8(sp) + 8000da5e: e82a sd a0,16(sp) + 8000da60: ec32 sd a2,24(sp) + Err(v) + 8000da62: e588 sd a0,8(a1) + 8000da64: e990 sd a2,16(a1) + 8000da66: 4505 li a0,1 + 8000da68: e188 sd a0,0(a1) + } + 8000da6a: 6105 addi sp,sp,32 + 8000da6c: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hc42702708db6cea4E: + +000000008000da6e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hc42702708db6cea4E>: + fn from_error(v: E) -> Self { + 8000da6e: 1141 addi sp,sp,-16 + 8000da70: 4501 li a0,0 + Err(v) + 8000da72: e02a sd a0,0(sp) + } + 8000da74: 0141 addi sp,sp,16 + 8000da76: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hc5c17464a72e6965E: + +000000008000da78 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hc5c17464a72e6965E>: + fn from_error(v: E) -> Self { + 8000da78: 1141 addi sp,sp,-16 + 8000da7a: 4501 li a0,0 + Err(v) + 8000da7c: e02a sd a0,0(sp) + } + 8000da7e: 0141 addi sp,sp,16 + 8000da80: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hfad957fd5ededc3fE: + +000000008000da82 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hfad957fd5ededc3fE>: + fn from_error(v: E) -> Self { + 8000da82: 1141 addi sp,sp,-16 + 8000da84: 4501 li a0,0 + Err(v) + 8000da86: e02a sd a0,0(sp) + } + 8000da88: 0141 addi sp,sp,16 + 8000da8a: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h01dd6c02021cf1cdE: + +000000008000da8c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h01dd6c02021cf1cdE>: + fn into_result(self) -> Self { + 8000da8c: 1141 addi sp,sp,-16 + 8000da8e: e42a sd a0,8(sp) + } + 8000da90: 0141 addi sp,sp,16 + 8000da92: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E: + +000000008000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E>: + fn into_result(self) -> Self { + 8000da94: 1141 addi sp,sp,-16 + 8000da96: e42e sd a1,8(sp) + 8000da98: 85aa mv a1,a0 + self + 8000da9a: 6522 ld a0,8(sp) + 8000da9c: 6910 ld a2,16(a0) + 8000da9e: e990 sd a2,16(a1) + 8000daa0: 6510 ld a2,8(a0) + 8000daa2: e590 sd a2,8(a1) + 8000daa4: 6108 ld a0,0(a0) + 8000daa6: e188 sd a0,0(a1) + } + 8000daa8: 0141 addi sp,sp,16 + 8000daaa: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E: + +000000008000daac <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E>: + fn into_result(self) -> Self { + 8000daac: 1141 addi sp,sp,-16 + 8000daae: e02a sd a0,0(sp) + 8000dab0: e42e sd a1,8(sp) + } + 8000dab2: 0141 addi sp,sp,16 + 8000dab4: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h219e266dbc1ee71cE: + +000000008000dab6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h219e266dbc1ee71cE>: + fn into_result(self) -> Self { + 8000dab6: 1141 addi sp,sp,-16 + 8000dab8: e42e sd a1,8(sp) + 8000daba: 85aa mv a1,a0 + self + 8000dabc: 6522 ld a0,8(sp) + 8000dabe: 6910 ld a2,16(a0) + 8000dac0: e990 sd a2,16(a1) + 8000dac2: 6510 ld a2,8(a0) + 8000dac4: e590 sd a2,8(a1) + 8000dac6: 6108 ld a0,0(a0) + 8000dac8: e188 sd a0,0(a1) + } + 8000daca: 0141 addi sp,sp,16 + 8000dacc: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h2625785248aabe7bE: + +000000008000dace <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h2625785248aabe7bE>: + fn into_result(self) -> Self { + 8000dace: 1141 addi sp,sp,-16 + 8000dad0: e42e sd a1,8(sp) + 8000dad2: 85aa mv a1,a0 + self + 8000dad4: 6522 ld a0,8(sp) + 8000dad6: 6910 ld a2,16(a0) + 8000dad8: e990 sd a2,16(a1) + 8000dada: 6510 ld a2,8(a0) + 8000dadc: e590 sd a2,8(a1) + 8000dade: 6108 ld a0,0(a0) + 8000dae0: e188 sd a0,0(a1) + } + 8000dae2: 0141 addi sp,sp,16 + 8000dae4: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h3002ccf5391f70d3E: + +000000008000dae6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h3002ccf5391f70d3E>: + fn into_result(self) -> Self { + 8000dae6: 1141 addi sp,sp,-16 + 8000dae8: e42e sd a1,8(sp) + 8000daea: 85aa mv a1,a0 + self + 8000daec: 6522 ld a0,8(sp) + 8000daee: 6910 ld a2,16(a0) + 8000daf0: e990 sd a2,16(a1) + 8000daf2: 6510 ld a2,8(a0) + 8000daf4: e590 sd a2,8(a1) + 8000daf6: 6108 ld a0,0(a0) + 8000daf8: e188 sd a0,0(a1) + } + 8000dafa: 0141 addi sp,sp,16 + 8000dafc: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h7e17d789c0860991E: + +000000008000dafe <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h7e17d789c0860991E>: + fn into_result(self) -> Self { + 8000dafe: 1141 addi sp,sp,-16 + 8000db00: e42e sd a1,8(sp) + 8000db02: 85aa mv a1,a0 + self + 8000db04: 6522 ld a0,8(sp) + 8000db06: 6910 ld a2,16(a0) + 8000db08: e990 sd a2,16(a1) + 8000db0a: 6510 ld a2,8(a0) + 8000db0c: e590 sd a2,8(a1) + 8000db0e: 6108 ld a0,0(a0) + 8000db10: e188 sd a0,0(a1) + } + 8000db12: 0141 addi sp,sp,16 + 8000db14: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h81067e0558a14198E: + +000000008000db16 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h81067e0558a14198E>: + fn into_result(self) -> Self { + 8000db16: 1141 addi sp,sp,-16 + 8000db18: e42e sd a1,8(sp) + 8000db1a: 85aa mv a1,a0 + self + 8000db1c: 6522 ld a0,8(sp) + 8000db1e: 6910 ld a2,16(a0) + 8000db20: e990 sd a2,16(a1) + 8000db22: 6510 ld a2,8(a0) + 8000db24: e590 sd a2,8(a1) + 8000db26: 6108 ld a0,0(a0) + 8000db28: e188 sd a0,0(a1) + } + 8000db2a: 0141 addi sp,sp,16 + 8000db2c: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E: + +000000008000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E>: + fn into_result(self) -> Self { + 8000db2e: 1141 addi sp,sp,-16 + 8000db30: 00a107a3 sb a0,15(sp) + } + 8000db34: 0141 addi sp,sp,16 + 8000db36: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb12176fc822fec8fE: + +000000008000db38 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb12176fc822fec8fE>: + fn into_result(self) -> Self { + 8000db38: 1141 addi sp,sp,-16 + 8000db3a: e02a sd a0,0(sp) + 8000db3c: e42e sd a1,8(sp) + } + 8000db3e: 0141 addi sp,sp,16 + 8000db40: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb8d2d18a4141e592E: + +000000008000db42 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb8d2d18a4141e592E>: + fn into_result(self) -> Self { + 8000db42: 1141 addi sp,sp,-16 + 8000db44: e02a sd a0,0(sp) + 8000db46: e42e sd a1,8(sp) + } + 8000db48: 0141 addi sp,sp,16 + 8000db4a: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hba461275fa0bc2dbE: + +000000008000db4c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hba461275fa0bc2dbE>: + fn into_result(self) -> Self { + 8000db4c: 1141 addi sp,sp,-16 + 8000db4e: e42a sd a0,8(sp) + } + 8000db50: 0141 addi sp,sp,16 + 8000db52: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hd9845beb6e8da5c7E: + +000000008000db54 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hd9845beb6e8da5c7E>: + fn into_result(self) -> Self { + 8000db54: 1141 addi sp,sp,-16 + 8000db56: e02a sd a0,0(sp) + 8000db58: e42e sd a1,8(sp) + } + 8000db5a: 0141 addi sp,sp,16 + 8000db5c: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hda96dc8b8fa1398aE: + +000000008000db5e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hda96dc8b8fa1398aE>: + fn into_result(self) -> Self { + 8000db5e: 1141 addi sp,sp,-16 + 8000db60: e42e sd a1,8(sp) + 8000db62: 85aa mv a1,a0 + self + 8000db64: 6522 ld a0,8(sp) + 8000db66: 6910 ld a2,16(a0) + 8000db68: e990 sd a2,16(a1) + 8000db6a: 6510 ld a2,8(a0) + 8000db6c: e590 sd a2,8(a1) + 8000db6e: 6108 ld a0,0(a0) + 8000db70: e188 sd a0,0(a1) + } + 8000db72: 0141 addi sp,sp,16 + 8000db74: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17heda032b26dd469a1E: + +000000008000db76 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17heda032b26dd469a1E>: + fn into_result(self) -> Self { + 8000db76: 1141 addi sp,sp,-16 + 8000db78: e42e sd a1,8(sp) + 8000db7a: 85aa mv a1,a0 + self + 8000db7c: 6522 ld a0,8(sp) + 8000db7e: 6910 ld a2,16(a0) + 8000db80: e990 sd a2,16(a1) + 8000db82: 6510 ld a2,8(a0) + 8000db84: e590 sd a2,8(a1) + 8000db86: 6108 ld a0,0(a0) + 8000db88: e188 sd a0,0(a1) + } + 8000db8a: 0141 addi sp,sp,16 + 8000db8c: 8082 ret + +Disassembly of section .text._ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hf2a730b9c7ab248fE: + +000000008000db8e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hf2a730b9c7ab248fE>: + fn into_result(self) -> Self { + 8000db8e: 1141 addi sp,sp,-16 + 8000db90: e42e sd a1,8(sp) + 8000db92: 85aa mv a1,a0 + self + 8000db94: 6522 ld a0,8(sp) + 8000db96: 6910 ld a2,16(a0) + 8000db98: e990 sd a2,16(a1) + 8000db9a: 6510 ld a2,8(a0) + 8000db9c: e590 sd a2,8(a1) + 8000db9e: 6108 ld a0,0(a0) + 8000dba0: e188 sd a0,0(a1) + } + 8000dba2: 0141 addi sp,sp,16 + 8000dba4: 8082 ret + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager9alloc_pid17hc71dad597dc5708aE: + +000000008000dba6 <_ZN6kernel7process7manager11ProcManager9alloc_pid17hc71dad597dc5708aE>: + + // pub fn get_table_mut(&mut self) -> &mut [task_struct; NTASK] { + // &mut self.tasks + // } + + pub fn alloc_pid() -> usize { + 8000dba6: 1101 addi sp,sp,-32 + +000000008000dba8 <.LBB0_3>: + // let curtask = unsafe { + // CPU_MANAGER.myproc().expect("Current cpu's process is none.") + // }; + unsafe { + let ret = nextpid; + 8000dba8: 00059517 auipc a0,0x59 + 8000dbac: 9e050513 addi a0,a0,-1568 # 80066588 <_ZN6kernel7process7manager7nextpid17h9a7cdc0385d7d3caE> + 8000dbb0: 610c ld a1,0(a0) + 8000dbb2: e42e sd a1,8(sp) + 8000dbb4: ec2e sd a1,24(sp) + + nextpid += 1; + 8000dbb6: 00158513 addi a0,a1,1 # 10001 <.Lline_table_start0+0x19e> + 8000dbba: e82a sd a0,16(sp) + 8000dbbc: 00b56c63 bltu a0,a1,8000dbd4 <.LBB0_5> + 8000dbc0: a009 j 8000dbc2 <.LBB0_3+0x1a> + 8000dbc2: 6522 ld a0,8(sp) + 8000dbc4: 65c2 ld a1,16(sp) + +000000008000dbc6 <.LBB0_4>: + 8000dbc6: 00059617 auipc a2,0x59 + 8000dbca: 9c260613 addi a2,a2,-1598 # 80066588 <_ZN6kernel7process7manager7nextpid17h9a7cdc0385d7d3caE> + 8000dbce: e20c sd a1,0(a2) + ret + } + } + 8000dbd0: 6105 addi sp,sp,32 + 8000dbd2: 8082 ret + +000000008000dbd4 <.LBB0_5>: + nextpid += 1; + 8000dbd4: 0001b517 auipc a0,0x1b + 8000dbd8: 70c50513 addi a0,a0,1804 # 800292e0 + +000000008000dbdc <.LBB0_6>: + 8000dbdc: 0001b617 auipc a2,0x1b + 8000dbe0: 6ec60613 addi a2,a2,1772 # 800292c8 <.L__unnamed_1> + 8000dbe4: 45f1 li a1,28 + 8000dbe6: 00015097 auipc ra,0x15 + 8000dbea: 55e080e7 jalr 1374(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager4init17h6f55d4e0f14b932aE: + +000000008000dbf0 <_ZN6kernel7process7manager11ProcManager4init17h6f55d4e0f14b932aE>: + + /// initialize the proc table at boot time. + /// Only used in boot. + pub unsafe fn init(&mut self){ + 8000dbf0: 7151 addi sp,sp,-240 + 8000dbf2: f586 sd ra,232(sp) + 8000dbf4: f02a sd a0,32(sp) + 8000dbf6: f92a sd a0,176(sp) + +000000008000dbf8 <.LBB1_14>: + println!("process init......"); + 8000dbf8: 0001b597 auipc a1,0x1b + 8000dbfc: 71858593 addi a1,a1,1816 # 80029310 <.L__unnamed_2> + +000000008000dc00 <.LBB1_15>: + 8000dc00: 0001b697 auipc a3,0x1b + 8000dc04: 72068693 addi a3,a3,1824 # 80029320 <.L__unnamed_42> + 8000dc08: 1028 addi a0,sp,40 + 8000dc0a: 4605 li a2,1 + 8000dc0c: 4701 li a4,0 + 8000dc0e: ffff8097 auipc ra,0xffff8 + 8000dc12: 97c080e7 jalr -1668(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000dc16: a009 j 8000dc18 <.LBB1_15+0x18> + 8000dc18: 1028 addi a0,sp,40 + 8000dc1a: 00011097 auipc ra,0x11 + 8000dc1e: fde080e7 jalr -34(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000dc22: a009 j 8000dc24 <.LBB1_15+0x24> + for (pos, proc) in self.tasks.iter_mut().enumerate() { + 8000dc24: 7502 ld a0,32(sp) + 8000dc26: 45a1 li a1,8 + 8000dc28: 00004097 auipc ra,0x4 + 8000dc2c: 4ec080e7 jalr 1260(ra) # 80012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E> + 8000dc30: e82a sd a0,16(sp) + 8000dc32: ec2e sd a1,24(sp) + 8000dc34: a009 j 8000dc36 <.LBB1_15+0x36> + 8000dc36: 6662 ld a2,24(sp) + 8000dc38: 65c2 ld a1,16(sp) + 8000dc3a: 1888 addi a0,sp,112 + 8000dc3c: ffffd097 auipc ra,0xffffd + 8000dc40: 7d8080e7 jalr 2008(ra) # 8000b414 <_ZN4core4iter6traits8iterator8Iterator9enumerate17hc3c1c2808e21f1bfE> + 8000dc44: a009 j 8000dc46 <.LBB1_15+0x46> + 8000dc46: 08a8 addi a0,sp,88 + 8000dc48: 188c addi a1,sp,112 + 8000dc4a: 00005097 auipc ra,0x5 + 8000dc4e: f38080e7 jalr -200(ra) # 80012b82 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h04cf438071e1a0e6E> + 8000dc52: a009 j 8000dc54 <.LBB1_15+0x54> + 8000dc54: 7526 ld a0,104(sp) + 8000dc56: ed2a sd a0,152(sp) + 8000dc58: 7506 ld a0,96(sp) + 8000dc5a: e92a sd a0,144(sp) + 8000dc5c: 6566 ld a0,88(sp) + 8000dc5e: e52a sd a0,136(sp) + 8000dc60: a009 j 8000dc62 <.LBB1_15+0x62> + 8000dc62: 0128 addi a0,sp,136 + 8000dc64: 00005097 auipc ra,0x5 + 8000dc68: e1c080e7 jalr -484(ra) # 80012a80 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E> + 8000dc6c: f12a sd a0,160(sp) + 8000dc6e: f52e sd a1,168(sp) + 8000dc70: a009 j 8000dc72 <.LBB1_15+0x72> + 8000dc72: 752a ld a0,168(sp) + 8000dc74: 00a035b3 snez a1,a0 + 8000dc78: 4581 li a1,0 + 8000dc7a: 00b50463 beq a0,a1,8000dc82 <.LBB1_15+0x82> + 8000dc7e: a009 j 8000dc80 <.LBB1_15+0x80> + 8000dc80: a029 j 8000dc8a <.LBB1_15+0x8a> + proc.init(kernel_stack(pos)); + } + } + 8000dc82: 70ae ld ra,232(sp) + 8000dc84: 616d addi sp,sp,240 + 8000dc86: 8082 ret + for (pos, proc) in self.tasks.iter_mut().enumerate() { + 8000dc88: 0000 unimp + 8000dc8a: 750a ld a0,160(sp) + 8000dc8c: 75aa ld a1,168(sp) + 8000dc8e: e02e sd a1,0(sp) + 8000dc90: fd2a sd a0,184(sp) + 8000dc92: e1ae sd a1,192(sp) + 8000dc94: e5aa sd a0,200(sp) + 8000dc96: e9ae sd a1,208(sp) + 8000dc98: edaa sd a0,216(sp) + 8000dc9a: f1ae sd a1,224(sp) + proc.init(kernel_stack(pos)); + 8000dc9c: 00001097 auipc ra,0x1 + 8000dca0: 014080e7 jalr 20(ra) # 8000ecb0 <_ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E> + 8000dca4: e42a sd a0,8(sp) + 8000dca6: a009 j 8000dca8 <.LBB1_15+0xa8> + 8000dca8: 65a2 ld a1,8(sp) + 8000dcaa: 6502 ld a0,0(sp) + 8000dcac: 00009097 auipc ra,0x9 + 8000dcb0: dd0080e7 jalr -560(ra) # 80016a7c <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E> + 8000dcb4: a009 j 8000dcb6 <.LBB1_15+0xb6> + for (pos, proc) in self.tasks.iter_mut().enumerate() { + 8000dcb6: b775 j 8000dc62 <.LBB1_15+0x62> + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E: + +000000008000dcb8 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E>: + + /// Allocate 4 page for each process's kernel stack. + /// Map it high in memory, followed by an invalid + /// group page + pub unsafe fn proc_mapstacks(&mut self) { + 8000dcb8: 7115 addi sp,sp,-224 + 8000dcba: ed86 sd ra,216(sp) + 8000dcbc: ed2a sd a0,152(sp) + 8000dcbe: 45a1 li a1,8 + for (pos, _) in self.tasks.iter_mut().enumerate() { + 8000dcc0: 00004097 auipc ra,0x4 + 8000dcc4: 454080e7 jalr 1108(ra) # 80012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E> + 8000dcc8: f82a sd a0,48(sp) + 8000dcca: fc2e sd a1,56(sp) + 8000dccc: a009 j 8000dcce <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x16> + 8000dcce: 7662 ld a2,56(sp) + 8000dcd0: 75c2 ld a1,48(sp) + 8000dcd2: 08a8 addi a0,sp,88 + 8000dcd4: ffffd097 auipc ra,0xffffd + 8000dcd8: 740080e7 jalr 1856(ra) # 8000b414 <_ZN4core4iter6traits8iterator8Iterator9enumerate17hc3c1c2808e21f1bfE> + 8000dcdc: a009 j 8000dcde <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x26> + 8000dcde: 0088 addi a0,sp,64 + 8000dce0: 08ac addi a1,sp,88 + 8000dce2: 00005097 auipc ra,0x5 + 8000dce6: ea0080e7 jalr -352(ra) # 80012b82 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h04cf438071e1a0e6E> + 8000dcea: a009 j 8000dcec <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x34> + 8000dcec: 6546 ld a0,80(sp) + 8000dcee: e12a sd a0,128(sp) + 8000dcf0: 6526 ld a0,72(sp) + 8000dcf2: fcaa sd a0,120(sp) + 8000dcf4: 6506 ld a0,64(sp) + 8000dcf6: f8aa sd a0,112(sp) + 8000dcf8: a009 j 8000dcfa <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x42> + 8000dcfa: 1888 addi a0,sp,112 + 8000dcfc: 00005097 auipc ra,0x5 + 8000dd00: d84080e7 jalr -636(ra) # 80012a80 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E> + 8000dd04: e52a sd a0,136(sp) + 8000dd06: e92e sd a1,144(sp) + 8000dd08: a009 j 8000dd0a <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x52> + 8000dd0a: 654a ld a0,144(sp) + 8000dd0c: 00a035b3 snez a1,a0 + 8000dd10: 4581 li a1,0 + 8000dd12: 00b50463 beq a0,a1,8000dd1a <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x62> + 8000dd16: a009 j 8000dd18 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x60> + 8000dd18: a029 j 8000dd22 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x6a> + PGSIZE * 4, + PteFlags::R | PteFlags::W + ); + + } + } + 8000dd1a: 60ee ld ra,216(sp) + 8000dd1c: 612d addi sp,sp,224 + 8000dd1e: 8082 ret + for (pos, _) in self.tasks.iter_mut().enumerate() { + 8000dd20: 0000 unimp + 8000dd22: 652a ld a0,136(sp) + 8000dd24: f02a sd a0,32(sp) + 8000dd26: 65ca ld a1,144(sp) + 8000dd28: f12a sd a0,160(sp) + 8000dd2a: f52e sd a1,168(sp) + 8000dd2c: f92a sd a0,176(sp) + 8000dd2e: fd2e sd a1,184(sp) + 8000dd30: e1aa sd a0,192(sp) + let pa = Stack::new_zeroed(); + 8000dd32: ffffd097 auipc ra,0xffffd + 8000dd36: a20080e7 jalr -1504(ra) # 8000a752 <_ZN6kernel6memory13PageAllocator10new_zeroed17h849e935775a724f6E> + 8000dd3a: 85aa mv a1,a0 + 8000dd3c: f42e sd a1,40(sp) + 8000dd3e: e5aa sd a0,200(sp) + 8000dd40: a009 j 8000dd42 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x8a> + let va = kernel_stack(pos); + 8000dd42: 7502 ld a0,32(sp) + 8000dd44: 00001097 auipc ra,0x1 + 8000dd48: f6c080e7 jalr -148(ra) # 8000ecb0 <_ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E> + 8000dd4c: 85aa mv a1,a0 + 8000dd4e: ec2e sd a1,24(sp) + 8000dd50: e9aa sd a0,208(sp) + 8000dd52: a009 j 8000dd54 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x9c> + VirtualAddress::new(va), + 8000dd54: 6562 ld a0,24(sp) + 8000dd56: 00004097 auipc ra,0x4 + 8000dd5a: 1f0080e7 jalr 496(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8000dd5e: e82a sd a0,16(sp) + 8000dd60: a009 j 8000dd62 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0xaa> + PhysicalAddress::new(pa), + 8000dd62: 7522 ld a0,40(sp) + 8000dd64: 00004097 auipc ra,0x4 + 8000dd68: 292080e7 jalr 658(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 8000dd6c: e42a sd a0,8(sp) + 8000dd6e: a009 j 8000dd70 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0xb8> + 8000dd70: 4509 li a0,2 + 8000dd72: 4591 li a1,4 + PteFlags::R | PteFlags::W + 8000dd74: ffffb097 auipc ra,0xffffb + 8000dd78: 304080e7 jalr 772(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8000dd7c: e02a sd a0,0(sp) + 8000dd7e: a009 j 8000dd80 <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0xc8> + KERNEL_PAGETABLE.kernel_map( + 8000dd80: 6702 ld a4,0(sp) + 8000dd82: 6622 ld a2,8(sp) + 8000dd84: 65c2 ld a1,16(sp) + +000000008000dd86 <.LBB2_16>: + 8000dd86: 00057517 auipc a0,0x57 + 8000dd8a: 27a50513 addi a0,a0,634 # 80065000 <_ZN6kernel6memory7mapping10kernel_map16KERNEL_PAGETABLE17h338fe72968ecefecE> + 8000dd8e: 6691 lui a3,0x4 + 8000dd90: 0000a097 auipc ra,0xa + 8000dd94: 448080e7 jalr 1096(ra) # 800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E> + 8000dd98: a009 j 8000dd9a <.LBB2_16+0x14> + for (pos, _) in self.tasks.iter_mut().enumerate() { + 8000dd9a: b785 j 8000dcfa <_ZN6kernel7process7manager11ProcManager14proc_mapstacks17he92f2c2a936a1699E+0x42> + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager9user_init17h45a7031cbcd11d0fE: + +000000008000dd9c <_ZN6kernel7process7manager11ProcManager9user_init17h45a7031cbcd11d0fE>: + + /// Set up first user programe + pub unsafe fn user_init(&mut self) { + 8000dd9c: 7151 addi sp,sp,-240 + 8000dd9e: f586 sd ra,232(sp) + 8000dda0: f42a sd a0,40(sp) + 8000dda2: f92a sd a0,176(sp) + +000000008000dda4 <.LBB3_15>: + println!("first user process init......"); + 8000dda4: 0001b597 auipc a1,0x1b + 8000dda8: 59c58593 addi a1,a1,1436 # 80029340 <.L__unnamed_4> + +000000008000ddac <.LBB3_16>: + 8000ddac: 0001b697 auipc a3,0x1b + 8000ddb0: 57468693 addi a3,a3,1396 # 80029320 <.L__unnamed_42> + 8000ddb4: 1808 addi a0,sp,48 + 8000ddb6: 4605 li a2,1 + 8000ddb8: 4701 li a4,0 + 8000ddba: ffff7097 auipc ra,0xffff7 + 8000ddbe: 7d0080e7 jalr 2000(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000ddc2: a009 j 8000ddc4 <.LBB3_16+0x18> + 8000ddc4: 1808 addi a0,sp,48 + 8000ddc6: 00011097 auipc ra,0x11 + 8000ddca: e32080e7 jalr -462(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000ddce: a009 j 8000ddd0 <.LBB3_16+0x24> + let task = ProcManager::alloc_proc().expect("Fail to get unused process"); + 8000ddd0: 00000097 auipc ra,0x0 + 8000ddd4: 15a080e7 jalr 346(ra) # 8000df2a <_ZN6kernel7process7manager11ProcManager10alloc_proc17h1cffa348e6417c04E> + 8000ddd8: f02a sd a0,32(sp) + 8000ddda: a009 j 8000dddc <.LBB3_16+0x30> + 8000dddc: 7502 ld a0,32(sp) + +000000008000ddde <.LBB3_17>: + 8000ddde: 0001b597 auipc a1,0x1b + 8000dde2: 57258593 addi a1,a1,1394 # 80029350 <.L__unnamed_5> + +000000008000dde6 <.LBB3_18>: + 8000dde6: 0001b697 auipc a3,0x1b + 8000ddea: 58a68693 addi a3,a3,1418 # 80029370 <.L__unnamed_6> + 8000ddee: 4669 li a2,26 + 8000ddf0: 00001097 auipc ra,0x1 + 8000ddf4: 60a080e7 jalr 1546(ra) # 8000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE> + 8000ddf8: 85aa mv a1,a0 + 8000ddfa: ec2e sd a1,24(sp) + 8000ddfc: fd2a sd a0,184(sp) + 8000ddfe: a009 j 8000de00 <.LBB3_18+0x1a> + + // allocate one user page and copy init's instructions + // and data into it. + task.pagetable.as_mut().unwrap().uvm_init( + 8000de00: 6562 ld a0,24(sp) + 8000de02: 6d08 ld a0,24(a0) + 8000de04: fffff097 auipc ra,0xfffff + 8000de08: 6a6080e7 jalr 1702(ra) # 8000d4aa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E> + 8000de0c: e82a sd a0,16(sp) + 8000de0e: a009 j 8000de10 <.LBB3_18+0x2a> + 8000de10: 6542 ld a0,16(sp) + +000000008000de12 <.LBB3_19>: + 8000de12: 0001b597 auipc a1,0x1b + 8000de16: 57658593 addi a1,a1,1398 # 80029388 <.L__unnamed_7> + 8000de1a: 00001097 auipc ra,0x1 + 8000de1e: 6ee080e7 jalr 1774(ra) # 8000f508 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E> + 8000de22: e42a sd a0,8(sp) + 8000de24: a009 j 8000de26 <.LBB3_19+0x14> + 8000de26: 6522 ld a0,8(sp) + +000000008000de28 <.LBB3_20>: + 8000de28: 0001f597 auipc a1,0x1f + 8000de2c: b7058593 addi a1,a1,-1168 # 8002c998 <_ZN6kernel7process8INITCODE17hdd0694ed5e43946eE> + 8000de30: 03300613 li a2,51 + 8000de34: 0000a097 auipc ra,0xa + 8000de38: 422080e7 jalr 1058(ra) # 80018256 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_init17h1e8988bec17c91edE> + 8000de3c: a009 j 8000de3e <.LBB3_20+0x16> + 8000de3e: 6562 ld a0,24(sp) + 8000de40: 6585 lui a1,0x1 + &INITCODE, + ); + + task.size = PGSIZE; + 8000de42: e90c sd a1,16(a0) + + // prepare for the very first "return" from kernel to user. + let tf = &mut *task.trapframe; + 8000de44: 7110 ld a2,32(a0) + 8000de46: e1b2 sd a2,192(sp) + 8000de48: 4581 li a1,0 + tf.epc = 0; // user program counter + 8000de4a: ee0c sd a1,24(a2) + +000000008000de4c <.LBB3_21>: + tf.sp = 4 * PGSIZE; // user stack pointer + 8000de4c: 00019597 auipc a1,0x19 + 8000de50: 80458593 addi a1,a1,-2044 # 80026650 <.L__unnamed_35+0x18> + 8000de54: 618c ld a1,0(a1) + 8000de56: fa0c sd a1,48(a2) + +000000008000de58 <.LBB3_22>: + + let init_name = b"initname\0"; + 8000de58: 0001b597 auipc a1,0x1b + 8000de5c: 54858593 addi a1,a1,1352 # 800293a0 <.L__unnamed_9> + 8000de60: e5ae sd a1,200(sp) + 8000de62: 4625 li a2,9 + task.set_name(init_name); + 8000de64: 00009097 auipc ra,0x9 + 8000de68: a3a080e7 jalr -1478(ra) # 8001689e <_ZN6kernel7process7process11task_struct8set_name17h9731c8514bd185a5E> + 8000de6c: a009 j 8000de6e <.LBB3_23> + +000000008000de6e <.LBB3_23>: + // Set init process's directory + task.cwd = Some(ICACHE.namei(&ROOTIPATH).expect("cannot find root inode")); + 8000de6e: 0004d597 auipc a1,0x4d + 8000de72: 71258593 addi a1,a1,1810 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + +000000008000de76 <.LBB3_24>: + 8000de76: 0001b617 auipc a2,0x1b + 8000de7a: 53360613 addi a2,a2,1331 # 800293a9 <.L__unnamed_10> + 8000de7e: 0128 addi a0,sp,136 + 8000de80: 4689 li a3,2 + 8000de82: 0000c097 auipc ra,0xc + 8000de86: 3a6080e7 jalr 934(ra) # 8001a228 <_ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E> + 8000de8a: a009 j 8000de8c <.LBB3_25> + +000000008000de8c <.LBB3_25>: + 8000de8c: 0001b597 auipc a1,0x1b + 8000de90: 51f58593 addi a1,a1,1311 # 800293ab <.L__unnamed_11> + +000000008000de94 <.LBB3_26>: + 8000de94: 0001b697 auipc a3,0x1b + 8000de98: 53468693 addi a3,a3,1332 # 800293c8 <.L__unnamed_12> + 8000de9c: 0128 addi a0,sp,136 + 8000de9e: 4659 li a2,22 + 8000dea0: 00001097 auipc ra,0x1 + 8000dea4: 62e080e7 jalr 1582(ra) # 8000f4ce <_ZN4core6option15Option$LT$T$GT$6expect17h91dc8b235b72ffe4E> + 8000dea8: e9aa sd a0,208(sp) + 8000deaa: edae sd a1,216(sp) + 8000deac: fcaa sd a0,120(sp) + 8000deae: e12e sd a1,128(sp) + 8000deb0: a009 j 8000deb2 <.LBB3_26+0x1e> + 8000deb2: 6562 ld a0,24(sp) + 8000deb4: 658a ld a1,128(sp) + 8000deb6: f8ae sd a1,112(sp) + 8000deb8: 75e6 ld a1,120(sp) + 8000deba: f4ae sd a1,104(sp) + 8000debc: 4585 li a1,1 + 8000debe: f0ae sd a1,96(sp) + 8000dec0: 3c850513 addi a0,a0,968 + 8000dec4: ffff9097 auipc ra,0xffff9 + 8000dec8: 26c080e7 jalr 620(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8000decc: a815 j 8000df00 <.LBB3_26+0x6c> + 8000dece: 6562 ld a0,24(sp) + 8000ded0: 458d li a1,3 + + let guard = self.tasks_lock.acquire(); + task.set_state(ProcState::RUNNABLE); + 8000ded2: 0ab107a3 sb a1,175(sp) + 8000ded6: 00009097 auipc ra,0x9 + 8000deda: ee4080e7 jalr -284(ra) # 80016dba <_ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E> + 8000dede: a009 j 8000dee0 <.LBB3_26+0x4c> + drop(guard); + 8000dee0: 750a ld a0,160(sp) + 8000dee2: 00010097 auipc ra,0x10 + 8000dee6: f06080e7 jalr -250(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000deea: a009 j 8000deec <.LBB3_26+0x58> + 8000deec: 6562 ld a0,24(sp) + 8000deee: 75a2 ld a1,40(sp) + 8000def0: 6609 lui a2,0x2 + 8000def2: 0c06061b addiw a2,a2,192 + + // Set init process + self.init_proc = task as *mut task_struct; + 8000def6: 95b2 add a1,a1,a2 + 8000def8: e188 sd a0,0(a1) + } + 8000defa: 70ae ld ra,232(sp) + 8000defc: 616d addi sp,sp,240 + 8000defe: 8082 ret + task.cwd = Some(ICACHE.namei(&ROOTIPATH).expect("cannot find root inode")); + 8000df00: 7522 ld a0,40(sp) + 8000df02: 6662 ld a2,24(sp) + 8000df04: 75c6 ld a1,112(sp) + 8000df06: 3cb63c23 sd a1,984(a2) # 23d8 <.Lline_table_start0+0x3d> + 8000df0a: 75a6 ld a1,104(sp) + 8000df0c: 3cb63823 sd a1,976(a2) + 8000df10: 7586 ld a1,96(sp) + 8000df12: 3cb63423 sd a1,968(a2) + 8000df16: 6589 lui a1,0x2 + 8000df18: 0c85859b addiw a1,a1,200 + let guard = self.tasks_lock.acquire(); + 8000df1c: 952e add a0,a0,a1 + 8000df1e: 00003097 auipc ra,0x3 + 8000df22: 124080e7 jalr 292(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000df26: f12a sd a0,160(sp) + 8000df28: b75d j 8000dece <.LBB3_26+0x3a> + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager10alloc_proc17h1cffa348e6417c04E: + +000000008000df2a <_ZN6kernel7process7manager11ProcManager10alloc_proc17h1cffa348e6417c04E>: + /// If found, initialize state required to run in the kernel, + /// and return p.acquire() held. + /// If there are a free procs, or a memory allocation fails, return 0. + + /// WARNING: possible error occurs here. + pub fn alloc_proc() -> Option<&'static mut task_struct> { + 8000df2a: 7135 addi sp,sp,-160 + 8000df2c: ed06 sd ra,152(sp) + 8000df2e: 6509 lui a0,0x2 + 8000df30: 0c85059b addiw a1,a0,200 + +000000008000df34 <.LBB4_21>: + 8000df34: 0004b517 auipc a0,0x4b + 8000df38: 49c50513 addi a0,a0,1180 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000df3c: 952e add a0,a0,a1 + + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 8000df3e: 00003097 auipc ra,0x3 + 8000df42: 104080e7 jalr 260(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000df46: 85aa mv a1,a0 + 8000df48: e0ae sd a1,64(sp) + 8000df4a: f8aa sd a0,112(sp) + 8000df4c: a009 j 8000df4e <.LBB4_22> + +000000008000df4e <.LBB4_22>: + + // let alloc_pid = self.alloc_pid(); + + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000df4e: 0004b517 auipc a0,0x4b + 8000df52: 48250513 addi a0,a0,1154 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000df56: 45a1 li a1,8 + 8000df58: 00004097 auipc ra,0x4 + 8000df5c: 1bc080e7 jalr 444(ra) # 80012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E> + 8000df60: f82a sd a0,48(sp) + 8000df62: fc2e sd a1,56(sp) + 8000df64: a009 j 8000df66 <.LBB4_22+0x18> + 8000df66: 75e2 ld a1,56(sp) + 8000df68: 7542 ld a0,48(sp) + 8000df6a: ffffe097 auipc ra,0xffffe + 8000df6e: 974080e7 jalr -1676(ra) # 8000b8de <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hca1289a056d9e0bbE> + 8000df72: f02a sd a0,32(sp) + 8000df74: f42e sd a1,40(sp) + 8000df76: a009 j 8000df78 <.LBB4_22+0x2a> + 8000df78: 7522 ld a0,40(sp) + 8000df7a: 7582 ld a1,32(sp) + 8000df7c: e8ae sd a1,80(sp) + 8000df7e: ecaa sd a0,88(sp) + 8000df80: a009 j 8000df82 <.LBB4_22+0x34> + 8000df82: 0888 addi a0,sp,80 + 8000df84: ffffe097 auipc ra,0xffffe + 8000df88: cf2080e7 jalr -782(ra) # 8000bc76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E> + 8000df8c: f0aa sd a0,96(sp) + 8000df8e: a009 j 8000df90 <.LBB4_22+0x42> + 8000df90: 7506 ld a0,96(sp) + 8000df92: 00a035b3 snez a1,a0 + 8000df96: 4581 li a1,0 + 8000df98: 00b50463 beq a0,a1,8000dfa0 <.LBB4_22+0x52> + 8000df9c: a009 j 8000df9e <.LBB4_22+0x50> + 8000df9e: a801 j 8000dfae <.LBB4_22+0x60> + return Some(task) + } + _ => {} + } + } + drop(guard); + 8000dfa0: 6506 ld a0,64(sp) + 8000dfa2: 00010097 auipc ra,0x10 + 8000dfa6: e46080e7 jalr -442(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000dfaa: a849 j 8000e03c <.LBB4_22+0xee> + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000dfac: 0000 unimp + 8000dfae: 7506 ld a0,96(sp) + 8000dfb0: ec2a sd a0,24(sp) + 8000dfb2: fcaa sd a0,120(sp) + 8000dfb4: e12a sd a0,128(sp) + 8000dfb6: e52a sd a0,136(sp) + ProcState::UNUSED => { + 8000dfb8: 41054503 lbu a0,1040(a0) + 8000dfbc: 4581 li a1,0 + 8000dfbe: 00b50463 beq a0,a1,8000dfc6 <.LBB4_22+0x78> + 8000dfc2: a009 j 8000dfc4 <.LBB4_22+0x76> + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000dfc4: bf7d j 8000df82 <.LBB4_22+0x34> + task.pid = ProcManager::alloc_pid(); + 8000dfc6: 00000097 auipc ra,0x0 + 8000dfca: be0080e7 jalr -1056(ra) # 8000dba6 <_ZN6kernel7process7manager11ProcManager9alloc_pid17hc71dad597dc5708aE> + 8000dfce: e82a sd a0,16(sp) + 8000dfd0: a009 j 8000dfd2 <.LBB4_22+0x84> + 8000dfd2: 6562 ld a0,24(sp) + 8000dfd4: 65c2 ld a1,16(sp) + 8000dfd6: 3eb53823 sd a1,1008(a0) + 8000dfda: 4599 li a1,6 + task.set_state(ProcState::ALLOCATED); + 8000dfdc: 06b107a3 sb a1,111(sp) + 8000dfe0: 00009097 auipc ra,0x9 + 8000dfe4: dda080e7 jalr -550(ra) # 80016dba <_ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E> + 8000dfe8: a009 j 8000dfea <.LBB4_22+0x9c> + drop(guard); + 8000dfea: 6506 ld a0,64(sp) + 8000dfec: 00010097 auipc ra,0x10 + 8000dff0: dfc080e7 jalr -516(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000dff4: a009 j 8000dff6 <.LBB4_22+0xa8> + let trapframe = unsafe{ RawPage::new_zeroed() as *mut u8 }; + 8000dff6: ffffc097 auipc ra,0xffffc + 8000dffa: 796080e7 jalr 1942(ra) # 8000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E> + 8000dffe: e42a sd a0,8(sp) + 8000e000: a009 j 8000e002 <.LBB4_22+0xb4> + 8000e002: 65a2 ld a1,8(sp) + 8000e004: 6562 ld a0,24(sp) + 8000e006: e92e sd a1,144(sp) + task.set_trapframe(trapframe as *mut Trapframe); + 8000e008: 00009097 auipc ra,0x9 + 8000e00c: 90e080e7 jalr -1778(ra) # 80016916 <_ZN6kernel7process7process11task_struct13set_trapframe17h3ad216f12fff42cbE> + 8000e010: a009 j 8000e012 <.LBB4_22+0xc4> + task.pagetable = task.proc_pagetable(); + 8000e012: 6562 ld a0,24(sp) + 8000e014: 00009097 auipc ra,0x9 + 8000e018: e0c080e7 jalr -500(ra) # 80016e20 <_ZN6kernel7process7process11task_struct14proc_pagetable17h83123d92b87bdd8cE> + 8000e01c: e02a sd a0,0(sp) + 8000e01e: a009 j 8000e020 <.LBB4_22+0xd2> + 8000e020: 6562 ld a0,24(sp) + 8000e022: 6582 ld a1,0(sp) + 8000e024: ed0c sd a1,24(a0) + task.init_context(); + 8000e026: 00009097 auipc ra,0x9 + 8000e02a: 908080e7 jalr -1784(ra) # 8001692e <_ZN6kernel7process7process11task_struct12init_context17h19c1fbb71ecd5bedE> + 8000e02e: a009 j 8000e030 <.LBB4_22+0xe2> + 8000e030: 6562 ld a0,24(sp) + 8000e032: 4581 li a1,0 + task.thread = 0; + 8000e034: 3eb53c23 sd a1,1016(a0) + return Some(task) + 8000e038: e4aa sd a0,72(sp) + None + } + 8000e03a: a021 j 8000e042 <.LBB4_22+0xf4> + 8000e03c: 4501 li a0,0 + None + 8000e03e: e4aa sd a0,72(sp) + } + 8000e040: a009 j 8000e042 <.LBB4_22+0xf4> + 8000e042: 6526 ld a0,72(sp) + 8000e044: 60ea ld ra,152(sp) + 8000e046: 610d addi sp,sp,160 + 8000e048: 8082 ret + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager12alloc_thread17h8a0457fc1a013afeE: + +000000008000e04a <_ZN6kernel7process7manager11ProcManager12alloc_thread17h8a0457fc1a013afeE>: + + pub fn alloc_thread() -> Option<&'static mut task_struct> { + 8000e04a: 7175 addi sp,sp,-144 + 8000e04c: e506 sd ra,136(sp) + 8000e04e: 6509 lui a0,0x2 + 8000e050: 0c85059b addiw a1,a0,200 + +000000008000e054 <.LBB5_18>: + 8000e054: 0004b517 auipc a0,0x4b + 8000e058: 37c50513 addi a0,a0,892 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000e05c: 952e add a0,a0,a1 + + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 8000e05e: 00003097 auipc ra,0x3 + 8000e062: fe4080e7 jalr -28(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000e066: 85aa mv a1,a0 + 8000e068: fc2e sd a1,56(sp) + 8000e06a: f4aa sd a0,104(sp) + 8000e06c: a009 j 8000e06e <.LBB5_19> + +000000008000e06e <.LBB5_19>: + + // let alloc_pid = self.alloc_pid(); + + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000e06e: 0004b517 auipc a0,0x4b + 8000e072: 36250513 addi a0,a0,866 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000e076: 45a1 li a1,8 + 8000e078: 00004097 auipc ra,0x4 + 8000e07c: 09c080e7 jalr 156(ra) # 80012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E> + 8000e080: f42a sd a0,40(sp) + 8000e082: f82e sd a1,48(sp) + 8000e084: a009 j 8000e086 <.LBB5_19+0x18> + 8000e086: 75c2 ld a1,48(sp) + 8000e088: 7522 ld a0,40(sp) + 8000e08a: ffffe097 auipc ra,0xffffe + 8000e08e: 854080e7 jalr -1964(ra) # 8000b8de <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hca1289a056d9e0bbE> + 8000e092: ec2a sd a0,24(sp) + 8000e094: f02e sd a1,32(sp) + 8000e096: a009 j 8000e098 <.LBB5_19+0x2a> + 8000e098: 7502 ld a0,32(sp) + 8000e09a: 65e2 ld a1,24(sp) + 8000e09c: e4ae sd a1,72(sp) + 8000e09e: e8aa sd a0,80(sp) + 8000e0a0: a009 j 8000e0a2 <.LBB5_19+0x34> + 8000e0a2: 00a8 addi a0,sp,72 + 8000e0a4: ffffe097 auipc ra,0xffffe + 8000e0a8: bd2080e7 jalr -1070(ra) # 8000bc76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E> + 8000e0ac: ecaa sd a0,88(sp) + 8000e0ae: a009 j 8000e0b0 <.LBB5_19+0x42> + 8000e0b0: 6566 ld a0,88(sp) + 8000e0b2: 00a035b3 snez a1,a0 + 8000e0b6: 4581 li a1,0 + 8000e0b8: 00b50463 beq a0,a1,8000e0c0 <.LBB5_19+0x52> + 8000e0bc: a009 j 8000e0be <.LBB5_19+0x50> + 8000e0be: a801 j 8000e0ce <.LBB5_19+0x60> + return Some(task) + } + _ => {} + } + } + drop(guard); + 8000e0c0: 7562 ld a0,56(sp) + 8000e0c2: 00010097 auipc ra,0x10 + 8000e0c6: d26080e7 jalr -730(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000e0ca: a095 j 8000e12e <.LBB5_19+0xc0> + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000e0cc: 0000 unimp + 8000e0ce: 6566 ld a0,88(sp) + 8000e0d0: e82a sd a0,16(sp) + 8000e0d2: f8aa sd a0,112(sp) + 8000e0d4: fcaa sd a0,120(sp) + 8000e0d6: e12a sd a0,128(sp) + ProcState::UNUSED => { + 8000e0d8: 41054503 lbu a0,1040(a0) + 8000e0dc: 4581 li a1,0 + 8000e0de: 00b50463 beq a0,a1,8000e0e6 <.LBB5_19+0x78> + 8000e0e2: a009 j 8000e0e4 <.LBB5_19+0x76> + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000e0e4: bf7d j 8000e0a2 <.LBB5_19+0x34> + task.pid = ProcManager::alloc_pid(); + 8000e0e6: 00000097 auipc ra,0x0 + 8000e0ea: ac0080e7 jalr -1344(ra) # 8000dba6 <_ZN6kernel7process7manager11ProcManager9alloc_pid17hc71dad597dc5708aE> + 8000e0ee: e42a sd a0,8(sp) + 8000e0f0: a009 j 8000e0f2 <.LBB5_19+0x84> + 8000e0f2: 6542 ld a0,16(sp) + 8000e0f4: 65a2 ld a1,8(sp) + 8000e0f6: 3eb53823 sd a1,1008(a0) + 8000e0fa: 4599 li a1,6 + task.set_state(ProcState::ALLOCATED); + 8000e0fc: 06b103a3 sb a1,103(sp) + 8000e100: 00009097 auipc ra,0x9 + 8000e104: cba080e7 jalr -838(ra) # 80016dba <_ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E> + 8000e108: a009 j 8000e10a <.LBB5_19+0x9c> + drop(guard); + 8000e10a: 7562 ld a0,56(sp) + 8000e10c: 00010097 auipc ra,0x10 + 8000e110: cdc080e7 jalr -804(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000e114: a009 j 8000e116 <.LBB5_19+0xa8> + task.init_context(); + 8000e116: 6542 ld a0,16(sp) + 8000e118: 00009097 auipc ra,0x9 + 8000e11c: 816080e7 jalr -2026(ra) # 8001692e <_ZN6kernel7process7process11task_struct12init_context17h19c1fbb71ecd5bedE> + 8000e120: a009 j 8000e122 <.LBB5_19+0xb4> + 8000e122: 6542 ld a0,16(sp) + 8000e124: 4585 li a1,1 + task.thread = 1; + 8000e126: 3eb53c23 sd a1,1016(a0) + return Some(task) + 8000e12a: e0aa sd a0,64(sp) + None + } + 8000e12c: a021 j 8000e134 <.LBB5_19+0xc6> + 8000e12e: 4501 li a0,0 + None + 8000e130: e0aa sd a0,64(sp) + } + 8000e132: a009 j 8000e134 <.LBB5_19+0xc6> + 8000e134: 6506 ld a0,64(sp) + 8000e136: 60aa ld ra,136(sp) + 8000e138: 6149 addi sp,sp,144 + 8000e13a: 8082 ret + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager7wakeup117hddcdae2e398d5cf3E: + +000000008000e13c <_ZN6kernel7process7manager11ProcManager7wakeup117hddcdae2e398d5cf3E>: + + + pub fn wakeup1(channel: usize){ + 8000e13c: 7119 addi sp,sp,-128 + 8000e13e: fc86 sd ra,120(sp) + 8000e140: f02a sd a0,32(sp) + 8000e142: ecaa sd a0,88(sp) + +000000008000e144 <.LBB6_17>: + for task in unsafe { PROC_MANAGER.tasks.iter_mut() }{ + 8000e144: 0004b517 auipc a0,0x4b + 8000e148: 28c50513 addi a0,a0,652 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000e14c: 45a1 li a1,8 + 8000e14e: 00004097 auipc ra,0x4 + 8000e152: fc6080e7 jalr -58(ra) # 80012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E> + 8000e156: f42a sd a0,40(sp) + 8000e158: f82e sd a1,48(sp) + 8000e15a: a009 j 8000e15c <.LBB6_17+0x18> + 8000e15c: 75c2 ld a1,48(sp) + 8000e15e: 7522 ld a0,40(sp) + 8000e160: ffffd097 auipc ra,0xffffd + 8000e164: 77e080e7 jalr 1918(ra) # 8000b8de <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hca1289a056d9e0bbE> + 8000e168: e82a sd a0,16(sp) + 8000e16a: ec2e sd a1,24(sp) + 8000e16c: a009 j 8000e16e <.LBB6_17+0x2a> + 8000e16e: 6562 ld a0,24(sp) + 8000e170: 65c2 ld a1,16(sp) + 8000e172: fc2e sd a1,56(sp) + 8000e174: e0aa sd a0,64(sp) + 8000e176: a009 j 8000e178 <.LBB6_17+0x34> + 8000e178: 1828 addi a0,sp,56 + 8000e17a: ffffe097 auipc ra,0xffffe + 8000e17e: afc080e7 jalr -1284(ra) # 8000bc76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E> + 8000e182: e4aa sd a0,72(sp) + 8000e184: a009 j 8000e186 <.LBB6_17+0x42> + 8000e186: 6526 ld a0,72(sp) + 8000e188: 00a035b3 snez a1,a0 + 8000e18c: 4581 li a1,0 + 8000e18e: 00b50463 beq a0,a1,8000e196 <.LBB6_17+0x52> + 8000e192: a009 j 8000e194 <.LBB6_17+0x50> + 8000e194: a029 j 8000e19e <.LBB6_17+0x5a> + if task.state == ProcState::SLEEPING && task.channel == channel { + task.state = ProcState::RUNNABLE; + } + } + } + 8000e196: 70e6 ld ra,120(sp) + 8000e198: 6109 addi sp,sp,128 + 8000e19a: 8082 ret + for task in unsafe { PROC_MANAGER.tasks.iter_mut() }{ + 8000e19c: 0000 unimp + 8000e19e: 6526 ld a0,72(sp) + 8000e1a0: e02a sd a0,0(sp) + 8000e1a2: f0aa sd a0,96(sp) + 8000e1a4: f4aa sd a0,104(sp) + 8000e1a6: f8aa sd a0,112(sp) + if task.state == ProcState::SLEEPING && task.channel == channel { + 8000e1a8: 41050513 addi a0,a0,1040 + +000000008000e1ac <.LBB6_18>: + 8000e1ac: 0001b597 auipc a1,0x1b + 8000e1b0: 23458593 addi a1,a1,564 # 800293e0 <.L__unnamed_13> + 8000e1b4: 00009097 auipc ra,0x9 + 8000e1b8: 676080e7 jalr 1654(ra) # 8001782a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE> + 8000e1bc: e42a sd a0,8(sp) + 8000e1be: a02d j 8000e1e8 <.LBB6_18+0x3c> + 8000e1c0: 4505 li a0,1 + 8000e1c2: 04a10b23 sb a0,86(sp) + 8000e1c6: a821 j 8000e1de <.LBB6_18+0x32> + 8000e1c8: 4501 li a0,0 + 8000e1ca: 04a10b23 sb a0,86(sp) + 8000e1ce: a801 j 8000e1de <.LBB6_18+0x32> + 8000e1d0: 7582 ld a1,32(sp) + 8000e1d2: 6502 ld a0,0(sp) + 8000e1d4: 3e053503 ld a0,992(a0) + 8000e1d8: feb504e3 beq a0,a1,8000e1c0 <.LBB6_18+0x14> + 8000e1dc: b7f5 j 8000e1c8 <.LBB6_18+0x1c> + 8000e1de: 05614503 lbu a0,86(sp) + 8000e1e2: 8905 andi a0,a0,1 + 8000e1e4: e509 bnez a0,8000e1ee <.LBB6_18+0x42> + 8000e1e6: a819 j 8000e1fc <.LBB6_18+0x50> + 8000e1e8: 6522 ld a0,8(sp) + 8000e1ea: f17d bnez a0,8000e1d0 <.LBB6_18+0x24> + 8000e1ec: bff1 j 8000e1c8 <.LBB6_18+0x1c> + 8000e1ee: 6582 ld a1,0(sp) + 8000e1f0: 450d li a0,3 + task.state = ProcState::RUNNABLE; + 8000e1f2: 04a10ba3 sb a0,87(sp) + 8000e1f6: 40a58823 sb a0,1040(a1) + if task.state == ProcState::SLEEPING && task.channel == channel { + 8000e1fa: a011 j 8000e1fe <.LBB6_18+0x52> + 8000e1fc: a009 j 8000e1fe <.LBB6_18+0x52> + for task in unsafe { PROC_MANAGER.tasks.iter_mut() }{ + 8000e1fe: bfad j 8000e178 <.LBB6_17+0x34> + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE: + +000000008000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE>: + + /// Wake up all processes sleeping on chan. + /// Must be called without any p->lock. + + pub fn wake_up(&mut self, channel: usize) { + 8000e200: 7179 addi sp,sp,-48 + 8000e202: f406 sd ra,40(sp) + 8000e204: e02e sd a1,0(sp) + 8000e206: e82a sd a0,16(sp) + 8000e208: ec2e sd a1,24(sp) + 8000e20a: 6589 lui a1,0x2 + 8000e20c: 0c85859b addiw a1,a1,200 + let guard = self.tasks_lock.acquire(); + 8000e210: 952e add a0,a0,a1 + 8000e212: 00003097 auipc ra,0x3 + 8000e216: e30080e7 jalr -464(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000e21a: 85aa mv a1,a0 + 8000e21c: e42e sd a1,8(sp) + 8000e21e: f02a sd a0,32(sp) + 8000e220: a009 j 8000e222 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE+0x22> + ProcManager::wakeup1(channel); + 8000e222: 6502 ld a0,0(sp) + 8000e224: 00000097 auipc ra,0x0 + 8000e228: f18080e7 jalr -232(ra) # 8000e13c <_ZN6kernel7process7manager11ProcManager7wakeup117hddcdae2e398d5cf3E> + 8000e22c: a009 j 8000e22e <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE+0x2e> + drop(guard); + 8000e22e: 6522 ld a0,8(sp) + 8000e230: 00010097 auipc ra,0x10 + 8000e234: bb8080e7 jalr -1096(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000e238: a009 j 8000e23a <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE+0x3a> + } + 8000e23a: 70a2 ld ra,40(sp) + 8000e23c: 6145 addi sp,sp,48 + 8000e23e: 8082 ret + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE: + +000000008000e240 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE>: + + /// Find a runnable and set status to allocated + /// should in lock + pub fn seek_runnable(&mut self) -> Option<&mut task_struct> { + 8000e240: 7119 addi sp,sp,-128 + 8000e242: fc86 sd ra,120(sp) + 8000e244: ecaa sd a0,88(sp) + 8000e246: 45a1 li a1,8 + // let guard = self.tasks_lock.acquire(); + for task in self.tasks.iter_mut() { + 8000e248: 00004097 auipc ra,0x4 + 8000e24c: ecc080e7 jalr -308(ra) # 80012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E> + 8000e250: f42a sd a0,40(sp) + 8000e252: f82e sd a1,48(sp) + 8000e254: a009 j 8000e256 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x16> + 8000e256: 75c2 ld a1,48(sp) + 8000e258: 7522 ld a0,40(sp) + 8000e25a: ffffd097 auipc ra,0xffffd + 8000e25e: 684080e7 jalr 1668(ra) # 8000b8de <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hca1289a056d9e0bbE> + 8000e262: ec2a sd a0,24(sp) + 8000e264: f02e sd a1,32(sp) + 8000e266: a009 j 8000e268 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x28> + 8000e268: 7502 ld a0,32(sp) + 8000e26a: 65e2 ld a1,24(sp) + 8000e26c: e0ae sd a1,64(sp) + 8000e26e: e4aa sd a0,72(sp) + 8000e270: a009 j 8000e272 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x32> + 8000e272: 0088 addi a0,sp,64 + 8000e274: ffffe097 auipc ra,0xffffe + 8000e278: a02080e7 jalr -1534(ra) # 8000bc76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E> + 8000e27c: e8aa sd a0,80(sp) + 8000e27e: a009 j 8000e280 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x40> + 8000e280: 6546 ld a0,80(sp) + 8000e282: 00a035b3 snez a1,a0 + 8000e286: 4581 li a1,0 + 8000e288: 00b50463 beq a0,a1,8000e290 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x50> + 8000e28c: a009 j 8000e28e <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x4e> + 8000e28e: a029 j 8000e298 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x58> + 8000e290: 4501 li a0,0 + // } + if task.state == ProcState::RUNNABLE { + return Some(task) + } + } + None + 8000e292: fc2a sd a0,56(sp) + } + 8000e294: a825 j 8000e2cc <.LBB8_13+0x26> + for task in self.tasks.iter_mut() { + 8000e296: 0000 unimp + 8000e298: 6546 ld a0,80(sp) + 8000e29a: e42a sd a0,8(sp) + 8000e29c: f0aa sd a0,96(sp) + 8000e29e: f4aa sd a0,104(sp) + 8000e2a0: f8aa sd a0,112(sp) + if task.state == ProcState::RUNNABLE { + 8000e2a2: 41050513 addi a0,a0,1040 + +000000008000e2a6 <.LBB8_13>: + 8000e2a6: 0001b597 auipc a1,0x1b + 8000e2aa: 13b58593 addi a1,a1,315 # 800293e1 <.L__unnamed_14> + 8000e2ae: 00009097 auipc ra,0x9 + 8000e2b2: 57c080e7 jalr 1404(ra) # 8001782a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE> + 8000e2b6: e82a sd a0,16(sp) + 8000e2b8: a009 j 8000e2ba <.LBB8_13+0x14> + 8000e2ba: 6542 ld a0,16(sp) + 8000e2bc: 4581 li a1,0 + 8000e2be: 00b50663 beq a0,a1,8000e2ca <.LBB8_13+0x24> + 8000e2c2: a009 j 8000e2c4 <.LBB8_13+0x1e> + return Some(task) + 8000e2c4: 6522 ld a0,8(sp) + 8000e2c6: fc2a sd a0,56(sp) + } + 8000e2c8: a011 j 8000e2cc <.LBB8_13+0x26> + for task in self.tasks.iter_mut() { + 8000e2ca: b765 j 8000e272 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE+0x32> + } + 8000e2cc: 7562 ld a0,56(sp) + 8000e2ce: 70e6 ld ra,120(sp) + 8000e2d0: 6109 addi sp,sp,128 + 8000e2d2: 8082 ret + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager8reparent17h4b120932c278a1b3E: + +000000008000e2d4 <_ZN6kernel7process7manager11ProcManager8reparent17h4b120932c278a1b3E>: + + /// Pass p's abandonded children to init. + /// Caller must hold wait lock. tasks_lock + pub fn reparent(proc: &mut task_struct) { + 8000e2d4: 7175 addi sp,sp,-144 + 8000e2d6: e506 sd ra,136(sp) + 8000e2d8: f02a sd a0,32(sp) + 8000e2da: f0aa sd a0,96(sp) + +000000008000e2dc <.LBB9_15>: + // pdata.parent = Some(self.init_proc); + // self.wake_up(self.init_proc as usize); + // } + // } + // } + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000e2dc: 0004b517 auipc a0,0x4b + 8000e2e0: 0f450513 addi a0,a0,244 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000e2e4: 45a1 li a1,8 + 8000e2e6: 00004097 auipc ra,0x4 + 8000e2ea: e2e080e7 jalr -466(ra) # 80012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E> + 8000e2ee: f42a sd a0,40(sp) + 8000e2f0: f82e sd a1,48(sp) + 8000e2f2: a009 j 8000e2f4 <.LBB9_15+0x18> + 8000e2f4: 75c2 ld a1,48(sp) + 8000e2f6: 7522 ld a0,40(sp) + 8000e2f8: ffffd097 auipc ra,0xffffd + 8000e2fc: 5e6080e7 jalr 1510(ra) # 8000b8de <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hca1289a056d9e0bbE> + 8000e300: e82a sd a0,16(sp) + 8000e302: ec2e sd a1,24(sp) + 8000e304: a009 j 8000e306 <.LBB9_15+0x2a> + 8000e306: 6562 ld a0,24(sp) + 8000e308: 65c2 ld a1,16(sp) + 8000e30a: fc2e sd a1,56(sp) + 8000e30c: e0aa sd a0,64(sp) + 8000e30e: a009 j 8000e310 <.LBB9_15+0x34> + 8000e310: 1828 addi a0,sp,56 + 8000e312: ffffe097 auipc ra,0xffffe + 8000e316: 964080e7 jalr -1692(ra) # 8000bc76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E> + 8000e31a: e4aa sd a0,72(sp) + 8000e31c: a009 j 8000e31e <.LBB9_15+0x42> + 8000e31e: 6526 ld a0,72(sp) + 8000e320: 00a035b3 snez a1,a0 + 8000e324: 4581 li a1,0 + 8000e326: 00b50463 beq a0,a1,8000e32e <.LBB9_15+0x52> + 8000e32a: a009 j 8000e32c <.LBB9_15+0x50> + 8000e32c: a029 j 8000e336 <.LBB9_15+0x5a> + // if task.state == ProcState::ZOMBIE !!!!!!!!TODO + ProcManager::wakeup1(unsafe { PROC_MANAGER.init_proc as usize }); + } + } + } + } + 8000e32e: 60aa ld ra,136(sp) + 8000e330: 6149 addi sp,sp,144 + 8000e332: 8082 ret + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000e334: 0000 unimp + 8000e336: 6526 ld a0,72(sp) + 8000e338: e42a sd a0,8(sp) + 8000e33a: f4aa sd a0,104(sp) + 8000e33c: f8aa sd a0,112(sp) + 8000e33e: fcaa sd a0,120(sp) + if let Some(parent) = task.parent { + 8000e340: 6d48 ld a0,152(a0) + 8000e342: 4581 li a1,0 + 8000e344: 00b51463 bne a0,a1,8000e34c <.LBB9_15+0x70> + 8000e348: a009 j 8000e34a <.LBB9_15+0x6e> + 8000e34a: a83d j 8000e388 <.LBB9_16+0x26> + 8000e34c: 7582 ld a1,32(sp) + 8000e34e: 6522 ld a0,8(sp) + 8000e350: 7148 ld a0,160(a0) + 8000e352: e12a sd a0,128(sp) + if parent as *const _ == proc as *const _ { + 8000e354: 02b51863 bne a0,a1,8000e384 <.LBB9_16+0x22> + 8000e358: a009 j 8000e35a <.LBB9_15+0x7e> + 8000e35a: 6622 ld a2,8(sp) + 8000e35c: 6509 lui a0,0x2 + 8000e35e: 0c05059b addiw a1,a0,192 + +000000008000e362 <.LBB9_16>: + 8000e362: 0004b517 auipc a0,0x4b + 8000e366: 06e50513 addi a0,a0,110 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000e36a: 952e add a0,a0,a1 + task.parent = unsafe { Some(PROC_MANAGER.init_proc) }; + 8000e36c: 610c ld a1,0(a0) + 8000e36e: ecae sd a1,88(sp) + 8000e370: 4685 li a3,1 + 8000e372: e8b6 sd a3,80(sp) + 8000e374: ee54 sd a3,152(a2) + 8000e376: f24c sd a1,160(a2) + ProcManager::wakeup1(unsafe { PROC_MANAGER.init_proc as usize }); + 8000e378: 6108 ld a0,0(a0) + 8000e37a: 00000097 auipc ra,0x0 + 8000e37e: dc2080e7 jalr -574(ra) # 8000e13c <_ZN6kernel7process7manager11ProcManager7wakeup117hddcdae2e398d5cf3E> + 8000e382: a011 j 8000e386 <.LBB9_16+0x24> + if parent as *const _ == proc as *const _ { + 8000e384: a011 j 8000e388 <.LBB9_16+0x26> + 8000e386: a009 j 8000e388 <.LBB9_16+0x26> + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + 8000e388: b761 j 8000e310 <.LBB9_15+0x34> + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager4exit17hfa49a8445fc58f81E: + +000000008000e38a <_ZN6kernel7process7manager11ProcManager4exit17hfa49a8445fc58f81E>: + + /// Exit the current process. Does not return. + /// An exited process remains in the zombie state + /// until its parent calls wait. + pub fn exit(&mut self, status : usize) -> ! { + 8000e38a: 712d addi sp,sp,-288 + 8000e38c: ee06 sd ra,280(sp) + 8000e38e: ecae sd a1,88(sp) + 8000e390: f0aa sd a0,96(sp) + 8000e392: e5aa sd a0,200(sp) + 8000e394: e9ae sd a1,208(sp) + +000000008000e396 <.LBB10_33>: + let curtask = unsafe { + CPU_MANAGER.myproc().expect("Current cpu's process is none.") + 8000e396: 00058517 auipc a0,0x58 + 8000e39a: daa50513 addi a0,a0,-598 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000e39e: 00004097 auipc ra,0x4 + 8000e3a2: 0ba080e7 jalr 186(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000e3a6: f4aa sd a0,104(sp) + 8000e3a8: a009 j 8000e3aa <.LBB10_33+0x14> + 8000e3aa: 7526 ld a0,104(sp) + +000000008000e3ac <.LBB10_34>: + 8000e3ac: 0001b597 auipc a1,0x1b + 8000e3b0: 03658593 addi a1,a1,54 # 800293e2 <.L__unnamed_15> + +000000008000e3b4 <.LBB10_35>: + 8000e3b4: 0001b697 auipc a3,0x1b + 8000e3b8: 04c68693 addi a3,a3,76 # 80029400 <.L__unnamed_16> + 8000e3bc: 4679 li a2,30 + 8000e3be: 00001097 auipc ra,0x1 + 8000e3c2: 03c080e7 jalr 60(ra) # 8000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE> + 8000e3c6: e8aa sd a0,80(sp) + 8000e3c8: a009 j 8000e3ca <.LBB10_35+0x16> + 8000e3ca: 6546 ld a0,80(sp) + 8000e3cc: edaa sd a0,216(sp) + }; + // close all open files. + // println!("STATUS {}", status); + let open_files = &mut curtask.open_files; + 8000e3ce: 0a850513 addi a0,a0,168 + 8000e3d2: e0aa sd a0,64(sp) + 8000e3d4: f1aa sd a0,224(sp) + 8000e3d6: 06400593 li a1,100 + // 遍历该进程打开的文件,夺取所有权,即将引用计数减一 + for index in 0..open_files.len() { + 8000e3da: 00001097 auipc ra,0x1 + 8000e3de: 9ec080e7 jalr -1556(ra) # 8000edc6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h659c29622d59b861E> + 8000e3e2: e4aa sd a0,72(sp) + 8000e3e4: a009 j 8000e3e6 <.LBB10_35+0x32> + 8000e3e6: 65a6 ld a1,72(sp) + 8000e3e8: 4501 li a0,0 + 8000e3ea: f8aa sd a0,112(sp) + 8000e3ec: fcae sd a1,120(sp) + 8000e3ee: 00012097 auipc ra,0x12 + 8000e3f2: 422080e7 jalr 1058(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8000e3f6: f82a sd a0,48(sp) + 8000e3f8: fc2e sd a1,56(sp) + 8000e3fa: a009 j 8000e3fc <.LBB10_35+0x48> + 8000e3fc: 7562 ld a0,56(sp) + 8000e3fe: 75c2 ld a1,48(sp) + 8000e400: e12e sd a1,128(sp) + 8000e402: e52a sd a0,136(sp) + 8000e404: a009 j 8000e406 <.LBB10_35+0x52> + 8000e406: 0108 addi a0,sp,128 + 8000e408: 00012097 auipc ra,0x12 + 8000e40c: 39a080e7 jalr 922(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8000e410: e92a sd a0,144(sp) + 8000e412: ed2e sd a1,152(sp) + 8000e414: a009 j 8000e416 <.LBB10_35+0x62> + 8000e416: 654a ld a0,144(sp) + 8000e418: 4581 li a1,0 + 8000e41a: 00b50463 beq a0,a1,8000e422 <.LBB10_36> + 8000e41e: a009 j 8000e420 <.LBB10_35+0x6c> + 8000e420: a819 j 8000e436 <.LBB10_36+0x14> + +000000008000e422 <.LBB10_36>: + if open_files[index].is_some() { + open_files[index].take(); + } + } + + LOG.begin_op(); + 8000e422: 0004d517 auipc a0,0x4d + 8000e426: 0b650513 addi a0,a0,182 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8000e42a: ffffb097 auipc ra,0xffffb + 8000e42e: fb0080e7 jalr -80(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 8000e432: a0a5 j 8000e49a <.LBB10_36+0x78> + for index in 0..open_files.len() { + 8000e434: 0000 unimp + 8000e436: 65ea ld a1,152(sp) + 8000e438: f42e sd a1,40(sp) + 8000e43a: f5ae sd a1,232(sp) + 8000e43c: f9ae sd a1,240(sp) + 8000e43e: fdae sd a1,248(sp) + 8000e440: 06300513 li a0,99 + if open_files[index].is_some() { + 8000e444: 16b56a63 bltu a0,a1,8000e5b8 <.LBB10_44+0x3e> + 8000e448: a009 j 8000e44a <.LBB10_36+0x28> + 8000e44a: 6506 ld a0,64(sp) + 8000e44c: 75a2 ld a1,40(sp) + 8000e44e: 058e slli a1,a1,0x3 + 8000e450: 952e add a0,a0,a1 + 8000e452: 00001097 auipc ra,0x1 + 8000e456: 4e0080e7 jalr 1248(ra) # 8000f932 <_ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE> + 8000e45a: f02a sd a0,32(sp) + 8000e45c: a009 j 8000e45e <.LBB10_36+0x3c> + 8000e45e: 7502 ld a0,32(sp) + 8000e460: 4581 li a1,0 + 8000e462: 00b50963 beq a0,a1,8000e474 <.LBB10_36+0x52> + 8000e466: a009 j 8000e468 <.LBB10_36+0x46> + 8000e468: 7522 ld a0,40(sp) + 8000e46a: 06400593 li a1,100 + open_files[index].take(); + 8000e46e: 00b56463 bltu a0,a1,8000e476 <.LBB10_36+0x54> + 8000e472: aab9 j 8000e5d0 <.LBB10_45+0x16> + if open_files[index].is_some() { + 8000e474: a015 j 8000e498 <.LBB10_36+0x76> + open_files[index].take(); + 8000e476: 6506 ld a0,64(sp) + 8000e478: 75a2 ld a1,40(sp) + 8000e47a: 058e slli a1,a1,0x3 + 8000e47c: 952e add a0,a0,a1 + 8000e47e: 00001097 auipc ra,0x1 + 8000e482: b8c080e7 jalr -1140(ra) # 8000f00a <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E> + 8000e486: f12a sd a0,160(sp) + 8000e488: a009 j 8000e48a <.LBB10_36+0x68> + 8000e48a: 1108 addi a0,sp,160 + 8000e48c: ffff9097 auipc ra,0xffff9 + 8000e490: d8a080e7 jalr -630(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 8000e494: a009 j 8000e496 <.LBB10_36+0x74> + if open_files[index].is_some() { + 8000e496: a009 j 8000e498 <.LBB10_36+0x76> + for index in 0..open_files.len() { + 8000e498: b7bd j 8000e406 <.LBB10_35+0x52> + let cwd = curtask.cwd.as_mut().expect("Fail to get inode"); + 8000e49a: 6546 ld a0,80(sp) + 8000e49c: 3c850513 addi a0,a0,968 + 8000e4a0: 00001097 auipc ra,0x1 + 8000e4a4: eae080e7 jalr -338(ra) # 8000f34e <_ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE> + 8000e4a8: ec2a sd a0,24(sp) + 8000e4aa: a009 j 8000e4ac <.LBB10_36+0x8a> + 8000e4ac: 6562 ld a0,24(sp) + +000000008000e4ae <.LBB10_37>: + 8000e4ae: 0001b597 auipc a1,0x1b + 8000e4b2: f9a58593 addi a1,a1,-102 # 80029448 <.L__unnamed_17> + +000000008000e4b6 <.LBB10_38>: + 8000e4b6: 0001b697 auipc a3,0x1b + 8000e4ba: faa68693 addi a3,a3,-86 # 80029460 <.L__unnamed_18> + 8000e4be: 4645 li a2,17 + 8000e4c0: 00001097 auipc ra,0x1 + 8000e4c4: fd8080e7 jalr -40(ra) # 8000f498 <_ZN4core6option15Option$LT$T$GT$6expect17h3c07e85986db6eddE> + 8000e4c8: 85aa mv a1,a0 + 8000e4ca: e82e sd a1,16(sp) + 8000e4cc: e22a sd a0,256(sp) + 8000e4ce: a009 j 8000e4d0 <.LBB10_38+0x1a> + drop(cwd); + 8000e4d0: 6542 ld a0,16(sp) + 8000e4d2: 00010097 auipc ra,0x10 + 8000e4d6: a60080e7 jalr -1440(ra) # 8001df32 <_ZN4core3mem4drop17he1c2696149894a05E> + 8000e4da: a009 j 8000e4dc <.LBB10_39> + +000000008000e4dc <.LBB10_39>: + LOG.end_op(); + 8000e4dc: 0004d517 auipc a0,0x4d + 8000e4e0: ffc50513 addi a0,a0,-4 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8000e4e4: ffffb097 auipc ra,0xffffb + 8000e4e8: 4dc080e7 jalr 1244(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 8000e4ec: a009 j 8000e4ee <.LBB10_39+0x12> + 8000e4ee: 6546 ld a0,80(sp) + 8000e4f0: 4581 li a1,0 + + + curtask.cwd = None; + 8000e4f2: f52e sd a1,168(sp) + 8000e4f4: 3c850513 addi a0,a0,968 + 8000e4f8: ffff9097 auipc ra,0xffff9 + 8000e4fc: c38080e7 jalr -968(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8000e500: a079 j 8000e58e <.LBB10_44+0x14> + + + let guard = self.tasks_lock.acquire(); + // Parent might be sleeping in wait. + // 唤醒父进程 + ProcManager::wakeup1(curtask.parent.expect("Fail to find parent process") as usize); + 8000e502: 65c6 ld a1,80(sp) + 8000e504: 6dc8 ld a0,152(a1) + 8000e506: 71cc ld a1,160(a1) + +000000008000e508 <.LBB10_40>: + 8000e508: 0001b617 auipc a2,0x1b + 8000e50c: f7060613 addi a2,a2,-144 # 80029478 <.L__unnamed_19> + +000000008000e510 <.LBB10_41>: + 8000e510: 0001b717 auipc a4,0x1b + 8000e514: f8870713 addi a4,a4,-120 # 80029498 <.L__unnamed_20> + 8000e518: 46ed li a3,27 + 8000e51a: 00001097 auipc ra,0x1 + 8000e51e: f4a080e7 jalr -182(ra) # 8000f464 <_ZN4core6option15Option$LT$T$GT$6expect17h2ee3949cdbd95affE> + 8000e522: e42a sd a0,8(sp) + 8000e524: a009 j 8000e526 <.LBB10_41+0x16> + 8000e526: 6522 ld a0,8(sp) + 8000e528: 00000097 auipc ra,0x0 + 8000e52c: c14080e7 jalr -1004(ra) # 8000e13c <_ZN6kernel7process7manager11ProcManager7wakeup117hddcdae2e398d5cf3E> + 8000e530: a009 j 8000e532 <.LBB10_41+0x22> + + // Give any children to init. + ProcManager::reparent(curtask); + 8000e532: 6546 ld a0,80(sp) + 8000e534: 00000097 auipc ra,0x0 + 8000e538: da0080e7 jalr -608(ra) # 8000e2d4 <_ZN6kernel7process7manager11ProcManager8reparent17h4b120932c278a1b3E> + 8000e53c: a009 j 8000e53e <.LBB10_41+0x2e> + // 设置退出状态 + curtask.xstate = status; + 8000e53e: 65c6 ld a1,80(sp) + 8000e540: 6566 ld a0,88(sp) + 8000e542: 3ea5b423 sd a0,1000(a1) + 8000e546: 4515 li a0,5 + // 设置运行状态 + curtask.state = ProcState::ZOMBIE; + 8000e548: 0ca103a3 sb a0,199(sp) + 8000e54c: 40a58823 sb a0,1040(a1) + +000000008000e550 <.LBB10_42>: + + let my_cpu = unsafe { + CPU_MANAGER.mycpu() + 8000e550: 00058517 auipc a0,0x58 + 8000e554: bf050513 addi a0,a0,-1040 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000e558: 00004097 auipc ra,0x4 + 8000e55c: eb4080e7 jalr -332(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 8000e560: e02a sd a0,0(sp) + 8000e562: a009 j 8000e564 <.LBB10_42+0x14> + 8000e564: 6502 ld a0,0(sp) + 8000e566: ea2a sd a0,272(sp) + }; + unsafe { + my_cpu.sched(); + 8000e568: 00004097 auipc ra,0x4 + 8000e56c: 116080e7 jalr 278(ra) # 8001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE> + 8000e570: a009 j 8000e572 <.LBB10_43> + +000000008000e572 <.LBB10_43>: + } + + panic!("zombie exit!"); + 8000e572: 0001b517 auipc a0,0x1b + 8000e576: f3e50513 addi a0,a0,-194 # 800294b0 <.L__unnamed_21> + +000000008000e57a <.LBB10_44>: + 8000e57a: 0001b617 auipc a2,0x1b + 8000e57e: f4660613 addi a2,a2,-186 # 800294c0 <.L__unnamed_22> + 8000e582: 45b1 li a1,12 + 8000e584: 00015097 auipc ra,0x15 + 8000e588: bc0080e7 jalr -1088(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000e58c: 0000 unimp + curtask.cwd = None; + 8000e58e: 7506 ld a0,96(sp) + 8000e590: 6646 ld a2,80(sp) + 8000e592: 75ea ld a1,184(sp) + 8000e594: 3cb63c23 sd a1,984(a2) + 8000e598: 75ca ld a1,176(sp) + 8000e59a: 3cb63823 sd a1,976(a2) + 8000e59e: 75aa ld a1,168(sp) + 8000e5a0: 3cb63423 sd a1,968(a2) + 8000e5a4: 6589 lui a1,0x2 + 8000e5a6: 0c85859b addiw a1,a1,200 + let guard = self.tasks_lock.acquire(); + 8000e5aa: 952e add a0,a0,a1 + 8000e5ac: 00003097 auipc ra,0x3 + 8000e5b0: a96080e7 jalr -1386(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000e5b4: e62a sd a0,264(sp) + 8000e5b6: b7b1 j 8000e502 <.LBB10_39+0x26> + if open_files[index].is_some() { + 8000e5b8: 7522 ld a0,40(sp) + +000000008000e5ba <.LBB10_45>: + 8000e5ba: 0001b617 auipc a2,0x1b + 8000e5be: e5e60613 addi a2,a2,-418 # 80029418 <.L__unnamed_23> + 8000e5c2: 06400593 li a1,100 + 8000e5c6: 00015097 auipc ra,0x15 + 8000e5ca: baa080e7 jalr -1110(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8000e5ce: 0000 unimp + open_files[index].take(); + 8000e5d0: 7522 ld a0,40(sp) + +000000008000e5d2 <.LBB10_46>: + 8000e5d2: 0001b617 auipc a2,0x1b + 8000e5d6: e5e60613 addi a2,a2,-418 # 80029430 <.L__unnamed_24> + 8000e5da: 06400593 li a1,100 + 8000e5de: 00015097 auipc ra,0x15 + 8000e5e2: b92080e7 jalr -1134(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager4wait17h7c4c80095cf78f04E: + +000000008000e5e8 <_ZN6kernel7process7manager11ProcManager4wait17h7c4c80095cf78f04E>: + } + + /// Wait for a child process to exit and return its pid. + /// 等待子进程退出并返回 pid + pub fn wait(&mut self, addr: usize) -> Option { + 8000e5e8: 710d addi sp,sp,-352 + 8000e5ea: ee86 sd ra,344(sp) + 8000e5ec: fcae sd a1,120(sp) + 8000e5ee: e12a sd a0,128(sp) + 8000e5f0: e22a sd a0,256(sp) + 8000e5f2: e62e sd a1,264(sp) + +000000008000e5f4 <.LBB11_47>: + let pid; + let curtask = unsafe { + CPU_MANAGER.myproc().expect("Fail to get my process") + 8000e5f4: 00058517 auipc a0,0x58 + 8000e5f8: b4c50513 addi a0,a0,-1204 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000e5fc: 00004097 auipc ra,0x4 + 8000e600: e5c080e7 jalr -420(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000e604: e52a sd a0,136(sp) + 8000e606: a009 j 8000e608 <.LBB11_47+0x14> + 8000e608: 652a ld a0,136(sp) + +000000008000e60a <.LBB11_48>: + 8000e60a: 0001b597 auipc a1,0x1b + 8000e60e: ece58593 addi a1,a1,-306 # 800294d8 <.L__unnamed_25> + +000000008000e612 <.LBB11_49>: + 8000e612: 0001b697 auipc a3,0x1b + 8000e616: ede68693 addi a3,a3,-290 # 800294f0 <.L__unnamed_26> + 8000e61a: 4659 li a2,22 + 8000e61c: 00001097 auipc ra,0x1 + 8000e620: dde080e7 jalr -546(ra) # 8000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE> + 8000e624: f8aa sd a0,112(sp) + 8000e626: a009 j 8000e628 <.LBB11_49+0x16> + 8000e628: 7546 ld a0,112(sp) + 8000e62a: ea2a sd a0,272(sp) + }; + + // let wait_guard = self.wait_lock.acquire(); + + loop { + 8000e62c: a009 j 8000e62e <.LBB11_49+0x1c> + 8000e62e: 650a ld a0,128(sp) + 8000e630: 6589 lui a1,0x2 + 8000e632: 0c85859b addiw a1,a1,200 + let tasks_guard = self.tasks_lock.acquire(); + 8000e636: 952e add a0,a0,a1 + 8000e638: 00003097 auipc ra,0x3 + 8000e63c: a0a080e7 jalr -1526(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000e640: 85aa mv a1,a0 + 8000e642: f4ae sd a1,104(sp) + 8000e644: ee2a sd a0,280(sp) + 8000e646: a009 j 8000e648 <.LBB11_49+0x36> + 8000e648: 650a ld a0,128(sp) + 8000e64a: 4581 li a1,0 + + + let mut have_kids = false; + 8000e64c: 0ab103a3 sb a1,167(sp) + 8000e650: 45a1 li a1,8 + // Scan through table looking for exited children. + // 遍历所有进程是否为其他进程的子进程 + for index in 0..self.tasks.len() { + 8000e652: 00004097 auipc ra,0x4 + 8000e656: a84080e7 jalr -1404(ra) # 800120d6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E> + 8000e65a: f0aa sd a0,96(sp) + 8000e65c: a009 j 8000e65e <.LBB11_49+0x4c> + 8000e65e: 7586 ld a1,96(sp) + 8000e660: 4501 li a0,0 + 8000e662: f52a sd a0,168(sp) + 8000e664: f92e sd a1,176(sp) + 8000e666: 00012097 auipc ra,0x12 + 8000e66a: 1aa080e7 jalr 426(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8000e66e: e8aa sd a0,80(sp) + 8000e670: ecae sd a1,88(sp) + 8000e672: a009 j 8000e674 <.LBB11_49+0x62> + 8000e674: 6566 ld a0,88(sp) + 8000e676: 65c6 ld a1,80(sp) + 8000e678: fd2e sd a1,184(sp) + 8000e67a: e1aa sd a0,192(sp) + 8000e67c: a009 j 8000e67e <.LBB11_49+0x6c> + 8000e67e: 1928 addi a0,sp,184 + 8000e680: 00012097 auipc ra,0x12 + 8000e684: 122080e7 jalr 290(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8000e688: e5aa sd a0,200(sp) + 8000e68a: e9ae sd a1,208(sp) + 8000e68c: a009 j 8000e68e <.LBB11_49+0x7c> + 8000e68e: 652e ld a0,200(sp) + 8000e690: 4581 li a1,0 + 8000e692: 00b50463 beq a0,a1,8000e69a <.LBB11_49+0x88> + 8000e696: a009 j 8000e698 <.LBB11_49+0x86> + 8000e698: a809 j 8000e6aa <.LBB11_49+0x98> + } + } + } + + // No point waiting if we don't have any children. + if !have_kids || curtask.killed { + 8000e69a: 0a714503 lbu a0,167(sp) + 8000e69e: 8905 andi a0,a0,1 + 8000e6a0: 4581 li a1,0 + 8000e6a2: 12b50063 beq a0,a1,8000e7c2 <.LBB11_50+0xce> + 8000e6a6: a235 j 8000e7d2 <.LBB11_50+0xde> + for index in 0..self.tasks.len() { + 8000e6a8: 0000 unimp + 8000e6aa: 65ce ld a1,208(sp) + 8000e6ac: e4ae sd a1,72(sp) + 8000e6ae: f22e sd a1,288(sp) + 8000e6b0: f62e sd a1,296(sp) + 8000e6b2: fa2e sd a1,304(sp) + 8000e6b4: 451d li a0,7 + let task = &mut self.tasks[index]; + 8000e6b6: 1ab56863 bltu a0,a1,8000e866 <.LBB11_51+0x56> + 8000e6ba: a009 j 8000e6bc <.LBB11_49+0xaa> + 8000e6bc: 650a ld a0,128(sp) + 8000e6be: 65a6 ld a1,72(sp) + 8000e6c0: 41800613 li a2,1048 + 8000e6c4: 02c585b3 mul a1,a1,a2 + 8000e6c8: 952e add a0,a0,a1 + 8000e6ca: e0aa sd a0,64(sp) + 8000e6cc: fe2a sd a0,312(sp) + if let Some(parent) = task.parent { + 8000e6ce: 6d48 ld a0,152(a0) + 8000e6d0: 4581 li a1,0 + 8000e6d2: 00b51463 bne a0,a1,8000e6da <.LBB11_49+0xc8> + 8000e6d6: a009 j 8000e6d8 <.LBB11_49+0xc6> + 8000e6d8: a0e5 j 8000e7c0 <.LBB11_50+0xcc> + 8000e6da: 75c6 ld a1,112(sp) + 8000e6dc: 6506 ld a0,64(sp) + 8000e6de: 7148 ld a0,160(a0) + 8000e6e0: e2aa sd a0,320(sp) + if parent as *const _ == curtask as *const _ { + 8000e6e2: 02b51363 bne a0,a1,8000e708 <.LBB11_50+0x14> + 8000e6e6: a009 j 8000e6e8 <.LBB11_49+0xd6> + 8000e6e8: 6506 ld a0,64(sp) + 8000e6ea: 4585 li a1,1 + have_kids = true; + 8000e6ec: 0ab103a3 sb a1,167(sp) + if task.state == ProcState::ZOMBIE { + 8000e6f0: 41050513 addi a0,a0,1040 + +000000008000e6f4 <.LBB11_50>: + 8000e6f4: 0001b597 auipc a1,0x1b + 8000e6f8: e2c58593 addi a1,a1,-468 # 80029520 <.L__unnamed_27> + 8000e6fc: 00009097 auipc ra,0x9 + 8000e700: 12e080e7 jalr 302(ra) # 8001782a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE> + 8000e704: fc2a sd a0,56(sp) + 8000e706: a011 j 8000e70a <.LBB11_50+0x16> + if parent as *const _ == curtask as *const _ { + 8000e708: a865 j 8000e7c0 <.LBB11_50+0xcc> + 8000e70a: 7562 ld a0,56(sp) + 8000e70c: 4581 li a1,0 + if task.state == ProcState::ZOMBIE { + 8000e70e: 02b50063 beq a0,a1,8000e72e <.LBB11_50+0x3a> + 8000e712: a009 j 8000e714 <.LBB11_50+0x20> + pid = task.pid; + 8000e714: 7566 ld a0,120(sp) + 8000e716: 6586 ld a1,64(sp) + 8000e718: 3f05b603 ld a2,1008(a1) + 8000e71c: f432 sd a2,40(sp) + 8000e71e: e6b2 sd a2,328(sp) + let page_table = unsafe { &mut *task.pagetable }; + 8000e720: 6d8c ld a1,24(a1) + 8000e722: f82e sd a1,48(sp) + 8000e724: eaae sd a1,336(sp) + 8000e726: 4581 li a1,0 + if addr != 0 && page_table.copy_out(addr, task.xstate as *const u8, size_of_val(&task.xstate)).is_err() { + 8000e728: 00b50863 beq a0,a1,8000e738 <.LBB11_50+0x44> + 8000e72c: a811 j 8000e740 <.LBB11_50+0x4c> + if parent as *const _ == curtask as *const _ { + 8000e72e: a849 j 8000e7c0 <.LBB11_50+0xcc> + 8000e730: 4505 li a0,1 + if addr != 0 && page_table.copy_out(addr, task.xstate as *const u8, size_of_val(&task.xstate)).is_err() { + 8000e732: 0ca10fa3 sb a0,223(sp) + 8000e736: a00d j 8000e758 <.LBB11_50+0x64> + 8000e738: 4501 li a0,0 + 8000e73a: 0ca10fa3 sb a0,223(sp) + 8000e73e: a829 j 8000e758 <.LBB11_50+0x64> + 8000e740: 6586 ld a1,64(sp) + 8000e742: 3e858513 addi a0,a1,1000 + 8000e746: 3e85b583 ld a1,1000(a1) + 8000e74a: ec2e sd a1,24(sp) + 8000e74c: 0000f097 auipc ra,0xf + 8000e750: 62e080e7 jalr 1582(ra) # 8001dd7a <_ZN4core3mem11size_of_val17hb8db3e1f6e8e8424E> + 8000e754: f02a sd a0,32(sp) + 8000e756: a031 j 8000e762 <.LBB11_50+0x6e> + 8000e758: 0df14503 lbu a0,223(sp) + 8000e75c: 8905 andi a0,a0,1 + 8000e75e: e51d bnez a0,8000e78c <.LBB11_50+0x98> + 8000e760: a825 j 8000e798 <.LBB11_50+0xa4> + 8000e762: 7682 ld a3,32(sp) + 8000e764: 6662 ld a2,24(sp) + 8000e766: 75e6 ld a1,120(sp) + 8000e768: 7542 ld a0,48(sp) + 8000e76a: 0000a097 auipc ra,0xa + 8000e76e: 214080e7 jalr 532(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 8000e772: f1aa sd a0,224(sp) + 8000e774: f5ae sd a1,232(sp) + 8000e776: a009 j 8000e778 <.LBB11_50+0x84> + 8000e778: 1188 addi a0,sp,224 + 8000e77a: fffff097 auipc ra,0xfffff + 8000e77e: efe080e7 jalr -258(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8000e782: e82a sd a0,16(sp) + 8000e784: a009 j 8000e786 <.LBB11_50+0x92> + 8000e786: 6542 ld a0,16(sp) + 8000e788: f545 bnez a0,8000e730 <.LBB11_50+0x3c> + 8000e78a: b77d j 8000e738 <.LBB11_50+0x44> + drop(tasks_guard); + 8000e78c: 7526 ld a0,104(sp) + 8000e78e: 0000f097 auipc ra,0xf + 8000e792: 65a080e7 jalr 1626(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000e796: a039 j 8000e7a4 <.LBB11_50+0xb0> + task.free_proc(); + 8000e798: 6506 ld a0,64(sp) + 8000e79a: 00008097 auipc ra,0x8 + 8000e79e: 7ae080e7 jalr 1966(ra) # 80016f48 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E> + 8000e7a2: a021 j 8000e7aa <.LBB11_50+0xb6> + 8000e7a4: 4501 li a0,0 + return None + 8000e7a6: e92a sd a0,144(sp) +#![no_std] + 8000e7a8: a855 j 8000e85c <.LBB11_51+0x4c> + drop(tasks_guard); + 8000e7aa: 7526 ld a0,104(sp) + 8000e7ac: 0000f097 auipc ra,0xf + 8000e7b0: 63c080e7 jalr 1596(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000e7b4: a009 j 8000e7b6 <.LBB11_50+0xc2> + return Some(pid) + 8000e7b6: 7522 ld a0,40(sp) + 8000e7b8: ed2a sd a0,152(sp) + 8000e7ba: 4505 li a0,1 + 8000e7bc: e92a sd a0,144(sp) + 8000e7be: a879 j 8000e85c <.LBB11_51+0x4c> + for index in 0..self.tasks.len() { + 8000e7c0: bd7d j 8000e67e <.LBB11_49+0x6c> + 8000e7c2: 4505 li a0,1 + if !have_kids || curtask.killed { + 8000e7c4: 0ea10ba3 sb a0,247(sp) + 8000e7c8: a819 j 8000e7de <.LBB11_50+0xea> + 8000e7ca: 4501 li a0,0 + 8000e7cc: 0ea10ba3 sb a0,247(sp) + 8000e7d0: a039 j 8000e7de <.LBB11_50+0xea> + 8000e7d2: 7546 ld a0,112(sp) + 8000e7d4: 41154503 lbu a0,1041(a0) + 8000e7d8: 8905 andi a0,a0,1 + 8000e7da: f565 bnez a0,8000e7c2 <.LBB11_50+0xce> + 8000e7dc: b7fd j 8000e7ca <.LBB11_50+0xd6> + 8000e7de: 0f714503 lbu a0,247(sp) + 8000e7e2: 8905 andi a0,a0,1 + 8000e7e4: 4581 li a1,0 + 8000e7e6: 00b50963 beq a0,a1,8000e7f8 <.LBB11_50+0x104> + 8000e7ea: a009 j 8000e7ec <.LBB11_50+0xf8> + drop(tasks_guard); + 8000e7ec: 7526 ld a0,104(sp) + 8000e7ee: 0000f097 auipc ra,0xf + 8000e7f2: 5fa080e7 jalr 1530(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000e7f6: a039 j 8000e804 <.LBB11_50+0x110> + // drop(wait_guard); + return None + } + + + drop(tasks_guard); + 8000e7f8: 7526 ld a0,104(sp) + 8000e7fa: 0000f097 auipc ra,0xf + 8000e7fe: 5ee080e7 jalr 1518(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000e802: a021 j 8000e80a <.LBB11_50+0x116> + 8000e804: 4501 li a0,0 + return None + 8000e806: e92a sd a0,144(sp) + 8000e808: a891 j 8000e85c <.LBB11_51+0x4c> + 8000e80a: 6509 lui a0,0x2 + 8000e80c: 0e85059b addiw a1,a0,232 + +000000008000e810 <.LBB11_51>: + 8000e810: 0004b517 auipc a0,0x4b + 8000e814: bc050513 addi a0,a0,-1088 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8000e818: 952e add a0,a0,a1 + // Wait for a child to exit. + let mut wait_guard = unsafe { PROC_MANAGER.wait_lock.acquire() }; + 8000e81a: 00003097 auipc ra,0x3 + 8000e81e: 828080e7 jalr -2008(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000e822: fdaa sd a0,248(sp) + 8000e824: a009 j 8000e826 <.LBB11_51+0x16> + curtask.sleep( + curtask as *const _ as usize, + wait_guard + 8000e826: 75c6 ld a1,112(sp) + 8000e828: 766e ld a2,248(sp) + curtask.sleep( + 8000e82a: 852e mv a0,a1 + 8000e82c: 00004097 auipc ra,0x4 + 8000e830: a20080e7 jalr -1504(ra) # 8001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E> + 8000e834: a009 j 8000e836 <.LBB11_51+0x26> + 8000e836: 650a ld a0,128(sp) + 8000e838: 6589 lui a1,0x2 + 8000e83a: 0e85859b addiw a1,a1,232 + ); + wait_guard = self.wait_lock.acquire(); + 8000e83e: 952e add a0,a0,a1 + 8000e840: 00003097 auipc ra,0x3 + 8000e844: 802080e7 jalr -2046(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000e848: e42a sd a0,8(sp) + 8000e84a: a009 j 8000e84c <.LBB11_51+0x3c> + 8000e84c: 6522 ld a0,8(sp) + 8000e84e: fdaa sd a0,248(sp) + 8000e850: 19a8 addi a0,sp,248 + } + 8000e852: ffff9097 auipc ra,0xffff9 + 8000e856: 904080e7 jalr -1788(ra) # 80007156 <_ZN4core3ptr74drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$LP$$RP$$GT$$GT$17he568be727488c8bbE> + 8000e85a: bbd1 j 8000e62e <.LBB11_49+0x1c> + } + 8000e85c: 654a ld a0,144(sp) + 8000e85e: 65ea ld a1,152(sp) + 8000e860: 60f6 ld ra,344(sp) + 8000e862: 6135 addi sp,sp,352 + 8000e864: 8082 ret + let task = &mut self.tasks[index]; + 8000e866: 6526 ld a0,72(sp) + +000000008000e868 <.LBB11_52>: + 8000e868: 0001b617 auipc a2,0x1b + 8000e86c: ca060613 addi a2,a2,-864 # 80029508 <.L__unnamed_28> + 8000e870: 45a1 li a1,8 + 8000e872: 00015097 auipc ra,0x15 + 8000e876: 8fe080e7 jalr -1794(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager4join17h0acabc4ce5dd65bdE: + +000000008000e87c <_ZN6kernel7process7manager11ProcManager4join17h0acabc4ce5dd65bdE>: + + pub fn join(&mut self, stack: usize) -> Option { + 8000e87c: 7105 addi sp,sp,-480 + 8000e87e: ef86 sd ra,472(sp) + 8000e880: e52a sd a0,136(sp) + 8000e882: ed2e sd a1,152(sp) + 8000e884: e32a sd a0,384(sp) + +000000008000e886 <.LBB12_47>: + let pid; + let my_proc = unsafe { + CPU_MANAGER.myproc().expect("Fail to get my process") + 8000e886: 00058517 auipc a0,0x58 + 8000e88a: 8ba50513 addi a0,a0,-1862 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8000e88e: 00004097 auipc ra,0x4 + 8000e892: bca080e7 jalr -1078(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8000e896: e92a sd a0,144(sp) + 8000e898: a009 j 8000e89a <.LBB12_47+0x14> + 8000e89a: 654a ld a0,144(sp) + +000000008000e89c <.LBB12_48>: + 8000e89c: 0001b597 auipc a1,0x1b + 8000e8a0: c3c58593 addi a1,a1,-964 # 800294d8 <.L__unnamed_25> + +000000008000e8a4 <.LBB12_49>: + 8000e8a4: 0001b697 auipc a3,0x1b + 8000e8a8: c8468693 addi a3,a3,-892 # 80029528 <.L__unnamed_29> + 8000e8ac: 4659 li a2,22 + 8000e8ae: 00001097 auipc ra,0x1 + 8000e8b2: b4c080e7 jalr -1204(ra) # 8000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE> + 8000e8b6: e12a sd a0,128(sp) + 8000e8b8: a009 j 8000e8ba <.LBB12_49+0x16> + 8000e8ba: 650a ld a0,128(sp) + 8000e8bc: e72a sd a0,392(sp) + 8000e8be: 0928 addi a0,sp,152 + }; + println!("In join the stack varible addr is {}", stack); + 8000e8c0: f9aa sd a0,240(sp) + 8000e8c2: eb2a sd a0,400(sp) + +000000008000e8c4 <.LBB12_50>: + 8000e8c4: 00017597 auipc a1,0x17 + 8000e8c8: fdc58593 addi a1,a1,-36 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8000e8cc: 00012097 auipc ra,0x12 + 8000e8d0: ca2080e7 jalr -862(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8000e8d4: f8aa sd a0,112(sp) + 8000e8d6: fcae sd a1,120(sp) + 8000e8d8: a009 j 8000e8da <.LBB12_50+0x16> + 8000e8da: 7566 ld a0,120(sp) + 8000e8dc: 75c6 ld a1,112(sp) + 8000e8de: f1ae sd a1,224(sp) + 8000e8e0: f5aa sd a0,232(sp) + +000000008000e8e2 <.LBB12_51>: + 8000e8e2: 0001b597 auipc a1,0x1b + 8000e8e6: c8658593 addi a1,a1,-890 # 80029568 <.L__unnamed_30> + 8000e8ea: 1908 addi a0,sp,176 + 8000e8ec: 4609 li a2,2 + 8000e8ee: 1194 addi a3,sp,224 + 8000e8f0: 4705 li a4,1 + 8000e8f2: ffff7097 auipc ra,0xffff7 + 8000e8f6: c98080e7 jalr -872(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000e8fa: a009 j 8000e8fc <.LBB12_51+0x1a> + 8000e8fc: 1908 addi a0,sp,176 + 8000e8fe: 00010097 auipc ra,0x10 + 8000e902: 2fa080e7 jalr 762(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000e906: a009 j 8000e908 <.LBB12_51+0x26> + 8000e908: 652a ld a0,136(sp) + 8000e90a: 6589 lui a1,0x2 + 8000e90c: 0c85859b addiw a1,a1,200 + loop { + let mut guard = self.tasks_lock.acquire(); + 8000e910: 952e add a0,a0,a1 + 8000e912: 00002097 auipc ra,0x2 + 8000e916: 730080e7 jalr 1840(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000e91a: 85aa mv a1,a0 + 8000e91c: f4ae sd a1,104(sp) + 8000e91e: ef2a sd a0,408(sp) + 8000e920: a009 j 8000e922 <.LBB12_51+0x40> + 8000e922: 652a ld a0,136(sp) + 8000e924: 4581 li a1,0 + let mut have_kids = false; + 8000e926: 0eb10fa3 sb a1,255(sp) + 8000e92a: 45a1 li a1,8 + // Scan through table looking for exited children. + // 遍历所有进程是否为其他进程的子进程 + for index in 0..self.tasks.len() { + 8000e92c: 00003097 auipc ra,0x3 + 8000e930: 7aa080e7 jalr 1962(ra) # 800120d6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E> + 8000e934: f0aa sd a0,96(sp) + 8000e936: a009 j 8000e938 <.LBB12_51+0x56> + 8000e938: 7586 ld a1,96(sp) + 8000e93a: 4501 li a0,0 + 8000e93c: e22a sd a0,256(sp) + 8000e93e: e62e sd a1,264(sp) + 8000e940: 00012097 auipc ra,0x12 + 8000e944: ed0080e7 jalr -304(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8000e948: e8aa sd a0,80(sp) + 8000e94a: ecae sd a1,88(sp) + 8000e94c: a009 j 8000e94e <.LBB12_51+0x6c> + 8000e94e: 6566 ld a0,88(sp) + 8000e950: 65c6 ld a1,80(sp) + 8000e952: ea2e sd a1,272(sp) + 8000e954: ee2a sd a0,280(sp) + 8000e956: a009 j 8000e958 <.LBB12_51+0x76> + 8000e958: 0a08 addi a0,sp,272 + 8000e95a: 00012097 auipc ra,0x12 + 8000e95e: e48080e7 jalr -440(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8000e962: f22a sd a0,288(sp) + 8000e964: f62e sd a1,296(sp) + 8000e966: a009 j 8000e968 <.LBB12_51+0x86> + 8000e968: 7512 ld a0,288(sp) + 8000e96a: 4581 li a1,0 + 8000e96c: 00b50463 beq a0,a1,8000e974 <.LBB12_51+0x92> + 8000e970: a009 j 8000e972 <.LBB12_51+0x90> + 8000e972: a809 j 8000e984 <.LBB12_51+0xa2> + } + } + } + } + // No point waiting if we don't have any children. + if !have_kids || my_proc.killed { + 8000e974: 0ff14503 lbu a0,255(sp) + 8000e978: 8905 andi a0,a0,1 + 8000e97a: 4581 li a1,0 + 8000e97c: 10b50f63 beq a0,a1,8000ea9a <.LBB12_54+0x4e> + 8000e980: a22d j 8000eaaa <.LBB12_54+0x5e> + for index in 0..self.tasks.len() { + 8000e982: 0000 unimp + 8000e984: 75b2 ld a1,296(sp) + 8000e986: e4ae sd a1,72(sp) + 8000e988: f32e sd a1,416(sp) + 8000e98a: f72e sd a1,424(sp) + 8000e98c: fb2e sd a1,432(sp) + 8000e98e: 451d li a0,7 + let p = &mut self.tasks[index]; + 8000e990: 1ab56463 bltu a0,a1,8000eb38 <.LBB12_54+0xec> + 8000e994: a009 j 8000e996 <.LBB12_51+0xb4> + 8000e996: 652a ld a0,136(sp) + 8000e998: 65a6 ld a1,72(sp) + 8000e99a: 41800613 li a2,1048 + 8000e99e: 02c585b3 mul a1,a1,a2 + 8000e9a2: 952e add a0,a0,a1 + 8000e9a4: e0aa sd a0,64(sp) + 8000e9a6: ff2a sd a0,440(sp) + if let Some(parent) = p.parent { + 8000e9a8: 6d48 ld a0,152(a0) + 8000e9aa: 4581 li a1,0 + 8000e9ac: 00b51463 bne a0,a1,8000e9b4 <.LBB12_51+0xd2> + 8000e9b0: a009 j 8000e9b2 <.LBB12_51+0xd0> + 8000e9b2: a0dd j 8000ea98 <.LBB12_54+0x4c> + 8000e9b4: 658a ld a1,128(sp) + 8000e9b6: 6506 ld a0,64(sp) + 8000e9b8: 7148 ld a0,160(a0) + 8000e9ba: e3aa sd a0,448(sp) + if parent as *const _ == my_proc as *const _ { + 8000e9bc: 02b51363 bne a0,a1,8000e9e2 <.LBB12_52+0x14> + 8000e9c0: a009 j 8000e9c2 <.LBB12_51+0xe0> + 8000e9c2: 6506 ld a0,64(sp) + 8000e9c4: 4585 li a1,1 + have_kids = true; + 8000e9c6: 0eb10fa3 sb a1,255(sp) + if p.state == ProcState::ZOMBIE { + 8000e9ca: 41050513 addi a0,a0,1040 + +000000008000e9ce <.LBB12_52>: + 8000e9ce: 0001b597 auipc a1,0x1b + 8000e9d2: b5258593 addi a1,a1,-1198 # 80029520 <.L__unnamed_27> + 8000e9d6: 00009097 auipc ra,0x9 + 8000e9da: e54080e7 jalr -428(ra) # 8001782a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE> + 8000e9de: fc2a sd a0,56(sp) + 8000e9e0: a011 j 8000e9e4 <.LBB12_52+0x16> + if parent as *const _ == my_proc as *const _ { + 8000e9e2: a85d j 8000ea98 <.LBB12_54+0x4c> + 8000e9e4: 7562 ld a0,56(sp) + 8000e9e6: 4581 li a1,0 + if p.state == ProcState::ZOMBIE { + 8000e9e8: 02b50063 beq a0,a1,8000ea08 <.LBB12_52+0x3a> + 8000e9ec: a009 j 8000e9ee <.LBB12_52+0x20> + pid = p.pid; + 8000e9ee: 6506 ld a0,64(sp) + 8000e9f0: 3f053583 ld a1,1008(a0) + 8000e9f4: ec2e sd a1,24(sp) + 8000e9f6: e7ae sd a1,456(sp) + let page_table = unsafe { &mut *p.pagetable }; + 8000e9f8: 6d0c ld a1,24(a0) + 8000e9fa: f02e sd a1,32(sp) + 8000e9fc: ebae sd a1,464(sp) + if page_table.copy_out(stack, p.thread_ustack as *const u8, size_of::()).is_err() { + 8000e9fe: 65ea ld a1,152(sp) + 8000ea00: f42e sd a1,40(sp) + 8000ea02: 6508 ld a0,8(a0) + 8000ea04: f82a sd a0,48(sp) + 8000ea06: a011 j 8000ea0a <.LBB12_52+0x3c> + if parent as *const _ == my_proc as *const _ { + 8000ea08: a841 j 8000ea98 <.LBB12_54+0x4c> + if page_table.copy_out(stack, p.thread_ustack as *const u8, size_of::()).is_err() { + 8000ea0a: 7642 ld a2,48(sp) + 8000ea0c: 75a2 ld a1,40(sp) + 8000ea0e: 7502 ld a0,32(sp) + 8000ea10: 46a1 li a3,8 + 8000ea12: 0000a097 auipc ra,0xa + 8000ea16: f6c080e7 jalr -148(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 8000ea1a: fa2a sd a0,304(sp) + 8000ea1c: fe2e sd a1,312(sp) + 8000ea1e: a009 j 8000ea20 <.LBB12_52+0x52> + 8000ea20: 1a08 addi a0,sp,304 + 8000ea22: fffff097 auipc ra,0xfffff + 8000ea26: c56080e7 jalr -938(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8000ea2a: e82a sd a0,16(sp) + 8000ea2c: a009 j 8000ea2e <.LBB12_52+0x60> + 8000ea2e: 6542 ld a0,16(sp) + 8000ea30: 4581 li a1,0 + 8000ea32: 00b50963 beq a0,a1,8000ea44 <.LBB12_53> + 8000ea36: a009 j 8000ea38 <.LBB12_52+0x6a> + drop(guard); + 8000ea38: 7526 ld a0,104(sp) + 8000ea3a: 0000f097 auipc ra,0xf + 8000ea3e: 3ae080e7 jalr 942(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000ea42: a00d j 8000ea64 <.LBB12_54+0x18> + +000000008000ea44 <.LBB12_53>: + println!("(FIND"); + 8000ea44: 0001b597 auipc a1,0x1b + 8000ea48: b6458593 addi a1,a1,-1180 # 800295a8 <.L__unnamed_31> + +000000008000ea4c <.LBB12_54>: + 8000ea4c: 0001b697 auipc a3,0x1b + 8000ea50: 8d468693 addi a3,a3,-1836 # 80029320 <.L__unnamed_42> + 8000ea54: 0288 addi a0,sp,320 + 8000ea56: 4605 li a2,1 + 8000ea58: 4701 li a4,0 + 8000ea5a: ffff7097 auipc ra,0xffff7 + 8000ea5e: b30080e7 jalr -1232(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000ea62: a021 j 8000ea6a <.LBB12_54+0x1e> + 8000ea64: 4501 li a0,0 + return None + 8000ea66: f12a sd a0,160(sp) + 8000ea68: a0d9 j 8000eb2e <.LBB12_54+0xe2> + 8000ea6a: 0288 addi a0,sp,320 + println!("(FIND"); + 8000ea6c: 00010097 auipc ra,0x10 + 8000ea70: 18c080e7 jalr 396(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000ea74: a009 j 8000ea76 <.LBB12_54+0x2a> + p.free_thread(); + 8000ea76: 6506 ld a0,64(sp) + 8000ea78: 00008097 auipc ra,0x8 + 8000ea7c: 540080e7 jalr 1344(ra) # 80016fb8 <_ZN6kernel7process7process11task_struct11free_thread17he6786fef99445e3bE> + 8000ea80: a009 j 8000ea82 <.LBB12_54+0x36> + drop(guard); + 8000ea82: 7526 ld a0,104(sp) + 8000ea84: 0000f097 auipc ra,0xf + 8000ea88: 364080e7 jalr 868(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000ea8c: a009 j 8000ea8e <.LBB12_54+0x42> + return Some(pid); + 8000ea8e: 6562 ld a0,24(sp) + 8000ea90: f52a sd a0,168(sp) + 8000ea92: 4505 li a0,1 + 8000ea94: f12a sd a0,160(sp) + 8000ea96: a861 j 8000eb2e <.LBB12_54+0xe2> + for index in 0..self.tasks.len() { + 8000ea98: b5c1 j 8000e958 <.LBB12_51+0x76> + 8000ea9a: 4505 li a0,1 + if !have_kids || my_proc.killed { + 8000ea9c: 16a10ba3 sb a0,375(sp) + 8000eaa0: a819 j 8000eab6 <.LBB12_54+0x6a> + 8000eaa2: 4501 li a0,0 + 8000eaa4: 16a10ba3 sb a0,375(sp) + 8000eaa8: a039 j 8000eab6 <.LBB12_54+0x6a> + 8000eaaa: 650a ld a0,128(sp) + 8000eaac: 41154503 lbu a0,1041(a0) + 8000eab0: 8905 andi a0,a0,1 + 8000eab2: f565 bnez a0,8000ea9a <.LBB12_54+0x4e> + 8000eab4: b7fd j 8000eaa2 <.LBB12_54+0x56> + 8000eab6: 17714503 lbu a0,375(sp) + 8000eaba: 8905 andi a0,a0,1 + 8000eabc: 4581 li a1,0 + 8000eabe: 00b50963 beq a0,a1,8000ead0 <.LBB12_54+0x84> + 8000eac2: a009 j 8000eac4 <.LBB12_54+0x78> + drop(guard); + 8000eac4: 7526 ld a0,104(sp) + 8000eac6: 0000f097 auipc ra,0xf + 8000eaca: 322080e7 jalr 802(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000eace: a039 j 8000eadc <.LBB12_54+0x90> + return None + } + // 释放锁,否则会死锁 + drop(guard); + 8000ead0: 7526 ld a0,104(sp) + 8000ead2: 0000f097 auipc ra,0xf + 8000ead6: 316080e7 jalr 790(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8000eada: a021 j 8000eae2 <.LBB12_54+0x96> + 8000eadc: 4501 li a0,0 + return None + 8000eade: f12a sd a0,160(sp) + 8000eae0: a0b9 j 8000eb2e <.LBB12_54+0xe2> + 8000eae2: 652a ld a0,136(sp) + 8000eae4: 6589 lui a1,0x2 + 8000eae6: 0e85859b addiw a1,a1,232 + let mut wait_guard = self.wait_lock.acquire(); + 8000eaea: 952e add a0,a0,a1 + 8000eaec: 00002097 auipc ra,0x2 + 8000eaf0: 556080e7 jalr 1366(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000eaf4: feaa sd a0,376(sp) + 8000eaf6: a009 j 8000eaf8 <.LBB12_54+0xac> + // Wait for a child to exit. + my_proc.sleep( + my_proc as *const _ as usize, + wait_guard + 8000eaf8: 658a ld a1,128(sp) + 8000eafa: 7676 ld a2,376(sp) + my_proc.sleep( + 8000eafc: 852e mv a0,a1 + 8000eafe: 00003097 auipc ra,0x3 + 8000eb02: 74e080e7 jalr 1870(ra) # 8001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E> + 8000eb06: a009 j 8000eb08 <.LBB12_54+0xbc> + 8000eb08: 652a ld a0,136(sp) + 8000eb0a: 6589 lui a1,0x2 + 8000eb0c: 0e85859b addiw a1,a1,232 + ); + wait_guard = self.wait_lock.acquire(); + 8000eb10: 952e add a0,a0,a1 + 8000eb12: 00002097 auipc ra,0x2 + 8000eb16: 530080e7 jalr 1328(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8000eb1a: e42a sd a0,8(sp) + 8000eb1c: a009 j 8000eb1e <.LBB12_54+0xd2> + 8000eb1e: 6522 ld a0,8(sp) + 8000eb20: feaa sd a0,376(sp) + 8000eb22: 1aa8 addi a0,sp,376 + } + 8000eb24: ffff8097 auipc ra,0xffff8 + 8000eb28: 632080e7 jalr 1586(ra) # 80007156 <_ZN4core3ptr74drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$LP$$RP$$GT$$GT$17he568be727488c8bbE> + 8000eb2c: bbf1 j 8000e908 <.LBB12_51+0x26> + } + 8000eb2e: 750a ld a0,160(sp) + 8000eb30: 75aa ld a1,168(sp) + 8000eb32: 60fe ld ra,472(sp) + 8000eb34: 613d addi sp,sp,480 + 8000eb36: 8082 ret + let p = &mut self.tasks[index]; + 8000eb38: 6526 ld a0,72(sp) + +000000008000eb3a <.LBB12_55>: + 8000eb3a: 0001b617 auipc a2,0x1b + 8000eb3e: a4e60613 addi a2,a2,-1458 # 80029588 <.L__unnamed_32> + 8000eb42: 45a1 li a1,8 + 8000eb44: 00014097 auipc ra,0x14 + 8000eb48: 62c080e7 jalr 1580(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E: + +000000008000eb4e <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E>: + } + + /// Print a process listing to console. For debugging. + /// Runs when user type ^P on console. + /// No lock to avoid wedging a stuck machine further + pub fn proc_dump(&self) { + 8000eb4e: 7149 addi sp,sp,-368 + 8000eb50: f686 sd ra,360(sp) + 8000eb52: fa2a sd a0,304(sp) + 8000eb54: 45a1 li a1,8 + for proc in self.tasks.iter() { + 8000eb56: 00003097 auipc ra,0x3 + 8000eb5a: 594080e7 jalr 1428(ra) # 800120ea <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17hee0c9e23d269ed9fE> + 8000eb5e: f4aa sd a0,104(sp) + 8000eb60: f8ae sd a1,112(sp) + 8000eb62: a009 j 8000eb64 <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x16> + 8000eb64: 75c6 ld a1,112(sp) + 8000eb66: 7526 ld a0,104(sp) + 8000eb68: ffffd097 auipc ra,0xffffd + 8000eb6c: d62080e7 jalr -670(ra) # 8000b8ca <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h9e69dea96ab82809E> + 8000eb70: ecaa sd a0,88(sp) + 8000eb72: f0ae sd a1,96(sp) + 8000eb74: a009 j 8000eb76 <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x28> + 8000eb76: 7506 ld a0,96(sp) + 8000eb78: 65e6 ld a1,88(sp) + 8000eb7a: fcae sd a1,120(sp) + 8000eb7c: e12a sd a0,128(sp) + 8000eb7e: a009 j 8000eb80 <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x32> + 8000eb80: 18a8 addi a0,sp,120 + 8000eb82: ffffd097 auipc ra,0xffffd + 8000eb86: d66080e7 jalr -666(ra) # 8000b8e8 <_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h23afd61ade8b7581E> + 8000eb8a: e52a sd a0,136(sp) + 8000eb8c: a009 j 8000eb8e <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x40> + 8000eb8e: 652a ld a0,136(sp) + 8000eb90: 00a035b3 snez a1,a0 + 8000eb94: 4581 li a1,0 + 8000eb96: 00b50463 beq a0,a1,8000eb9e <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x50> + 8000eb9a: a009 j 8000eb9c <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x4e> + 8000eb9c: a029 j 8000eba6 <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x58> + if proc.state() == ProcState::UNUSED { continue; } + else { + println!("pid: {} state: {:?} name: {}", proc.pid(), proc.state(), proc.name()); + } + } + } + 8000eb9e: 70b6 ld ra,360(sp) + 8000eba0: 6175 addi sp,sp,368 + 8000eba2: 8082 ret + for proc in self.tasks.iter() { + 8000eba4: 0000 unimp + 8000eba6: 652a ld a0,136(sp) + 8000eba8: e8aa sd a0,80(sp) + 8000ebaa: fe2a sd a0,312(sp) + 8000ebac: e2aa sd a0,320(sp) + 8000ebae: e6aa sd a0,328(sp) + if proc.state() == ProcState::UNUSED { continue; } + 8000ebb0: 00008097 auipc ra,0x8 + 8000ebb4: 21a080e7 jalr 538(ra) # 80016dca <_ZN6kernel7process7process11task_struct5state17h5a6e14064666f40dE> + 8000ebb8: 0ff57513 andi a0,a0,255 + 8000ebbc: 08a10ba3 sb a0,151(sp) + 8000ebc0: a009 j 8000ebc2 <.LBB13_20> + +000000008000ebc2 <.LBB13_20>: + 8000ebc2: 0001b597 auipc a1,0x1b + 8000ebc6: 9f658593 addi a1,a1,-1546 # 800295b8 <.L__unnamed_33> + 8000ebca: 09710513 addi a0,sp,151 + 8000ebce: 00009097 auipc ra,0x9 + 8000ebd2: c5c080e7 jalr -932(ra) # 8001782a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE> + 8000ebd6: e4aa sd a0,72(sp) + 8000ebd8: a009 j 8000ebda <.LBB13_20+0x18> + 8000ebda: 6526 ld a0,72(sp) + 8000ebdc: f155 bnez a0,8000eb80 <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x32> + 8000ebde: a009 j 8000ebe0 <.LBB13_20+0x1e> + println!("pid: {} state: {:?} name: {}", proc.pid(), proc.state(), proc.name()); + 8000ebe0: 6546 ld a0,80(sp) + 8000ebe2: 00008097 auipc ra,0x8 + 8000ebe6: 1cc080e7 jalr 460(ra) # 80016dae <_ZN6kernel7process7process11task_struct3pid17h731646b24aa3a8ceE> + 8000ebea: ea2a sd a0,272(sp) + 8000ebec: a009 j 8000ebee <.LBB13_20+0x2c> + 8000ebee: 6546 ld a0,80(sp) + 8000ebf0: 00008097 auipc ra,0x8 + 8000ebf4: 1da080e7 jalr 474(ra) # 80016dca <_ZN6kernel7process7process11task_struct5state17h5a6e14064666f40dE> + 8000ebf8: 0ff57513 andi a0,a0,255 + 8000ebfc: 10a10fa3 sb a0,287(sp) + 8000ec00: a009 j 8000ec02 <.LBB13_20+0x40> + 8000ec02: 6546 ld a0,80(sp) + 8000ec04: 00008097 auipc ra,0x8 + 8000ec08: 1d2080e7 jalr 466(ra) # 80016dd6 <_ZN6kernel7process7process11task_struct4name17hd751dc9eed384ff3E> + 8000ec0c: f22a sd a0,288(sp) + 8000ec0e: f62e sd a1,296(sp) + 8000ec10: a009 j 8000ec12 <.LBB13_20+0x50> + 8000ec12: 0a08 addi a0,sp,272 + 8000ec14: fdaa sd a0,248(sp) + 8000ec16: 11f10613 addi a2,sp,287 + 8000ec1a: f432 sd a2,40(sp) + 8000ec1c: e232 sd a2,256(sp) + 8000ec1e: 120c addi a1,sp,288 + 8000ec20: f82e sd a1,48(sp) + 8000ec22: e62e sd a1,264(sp) + 8000ec24: eaaa sd a0,336(sp) + 8000ec26: eeb2 sd a2,344(sp) + 8000ec28: f2ae sd a1,352(sp) + +000000008000ec2a <.LBB13_21>: + 8000ec2a: 00017597 auipc a1,0x17 + 8000ec2e: c7658593 addi a1,a1,-906 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8000ec32: 00012097 auipc ra,0x12 + 8000ec36: 93c080e7 jalr -1732(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8000ec3a: fc2a sd a0,56(sp) + 8000ec3c: e0ae sd a1,64(sp) + 8000ec3e: a009 j 8000ec40 <.LBB13_21+0x16> + 8000ec40: 7522 ld a0,40(sp) + +000000008000ec42 <.LBB13_22>: + 8000ec42: 00009597 auipc a1,0x9 + 8000ec46: a9258593 addi a1,a1,-1390 # 800176d4 <_ZN72_$LT$kernel..process..process..ProcState$u20$as$u20$core..fmt..Debug$GT$3fmt17hf525681892d4cccaE> + 8000ec4a: 00011097 auipc ra,0x11 + 8000ec4e: 8c2080e7 jalr -1854(ra) # 8001f50c <_ZN4core3fmt10ArgumentV13new17h8dd13dffa5e435d0E> + 8000ec52: ec2a sd a0,24(sp) + 8000ec54: f02e sd a1,32(sp) + 8000ec56: a009 j 8000ec58 <.LBB13_22+0x16> + 8000ec58: 7542 ld a0,48(sp) + +000000008000ec5a <.LBB13_23>: + 8000ec5a: 00011597 auipc a1,0x11 + 8000ec5e: 80658593 addi a1,a1,-2042 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8000ec62: 00011097 auipc ra,0x11 + 8000ec66: 822080e7 jalr -2014(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 8000ec6a: e42a sd a0,8(sp) + 8000ec6c: e82e sd a1,16(sp) + 8000ec6e: a009 j 8000ec70 <.LBB13_23+0x16> + 8000ec70: 6542 ld a0,16(sp) + 8000ec72: 65a2 ld a1,8(sp) + 8000ec74: 7602 ld a2,32(sp) + 8000ec76: 66e2 ld a3,24(sp) + 8000ec78: 6706 ld a4,64(sp) + 8000ec7a: 77e2 ld a5,56(sp) + 8000ec7c: e5be sd a5,200(sp) + 8000ec7e: e9ba sd a4,208(sp) + 8000ec80: edb6 sd a3,216(sp) + 8000ec82: f1b2 sd a2,224(sp) + 8000ec84: f5ae sd a1,232(sp) + 8000ec86: f9aa sd a0,240(sp) + +000000008000ec88 <.LBB13_24>: + 8000ec88: 0001b597 auipc a1,0x1b + 8000ec8c: 94058593 addi a1,a1,-1728 # 800295c8 <.L__unnamed_34> + 8000ec90: 0928 addi a0,sp,152 + 8000ec92: 4611 li a2,4 + 8000ec94: 01b4 addi a3,sp,200 + 8000ec96: 470d li a4,3 + 8000ec98: ffff7097 auipc ra,0xffff7 + 8000ec9c: 8f2080e7 jalr -1806(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8000eca0: a009 j 8000eca2 <.LBB13_24+0x1a> + 8000eca2: 0928 addi a0,sp,152 + 8000eca4: 00010097 auipc ra,0x10 + 8000eca8: f54080e7 jalr -172(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8000ecac: a009 j 8000ecae <.LBB13_24+0x26> + for proc in self.tasks.iter() { + 8000ecae: bdc9 j 8000eb80 <_ZN6kernel7process7manager11ProcManager9proc_dump17h983bd5c89559ec59E+0x32> + +Disassembly of section .text._ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E: + +000000008000ecb0 <_ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E>: +} + +#[inline] +fn kernel_stack(pos: usize) -> usize { + 8000ecb0: 7179 addi sp,sp,-48 + 8000ecb2: 85aa mv a1,a0 + 8000ecb4: f42e sd a1,40(sp) + TRAMPOLINE - (pos + 1) * 5 * PGSIZE + 8000ecb6: 00158513 addi a0,a1,1 + 8000ecba: f02a sd a0,32(sp) + 8000ecbc: 04b56863 bltu a0,a1,8000ed0c <.LBB14_9> + 8000ecc0: a009 j 8000ecc2 <_ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E+0x12> + 8000ecc2: 7502 ld a0,32(sp) + 8000ecc4: 00251593 slli a1,a0,0x2 + 8000ecc8: 95aa add a1,a1,a0 + 8000ecca: ec2e sd a1,24(sp) + 8000eccc: 4595 li a1,5 + 8000ecce: 02b53533 mulhu a0,a0,a1 + 8000ecd2: 4581 li a1,0 + 8000ecd4: 04b51a63 bne a0,a1,8000ed28 <.LBB14_11> + 8000ecd8: a009 j 8000ecda <_ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E+0x2a> + 8000ecda: 65e2 ld a1,24(sp) + 8000ecdc: 4505 li a0,1 + 8000ecde: 1552 slli a0,a0,0x34 + 8000ece0: 157d addi a0,a0,-1 + 8000ece2: 8d6d and a0,a0,a1 + 8000ece4: 00c59613 slli a2,a1,0xc + 8000ece8: e832 sd a2,16(sp) + 8000ecea: 04b51e63 bne a0,a1,8000ed46 <.LBB14_13> + 8000ecee: a009 j 8000ecf0 <_ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E+0x40> + 8000ecf0: 65c2 ld a1,16(sp) + 8000ecf2: 04000537 lui a0,0x4000 + 8000ecf6: 357d addiw a0,a0,-1 + 8000ecf8: 0532 slli a0,a0,0xc + 8000ecfa: 40b505b3 sub a1,a0,a1 + 8000ecfe: e42e sd a1,8(sp) + 8000ed00: 06b56263 bltu a0,a1,8000ed64 <.LBB14_15> + 8000ed04: a009 j 8000ed06 <_ZN6kernel7process7manager12kernel_stack17h27945807ba9b8a49E+0x56> + 8000ed06: 6522 ld a0,8(sp) + 8000ed08: 6145 addi sp,sp,48 + 8000ed0a: 8082 ret + +000000008000ed0c <.LBB14_9>: + TRAMPOLINE - (pos + 1) * 5 * PGSIZE + 8000ed0c: 0001a517 auipc a0,0x1a + 8000ed10: 5d450513 addi a0,a0,1492 # 800292e0 + +000000008000ed14 <.LBB14_10>: + 8000ed14: 0001b617 auipc a2,0x1b + 8000ed18: 8f460613 addi a2,a2,-1804 # 80029608 <.L__unnamed_35> + 8000ed1c: 45f1 li a1,28 + 8000ed1e: 00014097 auipc ra,0x14 + 8000ed22: 426080e7 jalr 1062(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000ed28 <.LBB14_11>: + 8000ed28: 0001b517 auipc a0,0x1b + 8000ed2c: 8f850513 addi a0,a0,-1800 # 80029620 + +000000008000ed30 <.LBB14_12>: + 8000ed30: 0001b617 auipc a2,0x1b + 8000ed34: 8d860613 addi a2,a2,-1832 # 80029608 <.L__unnamed_35> + 8000ed38: 02100593 li a1,33 + 8000ed3c: 00014097 auipc ra,0x14 + 8000ed40: 408080e7 jalr 1032(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000ed46 <.LBB14_13>: + 8000ed46: 0001b517 auipc a0,0x1b + 8000ed4a: 8da50513 addi a0,a0,-1830 # 80029620 + +000000008000ed4e <.LBB14_14>: + 8000ed4e: 0001b617 auipc a2,0x1b + 8000ed52: 8ba60613 addi a2,a2,-1862 # 80029608 <.L__unnamed_35> + 8000ed56: 02100593 li a1,33 + 8000ed5a: 00014097 auipc ra,0x14 + 8000ed5e: 3ea080e7 jalr 1002(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008000ed64 <.LBB14_15>: + 8000ed64: 0001b517 auipc a0,0x1b + 8000ed68: 8fc50513 addi a0,a0,-1796 # 80029660 + +000000008000ed6c <.LBB14_16>: + 8000ed6c: 0001b617 auipc a2,0x1b + 8000ed70: 8dc60613 addi a2,a2,-1828 # 80029648 <.L__unnamed_36> + 8000ed74: 02100593 li a1,33 + 8000ed78: 00014097 auipc ra,0x14 + 8000ed7c: 3cc080e7 jalr 972(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core5clone5Clone10clone_from17h2b52fdc155b58fc3E: + +000000008000ed82 <_ZN4core5clone5Clone10clone_from17h2b52fdc155b58fc3E>: + fn clone_from(&mut self, source: &Self) { + 8000ed82: cc010113 addi sp,sp,-832 + 8000ed86: 32113c23 sd ra,824(sp) + 8000ed8a: e02a sd a0,0(sp) + 8000ed8c: 32a13423 sd a0,808(sp) + 8000ed90: 32b13823 sd a1,816(sp) + 8000ed94: 0028 addi a0,sp,8 + *self = source.clone() + 8000ed96: ffff8097 auipc ra,0xffff8 + 8000ed9a: 4e6080e7 jalr 1254(ra) # 8000727c <_ZN4core5clone5Clone5clone17h31f6bbc7b19c5f8bE> + 8000ed9e: a009 j 8000eda0 <_ZN4core5clone5Clone10clone_from17h2b52fdc155b58fc3E+0x1e> + 8000eda0: 6502 ld a0,0(sp) + 8000eda2: ffff8097 auipc ra,0xffff8 + 8000eda6: 1ce080e7 jalr 462(ra) # 80006f70 <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E> + 8000edaa: a009 j 8000edac <_ZN4core5clone5Clone10clone_from17h2b52fdc155b58fc3E+0x2a> + 8000edac: 6502 ld a0,0(sp) + 8000edae: 002c addi a1,sp,8 + 8000edb0: 32000613 li a2,800 + 8000edb4: 00017097 auipc ra,0x17 + 8000edb8: 2ce080e7 jalr 718(ra) # 80026082 + } + 8000edbc: 33813083 ld ra,824(sp) + 8000edc0: 34010113 addi sp,sp,832 + 8000edc4: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h659c29622d59b861E: + +000000008000edc6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h659c29622d59b861E>: + pub const fn len(&self) -> usize { + 8000edc6: 7179 addi sp,sp,-48 + 8000edc8: e42e sd a1,8(sp) + 8000edca: 85aa mv a1,a0 + 8000edcc: 6522 ld a0,8(sp) + 8000edce: f02e sd a1,32(sp) + 8000edd0: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 8000edd2: e82e sd a1,16(sp) + 8000edd4: ec2a sd a0,24(sp) + } + 8000edd6: 6145 addi sp,sp,48 + 8000edd8: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E: + +000000008000edda <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E>: + /// + /// assert_eq!(maybe_some_len, Some(13)); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + pub fn map U>(self, f: F) -> Option { + 8000edda: 7179 addi sp,sp,-48 + 8000eddc: f406 sd ra,40(sp) + 8000edde: c42a sw a0,8(sp) + 8000ede0: c62e sw a1,12(sp) + 8000ede2: 4585 li a1,1 + match self { + Some(x) => Some(f(x)), + 8000ede4: 00b10fa3 sb a1,31(sp) + 8000ede8: 1502 slli a0,a0,0x20 + 8000edea: 9101 srli a0,a0,0x20 + 8000edec: 4581 li a1,0 + 8000edee: 00b50463 beq a0,a1,8000edf6 <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x1c> + 8000edf2: a009 j 8000edf4 <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x1a> + 8000edf4: a031 j 8000ee00 <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x26> + 8000edf6: 00110537 lui a0,0x110 + None => None, + 8000edfa: ca2a sw a0,20(sp) + match self { + 8000edfc: a805 j 8000ee2c <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x52> + 8000edfe: 0000 unimp + Some(x) => Some(f(x)), + 8000ee00: 4532 lw a0,12(sp) + 8000ee02: d22a sw a0,36(sp) + 8000ee04: 4581 li a1,0 + 8000ee06: 00b10fa3 sb a1,31(sp) + 8000ee0a: cc2a sw a0,24(sp) + 8000ee0c: 00010097 auipc ra,0x10 + 8000ee10: ee0080e7 jalr -288(ra) # 8001ecec <_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next28_$u7b$$u7b$closure$u7d$$u7d$17ha7c7da80d3c0bdbeE> + 8000ee14: 1502 slli a0,a0,0x20 + 8000ee16: 9101 srli a0,a0,0x20 + 8000ee18: e02a sd a0,0(sp) + 8000ee1a: a009 j 8000ee1c <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x42> + 8000ee1c: 6502 ld a0,0(sp) + 8000ee1e: ca2a sw a0,20(sp) + } + } + 8000ee20: a031 j 8000ee2c <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x52> + 8000ee22: 4552 lw a0,20(sp) + 8000ee24: 70a2 ld ra,40(sp) + 8000ee26: 6145 addi sp,sp,48 + 8000ee28: 8082 ret + 8000ee2a: bfe5 j 8000ee22 <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x48> + 8000ee2c: 01f14503 lbu a0,31(sp) + 8000ee30: 8905 andi a0,a0,1 + 8000ee32: fd65 bnez a0,8000ee2a <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x50> + 8000ee34: b7fd j 8000ee22 <_ZN4core6option15Option$LT$T$GT$3map17h2838ee6761cb3f47E+0x48> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E: + +000000008000ee36 <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E>: + pub fn map U>(self, f: F) -> Option { + 8000ee36: 7139 addi sp,sp,-64 + 8000ee38: fc06 sd ra,56(sp) + 8000ee3a: e02e sd a1,0(sp) + 8000ee3c: e42a sd a0,8(sp) + 8000ee3e: f42e sd a1,40(sp) + 8000ee40: 4585 li a1,1 + Some(x) => Some(f(x)), + 8000ee42: 02b103a3 sb a1,39(sp) + 8000ee46: 00a035b3 snez a1,a0 + 8000ee4a: 4581 li a1,0 + 8000ee4c: 00b50463 beq a0,a1,8000ee54 <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x1e> + 8000ee50: a009 j 8000ee52 <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x1c> + 8000ee52: a031 j 8000ee5e <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x28> + 8000ee54: 4501 li a0,0 + None => None, + 8000ee56: 00a10ba3 sb a0,23(sp) + match self { + 8000ee5a: a805 j 8000ee8a <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x54> + 8000ee5c: 0000 unimp + Some(x) => Some(f(x)), + 8000ee5e: 6502 ld a0,0(sp) + 8000ee60: 65a2 ld a1,8(sp) + 8000ee62: f82e sd a1,48(sp) + 8000ee64: 4601 li a2,0 + 8000ee66: 02c103a3 sb a2,39(sp) + 8000ee6a: ec2e sd a1,24(sp) + 8000ee6c: ffff7097 auipc ra,0xffff7 + 8000ee70: 990080e7 jalr -1648(ra) # 800057fc <_ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h09361c1327a61982E> + 8000ee74: a009 j 8000ee76 <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x40> + 8000ee76: 4505 li a0,1 + 8000ee78: 00a10ba3 sb a0,23(sp) + } + 8000ee7c: a039 j 8000ee8a <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x54> + 8000ee7e: 01714503 lbu a0,23(sp) + 8000ee82: 70e2 ld ra,56(sp) + 8000ee84: 6121 addi sp,sp,64 + 8000ee86: 8082 ret + 8000ee88: bfdd j 8000ee7e <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x48> + 8000ee8a: 02714503 lbu a0,39(sp) + 8000ee8e: 8905 andi a0,a0,1 + 8000ee90: fd65 bnez a0,8000ee88 <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x52> + 8000ee92: b7f5 j 8000ee7e <_ZN4core6option15Option$LT$T$GT$3map17ha9a8f16b0aa2a3f1E+0x48> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE: + +000000008000ee94 <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE>: + pub fn map U>(self, f: F) -> Option { + 8000ee94: 7139 addi sp,sp,-64 + 8000ee96: fc06 sd ra,56(sp) + 8000ee98: e42a sd a0,8(sp) + 8000ee9a: 4585 li a1,1 + Some(x) => Some(f(x)), + 8000ee9c: 02b103a3 sb a1,39(sp) + 8000eea0: 00a035b3 snez a1,a0 + 8000eea4: 4581 li a1,0 + 8000eea6: 00b50463 beq a0,a1,8000eeae <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x1a> + 8000eeaa: a009 j 8000eeac <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x18> + 8000eeac: a031 j 8000eeb8 <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x24> + 8000eeae: 4501 li a0,0 + None => None, + 8000eeb0: 00a10823 sb a0,16(sp) + match self { + 8000eeb4: a82d j 8000eeee <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x5a> + 8000eeb6: 0000 unimp + Some(x) => Some(f(x)), + 8000eeb8: 6522 ld a0,8(sp) + 8000eeba: f82a sd a0,48(sp) + 8000eebc: 4581 li a1,0 + 8000eebe: 02b103a3 sb a1,39(sp) + 8000eec2: ec2a sd a0,24(sp) + 8000eec4: 00001097 auipc ra,0x1 + 8000eec8: afe080e7 jalr -1282(ra) # 8000f9c2 <_ZN4core6option19Option$LT$$RF$T$GT$6copied28_$u7b$$u7b$closure$u7d$$u7d$17ha236d2efbe19b7e0E> + 8000eecc: e02a sd a0,0(sp) + 8000eece: a009 j 8000eed0 <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x3c> + 8000eed0: 6502 ld a0,0(sp) + 8000eed2: 00a108a3 sb a0,17(sp) + 8000eed6: 4505 li a0,1 + 8000eed8: 00a10823 sb a0,16(sp) + } + 8000eedc: a809 j 8000eeee <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x5a> + 8000eede: 01014503 lbu a0,16(sp) + 8000eee2: 01110583 lb a1,17(sp) + 8000eee6: 70e2 ld ra,56(sp) + 8000eee8: 6121 addi sp,sp,64 + 8000eeea: 8082 ret + 8000eeec: bfcd j 8000eede <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x4a> + 8000eeee: 02714503 lbu a0,39(sp) + 8000eef2: 8905 andi a0,a0,1 + 8000eef4: fd65 bnez a0,8000eeec <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x58> + 8000eef6: b7e5 j 8000eede <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE+0x4a> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E: + +000000008000eef8 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E>: + pub fn map U>(self, f: F) -> Option { + 8000eef8: 7139 addi sp,sp,-64 + 8000eefa: fc06 sd ra,56(sp) + 8000eefc: e02e sd a1,0(sp) + 8000eefe: e42a sd a0,8(sp) + 8000ef00: f42e sd a1,40(sp) + 8000ef02: 4585 li a1,1 + Some(x) => Some(f(x)), + 8000ef04: 02b103a3 sb a1,39(sp) + 8000ef08: 00a035b3 snez a1,a0 + 8000ef0c: 4581 li a1,0 + 8000ef0e: 00b50463 beq a0,a1,8000ef16 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x1e> + 8000ef12: a009 j 8000ef14 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x1c> + 8000ef14: a031 j 8000ef20 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x28> + 8000ef16: 4501 li a0,0 + None => None, + 8000ef18: 00a10ba3 sb a0,23(sp) + match self { + 8000ef1c: a805 j 8000ef4c <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x54> + 8000ef1e: 0000 unimp + Some(x) => Some(f(x)), + 8000ef20: 6502 ld a0,0(sp) + 8000ef22: 65a2 ld a1,8(sp) + 8000ef24: f82e sd a1,48(sp) + 8000ef26: 4601 li a2,0 + 8000ef28: 02c103a3 sb a2,39(sp) + 8000ef2c: ec2e sd a1,24(sp) + 8000ef2e: ffff7097 auipc ra,0xffff7 + 8000ef32: 8de080e7 jalr -1826(ra) # 8000580c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h0a4afebccbc6cf13E> + 8000ef36: a009 j 8000ef38 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x40> + 8000ef38: 4505 li a0,1 + 8000ef3a: 00a10ba3 sb a0,23(sp) + } + 8000ef3e: a039 j 8000ef4c <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x54> + 8000ef40: 01714503 lbu a0,23(sp) + 8000ef44: 70e2 ld ra,56(sp) + 8000ef46: 6121 addi sp,sp,64 + 8000ef48: 8082 ret + 8000ef4a: bfdd j 8000ef40 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x48> + 8000ef4c: 02714503 lbu a0,39(sp) + 8000ef50: 8905 andi a0,a0,1 + 8000ef52: fd65 bnez a0,8000ef4a <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x52> + 8000ef54: b7f5 j 8000ef40 <_ZN4core6option15Option$LT$T$GT$3map17hd4472e66f8c522f7E+0x48> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E: + +000000008000ef56 <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E>: + pub fn map U>(self, f: F) -> Option { + 8000ef56: 7139 addi sp,sp,-64 + 8000ef58: fc06 sd ra,56(sp) + 8000ef5a: e02e sd a1,0(sp) + 8000ef5c: e42a sd a0,8(sp) + 8000ef5e: f42e sd a1,40(sp) + 8000ef60: 4585 li a1,1 + Some(x) => Some(f(x)), + 8000ef62: 02b103a3 sb a1,39(sp) + 8000ef66: 00a035b3 snez a1,a0 + 8000ef6a: 4581 li a1,0 + 8000ef6c: 00b50463 beq a0,a1,8000ef74 <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x1e> + 8000ef70: a009 j 8000ef72 <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x1c> + 8000ef72: a031 j 8000ef7e <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x28> + 8000ef74: 4501 li a0,0 + None => None, + 8000ef76: 00a10ba3 sb a0,23(sp) + match self { + 8000ef7a: a805 j 8000efaa <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x54> + 8000ef7c: 0000 unimp + Some(x) => Some(f(x)), + 8000ef7e: 6502 ld a0,0(sp) + 8000ef80: 65a2 ld a1,8(sp) + 8000ef82: f82e sd a1,48(sp) + 8000ef84: 4601 li a2,0 + 8000ef86: 02c103a3 sb a2,39(sp) + 8000ef8a: ec2e sd a1,24(sp) + 8000ef8c: ffff7097 auipc ra,0xffff7 + 8000ef90: 890080e7 jalr -1904(ra) # 8000581c <_ZN6kernel2fs3bio6BufLru14move_if_no_ref28_$u7b$$u7b$closure$u7d$$u7d$17h304675452a5a98dfE> + 8000ef94: a009 j 8000ef96 <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x40> + 8000ef96: 4505 li a0,1 + 8000ef98: 00a10ba3 sb a0,23(sp) + } + 8000ef9c: a039 j 8000efaa <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x54> + 8000ef9e: 01714503 lbu a0,23(sp) + 8000efa2: 70e2 ld ra,56(sp) + 8000efa4: 6121 addi sp,sp,64 + 8000efa6: 8082 ret + 8000efa8: bfdd j 8000ef9e <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x48> + 8000efaa: 02714503 lbu a0,39(sp) + 8000efae: 8905 andi a0,a0,1 + 8000efb0: fd65 bnez a0,8000efa8 <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x52> + 8000efb2: b7f5 j 8000ef9e <_ZN4core6option15Option$LT$T$GT$3map17hf813a527d3b93241E+0x48> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$4take17h2bb26f7cfbd48ae3E: + +000000008000efb4 <_ZN4core6option15Option$LT$T$GT$4take17h2bb26f7cfbd48ae3E>: + /// assert_eq!(x, None); + /// assert_eq!(y, None); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + pub fn take(&mut self) -> Option { + 8000efb4: 1101 addi sp,sp,-32 + 8000efb6: ec06 sd ra,24(sp) + 8000efb8: e82a sd a0,16(sp) + mem::take(self) + 8000efba: 0000f097 auipc ra,0xf + 8000efbe: f9a080e7 jalr -102(ra) # 8001df54 <_ZN4core3mem4take17h5215bf07db4a9cdbE> + 8000efc2: e42a sd a0,8(sp) + 8000efc4: a009 j 8000efc6 <_ZN4core6option15Option$LT$T$GT$4take17h2bb26f7cfbd48ae3E+0x12> + } + 8000efc6: 6522 ld a0,8(sp) + 8000efc8: 60e2 ld ra,24(sp) + 8000efca: 6105 addi sp,sp,32 + 8000efcc: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$4take17h3f0477f04f3bf4c3E: + +000000008000efce <_ZN4core6option15Option$LT$T$GT$4take17h3f0477f04f3bf4c3E>: + pub fn take(&mut self) -> Option { + 8000efce: 1101 addi sp,sp,-32 + 8000efd0: ec06 sd ra,24(sp) + 8000efd2: e82a sd a0,16(sp) + mem::take(self) + 8000efd4: 0000f097 auipc ra,0xf + 8000efd8: 00c080e7 jalr 12(ra) # 8001dfe0 <_ZN4core3mem4take17ha8b178c6c6bab41fE> + 8000efdc: e02a sd a0,0(sp) + 8000efde: e42e sd a1,8(sp) + 8000efe0: a009 j 8000efe2 <_ZN4core6option15Option$LT$T$GT$4take17h3f0477f04f3bf4c3E+0x14> + } + 8000efe2: 65a2 ld a1,8(sp) + 8000efe4: 6502 ld a0,0(sp) + 8000efe6: 60e2 ld ra,24(sp) + 8000efe8: 6105 addi sp,sp,32 + 8000efea: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$4take17h80340c04cecd09beE: + +000000008000efec <_ZN4core6option15Option$LT$T$GT$4take17h80340c04cecd09beE>: + pub fn take(&mut self) -> Option { + 8000efec: 1101 addi sp,sp,-32 + 8000efee: ec06 sd ra,24(sp) + 8000eff0: e82a sd a0,16(sp) + mem::take(self) + 8000eff2: 0000f097 auipc ra,0xf + 8000eff6: fba080e7 jalr -70(ra) # 8001dfac <_ZN4core3mem4take17ha20fa5de2e41ca09E> + 8000effa: e02a sd a0,0(sp) + 8000effc: e42e sd a1,8(sp) + 8000effe: a009 j 8000f000 <_ZN4core6option15Option$LT$T$GT$4take17h80340c04cecd09beE+0x14> + } + 8000f000: 65a2 ld a1,8(sp) + 8000f002: 6502 ld a0,0(sp) + 8000f004: 60e2 ld ra,24(sp) + 8000f006: 6105 addi sp,sp,32 + 8000f008: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E: + +000000008000f00a <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E>: + pub fn take(&mut self) -> Option { + 8000f00a: 1101 addi sp,sp,-32 + 8000f00c: ec06 sd ra,24(sp) + 8000f00e: e82a sd a0,16(sp) + mem::take(self) + 8000f010: 0000f097 auipc ra,0xf + 8000f014: f70080e7 jalr -144(ra) # 8001df80 <_ZN4core3mem4take17h9920b9ae1a5c3368E> + 8000f018: e42a sd a0,8(sp) + 8000f01a: a009 j 8000f01c <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E+0x12> + } + 8000f01c: 6522 ld a0,8(sp) + 8000f01e: 60e2 ld ra,24(sp) + 8000f020: 6105 addi sp,sp,32 + 8000f022: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E: + +000000008000f024 <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E>: + pub fn ok_or(self, err: E) -> Result { + 8000f024: 7179 addi sp,sp,-48 + 8000f026: e42a sd a0,8(sp) + 8000f028: 4585 li a1,1 + Some(v) => Ok(v), + 8000f02a: 00b10fa3 sb a1,31(sp) + 8000f02e: 00a035b3 snez a1,a0 + 8000f032: 4581 li a1,0 + 8000f034: 00b50463 beq a0,a1,8000f03c <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x18> + 8000f038: a009 j 8000f03a <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x16> + 8000f03a: a039 j 8000f048 <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x24> + 8000f03c: 4501 li a0,0 + None => Err(err), + 8000f03e: 00a10fa3 sb a0,31(sp) + 8000f042: e82a sd a0,16(sp) + match self { + 8000f044: a031 j 8000f050 <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x2c> + 8000f046: 0000 unimp + Some(v) => Ok(v), + 8000f048: 6522 ld a0,8(sp) + 8000f04a: f42a sd a0,40(sp) + 8000f04c: e82a sd a0,16(sp) + match self { + 8000f04e: a009 j 8000f050 <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x2c> + } + 8000f050: 01f14503 lbu a0,31(sp) + 8000f054: 8905 andi a0,a0,1 + 8000f056: e509 bnez a0,8000f060 <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x3c> + 8000f058: a009 j 8000f05a <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x36> + 8000f05a: 6542 ld a0,16(sp) + 8000f05c: 6145 addi sp,sp,48 + 8000f05e: 8082 ret + 8000f060: bfed j 8000f05a <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E+0x36> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E: + +000000008000f062 <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E>: + pub fn ok_or(self, err: E) -> Result { + 8000f062: 7179 addi sp,sp,-48 + 8000f064: e42a sd a0,8(sp) + 8000f066: 4585 li a1,1 + Some(v) => Ok(v), + 8000f068: 00b10fa3 sb a1,31(sp) + 8000f06c: 00a035b3 snez a1,a0 + 8000f070: 4581 li a1,0 + 8000f072: 00b50463 beq a0,a1,8000f07a <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x18> + 8000f076: a009 j 8000f078 <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x16> + 8000f078: a039 j 8000f086 <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x24> + 8000f07a: 4501 li a0,0 + None => Err(err), + 8000f07c: 00a10fa3 sb a0,31(sp) + 8000f080: e82a sd a0,16(sp) + match self { + 8000f082: a031 j 8000f08e <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x2c> + 8000f084: 0000 unimp + Some(v) => Ok(v), + 8000f086: 6522 ld a0,8(sp) + 8000f088: f42a sd a0,40(sp) + 8000f08a: e82a sd a0,16(sp) + match self { + 8000f08c: a009 j 8000f08e <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x2c> + } + 8000f08e: 01f14503 lbu a0,31(sp) + 8000f092: 8905 andi a0,a0,1 + 8000f094: e509 bnez a0,8000f09e <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x3c> + 8000f096: a009 j 8000f098 <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x36> + 8000f098: 6542 ld a0,16(sp) + 8000f09a: 6145 addi sp,sp,48 + 8000f09c: 8082 ret + 8000f09e: bfed j 8000f098 <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E+0x36> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E: + +000000008000f0a0 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E>: + pub fn ok_or(self, err: E) -> Result { + 8000f0a0: 715d addi sp,sp,-80 + 8000f0a2: e43a sd a4,8(sp) + 8000f0a4: e836 sd a3,16(sp) + 8000f0a6: ec2a sd a0,24(sp) + 8000f0a8: f02e sd a1,32(sp) + 8000f0aa: f432 sd a2,40(sp) + 8000f0ac: fc36 sd a3,56(sp) + 8000f0ae: e0ba sd a4,64(sp) + 8000f0b0: 4505 li a0,1 + Some(v) => Ok(v), + 8000f0b2: 02a10ba3 sb a0,55(sp) + 8000f0b6: 4501 li a0,0 + 8000f0b8: 00a58463 beq a1,a0,8000f0c0 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x20> + 8000f0bc: a009 j 8000f0be <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x1e> + 8000f0be: a829 j 8000f0d8 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x38> + 8000f0c0: 65e2 ld a1,24(sp) + 8000f0c2: 6522 ld a0,8(sp) + 8000f0c4: 6642 ld a2,16(sp) + 8000f0c6: 4681 li a3,0 + None => Err(err), + 8000f0c8: 02d10ba3 sb a3,55(sp) + 8000f0cc: e590 sd a2,8(a1) + 8000f0ce: e988 sd a0,16(a1) + 8000f0d0: 4505 li a0,1 + 8000f0d2: e188 sd a0,0(a1) + match self { + 8000f0d4: a809 j 8000f0e6 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x46> + 8000f0d6: 0000 unimp + Some(v) => Ok(v), + 8000f0d8: 65e2 ld a1,24(sp) + 8000f0da: 7522 ld a0,40(sp) + 8000f0dc: e4aa sd a0,72(sp) + 8000f0de: e588 sd a0,8(a1) + 8000f0e0: 4501 li a0,0 + 8000f0e2: e188 sd a0,0(a1) + match self { + 8000f0e4: a009 j 8000f0e6 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x46> + } + 8000f0e6: 03714503 lbu a0,55(sp) + 8000f0ea: 8905 andi a0,a0,1 + 8000f0ec: e501 bnez a0,8000f0f4 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x54> + 8000f0ee: a009 j 8000f0f0 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x50> + 8000f0f0: 6161 addi sp,sp,80 + 8000f0f2: 8082 ret + 8000f0f4: bff5 j 8000f0f0 <_ZN4core6option15Option$LT$T$GT$5ok_or17h436768d7af37ca52E+0x50> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE: + +000000008000f0f6 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE>: + pub fn ok_or(self, err: E) -> Result { + 8000f0f6: 7139 addi sp,sp,-64 + 8000f0f8: e036 sd a3,0(sp) + 8000f0fa: e432 sd a2,8(sp) + 8000f0fc: e82a sd a0,16(sp) + 8000f0fe: ec2e sd a1,24(sp) + 8000f100: f432 sd a2,40(sp) + 8000f102: f836 sd a3,48(sp) + 8000f104: 4505 li a0,1 + Some(v) => Ok(v), + 8000f106: 02a103a3 sb a0,39(sp) + 8000f10a: 00b03533 snez a0,a1 + 8000f10e: 4501 li a0,0 + 8000f110: 00a58463 beq a1,a0,8000f118 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x22> + 8000f114: a009 j 8000f116 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x20> + 8000f116: a829 j 8000f130 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x3a> + 8000f118: 65c2 ld a1,16(sp) + 8000f11a: 6502 ld a0,0(sp) + 8000f11c: 6622 ld a2,8(sp) + 8000f11e: 4681 li a3,0 + None => Err(err), + 8000f120: 02d103a3 sb a3,39(sp) + 8000f124: e590 sd a2,8(a1) + 8000f126: e988 sd a0,16(a1) + 8000f128: 4505 li a0,1 + 8000f12a: e188 sd a0,0(a1) + match self { + 8000f12c: a809 j 8000f13e <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x48> + 8000f12e: 0000 unimp + Some(v) => Ok(v), + 8000f130: 65c2 ld a1,16(sp) + 8000f132: 6562 ld a0,24(sp) + 8000f134: fc2a sd a0,56(sp) + 8000f136: e588 sd a0,8(a1) + 8000f138: 4501 li a0,0 + 8000f13a: e188 sd a0,0(a1) + match self { + 8000f13c: a009 j 8000f13e <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x48> + } + 8000f13e: 02714503 lbu a0,39(sp) + 8000f142: 8905 andi a0,a0,1 + 8000f144: e501 bnez a0,8000f14c <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x56> + 8000f146: a009 j 8000f148 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x52> + 8000f148: 6121 addi sp,sp,64 + 8000f14a: 8082 ret + 8000f14c: bff5 j 8000f148 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE+0x52> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE: + +000000008000f14e <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE>: + pub fn ok_or(self, err: E) -> Result { + 8000f14e: 7139 addi sp,sp,-64 + 8000f150: e42a sd a0,8(sp) + 8000f152: e82e sd a1,16(sp) + 8000f154: 4585 li a1,1 + Some(v) => Ok(v), + 8000f156: 02b107a3 sb a1,47(sp) + 8000f15a: 4581 li a1,0 + 8000f15c: 00b50463 beq a0,a1,8000f164 <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x16> + 8000f160: a009 j 8000f162 <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x14> + 8000f162: a801 j 8000f172 <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x24> + 8000f164: 4501 li a0,0 + None => Err(err), + 8000f166: 02a107a3 sb a0,47(sp) + 8000f16a: 4505 li a0,1 + 8000f16c: ec2a sd a0,24(sp) + match self { + 8000f16e: a801 j 8000f17e <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x30> + 8000f170: 0000 unimp + Some(v) => Ok(v), + 8000f172: 6542 ld a0,16(sp) + 8000f174: fc2a sd a0,56(sp) + 8000f176: f02a sd a0,32(sp) + 8000f178: 4501 li a0,0 + 8000f17a: ec2a sd a0,24(sp) + match self { + 8000f17c: a009 j 8000f17e <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x30> + } + 8000f17e: 02f14503 lbu a0,47(sp) + 8000f182: 8905 andi a0,a0,1 + 8000f184: e511 bnez a0,8000f190 <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x42> + 8000f186: a009 j 8000f188 <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x3a> + 8000f188: 6562 ld a0,24(sp) + 8000f18a: 7582 ld a1,32(sp) + 8000f18c: 6121 addi sp,sp,64 + 8000f18e: 8082 ret + 8000f190: bfe5 j 8000f188 <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE+0x3a> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E: + +000000008000f192 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E>: + pub fn ok_or(self, err: E) -> Result { + 8000f192: 715d addi sp,sp,-80 + 8000f194: e43a sd a4,8(sp) + 8000f196: e836 sd a3,16(sp) + 8000f198: ec2a sd a0,24(sp) + 8000f19a: f02e sd a1,32(sp) + 8000f19c: f432 sd a2,40(sp) + 8000f19e: fc36 sd a3,56(sp) + 8000f1a0: e0ba sd a4,64(sp) + 8000f1a2: 4505 li a0,1 + Some(v) => Ok(v), + 8000f1a4: 02a10ba3 sb a0,55(sp) + 8000f1a8: 4501 li a0,0 + 8000f1aa: 00a58463 beq a1,a0,8000f1b2 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x20> + 8000f1ae: a009 j 8000f1b0 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x1e> + 8000f1b0: a829 j 8000f1ca <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x38> + 8000f1b2: 65e2 ld a1,24(sp) + 8000f1b4: 6522 ld a0,8(sp) + 8000f1b6: 6642 ld a2,16(sp) + 8000f1b8: 4681 li a3,0 + None => Err(err), + 8000f1ba: 02d10ba3 sb a3,55(sp) + 8000f1be: e590 sd a2,8(a1) + 8000f1c0: e988 sd a0,16(a1) + 8000f1c2: 4505 li a0,1 + 8000f1c4: e188 sd a0,0(a1) + match self { + 8000f1c6: a809 j 8000f1d8 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x46> + 8000f1c8: 0000 unimp + Some(v) => Ok(v), + 8000f1ca: 65e2 ld a1,24(sp) + 8000f1cc: 7522 ld a0,40(sp) + 8000f1ce: e4aa sd a0,72(sp) + 8000f1d0: e588 sd a0,8(a1) + 8000f1d2: 4501 li a0,0 + 8000f1d4: e188 sd a0,0(a1) + match self { + 8000f1d6: a009 j 8000f1d8 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x46> + } + 8000f1d8: 03714503 lbu a0,55(sp) + 8000f1dc: 8905 andi a0,a0,1 + 8000f1de: e501 bnez a0,8000f1e6 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x54> + 8000f1e0: a009 j 8000f1e2 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x50> + 8000f1e2: 6161 addi sp,sp,80 + 8000f1e4: 8082 ret + 8000f1e6: bff5 j 8000f1e2 <_ZN4core6option15Option$LT$T$GT$5ok_or17h7a4d5ef4770297f6E+0x50> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E: + +000000008000f1e8 <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E>: + pub fn ok_or(self, err: E) -> Result { + 8000f1e8: 7179 addi sp,sp,-48 + 8000f1ea: e42a sd a0,8(sp) + 8000f1ec: 4585 li a1,1 + Some(v) => Ok(v), + 8000f1ee: 00b10fa3 sb a1,31(sp) + 8000f1f2: 00a035b3 snez a1,a0 + 8000f1f6: 4581 li a1,0 + 8000f1f8: 00b50463 beq a0,a1,8000f200 <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x18> + 8000f1fc: a009 j 8000f1fe <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x16> + 8000f1fe: a039 j 8000f20c <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x24> + 8000f200: 4501 li a0,0 + None => Err(err), + 8000f202: 00a10fa3 sb a0,31(sp) + 8000f206: e82a sd a0,16(sp) + match self { + 8000f208: a031 j 8000f214 <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x2c> + 8000f20a: 0000 unimp + Some(v) => Ok(v), + 8000f20c: 6522 ld a0,8(sp) + 8000f20e: f42a sd a0,40(sp) + 8000f210: e82a sd a0,16(sp) + match self { + 8000f212: a009 j 8000f214 <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x2c> + } + 8000f214: 01f14503 lbu a0,31(sp) + 8000f218: 8905 andi a0,a0,1 + 8000f21a: e509 bnez a0,8000f224 <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x3c> + 8000f21c: a009 j 8000f21e <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x36> + 8000f21e: 6542 ld a0,16(sp) + 8000f220: 6145 addi sp,sp,48 + 8000f222: 8082 ret + 8000f224: bfed j 8000f21e <_ZN4core6option15Option$LT$T$GT$5ok_or17h8c89aa4278cdb5d9E+0x36> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E: + +000000008000f226 <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E>: + pub fn ok_or(self, err: E) -> Result { + 8000f226: 7139 addi sp,sp,-64 + 8000f228: e03a sd a4,0(sp) + 8000f22a: e436 sd a3,8(sp) + 8000f22c: e82a sd a0,16(sp) + 8000f22e: cc2e sw a1,24(sp) + 8000f230: ce32 sw a2,28(sp) + 8000f232: f436 sd a3,40(sp) + 8000f234: f83a sd a4,48(sp) + 8000f236: 4505 li a0,1 + Some(v) => Ok(v), + 8000f238: 02a103a3 sb a0,39(sp) + 8000f23c: 02059513 slli a0,a1,0x20 + 8000f240: 9101 srli a0,a0,0x20 + 8000f242: 4581 li a1,0 + 8000f244: 00b50463 beq a0,a1,8000f24c <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x26> + 8000f248: a009 j 8000f24a <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x24> + 8000f24a: a829 j 8000f264 <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x3e> + 8000f24c: 65c2 ld a1,16(sp) + 8000f24e: 6502 ld a0,0(sp) + 8000f250: 6622 ld a2,8(sp) + 8000f252: 4681 li a3,0 + None => Err(err), + 8000f254: 02d103a3 sb a3,39(sp) + 8000f258: e590 sd a2,8(a1) + 8000f25a: e988 sd a0,16(a1) + 8000f25c: 4505 li a0,1 + 8000f25e: c188 sw a0,0(a1) + match self { + 8000f260: a809 j 8000f272 <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x4c> + 8000f262: 0000 unimp + Some(v) => Ok(v), + 8000f264: 65c2 ld a1,16(sp) + 8000f266: 4572 lw a0,28(sp) + 8000f268: de2a sw a0,60(sp) + 8000f26a: c1c8 sw a0,4(a1) + 8000f26c: 4501 li a0,0 + 8000f26e: c188 sw a0,0(a1) + match self { + 8000f270: a009 j 8000f272 <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x4c> + } + 8000f272: 02714503 lbu a0,39(sp) + 8000f276: 8905 andi a0,a0,1 + 8000f278: e501 bnez a0,8000f280 <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x5a> + 8000f27a: a009 j 8000f27c <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x56> + 8000f27c: 6121 addi sp,sp,64 + 8000f27e: 8082 ret + 8000f280: bff5 j 8000f27c <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E+0x56> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E: + +000000008000f282 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E>: + pub fn ok_or(self, err: E) -> Result { + 8000f282: 7179 addi sp,sp,-48 + 8000f284: e42a sd a0,8(sp) + 8000f286: 4585 li a1,1 + Some(v) => Ok(v), + 8000f288: 00b10fa3 sb a1,31(sp) + 8000f28c: 00a035b3 snez a1,a0 + 8000f290: 4581 li a1,0 + 8000f292: 00b50463 beq a0,a1,8000f29a <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x18> + 8000f296: a009 j 8000f298 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x16> + 8000f298: a039 j 8000f2a6 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x24> + 8000f29a: 4501 li a0,0 + None => Err(err), + 8000f29c: 00a10fa3 sb a0,31(sp) + 8000f2a0: e82a sd a0,16(sp) + match self { + 8000f2a2: a031 j 8000f2ae <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x2c> + 8000f2a4: 0000 unimp + Some(v) => Ok(v), + 8000f2a6: 6522 ld a0,8(sp) + 8000f2a8: f42a sd a0,40(sp) + 8000f2aa: e82a sd a0,16(sp) + match self { + 8000f2ac: a009 j 8000f2ae <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x2c> + } + 8000f2ae: 01f14503 lbu a0,31(sp) + 8000f2b2: 8905 andi a0,a0,1 + 8000f2b4: e509 bnez a0,8000f2be <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x3c> + 8000f2b6: a009 j 8000f2b8 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x36> + 8000f2b8: 6542 ld a0,16(sp) + 8000f2ba: 6145 addi sp,sp,48 + 8000f2bc: 8082 ret + 8000f2be: bfed j 8000f2b8 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E+0x36> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E: + +000000008000f2c0 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E>: + pub fn ok_or(self, err: E) -> Result { + 8000f2c0: 711d addi sp,sp,-96 + 8000f2c2: e436 sd a3,8(sp) + 8000f2c4: e832 sd a2,16(sp) + 8000f2c6: ec2e sd a1,24(sp) + 8000f2c8: f02a sd a0,32(sp) + 8000f2ca: e8b2 sd a2,80(sp) + 8000f2cc: ecb6 sd a3,88(sp) + 8000f2ce: 4505 li a0,1 + Some(v) => Ok(v), + 8000f2d0: 04a107a3 sb a0,79(sp) + 8000f2d4: 6188 ld a0,0(a1) + 8000f2d6: 4581 li a1,0 + 8000f2d8: 00b50463 beq a0,a1,8000f2e0 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x20> + 8000f2dc: a009 j 8000f2de <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x1e> + 8000f2de: a829 j 8000f2f8 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x38> + 8000f2e0: 7582 ld a1,32(sp) + 8000f2e2: 6522 ld a0,8(sp) + 8000f2e4: 6642 ld a2,16(sp) + 8000f2e6: 4681 li a3,0 + None => Err(err), + 8000f2e8: 04d107a3 sb a3,79(sp) + 8000f2ec: e590 sd a2,8(a1) + 8000f2ee: e988 sd a0,16(a1) + 8000f2f0: 4505 li a0,1 + 8000f2f2: e188 sd a0,0(a1) + match self { + 8000f2f4: a839 j 8000f312 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x52> + 8000f2f6: 0000 unimp + Some(v) => Ok(v), + 8000f2f8: 7582 ld a1,32(sp) + 8000f2fa: 6662 ld a2,24(sp) + 8000f2fc: 6608 ld a0,8(a2) + 8000f2fe: f42a sd a0,40(sp) + 8000f300: 6a10 ld a2,16(a2) + 8000f302: f832 sd a2,48(sp) + 8000f304: e0b2 sd a2,64(sp) + 8000f306: fc2a sd a0,56(sp) + 8000f308: e990 sd a2,16(a1) + 8000f30a: e588 sd a0,8(a1) + 8000f30c: 4501 li a0,0 + 8000f30e: e188 sd a0,0(a1) + match self { + 8000f310: a009 j 8000f312 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x52> + } + 8000f312: 04f14503 lbu a0,79(sp) + 8000f316: 8905 andi a0,a0,1 + 8000f318: e501 bnez a0,8000f320 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x60> + 8000f31a: a009 j 8000f31c <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x5c> + 8000f31c: 6125 addi sp,sp,96 + 8000f31e: 8082 ret + 8000f320: bff5 j 8000f31c <_ZN4core6option15Option$LT$T$GT$5ok_or17hfc73591acc2890d8E+0x5c> + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E: + +000000008000f322 <_ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E>: + pub fn as_mut(&mut self) -> Option<&mut T> { + 8000f322: 1101 addi sp,sp,-32 + 8000f324: e02a sd a0,0(sp) + 8000f326: e82a sd a0,16(sp) + Some(ref mut x) => Some(x), + 8000f328: 6108 ld a0,0(a0) + 8000f32a: 00a035b3 snez a1,a0 + 8000f32e: 4581 li a1,0 + 8000f330: 00b50463 beq a0,a1,8000f338 <_ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E+0x16> + 8000f334: a009 j 8000f336 <_ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E+0x14> + 8000f336: a029 j 8000f340 <_ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E+0x1e> + 8000f338: 4501 li a0,0 + None => None, + 8000f33a: e42a sd a0,8(sp) + match *self { + 8000f33c: a031 j 8000f348 <_ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E+0x26> + 8000f33e: 0000 unimp + Some(ref mut x) => Some(x), + 8000f340: 6502 ld a0,0(sp) + 8000f342: ec2a sd a0,24(sp) + 8000f344: e42a sd a0,8(sp) + match *self { + 8000f346: a009 j 8000f348 <_ZN4core6option15Option$LT$T$GT$6as_mut17h3a38d82722b299a5E+0x26> + } + 8000f348: 6522 ld a0,8(sp) + 8000f34a: 6105 addi sp,sp,32 + 8000f34c: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE: + +000000008000f34e <_ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE>: + pub fn as_mut(&mut self) -> Option<&mut T> { + 8000f34e: 1101 addi sp,sp,-32 + 8000f350: e02a sd a0,0(sp) + 8000f352: e82a sd a0,16(sp) + Some(ref mut x) => Some(x), + 8000f354: 6108 ld a0,0(a0) + 8000f356: 4581 li a1,0 + 8000f358: 00b50463 beq a0,a1,8000f360 <_ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE+0x12> + 8000f35c: a009 j 8000f35e <_ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE+0x10> + 8000f35e: a029 j 8000f368 <_ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE+0x1a> + 8000f360: 4501 li a0,0 + None => None, + 8000f362: e42a sd a0,8(sp) + match *self { + 8000f364: a039 j 8000f372 <_ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE+0x24> + 8000f366: 0000 unimp + Some(ref mut x) => Some(x), + 8000f368: 6502 ld a0,0(sp) + 8000f36a: 0521 addi a0,a0,8 + 8000f36c: ec2a sd a0,24(sp) + 8000f36e: e42a sd a0,8(sp) + match *self { + 8000f370: a009 j 8000f372 <_ZN4core6option15Option$LT$T$GT$6as_mut17he7f8c9f3d27cdb5eE+0x24> + } + 8000f372: 6522 ld a0,8(sp) + 8000f374: 6105 addi sp,sp,32 + 8000f376: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E: + +000000008000f378 <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E>: + pub const fn as_ref(&self) -> Option<&T> { + 8000f378: 1101 addi sp,sp,-32 + 8000f37a: e02a sd a0,0(sp) + 8000f37c: e82a sd a0,16(sp) + Some(ref x) => Some(x), + 8000f37e: 6108 ld a0,0(a0) + 8000f380: 00a035b3 snez a1,a0 + 8000f384: 4581 li a1,0 + 8000f386: 00b50463 beq a0,a1,8000f38e <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E+0x16> + 8000f38a: a009 j 8000f38c <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E+0x14> + 8000f38c: a029 j 8000f396 <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E+0x1e> + 8000f38e: 4501 li a0,0 + None => None, + 8000f390: e42a sd a0,8(sp) + match *self { + 8000f392: a031 j 8000f39e <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E+0x26> + 8000f394: 0000 unimp + Some(ref x) => Some(x), + 8000f396: 6502 ld a0,0(sp) + 8000f398: ec2a sd a0,24(sp) + 8000f39a: e42a sd a0,8(sp) + match *self { + 8000f39c: a009 j 8000f39e <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E+0x26> + } + 8000f39e: 6522 ld a0,8(sp) + 8000f3a0: 6105 addi sp,sp,32 + 8000f3a2: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E: + +000000008000f3a4 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E>: + pub const fn as_ref(&self) -> Option<&T> { + 8000f3a4: 1101 addi sp,sp,-32 + 8000f3a6: e02a sd a0,0(sp) + 8000f3a8: e82a sd a0,16(sp) + Some(ref x) => Some(x), + 8000f3aa: 6108 ld a0,0(a0) + 8000f3ac: 4581 li a1,0 + 8000f3ae: 00b50463 beq a0,a1,8000f3b6 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E+0x12> + 8000f3b2: a009 j 8000f3b4 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E+0x10> + 8000f3b4: a029 j 8000f3be <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E+0x1a> + 8000f3b6: 4501 li a0,0 + None => None, + 8000f3b8: e42a sd a0,8(sp) + match *self { + 8000f3ba: a039 j 8000f3c8 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E+0x24> + 8000f3bc: 0000 unimp + Some(ref x) => Some(x), + 8000f3be: 6502 ld a0,0(sp) + 8000f3c0: 0521 addi a0,a0,8 + 8000f3c2: ec2a sd a0,24(sp) + 8000f3c4: e42a sd a0,8(sp) + match *self { + 8000f3c6: a009 j 8000f3c8 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E+0x24> + } + 8000f3c8: 6522 ld a0,8(sp) + 8000f3ca: 6105 addi sp,sp,32 + 8000f3cc: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E: + +000000008000f3ce <_ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E>: + pub const fn as_ref(&self) -> Option<&T> { + 8000f3ce: 1101 addi sp,sp,-32 + 8000f3d0: e02a sd a0,0(sp) + 8000f3d2: e82a sd a0,16(sp) + Some(ref x) => Some(x), + 8000f3d4: 6108 ld a0,0(a0) + 8000f3d6: 00a035b3 snez a1,a0 + 8000f3da: 4581 li a1,0 + 8000f3dc: 00b50463 beq a0,a1,8000f3e4 <_ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E+0x16> + 8000f3e0: a009 j 8000f3e2 <_ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E+0x14> + 8000f3e2: a029 j 8000f3ec <_ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E+0x1e> + 8000f3e4: 4501 li a0,0 + None => None, + 8000f3e6: e42a sd a0,8(sp) + match *self { + 8000f3e8: a031 j 8000f3f4 <_ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E+0x26> + 8000f3ea: 0000 unimp + Some(ref x) => Some(x), + 8000f3ec: 6502 ld a0,0(sp) + 8000f3ee: ec2a sd a0,24(sp) + 8000f3f0: e42a sd a0,8(sp) + match *self { + 8000f3f2: a009 j 8000f3f4 <_ZN4core6option15Option$LT$T$GT$6as_ref17hb04d778bad5fcb59E+0x26> + } + 8000f3f4: 6522 ld a0,8(sp) + 8000f3f6: 6105 addi sp,sp,32 + 8000f3f8: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE: + +000000008000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE>: + pub fn expect(self, msg: &str) -> T { + 8000f3fa: 7139 addi sp,sp,-64 + 8000f3fc: e436 sd a3,8(sp) + 8000f3fe: e832 sd a2,16(sp) + 8000f400: ec2e sd a1,24(sp) + 8000f402: f02a sd a0,32(sp) + 8000f404: f42e sd a1,40(sp) + 8000f406: f832 sd a2,48(sp) + Some(val) => val, + 8000f408: 00a035b3 snez a1,a0 + 8000f40c: 4581 li a1,0 + 8000f40e: 00b50463 beq a0,a1,8000f416 <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE+0x1c> + 8000f412: a009 j 8000f414 <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE+0x1a> + 8000f414: a811 j 8000f428 <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE+0x2e> + None => expect_failed(msg), + 8000f416: 6622 ld a2,8(sp) + 8000f418: 65c2 ld a1,16(sp) + 8000f41a: 6562 ld a0,24(sp) + 8000f41c: 00014097 auipc ra,0x14 + 8000f420: bec080e7 jalr -1044(ra) # 80023008 <_ZN4core6option13expect_failed17h0edd1e4bb5304a50E> + 8000f424: 0000 unimp + match self { + 8000f426: 0000 unimp + Some(val) => val, + 8000f428: 7502 ld a0,32(sp) + 8000f42a: fc2a sd a0,56(sp) + } + 8000f42c: 6121 addi sp,sp,64 + 8000f42e: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6expect17h263816fde9da1c25E: + +000000008000f430 <_ZN4core6option15Option$LT$T$GT$6expect17h263816fde9da1c25E>: + pub fn expect(self, msg: &str) -> T { + 8000f430: 7139 addi sp,sp,-64 + 8000f432: e03a sd a4,0(sp) + 8000f434: e436 sd a3,8(sp) + 8000f436: e832 sd a2,16(sp) + 8000f438: ec2a sd a0,24(sp) + 8000f43a: f02e sd a1,32(sp) + 8000f43c: f432 sd a2,40(sp) + 8000f43e: f836 sd a3,48(sp) + 8000f440: 4581 li a1,0 + Some(val) => val, + 8000f442: 00b50463 beq a0,a1,8000f44a <_ZN4core6option15Option$LT$T$GT$6expect17h263816fde9da1c25E+0x1a> + 8000f446: a009 j 8000f448 <_ZN4core6option15Option$LT$T$GT$6expect17h263816fde9da1c25E+0x18> + 8000f448: a811 j 8000f45c <_ZN4core6option15Option$LT$T$GT$6expect17h263816fde9da1c25E+0x2c> + None => expect_failed(msg), + 8000f44a: 6602 ld a2,0(sp) + 8000f44c: 65a2 ld a1,8(sp) + 8000f44e: 6542 ld a0,16(sp) + 8000f450: 00014097 auipc ra,0x14 + 8000f454: bb8080e7 jalr -1096(ra) # 80023008 <_ZN4core6option13expect_failed17h0edd1e4bb5304a50E> + 8000f458: 0000 unimp + match self { + 8000f45a: 0000 unimp + Some(val) => val, + 8000f45c: 7502 ld a0,32(sp) + 8000f45e: fc2a sd a0,56(sp) + } + 8000f460: 6121 addi sp,sp,64 + 8000f462: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6expect17h2ee3949cdbd95affE: + +000000008000f464 <_ZN4core6option15Option$LT$T$GT$6expect17h2ee3949cdbd95affE>: + pub fn expect(self, msg: &str) -> T { + 8000f464: 7139 addi sp,sp,-64 + 8000f466: e03a sd a4,0(sp) + 8000f468: e436 sd a3,8(sp) + 8000f46a: e832 sd a2,16(sp) + 8000f46c: ec2a sd a0,24(sp) + 8000f46e: f02e sd a1,32(sp) + 8000f470: f432 sd a2,40(sp) + 8000f472: f836 sd a3,48(sp) + 8000f474: 4581 li a1,0 + Some(val) => val, + 8000f476: 00b50463 beq a0,a1,8000f47e <_ZN4core6option15Option$LT$T$GT$6expect17h2ee3949cdbd95affE+0x1a> + 8000f47a: a009 j 8000f47c <_ZN4core6option15Option$LT$T$GT$6expect17h2ee3949cdbd95affE+0x18> + 8000f47c: a811 j 8000f490 <_ZN4core6option15Option$LT$T$GT$6expect17h2ee3949cdbd95affE+0x2c> + None => expect_failed(msg), + 8000f47e: 6602 ld a2,0(sp) + 8000f480: 65a2 ld a1,8(sp) + 8000f482: 6542 ld a0,16(sp) + 8000f484: 00014097 auipc ra,0x14 + 8000f488: b84080e7 jalr -1148(ra) # 80023008 <_ZN4core6option13expect_failed17h0edd1e4bb5304a50E> + 8000f48c: 0000 unimp + match self { + 8000f48e: 0000 unimp + Some(val) => val, + 8000f490: 7502 ld a0,32(sp) + 8000f492: fc2a sd a0,56(sp) + } + 8000f494: 6121 addi sp,sp,64 + 8000f496: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6expect17h3c07e85986db6eddE: + +000000008000f498 <_ZN4core6option15Option$LT$T$GT$6expect17h3c07e85986db6eddE>: + pub fn expect(self, msg: &str) -> T { + 8000f498: 7139 addi sp,sp,-64 + 8000f49a: e436 sd a3,8(sp) + 8000f49c: e832 sd a2,16(sp) + 8000f49e: ec2e sd a1,24(sp) + 8000f4a0: f02a sd a0,32(sp) + 8000f4a2: f42e sd a1,40(sp) + 8000f4a4: f832 sd a2,48(sp) + Some(val) => val, + 8000f4a6: 00a035b3 snez a1,a0 + 8000f4aa: 4581 li a1,0 + 8000f4ac: 00b50463 beq a0,a1,8000f4b4 <_ZN4core6option15Option$LT$T$GT$6expect17h3c07e85986db6eddE+0x1c> + 8000f4b0: a009 j 8000f4b2 <_ZN4core6option15Option$LT$T$GT$6expect17h3c07e85986db6eddE+0x1a> + 8000f4b2: a811 j 8000f4c6 <_ZN4core6option15Option$LT$T$GT$6expect17h3c07e85986db6eddE+0x2e> + None => expect_failed(msg), + 8000f4b4: 6622 ld a2,8(sp) + 8000f4b6: 65c2 ld a1,16(sp) + 8000f4b8: 6562 ld a0,24(sp) + 8000f4ba: 00014097 auipc ra,0x14 + 8000f4be: b4e080e7 jalr -1202(ra) # 80023008 <_ZN4core6option13expect_failed17h0edd1e4bb5304a50E> + 8000f4c2: 0000 unimp + match self { + 8000f4c4: 0000 unimp + Some(val) => val, + 8000f4c6: 7502 ld a0,32(sp) + 8000f4c8: fc2a sd a0,56(sp) + } + 8000f4ca: 6121 addi sp,sp,64 + 8000f4cc: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6expect17h91dc8b235b72ffe4E: + +000000008000f4ce <_ZN4core6option15Option$LT$T$GT$6expect17h91dc8b235b72ffe4E>: + pub fn expect(self, msg: &str) -> T { + 8000f4ce: 7139 addi sp,sp,-64 + 8000f4d0: e036 sd a3,0(sp) + 8000f4d2: e432 sd a2,8(sp) + 8000f4d4: e82e sd a1,16(sp) + 8000f4d6: ec2a sd a0,24(sp) + 8000f4d8: f82e sd a1,48(sp) + 8000f4da: fc32 sd a2,56(sp) + Some(val) => val, + 8000f4dc: 6108 ld a0,0(a0) + 8000f4de: 4581 li a1,0 + 8000f4e0: 00b50463 beq a0,a1,8000f4e8 <_ZN4core6option15Option$LT$T$GT$6expect17h91dc8b235b72ffe4E+0x1a> + 8000f4e4: a009 j 8000f4e6 <_ZN4core6option15Option$LT$T$GT$6expect17h91dc8b235b72ffe4E+0x18> + 8000f4e6: a811 j 8000f4fa <_ZN4core6option15Option$LT$T$GT$6expect17h91dc8b235b72ffe4E+0x2c> + None => expect_failed(msg), + 8000f4e8: 6602 ld a2,0(sp) + 8000f4ea: 65a2 ld a1,8(sp) + 8000f4ec: 6542 ld a0,16(sp) + 8000f4ee: 00014097 auipc ra,0x14 + 8000f4f2: b1a080e7 jalr -1254(ra) # 80023008 <_ZN4core6option13expect_failed17h0edd1e4bb5304a50E> + 8000f4f6: 0000 unimp + match self { + 8000f4f8: 0000 unimp + Some(val) => val, + 8000f4fa: 6562 ld a0,24(sp) + 8000f4fc: 690c ld a1,16(a0) + 8000f4fe: f42e sd a1,40(sp) + 8000f500: 6508 ld a0,8(a0) + 8000f502: f02a sd a0,32(sp) + } + 8000f504: 6121 addi sp,sp,64 + 8000f506: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E: + +000000008000f508 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E>: + pub const fn unwrap(self) -> T { + 8000f508: 1101 addi sp,sp,-32 + 8000f50a: e42e sd a1,8(sp) + 8000f50c: e82a sd a0,16(sp) + Some(val) => val, + 8000f50e: 00a035b3 snez a1,a0 + 8000f512: 4581 li a1,0 + 8000f514: 00b50463 beq a0,a1,8000f51c <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E+0x14> + 8000f518: a009 j 8000f51a <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E+0x12> + 8000f51a: a831 j 8000f536 <.LBB31_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f51c: 6622 ld a2,8(sp) + +000000008000f51e <.LBB31_5>: + 8000f51e: 0001a517 auipc a0,0x1a + 8000f522: 16350513 addi a0,a0,355 # 80029681 <.L__unnamed_1> + 8000f526: 02b00593 li a1,43 + 8000f52a: 00014097 auipc ra,0x14 + 8000f52e: c1a080e7 jalr -998(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f532: 0000 unimp + match self { + 8000f534: 0000 unimp + Some(val) => val, + 8000f536: 6542 ld a0,16(sp) + 8000f538: ec2a sd a0,24(sp) + } + 8000f53a: 6105 addi sp,sp,32 + 8000f53c: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h2ef2c85febc29d20E: + +000000008000f53e <_ZN4core6option15Option$LT$T$GT$6unwrap17h2ef2c85febc29d20E>: + pub const fn unwrap(self) -> T { + 8000f53e: 1101 addi sp,sp,-32 + 8000f540: e42e sd a1,8(sp) + 8000f542: e82a sd a0,16(sp) + Some(val) => val, + 8000f544: 00a035b3 snez a1,a0 + 8000f548: 4581 li a1,0 + 8000f54a: 00b50463 beq a0,a1,8000f552 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2ef2c85febc29d20E+0x14> + 8000f54e: a009 j 8000f550 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2ef2c85febc29d20E+0x12> + 8000f550: a831 j 8000f56c <.LBB32_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f552: 6622 ld a2,8(sp) + +000000008000f554 <.LBB32_5>: + 8000f554: 0001a517 auipc a0,0x1a + 8000f558: 12d50513 addi a0,a0,301 # 80029681 <.L__unnamed_1> + 8000f55c: 02b00593 li a1,43 + 8000f560: 00014097 auipc ra,0x14 + 8000f564: be4080e7 jalr -1052(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f568: 0000 unimp + match self { + 8000f56a: 0000 unimp + Some(val) => val, + 8000f56c: 6542 ld a0,16(sp) + 8000f56e: ec2a sd a0,24(sp) + } + 8000f570: 6105 addi sp,sp,32 + 8000f572: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h34586233d4d65f4cE: + +000000008000f574 <_ZN4core6option15Option$LT$T$GT$6unwrap17h34586233d4d65f4cE>: + pub const fn unwrap(self) -> T { + 8000f574: 1101 addi sp,sp,-32 + 8000f576: e42e sd a1,8(sp) + 8000f578: e82a sd a0,16(sp) + Some(val) => val, + 8000f57a: 00a035b3 snez a1,a0 + 8000f57e: 4581 li a1,0 + 8000f580: 00b50463 beq a0,a1,8000f588 <_ZN4core6option15Option$LT$T$GT$6unwrap17h34586233d4d65f4cE+0x14> + 8000f584: a009 j 8000f586 <_ZN4core6option15Option$LT$T$GT$6unwrap17h34586233d4d65f4cE+0x12> + 8000f586: a831 j 8000f5a2 <.LBB33_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f588: 6622 ld a2,8(sp) + +000000008000f58a <.LBB33_5>: + 8000f58a: 0001a517 auipc a0,0x1a + 8000f58e: 0f750513 addi a0,a0,247 # 80029681 <.L__unnamed_1> + 8000f592: 02b00593 li a1,43 + 8000f596: 00014097 auipc ra,0x14 + 8000f59a: bae080e7 jalr -1106(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f59e: 0000 unimp + match self { + 8000f5a0: 0000 unimp + Some(val) => val, + 8000f5a2: 6542 ld a0,16(sp) + 8000f5a4: ec2a sd a0,24(sp) + } + 8000f5a6: 6105 addi sp,sp,32 + 8000f5a8: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E: + +000000008000f5aa <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E>: + pub const fn unwrap(self) -> T { + 8000f5aa: 1101 addi sp,sp,-32 + 8000f5ac: e032 sd a2,0(sp) + 8000f5ae: e42a sd a0,8(sp) + 8000f5b0: e82e sd a1,16(sp) + 8000f5b2: 4581 li a1,0 + Some(val) => val, + 8000f5b4: 00b50463 beq a0,a1,8000f5bc <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E+0x12> + 8000f5b8: a009 j 8000f5ba <_ZN4core6option15Option$LT$T$GT$6unwrap17h3e0f2a48aae97d82E+0x10> + 8000f5ba: a831 j 8000f5d6 <.LBB34_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f5bc: 6602 ld a2,0(sp) + +000000008000f5be <.LBB34_5>: + 8000f5be: 0001a517 auipc a0,0x1a + 8000f5c2: 0c350513 addi a0,a0,195 # 80029681 <.L__unnamed_1> + 8000f5c6: 02b00593 li a1,43 + 8000f5ca: 00014097 auipc ra,0x14 + 8000f5ce: b7a080e7 jalr -1158(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f5d2: 0000 unimp + match self { + 8000f5d4: 0000 unimp + Some(val) => val, + 8000f5d6: 6542 ld a0,16(sp) + 8000f5d8: ec2a sd a0,24(sp) + } + 8000f5da: 6105 addi sp,sp,32 + 8000f5dc: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h5e7c29d7de25e54aE: + +000000008000f5de <_ZN4core6option15Option$LT$T$GT$6unwrap17h5e7c29d7de25e54aE>: + pub const fn unwrap(self) -> T { + 8000f5de: 1101 addi sp,sp,-32 + 8000f5e0: e42e sd a1,8(sp) + 8000f5e2: e82a sd a0,16(sp) + Some(val) => val, + 8000f5e4: 00a035b3 snez a1,a0 + 8000f5e8: 4581 li a1,0 + 8000f5ea: 00b50463 beq a0,a1,8000f5f2 <_ZN4core6option15Option$LT$T$GT$6unwrap17h5e7c29d7de25e54aE+0x14> + 8000f5ee: a009 j 8000f5f0 <_ZN4core6option15Option$LT$T$GT$6unwrap17h5e7c29d7de25e54aE+0x12> + 8000f5f0: a831 j 8000f60c <.LBB35_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f5f2: 6622 ld a2,8(sp) + +000000008000f5f4 <.LBB35_5>: + 8000f5f4: 0001a517 auipc a0,0x1a + 8000f5f8: 08d50513 addi a0,a0,141 # 80029681 <.L__unnamed_1> + 8000f5fc: 02b00593 li a1,43 + 8000f600: 00014097 auipc ra,0x14 + 8000f604: b44080e7 jalr -1212(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f608: 0000 unimp + match self { + 8000f60a: 0000 unimp + Some(val) => val, + 8000f60c: 6542 ld a0,16(sp) + 8000f60e: ec2a sd a0,24(sp) + } + 8000f610: 6105 addi sp,sp,32 + 8000f612: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h5fcd4b8dbd5a2f47E: + +000000008000f614 <_ZN4core6option15Option$LT$T$GT$6unwrap17h5fcd4b8dbd5a2f47E>: + pub const fn unwrap(self) -> T { + 8000f614: 1101 addi sp,sp,-32 + 8000f616: e02e sd a1,0(sp) + 8000f618: e42a sd a0,8(sp) + Some(val) => val, + 8000f61a: 6108 ld a0,0(a0) + 8000f61c: 4581 li a1,0 + 8000f61e: 00b50463 beq a0,a1,8000f626 <_ZN4core6option15Option$LT$T$GT$6unwrap17h5fcd4b8dbd5a2f47E+0x12> + 8000f622: a009 j 8000f624 <_ZN4core6option15Option$LT$T$GT$6unwrap17h5fcd4b8dbd5a2f47E+0x10> + 8000f624: a831 j 8000f640 <.LBB36_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f626: 6602 ld a2,0(sp) + +000000008000f628 <.LBB36_5>: + 8000f628: 0001a517 auipc a0,0x1a + 8000f62c: 05950513 addi a0,a0,89 # 80029681 <.L__unnamed_1> + 8000f630: 02b00593 li a1,43 + 8000f634: 00014097 auipc ra,0x14 + 8000f638: b10080e7 jalr -1264(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f63c: 0000 unimp + match self { + 8000f63e: 0000 unimp + Some(val) => val, + 8000f640: 6522 ld a0,8(sp) + 8000f642: 690c ld a1,16(a0) + 8000f644: ec2e sd a1,24(sp) + 8000f646: 6508 ld a0,8(a0) + 8000f648: e82a sd a0,16(sp) + } + 8000f64a: 6105 addi sp,sp,32 + 8000f64c: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E: + +000000008000f64e <_ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E>: + pub const fn unwrap(self) -> T { + 8000f64e: 1101 addi sp,sp,-32 + 8000f650: e032 sd a2,0(sp) + 8000f652: e42a sd a0,8(sp) + 8000f654: e82e sd a1,16(sp) + 8000f656: 4581 li a1,0 + Some(val) => val, + 8000f658: 00b50463 beq a0,a1,8000f660 <_ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E+0x12> + 8000f65c: a009 j 8000f65e <_ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E+0x10> + 8000f65e: a831 j 8000f67a <.LBB37_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f660: 6602 ld a2,0(sp) + +000000008000f662 <.LBB37_5>: + 8000f662: 0001a517 auipc a0,0x1a + 8000f666: 01f50513 addi a0,a0,31 # 80029681 <.L__unnamed_1> + 8000f66a: 02b00593 li a1,43 + 8000f66e: 00014097 auipc ra,0x14 + 8000f672: ad6080e7 jalr -1322(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f676: 0000 unimp + match self { + 8000f678: 0000 unimp + Some(val) => val, + 8000f67a: 6542 ld a0,16(sp) + 8000f67c: ec2a sd a0,24(sp) + } + 8000f67e: 6105 addi sp,sp,32 + 8000f680: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E: + +000000008000f682 <_ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E>: + pub const fn unwrap(self) -> T { + 8000f682: 1101 addi sp,sp,-32 + 8000f684: e42e sd a1,8(sp) + 8000f686: e82a sd a0,16(sp) + Some(val) => val, + 8000f688: 00a035b3 snez a1,a0 + 8000f68c: 4581 li a1,0 + 8000f68e: 00b50463 beq a0,a1,8000f696 <_ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E+0x14> + 8000f692: a009 j 8000f694 <_ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E+0x12> + 8000f694: a831 j 8000f6b0 <.LBB38_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f696: 6622 ld a2,8(sp) + +000000008000f698 <.LBB38_5>: + 8000f698: 0001a517 auipc a0,0x1a + 8000f69c: fe950513 addi a0,a0,-23 # 80029681 <.L__unnamed_1> + 8000f6a0: 02b00593 li a1,43 + 8000f6a4: 00014097 auipc ra,0x14 + 8000f6a8: aa0080e7 jalr -1376(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f6ac: 0000 unimp + match self { + 8000f6ae: 0000 unimp + Some(val) => val, + 8000f6b0: 6542 ld a0,16(sp) + 8000f6b2: ec2a sd a0,24(sp) + } + 8000f6b4: 6105 addi sp,sp,32 + 8000f6b6: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E: + +000000008000f6b8 <_ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E>: + pub const fn unwrap(self) -> T { + 8000f6b8: 1101 addi sp,sp,-32 + 8000f6ba: e42e sd a1,8(sp) + 8000f6bc: e82a sd a0,16(sp) + Some(val) => val, + 8000f6be: 00a035b3 snez a1,a0 + 8000f6c2: 4581 li a1,0 + 8000f6c4: 00b50463 beq a0,a1,8000f6cc <_ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E+0x14> + 8000f6c8: a009 j 8000f6ca <_ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E+0x12> + 8000f6ca: a831 j 8000f6e6 <.LBB39_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f6cc: 6622 ld a2,8(sp) + +000000008000f6ce <.LBB39_5>: + 8000f6ce: 0001a517 auipc a0,0x1a + 8000f6d2: fb350513 addi a0,a0,-77 # 80029681 <.L__unnamed_1> + 8000f6d6: 02b00593 li a1,43 + 8000f6da: 00014097 auipc ra,0x14 + 8000f6de: a6a080e7 jalr -1430(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f6e2: 0000 unimp + match self { + 8000f6e4: 0000 unimp + Some(val) => val, + 8000f6e6: 6542 ld a0,16(sp) + 8000f6e8: ec2a sd a0,24(sp) + } + 8000f6ea: 6105 addi sp,sp,32 + 8000f6ec: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h97667cf20f9698d4E: + +000000008000f6ee <_ZN4core6option15Option$LT$T$GT$6unwrap17h97667cf20f9698d4E>: + pub const fn unwrap(self) -> T { + 8000f6ee: 1101 addi sp,sp,-32 + 8000f6f0: e42e sd a1,8(sp) + 8000f6f2: e82a sd a0,16(sp) + Some(val) => val, + 8000f6f4: 00a035b3 snez a1,a0 + 8000f6f8: 4581 li a1,0 + 8000f6fa: 00b50463 beq a0,a1,8000f702 <_ZN4core6option15Option$LT$T$GT$6unwrap17h97667cf20f9698d4E+0x14> + 8000f6fe: a009 j 8000f700 <_ZN4core6option15Option$LT$T$GT$6unwrap17h97667cf20f9698d4E+0x12> + 8000f700: a831 j 8000f71c <.LBB40_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f702: 6622 ld a2,8(sp) + +000000008000f704 <.LBB40_5>: + 8000f704: 0001a517 auipc a0,0x1a + 8000f708: f7d50513 addi a0,a0,-131 # 80029681 <.L__unnamed_1> + 8000f70c: 02b00593 li a1,43 + 8000f710: 00014097 auipc ra,0x14 + 8000f714: a34080e7 jalr -1484(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f718: 0000 unimp + match self { + 8000f71a: 0000 unimp + Some(val) => val, + 8000f71c: 6542 ld a0,16(sp) + 8000f71e: ec2a sd a0,24(sp) + } + 8000f720: 6105 addi sp,sp,32 + 8000f722: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17hc367d03244a4b027E: + +000000008000f724 <_ZN4core6option15Option$LT$T$GT$6unwrap17hc367d03244a4b027E>: + pub const fn unwrap(self) -> T { + 8000f724: 1101 addi sp,sp,-32 + 8000f726: e42e sd a1,8(sp) + 8000f728: e82a sd a0,16(sp) + Some(val) => val, + 8000f72a: 00a035b3 snez a1,a0 + 8000f72e: 4581 li a1,0 + 8000f730: 00b50463 beq a0,a1,8000f738 <_ZN4core6option15Option$LT$T$GT$6unwrap17hc367d03244a4b027E+0x14> + 8000f734: a009 j 8000f736 <_ZN4core6option15Option$LT$T$GT$6unwrap17hc367d03244a4b027E+0x12> + 8000f736: a831 j 8000f752 <.LBB41_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f738: 6622 ld a2,8(sp) + +000000008000f73a <.LBB41_5>: + 8000f73a: 0001a517 auipc a0,0x1a + 8000f73e: f4750513 addi a0,a0,-185 # 80029681 <.L__unnamed_1> + 8000f742: 02b00593 li a1,43 + 8000f746: 00014097 auipc ra,0x14 + 8000f74a: 9fe080e7 jalr -1538(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f74e: 0000 unimp + match self { + 8000f750: 0000 unimp + Some(val) => val, + 8000f752: 6542 ld a0,16(sp) + 8000f754: ec2a sd a0,24(sp) + } + 8000f756: 6105 addi sp,sp,32 + 8000f758: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17hcaa2b543d69df090E: + +000000008000f75a <_ZN4core6option15Option$LT$T$GT$6unwrap17hcaa2b543d69df090E>: + pub const fn unwrap(self) -> T { + 8000f75a: 1101 addi sp,sp,-32 + 8000f75c: e42e sd a1,8(sp) + 8000f75e: e82a sd a0,16(sp) + Some(val) => val, + 8000f760: 00a035b3 snez a1,a0 + 8000f764: 4581 li a1,0 + 8000f766: 00b50463 beq a0,a1,8000f76e <_ZN4core6option15Option$LT$T$GT$6unwrap17hcaa2b543d69df090E+0x14> + 8000f76a: a009 j 8000f76c <_ZN4core6option15Option$LT$T$GT$6unwrap17hcaa2b543d69df090E+0x12> + 8000f76c: a831 j 8000f788 <.LBB42_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f76e: 6622 ld a2,8(sp) + +000000008000f770 <.LBB42_5>: + 8000f770: 0001a517 auipc a0,0x1a + 8000f774: f1150513 addi a0,a0,-239 # 80029681 <.L__unnamed_1> + 8000f778: 02b00593 li a1,43 + 8000f77c: 00014097 auipc ra,0x14 + 8000f780: 9c8080e7 jalr -1592(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f784: 0000 unimp + match self { + 8000f786: 0000 unimp + Some(val) => val, + 8000f788: 6542 ld a0,16(sp) + 8000f78a: ec2a sd a0,24(sp) + } + 8000f78c: 6105 addi sp,sp,32 + 8000f78e: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E: + +000000008000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E>: + pub const fn unwrap(self) -> T { + 8000f790: 1101 addi sp,sp,-32 + 8000f792: e42e sd a1,8(sp) + 8000f794: e82a sd a0,16(sp) + Some(val) => val, + 8000f796: 00a035b3 snez a1,a0 + 8000f79a: 4581 li a1,0 + 8000f79c: 00b50463 beq a0,a1,8000f7a4 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E+0x14> + 8000f7a0: a009 j 8000f7a2 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E+0x12> + 8000f7a2: a831 j 8000f7be <.LBB43_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f7a4: 6622 ld a2,8(sp) + +000000008000f7a6 <.LBB43_5>: + 8000f7a6: 0001a517 auipc a0,0x1a + 8000f7aa: edb50513 addi a0,a0,-293 # 80029681 <.L__unnamed_1> + 8000f7ae: 02b00593 li a1,43 + 8000f7b2: 00014097 auipc ra,0x14 + 8000f7b6: 992080e7 jalr -1646(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f7ba: 0000 unimp + match self { + 8000f7bc: 0000 unimp + Some(val) => val, + 8000f7be: 6542 ld a0,16(sp) + 8000f7c0: ec2a sd a0,24(sp) + } + 8000f7c2: 6105 addi sp,sp,32 + 8000f7c4: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17he97e68f5d459b5f2E: + +000000008000f7c6 <_ZN4core6option15Option$LT$T$GT$6unwrap17he97e68f5d459b5f2E>: + pub const fn unwrap(self) -> T { + 8000f7c6: 1101 addi sp,sp,-32 + 8000f7c8: e032 sd a2,0(sp) + 8000f7ca: e42a sd a0,8(sp) + 8000f7cc: e82e sd a1,16(sp) + 8000f7ce: 4581 li a1,0 + Some(val) => val, + 8000f7d0: 00b50463 beq a0,a1,8000f7d8 <_ZN4core6option15Option$LT$T$GT$6unwrap17he97e68f5d459b5f2E+0x12> + 8000f7d4: a009 j 8000f7d6 <_ZN4core6option15Option$LT$T$GT$6unwrap17he97e68f5d459b5f2E+0x10> + 8000f7d6: a831 j 8000f7f2 <.LBB44_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f7d8: 6602 ld a2,0(sp) + +000000008000f7da <.LBB44_5>: + 8000f7da: 0001a517 auipc a0,0x1a + 8000f7de: ea750513 addi a0,a0,-345 # 80029681 <.L__unnamed_1> + 8000f7e2: 02b00593 li a1,43 + 8000f7e6: 00014097 auipc ra,0x14 + 8000f7ea: 95e080e7 jalr -1698(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f7ee: 0000 unimp + match self { + 8000f7f0: 0000 unimp + Some(val) => val, + 8000f7f2: 6542 ld a0,16(sp) + 8000f7f4: ec2a sd a0,24(sp) + } + 8000f7f6: 6105 addi sp,sp,32 + 8000f7f8: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17heec1a84bcf97bc0fE: + +000000008000f7fa <_ZN4core6option15Option$LT$T$GT$6unwrap17heec1a84bcf97bc0fE>: + pub const fn unwrap(self) -> T { + 8000f7fa: 1101 addi sp,sp,-32 + 8000f7fc: e42e sd a1,8(sp) + 8000f7fe: e82a sd a0,16(sp) + Some(val) => val, + 8000f800: 00a035b3 snez a1,a0 + 8000f804: 4581 li a1,0 + 8000f806: 00b50463 beq a0,a1,8000f80e <_ZN4core6option15Option$LT$T$GT$6unwrap17heec1a84bcf97bc0fE+0x14> + 8000f80a: a009 j 8000f80c <_ZN4core6option15Option$LT$T$GT$6unwrap17heec1a84bcf97bc0fE+0x12> + 8000f80c: a831 j 8000f828 <.LBB45_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f80e: 6622 ld a2,8(sp) + +000000008000f810 <.LBB45_5>: + 8000f810: 0001a517 auipc a0,0x1a + 8000f814: e7150513 addi a0,a0,-399 # 80029681 <.L__unnamed_1> + 8000f818: 02b00593 li a1,43 + 8000f81c: 00014097 auipc ra,0x14 + 8000f820: 928080e7 jalr -1752(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f824: 0000 unimp + match self { + 8000f826: 0000 unimp + Some(val) => val, + 8000f828: 6542 ld a0,16(sp) + 8000f82a: ec2a sd a0,24(sp) + } + 8000f82c: 6105 addi sp,sp,32 + 8000f82e: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17hf17dde6d66464577E: + +000000008000f830 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf17dde6d66464577E>: + pub const fn unwrap(self) -> T { + 8000f830: 1101 addi sp,sp,-32 + 8000f832: e42e sd a1,8(sp) + 8000f834: e82a sd a0,16(sp) + Some(val) => val, + 8000f836: 00a035b3 snez a1,a0 + 8000f83a: 4581 li a1,0 + 8000f83c: 00b50463 beq a0,a1,8000f844 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf17dde6d66464577E+0x14> + 8000f840: a009 j 8000f842 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf17dde6d66464577E+0x12> + 8000f842: a831 j 8000f85e <.LBB46_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8000f844: 6622 ld a2,8(sp) + +000000008000f846 <.LBB46_5>: + 8000f846: 0001a517 auipc a0,0x1a + 8000f84a: e3b50513 addi a0,a0,-453 # 80029681 <.L__unnamed_1> + 8000f84e: 02b00593 li a1,43 + 8000f852: 00014097 auipc ra,0x14 + 8000f856: 8f2080e7 jalr -1806(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8000f85a: 0000 unimp + match self { + 8000f85c: 0000 unimp + Some(val) => val, + 8000f85e: 6542 ld a0,16(sp) + 8000f860: ec2a sd a0,24(sp) + } + 8000f862: 6105 addi sp,sp,32 + 8000f864: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7is_none17h8590a3c5c2d3d42aE: + +000000008000f866 <_ZN4core6option15Option$LT$T$GT$7is_none17h8590a3c5c2d3d42aE>: + pub const fn is_none(&self) -> bool { + 8000f866: 1101 addi sp,sp,-32 + 8000f868: ec06 sd ra,24(sp) + 8000f86a: e82a sd a0,16(sp) + !self.is_some() + 8000f86c: 00000097 auipc ra,0x0 + 8000f870: 0c6080e7 jalr 198(ra) # 8000f932 <_ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE> + 8000f874: e42a sd a0,8(sp) + 8000f876: a009 j 8000f878 <_ZN4core6option15Option$LT$T$GT$7is_none17h8590a3c5c2d3d42aE+0x12> + 8000f878: 6522 ld a0,8(sp) + 8000f87a: 00154513 xori a0,a0,1 + } + 8000f87e: 60e2 ld ra,24(sp) + 8000f880: 6105 addi sp,sp,32 + 8000f882: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7is_none17hb2038865e515c3d7E: + +000000008000f884 <_ZN4core6option15Option$LT$T$GT$7is_none17hb2038865e515c3d7E>: + pub const fn is_none(&self) -> bool { + 8000f884: 1101 addi sp,sp,-32 + 8000f886: ec06 sd ra,24(sp) + 8000f888: e82a sd a0,16(sp) + !self.is_some() + 8000f88a: 00000097 auipc ra,0x0 + 8000f88e: 036080e7 jalr 54(ra) # 8000f8c0 <_ZN4core6option15Option$LT$T$GT$7is_some17h82653431d308dc30E> + 8000f892: e42a sd a0,8(sp) + 8000f894: a009 j 8000f896 <_ZN4core6option15Option$LT$T$GT$7is_none17hb2038865e515c3d7E+0x12> + 8000f896: 6522 ld a0,8(sp) + 8000f898: 00154513 xori a0,a0,1 + } + 8000f89c: 60e2 ld ra,24(sp) + 8000f89e: 6105 addi sp,sp,32 + 8000f8a0: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7is_none17hbfc07de6cbdc4f1cE: + +000000008000f8a2 <_ZN4core6option15Option$LT$T$GT$7is_none17hbfc07de6cbdc4f1cE>: + pub const fn is_none(&self) -> bool { + 8000f8a2: 1101 addi sp,sp,-32 + 8000f8a4: ec06 sd ra,24(sp) + 8000f8a6: e82a sd a0,16(sp) + !self.is_some() + 8000f8a8: 00000097 auipc ra,0x0 + 8000f8ac: 064080e7 jalr 100(ra) # 8000f90c <_ZN4core6option15Option$LT$T$GT$7is_some17hac194dcf43ce65a0E> + 8000f8b0: e42a sd a0,8(sp) + 8000f8b2: a009 j 8000f8b4 <_ZN4core6option15Option$LT$T$GT$7is_none17hbfc07de6cbdc4f1cE+0x12> + 8000f8b4: 6522 ld a0,8(sp) + 8000f8b6: 00154513 xori a0,a0,1 + } + 8000f8ba: 60e2 ld ra,24(sp) + 8000f8bc: 6105 addi sp,sp,32 + 8000f8be: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7is_some17h82653431d308dc30E: + +000000008000f8c0 <_ZN4core6option15Option$LT$T$GT$7is_some17h82653431d308dc30E>: + pub const fn is_some(&self) -> bool { + 8000f8c0: 1141 addi sp,sp,-16 + 8000f8c2: e42a sd a0,8(sp) + matches!(*self, Some(_)) + 8000f8c4: 6108 ld a0,0(a0) + 8000f8c6: 4581 li a1,0 + 8000f8c8: 00b51763 bne a0,a1,8000f8d6 <_ZN4core6option15Option$LT$T$GT$7is_some17h82653431d308dc30E+0x16> + 8000f8cc: a009 j 8000f8ce <_ZN4core6option15Option$LT$T$GT$7is_some17h82653431d308dc30E+0xe> + 8000f8ce: 4501 li a0,0 + 8000f8d0: 00a103a3 sb a0,7(sp) + 8000f8d4: a029 j 8000f8de <_ZN4core6option15Option$LT$T$GT$7is_some17h82653431d308dc30E+0x1e> + 8000f8d6: 4505 li a0,1 + 8000f8d8: 00a103a3 sb a0,7(sp) + 8000f8dc: a009 j 8000f8de <_ZN4core6option15Option$LT$T$GT$7is_some17h82653431d308dc30E+0x1e> + } + 8000f8de: 00714503 lbu a0,7(sp) + 8000f8e2: 0141 addi sp,sp,16 + 8000f8e4: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7is_some17h901b9974d3eea8b8E: + +000000008000f8e6 <_ZN4core6option15Option$LT$T$GT$7is_some17h901b9974d3eea8b8E>: + pub const fn is_some(&self) -> bool { + 8000f8e6: 1141 addi sp,sp,-16 + 8000f8e8: e42a sd a0,8(sp) + matches!(*self, Some(_)) + 8000f8ea: 6108 ld a0,0(a0) + 8000f8ec: 4581 li a1,0 + 8000f8ee: 00b51763 bne a0,a1,8000f8fc <_ZN4core6option15Option$LT$T$GT$7is_some17h901b9974d3eea8b8E+0x16> + 8000f8f2: a009 j 8000f8f4 <_ZN4core6option15Option$LT$T$GT$7is_some17h901b9974d3eea8b8E+0xe> + 8000f8f4: 4501 li a0,0 + 8000f8f6: 00a103a3 sb a0,7(sp) + 8000f8fa: a029 j 8000f904 <_ZN4core6option15Option$LT$T$GT$7is_some17h901b9974d3eea8b8E+0x1e> + 8000f8fc: 4505 li a0,1 + 8000f8fe: 00a103a3 sb a0,7(sp) + 8000f902: a009 j 8000f904 <_ZN4core6option15Option$LT$T$GT$7is_some17h901b9974d3eea8b8E+0x1e> + } + 8000f904: 00714503 lbu a0,7(sp) + 8000f908: 0141 addi sp,sp,16 + 8000f90a: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7is_some17hac194dcf43ce65a0E: + +000000008000f90c <_ZN4core6option15Option$LT$T$GT$7is_some17hac194dcf43ce65a0E>: + pub const fn is_some(&self) -> bool { + 8000f90c: 1141 addi sp,sp,-16 + 8000f90e: e42a sd a0,8(sp) + matches!(*self, Some(_)) + 8000f910: 6108 ld a0,0(a0) + 8000f912: 4581 li a1,0 + 8000f914: 00b51763 bne a0,a1,8000f922 <_ZN4core6option15Option$LT$T$GT$7is_some17hac194dcf43ce65a0E+0x16> + 8000f918: a009 j 8000f91a <_ZN4core6option15Option$LT$T$GT$7is_some17hac194dcf43ce65a0E+0xe> + 8000f91a: 4501 li a0,0 + 8000f91c: 00a103a3 sb a0,7(sp) + 8000f920: a029 j 8000f92a <_ZN4core6option15Option$LT$T$GT$7is_some17hac194dcf43ce65a0E+0x1e> + 8000f922: 4505 li a0,1 + 8000f924: 00a103a3 sb a0,7(sp) + 8000f928: a009 j 8000f92a <_ZN4core6option15Option$LT$T$GT$7is_some17hac194dcf43ce65a0E+0x1e> + } + 8000f92a: 00714503 lbu a0,7(sp) + 8000f92e: 0141 addi sp,sp,16 + 8000f930: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE: + +000000008000f932 <_ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE>: + pub const fn is_some(&self) -> bool { + 8000f932: 1141 addi sp,sp,-16 + 8000f934: e42a sd a0,8(sp) + matches!(*self, Some(_)) + 8000f936: 6108 ld a0,0(a0) + 8000f938: 4581 li a1,0 + 8000f93a: 00b51763 bne a0,a1,8000f948 <_ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE+0x16> + 8000f93e: a009 j 8000f940 <_ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE+0xe> + 8000f940: 4501 li a0,0 + 8000f942: 00a103a3 sb a0,7(sp) + 8000f946: a029 j 8000f950 <_ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE+0x1e> + 8000f948: 4505 li a0,1 + 8000f94a: 00a103a3 sb a0,7(sp) + 8000f94e: a009 j 8000f950 <_ZN4core6option15Option$LT$T$GT$7is_some17hd48c331b6466f73fE+0x1e> + } + 8000f950: 00714503 lbu a0,7(sp) + 8000f954: 0141 addi sp,sp,16 + 8000f956: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7replace17h3b8bd4435d2ae84bE: + +000000008000f958 <_ZN4core6option15Option$LT$T$GT$7replace17h3b8bd4435d2ae84bE>: + /// assert_eq!(x, Some(3)); + /// assert_eq!(old, None); + /// ``` + #[inline] + #[stable(feature = "option_replace", since = "1.31.0")] + pub fn replace(&mut self, value: T) -> Option { + 8000f958: 711d addi sp,sp,-96 + 8000f95a: ec86 sd ra,88(sp) + 8000f95c: e832 sd a2,16(sp) + 8000f95e: ec36 sd a3,24(sp) + 8000f960: e032 sd a2,0(sp) + 8000f962: e436 sd a3,8(sp) + 8000f964: e8ae sd a1,80(sp) + mem::replace(self, Some(value)) + 8000f966: e0b2 sd a2,64(sp) + 8000f968: e4b6 sd a3,72(sp) + 8000f96a: f832 sd a2,48(sp) + 8000f96c: fc36 sd a3,56(sp) + 8000f96e: 4605 li a2,1 + 8000f970: f432 sd a2,40(sp) + 8000f972: 1030 addi a2,sp,40 + 8000f974: 0000e097 auipc ra,0xe + 8000f978: 782080e7 jalr 1922(ra) # 8001e0f6 <_ZN4core3mem7replace17hbc5a7f4d236ddb3dE> + 8000f97c: a009 j 8000f97e <_ZN4core6option15Option$LT$T$GT$7replace17h3b8bd4435d2ae84bE+0x26> + } + 8000f97e: 60e6 ld ra,88(sp) + 8000f980: 6125 addi sp,sp,96 + 8000f982: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$7replace17hf852e6bb4a32ec9aE: + +000000008000f984 <_ZN4core6option15Option$LT$T$GT$7replace17hf852e6bb4a32ec9aE>: + pub fn replace(&mut self, value: T) -> Option { + 8000f984: 7179 addi sp,sp,-48 + 8000f986: f406 sd ra,40(sp) + 8000f988: ec2a sd a0,24(sp) + 8000f98a: f02e sd a1,32(sp) + mem::replace(self, Some(value)) + 8000f98c: e82e sd a1,16(sp) + 8000f98e: 0000f097 auipc ra,0xf + 8000f992: 844080e7 jalr -1980(ra) # 8001e1d2 <_ZN4core3mem7replace17hfd1d9a060b66fcb5E> + 8000f996: e42a sd a0,8(sp) + 8000f998: a009 j 8000f99a <_ZN4core6option15Option$LT$T$GT$7replace17hf852e6bb4a32ec9aE+0x16> + } + 8000f99a: 6522 ld a0,8(sp) + 8000f99c: 70a2 ld ra,40(sp) + 8000f99e: 6145 addi sp,sp,48 + 8000f9a0: 8082 ret + +Disassembly of section .text._ZN4core6option19Option$LT$$RF$T$GT$6copied17h53fb63a9bdc6d466E: + +000000008000f9a2 <_ZN4core6option19Option$LT$$RF$T$GT$6copied17h53fb63a9bdc6d466E>: + /// assert_eq!(opt_x, Some(&12)); + /// let copied = opt_x.copied(); + /// assert_eq!(copied, Some(12)); + /// ``` + #[stable(feature = "copied", since = "1.35.0")] + pub fn copied(self) -> Option { + 8000f9a2: 1101 addi sp,sp,-32 + 8000f9a4: ec06 sd ra,24(sp) + 8000f9a6: e82a sd a0,16(sp) + self.map(|&t| t) + 8000f9a8: fffff097 auipc ra,0xfffff + 8000f9ac: 4ec080e7 jalr 1260(ra) # 8000ee94 <_ZN4core6option15Option$LT$T$GT$3map17ha9dd9632468a120eE> + 8000f9b0: e02a sd a0,0(sp) + 8000f9b2: e42e sd a1,8(sp) + 8000f9b4: a009 j 8000f9b6 <_ZN4core6option19Option$LT$$RF$T$GT$6copied17h53fb63a9bdc6d466E+0x14> + } + 8000f9b6: 65a2 ld a1,8(sp) + 8000f9b8: 6502 ld a0,0(sp) + 8000f9ba: 8905 andi a0,a0,1 + 8000f9bc: 60e2 ld ra,24(sp) + 8000f9be: 6105 addi sp,sp,32 + 8000f9c0: 8082 ret + +Disassembly of section .text._ZN4core6option19Option$LT$$RF$T$GT$6copied28_$u7b$$u7b$closure$u7d$$u7d$17ha236d2efbe19b7e0E: + +000000008000f9c2 <_ZN4core6option19Option$LT$$RF$T$GT$6copied28_$u7b$$u7b$closure$u7d$$u7d$17ha236d2efbe19b7e0E>: + self.map(|&t| t) + 8000f9c2: 1101 addi sp,sp,-32 + 8000f9c4: e82a sd a0,16(sp) + 8000f9c6: 00050503 lb a0,0(a0) + 8000f9ca: 00a10fa3 sb a0,31(sp) + 8000f9ce: 6105 addi sp,sp,32 + 8000f9d0: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h8871efd663dd0baaE: + +000000008000f9d2 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h8871efd663dd0baaE>: + fn from(t: T) -> T { + 8000f9d2: 1141 addi sp,sp,-16 + } + 8000f9d4: 0141 addi sp,sp,16 + 8000f9d6: 8082 ret + +Disassembly of section .text._ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE: + +000000008000f9d8 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE>: + None => None, + } + } + + #[inline] + fn clone_from(&mut self, source: &Self) { + 8000f9d8: 7159 addi sp,sp,-112 + 8000f9da: f486 sd ra,104(sp) + 8000f9dc: fc2a sd a0,56(sp) + 8000f9de: e0ae sd a1,64(sp) + match (self, source) { + 8000f9e0: e82a sd a0,16(sp) + 8000f9e2: ec2e sd a1,24(sp) + (Some(to), Some(from)) => to.clone_from(from), + 8000f9e4: 6108 ld a0,0(a0) + 8000f9e6: 4581 li a1,0 + 8000f9e8: 00b51e63 bne a0,a1,8000fa04 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x2c> + 8000f9ec: a009 j 8000f9ee <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x16> + (to, from) => *to = from.clone(), + 8000f9ee: 6542 ld a0,16(sp) + 8000f9f0: e02a sd a0,0(sp) + 8000f9f2: e4aa sd a0,72(sp) + 8000f9f4: 65e2 ld a1,24(sp) + 8000f9f6: e8ae sd a1,80(sp) + 8000f9f8: 1008 addi a0,sp,32 + 8000f9fa: 00000097 auipc ra,0x0 + 8000f9fe: 092080e7 jalr 146(ra) # 8000fa8c <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE> + 8000fa02: a01d j 8000fa28 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x50> + (Some(to), Some(from)) => to.clone_from(from), + 8000fa04: 6562 ld a0,24(sp) + 8000fa06: 6108 ld a0,0(a0) + 8000fa08: 4581 li a1,0 + 8000fa0a: feb502e3 beq a0,a1,8000f9ee <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x16> + 8000fa0e: a009 j 8000fa10 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x38> + 8000fa10: 6542 ld a0,16(sp) + 8000fa12: 0521 addi a0,a0,8 + 8000fa14: ecaa sd a0,88(sp) + 8000fa16: 65e2 ld a1,24(sp) + 8000fa18: 05a1 addi a1,a1,8 + 8000fa1a: f0ae sd a1,96(sp) + 8000fa1c: ffffa097 auipc ra,0xffffa + 8000fa20: 8d8080e7 jalr -1832(ra) # 800092f4 <_ZN4core5clone5Clone10clone_from17h4153b3cb0b8f3e29E> + 8000fa24: a009 j 8000fa26 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x4e> + match (self, source) { + 8000fa26: a039 j 8000fa34 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x5c> + (to, from) => *to = from.clone(), + 8000fa28: 6502 ld a0,0(sp) + 8000fa2a: ffff7097 auipc ra,0xffff7 + 8000fa2e: 706080e7 jalr 1798(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8000fa32: a021 j 8000fa3a <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x62> + } + } + 8000fa34: 70a6 ld ra,104(sp) + 8000fa36: 6165 addi sp,sp,112 + 8000fa38: 8082 ret + (to, from) => *to = from.clone(), + 8000fa3a: 6582 ld a1,0(sp) + 8000fa3c: 7542 ld a0,48(sp) + 8000fa3e: e988 sd a0,16(a1) + 8000fa40: 7522 ld a0,40(sp) + 8000fa42: e588 sd a0,8(a1) + 8000fa44: 7502 ld a0,32(sp) + 8000fa46: e188 sd a0,0(a1) + match (self, source) { + 8000fa48: b7f5 j 8000fa34 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE+0x5c> + +Disassembly of section .text._ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E: + +000000008000fa4a <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E>: + fn clone(&self) -> Self { + 8000fa4a: 7139 addi sp,sp,-64 + 8000fa4c: fc06 sd ra,56(sp) + 8000fa4e: e82a sd a0,16(sp) + 8000fa50: f42a sd a0,40(sp) + Some(x) => Some(x.clone()), + 8000fa52: 6108 ld a0,0(a0) + 8000fa54: 4581 li a1,0 + 8000fa56: 00b50463 beq a0,a1,8000fa5e <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E+0x14> + 8000fa5a: a009 j 8000fa5c <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E+0x12> + 8000fa5c: a029 j 8000fa66 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E+0x1c> + 8000fa5e: 4501 li a0,0 + None => None, + 8000fa60: ec2a sd a0,24(sp) + match self { + 8000fa62: a005 j 8000fa82 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E+0x38> + 8000fa64: 0000 unimp + Some(x) => Some(x.clone()), + 8000fa66: 6542 ld a0,16(sp) + 8000fa68: 0521 addi a0,a0,8 + 8000fa6a: f82a sd a0,48(sp) + 8000fa6c: 0000f097 auipc ra,0xf + 8000fa70: c20080e7 jalr -992(ra) # 8001e68c <_ZN4core5clone5impls62_$LT$impl$u20$core..clone..Clone$u20$for$u20$$BP$mut$u20$T$GT$5clone17h768b01e7342b2128E> + 8000fa74: e42a sd a0,8(sp) + 8000fa76: a009 j 8000fa78 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E+0x2e> + 8000fa78: 6522 ld a0,8(sp) + 8000fa7a: f02a sd a0,32(sp) + 8000fa7c: 4505 li a0,1 + 8000fa7e: ec2a sd a0,24(sp) + match self { + 8000fa80: a009 j 8000fa82 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h32acfd27258c2ca1E+0x38> + } + 8000fa82: 6562 ld a0,24(sp) + 8000fa84: 7582 ld a1,32(sp) + 8000fa86: 70e2 ld ra,56(sp) + 8000fa88: 6121 addi sp,sp,64 + 8000fa8a: 8082 ret + +Disassembly of section .text._ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE: + +000000008000fa8c <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE>: + fn clone(&self) -> Self { + 8000fa8c: 715d addi sp,sp,-80 + 8000fa8e: e486 sd ra,72(sp) + 8000fa90: e02e sd a1,0(sp) + 8000fa92: e42a sd a0,8(sp) + 8000fa94: f02e sd a1,32(sp) + Some(x) => Some(x.clone()), + 8000fa96: 6188 ld a0,0(a1) + 8000fa98: 4581 li a1,0 + 8000fa9a: 00b50463 beq a0,a1,8000faa2 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE+0x16> + 8000fa9e: a009 j 8000faa0 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE+0x14> + 8000faa0: a031 j 8000faac <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE+0x20> + 8000faa2: 65a2 ld a1,8(sp) + 8000faa4: 4501 li a0,0 + None => None, + 8000faa6: e188 sd a0,0(a1) + match self { + 8000faa8: a035 j 8000fad4 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE+0x48> + 8000faaa: 0000 unimp + Some(x) => Some(x.clone()), + 8000faac: 6502 ld a0,0(sp) + 8000faae: 0521 addi a0,a0,8 + 8000fab0: f42a sd a0,40(sp) + 8000fab2: 0000c097 auipc ra,0xc + 8000fab6: 18e080e7 jalr 398(ra) # 8001bc40 <_ZN63_$LT$kernel..fs..inode..Inode$u20$as$u20$core..clone..Clone$GT$5clone17hdd0850fb54e2bc6cE> + 8000faba: f82a sd a0,48(sp) + 8000fabc: fc2e sd a1,56(sp) + 8000fabe: e82a sd a0,16(sp) + 8000fac0: ec2e sd a1,24(sp) + 8000fac2: a009 j 8000fac4 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE+0x38> + 8000fac4: 65a2 ld a1,8(sp) + 8000fac6: 6562 ld a0,24(sp) + 8000fac8: e988 sd a0,16(a1) + 8000faca: 6542 ld a0,16(sp) + 8000facc: e588 sd a0,8(a1) + 8000face: 4505 li a0,1 + 8000fad0: e188 sd a0,0(a1) + match self { + 8000fad2: a009 j 8000fad4 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h97a616a53917bc2aE+0x48> + } + 8000fad4: 60a6 ld ra,72(sp) + 8000fad6: 6161 addi sp,sp,80 + 8000fad8: 8082 ret + +Disassembly of section .text._ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE: + +000000008000fada <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE>: + fn clone(&self) -> Self { + 8000fada: 7179 addi sp,sp,-48 + 8000fadc: f406 sd ra,40(sp) + 8000fade: e42a sd a0,8(sp) + 8000fae0: ec2a sd a0,24(sp) + Some(x) => Some(x.clone()), + 8000fae2: 6108 ld a0,0(a0) + 8000fae4: 00a035b3 snez a1,a0 + 8000fae8: 4581 li a1,0 + 8000faea: 00b50463 beq a0,a1,8000faf2 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE+0x18> + 8000faee: a009 j 8000faf0 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE+0x16> + 8000faf0: a029 j 8000fafa <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE+0x20> + 8000faf2: 4501 li a0,0 + None => None, + 8000faf4: e82a sd a0,16(sp) + match self { + 8000faf6: a829 j 8000fb10 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE+0x36> + 8000faf8: 0000 unimp + Some(x) => Some(x.clone()), + 8000fafa: 6522 ld a0,8(sp) + 8000fafc: f02a sd a0,32(sp) + 8000fafe: ffff3097 auipc ra,0xffff3 + 8000fb02: a78080e7 jalr -1416(ra) # 80002576 <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E> + 8000fb06: e02a sd a0,0(sp) + 8000fb08: a009 j 8000fb0a <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE+0x30> + 8000fb0a: 6502 ld a0,0(sp) + 8000fb0c: e82a sd a0,16(sp) + match self { + 8000fb0e: a009 j 8000fb10 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17ha5678c3a724a7a2fE+0x36> + } + 8000fb10: 6542 ld a0,16(sp) + 8000fb12: 70a2 ld ra,40(sp) + 8000fb14: 6145 addi sp,sp,48 + 8000fb16: 8082 ret + +Disassembly of section .text._ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE: + +000000008000fb18 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE>: + fn clone(&self) -> Self { + 8000fb18: 7139 addi sp,sp,-64 + 8000fb1a: fc06 sd ra,56(sp) + 8000fb1c: e82a sd a0,16(sp) + 8000fb1e: f42a sd a0,40(sp) + Some(x) => Some(x.clone()), + 8000fb20: 6108 ld a0,0(a0) + 8000fb22: 4581 li a1,0 + 8000fb24: 00b50463 beq a0,a1,8000fb2c <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE+0x14> + 8000fb28: a009 j 8000fb2a <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE+0x12> + 8000fb2a: a029 j 8000fb34 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE+0x1c> + 8000fb2c: 4501 li a0,0 + None => None, + 8000fb2e: ec2a sd a0,24(sp) + match self { + 8000fb30: a005 j 8000fb50 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE+0x38> + 8000fb32: 0000 unimp + Some(x) => Some(x.clone()), + 8000fb34: 6542 ld a0,16(sp) + 8000fb36: 0521 addi a0,a0,8 + 8000fb38: f82a sd a0,48(sp) + 8000fb3a: 0000f097 auipc ra,0xf + 8000fb3e: b8a080e7 jalr -1142(ra) # 8001e6c4 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E> + 8000fb42: e42a sd a0,8(sp) + 8000fb44: a009 j 8000fb46 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE+0x2e> + 8000fb46: 6522 ld a0,8(sp) + 8000fb48: f02a sd a0,32(sp) + 8000fb4a: 4505 li a0,1 + 8000fb4c: ec2a sd a0,24(sp) + match self { + 8000fb4e: a009 j 8000fb50 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE+0x38> + } + 8000fb50: 6562 ld a0,24(sp) + 8000fb52: 7582 ld a1,32(sp) + 8000fb54: 70e2 ld ra,56(sp) + 8000fb56: 6121 addi sp,sp,64 + 8000fb58: 8082 ret + +Disassembly of section .text._ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h35e87322ea53eeb5E: + +000000008000fb5a <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h35e87322ea53eeb5E>: + fn from_ok(v: T) -> Self { + Some(v) + } + + #[inline] + fn from_error(_: NoneError) -> Self { + 8000fb5a: 1141 addi sp,sp,-16 + 8000fb5c: 4501 li a0,0 + None + 8000fb5e: c02a sw a0,0(sp) + } + 8000fb60: 4592 lw a1,4(sp) + 8000fb62: 0141 addi sp,sp,16 + 8000fb64: 8082 ret + +Disassembly of section .text._ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h62e9788c2879be16E: + +000000008000fb66 <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h62e9788c2879be16E>: + fn from_error(_: NoneError) -> Self { + 8000fb66: 1101 addi sp,sp,-32 + 8000fb68: 4581 li a1,0 + None + 8000fb6a: e82e sd a1,16(sp) + } + 8000fb6c: 6522 ld a0,8(sp) + 8000fb6e: 6105 addi sp,sp,32 + 8000fb70: 8082 ret + +Disassembly of section .text._ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb32580bc026e46beE: + +000000008000fb72 <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb32580bc026e46beE>: + fn into_result(self) -> Result { + 8000fb72: 1101 addi sp,sp,-32 + 8000fb74: ec06 sd ra,24(sp) + 8000fb76: e82a sd a0,16(sp) + self.ok_or(NoneError) + 8000fb78: fffff097 auipc ra,0xfffff + 8000fb7c: 4ea080e7 jalr 1258(ra) # 8000f062 <_ZN4core6option15Option$LT$T$GT$5ok_or17h31b04b86b45dff41E> + 8000fb80: e42a sd a0,8(sp) + 8000fb82: a009 j 8000fb84 <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb32580bc026e46beE+0x12> + } + 8000fb84: 6522 ld a0,8(sp) + 8000fb86: 60e2 ld ra,24(sp) + 8000fb88: 6105 addi sp,sp,32 + 8000fb8a: 8082 ret + +Disassembly of section .text._ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hce0d66149b699885E: + +000000008000fb8c <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hce0d66149b699885E>: + fn into_result(self) -> Result { + 8000fb8c: 1101 addi sp,sp,-32 + 8000fb8e: ec06 sd ra,24(sp) + 8000fb90: e82a sd a0,16(sp) + self.ok_or(NoneError) + 8000fb92: fffff097 auipc ra,0xfffff + 8000fb96: 6f0080e7 jalr 1776(ra) # 8000f282 <_ZN4core6option15Option$LT$T$GT$5ok_or17hfa0f5f38e365ca74E> + 8000fb9a: e42a sd a0,8(sp) + 8000fb9c: a009 j 8000fb9e <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hce0d66149b699885E+0x12> + } + 8000fb9e: 6522 ld a0,8(sp) + 8000fba0: 60e2 ld ra,24(sp) + 8000fba2: 6105 addi sp,sp,32 + 8000fba4: 8082 ret + +Disassembly of section .text._ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h216c24bc3f109328E: + +000000008000fba6 <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h216c24bc3f109328E>: + fn default() -> Option { + 8000fba6: 1141 addi sp,sp,-16 + 8000fba8: 4501 li a0,0 + None + 8000fbaa: e02a sd a0,0(sp) + } + 8000fbac: 65a2 ld a1,8(sp) + 8000fbae: 0141 addi sp,sp,16 + 8000fbb0: 8082 ret + +Disassembly of section .text._ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h459b0dfcf4f19fffE: + +000000008000fbb2 <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h459b0dfcf4f19fffE>: + fn default() -> Option { + 8000fbb2: 1141 addi sp,sp,-16 + 8000fbb4: 4501 li a0,0 + None + 8000fbb6: e42a sd a0,8(sp) + } + 8000fbb8: 0141 addi sp,sp,16 + 8000fbba: 8082 ret + +Disassembly of section .text._ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h9e7fcea49a91f0edE: + +000000008000fbbc <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h9e7fcea49a91f0edE>: + fn default() -> Option { + 8000fbbc: 1141 addi sp,sp,-16 + 8000fbbe: 4501 li a0,0 + None + 8000fbc0: e02a sd a0,0(sp) + } + 8000fbc2: 65a2 ld a1,8(sp) + 8000fbc4: 0141 addi sp,sp,16 + 8000fbc6: 8082 ret + +Disassembly of section .text._ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17hbc90300349db98aaE: + +000000008000fbc8 <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17hbc90300349db98aaE>: + fn default() -> Option { + 8000fbc8: 1141 addi sp,sp,-16 + 8000fbca: 4501 li a0,0 + None + 8000fbcc: e42a sd a0,8(sp) + } + 8000fbce: 0141 addi sp,sp,16 + 8000fbd0: 8082 ret + +Disassembly of section .text._ZN119_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$core..ptr..unique..Unique$LT$T$GT$$GT$$GT$4from17h163e90b2907f9865E: + +000000008000fbd2 <_ZN119_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$core..ptr..unique..Unique$LT$T$GT$$GT$$GT$4from17h163e90b2907f9865E>: +} + +#[unstable(feature = "ptr_internals", issue = "none")] +impl From> for NonNull { + #[inline] + fn from(unique: Unique) -> Self { + 8000fbd2: 1101 addi sp,sp,-32 + 8000fbd4: ec06 sd ra,24(sp) + 8000fbd6: e82a sd a0,16(sp) + // SAFETY: A Unique pointer cannot be null, so the conditions for + // new_unchecked() are respected. + unsafe { NonNull::new_unchecked(unique.as_ptr()) } + 8000fbd8: ffffd097 auipc ra,0xffffd + 8000fbdc: 960080e7 jalr -1696(ra) # 8000c538 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hc428d38b809aa8c2E> + 8000fbe0: e42a sd a0,8(sp) + 8000fbe2: a009 j 8000fbe4 <_ZN119_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$core..ptr..unique..Unique$LT$T$GT$$GT$$GT$4from17h163e90b2907f9865E+0x12> + 8000fbe4: 6522 ld a0,8(sp) + 8000fbe6: 00000097 auipc ra,0x0 + 8000fbea: 04a080e7 jalr 74(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8000fbee: e02a sd a0,0(sp) + 8000fbf0: a009 j 8000fbf2 <_ZN119_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$core..ptr..unique..Unique$LT$T$GT$$GT$$GT$4from17h163e90b2907f9865E+0x20> + } + 8000fbf2: 6502 ld a0,0(sp) + 8000fbf4: 60e2 ld ra,24(sp) + 8000fbf6: 6105 addi sp,sp,32 + 8000fbf8: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h04fc63e3eb51e989E: + +000000008000fbfa <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h04fc63e3eb51e989E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fbfa: 1141 addi sp,sp,-16 + 8000fbfc: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fbfe: e02a sd a0,0(sp) + } + 8000fc00: 0141 addi sp,sp,16 + 8000fc02: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h0fdb76b0b758b1a8E: + +000000008000fc04 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h0fdb76b0b758b1a8E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc04: 1141 addi sp,sp,-16 + 8000fc06: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc08: e02a sd a0,0(sp) + } + 8000fc0a: 0141 addi sp,sp,16 + 8000fc0c: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h39caf58a5e84bcebE: + +000000008000fc0e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h39caf58a5e84bcebE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc0e: 1141 addi sp,sp,-16 + 8000fc10: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc12: e02a sd a0,0(sp) + } + 8000fc14: 0141 addi sp,sp,16 + 8000fc16: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h4fef4ea805603accE: + +000000008000fc18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h4fef4ea805603accE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc18: 1141 addi sp,sp,-16 + 8000fc1a: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc1c: e02a sd a0,0(sp) + } + 8000fc1e: 0141 addi sp,sp,16 + 8000fc20: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h590958fa24c9c418E: + +000000008000fc22 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h590958fa24c9c418E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc22: 1101 addi sp,sp,-32 + 8000fc24: e82a sd a0,16(sp) + 8000fc26: ec2e sd a1,24(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc28: e02a sd a0,0(sp) + 8000fc2a: e42e sd a1,8(sp) + } + 8000fc2c: 6105 addi sp,sp,32 + 8000fc2e: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E: + +000000008000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc30: 1141 addi sp,sp,-16 + 8000fc32: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc34: e02a sd a0,0(sp) + } + 8000fc36: 0141 addi sp,sp,16 + 8000fc38: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h8c61f83afe42e5a2E: + +000000008000fc3a <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h8c61f83afe42e5a2E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc3a: 1141 addi sp,sp,-16 + 8000fc3c: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc3e: e02a sd a0,0(sp) + } + 8000fc40: 0141 addi sp,sp,16 + 8000fc42: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hb7c70ed4b69f095cE: + +000000008000fc44 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hb7c70ed4b69f095cE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc44: 1141 addi sp,sp,-16 + 8000fc46: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc48: e02a sd a0,0(sp) + } + 8000fc4a: 0141 addi sp,sp,16 + 8000fc4c: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hd62713267129dcbeE: + +000000008000fc4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hd62713267129dcbeE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc4e: 1141 addi sp,sp,-16 + 8000fc50: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc52: e02a sd a0,0(sp) + } + 8000fc54: 0141 addi sp,sp,16 + 8000fc56: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17he8eb4f7b6f10823eE: + +000000008000fc58 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17he8eb4f7b6f10823eE>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc58: 1141 addi sp,sp,-16 + 8000fc5a: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc5c: e02a sd a0,0(sp) + } + 8000fc5e: 0141 addi sp,sp,16 + 8000fc60: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hf41e3912db402547E: + +000000008000fc62 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hf41e3912db402547E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc62: 1141 addi sp,sp,-16 + 8000fc64: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc66: e02a sd a0,0(sp) + } + 8000fc68: 0141 addi sp,sp,16 + 8000fc6a: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hfa67d7222a1c22a5E: + +000000008000fc6c <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hfa67d7222a1c22a5E>: + pub const unsafe fn new_unchecked(ptr: *mut T) -> Self { + 8000fc6c: 1141 addi sp,sp,-16 + 8000fc6e: e42a sd a0,8(sp) + unsafe { NonNull { pointer: ptr as _ } } + 8000fc70: e02a sd a0,0(sp) + } + 8000fc72: 0141 addi sp,sp,16 + 8000fc74: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E: + +000000008000fc76 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E>: + pub fn new(ptr: *mut T) -> Option { + 8000fc76: 7179 addi sp,sp,-48 + 8000fc78: f406 sd ra,40(sp) + 8000fc7a: e42a sd a0,8(sp) + 8000fc7c: f02a sd a0,32(sp) + if !ptr.is_null() { + 8000fc7e: 00011097 auipc ra,0x11 + 8000fc82: 9d2080e7 jalr -1582(ra) # 80020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E> + 8000fc86: e82a sd a0,16(sp) + 8000fc88: a009 j 8000fc8a <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E+0x14> + 8000fc8a: 6542 ld a0,16(sp) + 8000fc8c: e909 bnez a0,8000fc9e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E+0x28> + 8000fc8e: a009 j 8000fc90 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E+0x1a> + Some(unsafe { Self::new_unchecked(ptr) }) + 8000fc90: 6522 ld a0,8(sp) + 8000fc92: 00000097 auipc ra,0x0 + 8000fc96: f9e080e7 jalr -98(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8000fc9a: e02a sd a0,0(sp) + 8000fc9c: a021 j 8000fca4 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E+0x2e> + 8000fc9e: 4501 li a0,0 + None + 8000fca0: ec2a sd a0,24(sp) + if !ptr.is_null() { + 8000fca2: a021 j 8000fcaa <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E+0x34> + Some(unsafe { Self::new_unchecked(ptr) }) + 8000fca4: 6502 ld a0,0(sp) + 8000fca6: ec2a sd a0,24(sp) + if !ptr.is_null() { + 8000fca8: a009 j 8000fcaa <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h3fba838d6c025de4E+0x34> + } + 8000fcaa: 6562 ld a0,24(sp) + 8000fcac: 70a2 ld ra,40(sp) + 8000fcae: 6145 addi sp,sp,48 + 8000fcb0: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE: + +000000008000fcb2 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE>: + pub fn new(ptr: *mut T) -> Option { + 8000fcb2: 7179 addi sp,sp,-48 + 8000fcb4: f406 sd ra,40(sp) + 8000fcb6: e42a sd a0,8(sp) + 8000fcb8: f02a sd a0,32(sp) + if !ptr.is_null() { + 8000fcba: 00002097 auipc ra,0x2 + 8000fcbe: 396080e7 jalr 918(ra) # 80012050 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E> + 8000fcc2: e82a sd a0,16(sp) + 8000fcc4: a009 j 8000fcc6 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE+0x14> + 8000fcc6: 6542 ld a0,16(sp) + 8000fcc8: e909 bnez a0,8000fcda <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE+0x28> + 8000fcca: a009 j 8000fccc <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE+0x1a> + Some(unsafe { Self::new_unchecked(ptr) }) + 8000fccc: 6522 ld a0,8(sp) + 8000fcce: 00000097 auipc ra,0x0 + 8000fcd2: f4a080e7 jalr -182(ra) # 8000fc18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h4fef4ea805603accE> + 8000fcd6: e02a sd a0,0(sp) + 8000fcd8: a021 j 8000fce0 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE+0x2e> + 8000fcda: 4501 li a0,0 + None + 8000fcdc: ec2a sd a0,24(sp) + if !ptr.is_null() { + 8000fcde: a021 j 8000fce6 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE+0x34> + Some(unsafe { Self::new_unchecked(ptr) }) + 8000fce0: 6502 ld a0,0(sp) + 8000fce2: ec2a sd a0,24(sp) + if !ptr.is_null() { + 8000fce4: a009 j 8000fce6 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE+0x34> + } + 8000fce6: 6562 ld a0,24(sp) + 8000fce8: 70a2 ld ra,40(sp) + 8000fcea: 6145 addi sp,sp,48 + 8000fcec: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h280b1a52f32358efE: + +000000008000fcee <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h280b1a52f32358efE>: + pub const fn cast(self) -> NonNull { + 8000fcee: 7179 addi sp,sp,-48 + 8000fcf0: f406 sd ra,40(sp) + 8000fcf2: ec2a sd a0,24(sp) + 8000fcf4: f02e sd a1,32(sp) + unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } + 8000fcf6: 00000097 auipc ra,0x0 + 8000fcfa: 160080e7 jalr 352(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000fcfe: e82a sd a0,16(sp) + 8000fd00: a009 j 8000fd02 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h280b1a52f32358efE+0x14> + 8000fd02: 6542 ld a0,16(sp) + 8000fd04: 00000097 auipc ra,0x0 + 8000fd08: f36080e7 jalr -202(ra) # 8000fc3a <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h8c61f83afe42e5a2E> + 8000fd0c: e42a sd a0,8(sp) + 8000fd0e: a009 j 8000fd10 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h280b1a52f32358efE+0x22> + } + 8000fd10: 6522 ld a0,8(sp) + 8000fd12: 70a2 ld ra,40(sp) + 8000fd14: 6145 addi sp,sp,48 + 8000fd16: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h4354690cb24a4e56E: + +000000008000fd18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h4354690cb24a4e56E>: + pub const fn cast(self) -> NonNull { + 8000fd18: 7179 addi sp,sp,-48 + 8000fd1a: f406 sd ra,40(sp) + 8000fd1c: ec2a sd a0,24(sp) + 8000fd1e: f02e sd a1,32(sp) + unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } + 8000fd20: 00000097 auipc ra,0x0 + 8000fd24: 136080e7 jalr 310(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000fd28: e82a sd a0,16(sp) + 8000fd2a: a009 j 8000fd2c <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h4354690cb24a4e56E+0x14> + 8000fd2c: 6542 ld a0,16(sp) + 8000fd2e: 00000097 auipc ra,0x0 + 8000fd32: ed6080e7 jalr -298(ra) # 8000fc04 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h0fdb76b0b758b1a8E> + 8000fd36: e42a sd a0,8(sp) + 8000fd38: a009 j 8000fd3a <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h4354690cb24a4e56E+0x22> + } + 8000fd3a: 6522 ld a0,8(sp) + 8000fd3c: 70a2 ld ra,40(sp) + 8000fd3e: 6145 addi sp,sp,48 + 8000fd40: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h535f2787d46a2a35E: + +000000008000fd42 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h535f2787d46a2a35E>: + pub const fn cast(self) -> NonNull { + 8000fd42: 7179 addi sp,sp,-48 + 8000fd44: f406 sd ra,40(sp) + 8000fd46: ec2a sd a0,24(sp) + 8000fd48: f02e sd a1,32(sp) + unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } + 8000fd4a: 00000097 auipc ra,0x0 + 8000fd4e: 10c080e7 jalr 268(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000fd52: e82a sd a0,16(sp) + 8000fd54: a009 j 8000fd56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h535f2787d46a2a35E+0x14> + 8000fd56: 6542 ld a0,16(sp) + 8000fd58: 00000097 auipc ra,0x0 + 8000fd5c: eb6080e7 jalr -330(ra) # 8000fc0e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h39caf58a5e84bcebE> + 8000fd60: e42a sd a0,8(sp) + 8000fd62: a009 j 8000fd64 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h535f2787d46a2a35E+0x22> + } + 8000fd64: 6522 ld a0,8(sp) + 8000fd66: 70a2 ld ra,40(sp) + 8000fd68: 6145 addi sp,sp,48 + 8000fd6a: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h7831112f0067c5f4E: + +000000008000fd6c <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h7831112f0067c5f4E>: + pub const fn cast(self) -> NonNull { + 8000fd6c: 1101 addi sp,sp,-32 + 8000fd6e: ec06 sd ra,24(sp) + 8000fd70: e82a sd a0,16(sp) + unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } + 8000fd72: 00000097 auipc ra,0x0 + 8000fd76: 10e080e7 jalr 270(ra) # 8000fe80 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE> + 8000fd7a: e42a sd a0,8(sp) + 8000fd7c: a009 j 8000fd7e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h7831112f0067c5f4E+0x12> + 8000fd7e: 6522 ld a0,8(sp) + 8000fd80: 00000097 auipc ra,0x0 + 8000fd84: eb0080e7 jalr -336(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8000fd88: e02a sd a0,0(sp) + 8000fd8a: a009 j 8000fd8c <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h7831112f0067c5f4E+0x20> + } + 8000fd8c: 6502 ld a0,0(sp) + 8000fd8e: 60e2 ld ra,24(sp) + 8000fd90: 6105 addi sp,sp,32 + 8000fd92: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h85615dabbcfe0ebdE: + +000000008000fd94 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h85615dabbcfe0ebdE>: + pub const fn cast(self) -> NonNull { + 8000fd94: 7179 addi sp,sp,-48 + 8000fd96: f406 sd ra,40(sp) + 8000fd98: ec2a sd a0,24(sp) + 8000fd9a: f02e sd a1,32(sp) + unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } + 8000fd9c: 00000097 auipc ra,0x0 + 8000fda0: 0ba080e7 jalr 186(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000fda4: e82a sd a0,16(sp) + 8000fda6: a009 j 8000fda8 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h85615dabbcfe0ebdE+0x14> + 8000fda8: 6542 ld a0,16(sp) + 8000fdaa: 00000097 auipc ra,0x0 + 8000fdae: ec2080e7 jalr -318(ra) # 8000fc6c <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hfa67d7222a1c22a5E> + 8000fdb2: e42a sd a0,8(sp) + 8000fdb4: a009 j 8000fdb6 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h85615dabbcfe0ebdE+0x22> + } + 8000fdb6: 6522 ld a0,8(sp) + 8000fdb8: 70a2 ld ra,40(sp) + 8000fdba: 6145 addi sp,sp,48 + 8000fdbc: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17he3c6d28f0e68e811E: + +000000008000fdbe <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17he3c6d28f0e68e811E>: + pub const fn cast(self) -> NonNull { + 8000fdbe: 7179 addi sp,sp,-48 + 8000fdc0: f406 sd ra,40(sp) + 8000fdc2: ec2a sd a0,24(sp) + 8000fdc4: f02e sd a1,32(sp) + unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } + 8000fdc6: 00000097 auipc ra,0x0 + 8000fdca: 090080e7 jalr 144(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000fdce: e82a sd a0,16(sp) + 8000fdd0: a009 j 8000fdd2 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17he3c6d28f0e68e811E+0x14> + 8000fdd2: 6542 ld a0,16(sp) + 8000fdd4: 00000097 auipc ra,0x0 + 8000fdd8: e5c080e7 jalr -420(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8000fddc: e42a sd a0,8(sp) + 8000fdde: a009 j 8000fde0 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17he3c6d28f0e68e811E+0x22> + } + 8000fde0: 6522 ld a0,8(sp) + 8000fde2: 70a2 ld ra,40(sp) + 8000fde4: 6145 addi sp,sp,48 + 8000fde6: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17hf78234e23d9835f1E: + +000000008000fde8 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17hf78234e23d9835f1E>: + pub const fn cast(self) -> NonNull { + 8000fde8: 7179 addi sp,sp,-48 + 8000fdea: f406 sd ra,40(sp) + 8000fdec: ec2a sd a0,24(sp) + 8000fdee: f02e sd a1,32(sp) + unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) } + 8000fdf0: 00000097 auipc ra,0x0 + 8000fdf4: 066080e7 jalr 102(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000fdf8: e82a sd a0,16(sp) + 8000fdfa: a009 j 8000fdfc <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17hf78234e23d9835f1E+0x14> + 8000fdfc: 6542 ld a0,16(sp) + 8000fdfe: 00000097 auipc ra,0x0 + 8000fe02: e46080e7 jalr -442(ra) # 8000fc44 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17hb7c70ed4b69f095cE> + 8000fe06: e42a sd a0,8(sp) + 8000fe08: a009 j 8000fe0a <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17hf78234e23d9835f1E+0x22> + } + 8000fe0a: 6522 ld a0,8(sp) + 8000fe0c: 70a2 ld ra,40(sp) + 8000fe0e: 6145 addi sp,sp,48 + 8000fe10: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_mut17hdd17b08112763412E: + +000000008000fe12 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_mut17hdd17b08112763412E>: + pub unsafe fn as_mut<'a>(&mut self) -> &'a mut T { + 8000fe12: 1101 addi sp,sp,-32 + 8000fe14: ec06 sd ra,24(sp) + 8000fe16: e82a sd a0,16(sp) + unsafe { &mut *self.as_ptr() } + 8000fe18: 6108 ld a0,0(a0) + 8000fe1a: 00000097 auipc ra,0x0 + 8000fe1e: 01c080e7 jalr 28(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 8000fe22: e42a sd a0,8(sp) + 8000fe24: a009 j 8000fe26 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_mut17hdd17b08112763412E+0x14> + } + 8000fe26: 6522 ld a0,8(sp) + 8000fe28: 60e2 ld ra,24(sp) + 8000fe2a: 6105 addi sp,sp,32 + 8000fe2c: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h4054fe6794409e65E: + +000000008000fe2e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h4054fe6794409e65E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe2e: 1141 addi sp,sp,-16 + 8000fe30: e42a sd a0,8(sp) + } + 8000fe32: 0141 addi sp,sp,16 + 8000fe34: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E: + +000000008000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe36: 1141 addi sp,sp,-16 + 8000fe38: e42a sd a0,8(sp) + } + 8000fe3a: 0141 addi sp,sp,16 + 8000fe3c: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h593c20a0c1123d02E: + +000000008000fe3e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h593c20a0c1123d02E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe3e: 1141 addi sp,sp,-16 + 8000fe40: e42a sd a0,8(sp) + } + 8000fe42: 0141 addi sp,sp,16 + 8000fe44: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h6e70ae75457a689cE: + +000000008000fe46 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h6e70ae75457a689cE>: + pub const fn as_ptr(self) -> *mut T { + 8000fe46: 1141 addi sp,sp,-16 + 8000fe48: e42a sd a0,8(sp) + } + 8000fe4a: 0141 addi sp,sp,16 + 8000fe4c: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E: + +000000008000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe4e: 1141 addi sp,sp,-16 + 8000fe50: e42a sd a0,8(sp) + } + 8000fe52: 0141 addi sp,sp,16 + 8000fe54: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E: + +000000008000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe56: 1141 addi sp,sp,-16 + 8000fe58: e02a sd a0,0(sp) + 8000fe5a: e42e sd a1,8(sp) + } + 8000fe5c: 0141 addi sp,sp,16 + 8000fe5e: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h911cddd192dc1ebbE: + +000000008000fe60 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h911cddd192dc1ebbE>: + pub const fn as_ptr(self) -> *mut T { + 8000fe60: 1141 addi sp,sp,-16 + 8000fe62: e42a sd a0,8(sp) + } + 8000fe64: 0141 addi sp,sp,16 + 8000fe66: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h9b02cb35a46880f1E: + +000000008000fe68 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h9b02cb35a46880f1E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe68: 1141 addi sp,sp,-16 + 8000fe6a: e42a sd a0,8(sp) + } + 8000fe6c: 0141 addi sp,sp,16 + 8000fe6e: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17habcb33ad0b4dc302E: + +000000008000fe70 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17habcb33ad0b4dc302E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe70: 1141 addi sp,sp,-16 + 8000fe72: e42a sd a0,8(sp) + } + 8000fe74: 0141 addi sp,sp,16 + 8000fe76: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17haf282fdd0407a8a4E: + +000000008000fe78 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17haf282fdd0407a8a4E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe78: 1141 addi sp,sp,-16 + 8000fe7a: e42a sd a0,8(sp) + } + 8000fe7c: 0141 addi sp,sp,16 + 8000fe7e: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE: + +000000008000fe80 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE>: + pub const fn as_ptr(self) -> *mut T { + 8000fe80: 1141 addi sp,sp,-16 + 8000fe82: e42a sd a0,8(sp) + } + 8000fe84: 0141 addi sp,sp,16 + 8000fe86: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hd337d3c0c1677ef4E: + +000000008000fe88 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hd337d3c0c1677ef4E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe88: 1141 addi sp,sp,-16 + 8000fe8a: e42a sd a0,8(sp) + } + 8000fe8c: 0141 addi sp,sp,16 + 8000fe8e: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hfb12dd33ea904ed8E: + +000000008000fe90 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hfb12dd33ea904ed8E>: + pub const fn as_ptr(self) -> *mut T { + 8000fe90: 1141 addi sp,sp,-16 + 8000fe92: e42a sd a0,8(sp) + } + 8000fe94: 0141 addi sp,sp,16 + 8000fe96: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ref17hb658835e636047c4E: + +000000008000fe98 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ref17hb658835e636047c4E>: + pub unsafe fn as_ref<'a>(&self) -> &'a T { + 8000fe98: 1101 addi sp,sp,-32 + 8000fe9a: ec06 sd ra,24(sp) + 8000fe9c: e82a sd a0,16(sp) + unsafe { &*self.as_ptr() } + 8000fe9e: 6108 ld a0,0(a0) + 8000fea0: 00000097 auipc ra,0x0 + 8000fea4: fe0080e7 jalr -32(ra) # 8000fe80 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hc25f2e50aadb25dbE> + 8000fea8: e42a sd a0,8(sp) + 8000feaa: a009 j 8000feac <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ref17hb658835e636047c4E+0x14> + } + 8000feac: 6522 ld a0,8(sp) + 8000feae: 60e2 ld ra,24(sp) + 8000feb0: 6105 addi sp,sp,32 + 8000feb2: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$10as_mut_ptr17h1a3f7b42026c1de6E: + +000000008000feb4 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$10as_mut_ptr17h1a3f7b42026c1de6E>: + pub const fn as_mut_ptr(self) -> *mut T { + 8000feb4: 7179 addi sp,sp,-48 + 8000feb6: f406 sd ra,40(sp) + 8000feb8: ec2a sd a0,24(sp) + 8000feba: f02e sd a1,32(sp) + self.as_non_null_ptr().as_ptr() + 8000febc: 00000097 auipc ra,0x0 + 8000fec0: 022080e7 jalr 34(ra) # 8000fede <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$15as_non_null_ptr17h8962585bd18d4862E> + 8000fec4: e82a sd a0,16(sp) + 8000fec6: a009 j 8000fec8 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$10as_mut_ptr17h1a3f7b42026c1de6E+0x14> + 8000fec8: 6542 ld a0,16(sp) + 8000feca: 00000097 auipc ra,0x0 + 8000fece: f84080e7 jalr -124(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000fed2: e42a sd a0,8(sp) + 8000fed4: a009 j 8000fed6 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$10as_mut_ptr17h1a3f7b42026c1de6E+0x22> + } + 8000fed6: 6522 ld a0,8(sp) + 8000fed8: 70a2 ld ra,40(sp) + 8000feda: 6145 addi sp,sp,48 + 8000fedc: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$15as_non_null_ptr17h8962585bd18d4862E: + +000000008000fede <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$15as_non_null_ptr17h8962585bd18d4862E>: + pub const fn as_non_null_ptr(self) -> NonNull { + 8000fede: 7139 addi sp,sp,-64 + 8000fee0: fc06 sd ra,56(sp) + 8000fee2: f42a sd a0,40(sp) + 8000fee4: f82e sd a1,48(sp) + unsafe { NonNull::new_unchecked(self.as_ptr().as_mut_ptr()) } + 8000fee6: 00000097 auipc ra,0x0 + 8000feea: f70080e7 jalr -144(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000feee: ec2a sd a0,24(sp) + 8000fef0: f02e sd a1,32(sp) + 8000fef2: a009 j 8000fef4 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$15as_non_null_ptr17h8962585bd18d4862E+0x16> + 8000fef4: 7582 ld a1,32(sp) + 8000fef6: 6562 ld a0,24(sp) + 8000fef8: 00010097 auipc ra,0x10 + 8000fefc: 77a080e7 jalr 1914(ra) # 80020672 <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h80398cc0098c8b0fE> + 8000ff00: e82a sd a0,16(sp) + 8000ff02: a009 j 8000ff04 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$15as_non_null_ptr17h8962585bd18d4862E+0x26> + 8000ff04: 6542 ld a0,16(sp) + 8000ff06: 00000097 auipc ra,0x0 + 8000ff0a: d2a080e7 jalr -726(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8000ff0e: e42a sd a0,8(sp) + 8000ff10: a009 j 8000ff12 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$15as_non_null_ptr17h8962585bd18d4862E+0x34> + } + 8000ff12: 6522 ld a0,8(sp) + 8000ff14: 70e2 ld ra,56(sp) + 8000ff16: 6121 addi sp,sp,64 + 8000ff18: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E: + +000000008000ff1a <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E>: + pub const fn slice_from_raw_parts(data: NonNull, len: usize) -> Self { + 8000ff1a: 715d addi sp,sp,-80 + 8000ff1c: e486 sd ra,72(sp) + 8000ff1e: f42e sd a1,40(sp) + 8000ff20: fc2a sd a0,56(sp) + 8000ff22: e0ae sd a1,64(sp) + unsafe { Self::new_unchecked(super::slice_from_raw_parts_mut(data.as_ptr(), len)) } + 8000ff24: 00000097 auipc ra,0x0 + 8000ff28: f2a080e7 jalr -214(ra) # 8000fe4e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h729713db2b300d39E> + 8000ff2c: f82a sd a0,48(sp) + 8000ff2e: a009 j 8000ff30 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E+0x16> + 8000ff30: 75a2 ld a1,40(sp) + 8000ff32: 7542 ld a0,48(sp) + 8000ff34: 00012097 auipc ra,0x12 + 8000ff38: 742080e7 jalr 1858(ra) # 80022676 <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E> + 8000ff3c: ec2a sd a0,24(sp) + 8000ff3e: f02e sd a1,32(sp) + 8000ff40: a009 j 8000ff42 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E+0x28> + 8000ff42: 7582 ld a1,32(sp) + 8000ff44: 6562 ld a0,24(sp) + 8000ff46: 00000097 auipc ra,0x0 + 8000ff4a: cdc080e7 jalr -804(ra) # 8000fc22 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h590958fa24c9c418E> + 8000ff4e: e42a sd a0,8(sp) + 8000ff50: e82e sd a1,16(sp) + 8000ff52: a009 j 8000ff54 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$20slice_from_raw_parts17h7a0aec34eacd5d12E+0x3a> + } + 8000ff54: 65c2 ld a1,16(sp) + 8000ff56: 6522 ld a0,8(sp) + 8000ff58: 60a6 ld ra,72(sp) + 8000ff5a: 6161 addi sp,sp,80 + 8000ff5c: 8082 ret + +Disassembly of section .text._ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$3len17h17d848b65404492bE: + +000000008000ff5e <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$3len17h17d848b65404492bE>: + pub const fn len(self) -> usize { + 8000ff5e: 7179 addi sp,sp,-48 + 8000ff60: f406 sd ra,40(sp) + 8000ff62: ec2a sd a0,24(sp) + 8000ff64: f02e sd a1,32(sp) + self.as_ptr().len() + 8000ff66: 00000097 auipc ra,0x0 + 8000ff6a: ef0080e7 jalr -272(ra) # 8000fe56 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h8eef1d8fb3aa5851E> + 8000ff6e: e42a sd a0,8(sp) + 8000ff70: e82e sd a1,16(sp) + 8000ff72: a009 j 8000ff74 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$3len17h17d848b65404492bE+0x16> + 8000ff74: 65c2 ld a1,16(sp) + 8000ff76: 6522 ld a0,8(sp) + 8000ff78: ffff9097 auipc ra,0xffff9 + 8000ff7c: 1f6080e7 jalr 502(ra) # 8000916e <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$3len17hf44174276422642dE> + 8000ff80: e02a sd a0,0(sp) + 8000ff82: a009 j 8000ff84 <_ZN4core3ptr8non_null26NonNull$LT$$u5b$T$u5d$$GT$3len17h17d848b65404492bE+0x26> + } + 8000ff84: 6502 ld a0,0(sp) + 8000ff86: 70a2 ld ra,40(sp) + 8000ff88: 6145 addi sp,sp,48 + 8000ff8a: 8082 ret + +Disassembly of section .text._ZN98_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h99a3612f25da96c9E: + +000000008000ff8c <_ZN98_$LT$core..ptr..non_null..NonNull$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h99a3612f25da96c9E>: +} + +#[stable(feature = "nonnull", since = "1.25.0")] +impl From<&mut T> for NonNull { + #[inline] + fn from(reference: &mut T) -> Self { + 8000ff8c: 1141 addi sp,sp,-16 + 8000ff8e: e42a sd a0,8(sp) + // SAFETY: A mutable reference cannot be null. + unsafe { NonNull { pointer: reference as *mut T } } + 8000ff90: e02a sd a0,0(sp) + } + 8000ff92: 0141 addi sp,sp,16 + 8000ff94: 8082 ret + +Disassembly of section .text._ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2eq17h94523e3cd63d6752E: + +000000008000ff96 <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2eq17h94523e3cd63d6752E>: +#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)] + 8000ff96: 7179 addi sp,sp,-48 + 8000ff98: f406 sd ra,40(sp) + 8000ff9a: e42a sd a0,8(sp) + 8000ff9c: e82e sd a1,16(sp) +pub struct Wrapping(#[stable(feature = "rust1", since = "1.0.0")] pub T); + 8000ff9e: ec2e sd a1,24(sp) + 8000ffa0: f02a sd a0,32(sp) + 8000ffa2: 0000c097 auipc ra,0xc + 8000ffa6: 5da080e7 jalr 1498(ra) # 8001c57c <_ZN4core3cmp5impls56_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$usize$GT$2eq17hb88014a76b34c88fE> + 8000ffaa: e02a sd a0,0(sp) + 8000ffac: a009 j 8000ffae <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2eq17h94523e3cd63d6752E+0x18> +#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)] + 8000ffae: 6502 ld a0,0(sp) + 8000ffb0: 70a2 ld ra,40(sp) + 8000ffb2: 6145 addi sp,sp,48 + 8000ffb4: 8082 ret + +Disassembly of section .text._ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2ne17h2d3bd6a577efe0b1E: + +000000008000ffb6 <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2ne17h2d3bd6a577efe0b1E>: + 8000ffb6: 7179 addi sp,sp,-48 + 8000ffb8: f406 sd ra,40(sp) + 8000ffba: e42a sd a0,8(sp) + 8000ffbc: e82e sd a1,16(sp) +pub struct Wrapping(#[stable(feature = "rust1", since = "1.0.0")] pub T); + 8000ffbe: ec2e sd a1,24(sp) + 8000ffc0: f02a sd a0,32(sp) + 8000ffc2: 0000c097 auipc ra,0xc + 8000ffc6: 5ce080e7 jalr 1486(ra) # 8001c590 <_ZN4core3cmp5impls56_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$usize$GT$2ne17h958431dd9ff1337dE> + 8000ffca: e02a sd a0,0(sp) + 8000ffcc: a009 j 8000ffce <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2ne17h2d3bd6a577efe0b1E+0x18> +#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)] + 8000ffce: 6502 ld a0,0(sp) + 8000ffd0: 70a2 ld ra,40(sp) + 8000ffd2: 6145 addi sp,sp,48 + 8000ffd4: 8082 ret + +Disassembly of section .text._ZN4core4hint9spin_loop17h176cebad2d7c26adE: + +000000008000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE>: + // SAFETY: the `cfg` attr ensures that we only execute this on arm targets + // with support for the v6 feature. + unsafe { crate::arch::arm::__yield() }; + } + } +} + 8000ffd6: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3log3Log4init17h739bf7c5bf880a35E: + +000000008000ffd8 <_ZN6kernel2fs3log3Log4init17h739bf7c5bf880a35E>: + pub unsafe fn init(&mut self, dev: u32) { + 8000ffd8: 7155 addi sp,sp,-208 + 8000ffda: e586 sd ra,200(sp) + 8000ffdc: f82a sd a0,48(sp) + 8000ffde: 862e mv a2,a1 + 8000ffe0: fc32 sd a2,56(sp) + 8000ffe2: e92a sd a0,144(sp) + 8000ffe4: cf2e sw a1,156(sp) + debug_assert!(mem::size_of::() < BSIZE); + 8000ffe6: a009 j 8000ffe8 <_ZN6kernel2fs3log3Log4init17h739bf7c5bf880a35E+0x10> + 8000ffe8: 4505 li a0,1 + 8000ffea: e10d bnez a0,8001000c <.LBB0_13+0x16> + 8000ffec: a009 j 8000ffee <.LBB0_12> + +000000008000ffee <.LBB0_12>: + 8000ffee: 00019517 auipc a0,0x19 + 8000fff2: 6c150513 addi a0,a0,1729 # 800296af <.L__unnamed_1> + +000000008000fff6 <.LBB0_13>: + 8000fff6: 00019617 auipc a2,0x19 + 8000fffa: 70260613 addi a2,a2,1794 # 800296f8 <.L__unnamed_2> + 8000fffe: 03500593 li a1,53 + 80010002: 00013097 auipc ra,0x13 + 80010006: 142080e7 jalr 322(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001000a: 0000 unimp + 8001000c: 4521 li a0,8 + 8001000e: f42a sd a0,40(sp) + 80010010: fd2a sd a0,184(sp) + debug_assert_eq!(mem::align_of::() % mem::align_of::(), 0); + 80010012: a009 j 80010014 <.LBB0_13+0x1e> + 80010014: 4511 li a0,4 + 80010016: f02a sd a0,32(sp) + 80010018: e1aa sd a0,192(sp) + 8001001a: a009 j 8001001c <.LBB0_13+0x26> + 8001001c: 7502 ld a0,32(sp) + 8001001e: 4581 li a1,0 + 80010020: 08b50363 beq a0,a1,800100a6 <.LBB0_17> + 80010024: a009 j 80010026 <.LBB0_13+0x30> + 80010026: 7522 ld a0,40(sp) + 80010028: 7582 ld a1,32(sp) + 8001002a: 02b57533 remu a0,a0,a1 + 8001002e: e8aa sd a0,80(sp) + 80010030: 0890 addi a2,sp,80 + 80010032: e832 sd a2,16(sp) + 80010034: e0b2 sd a2,64(sp) + +0000000080010036 <.LBB0_14>: + 80010036: 00018597 auipc a1,0x18 + 8001003a: 82258593 addi a1,a1,-2014 # 80027858 <.L__unnamed_6+0xc8> + 8001003e: ec2e sd a1,24(sp) + 80010040: e4ae sd a1,72(sp) + 80010042: f132 sd a2,160(sp) + 80010044: f52e sd a1,168(sp) + 80010046: 4581 li a1,0 + 80010048: 02b50363 beq a0,a1,8001006e <.LBB0_16> + 8001004c: a009 j 8001004e <.LBB0_14+0x18> + 8001004e: 6662 ld a2,24(sp) + 80010050: 65c2 ld a1,16(sp) + 80010052: 4501 li a0,0 + 80010054: 04a10fa3 sb a0,95(sp) + 80010058: f0aa sd a0,96(sp) + +000000008001005a <.LBB0_15>: + 8001005a: 00019717 auipc a4,0x19 + 8001005e: 71670713 addi a4,a4,1814 # 80029770 <.L__unnamed_4> + 80010062: 1094 addi a3,sp,96 + 80010064: 00011097 auipc ra,0x11 + 80010068: 80e080e7 jalr -2034(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + ... + +000000008001006e <.LBB0_16>: + let (start, size) = SUPER_BLOCK.read_log(); + 8001006e: 00054517 auipc a0,0x54 + 80010072: 03250513 addi a0,a0,50 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 80010076: ffff8097 auipc ra,0xffff8 + 8001007a: 82e080e7 jalr -2002(ra) # 800078a4 <_ZN6kernel2fs10superblock10SuperBlock8read_log17h7cc8d407eaa9ef0fE> + 8001007e: e02a sd a0,0(sp) + 80010080: e42e sd a1,8(sp) + 80010082: a009 j 80010084 <.LBB0_16+0x16> + 80010084: 7542 ld a0,48(sp) + 80010086: 75e2 ld a1,56(sp) + 80010088: 6622 ld a2,8(sp) + 8001008a: 6682 ld a3,0(sp) + 8001008c: d936 sw a3,176(sp) + 8001008e: db32 sw a2,180(sp) + self.start = start; + 80010090: c114 sw a3,0(a0) + self.size = size; + 80010092: c150 sw a2,4(a0) + self.dev = dev; + 80010094: c50c sw a1,8(a0) + self.recover(); + 80010096: 00000097 auipc ra,0x0 + 8001009a: 02e080e7 jalr 46(ra) # 800100c4 <_ZN6kernel2fs3log3Log7recover17h4d88efc42f980b61E> + 8001009e: a009 j 800100a0 <.LBB0_16+0x32> + } + 800100a0: 60ae ld ra,200(sp) + 800100a2: 6169 addi sp,sp,208 + 800100a4: 8082 ret + +00000000800100a6 <.LBB0_17>: + debug_assert_eq!(mem::align_of::() % mem::align_of::(), 0); + 800100a6: 00019517 auipc a0,0x19 + 800100aa: 68a50513 addi a0,a0,1674 # 80029730 + +00000000800100ae <.LBB0_18>: + 800100ae: 00019617 auipc a2,0x19 + 800100b2: 66260613 addi a2,a2,1634 # 80029710 <.L__unnamed_5> + 800100b6: 03900593 li a1,57 + 800100ba: 00013097 auipc ra,0x13 + 800100be: 08a080e7 jalr 138(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs3log3Log7recover17h4d88efc42f980b61E: + +00000000800100c4 <_ZN6kernel2fs3log3Log7recover17h4d88efc42f980b61E>: + fn recover(&mut self) { + 800100c4: 7171 addi sp,sp,-176 + 800100c6: f506 sd ra,168(sp) + 800100c8: e02a sd a0,0(sp) + 800100ca: f12a sd a0,160(sp) + +00000000800100cc <.LBB1_13>: + println!("file system: checking logs"); + 800100cc: 00019597 auipc a1,0x19 + 800100d0: 6dc58593 addi a1,a1,1756 # 800297a8 <.L__unnamed_6> + +00000000800100d4 <.LBB1_14>: + 800100d4: 00019697 auipc a3,0x19 + 800100d8: 6e468693 addi a3,a3,1764 # 800297b8 <.L__unnamed_20> + 800100dc: 0808 addi a0,sp,16 + 800100de: 4605 li a2,1 + 800100e0: 4701 li a4,0 + 800100e2: ffff5097 auipc ra,0xffff5 + 800100e6: 4a8080e7 jalr 1192(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800100ea: a009 j 800100ec <.LBB1_14+0x18> + 800100ec: 0808 addi a0,sp,16 + 800100ee: 0000f097 auipc ra,0xf + 800100f2: b0a080e7 jalr -1270(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800100f6: a009 j 800100f8 <.LBB1_14+0x24> + self.read_head(); + 800100f8: 6502 ld a0,0(sp) + 800100fa: 00000097 auipc ra,0x0 + 800100fe: 092080e7 jalr 146(ra) # 8001018c <_ZN6kernel2fs3log3Log9read_head17hbc6584ed4df3a629E> + 80010102: a009 j 80010104 <.LBB1_14+0x30> + if self.lh.len > 0 { + 80010104: 6502 ld a0,0(sp) + 80010106: 4908 lw a0,16(a0) + 80010108: 4581 li a1,0 + 8001010a: 02b50363 beq a0,a1,80010130 <.LBB1_17> + 8001010e: a009 j 80010110 <.LBB1_15> + +0000000080010110 <.LBB1_15>: + println!("file system: recovering from logs"); + 80010110: 00019597 auipc a1,0x19 + 80010114: 6d058593 addi a1,a1,1744 # 800297e0 <.L__unnamed_8> + +0000000080010118 <.LBB1_16>: + 80010118: 00019697 auipc a3,0x19 + 8001011c: 6a068693 addi a3,a3,1696 # 800297b8 <.L__unnamed_20> + 80010120: 0088 addi a0,sp,64 + 80010122: 4605 li a2,1 + 80010124: 4701 li a4,0 + 80010126: ffff5097 auipc ra,0xffff5 + 8001012a: 464080e7 jalr 1124(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001012e: a00d j 80010150 <.LBB1_18+0x18> + +0000000080010130 <.LBB1_17>: + println!("file system: no need to recover"); + 80010130: 00019597 auipc a1,0x19 + 80010134: 6c058593 addi a1,a1,1728 # 800297f0 <.L__unnamed_9> + +0000000080010138 <.LBB1_18>: + 80010138: 00019697 auipc a3,0x19 + 8001013c: 68068693 addi a3,a3,1664 # 800297b8 <.L__unnamed_20> + 80010140: 1888 addi a0,sp,112 + 80010142: 4605 li a2,1 + 80010144: 4701 li a4,0 + 80010146: ffff5097 auipc ra,0xffff5 + 8001014a: 444080e7 jalr 1092(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001014e: a02d j 80010178 <.LBB1_18+0x40> + 80010150: 0088 addi a0,sp,64 + println!("file system: recovering from logs"); + 80010152: 0000f097 auipc ra,0xf + 80010156: aa6080e7 jalr -1370(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001015a: a009 j 8001015c <.LBB1_18+0x24> + self.install_trans(true); + 8001015c: 6502 ld a0,0(sp) + 8001015e: 4585 li a1,1 + 80010160: 00000097 auipc ra,0x0 + 80010164: 196080e7 jalr 406(ra) # 800102f6 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E> + 80010168: a009 j 8001016a <.LBB1_18+0x32> + self.empty_head(); + 8001016a: 6502 ld a0,0(sp) + 8001016c: 00000097 auipc ra,0x0 + 80010170: 0fc080e7 jalr 252(ra) # 80010268 <_ZN6kernel2fs3log3Log10empty_head17hfcefa6f849cc86acE> + 80010174: a009 j 80010176 <.LBB1_18+0x3e> + if self.lh.len > 0 { + 80010176: a801 j 80010186 <.LBB1_18+0x4e> + 80010178: 1888 addi a0,sp,112 + println!("file system: no need to recover"); + 8001017a: 0000f097 auipc ra,0xf + 8001017e: a7e080e7 jalr -1410(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80010182: a009 j 80010184 <.LBB1_18+0x4c> + if self.lh.len > 0 { + 80010184: a009 j 80010186 <.LBB1_18+0x4e> + } + 80010186: 70aa ld ra,168(sp) + 80010188: 614d addi sp,sp,176 + 8001018a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3log3Log9read_head17hbc6584ed4df3a629E: + +000000008001018c <_ZN6kernel2fs3log3Log9read_head17hbc6584ed4df3a629E>: + fn read_head(&mut self) { + 8001018c: 7159 addi sp,sp,-112 + 8001018e: f486 sd ra,104(sp) + 80010190: e42a sd a0,8(sp) + 80010192: f0aa sd a0,96(sp) + let buf = BCACHE.bread(self.dev, self.start); + 80010194: 4114 lw a3,0(a0) + 80010196: 4510 lw a2,8(a0) + +0000000080010198 <.LBB2_4>: + 80010198: 00020597 auipc a1,0x20 + 8001019c: e6858593 addi a1,a1,-408 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 800101a0: 0808 addi a0,sp,16 + 800101a2: ffff3097 auipc ra,0xffff3 + 800101a6: 4f2080e7 jalr 1266(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 800101aa: a009 j 800101ac <.LBB2_4+0x14> + 800101ac: 0808 addi a0,sp,16 + buf.raw_data() as *const LogHeader, + 800101ae: ffff3097 auipc ra,0xffff3 + 800101b2: 62c080e7 jalr 1580(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 800101b6: e02a sd a0,0(sp) + 800101b8: a009 j 800101ba <.LBB2_4+0x22> + &mut self.lh, + 800101ba: 6582 ld a1,0(sp) + 800101bc: 6522 ld a0,8(sp) + 800101be: 0541 addi a0,a0,16 + 800101c0: 07800613 li a2,120 + ptr::copy_nonoverlapping( + 800101c4: 00016097 auipc ra,0x16 + 800101c8: ebe080e7 jalr -322(ra) # 80026082 + drop(buf); + 800101cc: 6542 ld a0,16(sp) + 800101ce: fc2a sd a0,56(sp) + 800101d0: 6562 ld a0,24(sp) + 800101d2: e0aa sd a0,64(sp) + 800101d4: 7502 ld a0,32(sp) + 800101d6: e4aa sd a0,72(sp) + 800101d8: 7522 ld a0,40(sp) + 800101da: e8aa sd a0,80(sp) + 800101dc: 7542 ld a0,48(sp) + 800101de: ecaa sd a0,88(sp) + 800101e0: 1828 addi a0,sp,56 + 800101e2: 0000e097 auipc ra,0xe + 800101e6: d3c080e7 jalr -708(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 800101ea: a009 j 800101ec <.LBB2_4+0x54> + } + 800101ec: 70a6 ld ra,104(sp) + 800101ee: 6165 addi sp,sp,112 + 800101f0: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3log3Log10write_head17hcfa90aedd37d0ff2E: + +00000000800101f2 <_ZN6kernel2fs3log3Log10write_head17hcfa90aedd37d0ff2E>: + fn write_head(&mut self) { + 800101f2: 7119 addi sp,sp,-128 + 800101f4: fc86 sd ra,120(sp) + 800101f6: ec2a sd a0,24(sp) + 800101f8: f8aa sd a0,112(sp) + let mut buf = BCACHE.bread(self.dev, self.start); + 800101fa: 4114 lw a3,0(a0) + 800101fc: 4510 lw a2,8(a0) + +00000000800101fe <.LBB3_5>: + 800101fe: 00020597 auipc a1,0x20 + 80010202: e0258593 addi a1,a1,-510 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 80010206: 1008 addi a0,sp,32 + 80010208: ffff3097 auipc ra,0xffff3 + 8001020c: 48c080e7 jalr 1164(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 80010210: a009 j 80010212 <.LBB3_5+0x14> + &self.lh, + 80010212: 6562 ld a0,24(sp) + 80010214: 0541 addi a0,a0,16 + buf.raw_data_mut() as *mut LogHeader, + 80010216: e42a sd a0,8(sp) + 80010218: 1008 addi a0,sp,32 + 8001021a: ffff3097 auipc ra,0xffff3 + 8001021e: 604080e7 jalr 1540(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 80010222: e82a sd a0,16(sp) + 80010224: a009 j 80010226 <.LBB3_5+0x28> + ptr::copy_nonoverlapping( + 80010226: 65a2 ld a1,8(sp) + 80010228: 6542 ld a0,16(sp) + 8001022a: 07800613 li a2,120 + 8001022e: 00016097 auipc ra,0x16 + 80010232: e54080e7 jalr -428(ra) # 80026082 + 80010236: 1008 addi a0,sp,32 + buf.bwrite(); + 80010238: ffff3097 auipc ra,0xffff3 + 8001023c: 580080e7 jalr 1408(ra) # 800037b8 <_ZN6kernel2fs3bio3Buf6bwrite17hec751387ebedcc62E> + 80010240: a009 j 80010242 <.LBB3_5+0x44> + drop(buf); + 80010242: 6506 ld a0,64(sp) + 80010244: f4aa sd a0,104(sp) + 80010246: 7562 ld a0,56(sp) + 80010248: f0aa sd a0,96(sp) + 8001024a: 7542 ld a0,48(sp) + 8001024c: ecaa sd a0,88(sp) + 8001024e: 7522 ld a0,40(sp) + 80010250: e8aa sd a0,80(sp) + 80010252: 7502 ld a0,32(sp) + 80010254: e4aa sd a0,72(sp) + 80010256: 00a8 addi a0,sp,72 + 80010258: 0000e097 auipc ra,0xe + 8001025c: cc6080e7 jalr -826(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 80010260: a009 j 80010262 <.LBB3_5+0x64> + } + 80010262: 70e6 ld ra,120(sp) + 80010264: 6109 addi sp,sp,128 + 80010266: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3log3Log10empty_head17hfcefa6f849cc86acE: + +0000000080010268 <_ZN6kernel2fs3log3Log10empty_head17hfcefa6f849cc86acE>: + fn empty_head(&mut self) { + 80010268: 7119 addi sp,sp,-128 + 8001026a: fc86 sd ra,120(sp) + 8001026c: f4aa sd a0,104(sp) + 8001026e: 4581 li a1,0 + self.lh.len = 0; + 80010270: c90c sw a1,16(a0) + let mut buf = BCACHE.bread(self.dev, self.start); + 80010272: 4114 lw a3,0(a0) + 80010274: 4510 lw a2,8(a0) + +0000000080010276 <.LBB4_7>: + 80010276: 00020597 auipc a1,0x20 + 8001027a: d8a58593 addi a1,a1,-630 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8001027e: 0828 addi a0,sp,24 + 80010280: ffff3097 auipc ra,0xffff3 + 80010284: 414080e7 jalr 1044(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 80010288: a009 j 8001028a <.LBB4_7+0x14> + 8001028a: 0828 addi a0,sp,24 + let raw_lh = buf.raw_data_mut() as *mut LogHeader; + 8001028c: ffff3097 auipc ra,0xffff3 + 80010290: 592080e7 jalr 1426(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 80010294: e82a sd a0,16(sp) + 80010296: a009 j 80010298 <.LBB4_7+0x22> + 80010298: 6542 ld a0,16(sp) + 8001029a: f8aa sd a0,112(sp) + unsafe { raw_lh.as_mut().unwrap().len = 0; } + 8001029c: ffff9097 auipc ra,0xffff9 + 800102a0: 096080e7 jalr 150(ra) # 80009332 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1b12e5c191747deaE> + 800102a4: e42a sd a0,8(sp) + 800102a6: a009 j 800102a8 <.LBB4_7+0x32> + 800102a8: 6522 ld a0,8(sp) + +00000000800102aa <.LBB4_8>: + 800102aa: 00019597 auipc a1,0x19 + 800102ae: 55658593 addi a1,a1,1366 # 80029800 <.L__unnamed_10> + 800102b2: fffff097 auipc ra,0xfffff + 800102b6: 28c080e7 jalr 652(ra) # 8000f53e <_ZN4core6option15Option$LT$T$GT$6unwrap17h2ef2c85febc29d20E> + 800102ba: e02a sd a0,0(sp) + 800102bc: a009 j 800102be <.LBB4_8+0x14> + 800102be: 6582 ld a1,0(sp) + 800102c0: 4501 li a0,0 + 800102c2: c188 sw a0,0(a1) + 800102c4: 0828 addi a0,sp,24 + buf.bwrite(); + 800102c6: ffff3097 auipc ra,0xffff3 + 800102ca: 4f2080e7 jalr 1266(ra) # 800037b8 <_ZN6kernel2fs3bio3Buf6bwrite17hec751387ebedcc62E> + 800102ce: a009 j 800102d0 <.LBB4_8+0x26> + drop(buf); + 800102d0: 7562 ld a0,56(sp) + 800102d2: f0aa sd a0,96(sp) + 800102d4: 7542 ld a0,48(sp) + 800102d6: ecaa sd a0,88(sp) + 800102d8: 7522 ld a0,40(sp) + 800102da: e8aa sd a0,80(sp) + 800102dc: 7502 ld a0,32(sp) + 800102de: e4aa sd a0,72(sp) + 800102e0: 6562 ld a0,24(sp) + 800102e2: e0aa sd a0,64(sp) + 800102e4: 0088 addi a0,sp,64 + 800102e6: 0000e097 auipc ra,0xe + 800102ea: c38080e7 jalr -968(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 800102ee: a009 j 800102f0 <.LBB4_8+0x46> + } + 800102f0: 70e6 ld ra,120(sp) + 800102f2: 6109 addi sp,sp,128 + 800102f4: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E: + +00000000800102f6 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E>: + fn install_trans(&mut self, recovering: bool) { + 800102f6: 7129 addi sp,sp,-320 + 800102f8: fe06 sd ra,312(sp) + 800102fa: e4aa sd a0,72(sp) + 800102fc: 862e mv a2,a1 + 800102fe: e8b2 sd a2,80(sp) + 80010300: f22a sd a0,288(sp) + 80010302: 12b105a3 sb a1,299(sp) + for i in 0..self.lh.len { + 80010306: 490c lw a1,16(a0) + 80010308: 4501 li a0,0 + 8001030a: d4aa sw a0,104(sp) + 8001030c: d6ae sw a1,108(sp) + 8001030e: ffffc097 auipc ra,0xffffc + 80010312: 046080e7 jalr 70(ra) # 8000c354 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h2819071fbc006758E> + 80010316: ecaa sd a0,88(sp) + 80010318: f0ae sd a1,96(sp) + 8001031a: a009 j 8001031c <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x26> + 8001031c: 7506 ld a0,96(sp) + 8001031e: 65e6 ld a1,88(sp) + 80010320: d8ae sw a1,112(sp) + 80010322: daaa sw a0,116(sp) + 80010324: a009 j 80010326 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x30> + 80010326: 1888 addi a0,sp,112 + 80010328: ffffc097 auipc ra,0xffffc + 8001032c: ebe080e7 jalr -322(ra) # 8000c1e6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE> + 80010330: dcaa sw a0,120(sp) + 80010332: deae sw a1,124(sp) + 80010334: a009 j 80010336 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x40> + 80010336: 07816503 lwu a0,120(sp) + 8001033a: 4581 li a1,0 + 8001033c: 00b50463 beq a0,a1,80010344 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x4e> + 80010340: a009 j 80010342 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x4c> + 80010342: a029 j 8001034c <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x56> + } + 80010344: 70f2 ld ra,312(sp) + 80010346: 6131 addi sp,sp,320 + 80010348: 8082 ret + for i in 0..self.lh.len { + 8001034a: 0000 unimp + 8001034c: 6526 ld a0,72(sp) + 8001034e: 07c16583 lwu a1,124(sp) + 80010352: f82e sd a1,48(sp) + 80010354: 12b12623 sw a1,300(sp) + 80010358: 12b12823 sw a1,304(sp) + 8001035c: 12b12a23 sw a1,308(sp) + let log_buf = BCACHE.bread(self.dev, self.start+1+i); + 80010360: 00856583 lwu a1,8(a0) + 80010364: fc2e sd a1,56(sp) + 80010366: 00056503 lwu a0,0(a0) + 8001036a: 00150593 addi a1,a0,1 + 8001036e: e0ae sd a1,64(sp) + 80010370: 02059513 slli a0,a1,0x20 + 80010374: 9101 srli a0,a0,0x20 + 80010376: 10b51063 bne a0,a1,80010476 <.LBB5_28> + 8001037a: a009 j 8001037c <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x86> + 8001037c: 75c2 ld a1,48(sp) + 8001037e: 6506 ld a0,64(sp) + 80010380: 1502 slli a0,a0,0x20 + 80010382: 9101 srli a0,a0,0x20 + 80010384: 95aa add a1,a1,a0 + 80010386: f42e sd a1,40(sp) + 80010388: 02059513 slli a0,a1,0x20 + 8001038c: 9101 srli a0,a0,0x20 + 8001038e: 10b51263 bne a0,a1,80010492 <.LBB5_30> + 80010392: a009 j 80010394 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x9e> + 80010394: 76a2 ld a3,40(sp) + 80010396: 7662 ld a2,56(sp) + +0000000080010398 <.LBB5_26>: + 80010398: 00020597 auipc a1,0x20 + 8001039c: c6858593 addi a1,a1,-920 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 800103a0: 0108 addi a0,sp,128 + 800103a2: ffff3097 auipc ra,0xffff3 + 800103a6: 2f2080e7 jalr 754(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 800103aa: a009 j 800103ac <.LBB5_26+0x14> + let mut disk_buf = BCACHE.bread(self.dev, self.lh.blocknos[i as usize]); + 800103ac: 7542 ld a0,48(sp) + 800103ae: 65a6 ld a1,72(sp) + 800103b0: 0085e583 lwu a1,8(a1) + 800103b4: ec2e sd a1,24(sp) + 800103b6: 0005059b sext.w a1,a0 + 800103ba: f02a sd a0,32(sp) + 800103bc: 4571 li a0,28 + 800103be: 0eb56863 bltu a0,a1,800104ae <.LBB5_31+0x14> + 800103c2: a009 j 800103c4 <.LBB5_26+0x2c> + 800103c4: 6662 ld a2,24(sp) + 800103c6: 6526 ld a0,72(sp) + 800103c8: 7582 ld a1,32(sp) + 800103ca: 058a slli a1,a1,0x2 + 800103cc: 952e add a0,a0,a1 + 800103ce: 4954 lw a3,20(a0) + +00000000800103d0 <.LBB5_27>: + 800103d0: 00020597 auipc a1,0x20 + 800103d4: c3058593 addi a1,a1,-976 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 800103d8: 1128 addi a0,sp,168 + 800103da: ffff3097 auipc ra,0xffff3 + 800103de: 2ba080e7 jalr 698(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 800103e2: a009 j 800103e4 <.LBB5_27+0x14> + 800103e4: 0108 addi a0,sp,128 + log_buf.raw_data(), + 800103e6: ffff3097 auipc ra,0xffff3 + 800103ea: 3f4080e7 jalr 1012(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 800103ee: e82a sd a0,16(sp) + 800103f0: a009 j 800103f2 <.LBB5_27+0x22> + 800103f2: 1128 addi a0,sp,168 + disk_buf.raw_data_mut(), + 800103f4: ffff3097 auipc ra,0xffff3 + 800103f8: 42a080e7 jalr 1066(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 800103fc: e42a sd a0,8(sp) + 800103fe: a009 j 80010400 <.LBB5_27+0x30> + ptr::copy( + 80010400: 65c2 ld a1,16(sp) + 80010402: 6522 ld a0,8(sp) + 80010404: 40000613 li a2,1024 + 80010408: 00016097 auipc ra,0x16 + 8001040c: c90080e7 jalr -880(ra) # 80026098 + 80010410: a009 j 80010412 <.LBB5_27+0x42> + 80010412: 1128 addi a0,sp,168 + disk_buf.bwrite(); + 80010414: ffff3097 auipc ra,0xffff3 + 80010418: 3a4080e7 jalr 932(ra) # 800037b8 <_ZN6kernel2fs3bio3Buf6bwrite17hec751387ebedcc62E> + 8001041c: a009 j 8001041e <.LBB5_27+0x4e> + if !recovering { + 8001041e: 6546 ld a0,80(sp) + 80010420: e901 bnez a0,80010430 <.LBB5_27+0x60> + 80010422: a009 j 80010424 <.LBB5_27+0x54> + 80010424: 1128 addi a0,sp,168 + unsafe { disk_buf.unpin(); } + 80010426: ffff3097 auipc ra,0xffff3 + 8001042a: 47c080e7 jalr 1148(ra) # 800038a2 <_ZN6kernel2fs3bio3Buf5unpin17h781e1439f4d799baE> + 8001042e: a011 j 80010432 <.LBB5_27+0x62> + if !recovering { + 80010430: a011 j 80010434 <.LBB5_27+0x64> + 80010432: a009 j 80010434 <.LBB5_27+0x64> + drop(log_buf); + 80010434: 750a ld a0,160(sp) + 80010436: f9aa sd a0,240(sp) + 80010438: 656a ld a0,152(sp) + 8001043a: f5aa sd a0,232(sp) + 8001043c: 654a ld a0,144(sp) + 8001043e: f1aa sd a0,224(sp) + 80010440: 652a ld a0,136(sp) + 80010442: edaa sd a0,216(sp) + 80010444: 650a ld a0,128(sp) + 80010446: e9aa sd a0,208(sp) + 80010448: 0988 addi a0,sp,208 + 8001044a: 0000e097 auipc ra,0xe + 8001044e: ad4080e7 jalr -1324(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 80010452: a009 j 80010454 <.LBB5_27+0x84> + drop(disk_buf); + 80010454: 652e ld a0,200(sp) + 80010456: ee2a sd a0,280(sp) + 80010458: 650e ld a0,192(sp) + 8001045a: ea2a sd a0,272(sp) + 8001045c: 756a ld a0,184(sp) + 8001045e: e62a sd a0,264(sp) + 80010460: 754a ld a0,176(sp) + 80010462: e22a sd a0,256(sp) + 80010464: 752a ld a0,168(sp) + 80010466: fdaa sd a0,248(sp) + 80010468: 19a8 addi a0,sp,248 + 8001046a: 0000e097 auipc ra,0xe + 8001046e: ab4080e7 jalr -1356(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 80010472: a009 j 80010474 <.LBB5_27+0xa4> + for i in 0..self.lh.len { + 80010474: bd4d j 80010326 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E+0x30> + +0000000080010476 <.LBB5_28>: + let log_buf = BCACHE.bread(self.dev, self.start+1+i); + 80010476: 00019517 auipc a0,0x19 + 8001047a: 3ba50513 addi a0,a0,954 # 80029830 + +000000008001047e <.LBB5_29>: + 8001047e: 00019617 auipc a2,0x19 + 80010482: 39a60613 addi a2,a2,922 # 80029818 <.L__unnamed_11> + 80010486: 45f1 li a1,28 + 80010488: 00013097 auipc ra,0x13 + 8001048c: cbc080e7 jalr -836(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080010492 <.LBB5_30>: + 80010492: 00019517 auipc a0,0x19 + 80010496: 39e50513 addi a0,a0,926 # 80029830 + +000000008001049a <.LBB5_31>: + 8001049a: 00019617 auipc a2,0x19 + 8001049e: 37e60613 addi a2,a2,894 # 80029818 <.L__unnamed_11> + 800104a2: 45f1 li a1,28 + 800104a4: 00013097 auipc ra,0x13 + 800104a8: ca0080e7 jalr -864(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800104ac: 0000 unimp + let mut disk_buf = BCACHE.bread(self.dev, self.lh.blocknos[i as usize]); + 800104ae: 7502 ld a0,32(sp) + +00000000800104b0 <.LBB5_32>: + 800104b0: 00019617 auipc a2,0x19 + 800104b4: 3a060613 addi a2,a2,928 # 80029850 <.L__unnamed_12> + 800104b8: 45f5 li a1,29 + 800104ba: 00013097 auipc ra,0x13 + 800104be: cb6080e7 jalr -842(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs3log3Log6commit17hb6044c935645b581E: + +00000000800104c4 <_ZN6kernel2fs3log3Log6commit17hb6044c935645b581E>: + pub unsafe fn commit(&mut self) { + 800104c4: 1101 addi sp,sp,-32 + 800104c6: ec06 sd ra,24(sp) + 800104c8: e02a sd a0,0(sp) + 800104ca: e82a sd a0,16(sp) + if !self.committing { + 800104cc: 08854503 lbu a0,136(a0) + 800104d0: 8905 andi a0,a0,1 + 800104d2: e10d bnez a0,800104f4 <.LBB6_11+0x16> + 800104d4: a009 j 800104d6 <.LBB6_10> + +00000000800104d6 <.LBB6_10>: + panic!("log: committing while the committing flag is not set"); + 800104d6: 00019517 auipc a0,0x19 + 800104da: 39250513 addi a0,a0,914 # 80029868 <.L__unnamed_13> + +00000000800104de <.LBB6_11>: + 800104de: 00019617 auipc a2,0x19 + 800104e2: 3c260613 addi a2,a2,962 # 800298a0 <.L__unnamed_14> + 800104e6: 03400593 li a1,52 + 800104ea: 00013097 auipc ra,0x13 + 800104ee: c5a080e7 jalr -934(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800104f2: 0000 unimp + if self.lh.len > 0 { + 800104f4: 6502 ld a0,0(sp) + 800104f6: 4908 lw a0,16(a0) + 800104f8: 4581 li a1,0 + 800104fa: 00b50963 beq a0,a1,8001050c <.LBB6_11+0x2e> + 800104fe: a009 j 80010500 <.LBB6_11+0x22> + self.write_log(); + 80010500: 6502 ld a0,0(sp) + 80010502: 00000097 auipc ra,0x0 + 80010506: 03a080e7 jalr 58(ra) # 8001053c <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE> + 8001050a: a011 j 8001050e <.LBB6_11+0x30> + if self.lh.len > 0 { + 8001050c: a02d j 80010536 <.LBB6_11+0x58> + self.write_head(); + 8001050e: 6502 ld a0,0(sp) + 80010510: 00000097 auipc ra,0x0 + 80010514: ce2080e7 jalr -798(ra) # 800101f2 <_ZN6kernel2fs3log3Log10write_head17hcfa90aedd37d0ff2E> + 80010518: a009 j 8001051a <.LBB6_11+0x3c> + self.install_trans(false); + 8001051a: 6502 ld a0,0(sp) + 8001051c: 4581 li a1,0 + 8001051e: 00000097 auipc ra,0x0 + 80010522: dd8080e7 jalr -552(ra) # 800102f6 <_ZN6kernel2fs3log3Log13install_trans17h365e0e8a575b1656E> + 80010526: a009 j 80010528 <.LBB6_11+0x4a> + self.empty_head(); + 80010528: 6502 ld a0,0(sp) + 8001052a: 00000097 auipc ra,0x0 + 8001052e: d3e080e7 jalr -706(ra) # 80010268 <_ZN6kernel2fs3log3Log10empty_head17hfcefa6f849cc86acE> + 80010532: a009 j 80010534 <.LBB6_11+0x56> + if self.lh.len > 0 { + 80010534: a009 j 80010536 <.LBB6_11+0x58> + } + 80010536: 60e2 ld ra,24(sp) + 80010538: 6105 addi sp,sp,32 + 8001053a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE: + +000000008001053c <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE>: + fn write_log(&mut self) { + 8001053c: 7169 addi sp,sp,-304 + 8001053e: f606 sd ra,296(sp) + 80010540: e0aa sd a0,64(sp) + 80010542: ea2a sd a0,272(sp) + for i in 0..self.lh.len { + 80010544: 490c lw a1,16(a0) + 80010546: 4501 li a0,0 + 80010548: ccaa sw a0,88(sp) + 8001054a: ceae sw a1,92(sp) + 8001054c: ffffc097 auipc ra,0xffffc + 80010550: e08080e7 jalr -504(ra) # 8000c354 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h2819071fbc006758E> + 80010554: e4aa sd a0,72(sp) + 80010556: e8ae sd a1,80(sp) + 80010558: a009 j 8001055a <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x1e> + 8001055a: 6546 ld a0,80(sp) + 8001055c: 65a6 ld a1,72(sp) + 8001055e: d0ae sw a1,96(sp) + 80010560: d2aa sw a0,100(sp) + 80010562: a009 j 80010564 <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x28> + 80010564: 1088 addi a0,sp,96 + 80010566: ffffc097 auipc ra,0xffffc + 8001056a: c80080e7 jalr -896(ra) # 8000c1e6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE> + 8001056e: d4aa sw a0,104(sp) + 80010570: d6ae sw a1,108(sp) + 80010572: a009 j 80010574 <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x38> + 80010574: 06816503 lwu a0,104(sp) + 80010578: 4581 li a1,0 + 8001057a: 00b50463 beq a0,a1,80010582 <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x46> + 8001057e: a009 j 80010580 <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x44> + 80010580: a029 j 8001058a <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x4e> + } + 80010582: 70b2 ld ra,296(sp) + 80010584: 6155 addi sp,sp,304 + 80010586: 8082 ret + for i in 0..self.lh.len { + 80010588: 0000 unimp + 8001058a: 6506 ld a0,64(sp) + 8001058c: 06c16583 lwu a1,108(sp) + 80010590: f42e sd a1,40(sp) + 80010592: 10b12e23 sw a1,284(sp) + 80010596: 12b12023 sw a1,288(sp) + 8001059a: 12b12223 sw a1,292(sp) + let mut log_buf = BCACHE.bread(self.dev, self.start+1+i); + 8001059e: 00856583 lwu a1,8(a0) + 800105a2: f82e sd a1,48(sp) + 800105a4: 00056503 lwu a0,0(a0) + 800105a8: 00150593 addi a1,a0,1 + 800105ac: fc2e sd a1,56(sp) + 800105ae: 02059513 slli a0,a1,0x20 + 800105b2: 9101 srli a0,a0,0x20 + 800105b4: 0eb51563 bne a0,a1,8001069e <.LBB7_24> + 800105b8: a009 j 800105ba <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x7e> + 800105ba: 75a2 ld a1,40(sp) + 800105bc: 7562 ld a0,56(sp) + 800105be: 1502 slli a0,a0,0x20 + 800105c0: 9101 srli a0,a0,0x20 + 800105c2: 95aa add a1,a1,a0 + 800105c4: f02e sd a1,32(sp) + 800105c6: 02059513 slli a0,a1,0x20 + 800105ca: 9101 srli a0,a0,0x20 + 800105cc: 0eb51763 bne a0,a1,800106ba <.LBB7_26> + 800105d0: a009 j 800105d2 <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x96> + 800105d2: 7682 ld a3,32(sp) + 800105d4: 7642 ld a2,48(sp) + +00000000800105d6 <.LBB7_22>: + 800105d6: 00020597 auipc a1,0x20 + 800105da: a2a58593 addi a1,a1,-1494 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 800105de: 1888 addi a0,sp,112 + 800105e0: ffff3097 auipc ra,0xffff3 + 800105e4: 0b4080e7 jalr 180(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 800105e8: a009 j 800105ea <.LBB7_22+0x14> + let cache_buf = BCACHE.bread(self.dev, self.lh.blocknos[i as usize]); + 800105ea: 7522 ld a0,40(sp) + 800105ec: 6586 ld a1,64(sp) + 800105ee: 0085e583 lwu a1,8(a1) + 800105f2: e82e sd a1,16(sp) + 800105f4: 0005059b sext.w a1,a0 + 800105f8: ec2a sd a0,24(sp) + 800105fa: 4571 li a0,28 + 800105fc: 0cb56d63 bltu a0,a1,800106d6 <.LBB7_27+0x14> + 80010600: a009 j 80010602 <.LBB7_22+0x2c> + 80010602: 6642 ld a2,16(sp) + 80010604: 6506 ld a0,64(sp) + 80010606: 65e2 ld a1,24(sp) + 80010608: 058a slli a1,a1,0x2 + 8001060a: 952e add a0,a0,a1 + 8001060c: 4954 lw a3,20(a0) + +000000008001060e <.LBB7_23>: + 8001060e: 00020597 auipc a1,0x20 + 80010612: 9f258593 addi a1,a1,-1550 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 80010616: 0928 addi a0,sp,152 + 80010618: ffff3097 auipc ra,0xffff3 + 8001061c: 07c080e7 jalr 124(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 80010620: a009 j 80010622 <.LBB7_23+0x14> + 80010622: 0928 addi a0,sp,152 + cache_buf.raw_data(), + 80010624: ffff3097 auipc ra,0xffff3 + 80010628: 1b6080e7 jalr 438(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 8001062c: e42a sd a0,8(sp) + 8001062e: a009 j 80010630 <.LBB7_23+0x22> + 80010630: 1888 addi a0,sp,112 + log_buf.raw_data_mut(), + 80010632: ffff3097 auipc ra,0xffff3 + 80010636: 1ec080e7 jalr 492(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 8001063a: e02a sd a0,0(sp) + 8001063c: a009 j 8001063e <.LBB7_23+0x30> + ptr::copy( + 8001063e: 65a2 ld a1,8(sp) + 80010640: 6502 ld a0,0(sp) + 80010642: 40000613 li a2,1024 + 80010646: 00016097 auipc ra,0x16 + 8001064a: a52080e7 jalr -1454(ra) # 80026098 + 8001064e: a009 j 80010650 <.LBB7_23+0x42> + 80010650: 1888 addi a0,sp,112 + log_buf.bwrite(); + 80010652: ffff3097 auipc ra,0xffff3 + 80010656: 166080e7 jalr 358(ra) # 800037b8 <_ZN6kernel2fs3bio3Buf6bwrite17hec751387ebedcc62E> + 8001065a: a009 j 8001065c <.LBB7_23+0x4e> + drop(cache_buf); + 8001065c: 756a ld a0,184(sp) + 8001065e: f1aa sd a0,224(sp) + 80010660: 754a ld a0,176(sp) + 80010662: edaa sd a0,216(sp) + 80010664: 752a ld a0,168(sp) + 80010666: e9aa sd a0,208(sp) + 80010668: 750a ld a0,160(sp) + 8001066a: e5aa sd a0,200(sp) + 8001066c: 656a ld a0,152(sp) + 8001066e: e1aa sd a0,192(sp) + 80010670: 0188 addi a0,sp,192 + 80010672: 0000e097 auipc ra,0xe + 80010676: 8ac080e7 jalr -1876(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 8001067a: a009 j 8001067c <.LBB7_23+0x6e> + drop(log_buf); + 8001067c: 654a ld a0,144(sp) + 8001067e: e62a sd a0,264(sp) + 80010680: 652a ld a0,136(sp) + 80010682: e22a sd a0,256(sp) + 80010684: 650a ld a0,128(sp) + 80010686: fdaa sd a0,248(sp) + 80010688: 7566 ld a0,120(sp) + 8001068a: f9aa sd a0,240(sp) + 8001068c: 7546 ld a0,112(sp) + 8001068e: f5aa sd a0,232(sp) + 80010690: 11a8 addi a0,sp,232 + 80010692: 0000e097 auipc ra,0xe + 80010696: 88c080e7 jalr -1908(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 8001069a: a009 j 8001069c <.LBB7_23+0x8e> + for i in 0..self.lh.len { + 8001069c: b5e1 j 80010564 <_ZN6kernel2fs3log3Log9write_log17hf6e116b9849c70aeE+0x28> + +000000008001069e <.LBB7_24>: + let mut log_buf = BCACHE.bread(self.dev, self.start+1+i); + 8001069e: 00019517 auipc a0,0x19 + 800106a2: 19250513 addi a0,a0,402 # 80029830 + +00000000800106a6 <.LBB7_25>: + 800106a6: 00019617 auipc a2,0x19 + 800106aa: 21260613 addi a2,a2,530 # 800298b8 <.L__unnamed_15> + 800106ae: 45f1 li a1,28 + 800106b0: 00013097 auipc ra,0x13 + 800106b4: a94080e7 jalr -1388(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800106ba <.LBB7_26>: + 800106ba: 00019517 auipc a0,0x19 + 800106be: 17650513 addi a0,a0,374 # 80029830 + +00000000800106c2 <.LBB7_27>: + 800106c2: 00019617 auipc a2,0x19 + 800106c6: 1f660613 addi a2,a2,502 # 800298b8 <.L__unnamed_15> + 800106ca: 45f1 li a1,28 + 800106cc: 00013097 auipc ra,0x13 + 800106d0: a78080e7 jalr -1416(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800106d4: 0000 unimp + let cache_buf = BCACHE.bread(self.dev, self.lh.blocknos[i as usize]); + 800106d6: 6562 ld a0,24(sp) + +00000000800106d8 <.LBB7_28>: + 800106d8: 00019617 auipc a2,0x19 + 800106dc: 1f860613 addi a2,a2,504 # 800298d0 <.L__unnamed_16> + 800106e0: 45f5 li a1,29 + 800106e2: 00013097 auipc ra,0x13 + 800106e6: a8e080e7 jalr -1394(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN4core4sync6atomic10atomic_add17hcefa99837e5e8934E: + +00000000800106ec <_ZN4core4sync6atomic10atomic_add17hcefa99837e5e8934E>: +unsafe fn atomic_add(dst: *mut T, val: T, order: Ordering) -> T { + 800106ec: 7139 addi sp,sp,-64 + 800106ee: e42e sd a1,8(sp) + 800106f0: e82a sd a0,16(sp) + 800106f2: 02c103a3 sb a2,39(sp) + 800106f6: f82a sd a0,48(sp) + 800106f8: fc2e sd a1,56(sp) + Acquire => intrinsics::atomic_xadd_acq(dst, val), + 800106fa: 0ff67513 andi a0,a2,255 + 800106fe: ec2a sd a0,24(sp) + 80010700: 6562 ld a0,24(sp) + 80010702: 050e slli a0,a0,0x3 + +0000000080010704 <.LBB0_14>: + 80010704: 00019597 auipc a1,0x19 + 80010708: 1e458593 addi a1,a1,484 # 800298e8 <.LJTI0_0> + 8001070c: 952e add a0,a0,a1 + 8001070e: 6108 ld a0,0(a0) + 80010710: 8502 jr a0 + +0000000080010712 <.LBB0_2>: + SeqCst => intrinsics::atomic_xadd(dst, val), + 80010712: 6542 ld a0,16(sp) + 80010714: 65a2 ld a1,8(sp) + 80010716: 06b5352f amoadd.d.aqrl a0,a1,(a0) + 8001071a: f42a sd a0,40(sp) + 8001071c: a835 j 80010758 <.LBB0_10+0xe> + ... + +0000000080010720 <.LBB0_4>: + Acquire => intrinsics::atomic_xadd_acq(dst, val), + 80010720: 6542 ld a0,16(sp) + 80010722: 65a2 ld a1,8(sp) + 80010724: 04b5352f amoadd.d.aq a0,a1,(a0) + 80010728: f42a sd a0,40(sp) + 8001072a: a009 j 8001072c <.LBB0_4+0xc> + match order { + 8001072c: a03d j 8001075a <.LBB0_10+0x10> + +000000008001072e <.LBB0_6>: + Release => intrinsics::atomic_xadd_rel(dst, val), + 8001072e: 6542 ld a0,16(sp) + 80010730: 65a2 ld a1,8(sp) + 80010732: 02b5352f amoadd.d.rl a0,a1,(a0) + 80010736: f42a sd a0,40(sp) + 80010738: a009 j 8001073a <.LBB0_6+0xc> + match order { + 8001073a: a005 j 8001075a <.LBB0_10+0x10> + +000000008001073c <.LBB0_8>: + AcqRel => intrinsics::atomic_xadd_acqrel(dst, val), + 8001073c: 6542 ld a0,16(sp) + 8001073e: 65a2 ld a1,8(sp) + 80010740: 06b5352f amoadd.d.aqrl a0,a1,(a0) + 80010744: f42a sd a0,40(sp) + 80010746: a009 j 80010748 <.LBB0_8+0xc> + match order { + 80010748: a809 j 8001075a <.LBB0_10+0x10> + +000000008001074a <.LBB0_10>: + Relaxed => intrinsics::atomic_xadd_relaxed(dst, val), + 8001074a: 6542 ld a0,16(sp) + 8001074c: 65a2 ld a1,8(sp) + 8001074e: 00b5352f amoadd.d a0,a1,(a0) + 80010752: f42a sd a0,40(sp) + 80010754: a009 j 80010756 <.LBB0_10+0xc> + match order { + 80010756: a011 j 8001075a <.LBB0_10+0x10> + 80010758: a009 j 8001075a <.LBB0_10+0x10> +} + 8001075a: 7522 ld a0,40(sp) + 8001075c: 6121 addi sp,sp,64 + 8001075e: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic10atomic_sub17ha62074418a99a7bbE: + +0000000080010760 <_ZN4core4sync6atomic10atomic_sub17ha62074418a99a7bbE>: +unsafe fn atomic_sub(dst: *mut T, val: T, order: Ordering) -> T { + 80010760: 7139 addi sp,sp,-64 + 80010762: e42e sd a1,8(sp) + 80010764: e82a sd a0,16(sp) + 80010766: 02c103a3 sb a2,39(sp) + 8001076a: f82a sd a0,48(sp) + 8001076c: fc2e sd a1,56(sp) + Acquire => intrinsics::atomic_xsub_acq(dst, val), + 8001076e: 0ff67513 andi a0,a2,255 + 80010772: ec2a sd a0,24(sp) + 80010774: 6562 ld a0,24(sp) + 80010776: 050e slli a0,a0,0x3 + +0000000080010778 <.LBB1_14>: + 80010778: 00019597 auipc a1,0x19 + 8001077c: 19858593 addi a1,a1,408 # 80029910 <.LJTI1_0> + 80010780: 952e add a0,a0,a1 + 80010782: 6108 ld a0,0(a0) + 80010784: 8502 jr a0 + +0000000080010786 <.LBB1_2>: + SeqCst => intrinsics::atomic_xsub(dst, val), + 80010786: 6542 ld a0,16(sp) + 80010788: 65a2 ld a1,8(sp) + 8001078a: 40b005b3 neg a1,a1 + 8001078e: 06b5352f amoadd.d.aqrl a0,a1,(a0) + 80010792: f42a sd a0,40(sp) + 80010794: a0b1 j 800107e0 <.LBB1_10+0x12> + ... + +0000000080010798 <.LBB1_4>: + Acquire => intrinsics::atomic_xsub_acq(dst, val), + 80010798: 6542 ld a0,16(sp) + 8001079a: 65a2 ld a1,8(sp) + 8001079c: 40b005b3 neg a1,a1 + 800107a0: 04b5352f amoadd.d.aq a0,a1,(a0) + 800107a4: f42a sd a0,40(sp) + 800107a6: a009 j 800107a8 <.LBB1_4+0x10> + match order { + 800107a8: a82d j 800107e2 <.LBB1_10+0x14> + +00000000800107aa <.LBB1_6>: + Release => intrinsics::atomic_xsub_rel(dst, val), + 800107aa: 6542 ld a0,16(sp) + 800107ac: 65a2 ld a1,8(sp) + 800107ae: 40b005b3 neg a1,a1 + 800107b2: 02b5352f amoadd.d.rl a0,a1,(a0) + 800107b6: f42a sd a0,40(sp) + 800107b8: a009 j 800107ba <.LBB1_6+0x10> + match order { + 800107ba: a025 j 800107e2 <.LBB1_10+0x14> + +00000000800107bc <.LBB1_8>: + AcqRel => intrinsics::atomic_xsub_acqrel(dst, val), + 800107bc: 6542 ld a0,16(sp) + 800107be: 65a2 ld a1,8(sp) + 800107c0: 40b005b3 neg a1,a1 + 800107c4: 06b5352f amoadd.d.aqrl a0,a1,(a0) + 800107c8: f42a sd a0,40(sp) + 800107ca: a009 j 800107cc <.LBB1_8+0x10> + match order { + 800107cc: a819 j 800107e2 <.LBB1_10+0x14> + +00000000800107ce <.LBB1_10>: + Relaxed => intrinsics::atomic_xsub_relaxed(dst, val), + 800107ce: 6542 ld a0,16(sp) + 800107d0: 65a2 ld a1,8(sp) + 800107d2: 40b005b3 neg a1,a1 + 800107d6: 00b5352f amoadd.d a0,a1,(a0) + 800107da: f42a sd a0,40(sp) + 800107dc: a009 j 800107de <.LBB1_10+0x10> + match order { + 800107de: a011 j 800107e2 <.LBB1_10+0x14> + 800107e0: a009 j 800107e2 <.LBB1_10+0x14> +} + 800107e2: 7522 ld a0,40(sp) + 800107e4: 6121 addi sp,sp,64 + 800107e6: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic11atomic_swap17hdd22e709589114eaE: + +00000000800107e8 <_ZN4core4sync6atomic11atomic_swap17hdd22e709589114eaE>: +unsafe fn atomic_swap(dst: *mut T, val: T, order: Ordering) -> T { + 800107e8: 7179 addi sp,sp,-48 + 800107ea: e02a sd a0,0(sp) + 800107ec: 86ae mv a3,a1 + 800107ee: e436 sd a3,8(sp) + 800107f0: 00c10f23 sb a2,30(sp) + 800107f4: f02a sd a0,32(sp) + 800107f6: 02b107a3 sb a1,47(sp) + Acquire => intrinsics::atomic_xchg_acq(dst, val), + 800107fa: 0ff67513 andi a0,a2,255 + 800107fe: e82a sd a0,16(sp) + 80010800: 6542 ld a0,16(sp) + 80010802: 050e slli a0,a0,0x3 + +0000000080010804 <.LBB2_14>: + 80010804: 00019597 auipc a1,0x19 + 80010808: 13458593 addi a1,a1,308 # 80029938 <.LJTI2_0> + 8001080c: 952e add a0,a0,a1 + 8001080e: 6108 ld a0,0(a0) + 80010810: 8502 jr a0 + +0000000080010812 <.LBB2_2>: + SeqCst => intrinsics::atomic_xchg(dst, val), + 80010812: 6522 ld a0,8(sp) + 80010814: 6582 ld a1,0(sp) + 80010816: ffc5f693 andi a3,a1,-4 + 8001081a: 058e slli a1,a1,0x3 + 8001081c: 0ff00613 li a2,255 + 80010820: 00b617bb sllw a5,a2,a1 + 80010824: 0ff57513 andi a0,a0,255 + 80010828: 00b5173b sllw a4,a0,a1 + 8001082c: 1606a52f lr.w.aqrl a0,(a3) + 80010830: 863a mv a2,a4 + 80010832: 8e29 xor a2,a2,a0 + 80010834: 8e7d and a2,a2,a5 + 80010836: 8e29 xor a2,a2,a0 + 80010838: 1ec6a62f sc.w.aqrl a2,a2,(a3) + 8001083c: fa65 bnez a2,8001082c <.LBB2_2+0x1a> + 8001083e: 00b5553b srlw a0,a0,a1 + 80010842: 00a10fa3 sb a0,31(sp) + 80010846: a0d5 j 8001092a <.LBB2_10+0x38> + ... + +000000008001084a <.LBB2_4>: + Acquire => intrinsics::atomic_xchg_acq(dst, val), + 8001084a: 6522 ld a0,8(sp) + 8001084c: 6582 ld a1,0(sp) + 8001084e: ffc5f693 andi a3,a1,-4 + 80010852: 058e slli a1,a1,0x3 + 80010854: 0ff00613 li a2,255 + 80010858: 00b617bb sllw a5,a2,a1 + 8001085c: 0ff57513 andi a0,a0,255 + 80010860: 00b5173b sllw a4,a0,a1 + 80010864: 1406a52f lr.w.aq a0,(a3) + 80010868: 863a mv a2,a4 + 8001086a: 8e29 xor a2,a2,a0 + 8001086c: 8e7d and a2,a2,a5 + 8001086e: 8e29 xor a2,a2,a0 + 80010870: 18c6a62f sc.w a2,a2,(a3) + 80010874: fa65 bnez a2,80010864 <.LBB2_4+0x1a> + 80010876: 00b5553b srlw a0,a0,a1 + 8001087a: 00a10fa3 sb a0,31(sp) + 8001087e: a009 j 80010880 <.LBB2_4+0x36> + match order { + 80010880: a075 j 8001092c <.LBB2_10+0x3a> + +0000000080010882 <.LBB2_6>: + Release => intrinsics::atomic_xchg_rel(dst, val), + 80010882: 6522 ld a0,8(sp) + 80010884: 6582 ld a1,0(sp) + 80010886: ffc5f693 andi a3,a1,-4 + 8001088a: 058e slli a1,a1,0x3 + 8001088c: 0ff00613 li a2,255 + 80010890: 00b617bb sllw a5,a2,a1 + 80010894: 0ff57513 andi a0,a0,255 + 80010898: 00b5173b sllw a4,a0,a1 + 8001089c: 1006a52f lr.w a0,(a3) + 800108a0: 863a mv a2,a4 + 800108a2: 8e29 xor a2,a2,a0 + 800108a4: 8e7d and a2,a2,a5 + 800108a6: 8e29 xor a2,a2,a0 + 800108a8: 1ac6a62f sc.w.rl a2,a2,(a3) + 800108ac: fa65 bnez a2,8001089c <.LBB2_6+0x1a> + 800108ae: 00b5553b srlw a0,a0,a1 + 800108b2: 00a10fa3 sb a0,31(sp) + 800108b6: a009 j 800108b8 <.LBB2_6+0x36> + match order { + 800108b8: a895 j 8001092c <.LBB2_10+0x3a> + +00000000800108ba <.LBB2_8>: + AcqRel => intrinsics::atomic_xchg_acqrel(dst, val), + 800108ba: 6522 ld a0,8(sp) + 800108bc: 6582 ld a1,0(sp) + 800108be: ffc5f693 andi a3,a1,-4 + 800108c2: 058e slli a1,a1,0x3 + 800108c4: 0ff00613 li a2,255 + 800108c8: 00b617bb sllw a5,a2,a1 + 800108cc: 0ff57513 andi a0,a0,255 + 800108d0: 00b5173b sllw a4,a0,a1 + 800108d4: 1406a52f lr.w.aq a0,(a3) + 800108d8: 863a mv a2,a4 + 800108da: 8e29 xor a2,a2,a0 + 800108dc: 8e7d and a2,a2,a5 + 800108de: 8e29 xor a2,a2,a0 + 800108e0: 1ac6a62f sc.w.rl a2,a2,(a3) + 800108e4: fa65 bnez a2,800108d4 <.LBB2_8+0x1a> + 800108e6: 00b5553b srlw a0,a0,a1 + 800108ea: 00a10fa3 sb a0,31(sp) + 800108ee: a009 j 800108f0 <.LBB2_8+0x36> + match order { + 800108f0: a835 j 8001092c <.LBB2_10+0x3a> + +00000000800108f2 <.LBB2_10>: + Relaxed => intrinsics::atomic_xchg_relaxed(dst, val), + 800108f2: 6522 ld a0,8(sp) + 800108f4: 6582 ld a1,0(sp) + 800108f6: ffc5f693 andi a3,a1,-4 + 800108fa: 058e slli a1,a1,0x3 + 800108fc: 0ff00613 li a2,255 + 80010900: 00b617bb sllw a5,a2,a1 + 80010904: 0ff57513 andi a0,a0,255 + 80010908: 00b5173b sllw a4,a0,a1 + 8001090c: 1006a52f lr.w a0,(a3) + 80010910: 863a mv a2,a4 + 80010912: 8e29 xor a2,a2,a0 + 80010914: 8e7d and a2,a2,a5 + 80010916: 8e29 xor a2,a2,a0 + 80010918: 18c6a62f sc.w a2,a2,(a3) + 8001091c: fa65 bnez a2,8001090c <.LBB2_10+0x1a> + 8001091e: 00b5553b srlw a0,a0,a1 + 80010922: 00a10fa3 sb a0,31(sp) + 80010926: a009 j 80010928 <.LBB2_10+0x36> + match order { + 80010928: a011 j 8001092c <.LBB2_10+0x3a> + 8001092a: a009 j 8001092c <.LBB2_10+0x3a> +} + 8001092c: 01f10503 lb a0,31(sp) + 80010930: 6145 addi sp,sp,48 + 80010932: 8082 ret + +Disassembly of section .text._ZN4core4sync6atomic12atomic_store17h031d76ab229dd222E: + +0000000080010934 <_ZN4core4sync6atomic12atomic_store17h031d76ab229dd222E>: +unsafe fn atomic_store(dst: *mut T, val: T, order: Ordering) { + 80010934: 7139 addi sp,sp,-64 + 80010936: e42a sd a0,8(sp) + 80010938: 86ae mv a3,a1 + 8001093a: e836 sd a3,16(sp) + 8001093c: 02c103a3 sb a2,39(sp) + 80010940: f82a sd a0,48(sp) + 80010942: 02b10fa3 sb a1,63(sp) + Release => intrinsics::atomic_store_rel(dst, val), + 80010946: 0ff67513 andi a0,a2,255 + 8001094a: ec2a sd a0,24(sp) + 8001094c: 6562 ld a0,24(sp) + 8001094e: 050e slli a0,a0,0x3 + +0000000080010950 <.LBB3_12>: + 80010950: 00019597 auipc a1,0x19 + 80010954: 01058593 addi a1,a1,16 # 80029960 <.LJTI3_0> + 80010958: 952e add a0,a0,a1 + 8001095a: 6108 ld a0,0(a0) + 8001095c: 8502 jr a0 + +000000008001095e <.LBB3_13>: + AcqRel => panic!("there is no such thing as an acquire/release store"), + 8001095e: 00019517 auipc a0,0x19 + 80010962: 02a50513 addi a0,a0,42 # 80029988 <.L__unnamed_1> + +0000000080010966 <.LBB3_14>: + 80010966: 00019617 auipc a2,0x19 + 8001096a: 0d260613 addi a2,a2,210 # 80029a38 <.L__unnamed_2> + 8001096e: 03200593 li a1,50 + 80010972: 00012097 auipc ra,0x12 + 80010976: 7d2080e7 jalr 2002(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001097a: 0000 unimp + ... + +000000008001097e <.LBB3_4>: + Release => intrinsics::atomic_store_rel(dst, val), + 8001097e: 6542 ld a0,16(sp) + 80010980: 65a2 ld a1,8(sp) + 80010982: 0310000f fence rw,w + 80010986: 00a58023 sb a0,0(a1) + 8001098a: a009 j 8001098c <.LBB3_4+0xe> + match order { + 8001098c: a835 j 800109c8 <.LBB3_16+0x16> + +000000008001098e <.LBB3_6>: + Relaxed => intrinsics::atomic_store_relaxed(dst, val), + 8001098e: 6542 ld a0,16(sp) + 80010990: 65a2 ld a1,8(sp) + 80010992: 00a58023 sb a0,0(a1) + 80010996: a009 j 80010998 <.LBB3_6+0xa> + match order { + 80010998: a805 j 800109c8 <.LBB3_16+0x16> + +000000008001099a <.LBB3_8>: + SeqCst => intrinsics::atomic_store(dst, val), + 8001099a: 6542 ld a0,16(sp) + 8001099c: 65a2 ld a1,8(sp) + 8001099e: 0310000f fence rw,w + 800109a2: 00a58023 sb a0,0(a1) + 800109a6: a009 j 800109a8 <.LBB3_8+0xe> + match order { + 800109a8: a005 j 800109c8 <.LBB3_16+0x16> + +00000000800109aa <.LBB3_10>: + Acquire => panic!("there is no such thing as an acquire store"), + 800109aa: 00019517 auipc a0,0x19 + 800109ae: 0a650513 addi a0,a0,166 # 80029a50 <.L__unnamed_3> + +00000000800109b2 <.LBB3_16>: + 800109b2: 00019617 auipc a2,0x19 + 800109b6: 0ce60613 addi a2,a2,206 # 80029a80 <.L__unnamed_4> + 800109ba: 02a00593 li a1,42 + 800109be: 00012097 auipc ra,0x12 + 800109c2: 786080e7 jalr 1926(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800109c6: 0000 unimp +} + 800109c8: 6121 addi sp,sp,64 + 800109ca: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$3new17h56b5f93ca614e897E: + +00000000800109cc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$3new17h56b5f93ca614e897E>: + pub const fn new(data: T, name: &'static str) -> Self { + 800109cc: 715d addi sp,sp,-80 + let lock = Spinlock { + 800109ce: e486 sd ra,72(sp) + 800109d0: e432 sd a2,8(sp) + 800109d2: e82e sd a1,16(sp) + 800109d4: ec2a sd a0,24(sp) + 800109d6: f82e sd a1,48(sp) + 800109d8: fc32 sd a2,56(sp) + 800109da: 4501 li a0,0 + locked: AtomicBool::new(false), + 800109dc: ffff4097 auipc ra,0xffff4 + 800109e0: d0a080e7 jalr -758(ra) # 800046e6 <_ZN4core4sync6atomic10AtomicBool3new17hb0054f5394c676a1E> + 800109e4: 04a103a3 sb a0,71(sp) + 800109e8: 02a10023 sb a0,32(sp) + 800109ec: a009 j 800109ee <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$3new17h56b5f93ca614e897E+0x22> + 800109ee: 557d li a0,-1 + cpu_id: Cell::new(-1), + 800109f0: ffff5097 auipc ra,0xffff5 + 800109f4: 89a080e7 jalr -1894(ra) # 8000528a <_ZN4core4cell13Cell$LT$T$GT$3new17h92764083b52e393eE> + 800109f8: e02a sd a0,0(sp) + 800109fa: a009 j 800109fc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$3new17h56b5f93ca614e897E+0x30> + data: UnsafeCell::new(data) + 800109fc: ffff5097 auipc ra,0xffff5 + 80010a00: 9de080e7 jalr -1570(ra) # 800053da <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17hc63dc9326193c257E> + 80010a04: a009 j 80010a06 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$3new17h56b5f93ca614e897E+0x3a> + let lock = Spinlock { + 80010a06: 6502 ld a0,0(sp) + 80010a08: 65e2 ld a1,24(sp) + 80010a0a: 6622 ld a2,8(sp) + 80010a0c: 66c2 ld a3,16(sp) + 80010a0e: 02010703 lb a4,32(sp) + 80010a12: 00e58c23 sb a4,24(a1) + 80010a16: e194 sd a3,0(a1) + 80010a18: e590 sd a2,8(a1) + 80010a1a: e988 sd a0,16(a1) + } + 80010a1c: 60a6 ld ra,72(sp) + 80010a1e: 6161 addi sp,sp,80 + 80010a20: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E: + +0000000080010a22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80010a22: 7135 addi sp,sp,-160 + 80010a24: ed06 sd ra,152(sp) + 80010a26: f82a sd a0,48(sp) + push_off(); + 80010a28: 00002097 auipc ra,0x2 + 80010a2c: e34080e7 jalr -460(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80010a30: a009 j 80010a32 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E+0x10> + if self.holding() { + 80010a32: 7542 ld a0,48(sp) + 80010a34: 00001097 auipc ra,0x1 + 80010a38: f84080e7 jalr -124(ra) # 800119b8 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE> + 80010a3c: f42a sd a0,40(sp) + 80010a3e: a009 j 80010a40 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E+0x1e> + 80010a40: 7522 ld a0,40(sp) + 80010a42: 4581 li a1,0 + 80010a44: 02b50163 beq a0,a1,80010a66 <.LBB1_15+0x16> + 80010a48: a009 j 80010a4a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E+0x28> + panic!("spinlock {} acquire", self.name); + 80010a4a: 7542 ld a0,48(sp) + 80010a4c: e12a sd a0,128(sp) + 80010a4e: e92a sd a0,144(sp) + +0000000080010a50 <.LBB1_15>: + 80010a50: 0000f597 auipc a1,0xf + 80010a54: a1058593 addi a1,a1,-1520 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80010a58: 0000f097 auipc ra,0xf + 80010a5c: a2c080e7 jalr -1492(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80010a60: ec2a sd a0,24(sp) + 80010a62: f02e sd a1,32(sp) + 80010a64: a011 j 80010a68 <.LBB1_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80010a66: a825 j 80010a9e <.LBB1_17+0x14> + panic!("spinlock {} acquire", self.name); + 80010a68: 7502 ld a0,32(sp) + 80010a6a: 65e2 ld a1,24(sp) + 80010a6c: f8ae sd a1,112(sp) + 80010a6e: fcaa sd a0,120(sp) + +0000000080010a70 <.LBB1_16>: + 80010a70: 00019597 auipc a1,0x19 + 80010a74: 03858593 addi a1,a1,56 # 80029aa8 <.L__unnamed_1> + 80010a78: 0088 addi a0,sp,64 + 80010a7a: 4609 li a2,2 + 80010a7c: 1894 addi a3,sp,112 + 80010a7e: 4705 li a4,1 + 80010a80: ffff5097 auipc ra,0xffff5 + 80010a84: b0a080e7 jalr -1270(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80010a88: a009 j 80010a8a <.LBB1_17> + +0000000080010a8a <.LBB1_17>: + 80010a8a: 00019597 auipc a1,0x19 + 80010a8e: 05658593 addi a1,a1,86 # 80029ae0 <.L__unnamed_2> + 80010a92: 0088 addi a0,sp,64 + 80010a94: 00012097 auipc ra,0x12 + 80010a98: 71c080e7 jalr 1820(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80010a9c: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 80010a9e: 7542 ld a0,48(sp) + 80010aa0: 0561 addi a0,a0,24 + 80010aa2: 4609 li a2,2 + 80010aa4: 08c10723 sb a2,142(sp) + 80010aa8: 4585 li a1,1 + 80010aaa: ffff4097 auipc ra,0xffff4 + 80010aae: c96080e7 jalr -874(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 80010ab2: e82a sd a0,16(sp) + 80010ab4: a009 j 80010ab6 <.LBB1_17+0x2c> + 80010ab6: 6542 ld a0,16(sp) + 80010ab8: e911 bnez a0,80010acc <.LBB1_17+0x42> + 80010aba: a009 j 80010abc <.LBB1_17+0x32> + 80010abc: 4511 li a0,4 + fence(Ordering::SeqCst); + 80010abe: 08a107a3 sb a0,143(sp) + 80010ac2: ffff4097 auipc ra,0xffff4 + 80010ac6: d86080e7 jalr -634(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80010aca: a039 j 80010ad8 <.LBB1_17+0x4e> + spin_loop(); + 80010acc: fffff097 auipc ra,0xfffff + 80010ad0: 50a080e7 jalr 1290(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 80010ad4: a009 j 80010ad6 <.LBB1_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 80010ad6: b7e1 j 80010a9e <.LBB1_17+0x14> + self.cpu_id.set(cpuid() as isize); + 80010ad8: 7542 ld a0,48(sp) + 80010ada: 0541 addi a0,a0,16 + 80010adc: e02a sd a0,0(sp) + 80010ade: 00002097 auipc ra,0x2 + 80010ae2: 912080e7 jalr -1774(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80010ae6: e42a sd a0,8(sp) + 80010ae8: a009 j 80010aea <.LBB1_17+0x60> + 80010aea: 65a2 ld a1,8(sp) + 80010aec: 6502 ld a0,0(sp) + 80010aee: ffff4097 auipc ra,0xffff4 + 80010af2: 7e6080e7 jalr 2022(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80010af6: a009 j 80010af8 <.LBB1_17+0x6e> + SpinlockGuard{spinlock: &self} + 80010af8: 7542 ld a0,48(sp) + 80010afa: fc2a sd a0,56(sp) + } + 80010afc: 60ea ld ra,152(sp) + 80010afe: 610d addi sp,sp,160 + 80010b00: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E: + +0000000080010b02 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80010b02: 7135 addi sp,sp,-160 + 80010b04: ed06 sd ra,152(sp) + 80010b06: f82a sd a0,48(sp) + push_off(); + 80010b08: 00002097 auipc ra,0x2 + 80010b0c: d54080e7 jalr -684(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80010b10: a009 j 80010b12 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E+0x10> + if self.holding() { + 80010b12: 7542 ld a0,48(sp) + 80010b14: 00001097 auipc ra,0x1 + 80010b18: 110080e7 jalr 272(ra) # 80011c24 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E> + 80010b1c: f42a sd a0,40(sp) + 80010b1e: a009 j 80010b20 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E+0x1e> + 80010b20: 7522 ld a0,40(sp) + 80010b22: 4581 li a1,0 + 80010b24: 02b50163 beq a0,a1,80010b46 <.LBB2_15+0x16> + 80010b28: a009 j 80010b2a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h107253eaf5028ed4E+0x28> + panic!("spinlock {} acquire", self.name); + 80010b2a: 7542 ld a0,48(sp) + 80010b2c: e12a sd a0,128(sp) + 80010b2e: e92a sd a0,144(sp) + +0000000080010b30 <.LBB2_15>: + 80010b30: 0000f597 auipc a1,0xf + 80010b34: 93058593 addi a1,a1,-1744 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80010b38: 0000f097 auipc ra,0xf + 80010b3c: 94c080e7 jalr -1716(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80010b40: ec2a sd a0,24(sp) + 80010b42: f02e sd a1,32(sp) + 80010b44: a011 j 80010b48 <.LBB2_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80010b46: a825 j 80010b7e <.LBB2_17+0x14> + panic!("spinlock {} acquire", self.name); + 80010b48: 7502 ld a0,32(sp) + 80010b4a: 65e2 ld a1,24(sp) + 80010b4c: f8ae sd a1,112(sp) + 80010b4e: fcaa sd a0,120(sp) + +0000000080010b50 <.LBB2_16>: + 80010b50: 00019597 auipc a1,0x19 + 80010b54: f5858593 addi a1,a1,-168 # 80029aa8 <.L__unnamed_1> + 80010b58: 0088 addi a0,sp,64 + 80010b5a: 4609 li a2,2 + 80010b5c: 1894 addi a3,sp,112 + 80010b5e: 4705 li a4,1 + 80010b60: ffff5097 auipc ra,0xffff5 + 80010b64: a2a080e7 jalr -1494(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80010b68: a009 j 80010b6a <.LBB2_17> + +0000000080010b6a <.LBB2_17>: + 80010b6a: 00019597 auipc a1,0x19 + 80010b6e: f7658593 addi a1,a1,-138 # 80029ae0 <.L__unnamed_2> + 80010b72: 0088 addi a0,sp,64 + 80010b74: 00012097 auipc ra,0x12 + 80010b78: 63c080e7 jalr 1596(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80010b7c: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 80010b7e: 7542 ld a0,48(sp) + 80010b80: 0561 addi a0,a0,24 + 80010b82: 4609 li a2,2 + 80010b84: 08c10723 sb a2,142(sp) + 80010b88: 4585 li a1,1 + 80010b8a: ffff4097 auipc ra,0xffff4 + 80010b8e: bb6080e7 jalr -1098(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 80010b92: e82a sd a0,16(sp) + 80010b94: a009 j 80010b96 <.LBB2_17+0x2c> + 80010b96: 6542 ld a0,16(sp) + 80010b98: e911 bnez a0,80010bac <.LBB2_17+0x42> + 80010b9a: a009 j 80010b9c <.LBB2_17+0x32> + 80010b9c: 4511 li a0,4 + fence(Ordering::SeqCst); + 80010b9e: 08a107a3 sb a0,143(sp) + 80010ba2: ffff4097 auipc ra,0xffff4 + 80010ba6: ca6080e7 jalr -858(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80010baa: a039 j 80010bb8 <.LBB2_17+0x4e> + spin_loop(); + 80010bac: fffff097 auipc ra,0xfffff + 80010bb0: 42a080e7 jalr 1066(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 80010bb4: a009 j 80010bb6 <.LBB2_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 80010bb6: b7e1 j 80010b7e <.LBB2_17+0x14> + self.cpu_id.set(cpuid() as isize); + 80010bb8: 7542 ld a0,48(sp) + 80010bba: 0541 addi a0,a0,16 + 80010bbc: e02a sd a0,0(sp) + 80010bbe: 00002097 auipc ra,0x2 + 80010bc2: 832080e7 jalr -1998(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80010bc6: e42a sd a0,8(sp) + 80010bc8: a009 j 80010bca <.LBB2_17+0x60> + 80010bca: 65a2 ld a1,8(sp) + 80010bcc: 6502 ld a0,0(sp) + 80010bce: ffff4097 auipc ra,0xffff4 + 80010bd2: 706080e7 jalr 1798(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80010bd6: a009 j 80010bd8 <.LBB2_17+0x6e> + SpinlockGuard{spinlock: &self} + 80010bd8: 7542 ld a0,48(sp) + 80010bda: fc2a sd a0,56(sp) + } + 80010bdc: 60ea ld ra,152(sp) + 80010bde: 610d addi sp,sp,160 + 80010be0: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E: + +0000000080010be2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80010be2: 7135 addi sp,sp,-160 + 80010be4: ed06 sd ra,152(sp) + 80010be6: f82a sd a0,48(sp) + push_off(); + 80010be8: 00002097 auipc ra,0x2 + 80010bec: c74080e7 jalr -908(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80010bf0: a009 j 80010bf2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E+0x10> + if self.holding() { + 80010bf2: 7542 ld a0,48(sp) + 80010bf4: 00001097 auipc ra,0x1 + 80010bf8: d48080e7 jalr -696(ra) # 8001193c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E> + 80010bfc: f42a sd a0,40(sp) + 80010bfe: a009 j 80010c00 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E+0x1e> + 80010c00: 7522 ld a0,40(sp) + 80010c02: 4581 li a1,0 + 80010c04: 02b50163 beq a0,a1,80010c26 <.LBB3_15+0x16> + 80010c08: a009 j 80010c0a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h25a8532f298de6d8E+0x28> + panic!("spinlock {} acquire", self.name); + 80010c0a: 7542 ld a0,48(sp) + 80010c0c: e12a sd a0,128(sp) + 80010c0e: e92a sd a0,144(sp) + +0000000080010c10 <.LBB3_15>: + 80010c10: 0000f597 auipc a1,0xf + 80010c14: 85058593 addi a1,a1,-1968 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80010c18: 0000f097 auipc ra,0xf + 80010c1c: 86c080e7 jalr -1940(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80010c20: ec2a sd a0,24(sp) + 80010c22: f02e sd a1,32(sp) + 80010c24: a011 j 80010c28 <.LBB3_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80010c26: a825 j 80010c5e <.LBB3_17+0x14> + panic!("spinlock {} acquire", self.name); + 80010c28: 7502 ld a0,32(sp) + 80010c2a: 65e2 ld a1,24(sp) + 80010c2c: f8ae sd a1,112(sp) + 80010c2e: fcaa sd a0,120(sp) + +0000000080010c30 <.LBB3_16>: + 80010c30: 00019597 auipc a1,0x19 + 80010c34: e7858593 addi a1,a1,-392 # 80029aa8 <.L__unnamed_1> + 80010c38: 0088 addi a0,sp,64 + 80010c3a: 4609 li a2,2 + 80010c3c: 1894 addi a3,sp,112 + 80010c3e: 4705 li a4,1 + 80010c40: ffff5097 auipc ra,0xffff5 + 80010c44: 94a080e7 jalr -1718(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80010c48: a009 j 80010c4a <.LBB3_17> + +0000000080010c4a <.LBB3_17>: + 80010c4a: 00019597 auipc a1,0x19 + 80010c4e: e9658593 addi a1,a1,-362 # 80029ae0 <.L__unnamed_2> + 80010c52: 0088 addi a0,sp,64 + 80010c54: 00012097 auipc ra,0x12 + 80010c58: 55c080e7 jalr 1372(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80010c5c: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 80010c5e: 7542 ld a0,48(sp) + 80010c60: 0561 addi a0,a0,24 + 80010c62: 4609 li a2,2 + 80010c64: 08c10723 sb a2,142(sp) + 80010c68: 4585 li a1,1 + 80010c6a: ffff4097 auipc ra,0xffff4 + 80010c6e: ad6080e7 jalr -1322(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 80010c72: e82a sd a0,16(sp) + 80010c74: a009 j 80010c76 <.LBB3_17+0x2c> + 80010c76: 6542 ld a0,16(sp) + 80010c78: e911 bnez a0,80010c8c <.LBB3_17+0x42> + 80010c7a: a009 j 80010c7c <.LBB3_17+0x32> + 80010c7c: 4511 li a0,4 + fence(Ordering::SeqCst); + 80010c7e: 08a107a3 sb a0,143(sp) + 80010c82: ffff4097 auipc ra,0xffff4 + 80010c86: bc6080e7 jalr -1082(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80010c8a: a039 j 80010c98 <.LBB3_17+0x4e> + spin_loop(); + 80010c8c: fffff097 auipc ra,0xfffff + 80010c90: 34a080e7 jalr 842(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 80010c94: a009 j 80010c96 <.LBB3_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 80010c96: b7e1 j 80010c5e <.LBB3_17+0x14> + self.cpu_id.set(cpuid() as isize); + 80010c98: 7542 ld a0,48(sp) + 80010c9a: 0541 addi a0,a0,16 + 80010c9c: e02a sd a0,0(sp) + 80010c9e: 00001097 auipc ra,0x1 + 80010ca2: 752080e7 jalr 1874(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80010ca6: e42a sd a0,8(sp) + 80010ca8: a009 j 80010caa <.LBB3_17+0x60> + 80010caa: 65a2 ld a1,8(sp) + 80010cac: 6502 ld a0,0(sp) + 80010cae: ffff4097 auipc ra,0xffff4 + 80010cb2: 626080e7 jalr 1574(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80010cb6: a009 j 80010cb8 <.LBB3_17+0x6e> + SpinlockGuard{spinlock: &self} + 80010cb8: 7542 ld a0,48(sp) + 80010cba: fc2a sd a0,56(sp) + } + 80010cbc: 60ea ld ra,152(sp) + 80010cbe: 610d addi sp,sp,160 + 80010cc0: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E: + +0000000080010cc2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80010cc2: 7135 addi sp,sp,-160 + 80010cc4: ed06 sd ra,152(sp) + 80010cc6: f82a sd a0,48(sp) + push_off(); + 80010cc8: 00002097 auipc ra,0x2 + 80010ccc: b94080e7 jalr -1132(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80010cd0: a009 j 80010cd2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E+0x10> + if self.holding() { + 80010cd2: 7542 ld a0,48(sp) + 80010cd4: 00001097 auipc ra,0x1 + 80010cd8: e58080e7 jalr -424(ra) # 80011b2c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E> + 80010cdc: f42a sd a0,40(sp) + 80010cde: a009 j 80010ce0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E+0x1e> + 80010ce0: 7522 ld a0,40(sp) + 80010ce2: 4581 li a1,0 + 80010ce4: 02b50163 beq a0,a1,80010d06 <.LBB4_15+0x16> + 80010ce8: a009 j 80010cea <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h431ef48b95a5e4c6E+0x28> + panic!("spinlock {} acquire", self.name); + 80010cea: 7542 ld a0,48(sp) + 80010cec: e12a sd a0,128(sp) + 80010cee: e92a sd a0,144(sp) + +0000000080010cf0 <.LBB4_15>: + 80010cf0: 0000e597 auipc a1,0xe + 80010cf4: 77058593 addi a1,a1,1904 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80010cf8: 0000e097 auipc ra,0xe + 80010cfc: 78c080e7 jalr 1932(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80010d00: ec2a sd a0,24(sp) + 80010d02: f02e sd a1,32(sp) + 80010d04: a011 j 80010d08 <.LBB4_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80010d06: a825 j 80010d3e <.LBB4_17+0x14> + panic!("spinlock {} acquire", self.name); + 80010d08: 7502 ld a0,32(sp) + 80010d0a: 65e2 ld a1,24(sp) + 80010d0c: f8ae sd a1,112(sp) + 80010d0e: fcaa sd a0,120(sp) + +0000000080010d10 <.LBB4_16>: + 80010d10: 00019597 auipc a1,0x19 + 80010d14: d9858593 addi a1,a1,-616 # 80029aa8 <.L__unnamed_1> + 80010d18: 0088 addi a0,sp,64 + 80010d1a: 4609 li a2,2 + 80010d1c: 1894 addi a3,sp,112 + 80010d1e: 4705 li a4,1 + 80010d20: ffff5097 auipc ra,0xffff5 + 80010d24: 86a080e7 jalr -1942(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80010d28: a009 j 80010d2a <.LBB4_17> + +0000000080010d2a <.LBB4_17>: + 80010d2a: 00019597 auipc a1,0x19 + 80010d2e: db658593 addi a1,a1,-586 # 80029ae0 <.L__unnamed_2> + 80010d32: 0088 addi a0,sp,64 + 80010d34: 00012097 auipc ra,0x12 + 80010d38: 47c080e7 jalr 1148(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80010d3c: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 80010d3e: 7542 ld a0,48(sp) + 80010d40: 0561 addi a0,a0,24 + 80010d42: 4609 li a2,2 + 80010d44: 08c10723 sb a2,142(sp) + 80010d48: 4585 li a1,1 + 80010d4a: ffff4097 auipc ra,0xffff4 + 80010d4e: 9f6080e7 jalr -1546(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 80010d52: e82a sd a0,16(sp) + 80010d54: a009 j 80010d56 <.LBB4_17+0x2c> + 80010d56: 6542 ld a0,16(sp) + 80010d58: e911 bnez a0,80010d6c <.LBB4_17+0x42> + 80010d5a: a009 j 80010d5c <.LBB4_17+0x32> + 80010d5c: 4511 li a0,4 + fence(Ordering::SeqCst); + 80010d5e: 08a107a3 sb a0,143(sp) + 80010d62: ffff4097 auipc ra,0xffff4 + 80010d66: ae6080e7 jalr -1306(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80010d6a: a039 j 80010d78 <.LBB4_17+0x4e> + spin_loop(); + 80010d6c: fffff097 auipc ra,0xfffff + 80010d70: 26a080e7 jalr 618(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 80010d74: a009 j 80010d76 <.LBB4_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 80010d76: b7e1 j 80010d3e <.LBB4_17+0x14> + self.cpu_id.set(cpuid() as isize); + 80010d78: 7542 ld a0,48(sp) + 80010d7a: 0541 addi a0,a0,16 + 80010d7c: e02a sd a0,0(sp) + 80010d7e: 00001097 auipc ra,0x1 + 80010d82: 672080e7 jalr 1650(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80010d86: e42a sd a0,8(sp) + 80010d88: a009 j 80010d8a <.LBB4_17+0x60> + 80010d8a: 65a2 ld a1,8(sp) + 80010d8c: 6502 ld a0,0(sp) + 80010d8e: ffff4097 auipc ra,0xffff4 + 80010d92: 546080e7 jalr 1350(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80010d96: a009 j 80010d98 <.LBB4_17+0x6e> + SpinlockGuard{spinlock: &self} + 80010d98: 7542 ld a0,48(sp) + 80010d9a: fc2a sd a0,56(sp) + } + 80010d9c: 60ea ld ra,152(sp) + 80010d9e: 610d addi sp,sp,160 + 80010da0: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE: + +0000000080010da2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80010da2: 7135 addi sp,sp,-160 + 80010da4: ed06 sd ra,152(sp) + 80010da6: f82a sd a0,48(sp) + push_off(); + 80010da8: 00002097 auipc ra,0x2 + 80010dac: ab4080e7 jalr -1356(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80010db0: a009 j 80010db2 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE+0x10> + if self.holding() { + 80010db2: 7542 ld a0,48(sp) + 80010db4: 00001097 auipc ra,0x1 + 80010db8: cfc080e7 jalr -772(ra) # 80011ab0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E> + 80010dbc: f42a sd a0,40(sp) + 80010dbe: a009 j 80010dc0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE+0x1e> + 80010dc0: 7522 ld a0,40(sp) + 80010dc2: 4581 li a1,0 + 80010dc4: 02b50163 beq a0,a1,80010de6 <.LBB5_15+0x16> + 80010dc8: a009 j 80010dca <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h4c9081acf22588feE+0x28> + panic!("spinlock {} acquire", self.name); + 80010dca: 7542 ld a0,48(sp) + 80010dcc: e12a sd a0,128(sp) + 80010dce: e92a sd a0,144(sp) + +0000000080010dd0 <.LBB5_15>: + 80010dd0: 0000e597 auipc a1,0xe + 80010dd4: 69058593 addi a1,a1,1680 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80010dd8: 0000e097 auipc ra,0xe + 80010ddc: 6ac080e7 jalr 1708(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80010de0: ec2a sd a0,24(sp) + 80010de2: f02e sd a1,32(sp) + 80010de4: a011 j 80010de8 <.LBB5_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80010de6: a825 j 80010e1e <.LBB5_17+0x14> + panic!("spinlock {} acquire", self.name); + 80010de8: 7502 ld a0,32(sp) + 80010dea: 65e2 ld a1,24(sp) + 80010dec: f8ae sd a1,112(sp) + 80010dee: fcaa sd a0,120(sp) + +0000000080010df0 <.LBB5_16>: + 80010df0: 00019597 auipc a1,0x19 + 80010df4: cb858593 addi a1,a1,-840 # 80029aa8 <.L__unnamed_1> + 80010df8: 0088 addi a0,sp,64 + 80010dfa: 4609 li a2,2 + 80010dfc: 1894 addi a3,sp,112 + 80010dfe: 4705 li a4,1 + 80010e00: ffff4097 auipc ra,0xffff4 + 80010e04: 78a080e7 jalr 1930(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80010e08: a009 j 80010e0a <.LBB5_17> + +0000000080010e0a <.LBB5_17>: + 80010e0a: 00019597 auipc a1,0x19 + 80010e0e: cd658593 addi a1,a1,-810 # 80029ae0 <.L__unnamed_2> + 80010e12: 0088 addi a0,sp,64 + 80010e14: 00012097 auipc ra,0x12 + 80010e18: 39c080e7 jalr 924(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80010e1c: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 80010e1e: 7542 ld a0,48(sp) + 80010e20: 0561 addi a0,a0,24 + 80010e22: 4609 li a2,2 + 80010e24: 08c10723 sb a2,142(sp) + 80010e28: 4585 li a1,1 + 80010e2a: ffff4097 auipc ra,0xffff4 + 80010e2e: 916080e7 jalr -1770(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 80010e32: e82a sd a0,16(sp) + 80010e34: a009 j 80010e36 <.LBB5_17+0x2c> + 80010e36: 6542 ld a0,16(sp) + 80010e38: e911 bnez a0,80010e4c <.LBB5_17+0x42> + 80010e3a: a009 j 80010e3c <.LBB5_17+0x32> + 80010e3c: 4511 li a0,4 + fence(Ordering::SeqCst); + 80010e3e: 08a107a3 sb a0,143(sp) + 80010e42: ffff4097 auipc ra,0xffff4 + 80010e46: a06080e7 jalr -1530(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80010e4a: a039 j 80010e58 <.LBB5_17+0x4e> + spin_loop(); + 80010e4c: fffff097 auipc ra,0xfffff + 80010e50: 18a080e7 jalr 394(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 80010e54: a009 j 80010e56 <.LBB5_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 80010e56: b7e1 j 80010e1e <.LBB5_17+0x14> + self.cpu_id.set(cpuid() as isize); + 80010e58: 7542 ld a0,48(sp) + 80010e5a: 0541 addi a0,a0,16 + 80010e5c: e02a sd a0,0(sp) + 80010e5e: 00001097 auipc ra,0x1 + 80010e62: 592080e7 jalr 1426(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80010e66: e42a sd a0,8(sp) + 80010e68: a009 j 80010e6a <.LBB5_17+0x60> + 80010e6a: 65a2 ld a1,8(sp) + 80010e6c: 6502 ld a0,0(sp) + 80010e6e: ffff4097 auipc ra,0xffff4 + 80010e72: 466080e7 jalr 1126(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80010e76: a009 j 80010e78 <.LBB5_17+0x6e> + SpinlockGuard{spinlock: &self} + 80010e78: 7542 ld a0,48(sp) + 80010e7a: fc2a sd a0,56(sp) + } + 80010e7c: 60ea ld ra,152(sp) + 80010e7e: 610d addi sp,sp,160 + 80010e80: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E: + +0000000080010e82 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80010e82: 7135 addi sp,sp,-160 + 80010e84: ed06 sd ra,152(sp) + 80010e86: f82a sd a0,48(sp) + push_off(); + 80010e88: 00002097 auipc ra,0x2 + 80010e8c: 9d4080e7 jalr -1580(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80010e90: a009 j 80010e92 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E+0x10> + if self.holding() { + 80010e92: 7542 ld a0,48(sp) + 80010e94: 00001097 auipc ra,0x1 + 80010e98: ba0080e7 jalr -1120(ra) # 80011a34 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E> + 80010e9c: f42a sd a0,40(sp) + 80010e9e: a009 j 80010ea0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E+0x1e> + 80010ea0: 7522 ld a0,40(sp) + 80010ea2: 4581 li a1,0 + 80010ea4: 02b50163 beq a0,a1,80010ec6 <.LBB6_15+0x16> + 80010ea8: a009 j 80010eaa <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E+0x28> + panic!("spinlock {} acquire", self.name); + 80010eaa: 7542 ld a0,48(sp) + 80010eac: e12a sd a0,128(sp) + 80010eae: e92a sd a0,144(sp) + +0000000080010eb0 <.LBB6_15>: + 80010eb0: 0000e597 auipc a1,0xe + 80010eb4: 5b058593 addi a1,a1,1456 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80010eb8: 0000e097 auipc ra,0xe + 80010ebc: 5cc080e7 jalr 1484(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80010ec0: ec2a sd a0,24(sp) + 80010ec2: f02e sd a1,32(sp) + 80010ec4: a011 j 80010ec8 <.LBB6_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80010ec6: a825 j 80010efe <.LBB6_17+0x14> + panic!("spinlock {} acquire", self.name); + 80010ec8: 7502 ld a0,32(sp) + 80010eca: 65e2 ld a1,24(sp) + 80010ecc: f8ae sd a1,112(sp) + 80010ece: fcaa sd a0,120(sp) + +0000000080010ed0 <.LBB6_16>: + 80010ed0: 00019597 auipc a1,0x19 + 80010ed4: bd858593 addi a1,a1,-1064 # 80029aa8 <.L__unnamed_1> + 80010ed8: 0088 addi a0,sp,64 + 80010eda: 4609 li a2,2 + 80010edc: 1894 addi a3,sp,112 + 80010ede: 4705 li a4,1 + 80010ee0: ffff4097 auipc ra,0xffff4 + 80010ee4: 6aa080e7 jalr 1706(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80010ee8: a009 j 80010eea <.LBB6_17> + +0000000080010eea <.LBB6_17>: + 80010eea: 00019597 auipc a1,0x19 + 80010eee: bf658593 addi a1,a1,-1034 # 80029ae0 <.L__unnamed_2> + 80010ef2: 0088 addi a0,sp,64 + 80010ef4: 00012097 auipc ra,0x12 + 80010ef8: 2bc080e7 jalr 700(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80010efc: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 80010efe: 7542 ld a0,48(sp) + 80010f00: 0561 addi a0,a0,24 + 80010f02: 4609 li a2,2 + 80010f04: 08c10723 sb a2,142(sp) + 80010f08: 4585 li a1,1 + 80010f0a: ffff4097 auipc ra,0xffff4 + 80010f0e: 836080e7 jalr -1994(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 80010f12: e82a sd a0,16(sp) + 80010f14: a009 j 80010f16 <.LBB6_17+0x2c> + 80010f16: 6542 ld a0,16(sp) + 80010f18: e911 bnez a0,80010f2c <.LBB6_17+0x42> + 80010f1a: a009 j 80010f1c <.LBB6_17+0x32> + 80010f1c: 4511 li a0,4 + fence(Ordering::SeqCst); + 80010f1e: 08a107a3 sb a0,143(sp) + 80010f22: ffff4097 auipc ra,0xffff4 + 80010f26: 926080e7 jalr -1754(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80010f2a: a039 j 80010f38 <.LBB6_17+0x4e> + spin_loop(); + 80010f2c: fffff097 auipc ra,0xfffff + 80010f30: 0aa080e7 jalr 170(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 80010f34: a009 j 80010f36 <.LBB6_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 80010f36: b7e1 j 80010efe <.LBB6_17+0x14> + self.cpu_id.set(cpuid() as isize); + 80010f38: 7542 ld a0,48(sp) + 80010f3a: 0541 addi a0,a0,16 + 80010f3c: e02a sd a0,0(sp) + 80010f3e: 00001097 auipc ra,0x1 + 80010f42: 4b2080e7 jalr 1202(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80010f46: e42a sd a0,8(sp) + 80010f48: a009 j 80010f4a <.LBB6_17+0x60> + 80010f4a: 65a2 ld a1,8(sp) + 80010f4c: 6502 ld a0,0(sp) + 80010f4e: ffff4097 auipc ra,0xffff4 + 80010f52: 386080e7 jalr 902(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80010f56: a009 j 80010f58 <.LBB6_17+0x6e> + SpinlockGuard{spinlock: &self} + 80010f58: 7542 ld a0,48(sp) + 80010f5a: fc2a sd a0,56(sp) + } + 80010f5c: 60ea ld ra,152(sp) + 80010f5e: 610d addi sp,sp,160 + 80010f60: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E: + +0000000080010f62 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80010f62: 7135 addi sp,sp,-160 + 80010f64: ed06 sd ra,152(sp) + 80010f66: f82a sd a0,48(sp) + push_off(); + 80010f68: 00002097 auipc ra,0x2 + 80010f6c: 8f4080e7 jalr -1804(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80010f70: a009 j 80010f72 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E+0x10> + if self.holding() { + 80010f72: 7542 ld a0,48(sp) + 80010f74: 00001097 auipc ra,0x1 + 80010f78: 8d0080e7 jalr -1840(ra) # 80011844 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E> + 80010f7c: f42a sd a0,40(sp) + 80010f7e: a009 j 80010f80 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E+0x1e> + 80010f80: 7522 ld a0,40(sp) + 80010f82: 4581 li a1,0 + 80010f84: 02b50163 beq a0,a1,80010fa6 <.LBB7_15+0x16> + 80010f88: a009 j 80010f8a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h922bace5232f6228E+0x28> + panic!("spinlock {} acquire", self.name); + 80010f8a: 7542 ld a0,48(sp) + 80010f8c: e12a sd a0,128(sp) + 80010f8e: e92a sd a0,144(sp) + +0000000080010f90 <.LBB7_15>: + 80010f90: 0000e597 auipc a1,0xe + 80010f94: 4d058593 addi a1,a1,1232 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80010f98: 0000e097 auipc ra,0xe + 80010f9c: 4ec080e7 jalr 1260(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80010fa0: ec2a sd a0,24(sp) + 80010fa2: f02e sd a1,32(sp) + 80010fa4: a011 j 80010fa8 <.LBB7_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80010fa6: a825 j 80010fde <.LBB7_17+0x14> + panic!("spinlock {} acquire", self.name); + 80010fa8: 7502 ld a0,32(sp) + 80010faa: 65e2 ld a1,24(sp) + 80010fac: f8ae sd a1,112(sp) + 80010fae: fcaa sd a0,120(sp) + +0000000080010fb0 <.LBB7_16>: + 80010fb0: 00019597 auipc a1,0x19 + 80010fb4: af858593 addi a1,a1,-1288 # 80029aa8 <.L__unnamed_1> + 80010fb8: 0088 addi a0,sp,64 + 80010fba: 4609 li a2,2 + 80010fbc: 1894 addi a3,sp,112 + 80010fbe: 4705 li a4,1 + 80010fc0: ffff4097 auipc ra,0xffff4 + 80010fc4: 5ca080e7 jalr 1482(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80010fc8: a009 j 80010fca <.LBB7_17> + +0000000080010fca <.LBB7_17>: + 80010fca: 00019597 auipc a1,0x19 + 80010fce: b1658593 addi a1,a1,-1258 # 80029ae0 <.L__unnamed_2> + 80010fd2: 0088 addi a0,sp,64 + 80010fd4: 00012097 auipc ra,0x12 + 80010fd8: 1dc080e7 jalr 476(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80010fdc: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 80010fde: 7542 ld a0,48(sp) + 80010fe0: 0561 addi a0,a0,24 + 80010fe2: 4609 li a2,2 + 80010fe4: 08c10723 sb a2,142(sp) + 80010fe8: 4585 li a1,1 + 80010fea: ffff3097 auipc ra,0xffff3 + 80010fee: 756080e7 jalr 1878(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 80010ff2: e82a sd a0,16(sp) + 80010ff4: a009 j 80010ff6 <.LBB7_17+0x2c> + 80010ff6: 6542 ld a0,16(sp) + 80010ff8: e911 bnez a0,8001100c <.LBB7_17+0x42> + 80010ffa: a009 j 80010ffc <.LBB7_17+0x32> + 80010ffc: 4511 li a0,4 + fence(Ordering::SeqCst); + 80010ffe: 08a107a3 sb a0,143(sp) + 80011002: ffff4097 auipc ra,0xffff4 + 80011006: 846080e7 jalr -1978(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 8001100a: a039 j 80011018 <.LBB7_17+0x4e> + spin_loop(); + 8001100c: fffff097 auipc ra,0xfffff + 80011010: fca080e7 jalr -54(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 80011014: a009 j 80011016 <.LBB7_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 80011016: b7e1 j 80010fde <.LBB7_17+0x14> + self.cpu_id.set(cpuid() as isize); + 80011018: 7542 ld a0,48(sp) + 8001101a: 0541 addi a0,a0,16 + 8001101c: e02a sd a0,0(sp) + 8001101e: 00001097 auipc ra,0x1 + 80011022: 3d2080e7 jalr 978(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011026: e42a sd a0,8(sp) + 80011028: a009 j 8001102a <.LBB7_17+0x60> + 8001102a: 65a2 ld a1,8(sp) + 8001102c: 6502 ld a0,0(sp) + 8001102e: ffff4097 auipc ra,0xffff4 + 80011032: 2a6080e7 jalr 678(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80011036: a009 j 80011038 <.LBB7_17+0x6e> + SpinlockGuard{spinlock: &self} + 80011038: 7542 ld a0,48(sp) + 8001103a: fc2a sd a0,56(sp) + } + 8001103c: 60ea ld ra,152(sp) + 8001103e: 610d addi sp,sp,160 + 80011040: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E: + +0000000080011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80011042: 7135 addi sp,sp,-160 + 80011044: ed06 sd ra,152(sp) + 80011046: f82a sd a0,48(sp) + push_off(); + 80011048: 00002097 auipc ra,0x2 + 8001104c: 814080e7 jalr -2028(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80011050: a009 j 80011052 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E+0x10> + if self.holding() { + 80011052: 7542 ld a0,48(sp) + 80011054: 00001097 auipc ra,0x1 + 80011058: 86c080e7 jalr -1940(ra) # 800118c0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E> + 8001105c: f42a sd a0,40(sp) + 8001105e: a009 j 80011060 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E+0x1e> + 80011060: 7522 ld a0,40(sp) + 80011062: 4581 li a1,0 + 80011064: 02b50163 beq a0,a1,80011086 <.LBB8_15+0x16> + 80011068: a009 j 8001106a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E+0x28> + panic!("spinlock {} acquire", self.name); + 8001106a: 7542 ld a0,48(sp) + 8001106c: e12a sd a0,128(sp) + 8001106e: e92a sd a0,144(sp) + +0000000080011070 <.LBB8_15>: + 80011070: 0000e597 auipc a1,0xe + 80011074: 3f058593 addi a1,a1,1008 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80011078: 0000e097 auipc ra,0xe + 8001107c: 40c080e7 jalr 1036(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80011080: ec2a sd a0,24(sp) + 80011082: f02e sd a1,32(sp) + 80011084: a011 j 80011088 <.LBB8_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80011086: a825 j 800110be <.LBB8_17+0x14> + panic!("spinlock {} acquire", self.name); + 80011088: 7502 ld a0,32(sp) + 8001108a: 65e2 ld a1,24(sp) + 8001108c: f8ae sd a1,112(sp) + 8001108e: fcaa sd a0,120(sp) + +0000000080011090 <.LBB8_16>: + 80011090: 00019597 auipc a1,0x19 + 80011094: a1858593 addi a1,a1,-1512 # 80029aa8 <.L__unnamed_1> + 80011098: 0088 addi a0,sp,64 + 8001109a: 4609 li a2,2 + 8001109c: 1894 addi a3,sp,112 + 8001109e: 4705 li a4,1 + 800110a0: ffff4097 auipc ra,0xffff4 + 800110a4: 4ea080e7 jalr 1258(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800110a8: a009 j 800110aa <.LBB8_17> + +00000000800110aa <.LBB8_17>: + 800110aa: 00019597 auipc a1,0x19 + 800110ae: a3658593 addi a1,a1,-1482 # 80029ae0 <.L__unnamed_2> + 800110b2: 0088 addi a0,sp,64 + 800110b4: 00012097 auipc ra,0x12 + 800110b8: 0fc080e7 jalr 252(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 800110bc: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 800110be: 7542 ld a0,48(sp) + 800110c0: 0561 addi a0,a0,24 + 800110c2: 4609 li a2,2 + 800110c4: 08c10723 sb a2,142(sp) + 800110c8: 4585 li a1,1 + 800110ca: ffff3097 auipc ra,0xffff3 + 800110ce: 676080e7 jalr 1654(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 800110d2: e82a sd a0,16(sp) + 800110d4: a009 j 800110d6 <.LBB8_17+0x2c> + 800110d6: 6542 ld a0,16(sp) + 800110d8: e911 bnez a0,800110ec <.LBB8_17+0x42> + 800110da: a009 j 800110dc <.LBB8_17+0x32> + 800110dc: 4511 li a0,4 + fence(Ordering::SeqCst); + 800110de: 08a107a3 sb a0,143(sp) + 800110e2: ffff3097 auipc ra,0xffff3 + 800110e6: 766080e7 jalr 1894(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 800110ea: a039 j 800110f8 <.LBB8_17+0x4e> + spin_loop(); + 800110ec: fffff097 auipc ra,0xfffff + 800110f0: eea080e7 jalr -278(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 800110f4: a009 j 800110f6 <.LBB8_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 800110f6: b7e1 j 800110be <.LBB8_17+0x14> + self.cpu_id.set(cpuid() as isize); + 800110f8: 7542 ld a0,48(sp) + 800110fa: 0541 addi a0,a0,16 + 800110fc: e02a sd a0,0(sp) + 800110fe: 00001097 auipc ra,0x1 + 80011102: 2f2080e7 jalr 754(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011106: e42a sd a0,8(sp) + 80011108: a009 j 8001110a <.LBB8_17+0x60> + 8001110a: 65a2 ld a1,8(sp) + 8001110c: 6502 ld a0,0(sp) + 8001110e: ffff4097 auipc ra,0xffff4 + 80011112: 1c6080e7 jalr 454(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80011116: a009 j 80011118 <.LBB8_17+0x6e> + SpinlockGuard{spinlock: &self} + 80011118: 7542 ld a0,48(sp) + 8001111a: fc2a sd a0,56(sp) + } + 8001111c: 60ea ld ra,152(sp) + 8001111e: 610d addi sp,sp,160 + 80011120: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17he33ed4c8b2ffa030E: + +0000000080011122 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17he33ed4c8b2ffa030E>: + pub fn acquire(&self) -> SpinlockGuard<'_, T> { + 80011122: 7135 addi sp,sp,-160 + 80011124: ed06 sd ra,152(sp) + 80011126: f82a sd a0,48(sp) + push_off(); + 80011128: 00001097 auipc ra,0x1 + 8001112c: 734080e7 jalr 1844(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80011130: a009 j 80011132 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17he33ed4c8b2ffa030E+0x10> + if self.holding() { + 80011132: 7542 ld a0,48(sp) + 80011134: 00001097 auipc ra,0x1 + 80011138: a74080e7 jalr -1420(ra) # 80011ba8 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E> + 8001113c: f42a sd a0,40(sp) + 8001113e: a009 j 80011140 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17he33ed4c8b2ffa030E+0x1e> + 80011140: 7522 ld a0,40(sp) + 80011142: 4581 li a1,0 + 80011144: 02b50163 beq a0,a1,80011166 <.LBB9_15+0x16> + 80011148: a009 j 8001114a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17he33ed4c8b2ffa030E+0x28> + panic!("spinlock {} acquire", self.name); + 8001114a: 7542 ld a0,48(sp) + 8001114c: e12a sd a0,128(sp) + 8001114e: e92a sd a0,144(sp) + +0000000080011150 <.LBB9_15>: + 80011150: 0000e597 auipc a1,0xe + 80011154: 31058593 addi a1,a1,784 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80011158: 0000e097 auipc ra,0xe + 8001115c: 32c080e7 jalr 812(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80011160: ec2a sd a0,24(sp) + 80011162: f02e sd a1,32(sp) + 80011164: a011 j 80011168 <.LBB9_15+0x18> + while self.locked.swap(true, Ordering::Acquire){ + 80011166: a825 j 8001119e <.LBB9_17+0x14> + panic!("spinlock {} acquire", self.name); + 80011168: 7502 ld a0,32(sp) + 8001116a: 65e2 ld a1,24(sp) + 8001116c: f8ae sd a1,112(sp) + 8001116e: fcaa sd a0,120(sp) + +0000000080011170 <.LBB9_16>: + 80011170: 00019597 auipc a1,0x19 + 80011174: 93858593 addi a1,a1,-1736 # 80029aa8 <.L__unnamed_1> + 80011178: 0088 addi a0,sp,64 + 8001117a: 4609 li a2,2 + 8001117c: 1894 addi a3,sp,112 + 8001117e: 4705 li a4,1 + 80011180: ffff4097 auipc ra,0xffff4 + 80011184: 40a080e7 jalr 1034(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80011188: a009 j 8001118a <.LBB9_17> + +000000008001118a <.LBB9_17>: + 8001118a: 00019597 auipc a1,0x19 + 8001118e: 95658593 addi a1,a1,-1706 # 80029ae0 <.L__unnamed_2> + 80011192: 0088 addi a0,sp,64 + 80011194: 00012097 auipc ra,0x12 + 80011198: 01c080e7 jalr 28(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 8001119c: 0000 unimp + while self.locked.swap(true, Ordering::Acquire){ + 8001119e: 7542 ld a0,48(sp) + 800111a0: 0561 addi a0,a0,24 + 800111a2: 4609 li a2,2 + 800111a4: 08c10723 sb a2,142(sp) + 800111a8: 4585 li a1,1 + 800111aa: ffff3097 auipc ra,0xffff3 + 800111ae: 596080e7 jalr 1430(ra) # 80004740 <_ZN4core4sync6atomic10AtomicBool4swap17h269e9e7e986b9c97E> + 800111b2: e82a sd a0,16(sp) + 800111b4: a009 j 800111b6 <.LBB9_17+0x2c> + 800111b6: 6542 ld a0,16(sp) + 800111b8: e911 bnez a0,800111cc <.LBB9_17+0x42> + 800111ba: a009 j 800111bc <.LBB9_17+0x32> + 800111bc: 4511 li a0,4 + fence(Ordering::SeqCst); + 800111be: 08a107a3 sb a0,143(sp) + 800111c2: ffff3097 auipc ra,0xffff3 + 800111c6: 686080e7 jalr 1670(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 800111ca: a039 j 800111d8 <.LBB9_17+0x4e> + spin_loop(); + 800111cc: fffff097 auipc ra,0xfffff + 800111d0: e0a080e7 jalr -502(ra) # 8000ffd6 <_ZN4core4hint9spin_loop17h176cebad2d7c26adE> + 800111d4: a009 j 800111d6 <.LBB9_17+0x4c> + while self.locked.swap(true, Ordering::Acquire){ + 800111d6: b7e1 j 8001119e <.LBB9_17+0x14> + self.cpu_id.set(cpuid() as isize); + 800111d8: 7542 ld a0,48(sp) + 800111da: 0541 addi a0,a0,16 + 800111dc: e02a sd a0,0(sp) + 800111de: 00001097 auipc ra,0x1 + 800111e2: 212080e7 jalr 530(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 800111e6: e42a sd a0,8(sp) + 800111e8: a009 j 800111ea <.LBB9_17+0x60> + 800111ea: 65a2 ld a1,8(sp) + 800111ec: 6502 ld a0,0(sp) + 800111ee: ffff4097 auipc ra,0xffff4 + 800111f2: 0e6080e7 jalr 230(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 800111f6: a009 j 800111f8 <.LBB9_17+0x6e> + SpinlockGuard{spinlock: &self} + 800111f8: 7542 ld a0,48(sp) + 800111fa: fc2a sd a0,56(sp) + } + 800111fc: 60ea ld ra,152(sp) + 800111fe: 610d addi sp,sp,160 + 80011200: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h4488adb03f65166cE: + +0000000080011202 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h4488adb03f65166cE>: + pub fn release(&self) { + 80011202: 7175 addi sp,sp,-144 + 80011204: e506 sd ra,136(sp) + 80011206: ec2a sd a0,24(sp) + 80011208: fcaa sd a0,120(sp) + if !self.holding() { + 8001120a: 00000097 auipc ra,0x0 + 8001120e: 732080e7 jalr 1842(ra) # 8001193c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E> + 80011212: f02a sd a0,32(sp) + 80011214: a009 j 80011216 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h4488adb03f65166cE+0x14> + 80011216: 7502 ld a0,32(sp) + 80011218: e105 bnez a0,80011238 <.LBB10_10+0x16> + 8001121a: a009 j 8001121c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h4488adb03f65166cE+0x1a> + panic!("spinlock {} release", self.name); + 8001121c: 6562 ld a0,24(sp) + 8001121e: f4aa sd a0,104(sp) + 80011220: e12a sd a0,128(sp) + +0000000080011222 <.LBB10_10>: + 80011222: 0000e597 auipc a1,0xe + 80011226: 23e58593 addi a1,a1,574 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8001122a: 0000e097 auipc ra,0xe + 8001122e: 25a080e7 jalr 602(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80011232: e42a sd a0,8(sp) + 80011234: e82e sd a1,16(sp) + 80011236: a809 j 80011248 <.LBB10_10+0x26> + self.cpu_id.set(-1); + 80011238: 6562 ld a0,24(sp) + 8001123a: 0541 addi a0,a0,16 + 8001123c: 55fd li a1,-1 + 8001123e: ffff4097 auipc ra,0xffff4 + 80011242: 096080e7 jalr 150(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80011246: a825 j 8001127e <.LBB10_12+0x14> + panic!("spinlock {} release", self.name); + 80011248: 6542 ld a0,16(sp) + 8001124a: 65a2 ld a1,8(sp) + 8001124c: ecae sd a1,88(sp) + 8001124e: f0aa sd a0,96(sp) + +0000000080011250 <.LBB10_11>: + 80011250: 00019597 auipc a1,0x19 + 80011254: 8a858593 addi a1,a1,-1880 # 80029af8 <.L__unnamed_3> + 80011258: 1028 addi a0,sp,40 + 8001125a: 4609 li a2,2 + 8001125c: 08b4 addi a3,sp,88 + 8001125e: 4705 li a4,1 + 80011260: ffff4097 auipc ra,0xffff4 + 80011264: 32a080e7 jalr 810(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80011268: a009 j 8001126a <.LBB10_12> + +000000008001126a <.LBB10_12>: + 8001126a: 00019597 auipc a1,0x19 + 8001126e: 8ae58593 addi a1,a1,-1874 # 80029b18 <.L__unnamed_4> + 80011272: 1028 addi a0,sp,40 + 80011274: 00012097 auipc ra,0x12 + 80011278: f3c080e7 jalr -196(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 8001127c: 0000 unimp + 8001127e: 4511 li a0,4 + fence(Ordering::SeqCst); + 80011280: 06a10b23 sb a0,118(sp) + 80011284: ffff3097 auipc ra,0xffff3 + 80011288: 5c4080e7 jalr 1476(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 8001128c: a009 j 8001128e <.LBB10_12+0x24> + self.locked.store(false, Ordering::Release); + 8001128e: 6562 ld a0,24(sp) + 80011290: 0561 addi a0,a0,24 + 80011292: 4605 li a2,1 + 80011294: 06c10ba3 sb a2,119(sp) + 80011298: 4581 li a1,0 + 8001129a: ffff3097 auipc ra,0xffff3 + 8001129e: 4ea080e7 jalr 1258(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 800112a2: a009 j 800112a4 <.LBB10_12+0x3a> + pop_off(); + 800112a4: 00001097 auipc ra,0x1 + 800112a8: 63c080e7 jalr 1596(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 800112ac: a009 j 800112ae <.LBB10_12+0x44> + } + 800112ae: 60aa ld ra,136(sp) + 800112b0: 6149 addi sp,sp,144 + 800112b2: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h7f531b2c66469855E: + +00000000800112b4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h7f531b2c66469855E>: + pub fn release(&self) { + 800112b4: 7175 addi sp,sp,-144 + 800112b6: e506 sd ra,136(sp) + 800112b8: ec2a sd a0,24(sp) + 800112ba: fcaa sd a0,120(sp) + if !self.holding() { + 800112bc: 00000097 auipc ra,0x0 + 800112c0: 7f4080e7 jalr 2036(ra) # 80011ab0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E> + 800112c4: f02a sd a0,32(sp) + 800112c6: a009 j 800112c8 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h7f531b2c66469855E+0x14> + 800112c8: 7502 ld a0,32(sp) + 800112ca: e105 bnez a0,800112ea <.LBB11_10+0x16> + 800112cc: a009 j 800112ce <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h7f531b2c66469855E+0x1a> + panic!("spinlock {} release", self.name); + 800112ce: 6562 ld a0,24(sp) + 800112d0: f4aa sd a0,104(sp) + 800112d2: e12a sd a0,128(sp) + +00000000800112d4 <.LBB11_10>: + 800112d4: 0000e597 auipc a1,0xe + 800112d8: 18c58593 addi a1,a1,396 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 800112dc: 0000e097 auipc ra,0xe + 800112e0: 1a8080e7 jalr 424(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 800112e4: e42a sd a0,8(sp) + 800112e6: e82e sd a1,16(sp) + 800112e8: a809 j 800112fa <.LBB11_10+0x26> + self.cpu_id.set(-1); + 800112ea: 6562 ld a0,24(sp) + 800112ec: 0541 addi a0,a0,16 + 800112ee: 55fd li a1,-1 + 800112f0: ffff4097 auipc ra,0xffff4 + 800112f4: fe4080e7 jalr -28(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 800112f8: a825 j 80011330 <.LBB11_12+0x14> + panic!("spinlock {} release", self.name); + 800112fa: 6542 ld a0,16(sp) + 800112fc: 65a2 ld a1,8(sp) + 800112fe: ecae sd a1,88(sp) + 80011300: f0aa sd a0,96(sp) + +0000000080011302 <.LBB11_11>: + 80011302: 00018597 auipc a1,0x18 + 80011306: 7f658593 addi a1,a1,2038 # 80029af8 <.L__unnamed_3> + 8001130a: 1028 addi a0,sp,40 + 8001130c: 4609 li a2,2 + 8001130e: 08b4 addi a3,sp,88 + 80011310: 4705 li a4,1 + 80011312: ffff4097 auipc ra,0xffff4 + 80011316: 278080e7 jalr 632(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001131a: a009 j 8001131c <.LBB11_12> + +000000008001131c <.LBB11_12>: + 8001131c: 00018597 auipc a1,0x18 + 80011320: 7fc58593 addi a1,a1,2044 # 80029b18 <.L__unnamed_4> + 80011324: 1028 addi a0,sp,40 + 80011326: 00012097 auipc ra,0x12 + 8001132a: e8a080e7 jalr -374(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 8001132e: 0000 unimp + 80011330: 4511 li a0,4 + fence(Ordering::SeqCst); + 80011332: 06a10b23 sb a0,118(sp) + 80011336: ffff3097 auipc ra,0xffff3 + 8001133a: 512080e7 jalr 1298(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 8001133e: a009 j 80011340 <.LBB11_12+0x24> + self.locked.store(false, Ordering::Release); + 80011340: 6562 ld a0,24(sp) + 80011342: 0561 addi a0,a0,24 + 80011344: 4605 li a2,1 + 80011346: 06c10ba3 sb a2,119(sp) + 8001134a: 4581 li a1,0 + 8001134c: ffff3097 auipc ra,0xffff3 + 80011350: 438080e7 jalr 1080(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 80011354: a009 j 80011356 <.LBB11_12+0x3a> + pop_off(); + 80011356: 00001097 auipc ra,0x1 + 8001135a: 58a080e7 jalr 1418(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 8001135e: a009 j 80011360 <.LBB11_12+0x44> + } + 80011360: 60aa ld ra,136(sp) + 80011362: 6149 addi sp,sp,144 + 80011364: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h8041517806e423d6E: + +0000000080011366 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h8041517806e423d6E>: + pub fn release(&self) { + 80011366: 7175 addi sp,sp,-144 + 80011368: e506 sd ra,136(sp) + 8001136a: ec2a sd a0,24(sp) + 8001136c: fcaa sd a0,120(sp) + if !self.holding() { + 8001136e: 00000097 auipc ra,0x0 + 80011372: 64a080e7 jalr 1610(ra) # 800119b8 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE> + 80011376: f02a sd a0,32(sp) + 80011378: a009 j 8001137a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h8041517806e423d6E+0x14> + 8001137a: 7502 ld a0,32(sp) + 8001137c: e105 bnez a0,8001139c <.LBB12_10+0x16> + 8001137e: a009 j 80011380 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h8041517806e423d6E+0x1a> + panic!("spinlock {} release", self.name); + 80011380: 6562 ld a0,24(sp) + 80011382: f4aa sd a0,104(sp) + 80011384: e12a sd a0,128(sp) + +0000000080011386 <.LBB12_10>: + 80011386: 0000e597 auipc a1,0xe + 8001138a: 0da58593 addi a1,a1,218 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8001138e: 0000e097 auipc ra,0xe + 80011392: 0f6080e7 jalr 246(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80011396: e42a sd a0,8(sp) + 80011398: e82e sd a1,16(sp) + 8001139a: a809 j 800113ac <.LBB12_10+0x26> + self.cpu_id.set(-1); + 8001139c: 6562 ld a0,24(sp) + 8001139e: 0541 addi a0,a0,16 + 800113a0: 55fd li a1,-1 + 800113a2: ffff4097 auipc ra,0xffff4 + 800113a6: f32080e7 jalr -206(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 800113aa: a825 j 800113e2 <.LBB12_12+0x14> + panic!("spinlock {} release", self.name); + 800113ac: 6542 ld a0,16(sp) + 800113ae: 65a2 ld a1,8(sp) + 800113b0: ecae sd a1,88(sp) + 800113b2: f0aa sd a0,96(sp) + +00000000800113b4 <.LBB12_11>: + 800113b4: 00018597 auipc a1,0x18 + 800113b8: 74458593 addi a1,a1,1860 # 80029af8 <.L__unnamed_3> + 800113bc: 1028 addi a0,sp,40 + 800113be: 4609 li a2,2 + 800113c0: 08b4 addi a3,sp,88 + 800113c2: 4705 li a4,1 + 800113c4: ffff4097 auipc ra,0xffff4 + 800113c8: 1c6080e7 jalr 454(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800113cc: a009 j 800113ce <.LBB12_12> + +00000000800113ce <.LBB12_12>: + 800113ce: 00018597 auipc a1,0x18 + 800113d2: 74a58593 addi a1,a1,1866 # 80029b18 <.L__unnamed_4> + 800113d6: 1028 addi a0,sp,40 + 800113d8: 00012097 auipc ra,0x12 + 800113dc: dd8080e7 jalr -552(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 800113e0: 0000 unimp + 800113e2: 4511 li a0,4 + fence(Ordering::SeqCst); + 800113e4: 06a10b23 sb a0,118(sp) + 800113e8: ffff3097 auipc ra,0xffff3 + 800113ec: 460080e7 jalr 1120(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 800113f0: a009 j 800113f2 <.LBB12_12+0x24> + self.locked.store(false, Ordering::Release); + 800113f2: 6562 ld a0,24(sp) + 800113f4: 0561 addi a0,a0,24 + 800113f6: 4605 li a2,1 + 800113f8: 06c10ba3 sb a2,119(sp) + 800113fc: 4581 li a1,0 + 800113fe: ffff3097 auipc ra,0xffff3 + 80011402: 386080e7 jalr 902(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 80011406: a009 j 80011408 <.LBB12_12+0x3a> + pop_off(); + 80011408: 00001097 auipc ra,0x1 + 8001140c: 4d8080e7 jalr 1240(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 80011410: a009 j 80011412 <.LBB12_12+0x44> + } + 80011412: 60aa ld ra,136(sp) + 80011414: 6149 addi sp,sp,144 + 80011416: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h84d22e527c35405fE: + +0000000080011418 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h84d22e527c35405fE>: + pub fn release(&self) { + 80011418: 7175 addi sp,sp,-144 + 8001141a: e506 sd ra,136(sp) + 8001141c: ec2a sd a0,24(sp) + 8001141e: fcaa sd a0,120(sp) + if !self.holding() { + 80011420: 00001097 auipc ra,0x1 + 80011424: 804080e7 jalr -2044(ra) # 80011c24 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E> + 80011428: f02a sd a0,32(sp) + 8001142a: a009 j 8001142c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h84d22e527c35405fE+0x14> + 8001142c: 7502 ld a0,32(sp) + 8001142e: e105 bnez a0,8001144e <.LBB13_10+0x16> + 80011430: a009 j 80011432 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17h84d22e527c35405fE+0x1a> + panic!("spinlock {} release", self.name); + 80011432: 6562 ld a0,24(sp) + 80011434: f4aa sd a0,104(sp) + 80011436: e12a sd a0,128(sp) + +0000000080011438 <.LBB13_10>: + 80011438: 0000e597 auipc a1,0xe + 8001143c: 02858593 addi a1,a1,40 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80011440: 0000e097 auipc ra,0xe + 80011444: 044080e7 jalr 68(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80011448: e42a sd a0,8(sp) + 8001144a: e82e sd a1,16(sp) + 8001144c: a809 j 8001145e <.LBB13_10+0x26> + self.cpu_id.set(-1); + 8001144e: 6562 ld a0,24(sp) + 80011450: 0541 addi a0,a0,16 + 80011452: 55fd li a1,-1 + 80011454: ffff4097 auipc ra,0xffff4 + 80011458: e80080e7 jalr -384(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 8001145c: a825 j 80011494 <.LBB13_12+0x14> + panic!("spinlock {} release", self.name); + 8001145e: 6542 ld a0,16(sp) + 80011460: 65a2 ld a1,8(sp) + 80011462: ecae sd a1,88(sp) + 80011464: f0aa sd a0,96(sp) + +0000000080011466 <.LBB13_11>: + 80011466: 00018597 auipc a1,0x18 + 8001146a: 69258593 addi a1,a1,1682 # 80029af8 <.L__unnamed_3> + 8001146e: 1028 addi a0,sp,40 + 80011470: 4609 li a2,2 + 80011472: 08b4 addi a3,sp,88 + 80011474: 4705 li a4,1 + 80011476: ffff4097 auipc ra,0xffff4 + 8001147a: 114080e7 jalr 276(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001147e: a009 j 80011480 <.LBB13_12> + +0000000080011480 <.LBB13_12>: + 80011480: 00018597 auipc a1,0x18 + 80011484: 69858593 addi a1,a1,1688 # 80029b18 <.L__unnamed_4> + 80011488: 1028 addi a0,sp,40 + 8001148a: 00012097 auipc ra,0x12 + 8001148e: d26080e7 jalr -730(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80011492: 0000 unimp + 80011494: 4511 li a0,4 + fence(Ordering::SeqCst); + 80011496: 06a10b23 sb a0,118(sp) + 8001149a: ffff3097 auipc ra,0xffff3 + 8001149e: 3ae080e7 jalr 942(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 800114a2: a009 j 800114a4 <.LBB13_12+0x24> + self.locked.store(false, Ordering::Release); + 800114a4: 6562 ld a0,24(sp) + 800114a6: 0561 addi a0,a0,24 + 800114a8: 4605 li a2,1 + 800114aa: 06c10ba3 sb a2,119(sp) + 800114ae: 4581 li a1,0 + 800114b0: ffff3097 auipc ra,0xffff3 + 800114b4: 2d4080e7 jalr 724(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 800114b8: a009 j 800114ba <.LBB13_12+0x3a> + pop_off(); + 800114ba: 00001097 auipc ra,0x1 + 800114be: 426080e7 jalr 1062(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 800114c2: a009 j 800114c4 <.LBB13_12+0x44> + } + 800114c4: 60aa ld ra,136(sp) + 800114c6: 6149 addi sp,sp,144 + 800114c8: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hb6d563787d966a77E: + +00000000800114ca <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hb6d563787d966a77E>: + pub fn release(&self) { + 800114ca: 7175 addi sp,sp,-144 + 800114cc: e506 sd ra,136(sp) + 800114ce: ec2a sd a0,24(sp) + 800114d0: fcaa sd a0,120(sp) + if !self.holding() { + 800114d2: 00000097 auipc ra,0x0 + 800114d6: 6d6080e7 jalr 1750(ra) # 80011ba8 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E> + 800114da: f02a sd a0,32(sp) + 800114dc: a009 j 800114de <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hb6d563787d966a77E+0x14> + 800114de: 7502 ld a0,32(sp) + 800114e0: e105 bnez a0,80011500 <.LBB14_10+0x16> + 800114e2: a009 j 800114e4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hb6d563787d966a77E+0x1a> + panic!("spinlock {} release", self.name); + 800114e4: 6562 ld a0,24(sp) + 800114e6: f4aa sd a0,104(sp) + 800114e8: e12a sd a0,128(sp) + +00000000800114ea <.LBB14_10>: + 800114ea: 0000e597 auipc a1,0xe + 800114ee: f7658593 addi a1,a1,-138 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 800114f2: 0000e097 auipc ra,0xe + 800114f6: f92080e7 jalr -110(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 800114fa: e42a sd a0,8(sp) + 800114fc: e82e sd a1,16(sp) + 800114fe: a809 j 80011510 <.LBB14_10+0x26> + self.cpu_id.set(-1); + 80011500: 6562 ld a0,24(sp) + 80011502: 0541 addi a0,a0,16 + 80011504: 55fd li a1,-1 + 80011506: ffff4097 auipc ra,0xffff4 + 8001150a: dce080e7 jalr -562(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 8001150e: a825 j 80011546 <.LBB14_12+0x14> + panic!("spinlock {} release", self.name); + 80011510: 6542 ld a0,16(sp) + 80011512: 65a2 ld a1,8(sp) + 80011514: ecae sd a1,88(sp) + 80011516: f0aa sd a0,96(sp) + +0000000080011518 <.LBB14_11>: + 80011518: 00018597 auipc a1,0x18 + 8001151c: 5e058593 addi a1,a1,1504 # 80029af8 <.L__unnamed_3> + 80011520: 1028 addi a0,sp,40 + 80011522: 4609 li a2,2 + 80011524: 08b4 addi a3,sp,88 + 80011526: 4705 li a4,1 + 80011528: ffff4097 auipc ra,0xffff4 + 8001152c: 062080e7 jalr 98(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80011530: a009 j 80011532 <.LBB14_12> + +0000000080011532 <.LBB14_12>: + 80011532: 00018597 auipc a1,0x18 + 80011536: 5e658593 addi a1,a1,1510 # 80029b18 <.L__unnamed_4> + 8001153a: 1028 addi a0,sp,40 + 8001153c: 00012097 auipc ra,0x12 + 80011540: c74080e7 jalr -908(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80011544: 0000 unimp + 80011546: 4511 li a0,4 + fence(Ordering::SeqCst); + 80011548: 06a10b23 sb a0,118(sp) + 8001154c: ffff3097 auipc ra,0xffff3 + 80011550: 2fc080e7 jalr 764(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80011554: a009 j 80011556 <.LBB14_12+0x24> + self.locked.store(false, Ordering::Release); + 80011556: 6562 ld a0,24(sp) + 80011558: 0561 addi a0,a0,24 + 8001155a: 4605 li a2,1 + 8001155c: 06c10ba3 sb a2,119(sp) + 80011560: 4581 li a1,0 + 80011562: ffff3097 auipc ra,0xffff3 + 80011566: 222080e7 jalr 546(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 8001156a: a009 j 8001156c <.LBB14_12+0x3a> + pop_off(); + 8001156c: 00001097 auipc ra,0x1 + 80011570: 374080e7 jalr 884(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 80011574: a009 j 80011576 <.LBB14_12+0x44> + } + 80011576: 60aa ld ra,136(sp) + 80011578: 6149 addi sp,sp,144 + 8001157a: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hd5c81d47b1881bbfE: + +000000008001157c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hd5c81d47b1881bbfE>: + pub fn release(&self) { + 8001157c: 7175 addi sp,sp,-144 + 8001157e: e506 sd ra,136(sp) + 80011580: ec2a sd a0,24(sp) + 80011582: fcaa sd a0,120(sp) + if !self.holding() { + 80011584: 00000097 auipc ra,0x0 + 80011588: 4b0080e7 jalr 1200(ra) # 80011a34 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E> + 8001158c: f02a sd a0,32(sp) + 8001158e: a009 j 80011590 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hd5c81d47b1881bbfE+0x14> + 80011590: 7502 ld a0,32(sp) + 80011592: e105 bnez a0,800115b2 <.LBB15_10+0x16> + 80011594: a009 j 80011596 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hd5c81d47b1881bbfE+0x1a> + panic!("spinlock {} release", self.name); + 80011596: 6562 ld a0,24(sp) + 80011598: f4aa sd a0,104(sp) + 8001159a: e12a sd a0,128(sp) + +000000008001159c <.LBB15_10>: + 8001159c: 0000e597 auipc a1,0xe + 800115a0: ec458593 addi a1,a1,-316 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 800115a4: 0000e097 auipc ra,0xe + 800115a8: ee0080e7 jalr -288(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 800115ac: e42a sd a0,8(sp) + 800115ae: e82e sd a1,16(sp) + 800115b0: a809 j 800115c2 <.LBB15_10+0x26> + self.cpu_id.set(-1); + 800115b2: 6562 ld a0,24(sp) + 800115b4: 0541 addi a0,a0,16 + 800115b6: 55fd li a1,-1 + 800115b8: ffff4097 auipc ra,0xffff4 + 800115bc: d1c080e7 jalr -740(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 800115c0: a825 j 800115f8 <.LBB15_12+0x14> + panic!("spinlock {} release", self.name); + 800115c2: 6542 ld a0,16(sp) + 800115c4: 65a2 ld a1,8(sp) + 800115c6: ecae sd a1,88(sp) + 800115c8: f0aa sd a0,96(sp) + +00000000800115ca <.LBB15_11>: + 800115ca: 00018597 auipc a1,0x18 + 800115ce: 52e58593 addi a1,a1,1326 # 80029af8 <.L__unnamed_3> + 800115d2: 1028 addi a0,sp,40 + 800115d4: 4609 li a2,2 + 800115d6: 08b4 addi a3,sp,88 + 800115d8: 4705 li a4,1 + 800115da: ffff4097 auipc ra,0xffff4 + 800115de: fb0080e7 jalr -80(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800115e2: a009 j 800115e4 <.LBB15_12> + +00000000800115e4 <.LBB15_12>: + 800115e4: 00018597 auipc a1,0x18 + 800115e8: 53458593 addi a1,a1,1332 # 80029b18 <.L__unnamed_4> + 800115ec: 1028 addi a0,sp,40 + 800115ee: 00012097 auipc ra,0x12 + 800115f2: bc2080e7 jalr -1086(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 800115f6: 0000 unimp + 800115f8: 4511 li a0,4 + fence(Ordering::SeqCst); + 800115fa: 06a10b23 sb a0,118(sp) + 800115fe: ffff3097 auipc ra,0xffff3 + 80011602: 24a080e7 jalr 586(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80011606: a009 j 80011608 <.LBB15_12+0x24> + self.locked.store(false, Ordering::Release); + 80011608: 6562 ld a0,24(sp) + 8001160a: 0561 addi a0,a0,24 + 8001160c: 4605 li a2,1 + 8001160e: 06c10ba3 sb a2,119(sp) + 80011612: 4581 li a1,0 + 80011614: ffff3097 auipc ra,0xffff3 + 80011618: 170080e7 jalr 368(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 8001161c: a009 j 8001161e <.LBB15_12+0x3a> + pop_off(); + 8001161e: 00001097 auipc ra,0x1 + 80011622: 2c2080e7 jalr 706(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 80011626: a009 j 80011628 <.LBB15_12+0x44> + } + 80011628: 60aa ld ra,136(sp) + 8001162a: 6149 addi sp,sp,144 + 8001162c: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hdd8465c64dcbee95E: + +000000008001162e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hdd8465c64dcbee95E>: + pub fn release(&self) { + 8001162e: 7175 addi sp,sp,-144 + 80011630: e506 sd ra,136(sp) + 80011632: ec2a sd a0,24(sp) + 80011634: fcaa sd a0,120(sp) + if !self.holding() { + 80011636: 00000097 auipc ra,0x0 + 8001163a: 4f6080e7 jalr 1270(ra) # 80011b2c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E> + 8001163e: f02a sd a0,32(sp) + 80011640: a009 j 80011642 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hdd8465c64dcbee95E+0x14> + 80011642: 7502 ld a0,32(sp) + 80011644: e105 bnez a0,80011664 <.LBB16_10+0x16> + 80011646: a009 j 80011648 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hdd8465c64dcbee95E+0x1a> + panic!("spinlock {} release", self.name); + 80011648: 6562 ld a0,24(sp) + 8001164a: f4aa sd a0,104(sp) + 8001164c: e12a sd a0,128(sp) + +000000008001164e <.LBB16_10>: + 8001164e: 0000e597 auipc a1,0xe + 80011652: e1258593 addi a1,a1,-494 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80011656: 0000e097 auipc ra,0xe + 8001165a: e2e080e7 jalr -466(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 8001165e: e42a sd a0,8(sp) + 80011660: e82e sd a1,16(sp) + 80011662: a809 j 80011674 <.LBB16_10+0x26> + self.cpu_id.set(-1); + 80011664: 6562 ld a0,24(sp) + 80011666: 0541 addi a0,a0,16 + 80011668: 55fd li a1,-1 + 8001166a: ffff4097 auipc ra,0xffff4 + 8001166e: c6a080e7 jalr -918(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80011672: a825 j 800116aa <.LBB16_12+0x14> + panic!("spinlock {} release", self.name); + 80011674: 6542 ld a0,16(sp) + 80011676: 65a2 ld a1,8(sp) + 80011678: ecae sd a1,88(sp) + 8001167a: f0aa sd a0,96(sp) + +000000008001167c <.LBB16_11>: + 8001167c: 00018597 auipc a1,0x18 + 80011680: 47c58593 addi a1,a1,1148 # 80029af8 <.L__unnamed_3> + 80011684: 1028 addi a0,sp,40 + 80011686: 4609 li a2,2 + 80011688: 08b4 addi a3,sp,88 + 8001168a: 4705 li a4,1 + 8001168c: ffff4097 auipc ra,0xffff4 + 80011690: efe080e7 jalr -258(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80011694: a009 j 80011696 <.LBB16_12> + +0000000080011696 <.LBB16_12>: + 80011696: 00018597 auipc a1,0x18 + 8001169a: 48258593 addi a1,a1,1154 # 80029b18 <.L__unnamed_4> + 8001169e: 1028 addi a0,sp,40 + 800116a0: 00012097 auipc ra,0x12 + 800116a4: b10080e7 jalr -1264(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 800116a8: 0000 unimp + 800116aa: 4511 li a0,4 + fence(Ordering::SeqCst); + 800116ac: 06a10b23 sb a0,118(sp) + 800116b0: ffff3097 auipc ra,0xffff3 + 800116b4: 198080e7 jalr 408(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 800116b8: a009 j 800116ba <.LBB16_12+0x24> + self.locked.store(false, Ordering::Release); + 800116ba: 6562 ld a0,24(sp) + 800116bc: 0561 addi a0,a0,24 + 800116be: 4605 li a2,1 + 800116c0: 06c10ba3 sb a2,119(sp) + 800116c4: 4581 li a1,0 + 800116c6: ffff3097 auipc ra,0xffff3 + 800116ca: 0be080e7 jalr 190(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 800116ce: a009 j 800116d0 <.LBB16_12+0x3a> + pop_off(); + 800116d0: 00001097 auipc ra,0x1 + 800116d4: 210080e7 jalr 528(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 800116d8: a009 j 800116da <.LBB16_12+0x44> + } + 800116da: 60aa ld ra,136(sp) + 800116dc: 6149 addi sp,sp,144 + 800116de: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfda5e7f2f4cdedb7E: + +00000000800116e0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfda5e7f2f4cdedb7E>: + pub fn release(&self) { + 800116e0: 7175 addi sp,sp,-144 + 800116e2: e506 sd ra,136(sp) + 800116e4: ec2a sd a0,24(sp) + 800116e6: fcaa sd a0,120(sp) + if !self.holding() { + 800116e8: 00000097 auipc ra,0x0 + 800116ec: 1d8080e7 jalr 472(ra) # 800118c0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E> + 800116f0: f02a sd a0,32(sp) + 800116f2: a009 j 800116f4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfda5e7f2f4cdedb7E+0x14> + 800116f4: 7502 ld a0,32(sp) + 800116f6: e105 bnez a0,80011716 <.LBB17_10+0x16> + 800116f8: a009 j 800116fa <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfda5e7f2f4cdedb7E+0x1a> + panic!("spinlock {} release", self.name); + 800116fa: 6562 ld a0,24(sp) + 800116fc: f4aa sd a0,104(sp) + 800116fe: e12a sd a0,128(sp) + +0000000080011700 <.LBB17_10>: + 80011700: 0000e597 auipc a1,0xe + 80011704: d6058593 addi a1,a1,-672 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80011708: 0000e097 auipc ra,0xe + 8001170c: d7c080e7 jalr -644(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80011710: e42a sd a0,8(sp) + 80011712: e82e sd a1,16(sp) + 80011714: a809 j 80011726 <.LBB17_10+0x26> + self.cpu_id.set(-1); + 80011716: 6562 ld a0,24(sp) + 80011718: 0541 addi a0,a0,16 + 8001171a: 55fd li a1,-1 + 8001171c: ffff4097 auipc ra,0xffff4 + 80011720: bb8080e7 jalr -1096(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 80011724: a825 j 8001175c <.LBB17_12+0x14> + panic!("spinlock {} release", self.name); + 80011726: 6542 ld a0,16(sp) + 80011728: 65a2 ld a1,8(sp) + 8001172a: ecae sd a1,88(sp) + 8001172c: f0aa sd a0,96(sp) + +000000008001172e <.LBB17_11>: + 8001172e: 00018597 auipc a1,0x18 + 80011732: 3ca58593 addi a1,a1,970 # 80029af8 <.L__unnamed_3> + 80011736: 1028 addi a0,sp,40 + 80011738: 4609 li a2,2 + 8001173a: 08b4 addi a3,sp,88 + 8001173c: 4705 li a4,1 + 8001173e: ffff4097 auipc ra,0xffff4 + 80011742: e4c080e7 jalr -436(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80011746: a009 j 80011748 <.LBB17_12> + +0000000080011748 <.LBB17_12>: + 80011748: 00018597 auipc a1,0x18 + 8001174c: 3d058593 addi a1,a1,976 # 80029b18 <.L__unnamed_4> + 80011750: 1028 addi a0,sp,40 + 80011752: 00012097 auipc ra,0x12 + 80011756: a5e080e7 jalr -1442(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 8001175a: 0000 unimp + 8001175c: 4511 li a0,4 + fence(Ordering::SeqCst); + 8001175e: 06a10b23 sb a0,118(sp) + 80011762: ffff3097 auipc ra,0xffff3 + 80011766: 0e6080e7 jalr 230(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 8001176a: a009 j 8001176c <.LBB17_12+0x24> + self.locked.store(false, Ordering::Release); + 8001176c: 6562 ld a0,24(sp) + 8001176e: 0561 addi a0,a0,24 + 80011770: 4605 li a2,1 + 80011772: 06c10ba3 sb a2,119(sp) + 80011776: 4581 li a1,0 + 80011778: ffff3097 auipc ra,0xffff3 + 8001177c: 00c080e7 jalr 12(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 80011780: a009 j 80011782 <.LBB17_12+0x3a> + pop_off(); + 80011782: 00001097 auipc ra,0x1 + 80011786: 15e080e7 jalr 350(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 8001178a: a009 j 8001178c <.LBB17_12+0x44> + } + 8001178c: 60aa ld ra,136(sp) + 8001178e: 6149 addi sp,sp,144 + 80011790: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfedbfd7a024c8acfE: + +0000000080011792 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfedbfd7a024c8acfE>: + pub fn release(&self) { + 80011792: 7175 addi sp,sp,-144 + 80011794: e506 sd ra,136(sp) + 80011796: ec2a sd a0,24(sp) + 80011798: fcaa sd a0,120(sp) + if !self.holding() { + 8001179a: 00000097 auipc ra,0x0 + 8001179e: 0aa080e7 jalr 170(ra) # 80011844 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E> + 800117a2: f02a sd a0,32(sp) + 800117a4: a009 j 800117a6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfedbfd7a024c8acfE+0x14> + 800117a6: 7502 ld a0,32(sp) + 800117a8: e105 bnez a0,800117c8 <.LBB18_10+0x16> + 800117aa: a009 j 800117ac <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfedbfd7a024c8acfE+0x1a> + panic!("spinlock {} release", self.name); + 800117ac: 6562 ld a0,24(sp) + 800117ae: f4aa sd a0,104(sp) + 800117b0: e12a sd a0,128(sp) + +00000000800117b2 <.LBB18_10>: + 800117b2: 0000e597 auipc a1,0xe + 800117b6: cae58593 addi a1,a1,-850 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 800117ba: 0000e097 auipc ra,0xe + 800117be: cca080e7 jalr -822(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 800117c2: e42a sd a0,8(sp) + 800117c4: e82e sd a1,16(sp) + 800117c6: a809 j 800117d8 <.LBB18_10+0x26> + self.cpu_id.set(-1); + 800117c8: 6562 ld a0,24(sp) + 800117ca: 0541 addi a0,a0,16 + 800117cc: 55fd li a1,-1 + 800117ce: ffff4097 auipc ra,0xffff4 + 800117d2: b06080e7 jalr -1274(ra) # 800052d4 <_ZN4core4cell13Cell$LT$T$GT$3set17hb9927bf4fdcefc87E> + 800117d6: a825 j 8001180e <.LBB18_12+0x14> + panic!("spinlock {} release", self.name); + 800117d8: 6542 ld a0,16(sp) + 800117da: 65a2 ld a1,8(sp) + 800117dc: ecae sd a1,88(sp) + 800117de: f0aa sd a0,96(sp) + +00000000800117e0 <.LBB18_11>: + 800117e0: 00018597 auipc a1,0x18 + 800117e4: 31858593 addi a1,a1,792 # 80029af8 <.L__unnamed_3> + 800117e8: 1028 addi a0,sp,40 + 800117ea: 4609 li a2,2 + 800117ec: 08b4 addi a3,sp,88 + 800117ee: 4705 li a4,1 + 800117f0: ffff4097 auipc ra,0xffff4 + 800117f4: d9a080e7 jalr -614(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800117f8: a009 j 800117fa <.LBB18_12> + +00000000800117fa <.LBB18_12>: + 800117fa: 00018597 auipc a1,0x18 + 800117fe: 31e58593 addi a1,a1,798 # 80029b18 <.L__unnamed_4> + 80011802: 1028 addi a0,sp,40 + 80011804: 00012097 auipc ra,0x12 + 80011808: 9ac080e7 jalr -1620(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 8001180c: 0000 unimp + 8001180e: 4511 li a0,4 + fence(Ordering::SeqCst); + 80011810: 06a10b23 sb a0,118(sp) + 80011814: ffff3097 auipc ra,0xffff3 + 80011818: 034080e7 jalr 52(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 8001181c: a009 j 8001181e <.LBB18_12+0x24> + self.locked.store(false, Ordering::Release); + 8001181e: 6562 ld a0,24(sp) + 80011820: 0561 addi a0,a0,24 + 80011822: 4605 li a2,1 + 80011824: 06c10ba3 sb a2,119(sp) + 80011828: 4581 li a1,0 + 8001182a: ffff3097 auipc ra,0xffff3 + 8001182e: f5a080e7 jalr -166(ra) # 80004784 <_ZN4core4sync6atomic10AtomicBool5store17h325e21ca90edd7e7E> + 80011832: a009 j 80011834 <.LBB18_12+0x3a> + pop_off(); + 80011834: 00001097 auipc ra,0x1 + 80011838: 0ac080e7 jalr 172(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 8001183c: a009 j 8001183e <.LBB18_12+0x44> + } + 8001183e: 60aa ld ra,136(sp) + 80011840: 6149 addi sp,sp,144 + 80011842: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E: + +0000000080011844 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E>: + pub fn holding(&self) -> bool{ + 80011844: 7139 addi sp,sp,-64 + 80011846: fc06 sd ra,56(sp) + 80011848: ec2a sd a0,24(sp) + 8001184a: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 8001184c: 0561 addi a0,a0,24 + 8001184e: 4581 li a1,0 + 80011850: 02b107a3 sb a1,47(sp) + 80011854: ffff3097 auipc ra,0xffff3 + 80011858: eb2080e7 jalr -334(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 8001185c: f02a sd a0,32(sp) + 8001185e: a035 j 8001188a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x46> + 80011860: 4505 li a0,1 + 80011862: 02a10723 sb a0,46(sp) + 80011866: a829 j 80011880 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x3c> + 80011868: 4501 li a0,0 + 8001186a: 02a10723 sb a0,46(sp) + 8001186e: a809 j 80011880 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x3c> + 80011870: 6562 ld a0,24(sp) + 80011872: 0541 addi a0,a0,16 + 80011874: ffff4097 auipc ra,0xffff4 + 80011878: 9fa080e7 jalr -1542(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 8001187c: e82a sd a0,16(sp) + 8001187e: a809 j 80011890 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x4c> + 80011880: 02e14503 lbu a0,46(sp) + 80011884: 8905 andi a0,a0,1 + 80011886: e105 bnez a0,800118a6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x62> + 80011888: a01d j 800118ae <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x6a> + 8001188a: 7502 ld a0,32(sp) + 8001188c: f175 bnez a0,80011870 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x2c> + 8001188e: bfe9 j 80011868 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x24> + 80011890: 00001097 auipc ra,0x1 + 80011894: b60080e7 jalr -1184(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011898: e42a sd a0,8(sp) + 8001189a: a009 j 8001189c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x58> + 8001189c: 6542 ld a0,16(sp) + 8001189e: 65a2 ld a1,8(sp) + 800118a0: fcb500e3 beq a0,a1,80011860 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x1c> + 800118a4: b7d1 j 80011868 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x24> + 800118a6: 4505 li a0,1 + return true + 800118a8: 02a106a3 sb a0,45(sp) + } + 800118ac: a029 j 800118b6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x72> + 800118ae: 4501 li a0,0 + false + 800118b0: 02a106a3 sb a0,45(sp) + } + 800118b4: a009 j 800118b6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h04bb873c43629d68E+0x72> + 800118b6: 02d14503 lbu a0,45(sp) + 800118ba: 70e2 ld ra,56(sp) + 800118bc: 6121 addi sp,sp,64 + 800118be: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E: + +00000000800118c0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E>: + pub fn holding(&self) -> bool{ + 800118c0: 7139 addi sp,sp,-64 + 800118c2: fc06 sd ra,56(sp) + 800118c4: ec2a sd a0,24(sp) + 800118c6: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 800118c8: 0561 addi a0,a0,24 + 800118ca: 4581 li a1,0 + 800118cc: 02b107a3 sb a1,47(sp) + 800118d0: ffff3097 auipc ra,0xffff3 + 800118d4: e36080e7 jalr -458(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 800118d8: f02a sd a0,32(sp) + 800118da: a035 j 80011906 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x46> + 800118dc: 4505 li a0,1 + 800118de: 02a10723 sb a0,46(sp) + 800118e2: a829 j 800118fc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x3c> + 800118e4: 4501 li a0,0 + 800118e6: 02a10723 sb a0,46(sp) + 800118ea: a809 j 800118fc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x3c> + 800118ec: 6562 ld a0,24(sp) + 800118ee: 0541 addi a0,a0,16 + 800118f0: ffff4097 auipc ra,0xffff4 + 800118f4: 97e080e7 jalr -1666(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 800118f8: e82a sd a0,16(sp) + 800118fa: a809 j 8001190c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x4c> + 800118fc: 02e14503 lbu a0,46(sp) + 80011900: 8905 andi a0,a0,1 + 80011902: e105 bnez a0,80011922 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x62> + 80011904: a01d j 8001192a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x6a> + 80011906: 7502 ld a0,32(sp) + 80011908: f175 bnez a0,800118ec <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x2c> + 8001190a: bfe9 j 800118e4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x24> + 8001190c: 00001097 auipc ra,0x1 + 80011910: ae4080e7 jalr -1308(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011914: e42a sd a0,8(sp) + 80011916: a009 j 80011918 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x58> + 80011918: 6542 ld a0,16(sp) + 8001191a: 65a2 ld a1,8(sp) + 8001191c: fcb500e3 beq a0,a1,800118dc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x1c> + 80011920: b7d1 j 800118e4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x24> + 80011922: 4505 li a0,1 + return true + 80011924: 02a106a3 sb a0,45(sp) + } + 80011928: a029 j 80011932 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x72> + 8001192a: 4501 li a0,0 + false + 8001192c: 02a106a3 sb a0,45(sp) + } + 80011930: a009 j 80011932 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E+0x72> + 80011932: 02d14503 lbu a0,45(sp) + 80011936: 70e2 ld ra,56(sp) + 80011938: 6121 addi sp,sp,64 + 8001193a: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E: + +000000008001193c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E>: + pub fn holding(&self) -> bool{ + 8001193c: 7139 addi sp,sp,-64 + 8001193e: fc06 sd ra,56(sp) + 80011940: ec2a sd a0,24(sp) + 80011942: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 80011944: 0561 addi a0,a0,24 + 80011946: 4581 li a1,0 + 80011948: 02b107a3 sb a1,47(sp) + 8001194c: ffff3097 auipc ra,0xffff3 + 80011950: dba080e7 jalr -582(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 80011954: f02a sd a0,32(sp) + 80011956: a035 j 80011982 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x46> + 80011958: 4505 li a0,1 + 8001195a: 02a10723 sb a0,46(sp) + 8001195e: a829 j 80011978 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x3c> + 80011960: 4501 li a0,0 + 80011962: 02a10723 sb a0,46(sp) + 80011966: a809 j 80011978 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x3c> + 80011968: 6562 ld a0,24(sp) + 8001196a: 0541 addi a0,a0,16 + 8001196c: ffff4097 auipc ra,0xffff4 + 80011970: 902080e7 jalr -1790(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 80011974: e82a sd a0,16(sp) + 80011976: a809 j 80011988 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x4c> + 80011978: 02e14503 lbu a0,46(sp) + 8001197c: 8905 andi a0,a0,1 + 8001197e: e105 bnez a0,8001199e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x62> + 80011980: a01d j 800119a6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x6a> + 80011982: 7502 ld a0,32(sp) + 80011984: f175 bnez a0,80011968 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x2c> + 80011986: bfe9 j 80011960 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x24> + 80011988: 00001097 auipc ra,0x1 + 8001198c: a68080e7 jalr -1432(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011990: e42a sd a0,8(sp) + 80011992: a009 j 80011994 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x58> + 80011994: 6542 ld a0,16(sp) + 80011996: 65a2 ld a1,8(sp) + 80011998: fcb500e3 beq a0,a1,80011958 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x1c> + 8001199c: b7d1 j 80011960 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x24> + 8001199e: 4505 li a0,1 + return true + 800119a0: 02a106a3 sb a0,45(sp) + } + 800119a4: a029 j 800119ae <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x72> + 800119a6: 4501 li a0,0 + false + 800119a8: 02a106a3 sb a0,45(sp) + } + 800119ac: a009 j 800119ae <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h56772fc96a718090E+0x72> + 800119ae: 02d14503 lbu a0,45(sp) + 800119b2: 70e2 ld ra,56(sp) + 800119b4: 6121 addi sp,sp,64 + 800119b6: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE: + +00000000800119b8 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE>: + pub fn holding(&self) -> bool{ + 800119b8: 7139 addi sp,sp,-64 + 800119ba: fc06 sd ra,56(sp) + 800119bc: ec2a sd a0,24(sp) + 800119be: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 800119c0: 0561 addi a0,a0,24 + 800119c2: 4581 li a1,0 + 800119c4: 02b107a3 sb a1,47(sp) + 800119c8: ffff3097 auipc ra,0xffff3 + 800119cc: d3e080e7 jalr -706(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 800119d0: f02a sd a0,32(sp) + 800119d2: a035 j 800119fe <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x46> + 800119d4: 4505 li a0,1 + 800119d6: 02a10723 sb a0,46(sp) + 800119da: a829 j 800119f4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x3c> + 800119dc: 4501 li a0,0 + 800119de: 02a10723 sb a0,46(sp) + 800119e2: a809 j 800119f4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x3c> + 800119e4: 6562 ld a0,24(sp) + 800119e6: 0541 addi a0,a0,16 + 800119e8: ffff4097 auipc ra,0xffff4 + 800119ec: 886080e7 jalr -1914(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 800119f0: e82a sd a0,16(sp) + 800119f2: a809 j 80011a04 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x4c> + 800119f4: 02e14503 lbu a0,46(sp) + 800119f8: 8905 andi a0,a0,1 + 800119fa: e105 bnez a0,80011a1a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x62> + 800119fc: a01d j 80011a22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x6a> + 800119fe: 7502 ld a0,32(sp) + 80011a00: f175 bnez a0,800119e4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x2c> + 80011a02: bfe9 j 800119dc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x24> + 80011a04: 00001097 auipc ra,0x1 + 80011a08: 9ec080e7 jalr -1556(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011a0c: e42a sd a0,8(sp) + 80011a0e: a009 j 80011a10 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x58> + 80011a10: 6542 ld a0,16(sp) + 80011a12: 65a2 ld a1,8(sp) + 80011a14: fcb500e3 beq a0,a1,800119d4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x1c> + 80011a18: b7d1 j 800119dc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x24> + 80011a1a: 4505 li a0,1 + return true + 80011a1c: 02a106a3 sb a0,45(sp) + } + 80011a20: a029 j 80011a2a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x72> + 80011a22: 4501 li a0,0 + false + 80011a24: 02a106a3 sb a0,45(sp) + } + 80011a28: a009 j 80011a2a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h685eaac29cc8096eE+0x72> + 80011a2a: 02d14503 lbu a0,45(sp) + 80011a2e: 70e2 ld ra,56(sp) + 80011a30: 6121 addi sp,sp,64 + 80011a32: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E: + +0000000080011a34 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E>: + pub fn holding(&self) -> bool{ + 80011a34: 7139 addi sp,sp,-64 + 80011a36: fc06 sd ra,56(sp) + 80011a38: ec2a sd a0,24(sp) + 80011a3a: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 80011a3c: 0561 addi a0,a0,24 + 80011a3e: 4581 li a1,0 + 80011a40: 02b107a3 sb a1,47(sp) + 80011a44: ffff3097 auipc ra,0xffff3 + 80011a48: cc2080e7 jalr -830(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 80011a4c: f02a sd a0,32(sp) + 80011a4e: a035 j 80011a7a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x46> + 80011a50: 4505 li a0,1 + 80011a52: 02a10723 sb a0,46(sp) + 80011a56: a829 j 80011a70 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x3c> + 80011a58: 4501 li a0,0 + 80011a5a: 02a10723 sb a0,46(sp) + 80011a5e: a809 j 80011a70 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x3c> + 80011a60: 6562 ld a0,24(sp) + 80011a62: 0541 addi a0,a0,16 + 80011a64: ffff4097 auipc ra,0xffff4 + 80011a68: 80a080e7 jalr -2038(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 80011a6c: e82a sd a0,16(sp) + 80011a6e: a809 j 80011a80 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x4c> + 80011a70: 02e14503 lbu a0,46(sp) + 80011a74: 8905 andi a0,a0,1 + 80011a76: e105 bnez a0,80011a96 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x62> + 80011a78: a01d j 80011a9e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x6a> + 80011a7a: 7502 ld a0,32(sp) + 80011a7c: f175 bnez a0,80011a60 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x2c> + 80011a7e: bfe9 j 80011a58 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x24> + 80011a80: 00001097 auipc ra,0x1 + 80011a84: 970080e7 jalr -1680(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011a88: e42a sd a0,8(sp) + 80011a8a: a009 j 80011a8c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x58> + 80011a8c: 6542 ld a0,16(sp) + 80011a8e: 65a2 ld a1,8(sp) + 80011a90: fcb500e3 beq a0,a1,80011a50 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x1c> + 80011a94: b7d1 j 80011a58 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x24> + 80011a96: 4505 li a0,1 + return true + 80011a98: 02a106a3 sb a0,45(sp) + } + 80011a9c: a029 j 80011aa6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x72> + 80011a9e: 4501 li a0,0 + false + 80011aa0: 02a106a3 sb a0,45(sp) + } + 80011aa4: a009 j 80011aa6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h92b63d3de4da3516E+0x72> + 80011aa6: 02d14503 lbu a0,45(sp) + 80011aaa: 70e2 ld ra,56(sp) + 80011aac: 6121 addi sp,sp,64 + 80011aae: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E: + +0000000080011ab0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E>: + pub fn holding(&self) -> bool{ + 80011ab0: 7139 addi sp,sp,-64 + 80011ab2: fc06 sd ra,56(sp) + 80011ab4: ec2a sd a0,24(sp) + 80011ab6: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 80011ab8: 0561 addi a0,a0,24 + 80011aba: 4581 li a1,0 + 80011abc: 02b107a3 sb a1,47(sp) + 80011ac0: ffff3097 auipc ra,0xffff3 + 80011ac4: c46080e7 jalr -954(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 80011ac8: f02a sd a0,32(sp) + 80011aca: a035 j 80011af6 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x46> + 80011acc: 4505 li a0,1 + 80011ace: 02a10723 sb a0,46(sp) + 80011ad2: a829 j 80011aec <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x3c> + 80011ad4: 4501 li a0,0 + 80011ad6: 02a10723 sb a0,46(sp) + 80011ada: a809 j 80011aec <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x3c> + 80011adc: 6562 ld a0,24(sp) + 80011ade: 0541 addi a0,a0,16 + 80011ae0: ffff3097 auipc ra,0xffff3 + 80011ae4: 78e080e7 jalr 1934(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 80011ae8: e82a sd a0,16(sp) + 80011aea: a809 j 80011afc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x4c> + 80011aec: 02e14503 lbu a0,46(sp) + 80011af0: 8905 andi a0,a0,1 + 80011af2: e105 bnez a0,80011b12 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x62> + 80011af4: a01d j 80011b1a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x6a> + 80011af6: 7502 ld a0,32(sp) + 80011af8: f175 bnez a0,80011adc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x2c> + 80011afa: bfe9 j 80011ad4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x24> + 80011afc: 00001097 auipc ra,0x1 + 80011b00: 8f4080e7 jalr -1804(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011b04: e42a sd a0,8(sp) + 80011b06: a009 j 80011b08 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x58> + 80011b08: 6542 ld a0,16(sp) + 80011b0a: 65a2 ld a1,8(sp) + 80011b0c: fcb500e3 beq a0,a1,80011acc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x1c> + 80011b10: b7d1 j 80011ad4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x24> + 80011b12: 4505 li a0,1 + return true + 80011b14: 02a106a3 sb a0,45(sp) + } + 80011b18: a029 j 80011b22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x72> + 80011b1a: 4501 li a0,0 + false + 80011b1c: 02a106a3 sb a0,45(sp) + } + 80011b20: a009 j 80011b22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17haa146bec45c9d0c2E+0x72> + 80011b22: 02d14503 lbu a0,45(sp) + 80011b26: 70e2 ld ra,56(sp) + 80011b28: 6121 addi sp,sp,64 + 80011b2a: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E: + +0000000080011b2c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E>: + pub fn holding(&self) -> bool{ + 80011b2c: 7139 addi sp,sp,-64 + 80011b2e: fc06 sd ra,56(sp) + 80011b30: ec2a sd a0,24(sp) + 80011b32: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 80011b34: 0561 addi a0,a0,24 + 80011b36: 4581 li a1,0 + 80011b38: 02b107a3 sb a1,47(sp) + 80011b3c: ffff3097 auipc ra,0xffff3 + 80011b40: bca080e7 jalr -1078(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 80011b44: f02a sd a0,32(sp) + 80011b46: a035 j 80011b72 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x46> + 80011b48: 4505 li a0,1 + 80011b4a: 02a10723 sb a0,46(sp) + 80011b4e: a829 j 80011b68 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x3c> + 80011b50: 4501 li a0,0 + 80011b52: 02a10723 sb a0,46(sp) + 80011b56: a809 j 80011b68 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x3c> + 80011b58: 6562 ld a0,24(sp) + 80011b5a: 0541 addi a0,a0,16 + 80011b5c: ffff3097 auipc ra,0xffff3 + 80011b60: 712080e7 jalr 1810(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 80011b64: e82a sd a0,16(sp) + 80011b66: a809 j 80011b78 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x4c> + 80011b68: 02e14503 lbu a0,46(sp) + 80011b6c: 8905 andi a0,a0,1 + 80011b6e: e105 bnez a0,80011b8e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x62> + 80011b70: a01d j 80011b96 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x6a> + 80011b72: 7502 ld a0,32(sp) + 80011b74: f175 bnez a0,80011b58 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x2c> + 80011b76: bfe9 j 80011b50 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x24> + 80011b78: 00001097 auipc ra,0x1 + 80011b7c: 878080e7 jalr -1928(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011b80: e42a sd a0,8(sp) + 80011b82: a009 j 80011b84 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x58> + 80011b84: 6542 ld a0,16(sp) + 80011b86: 65a2 ld a1,8(sp) + 80011b88: fcb500e3 beq a0,a1,80011b48 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x1c> + 80011b8c: b7d1 j 80011b50 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x24> + 80011b8e: 4505 li a0,1 + return true + 80011b90: 02a106a3 sb a0,45(sp) + } + 80011b94: a029 j 80011b9e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x72> + 80011b96: 4501 li a0,0 + false + 80011b98: 02a106a3 sb a0,45(sp) + } + 80011b9c: a009 j 80011b9e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hca575eb433d6c072E+0x72> + 80011b9e: 02d14503 lbu a0,45(sp) + 80011ba2: 70e2 ld ra,56(sp) + 80011ba4: 6121 addi sp,sp,64 + 80011ba6: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E: + +0000000080011ba8 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E>: + pub fn holding(&self) -> bool{ + 80011ba8: 7139 addi sp,sp,-64 + 80011baa: fc06 sd ra,56(sp) + 80011bac: ec2a sd a0,24(sp) + 80011bae: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 80011bb0: 0561 addi a0,a0,24 + 80011bb2: 4581 li a1,0 + 80011bb4: 02b107a3 sb a1,47(sp) + 80011bb8: ffff3097 auipc ra,0xffff3 + 80011bbc: b4e080e7 jalr -1202(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 80011bc0: f02a sd a0,32(sp) + 80011bc2: a035 j 80011bee <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x46> + 80011bc4: 4505 li a0,1 + 80011bc6: 02a10723 sb a0,46(sp) + 80011bca: a829 j 80011be4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x3c> + 80011bcc: 4501 li a0,0 + 80011bce: 02a10723 sb a0,46(sp) + 80011bd2: a809 j 80011be4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x3c> + 80011bd4: 6562 ld a0,24(sp) + 80011bd6: 0541 addi a0,a0,16 + 80011bd8: ffff3097 auipc ra,0xffff3 + 80011bdc: 696080e7 jalr 1686(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 80011be0: e82a sd a0,16(sp) + 80011be2: a809 j 80011bf4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x4c> + 80011be4: 02e14503 lbu a0,46(sp) + 80011be8: 8905 andi a0,a0,1 + 80011bea: e105 bnez a0,80011c0a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x62> + 80011bec: a01d j 80011c12 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x6a> + 80011bee: 7502 ld a0,32(sp) + 80011bf0: f175 bnez a0,80011bd4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x2c> + 80011bf2: bfe9 j 80011bcc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x24> + 80011bf4: 00000097 auipc ra,0x0 + 80011bf8: 7fc080e7 jalr 2044(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011bfc: e42a sd a0,8(sp) + 80011bfe: a009 j 80011c00 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x58> + 80011c00: 6542 ld a0,16(sp) + 80011c02: 65a2 ld a1,8(sp) + 80011c04: fcb500e3 beq a0,a1,80011bc4 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x1c> + 80011c08: b7d1 j 80011bcc <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x24> + 80011c0a: 4505 li a0,1 + return true + 80011c0c: 02a106a3 sb a0,45(sp) + } + 80011c10: a029 j 80011c1a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x72> + 80011c12: 4501 li a0,0 + false + 80011c14: 02a106a3 sb a0,45(sp) + } + 80011c18: a009 j 80011c1a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17he647ed27b9879bf9E+0x72> + 80011c1a: 02d14503 lbu a0,45(sp) + 80011c1e: 70e2 ld ra,56(sp) + 80011c20: 6121 addi sp,sp,64 + 80011c22: 8082 ret + +Disassembly of section .text._ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E: + +0000000080011c24 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E>: + pub fn holding(&self) -> bool{ + 80011c24: 7139 addi sp,sp,-64 + 80011c26: fc06 sd ra,56(sp) + 80011c28: ec2a sd a0,24(sp) + 80011c2a: f82a sd a0,48(sp) + if self.locked.load(Ordering::Relaxed) && self.cpu_id.get() == unsafe{ cpuid() } as isize { + 80011c2c: 0561 addi a0,a0,24 + 80011c2e: 4581 li a1,0 + 80011c30: 02b107a3 sb a1,47(sp) + 80011c34: ffff3097 auipc ra,0xffff3 + 80011c38: ad2080e7 jalr -1326(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 80011c3c: f02a sd a0,32(sp) + 80011c3e: a035 j 80011c6a <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x46> + 80011c40: 4505 li a0,1 + 80011c42: 02a10723 sb a0,46(sp) + 80011c46: a829 j 80011c60 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x3c> + 80011c48: 4501 li a0,0 + 80011c4a: 02a10723 sb a0,46(sp) + 80011c4e: a809 j 80011c60 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x3c> + 80011c50: 6562 ld a0,24(sp) + 80011c52: 0541 addi a0,a0,16 + 80011c54: ffff3097 auipc ra,0xffff3 + 80011c58: 61a080e7 jalr 1562(ra) # 8000526e <_ZN4core4cell13Cell$LT$T$GT$3get17hc0e1a98a16df48afE> + 80011c5c: e82a sd a0,16(sp) + 80011c5e: a809 j 80011c70 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x4c> + 80011c60: 02e14503 lbu a0,46(sp) + 80011c64: 8905 andi a0,a0,1 + 80011c66: e105 bnez a0,80011c86 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x62> + 80011c68: a01d j 80011c8e <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x6a> + 80011c6a: 7502 ld a0,32(sp) + 80011c6c: f175 bnez a0,80011c50 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x2c> + 80011c6e: bfe9 j 80011c48 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x24> + 80011c70: 00000097 auipc ra,0x0 + 80011c74: 780080e7 jalr 1920(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 80011c78: e42a sd a0,8(sp) + 80011c7a: a009 j 80011c7c <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x58> + 80011c7c: 6542 ld a0,16(sp) + 80011c7e: 65a2 ld a1,8(sp) + 80011c80: fcb500e3 beq a0,a1,80011c40 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x1c> + 80011c84: b7d1 j 80011c48 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x24> + 80011c86: 4505 li a0,1 + return true + 80011c88: 02a106a3 sb a0,45(sp) + } + 80011c8c: a029 j 80011c96 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x72> + 80011c8e: 4501 li a0,0 + false + 80011c90: 02a106a3 sb a0,45(sp) + } + 80011c94: a009 j 80011c96 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17hfffb7f56d7315d17E+0x72> + 80011c96: 02d14503 lbu a0,45(sp) + 80011c9a: 70e2 ld ra,56(sp) + 80011c9c: 6121 addi sp,sp,64 + 80011c9e: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E: + +0000000080011ca0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E>: + fn deref(&self) -> &Self::Target { + 80011ca0: 1101 addi sp,sp,-32 + 80011ca2: ec06 sd ra,24(sp) + 80011ca4: e82a sd a0,16(sp) + &*self.spinlock.data.get() + 80011ca6: 6108 ld a0,0(a0) + 80011ca8: 02050513 addi a0,a0,32 + 80011cac: ffff3097 auipc ra,0xffff3 + 80011cb0: 6e4080e7 jalr 1764(ra) # 80005390 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h4b85f27290bf8d3bE> + 80011cb4: e42a sd a0,8(sp) + 80011cb6: a009 j 80011cb8 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E+0x18> + } + 80011cb8: 6522 ld a0,8(sp) + 80011cba: 60e2 ld ra,24(sp) + 80011cbc: 6105 addi sp,sp,32 + 80011cbe: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h570d144f846c2ec7E: + +0000000080011cc0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h570d144f846c2ec7E>: + fn deref(&self) -> &Self::Target { + 80011cc0: 1101 addi sp,sp,-32 + 80011cc2: ec06 sd ra,24(sp) + 80011cc4: e82a sd a0,16(sp) + &*self.spinlock.data.get() + 80011cc6: 6108 ld a0,0(a0) + 80011cc8: 02050513 addi a0,a0,32 + 80011ccc: 00011097 auipc ra,0x11 + 80011cd0: 2ae080e7 jalr 686(ra) # 80022f7a <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hcdc438fb74b7ecc8E> + 80011cd4: e42a sd a0,8(sp) + 80011cd6: a009 j 80011cd8 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h570d144f846c2ec7E+0x18> + } + 80011cd8: 6522 ld a0,8(sp) + 80011cda: 60e2 ld ra,24(sp) + 80011cdc: 6105 addi sp,sp,32 + 80011cde: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7eb0b551b3d2dabcE: + +0000000080011ce0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7eb0b551b3d2dabcE>: + fn deref(&self) -> &Self::Target { + 80011ce0: 1101 addi sp,sp,-32 + 80011ce2: ec06 sd ra,24(sp) + 80011ce4: e82a sd a0,16(sp) + &*self.spinlock.data.get() + 80011ce6: 6108 ld a0,0(a0) + 80011ce8: 6585 lui a1,0x1 + 80011cea: 952e add a0,a0,a1 + 80011cec: ffff3097 auipc ra,0xffff3 + 80011cf0: 69c080e7 jalr 1692(ra) # 80005388 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h222732a2deb54afaE> + 80011cf4: e42a sd a0,8(sp) + 80011cf6: a009 j 80011cf8 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7eb0b551b3d2dabcE+0x18> + } + 80011cf8: 6522 ld a0,8(sp) + 80011cfa: 60e2 ld ra,24(sp) + 80011cfc: 6105 addi sp,sp,32 + 80011cfe: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE: + +0000000080011d00 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE>: + fn deref(&self) -> &Self::Target { + 80011d00: 1101 addi sp,sp,-32 + 80011d02: ec06 sd ra,24(sp) + 80011d04: e82a sd a0,16(sp) + &*self.spinlock.data.get() + 80011d06: 6108 ld a0,0(a0) + 80011d08: 0571 addi a0,a0,28 + 80011d0a: ffff3097 auipc ra,0xffff3 + 80011d0e: 6be080e7 jalr 1726(ra) # 800053c8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hf0694f5cd8271985E> + 80011d12: e42a sd a0,8(sp) + 80011d14: a009 j 80011d16 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h89fb3cfbc0625c4cE+0x16> + } + 80011d16: 6522 ld a0,8(sp) + 80011d18: 60e2 ld ra,24(sp) + 80011d1a: 6105 addi sp,sp,32 + 80011d1c: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E: + +0000000080011d1e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E>: + fn deref(&self) -> &Self::Target { + 80011d1e: 1101 addi sp,sp,-32 + 80011d20: ec06 sd ra,24(sp) + 80011d22: e82a sd a0,16(sp) + &*self.spinlock.data.get() + 80011d24: 6108 ld a0,0(a0) + 80011d26: 02050513 addi a0,a0,32 + 80011d2a: ffff3097 auipc ra,0xffff3 + 80011d2e: 64e080e7 jalr 1614(ra) # 80005378 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h05438521b5304ed4E> + 80011d32: e42a sd a0,8(sp) + 80011d34: a009 j 80011d36 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h8f385c8b975788d5E+0x18> + } + 80011d36: 6522 ld a0,8(sp) + 80011d38: 60e2 ld ra,24(sp) + 80011d3a: 6105 addi sp,sp,32 + 80011d3c: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h9affced61e721535E: + +0000000080011d3e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h9affced61e721535E>: + fn deref(&self) -> &Self::Target { + 80011d3e: 1101 addi sp,sp,-32 + 80011d40: ec06 sd ra,24(sp) + 80011d42: e82a sd a0,16(sp) + &*self.spinlock.data.get() + 80011d44: 6108 ld a0,0(a0) + 80011d46: 02050513 addi a0,a0,32 + 80011d4a: ffff3097 auipc ra,0xffff3 + 80011d4e: 65e080e7 jalr 1630(ra) # 800053a8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h85f42af92512c053E> + 80011d52: e42a sd a0,8(sp) + 80011d54: a009 j 80011d56 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h9affced61e721535E+0x18> + } + 80011d56: 6522 ld a0,8(sp) + 80011d58: 60e2 ld ra,24(sp) + 80011d5a: 6105 addi sp,sp,32 + 80011d5c: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hc8a5a3c7c4ffa947E: + +0000000080011d5e <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hc8a5a3c7c4ffa947E>: + fn deref(&self) -> &Self::Target { + 80011d5e: 1101 addi sp,sp,-32 + 80011d60: ec06 sd ra,24(sp) + 80011d62: e82a sd a0,16(sp) + &*self.spinlock.data.get() + 80011d64: 6108 ld a0,0(a0) + 80011d66: 02050513 addi a0,a0,32 + 80011d6a: ffff3097 auipc ra,0xffff3 + 80011d6e: 656080e7 jalr 1622(ra) # 800053c0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hbe9e1598ba1bbd42E> + 80011d72: e42a sd a0,8(sp) + 80011d74: a009 j 80011d76 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hc8a5a3c7c4ffa947E+0x18> + } + 80011d76: 6522 ld a0,8(sp) + 80011d78: 60e2 ld ra,24(sp) + 80011d7a: 6105 addi sp,sp,32 + 80011d7c: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E: + +0000000080011d7e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011d7e: 1101 addi sp,sp,-32 + 80011d80: ec06 sd ra,24(sp) + 80011d82: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011d84: 6108 ld a0,0(a0) + 80011d86: 6585 lui a1,0x1 + 80011d88: 952e add a0,a0,a1 + 80011d8a: ffff3097 auipc ra,0xffff3 + 80011d8e: 5fe080e7 jalr 1534(ra) # 80005388 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h222732a2deb54afaE> + 80011d92: e42a sd a0,8(sp) + 80011d94: a009 j 80011d96 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h362a59dae1fa4f35E+0x18> + } + 80011d96: 6522 ld a0,8(sp) + 80011d98: 60e2 ld ra,24(sp) + 80011d9a: 6105 addi sp,sp,32 + 80011d9c: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h5eeb9448b47ad682E: + +0000000080011d9e <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h5eeb9448b47ad682E>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011d9e: 1101 addi sp,sp,-32 + 80011da0: ec06 sd ra,24(sp) + 80011da2: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011da4: 6108 ld a0,0(a0) + 80011da6: 02050513 addi a0,a0,32 + 80011daa: ffff3097 auipc ra,0xffff3 + 80011dae: 5f6080e7 jalr 1526(ra) # 800053a0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h6b3041abf61d3f4fE> + 80011db2: e42a sd a0,8(sp) + 80011db4: a009 j 80011db6 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h5eeb9448b47ad682E+0x18> + } + 80011db6: 6522 ld a0,8(sp) + 80011db8: 60e2 ld ra,24(sp) + 80011dba: 6105 addi sp,sp,32 + 80011dbc: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE: + +0000000080011dbe <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011dbe: 1101 addi sp,sp,-32 + 80011dc0: ec06 sd ra,24(sp) + 80011dc2: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011dc4: 6108 ld a0,0(a0) + 80011dc6: 0571 addi a0,a0,28 + 80011dc8: ffff3097 auipc ra,0xffff3 + 80011dcc: 600080e7 jalr 1536(ra) # 800053c8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hf0694f5cd8271985E> + 80011dd0: e42a sd a0,8(sp) + 80011dd2: a009 j 80011dd4 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6a09efacfb59499dE+0x16> + } + 80011dd4: 6522 ld a0,8(sp) + 80011dd6: 60e2 ld ra,24(sp) + 80011dd8: 6105 addi sp,sp,32 + 80011dda: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E: + +0000000080011ddc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011ddc: 1101 addi sp,sp,-32 + 80011dde: ec06 sd ra,24(sp) + 80011de0: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011de2: 6108 ld a0,0(a0) + 80011de4: 02050513 addi a0,a0,32 + 80011de8: ffff3097 auipc ra,0xffff3 + 80011dec: 590080e7 jalr 1424(ra) # 80005378 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h05438521b5304ed4E> + 80011df0: e42a sd a0,8(sp) + 80011df2: a009 j 80011df4 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h6db8254bcc254a19E+0x18> + } + 80011df4: 6522 ld a0,8(sp) + 80011df6: 60e2 ld ra,24(sp) + 80011df8: 6105 addi sp,sp,32 + 80011dfa: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E: + +0000000080011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011dfc: 1101 addi sp,sp,-32 + 80011dfe: ec06 sd ra,24(sp) + 80011e00: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011e02: 6108 ld a0,0(a0) + 80011e04: 02050513 addi a0,a0,32 + 80011e08: ffff3097 auipc ra,0xffff3 + 80011e0c: 588080e7 jalr 1416(ra) # 80005390 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h4b85f27290bf8d3bE> + 80011e10: e42a sd a0,8(sp) + 80011e12: a009 j 80011e14 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E+0x18> + } + 80011e14: 6522 ld a0,8(sp) + 80011e16: 60e2 ld ra,24(sp) + 80011e18: 6105 addi sp,sp,32 + 80011e1a: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE: + +0000000080011e1c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011e1c: 1101 addi sp,sp,-32 + 80011e1e: ec06 sd ra,24(sp) + 80011e20: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011e22: 6108 ld a0,0(a0) + 80011e24: 02050513 addi a0,a0,32 + 80011e28: ffff3097 auipc ra,0xffff3 + 80011e2c: 598080e7 jalr 1432(ra) # 800053c0 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hbe9e1598ba1bbd42E> + 80011e30: e42a sd a0,8(sp) + 80011e32: a009 j 80011e34 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7fbd4bc7b8273f3cE+0x18> + } + 80011e34: 6522 ld a0,8(sp) + 80011e36: 60e2 ld ra,24(sp) + 80011e38: 6105 addi sp,sp,32 + 80011e3a: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h8532990243dc594eE: + +0000000080011e3c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h8532990243dc594eE>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011e3c: 1101 addi sp,sp,-32 + 80011e3e: ec06 sd ra,24(sp) + 80011e40: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011e42: 6108 ld a0,0(a0) + 80011e44: 02050513 addi a0,a0,32 + 80011e48: 00011097 auipc ra,0x11 + 80011e4c: 132080e7 jalr 306(ra) # 80022f7a <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hcdc438fb74b7ecc8E> + 80011e50: e42a sd a0,8(sp) + 80011e52: a009 j 80011e54 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h8532990243dc594eE+0x18> + } + 80011e54: 6522 ld a0,8(sp) + 80011e56: 60e2 ld ra,24(sp) + 80011e58: 6105 addi sp,sp,32 + 80011e5a: 8082 ret + +Disassembly of section .text._ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE: + +0000000080011e5c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE>: + fn deref_mut(&mut self) -> &mut Self::Target{ + 80011e5c: 1101 addi sp,sp,-32 + 80011e5e: ec06 sd ra,24(sp) + 80011e60: e82a sd a0,16(sp) + &mut *self.spinlock.data.get() + 80011e62: 6108 ld a0,0(a0) + 80011e64: 02050513 addi a0,a0,32 + 80011e68: ffff3097 auipc ra,0xffff3 + 80011e6c: 540080e7 jalr 1344(ra) # 800053a8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h85f42af92512c053E> + 80011e70: e42a sd a0,8(sp) + 80011e72: a009 j 80011e74 <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE+0x18> + } + 80011e74: 6522 ld a0,8(sp) + 80011e76: 60e2 ld ra,24(sp) + 80011e78: 6105 addi sp,sp,32 + 80011e7a: 8082 ret + +Disassembly of section .text._ZN4core5slice5index74_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$5index17h0c420969feecb596E: + +0000000080011e7c <_ZN4core5slice5index74_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$5index17h0c420969feecb596E>: + fn index(&self, index: I) -> &I::Output { + 80011e7c: 7179 addi sp,sp,-48 + 80011e7e: f406 sd ra,40(sp) + 80011e80: e82a sd a0,16(sp) + 80011e82: ec2e sd a1,24(sp) + index.index(self) + 80011e84: ffffa097 auipc ra,0xffffa + 80011e88: 4e8080e7 jalr 1256(ra) # 8000c36c <_ZN97_$LT$core..ops..range..RangeFull$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hf9cc134d1ddb7793E> + 80011e8c: e02a sd a0,0(sp) + 80011e8e: e42e sd a1,8(sp) + 80011e90: a009 j 80011e92 <_ZN4core5slice5index74_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$5index17h0c420969feecb596E+0x16> + } + 80011e92: 65a2 ld a1,8(sp) + 80011e94: 6502 ld a0,0(sp) + 80011e96: 70a2 ld ra,40(sp) + 80011e98: 6145 addi sp,sp,48 + 80011e9a: 8082 ret + +Disassembly of section .text._ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17h6397a28cd31ac6bcE: + +0000000080011e9c <_ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17h6397a28cd31ac6bcE>: + fn index_mut(&mut self, index: I) -> &mut I::Output { + 80011e9c: 7179 addi sp,sp,-48 + 80011e9e: f406 sd ra,40(sp) + 80011ea0: e82a sd a0,16(sp) + 80011ea2: ec2e sd a1,24(sp) + index.index_mut(self) + 80011ea4: ffffa097 auipc ra,0xffffa + 80011ea8: 4d2080e7 jalr 1234(ra) # 8000c376 <_ZN97_$LT$core..ops..range..RangeFull$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hf4f8ccbc08517323E> + 80011eac: e02a sd a0,0(sp) + 80011eae: e42e sd a1,8(sp) + 80011eb0: a009 j 80011eb2 <_ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17h6397a28cd31ac6bcE+0x16> + } + 80011eb2: 65a2 ld a1,8(sp) + 80011eb4: 6502 ld a0,0(sp) + 80011eb6: 70a2 ld ra,40(sp) + 80011eb8: 6145 addi sp,sp,48 + 80011eba: 8082 ret + +Disassembly of section .text._ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17hb4c5f14cfefb7eb2E: + +0000000080011ebc <_ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17hb4c5f14cfefb7eb2E>: + fn index_mut(&mut self, index: I) -> &mut I::Output { + 80011ebc: 7139 addi sp,sp,-64 + 80011ebe: fc06 sd ra,56(sp) + 80011ec0: e432 sd a2,8(sp) + 80011ec2: 862e mv a2,a1 + 80011ec4: 85aa mv a1,a0 + 80011ec6: 6522 ld a0,8(sp) + 80011ec8: f02e sd a1,32(sp) + 80011eca: f432 sd a2,40(sp) + 80011ecc: f82a sd a0,48(sp) + index.index_mut(self) + 80011ece: ffffa097 auipc ra,0xffffa + 80011ed2: 030080e7 jalr 48(ra) # 8000befe <_ZN108_$LT$core..ops..range..RangeTo$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17h6e1483f88545dbc6E> + 80011ed6: e82a sd a0,16(sp) + 80011ed8: ec2e sd a1,24(sp) + 80011eda: a009 j 80011edc <_ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17hb4c5f14cfefb7eb2E+0x20> + } + 80011edc: 65e2 ld a1,24(sp) + 80011ede: 6542 ld a0,16(sp) + 80011ee0: 70e2 ld ra,56(sp) + 80011ee2: 6121 addi sp,sp,64 + 80011ee4: 8082 ret + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h1a7368dde5044597E: + +0000000080011ee6 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h1a7368dde5044597E>: + 80011ee6: 1101 addi sp,sp,-32 + 80011ee8: ec06 sd ra,24(sp) + 80011eea: e42a sd a0,8(sp) + 80011eec: e82e sd a1,16(sp) + 80011eee: 6108 ld a0,0(a0) + 80011ef0: ffff6097 auipc ra,0xffff6 + 80011ef4: 172080e7 jalr 370(ra) # 80008062 <_ZN85_$LT$kernel..arch..riscv..register..scause..Interrupt$u20$as$u20$core..fmt..Debug$GT$3fmt17h96992b3c4ed41ad9E> + 80011ef8: e02a sd a0,0(sp) + 80011efa: a009 j 80011efc <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h1a7368dde5044597E+0x16> + 80011efc: 6502 ld a0,0(sp) + 80011efe: 60e2 ld ra,24(sp) + 80011f00: 6105 addi sp,sp,32 + 80011f02: 8082 ret + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h436ba031ceeed146E: + +0000000080011f04 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h436ba031ceeed146E>: + 80011f04: 1101 addi sp,sp,-32 + 80011f06: ec06 sd ra,24(sp) + 80011f08: e42a sd a0,8(sp) + 80011f0a: e82e sd a1,16(sp) + 80011f0c: 6108 ld a0,0(a0) + 80011f0e: ffff6097 auipc ra,0xffff6 + 80011f12: 2aa080e7 jalr 682(ra) # 800081b8 <_ZN85_$LT$kernel..arch..riscv..register..scause..Exception$u20$as$u20$core..fmt..Debug$GT$3fmt17h4deffc5a3158ed01E> + 80011f16: e02a sd a0,0(sp) + 80011f18: a009 j 80011f1a <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h436ba031ceeed146E+0x16> + 80011f1a: 6502 ld a0,0(sp) + 80011f1c: 60e2 ld ra,24(sp) + 80011f1e: 6105 addi sp,sp,32 + 80011f20: 8082 ret + +Disassembly of section .text._ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E: + +0000000080011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E>: + } +} + +impl Addr for VirtualAddress{ + #[inline] + fn as_usize(&self) -> usize{ + 80011f22: 1141 addi sp,sp,-16 + 80011f24: e42a sd a0,8(sp) + self.0 + 80011f26: 6108 ld a0,0(a0) + } + 80011f28: 0141 addi sp,sp,16 + 80011f2a: 8082 ret + +Disassembly of section .text._ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h88794159bc97d31bE: + +0000000080011f2c <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h88794159bc97d31bE>: + fn data_ref(&self) -> &usize{ + &self.0 + } + + #[inline] + fn data_mut(&mut self) -> &mut usize{ + 80011f2c: 1141 addi sp,sp,-16 + 80011f2e: e42a sd a0,8(sp) + &mut self.0 + } + 80011f30: 0141 addi sp,sp,16 + 80011f32: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E: + +0000000080011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E>: + +impl Addr for PhysicalAddress{ + + + #[inline] + fn as_usize(&self) -> usize{ + 80011f34: 1141 addi sp,sp,-16 + 80011f36: e42a sd a0,8(sp) + self.0 + 80011f38: 6108 ld a0,0(a0) + } + 80011f3a: 0141 addi sp,sp,16 + 80011f3c: 8082 ret + +Disassembly of section .text._ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h98a368b1f7383ca3E: + +0000000080011f3e <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8data_mut17h98a368b1f7383ca3E>: + fn data_ref(&self) -> &usize{ + &self.0 + } + + #[inline] + fn data_mut(&mut self) -> &mut usize{ + 80011f3e: 1141 addi sp,sp,-16 + 80011f40: e42a sd a0,8(sp) + &mut self.0 + } + 80011f42: 0141 addi sp,sp,16 + 80011f44: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E: + +0000000080011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E>: + +} + +impl VirtualAddress{ + pub fn new(addr: usize) -> Self{ + 80011f46: 1141 addi sp,sp,-16 + 80011f48: e42a sd a0,8(sp) + Self(addr) + 80011f4a: e02a sd a0,0(sp) + } + 80011f4c: 0141 addi sp,sp,16 + 80011f4e: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE: + +0000000080011f50 <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE>: + pub fn add_addr(&self, addr:usize) -> Self{ + Self(self.0+addr) + } + + + pub fn page_num(&self, level: usize) -> usize{ + 80011f50: 7179 addi sp,sp,-48 + 80011f52: f02a sd a0,32(sp) + 80011f54: f42e sd a1,40(sp) + (self.0 >> (PGSHIFT + level * PGMASKLEN)) & PGMASK + 80011f56: 6108 ld a0,0(a0) + 80011f58: e82a sd a0,16(sp) + 80011f5a: 00359513 slli a0,a1,0x3 + 80011f5e: 952e add a0,a0,a1 + 80011f60: ec2a sd a0,24(sp) + 80011f62: 4525 li a0,9 + 80011f64: 02a5b533 mulhu a0,a1,a0 + 80011f68: 4581 li a1,0 + 80011f6a: 02b51a63 bne a0,a1,80011f9e <.LBB5_7> + 80011f6e: a009 j 80011f70 <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE+0x20> + 80011f70: 65e2 ld a1,24(sp) + 80011f72: 00c58513 addi a0,a1,12 # 100c <.Lline_table_start0+0x14c> + 80011f76: e42a sd a0,8(sp) + 80011f78: 04b56263 bltu a0,a1,80011fbc <.LBB5_9> + 80011f7c: a009 j 80011f7e <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE+0x2e> + 80011f7e: 65c2 ld a1,16(sp) + 80011f80: 6622 ld a2,8(sp) + 80011f82: fc067513 andi a0,a2,-64 + 80011f86: 00c5d5b3 srl a1,a1,a2 + 80011f8a: e02e sd a1,0(sp) + 80011f8c: 4581 li a1,0 + 80011f8e: 04b51563 bne a0,a1,80011fd8 <.LBB5_11> + 80011f92: a009 j 80011f94 <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE+0x44> + 80011f94: 6502 ld a0,0(sp) + 80011f96: 1ff57513 andi a0,a0,511 + } + 80011f9a: 6145 addi sp,sp,48 + 80011f9c: 8082 ret + +0000000080011f9e <.LBB5_7>: + (self.0 >> (PGSHIFT + level * PGMASKLEN)) & PGMASK + 80011f9e: 00018517 auipc a0,0x18 + 80011fa2: bc250513 addi a0,a0,-1086 # 80029b60 + +0000000080011fa6 <.LBB5_8>: + 80011fa6: 00018617 auipc a2,0x18 + 80011faa: ba260613 addi a2,a2,-1118 # 80029b48 <.L__unnamed_1> + 80011fae: 02100593 li a1,33 + 80011fb2: 00011097 auipc ra,0x11 + 80011fb6: 192080e7 jalr 402(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080011fbc <.LBB5_9>: + 80011fbc: 00018517 auipc a0,0x18 + 80011fc0: be450513 addi a0,a0,-1052 # 80029ba0 + +0000000080011fc4 <.LBB5_10>: + 80011fc4: 00018617 auipc a2,0x18 + 80011fc8: bc460613 addi a2,a2,-1084 # 80029b88 <.L__unnamed_2> + 80011fcc: 45f1 li a1,28 + 80011fce: 00011097 auipc ra,0x11 + 80011fd2: 176080e7 jalr 374(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080011fd8 <.LBB5_11>: + 80011fd8: 00018517 auipc a0,0x18 + 80011fdc: c0850513 addi a0,a0,-1016 # 80029be0 + +0000000080011fe0 <.LBB5_12>: + 80011fe0: 00018617 auipc a2,0x18 + 80011fe4: be060613 addi a2,a2,-1056 # 80029bc0 <.L__unnamed_3> + 80011fe8: 02400593 li a1,36 + 80011fec: 00011097 auipc ra,0x11 + 80011ff0: 158080e7 jalr 344(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E: + +0000000080011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E>: + +} + +impl PhysicalAddress{ + pub fn new(value:usize) -> Self{ + 80011ff6: 1141 addi sp,sp,-16 + 80011ff8: e42a sd a0,8(sp) + Self(value) + 80011ffa: e02a sd a0,0(sp) + } + 80011ffc: 0141 addi sp,sp,16 + 80011ffe: 8082 ret + +Disassembly of section .text._ZN80_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$core..cmp..PartialEq$GT$2ne17h594c009ca6e35357E: + +0000000080012000 <_ZN80_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$core..cmp..PartialEq$GT$2ne17h594c009ca6e35357E>: +#[derive(Debug, Copy, Clone, PartialEq)] + 80012000: 1101 addi sp,sp,-32 + 80012002: e02a sd a0,0(sp) + 80012004: e42e sd a1,8(sp) +pub struct VirtualAddress(pub usize); + 80012006: e82e sd a1,16(sp) + 80012008: ec2a sd a0,24(sp) + 8001200a: 6108 ld a0,0(a0) + 8001200c: 618c ld a1,0(a1) + 8001200e: 8d2d xor a0,a0,a1 + 80012010: 00a03533 snez a0,a0 +#[derive(Debug, Copy, Clone, PartialEq)] + 80012014: 6105 addi sp,sp,32 + 80012016: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h92628fd5b4e20f4bE: + +0000000080012018 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h92628fd5b4e20f4bE>: + pub const unsafe fn add(self, count: usize) -> Self + 80012018: 1101 addi sp,sp,-32 + 8001201a: ec06 sd ra,24(sp) + 8001201c: e42a sd a0,8(sp) + 8001201e: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 80012020: 00000097 auipc ra,0x0 + 80012024: 014080e7 jalr 20(ra) # 80012034 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h2e4c04da2e1cf416E> + 80012028: e02a sd a0,0(sp) + 8001202a: a009 j 8001202c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h92628fd5b4e20f4bE+0x14> + } + 8001202c: 6502 ld a0,0(sp) + 8001202e: 60e2 ld ra,24(sp) + 80012030: 6105 addi sp,sp,32 + 80012032: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h2e4c04da2e1cf416E: + +0000000080012034 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h2e4c04da2e1cf416E>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 80012034: 1101 addi sp,sp,-32 + 80012036: e42a sd a0,8(sp) + 80012038: e82e sd a1,16(sp) + 8001203a: 41800613 li a2,1048 + unsafe { intrinsics::offset(self, count) as *mut T } + 8001203e: 02c585b3 mul a1,a1,a2 + 80012042: 952e add a0,a0,a1 + 80012044: e02a sd a0,0(sp) + 80012046: ec2a sd a0,24(sp) + 80012048: a009 j 8001204a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h2e4c04da2e1cf416E+0x16> + } + 8001204a: 6502 ld a0,0(sp) + 8001204c: 6105 addi sp,sp,32 + 8001204e: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E: + +0000000080012050 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E>: + pub const fn is_null(self) -> bool { + 80012050: 1101 addi sp,sp,-32 + 80012052: ec06 sd ra,24(sp) + 80012054: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 80012056: e42a sd a0,8(sp) + 80012058: a009 j 8001205a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E+0xa> + 8001205a: 6522 ld a0,8(sp) + 8001205c: 4581 li a1,0 + 8001205e: 00011097 auipc ra,0x11 + 80012062: eac080e7 jalr -340(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 80012066: e02a sd a0,0(sp) + 80012068: a009 j 8001206a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h85a37a40d6479ac3E+0x1a> + } + 8001206a: 6502 ld a0,0(sp) + 8001206c: 60e2 ld ra,24(sp) + 8001206e: 6105 addi sp,sp,32 + 80012070: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17ha1c03feaee4d8d14E: + +0000000080012072 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17ha1c03feaee4d8d14E>: + pub const unsafe fn add(self, count: usize) -> Self + 80012072: 1101 addi sp,sp,-32 + 80012074: ec06 sd ra,24(sp) + 80012076: e42a sd a0,8(sp) + 80012078: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 8001207a: 00000097 auipc ra,0x0 + 8001207e: 014080e7 jalr 20(ra) # 8001208e <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h6480ea29a8b0f54fE> + 80012082: e02a sd a0,0(sp) + 80012084: a009 j 80012086 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17ha1c03feaee4d8d14E+0x14> + } + 80012086: 6502 ld a0,0(sp) + 80012088: 60e2 ld ra,24(sp) + 8001208a: 6105 addi sp,sp,32 + 8001208c: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h6480ea29a8b0f54fE: + +000000008001208e <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h6480ea29a8b0f54fE>: + pub const unsafe fn offset(self, count: isize) -> *const T + 8001208e: 1101 addi sp,sp,-32 + 80012090: e42a sd a0,8(sp) + 80012092: e82e sd a1,16(sp) + 80012094: 41800613 li a2,1048 + unsafe { intrinsics::offset(self, count) } + 80012098: 02c585b3 mul a1,a1,a2 + 8001209c: 952e add a0,a0,a1 + 8001209e: e02a sd a0,0(sp) + 800120a0: ec2a sd a0,24(sp) + 800120a2: a009 j 800120a4 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h6480ea29a8b0f54fE+0x16> + } + 800120a4: 6502 ld a0,0(sp) + 800120a6: 6105 addi sp,sp,32 + 800120a8: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h3d65bc1db9cfc841E: + +00000000800120aa <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h3d65bc1db9cfc841E>: + pub const fn is_null(self) -> bool { + 800120aa: 1101 addi sp,sp,-32 + 800120ac: ec06 sd ra,24(sp) + 800120ae: e82a sd a0,16(sp) + (self as *const u8).guaranteed_eq(null()) + 800120b0: e42a sd a0,8(sp) + 800120b2: a009 j 800120b4 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h3d65bc1db9cfc841E+0xa> + 800120b4: 6522 ld a0,8(sp) + 800120b6: 4581 li a1,0 + 800120b8: 00011097 auipc ra,0x11 + 800120bc: e6c080e7 jalr -404(ra) # 80022f24 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17h0ce622e77376dc6cE> + 800120c0: e02a sd a0,0(sp) + 800120c2: a009 j 800120c4 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h3d65bc1db9cfc841E+0x1a> + } + 800120c4: 6502 ld a0,0(sp) + 800120c6: 60e2 ld ra,24(sp) + 800120c8: 6105 addi sp,sp,32 + 800120ca: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17hb97ee0bcc69dbfd1E: + +00000000800120cc <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17hb97ee0bcc69dbfd1E>: + pub const fn as_mut_ptr(&mut self) -> *mut T { + 800120cc: 1141 addi sp,sp,-16 + 800120ce: e02a sd a0,0(sp) + 800120d0: e42e sd a1,8(sp) + } + 800120d2: 0141 addi sp,sp,16 + 800120d4: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E: + +00000000800120d6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h4bfd03ca73658008E>: + pub const fn len(&self) -> usize { + 800120d6: 7179 addi sp,sp,-48 + 800120d8: e42e sd a1,8(sp) + 800120da: 85aa mv a1,a0 + 800120dc: 6522 ld a0,8(sp) + 800120de: f02e sd a1,32(sp) + 800120e0: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 800120e2: e82e sd a1,16(sp) + 800120e4: ec2a sd a0,24(sp) + } + 800120e6: 6145 addi sp,sp,48 + 800120e8: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17hee0c9e23d269ed9fE: + +00000000800120ea <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17hee0c9e23d269ed9fE>: + pub fn iter(&self) -> Iter<'_, T> { + 800120ea: 7179 addi sp,sp,-48 + 800120ec: f406 sd ra,40(sp) + 800120ee: ec2a sd a0,24(sp) + 800120f0: f02e sd a1,32(sp) + Iter::new(self) + 800120f2: ffff9097 auipc ra,0xffff9 + 800120f6: 3d0080e7 jalr 976(ra) # 8000b4c2 <_ZN4core5slice4iter13Iter$LT$T$GT$3new17hf10fcd709702b21cE> + 800120fa: e42a sd a0,8(sp) + 800120fc: e82e sd a1,16(sp) + 800120fe: a009 j 80012100 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17hee0c9e23d269ed9fE+0x16> + } + 80012100: 65c2 ld a1,16(sp) + 80012102: 6522 ld a0,8(sp) + 80012104: 70a2 ld ra,40(sp) + 80012106: 6145 addi sp,sp,48 + 80012108: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17h96d6be25d539a858E: + +000000008001210a <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17h96d6be25d539a858E>: + pub const fn as_ptr(&self) -> *const T { + 8001210a: 1141 addi sp,sp,-16 + 8001210c: e02a sd a0,0(sp) + 8001210e: e42e sd a1,8(sp) + } + 80012110: 0141 addi sp,sp,16 + 80012112: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E: + +0000000080012114 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E>: + pub fn iter_mut(&mut self) -> IterMut<'_, T> { + 80012114: 7179 addi sp,sp,-48 + 80012116: f406 sd ra,40(sp) + 80012118: ec2a sd a0,24(sp) + 8001211a: f02e sd a1,32(sp) + IterMut::new(self) + 8001211c: ffff9097 auipc ra,0xffff9 + 80012120: 5da080e7 jalr 1498(ra) # 8000b6f6 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h494ce98d94679ec3E> + 80012124: e42a sd a0,8(sp) + 80012126: e82e sd a1,16(sp) + 80012128: a009 j 8001212a <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h437897ea96238243E+0x16> + } + 8001212a: 65c2 ld a1,16(sp) + 8001212c: 6522 ld a0,8(sp) + 8001212e: 70a2 ld ra,40(sp) + 80012130: 6145 addi sp,sp,48 + 80012132: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct5sleep17h09ab315f9f2cb91eE: + +0000000080012134 <_ZN6kernel7process7process11task_struct5sleep17h09ab315f9f2cb91eE>: + drop(guard); + } + + /// Atomically release lock and sleep on chan + /// Reacquires lock when awakened. + pub fn sleep(&mut self, channel: usize, lock: SpinlockGuard<'_, T>) { + 80012134: 711d addi sp,sp,-96 + 80012136: ec86 sd ra,88(sp) + 80012138: e432 sd a2,8(sp) + 8001213a: e82e sd a1,16(sp) + 8001213c: ec2a sd a0,24(sp) + 8001213e: f82a sd a0,48(sp) + 80012140: fc2e sd a1,56(sp) + 80012142: e0b2 sd a2,64(sp) + 80012144: 6509 lui a0,0x2 + 80012146: 0c85059b addiw a1,a0,200 + +000000008001214a <.LBB11_6>: + 8001214a: 00047517 auipc a0,0x47 + 8001214e: 28650513 addi a0,a0,646 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80012152: 952e add a0,a0,a1 + // // Tide up + // guard.channel = 0; + // drop(guard); + // } + + let tasks_guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 80012154: fffff097 auipc ra,0xfffff + 80012158: eee080e7 jalr -274(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001215c: 85aa mv a1,a0 + 8001215e: f02e sd a1,32(sp) + 80012160: e4aa sd a0,72(sp) + 80012162: a009 j 80012164 <.LBB11_6+0x1a> + drop(lock); + 80012164: 6522 ld a0,8(sp) + 80012166: 0000c097 auipc ra,0xc + 8001216a: cb2080e7 jalr -846(ra) # 8001de18 <_ZN4core3mem4drop17h2ed300707c7d4096E> + 8001216e: a009 j 80012170 <.LBB11_6+0x26> + + self.channel = channel; + 80012170: 65e2 ld a1,24(sp) + 80012172: 6542 ld a0,16(sp) + 80012174: 3ea5b023 sd a0,992(a1) + 80012178: 4509 li a0,2 + self.state = ProcState::SLEEPING; + 8001217a: 02a107a3 sb a0,47(sp) + 8001217e: 40a58823 sb a0,1040(a1) + +0000000080012182 <.LBB11_7>: + + unsafe { + let mycpu = CPU_MANAGER.mycpu(); + 80012182: 00054517 auipc a0,0x54 + 80012186: fbe50513 addi a0,a0,-66 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001218a: 00000097 auipc ra,0x0 + 8001218e: 282080e7 jalr 642(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 80012192: 85aa mv a1,a0 + 80012194: e02e sd a1,0(sp) + 80012196: e8aa sd a0,80(sp) + 80012198: a009 j 8001219a <.LBB11_7+0x18> + // let cur_ctx = (&mut self.context); + + mycpu.sched(); + 8001219a: 6502 ld a0,0(sp) + 8001219c: 00000097 auipc ra,0x0 + 800121a0: 4e2080e7 jalr 1250(ra) # 8001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE> + 800121a4: a009 j 800121a6 <.LBB11_7+0x24> + 800121a6: 7502 ld a0,32(sp) + 800121a8: 6662 ld a2,24(sp) + 800121aa: 4581 li a1,0 + } + + self.channel = 0; + 800121ac: 3eb63023 sd a1,992(a2) + + drop(tasks_guard); + 800121b0: 0000c097 auipc ra,0xc + 800121b4: c38080e7 jalr -968(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 800121b8: a009 j 800121ba <.LBB11_7+0x38> + + } + 800121ba: 60e6 ld ra,88(sp) + 800121bc: 6125 addi sp,sp,96 + 800121be: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct5sleep17h6aeb0e2d2de445aaE: + +00000000800121c0 <_ZN6kernel7process7process11task_struct5sleep17h6aeb0e2d2de445aaE>: + pub fn sleep(&mut self, channel: usize, lock: SpinlockGuard<'_, T>) { + 800121c0: 711d addi sp,sp,-96 + 800121c2: ec86 sd ra,88(sp) + 800121c4: e432 sd a2,8(sp) + 800121c6: e82e sd a1,16(sp) + 800121c8: ec2a sd a0,24(sp) + 800121ca: f82a sd a0,48(sp) + 800121cc: fc2e sd a1,56(sp) + 800121ce: e0b2 sd a2,64(sp) + 800121d0: 6509 lui a0,0x2 + 800121d2: 0c85059b addiw a1,a0,200 + +00000000800121d6 <.LBB12_6>: + 800121d6: 00047517 auipc a0,0x47 + 800121da: 1fa50513 addi a0,a0,506 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 800121de: 952e add a0,a0,a1 + let tasks_guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 800121e0: fffff097 auipc ra,0xfffff + 800121e4: e62080e7 jalr -414(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 800121e8: 85aa mv a1,a0 + 800121ea: f02e sd a1,32(sp) + 800121ec: e4aa sd a0,72(sp) + 800121ee: a009 j 800121f0 <.LBB12_6+0x1a> + drop(lock); + 800121f0: 6522 ld a0,8(sp) + 800121f2: 0000c097 auipc ra,0xc + 800121f6: cf6080e7 jalr -778(ra) # 8001dee8 <_ZN4core3mem4drop17haa2d2dc72bd2e81bE> + 800121fa: a009 j 800121fc <.LBB12_6+0x26> + self.channel = channel; + 800121fc: 65e2 ld a1,24(sp) + 800121fe: 6542 ld a0,16(sp) + 80012200: 3ea5b023 sd a0,992(a1) + 80012204: 4509 li a0,2 + self.state = ProcState::SLEEPING; + 80012206: 02a107a3 sb a0,47(sp) + 8001220a: 40a58823 sb a0,1040(a1) + +000000008001220e <.LBB12_7>: + let mycpu = CPU_MANAGER.mycpu(); + 8001220e: 00054517 auipc a0,0x54 + 80012212: f3250513 addi a0,a0,-206 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80012216: 00000097 auipc ra,0x0 + 8001221a: 1f6080e7 jalr 502(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 8001221e: 85aa mv a1,a0 + 80012220: e02e sd a1,0(sp) + 80012222: e8aa sd a0,80(sp) + 80012224: a009 j 80012226 <.LBB12_7+0x18> + mycpu.sched(); + 80012226: 6502 ld a0,0(sp) + 80012228: 00000097 auipc ra,0x0 + 8001222c: 456080e7 jalr 1110(ra) # 8001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE> + 80012230: a009 j 80012232 <.LBB12_7+0x24> + 80012232: 7502 ld a0,32(sp) + 80012234: 6662 ld a2,24(sp) + 80012236: 4581 li a1,0 + self.channel = 0; + 80012238: 3eb63023 sd a1,992(a2) + drop(tasks_guard); + 8001223c: 0000c097 auipc ra,0xc + 80012240: bac080e7 jalr -1108(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80012244: a009 j 80012246 <.LBB12_7+0x38> + } + 80012246: 60e6 ld ra,88(sp) + 80012248: 6125 addi sp,sp,96 + 8001224a: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E: + +000000008001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E>: + pub fn sleep(&mut self, channel: usize, lock: SpinlockGuard<'_, T>) { + 8001224c: 711d addi sp,sp,-96 + 8001224e: ec86 sd ra,88(sp) + 80012250: e432 sd a2,8(sp) + 80012252: e82e sd a1,16(sp) + 80012254: ec2a sd a0,24(sp) + 80012256: f82a sd a0,48(sp) + 80012258: fc2e sd a1,56(sp) + 8001225a: e0b2 sd a2,64(sp) + 8001225c: 6509 lui a0,0x2 + 8001225e: 0c85059b addiw a1,a0,200 + +0000000080012262 <.LBB13_6>: + 80012262: 00047517 auipc a0,0x47 + 80012266: 16e50513 addi a0,a0,366 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8001226a: 952e add a0,a0,a1 + let tasks_guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 8001226c: fffff097 auipc ra,0xfffff + 80012270: dd6080e7 jalr -554(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80012274: 85aa mv a1,a0 + 80012276: f02e sd a1,32(sp) + 80012278: e4aa sd a0,72(sp) + 8001227a: a009 j 8001227c <.LBB13_6+0x1a> + drop(lock); + 8001227c: 6522 ld a0,8(sp) + 8001227e: 0000c097 auipc ra,0xc + 80012282: b6a080e7 jalr -1174(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80012286: a009 j 80012288 <.LBB13_6+0x26> + self.channel = channel; + 80012288: 65e2 ld a1,24(sp) + 8001228a: 6542 ld a0,16(sp) + 8001228c: 3ea5b023 sd a0,992(a1) + 80012290: 4509 li a0,2 + self.state = ProcState::SLEEPING; + 80012292: 02a107a3 sb a0,47(sp) + 80012296: 40a58823 sb a0,1040(a1) + +000000008001229a <.LBB13_7>: + let mycpu = CPU_MANAGER.mycpu(); + 8001229a: 00054517 auipc a0,0x54 + 8001229e: ea650513 addi a0,a0,-346 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 800122a2: 00000097 auipc ra,0x0 + 800122a6: 16a080e7 jalr 362(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 800122aa: 85aa mv a1,a0 + 800122ac: e02e sd a1,0(sp) + 800122ae: e8aa sd a0,80(sp) + 800122b0: a009 j 800122b2 <.LBB13_7+0x18> + mycpu.sched(); + 800122b2: 6502 ld a0,0(sp) + 800122b4: 00000097 auipc ra,0x0 + 800122b8: 3ca080e7 jalr 970(ra) # 8001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE> + 800122bc: a009 j 800122be <.LBB13_7+0x24> + 800122be: 7502 ld a0,32(sp) + 800122c0: 6662 ld a2,24(sp) + 800122c2: 4581 li a1,0 + self.channel = 0; + 800122c4: 3eb63023 sd a1,992(a2) + drop(tasks_guard); + 800122c8: 0000c097 auipc ra,0xc + 800122cc: b20080e7 jalr -1248(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 800122d0: a009 j 800122d2 <.LBB13_7+0x38> + } + 800122d2: 60e6 ld ra,88(sp) + 800122d4: 6125 addi sp,sp,96 + 800122d6: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct5sleep17hbec20003601a1a02E: + +00000000800122d8 <_ZN6kernel7process7process11task_struct5sleep17hbec20003601a1a02E>: + pub fn sleep(&mut self, channel: usize, lock: SpinlockGuard<'_, T>) { + 800122d8: 711d addi sp,sp,-96 + 800122da: ec86 sd ra,88(sp) + 800122dc: e432 sd a2,8(sp) + 800122de: e82e sd a1,16(sp) + 800122e0: ec2a sd a0,24(sp) + 800122e2: f82a sd a0,48(sp) + 800122e4: fc2e sd a1,56(sp) + 800122e6: e0b2 sd a2,64(sp) + 800122e8: 6509 lui a0,0x2 + 800122ea: 0c85059b addiw a1,a0,200 + +00000000800122ee <.LBB14_6>: + 800122ee: 00047517 auipc a0,0x47 + 800122f2: 0e250513 addi a0,a0,226 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 800122f6: 952e add a0,a0,a1 + let tasks_guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 800122f8: fffff097 auipc ra,0xfffff + 800122fc: d4a080e7 jalr -694(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80012300: 85aa mv a1,a0 + 80012302: f02e sd a1,32(sp) + 80012304: e4aa sd a0,72(sp) + 80012306: a009 j 80012308 <.LBB14_6+0x1a> + drop(lock); + 80012308: 6522 ld a0,8(sp) + 8001230a: 0000c097 auipc ra,0xc + 8001230e: bb2080e7 jalr -1102(ra) # 8001debc <_ZN4core3mem4drop17h96fc0e7c88170ba8E> + 80012312: a009 j 80012314 <.LBB14_6+0x26> + self.channel = channel; + 80012314: 65e2 ld a1,24(sp) + 80012316: 6542 ld a0,16(sp) + 80012318: 3ea5b023 sd a0,992(a1) + 8001231c: 4509 li a0,2 + self.state = ProcState::SLEEPING; + 8001231e: 02a107a3 sb a0,47(sp) + 80012322: 40a58823 sb a0,1040(a1) + +0000000080012326 <.LBB14_7>: + let mycpu = CPU_MANAGER.mycpu(); + 80012326: 00054517 auipc a0,0x54 + 8001232a: e1a50513 addi a0,a0,-486 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001232e: 00000097 auipc ra,0x0 + 80012332: 0de080e7 jalr 222(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 80012336: 85aa mv a1,a0 + 80012338: e02e sd a1,0(sp) + 8001233a: e8aa sd a0,80(sp) + 8001233c: a009 j 8001233e <.LBB14_7+0x18> + mycpu.sched(); + 8001233e: 6502 ld a0,0(sp) + 80012340: 00000097 auipc ra,0x0 + 80012344: 33e080e7 jalr 830(ra) # 8001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE> + 80012348: a009 j 8001234a <.LBB14_7+0x24> + 8001234a: 7502 ld a0,32(sp) + 8001234c: 6662 ld a2,24(sp) + 8001234e: 4581 li a1,0 + self.channel = 0; + 80012350: 3eb63023 sd a1,992(a2) + drop(tasks_guard); + 80012354: 0000c097 auipc ra,0xc + 80012358: a94080e7 jalr -1388(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001235c: a009 j 8001235e <.LBB14_7+0x38> + } + 8001235e: 60e6 ld ra,88(sp) + 80012360: 6125 addi sp,sp,96 + 80012362: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct5sleep17heedb33ddc1916294E: + +0000000080012364 <_ZN6kernel7process7process11task_struct5sleep17heedb33ddc1916294E>: + pub fn sleep(&mut self, channel: usize, lock: SpinlockGuard<'_, T>) { + 80012364: 711d addi sp,sp,-96 + 80012366: ec86 sd ra,88(sp) + 80012368: e432 sd a2,8(sp) + 8001236a: e82e sd a1,16(sp) + 8001236c: ec2a sd a0,24(sp) + 8001236e: f82a sd a0,48(sp) + 80012370: fc2e sd a1,56(sp) + 80012372: e0b2 sd a2,64(sp) + 80012374: 6509 lui a0,0x2 + 80012376: 0c85059b addiw a1,a0,200 + +000000008001237a <.LBB15_6>: + 8001237a: 00047517 auipc a0,0x47 + 8001237e: 05650513 addi a0,a0,86 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80012382: 952e add a0,a0,a1 + let tasks_guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 80012384: fffff097 auipc ra,0xfffff + 80012388: cbe080e7 jalr -834(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001238c: 85aa mv a1,a0 + 8001238e: f02e sd a1,32(sp) + 80012390: e4aa sd a0,72(sp) + 80012392: a009 j 80012394 <.LBB15_6+0x1a> + drop(lock); + 80012394: 6522 ld a0,8(sp) + 80012396: 0000c097 auipc ra,0xc + 8001239a: ba6080e7 jalr -1114(ra) # 8001df3c <_ZN4core3mem4drop17hf5d8d4b62719f1bfE> + 8001239e: a009 j 800123a0 <.LBB15_6+0x26> + self.channel = channel; + 800123a0: 65e2 ld a1,24(sp) + 800123a2: 6542 ld a0,16(sp) + 800123a4: 3ea5b023 sd a0,992(a1) + 800123a8: 4509 li a0,2 + self.state = ProcState::SLEEPING; + 800123aa: 02a107a3 sb a0,47(sp) + 800123ae: 40a58823 sb a0,1040(a1) + +00000000800123b2 <.LBB15_7>: + let mycpu = CPU_MANAGER.mycpu(); + 800123b2: 00054517 auipc a0,0x54 + 800123b6: d8e50513 addi a0,a0,-626 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 800123ba: 00000097 auipc ra,0x0 + 800123be: 052080e7 jalr 82(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 800123c2: 85aa mv a1,a0 + 800123c4: e02e sd a1,0(sp) + 800123c6: e8aa sd a0,80(sp) + 800123c8: a009 j 800123ca <.LBB15_7+0x18> + mycpu.sched(); + 800123ca: 6502 ld a0,0(sp) + 800123cc: 00000097 auipc ra,0x0 + 800123d0: 2b2080e7 jalr 690(ra) # 8001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE> + 800123d4: a009 j 800123d6 <.LBB15_7+0x24> + 800123d6: 7502 ld a0,32(sp) + 800123d8: 6662 ld a2,24(sp) + 800123da: 4581 li a1,0 + self.channel = 0; + 800123dc: 3eb63023 sd a1,992(a2) + drop(tasks_guard); + 800123e0: 0000c097 auipc ra,0xc + 800123e4: a08080e7 jalr -1528(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 800123e8: a009 j 800123ea <.LBB15_7+0x38> + } + 800123ea: 60e6 ld ra,88(sp) + 800123ec: 6125 addi sp,sp,96 + 800123ee: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E: + +00000000800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E>: + cpus: [CPU; NCPU] +} + +pub static mut CPU_MANAGER:CPUManager = CPUManager::new(); + +pub unsafe fn cpuid() -> usize { + 800123f0: 1101 addi sp,sp,-32 + let id = tp::read(); + 800123f2: ec06 sd ra,24(sp) + 800123f4: 0000d097 auipc ra,0xd + 800123f8: 2b6080e7 jalr 694(ra) # 8001f6aa <_ZN6kernel4arch5riscv8register2tp4read17h418649f5c8f5b927E> + 800123fc: 85aa mv a1,a0 + 800123fe: e42e sd a1,8(sp) + 80012400: e82a sd a0,16(sp) + 80012402: a009 j 80012404 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E+0x14> + id +} + 80012404: 6522 ld a0,8(sp) + 80012406: 60e2 ld ra,24(sp) + 80012408: 6105 addi sp,sp,32 + 8001240a: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E: + +000000008001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E>: + Self{ + cpus: array![_ => CPU::new(); NCPU], + } + } + + pub unsafe fn mycpu(&mut self) -> &mut CPU{ + 8001240c: 7179 addi sp,sp,-48 + 8001240e: f406 sd ra,40(sp) + 80012410: e42a sd a0,8(sp) + 80012412: ec2a sd a0,24(sp) + let cpu_id = cpuid(); + 80012414: 00000097 auipc ra,0x0 + 80012418: fdc080e7 jalr -36(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 8001241c: 85aa mv a1,a0 + 8001241e: e82e sd a1,16(sp) + 80012420: f02a sd a0,32(sp) + 80012422: a009 j 80012424 <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E+0x18> + 80012424: 65c2 ld a1,16(sp) + 80012426: 451d li a0,7 + &mut self.cpus[cpu_id] + 80012428: 00b56d63 bltu a0,a1,80012442 <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E+0x36> + 8001242c: a009 j 8001242e <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E+0x22> + 8001242e: 6522 ld a0,8(sp) + 80012430: 65c2 ld a1,16(sp) + 80012432: 08800613 li a2,136 + 80012436: 02c585b3 mul a1,a1,a2 + 8001243a: 952e add a0,a0,a1 + } + 8001243c: 70a2 ld ra,40(sp) + 8001243e: 6145 addi sp,sp,48 + 80012440: 8082 ret + &mut self.cpus[cpu_id] + 80012442: 6542 ld a0,16(sp) + +0000000080012444 <.LBB1_4>: + 80012444: 00017617 auipc a2,0x17 + 80012448: 7d460613 addi a2,a2,2004 # 80029c18 <.L__unnamed_1> + 8001244c: 45a1 li a1,8 + 8001244e: 00011097 auipc ra,0x11 + 80012452: d22080e7 jalr -734(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E: + +0000000080012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E>: + + pub unsafe fn myproc(&mut self) -> Option<&mut task_struct>{ + 80012458: 7139 addi sp,sp,-64 + 8001245a: fc06 sd ra,56(sp) + 8001245c: f02a sd a0,32(sp) + push_off(); + 8001245e: 00000097 auipc ra,0x0 + 80012462: 3fe080e7 jalr 1022(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 80012466: a009 j 80012468 <.LBB2_6> + +0000000080012468 <.LBB2_6>: + let c = CPU_MANAGER.mycpu(); + 80012468: 00054517 auipc a0,0x54 + 8001246c: cd850513 addi a0,a0,-808 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80012470: 00000097 auipc ra,0x0 + 80012474: f9c080e7 jalr -100(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 80012478: 85aa mv a1,a0 + 8001247a: e82e sd a1,16(sp) + 8001247c: f42a sd a0,40(sp) + 8001247e: a009 j 80012480 <.LBB2_6+0x18> + let p = &mut *c.process.unwrap().as_ptr(); + 80012480: 6542 ld a0,16(sp) + 80012482: 6108 ld a0,0(a0) + +0000000080012484 <.LBB2_7>: + 80012484: 00017597 auipc a1,0x17 + 80012488: 7ac58593 addi a1,a1,1964 # 80029c30 <.L__unnamed_2> + 8001248c: ffffd097 auipc ra,0xffffd + 80012490: 3a4080e7 jalr 932(ra) # 8000f830 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf17dde6d66464577E> + 80012494: e42a sd a0,8(sp) + 80012496: a009 j 80012498 <.LBB2_7+0x14> + 80012498: 6522 ld a0,8(sp) + 8001249a: ffffe097 auipc ra,0xffffe + 8001249e: 99c080e7 jalr -1636(ra) # 8000fe36 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h54223eceda981db8E> + 800124a2: e02a sd a0,0(sp) + 800124a4: a009 j 800124a6 <.LBB2_7+0x22> + 800124a6: 6502 ld a0,0(sp) + 800124a8: f82a sd a0,48(sp) + pop_off(); + 800124aa: 00000097 auipc ra,0x0 + 800124ae: 436080e7 jalr 1078(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 800124b2: a009 j 800124b4 <.LBB2_7+0x30> + Some(p) + 800124b4: 6502 ld a0,0(sp) + 800124b6: ec2a sd a0,24(sp) + } + 800124b8: 70e2 ld ra,56(sp) + 800124ba: 6121 addi sp,sp,64 + 800124bc: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu10CPUManager9scheduler17hecedd2e89c301e93E: + +00000000800124be <_ZN6kernel7process3cpu10CPUManager9scheduler17hecedd2e89c301e93E>: + /// Scheduler never returns. It loops, doing: + /// - choose a process to run. + /// - switch to start running that process. + /// - eventually that process transfers control + /// via switch back to the scheduler. + pub unsafe fn scheduler(&mut self){ + 800124be: 7119 addi sp,sp,-128 + 800124c0: fc86 sd ra,120(sp) + 800124c2: ecaa sd a0,88(sp) + extern "C" { + fn switch(old: *mut Context, new: *mut Context); + } + + let c = self.mycpu(); + 800124c4: 00000097 auipc ra,0x0 + 800124c8: f48080e7 jalr -184(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 800124cc: 85aa mv a1,a0 + 800124ce: fc2e sd a1,56(sp) + 800124d0: f0aa sd a0,96(sp) + 800124d2: a009 j 800124d4 <_ZN6kernel7process3cpu10CPUManager9scheduler17hecedd2e89c301e93E+0x16> + loop { + // Avoid deadlock by ensuring that devices can interrupt. + sstatus::intr_on(); + 800124d4: 0000d097 auipc ra,0xd + 800124d8: d1c080e7 jalr -740(ra) # 8001f1f0 <_ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E> + 800124dc: a009 j 800124de <_ZN6kernel7process3cpu10CPUManager9scheduler17hecedd2e89c301e93E+0x20> + 800124de: 6509 lui a0,0x2 + 800124e0: 0c85059b addiw a1,a0,200 + +00000000800124e4 <.LBB3_20>: + 800124e4: 00047517 auipc a0,0x47 + 800124e8: eec50513 addi a0,a0,-276 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 800124ec: 952e add a0,a0,a1 + + let guard = PROC_MANAGER.tasks_lock.acquire(); + 800124ee: fffff097 auipc ra,0xfffff + 800124f2: b54080e7 jalr -1196(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 800124f6: 85aa mv a1,a0 + 800124f8: f82e sd a1,48(sp) + 800124fa: f4aa sd a0,104(sp) + 800124fc: a009 j 800124fe <.LBB3_21> + +00000000800124fe <.LBB3_21>: + match PROC_MANAGER.seek_runnable() { + 800124fe: 00047517 auipc a0,0x47 + 80012502: ed250513 addi a0,a0,-302 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80012506: ffffc097 auipc ra,0xffffc + 8001250a: d3a080e7 jalr -710(ra) # 8000e240 <_ZN6kernel7process7manager11ProcManager13seek_runnable17h44209dc1d9cfdf6eE> + 8001250e: e0aa sd a0,64(sp) + 80012510: a009 j 80012512 <.LBB3_21+0x14> + Some(task) => { + 80012512: 6506 ld a0,64(sp) + 80012514: 00a035b3 snez a1,a0 + 80012518: 4581 li a1,0 + 8001251a: 00b50463 beq a0,a1,80012522 <.LBB3_21+0x24> + 8001251e: a009 j 80012520 <.LBB3_21+0x22> + 80012520: a019 j 80012526 <.LBB3_21+0x28> + match PROC_MANAGER.seek_runnable() { + 80012522: a05d j 800125c8 <.LBB3_23+0x28> + 80012524: 0000 unimp + Some(task) => { + 80012526: 6506 ld a0,64(sp) + 80012528: f02a sd a0,32(sp) + 8001252a: f8aa sd a0,112(sp) + // Switch to chosen process. It is the process's job + // to release it's lock and then reacquire it + // before jumping back to us. + c.set_proc(NonNull::new(task as *mut task_struct)); + 8001252c: ffffd097 auipc ra,0xffffd + 80012530: 786080e7 jalr 1926(ra) # 8000fcb2 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$3new17h88bc8711e49ee9baE> + 80012534: f42a sd a0,40(sp) + 80012536: a009 j 80012538 <.LBB3_21+0x3a> + 80012538: 75a2 ld a1,40(sp) + 8001253a: 7562 ld a0,56(sp) + 8001253c: 00000097 auipc ra,0x0 + 80012540: 12c080e7 jalr 300(ra) # 80012668 <_ZN6kernel7process3cpu3CPU8set_proc17hee92d5e504a0ddaeE> + 80012544: a009 j 80012546 <.LBB3_21+0x48> + 80012546: 7562 ld a0,56(sp) + 80012548: 7602 ld a2,32(sp) + 8001254a: 4591 li a1,4 + + task.state = ProcState::RUNNING; + 8001254c: 04b107a3 sb a1,79(sp) + 80012550: 40b60823 sb a1,1040(a2) + + switch( + c.get_context_mut(), + 80012554: 00000097 auipc ra,0x0 + 80012558: 120080e7 jalr 288(ra) # 80012674 <_ZN6kernel7process3cpu3CPU15get_context_mut17hcdad5fc27fe1585bE> + 8001255c: ec2a sd a0,24(sp) + 8001255e: a009 j 80012560 <.LBB3_21+0x62> + &mut task.context as *mut Context + 80012560: 6562 ld a0,24(sp) + 80012562: 7582 ld a1,32(sp) + 80012564: 02858593 addi a1,a1,40 + switch( + 80012568: fffef097 auipc ra,0xfffef + 8001256c: bba080e7 jalr -1094(ra) # 80001122 + 80012570: a009 j 80012572 <.LBB3_21+0x74> + ); + + if c.get_context_mut().is_null() { + 80012572: 7562 ld a0,56(sp) + 80012574: 00000097 auipc ra,0x0 + 80012578: 100080e7 jalr 256(ra) # 80012674 <_ZN6kernel7process3cpu3CPU15get_context_mut17hcdad5fc27fe1585bE> + 8001257c: e82a sd a0,16(sp) + 8001257e: a009 j 80012580 <.LBB3_21+0x82> + 80012580: 6542 ld a0,16(sp) + 80012582: 0000a097 auipc ra,0xa + 80012586: 926080e7 jalr -1754(ra) # 8001bea8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h3aa8018dbd05d49dE> + 8001258a: e42a sd a0,8(sp) + 8001258c: a009 j 8001258e <.LBB3_21+0x90> + 8001258e: 6522 ld a0,8(sp) + 80012590: 4581 li a1,0 + 80012592: 02b50263 beq a0,a1,800125b6 <.LBB3_23+0x16> + 80012596: a009 j 80012598 <.LBB3_22> + +0000000080012598 <.LBB3_22>: + panic!("context switch back with no process reference."); + 80012598: 00017517 auipc a0,0x17 + 8001259c: 6b050513 addi a0,a0,1712 # 80029c48 <.L__unnamed_3> + +00000000800125a0 <.LBB3_23>: + 800125a0: 00017617 auipc a2,0x17 + 800125a4: 6d860613 addi a2,a2,1752 # 80029c78 <.L__unnamed_4> + 800125a8: 02e00593 li a1,46 + 800125ac: 00011097 auipc ra,0x11 + 800125b0: b98080e7 jalr -1128(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800125b4: 0000 unimp + 800125b6: 7562 ld a0,56(sp) + 800125b8: 4581 li a1,0 + } + // Process is done running for now. + // It should have changed it's process state before coming back. + c.set_proc(None); + 800125ba: e8ae sd a1,80(sp) + 800125bc: 00000097 auipc ra,0x0 + 800125c0: 0ac080e7 jalr 172(ra) # 80012668 <_ZN6kernel7process3cpu3CPU8set_proc17hee92d5e504a0ddaeE> + 800125c4: a009 j 800125c6 <.LBB3_23+0x26> + match PROC_MANAGER.seek_runnable() { + 800125c6: a009 j 800125c8 <.LBB3_23+0x28> + + } + + None => {} + } + drop(guard); + 800125c8: 7542 ld a0,48(sp) + 800125ca: 0000c097 auipc ra,0xc + 800125ce: 81e080e7 jalr -2018(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 800125d2: a009 j 800125d4 <.LBB3_23+0x34> + loop { + 800125d4: b701 j 800124d4 <_ZN6kernel7process3cpu10CPUManager9scheduler17hecedd2e89c301e93E+0x16> + +Disassembly of section .text._ZN6kernel7process3cpu10CPUManager8alloc_fd17h6273585a0cf04a04E: + +00000000800125d6 <_ZN6kernel7process3cpu10CPUManager8alloc_fd17h6273585a0cf04a04E>: + } + } + + pub fn alloc_fd(&mut self, file:&VFile) -> Result { + 800125d6: 7135 addi sp,sp,-160 + 800125d8: ed06 sd ra,152(sp) + 800125da: ec32 sd a2,24(sp) + 800125dc: f02e sd a1,32(sp) + 800125de: 85aa mv a1,a0 + 800125e0: 7502 ld a0,32(sp) + 800125e2: f42e sd a1,40(sp) + 800125e4: f4aa sd a0,104(sp) + 800125e6: f8b2 sd a2,112(sp) + let proc = unsafe{ self.myproc().ok_or("Fail to find current process")? }; + 800125e8: 00000097 auipc ra,0x0 + 800125ec: e70080e7 jalr -400(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 800125f0: f82a sd a0,48(sp) + 800125f2: a009 j 800125f4 <_ZN6kernel7process3cpu10CPUManager8alloc_fd17h6273585a0cf04a04E+0x1e> + 800125f4: 75c2 ld a1,48(sp) + +00000000800125f6 <.LBB4_10>: + 800125f6: 00017617 auipc a2,0x17 + 800125fa: 69a60613 addi a2,a2,1690 # 80029c90 <.L__unnamed_5> + 800125fe: 0888 addi a0,sp,80 + 80012600: 46f1 li a3,28 + 80012602: ffffd097 auipc ra,0xffffd + 80012606: af4080e7 jalr -1292(ra) # 8000f0f6 <_ZN4core6option15Option$LT$T$GT$5ok_or17h4f98d014309ae6ecE> + 8001260a: a009 j 8001260c <.LBB4_10+0x16> + 8001260c: 1828 addi a0,sp,56 + 8001260e: 088c addi a1,sp,80 + 80012610: ffffb097 auipc ra,0xffffb + 80012614: 4be080e7 jalr 1214(ra) # 8000dace <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h2625785248aabe7bE> + 80012618: a009 j 8001261a <.LBB4_10+0x24> + 8001261a: 7562 ld a0,56(sp) + 8001261c: 4581 li a1,0 + 8001261e: 00b50463 beq a0,a1,80012626 <.LBB4_10+0x30> + 80012622: a009 j 80012624 <.LBB4_10+0x2e> + 80012624: a821 j 8001263c <.LBB4_10+0x46> + 80012626: 6662 ld a2,24(sp) + 80012628: 7522 ld a0,40(sp) + 8001262a: 6586 ld a1,64(sp) + 8001262c: e52e sd a1,136(sp) + 8001262e: e92e sd a1,144(sp) + proc.fd_alloc(file) + 80012630: 00005097 auipc ra,0x5 + 80012634: b50080e7 jalr -1200(ra) # 80017180 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE> + 80012638: a02d j 80012662 <.LBB4_10+0x6c> + let proc = unsafe{ self.myproc().ok_or("Fail to find current process")? }; + 8001263a: 0000 unimp + 8001263c: 6506 ld a0,64(sp) + 8001263e: 65a6 ld a1,72(sp) + 80012640: fcaa sd a0,120(sp) + 80012642: e12e sd a1,128(sp) + 80012644: ffffa097 auipc ra,0xffffa + 80012648: d42080e7 jalr -702(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001264c: e42a sd a0,8(sp) + 8001264e: e82e sd a1,16(sp) + 80012650: a009 j 80012652 <.LBB4_10+0x5c> + 80012652: 6642 ld a2,16(sp) + 80012654: 65a2 ld a1,8(sp) + 80012656: 7522 ld a0,40(sp) + 80012658: ffffb097 auipc ra,0xffffb + 8001265c: 36e080e7 jalr 878(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 80012660: a009 j 80012662 <.LBB4_10+0x6c> + } + 80012662: 60ea ld ra,152(sp) + 80012664: 610d addi sp,sp,160 + 80012666: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu3CPU8set_proc17hee92d5e504a0ddaeE: + +0000000080012668 <_ZN6kernel7process3cpu3CPU8set_proc17hee92d5e504a0ddaeE>: + noff:0, + intena:0 + } + } + + pub fn set_proc(&mut self, proc:Option>){ + 80012668: 1141 addi sp,sp,-16 + 8001266a: e02a sd a0,0(sp) + 8001266c: e42e sd a1,8(sp) + self.process = proc; + 8001266e: e10c sd a1,0(a0) + } + 80012670: 0141 addi sp,sp,16 + 80012672: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu3CPU15get_context_mut17hcdad5fc27fe1585bE: + +0000000080012674 <_ZN6kernel7process3cpu3CPU15get_context_mut17hcdad5fc27fe1585bE>: + + pub fn get_context_mut(&mut self) -> *mut Context{ + 80012674: 1141 addi sp,sp,-16 + 80012676: e42a sd a0,8(sp) + &mut self.context as *mut Context + 80012678: 0521 addi a0,a0,8 + } + 8001267a: 0141 addi sp,sp,16 + 8001267c: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE: + +000000008001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE>: + /// intena because intena is a property of this + /// kernel thread, not this CPU. It should + /// be proc->intena and proc->noff, but that would + /// break in the few places where a lock is held but + /// there's no process. + pub unsafe fn sched<'a>(&mut self) + 8001267e: 7155 addi sp,sp,-208 + 80012680: e586 sd ra,200(sp) + 80012682: e4aa sd a0,72(sp) + 80012684: f12a sd a0,160(sp) + +0000000080012686 <.LBB7_18>: + { + extern "C" { + fn switch(old: *mut Context, new: *mut Context); + } + + let curtask = CPU_MANAGER.myproc().unwrap(); + 80012686: 00054517 auipc a0,0x54 + 8001268a: aba50513 addi a0,a0,-1350 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001268e: 00000097 auipc ra,0x0 + 80012692: dca080e7 jalr -566(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80012696: e8aa sd a0,80(sp) + 80012698: a009 j 8001269a <.LBB7_18+0x14> + 8001269a: 6546 ld a0,80(sp) + +000000008001269c <.LBB7_19>: + 8001269c: 00017597 auipc a1,0x17 + 800126a0: 61458593 addi a1,a1,1556 # 80029cb0 <.L__unnamed_6> + 800126a4: ffffd097 auipc ra,0xffffd + 800126a8: 0ec080e7 jalr 236(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 800126ac: 85aa mv a1,a0 + 800126ae: e0ae sd a1,64(sp) + 800126b0: f52a sd a0,168(sp) + 800126b2: a009 j 800126b4 <.LBB7_19+0x18> + let cur_ctx = &mut curtask.context as *mut Context ; + 800126b4: 6506 ld a0,64(sp) + 800126b6: 02850513 addi a0,a0,40 + 800126ba: f82a sd a0,48(sp) + 800126bc: f92a sd a0,176(sp) + 800126be: 6509 lui a0,0x2 + 800126c0: 0c85059b addiw a1,a0,200 + +00000000800126c4 <.LBB7_20>: + 800126c4: 00047517 auipc a0,0x47 + 800126c8: d0c50513 addi a0,a0,-756 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 800126cc: 952e add a0,a0,a1 + + if !PROC_MANAGER.tasks_lock.holding() { + 800126ce: fffff097 auipc ra,0xfffff + 800126d2: 1f2080e7 jalr 498(ra) # 800118c0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7holding17h22290a831051ae28E> + 800126d6: fc2a sd a0,56(sp) + 800126d8: a009 j 800126da <.LBB7_20+0x16> + 800126da: 7562 ld a0,56(sp) + 800126dc: e105 bnez a0,800126fc <.LBB7_22+0x14> + 800126de: a009 j 800126e0 <.LBB7_21> + +00000000800126e0 <.LBB7_21>: + panic!("sched: not holding proc's lock"); + 800126e0: 00017517 auipc a0,0x17 + 800126e4: 5e850513 addi a0,a0,1512 # 80029cc8 <.L__unnamed_7> + +00000000800126e8 <.LBB7_22>: + 800126e8: 00017617 auipc a2,0x17 + 800126ec: 60060613 addi a2,a2,1536 # 80029ce8 <.L__unnamed_8> + 800126f0: 45f9 li a1,30 + 800126f2: 00011097 auipc ra,0x11 + 800126f6: a52080e7 jalr -1454(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800126fa: 0000 unimp + } + // only holding self.proc.lock + if self.noff != 1 { + 800126fc: 6526 ld a0,72(sp) + 800126fe: 7d28 ld a0,120(a0) + 80012700: 4585 li a1,1 + 80012702: 02b50363 beq a0,a1,80012728 <.LBB7_23+0x16> + 80012706: a009 j 80012708 <.LBB7_22+0x20> + println!("self noff is {}", self.noff); + 80012708: 6526 ld a0,72(sp) + 8001270a: 07850513 addi a0,a0,120 + 8001270e: ed2a sd a0,152(sp) + 80012710: fd2a sd a0,184(sp) + +0000000080012712 <.LBB7_23>: + 80012712: 00013597 auipc a1,0x13 + 80012716: 18e58593 addi a1,a1,398 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001271a: 0000e097 auipc ra,0xe + 8001271e: e54080e7 jalr -428(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80012722: f02a sd a0,32(sp) + 80012724: f42e sd a1,40(sp) + 80012726: a831 j 80012742 <.LBB7_24+0x14> + panic!("sched: cpu hold mutliple locks"); + } + + // proc is not running. + if curtask.state == ProcState::RUNNING { + 80012728: 6506 ld a0,64(sp) + 8001272a: 41050513 addi a0,a0,1040 + +000000008001272e <.LBB7_24>: + 8001272e: 00017597 auipc a1,0x17 + 80012732: 63a58593 addi a1,a1,1594 # 80029d68 <.L__unnamed_9> + 80012736: 00005097 auipc ra,0x5 + 8001273a: 0f4080e7 jalr 244(ra) # 8001782a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE> + 8001273e: ec2a sd a0,24(sp) + 80012740: a0b1 j 8001278c <.LBB7_27+0x14> + println!("self noff is {}", self.noff); + 80012742: 7522 ld a0,40(sp) + 80012744: 7582 ld a1,32(sp) + 80012746: e52e sd a1,136(sp) + 80012748: e92a sd a0,144(sp) + +000000008001274a <.LBB7_25>: + 8001274a: 00017597 auipc a1,0x17 + 8001274e: 5c658593 addi a1,a1,1478 # 80029d10 <.L__unnamed_10> + 80012752: 08a8 addi a0,sp,88 + 80012754: 4609 li a2,2 + 80012756: 0134 addi a3,sp,136 + 80012758: 4705 li a4,1 + 8001275a: ffff3097 auipc ra,0xffff3 + 8001275e: e30080e7 jalr -464(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80012762: a009 j 80012764 <.LBB7_25+0x1a> + 80012764: 08a8 addi a0,sp,88 + 80012766: 0000c097 auipc ra,0xc + 8001276a: 492080e7 jalr 1170(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001276e: a009 j 80012770 <.LBB7_26> + +0000000080012770 <.LBB7_26>: + panic!("sched: cpu hold mutliple locks"); + 80012770: 00017517 auipc a0,0x17 + 80012774: 5c050513 addi a0,a0,1472 # 80029d30 <.L__unnamed_11> + +0000000080012778 <.LBB7_27>: + 80012778: 00017617 auipc a2,0x17 + 8001277c: 5d860613 addi a2,a2,1496 # 80029d50 <.L__unnamed_12> + 80012780: 45f9 li a1,30 + 80012782: 00011097 auipc ra,0x11 + 80012786: 9c2080e7 jalr -1598(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001278a: 0000 unimp + 8001278c: 6562 ld a0,24(sp) + 8001278e: 4581 li a1,0 + if curtask.state == ProcState::RUNNING { + 80012790: 02b50163 beq a0,a1,800127b2 <.LBB7_29+0x14> + 80012794: a009 j 80012796 <.LBB7_28> + +0000000080012796 <.LBB7_28>: + panic!("sched: proc is running"); + 80012796: 00017517 auipc a0,0x17 + 8001279a: 5d350513 addi a0,a0,1491 # 80029d69 <.L__unnamed_13> + +000000008001279e <.LBB7_29>: + 8001279e: 00017617 auipc a2,0x17 + 800127a2: 5e260613 addi a2,a2,1506 # 80029d80 <.L__unnamed_14> + 800127a6: 45d9 li a1,22 + 800127a8: 00011097 auipc ra,0x11 + 800127ac: 99c080e7 jalr -1636(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800127b0: 0000 unimp + } + + // should not be interruptible + if sstatus::intr_get() { + 800127b2: 0000d097 auipc ra,0xd + 800127b6: a88080e7 jalr -1400(ra) # 8001f23a <_ZN6kernel4arch5riscv8register7sstatus8intr_get17h3e12e0f19cb31fd5E> + 800127ba: e82a sd a0,16(sp) + 800127bc: a009 j 800127be <.LBB7_29+0x20> + 800127be: 6542 ld a0,16(sp) + 800127c0: 4581 li a1,0 + 800127c2: 02b50163 beq a0,a1,800127e4 <.LBB7_31+0x14> + 800127c6: a009 j 800127c8 <.LBB7_30> + +00000000800127c8 <.LBB7_30>: + panic!("sched: interruptible"); + 800127c8: 00017517 auipc a0,0x17 + 800127cc: 5d050513 addi a0,a0,1488 # 80029d98 <.L__unnamed_15> + +00000000800127d0 <.LBB7_31>: + 800127d0: 00017617 auipc a2,0x17 + 800127d4: 5e060613 addi a2,a2,1504 # 80029db0 <.L__unnamed_16> + 800127d8: 45d1 li a1,20 + 800127da: 00011097 auipc ra,0x11 + 800127de: 96a080e7 jalr -1686(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800127e2: 0000 unimp + } + + let intena = self.intena; + 800127e4: 7542 ld a0,48(sp) + 800127e6: 65a6 ld a1,72(sp) + 800127e8: 61d0 ld a2,128(a1) + 800127ea: e432 sd a2,8(sp) + 800127ec: e1b2 sd a2,192(sp) + // println!("[Kernel] switch"); + // println!("[Kernel] old_context: 0x{:x}, new_context: 0x{:x}", ctx as usize, &mut self.context as *mut Context as usize); + switch( + cur_ctx, + &mut self.context as *mut Context + 800127ee: 05a1 addi a1,a1,8 + switch( + 800127f0: fffef097 auipc ra,0xfffef + 800127f4: 932080e7 jalr -1742(ra) # 80001122 + 800127f8: a009 j 800127fa <.LBB7_31+0x2a> + ); + + + self.intena = intena; + 800127fa: 6522 ld a0,8(sp) + 800127fc: 65a6 ld a1,72(sp) + 800127fe: e1c8 sd a0,128(a1) + } + 80012800: 60ae ld ra,200(sp) + 80012802: 6169 addi sp,sp,208 + 80012804: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu3CPU14try_yield_proc17hdb175aaf084d8a03E: + +0000000080012806 <_ZN6kernel7process3cpu3CPU14try_yield_proc17hdb175aaf084d8a03E>: + + /// Yield the holding process if any and it's RUNNING. + /// Directly return if none. + pub fn try_yield_proc(&mut self) { + 80012806: 7139 addi sp,sp,-64 + 80012808: fc06 sd ra,56(sp) + 8001280a: e82a sd a0,16(sp) + 8001280c: f82a sd a0,48(sp) + + if !self.process.is_none() { + 8001280e: ffffd097 auipc ra,0xffffd + 80012812: 076080e7 jalr 118(ra) # 8000f884 <_ZN4core6option15Option$LT$T$GT$7is_none17hb2038865e515c3d7E> + 80012816: ec2a sd a0,24(sp) + 80012818: a009 j 8001281a <_ZN6kernel7process3cpu3CPU14try_yield_proc17hdb175aaf084d8a03E+0x14> + 8001281a: 6562 ld a0,24(sp) + 8001281c: ed11 bnez a0,80012838 <.LBB8_8+0x14> + 8001281e: a009 j 80012820 <_ZN6kernel7process3cpu3CPU14try_yield_proc17hdb175aaf084d8a03E+0x1a> + // drop(guard); + // unsafe { self.process.unwrap().as_mut().yielding() } + // } else { + // drop(guard); + // } + unsafe { self.process.unwrap().as_mut().yielding(); } + 80012820: 6542 ld a0,16(sp) + 80012822: 6108 ld a0,0(a0) + +0000000080012824 <.LBB8_8>: + 80012824: 00017597 auipc a1,0x17 + 80012828: 5a458593 addi a1,a1,1444 # 80029dc8 <.L__unnamed_17> + 8001282c: ffffd097 auipc ra,0xffffd + 80012830: 004080e7 jalr 4(ra) # 8000f830 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf17dde6d66464577E> + 80012834: f42a sd a0,40(sp) + 80012836: a011 j 8001283a <.LBB8_8+0x16> + if !self.process.is_none() { + 80012838: a839 j 80012856 <.LBB8_8+0x32> + 8001283a: 1028 addi a0,sp,40 + unsafe { self.process.unwrap().as_mut().yielding(); } + 8001283c: ffffd097 auipc ra,0xffffd + 80012840: 5d6080e7 jalr 1494(ra) # 8000fe12 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_mut17hdd17b08112763412E> + 80012844: e42a sd a0,8(sp) + 80012846: a009 j 80012848 <.LBB8_8+0x24> + 80012848: 6522 ld a0,8(sp) + 8001284a: 00005097 auipc ra,0x5 + 8001284e: 8c6080e7 jalr -1850(ra) # 80017110 <_ZN6kernel7process7process11task_struct8yielding17ha01fb6496bdc4c3eE> + 80012852: a009 j 80012854 <.LBB8_8+0x30> + if !self.process.is_none() { + 80012854: a009 j 80012856 <.LBB8_8+0x32> + } + } + 80012856: 70e2 ld ra,56(sp) + 80012858: 6121 addi sp,sp,64 + 8001285a: 8082 ret + +Disassembly of section .text._ZN6kernel7process3cpu8push_off17h0acd4baa93104745E: + +000000008001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E>: + +/// push_off/pop_off are like intr_off()/intr_on() except that they are matched: +/// it takes two pop_off()s to undo two push_off()s. Also, if interrupts +/// are initially off, then push_off, pop_off leaves them off. + +pub fn push_off(){ + 8001285c: 7179 addi sp,sp,-48 + let old_enable; + unsafe{ + old_enable = sstatus::intr_get(); + 8001285e: f406 sd ra,40(sp) + 80012860: 0000d097 auipc ra,0xd + 80012864: 9da080e7 jalr -1574(ra) # 8001f23a <_ZN6kernel4arch5riscv8register7sstatus8intr_get17h3e12e0f19cb31fd5E> + 80012868: e82a sd a0,16(sp) + 8001286a: a009 j 8001286c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E+0x10> + 8001286c: 6542 ld a0,16(sp) + 8001286e: 00a10fa3 sb a0,31(sp) + sstatus::intr_off(); + 80012872: 0000d097 auipc ra,0xd + 80012876: 9a4080e7 jalr -1628(ra) # 8001f216 <_ZN6kernel4arch5riscv8register7sstatus8intr_off17hed3f5b43b53e6556E> + 8001287a: a009 j 8001287c <.LBB9_9> + +000000008001287c <.LBB9_9>: + } + let my_cpu = unsafe{ CPU_MANAGER.mycpu() }; + 8001287c: 00054517 auipc a0,0x54 + 80012880: 8c450513 addi a0,a0,-1852 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80012884: 00000097 auipc ra,0x0 + 80012888: b88080e7 jalr -1144(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 8001288c: e42a sd a0,8(sp) + 8001288e: a009 j 80012890 <.LBB9_9+0x14> + 80012890: 6522 ld a0,8(sp) + 80012892: f02a sd a0,32(sp) + if my_cpu.noff == 0 { + 80012894: 7d28 ld a0,120(a0) + 80012896: 4581 li a1,0 + 80012898: 00b51763 bne a0,a1,800128a6 <.LBB9_9+0x2a> + 8001289c: a009 j 8001289e <.LBB9_9+0x22> + my_cpu.intena = old_enable as usize; + 8001289e: 6542 ld a0,16(sp) + 800128a0: 65a2 ld a1,8(sp) + 800128a2: e1c8 sd a0,128(a1) + if my_cpu.noff == 0 { + 800128a4: a011 j 800128a8 <.LBB9_9+0x2c> + 800128a6: a009 j 800128a8 <.LBB9_9+0x2c> + } + + my_cpu.noff += 1; + 800128a8: 6522 ld a0,8(sp) + 800128aa: 7d2c ld a1,120(a0) + 800128ac: 00158513 addi a0,a1,1 + 800128b0: e02a sd a0,0(sp) + 800128b2: 00b56963 bltu a0,a1,800128c4 <.LBB9_10> + 800128b6: a009 j 800128b8 <.LBB9_9+0x3c> + 800128b8: 6502 ld a0,0(sp) + 800128ba: 65a2 ld a1,8(sp) + 800128bc: fda8 sd a0,120(a1) +} + 800128be: 70a2 ld ra,40(sp) + 800128c0: 6145 addi sp,sp,48 + 800128c2: 8082 ret + +00000000800128c4 <.LBB9_10>: + my_cpu.noff += 1; + 800128c4: 00017517 auipc a0,0x17 + 800128c8: 53c50513 addi a0,a0,1340 # 80029e00 + +00000000800128cc <.LBB9_11>: + 800128cc: 00017617 auipc a2,0x17 + 800128d0: 51460613 addi a2,a2,1300 # 80029de0 <.L__unnamed_18> + 800128d4: 45f1 li a1,28 + 800128d6: 00011097 auipc ra,0x11 + 800128da: 86e080e7 jalr -1938(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE: + +00000000800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE>: + + +pub fn pop_off() { + 800128e0: 715d addi sp,sp,-80 + if unsafe{ sstatus::intr_get() } { + 800128e2: e486 sd ra,72(sp) + 800128e4: 0000d097 auipc ra,0xd + 800128e8: 956080e7 jalr -1706(ra) # 8001f23a <_ZN6kernel4arch5riscv8register7sstatus8intr_get17h3e12e0f19cb31fd5E> + 800128ec: ec2a sd a0,24(sp) + 800128ee: a009 j 800128f0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE+0x10> + 800128f0: 6562 ld a0,24(sp) + 800128f2: 4581 li a1,0 + 800128f4: 02b50163 beq a0,a1,80012916 <.LBB10_21> + 800128f8: a009 j 800128fa <.LBB10_19> + +00000000800128fa <.LBB10_19>: + panic!("pop_off(): interruptable"); + 800128fa: 00017517 auipc a0,0x17 + 800128fe: 52250513 addi a0,a0,1314 # 80029e1c <.L__unnamed_19> + +0000000080012902 <.LBB10_20>: + 80012902: 00017617 auipc a2,0x17 + 80012906: 53660613 addi a2,a2,1334 # 80029e38 <.L__unnamed_20> + 8001290a: 45e1 li a1,24 + 8001290c: 00011097 auipc ra,0x11 + 80012910: 838080e7 jalr -1992(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080012916 <.LBB10_21>: + } + let c = unsafe { CPU_MANAGER.mycpu() }; + 80012916: 00054517 auipc a0,0x54 + 8001291a: 82a50513 addi a0,a0,-2006 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001291e: 00000097 auipc ra,0x0 + 80012922: aee080e7 jalr -1298(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 80012926: e82a sd a0,16(sp) + 80012928: a009 j 8001292a <.LBB10_21+0x14> + 8001292a: 6542 ld a0,16(sp) + 8001292c: e0aa sd a0,64(sp) + if c.noff.checked_sub(1).is_none() { + 8001292e: 7d28 ld a0,120(a0) + 80012930: 4585 li a1,1 + 80012932: 0000c097 auipc ra,0xc + 80012936: 5e0080e7 jalr 1504(ra) # 8001ef12 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E> + 8001293a: f42a sd a0,40(sp) + 8001293c: f82e sd a1,48(sp) + 8001293e: a009 j 80012940 <.LBB10_21+0x2a> + 80012940: 1028 addi a0,sp,40 + 80012942: ffffd097 auipc ra,0xffffd + 80012946: f60080e7 jalr -160(ra) # 8000f8a2 <_ZN4core6option15Option$LT$T$GT$7is_none17hbfc07de6cbdc4f1cE> + 8001294a: e42a sd a0,8(sp) + 8001294c: a009 j 8001294e <.LBB10_21+0x38> + 8001294e: 6522 ld a0,8(sp) + 80012950: 4581 li a1,0 + 80012952: 02b50163 beq a0,a1,80012974 <.LBB10_23+0x14> + 80012956: a009 j 80012958 <.LBB10_22> + +0000000080012958 <.LBB10_22>: + panic!("pop_off(): count not match"); + 80012958: 00017517 auipc a0,0x17 + 8001295c: 4f850513 addi a0,a0,1272 # 80029e50 <.L__unnamed_21> + +0000000080012960 <.LBB10_23>: + 80012960: 00017617 auipc a2,0x17 + 80012964: 51060613 addi a2,a2,1296 # 80029e70 <.L__unnamed_22> + 80012968: 45e9 li a1,26 + 8001296a: 00010097 auipc ra,0x10 + 8001296e: 7da080e7 jalr 2010(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80012972: 0000 unimp + } + c.noff -= 1; + 80012974: 6542 ld a0,16(sp) + 80012976: 7d28 ld a0,120(a0) + 80012978: fff50593 addi a1,a0,-1 + 8001297c: e02e sd a1,0(sp) + 8001297e: 04b56963 bltu a0,a1,800129d0 <.LBB10_24> + 80012982: a009 j 80012984 <.LBB10_23+0x24> + 80012984: 6502 ld a0,0(sp) + 80012986: 65c2 ld a1,16(sp) + 80012988: fda8 sd a0,120(a1) + 8001298a: 4581 li a1,0 + if c.noff == 0 && c.intena != 0 { + 8001298c: 00b50b63 beq a0,a1,800129a2 <.LBB10_23+0x42> + 80012990: a029 j 8001299a <.LBB10_23+0x3a> + 80012992: 4505 li a0,1 + 80012994: 02a10fa3 sb a0,63(sp) + 80012998: a819 j 800129ae <.LBB10_23+0x4e> + 8001299a: 4501 li a0,0 + 8001299c: 02a10fa3 sb a0,63(sp) + 800129a0: a039 j 800129ae <.LBB10_23+0x4e> + 800129a2: 6542 ld a0,16(sp) + 800129a4: 6148 ld a0,128(a0) + 800129a6: 4581 li a1,0 + 800129a8: feb509e3 beq a0,a1,8001299a <.LBB10_23+0x3a> + 800129ac: b7dd j 80012992 <.LBB10_23+0x32> + 800129ae: 03f14503 lbu a0,63(sp) + 800129b2: 8905 andi a0,a0,1 + 800129b4: 4581 li a1,0 + 800129b6: 00b50863 beq a0,a1,800129c6 <.LBB10_23+0x66> + 800129ba: a009 j 800129bc <.LBB10_23+0x5c> + unsafe{ sstatus::intr_on() }; + 800129bc: 0000d097 auipc ra,0xd + 800129c0: 834080e7 jalr -1996(ra) # 8001f1f0 <_ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E> + 800129c4: a011 j 800129c8 <.LBB10_23+0x68> + if c.noff == 0 && c.intena != 0 { + 800129c6: a011 j 800129ca <.LBB10_23+0x6a> + 800129c8: a009 j 800129ca <.LBB10_23+0x6a> + } +} + 800129ca: 60a6 ld ra,72(sp) + 800129cc: 6161 addi sp,sp,80 + 800129ce: 8082 ret + +00000000800129d0 <.LBB10_24>: + c.noff -= 1; + 800129d0: 00017517 auipc a0,0x17 + 800129d4: 4d050513 addi a0,a0,1232 # 80029ea0 + +00000000800129d8 <.LBB10_25>: + 800129d8: 00017617 auipc a2,0x17 + 800129dc: 4b060613 addi a2,a2,1200 # 80029e88 <.L__unnamed_23> + 800129e0: 02100593 li a1,33 + 800129e4: 00010097 auipc ra,0x10 + 800129e8: 760080e7 jalr 1888(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold17hc2ce6cb165c0b4a8E: + +00000000800129ee <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold17hc2ce6cb165c0b4a8E>: + + self.iter.try_fold(init, enumerate(&mut self.count, fold)) + } + + #[inline] + fn fold(self, init: Acc, fold: Fold) -> Acc + 800129ee: 7179 addi sp,sp,-48 + count += 1; + acc + } + } + + self.iter.fold(init, enumerate(self.count, fold)) + 800129f0: f406 sd ra,40(sp) + 800129f2: 610c ld a1,0(a0) + 800129f4: e02e sd a1,0(sp) + 800129f6: 650c ld a1,8(a0) + 800129f8: e42e sd a1,8(sp) + 800129fa: 6908 ld a0,16(a0) + 800129fc: 00000097 auipc ra,0x0 + 80012a00: 022080e7 jalr 34(ra) # 80012a1e <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate17h31eee2683e3bacc6E> + 80012a04: e82a sd a0,16(sp) + 80012a06: a009 j 80012a08 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold17hc2ce6cb165c0b4a8E+0x1a> + 80012a08: 6642 ld a2,16(sp) + 80012a0a: 65a2 ld a1,8(sp) + 80012a0c: 6502 ld a0,0(sp) + 80012a0e: ffff9097 auipc ra,0xffff9 + 80012a12: 98a080e7 jalr -1654(ra) # 8000b398 <_ZN4core4iter6traits8iterator8Iterator4fold17hc68e62fe16e6d649E> + 80012a16: a009 j 80012a18 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold17hc2ce6cb165c0b4a8E+0x2a> + } + 80012a18: 70a2 ld ra,40(sp) + 80012a1a: 6145 addi sp,sp,48 + 80012a1c: 8082 ret + +Disassembly of section .text._ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate17h31eee2683e3bacc6E: + +0000000080012a1e <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate17h31eee2683e3bacc6E>: + fn enumerate( + 80012a1e: 1101 addi sp,sp,-32 + 80012a20: e82a sd a0,16(sp) + move |acc, item| { + 80012a22: e42a sd a0,8(sp) + } + 80012a24: 6105 addi sp,sp,32 + 80012a26: 8082 ret + +Disassembly of section .text._ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate28_$u7b$$u7b$closure$u7d$$u7d$17hd0c93bb900581135E: + +0000000080012a28 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate28_$u7b$$u7b$closure$u7d$$u7d$17hd0c93bb900581135E>: + move |acc, item| { + 80012a28: 711d addi sp,sp,-96 + 80012a2a: ec86 sd ra,88(sp) + 80012a2c: 862e mv a2,a1 + 80012a2e: e82a sd a0,16(sp) + 80012a30: e0aa sd a0,64(sp) + 80012a32: e8b2 sd a2,80(sp) + let acc = fold(acc, (count, item)); + 80012a34: 610c ld a1,0(a0) + 80012a36: f42e sd a1,40(sp) + 80012a38: f832 sd a2,48(sp) + 80012a3a: ec2e sd a1,24(sp) + 80012a3c: f032 sd a2,32(sp) + 80012a3e: 0000b097 auipc ra,0xb + 80012a42: 90c080e7 jalr -1780(ra) # 8001d34a <_ZN4core4iter6traits8iterator8Iterator8for_each4call28_$u7b$$u7b$closure$u7d$$u7d$17h486761cc57705d97E> + 80012a46: a009 j 80012a48 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate28_$u7b$$u7b$closure$u7d$$u7d$17hd0c93bb900581135E+0x20> + count += 1; + 80012a48: 6542 ld a0,16(sp) + 80012a4a: 610c ld a1,0(a0) + 80012a4c: 00158513 addi a0,a1,1 + 80012a50: e42a sd a0,8(sp) + 80012a52: 00b56963 bltu a0,a1,80012a64 <.LBB2_4> + 80012a56: a009 j 80012a58 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold9enumerate28_$u7b$$u7b$closure$u7d$$u7d$17hd0c93bb900581135E+0x30> + 80012a58: 6522 ld a0,8(sp) + 80012a5a: 65c2 ld a1,16(sp) + 80012a5c: e188 sd a0,0(a1) + } + 80012a5e: 60e6 ld ra,88(sp) + 80012a60: 6125 addi sp,sp,96 + 80012a62: 8082 ret + +0000000080012a64 <.LBB2_4>: + count += 1; + 80012a64: 00017517 auipc a0,0x17 + 80012a68: 50c50513 addi a0,a0,1292 # 80029f70 + +0000000080012a6c <.LBB2_5>: + 80012a6c: 00017617 auipc a2,0x17 + 80012a70: 4e460613 addi a2,a2,1252 # 80029f50 <.L__unnamed_1> + 80012a74: 45f1 li a1,28 + 80012a76: 00010097 auipc ra,0x10 + 80012a7a: 6ce080e7 jalr 1742(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E: + +0000000080012a80 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E>: + fn next(&mut self) -> Option<(usize, ::Item)> { + 80012a80: 7119 addi sp,sp,-128 + 80012a82: fc86 sd ra,120(sp) + 80012a84: ec2a sd a0,24(sp) + 80012a86: e8aa sd a0,80(sp) + let a = self.iter.next()?; + 80012a88: ffff9097 auipc ra,0xffff9 + 80012a8c: 1ee080e7 jalr 494(ra) # 8000bc76 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcaf94d529f5eaff1E> + 80012a90: f02a sd a0,32(sp) + 80012a92: a009 j 80012a94 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x14> + 80012a94: 7502 ld a0,32(sp) + 80012a96: ffffd097 auipc ra,0xffffd + 80012a9a: 0dc080e7 jalr 220(ra) # 8000fb72 <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb32580bc026e46beE> + 80012a9e: fc2a sd a0,56(sp) + 80012aa0: a009 j 80012aa2 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x22> + 80012aa2: 7562 ld a0,56(sp) + 80012aa4: 00153593 seqz a1,a0 + 80012aa8: 4581 li a1,0 + 80012aaa: 00b51463 bne a0,a1,80012ab2 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x32> + 80012aae: a009 j 80012ab0 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x30> + 80012ab0: a00d j 80012ad2 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x52> + 80012ab2: 6562 ld a0,24(sp) + 80012ab4: 75e2 ld a1,56(sp) + 80012ab6: e02e sd a1,0(sp) + 80012ab8: f0ae sd a1,96(sp) + 80012aba: f4ae sd a1,104(sp) + let i = self.count; + 80012abc: 690c ld a1,16(a0) + 80012abe: e42e sd a1,8(sp) + 80012ac0: f8ae sd a1,112(sp) + self.count += 1; + 80012ac2: 690c ld a1,16(a0) + 80012ac4: 00158513 addi a0,a1,1 + 80012ac8: e82a sd a0,16(sp) + 80012aca: 04b56063 bltu a0,a1,80012b0a <.LBB3_12> + 80012ace: a839 j 80012aec <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x6c> + let a = self.iter.next()?; + 80012ad0: 0000 unimp + 80012ad2: ffffd097 auipc ra,0xffffd + 80012ad6: f00080e7 jalr -256(ra) # 8000f9d2 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h8871efd663dd0baaE> + 80012ada: a009 j 80012adc <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x5c> + 80012adc: ffffd097 auipc ra,0xffffd + 80012ae0: 08a080e7 jalr 138(ra) # 8000fb66 <_ZN69_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h62e9788c2879be16E> + 80012ae4: f42a sd a0,40(sp) + 80012ae6: f82e sd a1,48(sp) + 80012ae8: a009 j 80012aea <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x6a> + } + 80012aea: a819 j 80012b00 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x80> + self.count += 1; + 80012aec: 6502 ld a0,0(sp) + 80012aee: 65a2 ld a1,8(sp) + 80012af0: 6642 ld a2,16(sp) + 80012af2: 66e2 ld a3,24(sp) + 80012af4: ea90 sd a2,16(a3) + Some((i, a)) + 80012af6: e0ae sd a1,64(sp) + 80012af8: e4aa sd a0,72(sp) + 80012afa: f42e sd a1,40(sp) + 80012afc: f82a sd a0,48(sp) + } + 80012afe: a009 j 80012b00 <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha88021fcbf612639E+0x80> + 80012b00: 7522 ld a0,40(sp) + 80012b02: 75c2 ld a1,48(sp) + 80012b04: 70e6 ld ra,120(sp) + 80012b06: 6109 addi sp,sp,128 + 80012b08: 8082 ret + +0000000080012b0a <.LBB3_12>: + self.count += 1; + 80012b0a: 00017517 auipc a0,0x17 + 80012b0e: 46650513 addi a0,a0,1126 # 80029f70 + +0000000080012b12 <.LBB3_13>: + 80012b12: 00017617 auipc a2,0x17 + 80012b16: 47e60613 addi a2,a2,1150 # 80029f90 <.L__unnamed_2> + 80012b1a: 45f1 li a1,28 + 80012b1c: 00010097 auipc ra,0x10 + 80012b20: 628080e7 jalr 1576(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator8for_each17hc49183b8c223967eE: + +0000000080012b26 <_ZN4core4iter6traits8iterator8Iterator8for_each17hc49183b8c223967eE>: + fn for_each(self, f: F) + 80012b26: 7179 addi sp,sp,-48 + self.fold((), call(f)); + 80012b28: f406 sd ra,40(sp) + 80012b2a: 690c ld a1,16(a0) + 80012b2c: ec2e sd a1,24(sp) + 80012b2e: 650c ld a1,8(a0) + 80012b30: e82e sd a1,16(sp) + 80012b32: 6108 ld a0,0(a0) + 80012b34: e42a sd a0,8(sp) + 80012b36: 0000b097 auipc ra,0xb + 80012b3a: 80e080e7 jalr -2034(ra) # 8001d344 <_ZN4core4iter6traits8iterator8Iterator8for_each4call17hfc6c60365ed1f66bE> + 80012b3e: a009 j 80012b40 <_ZN4core4iter6traits8iterator8Iterator8for_each17hc49183b8c223967eE+0x1a> + 80012b40: 0028 addi a0,sp,8 + 80012b42: 00000097 auipc ra,0x0 + 80012b46: eac080e7 jalr -340(ra) # 800129ee <_ZN110_$LT$core..iter..adapters..enumerate..Enumerate$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4fold17hc2ce6cb165c0b4a8E> + 80012b4a: a009 j 80012b4c <_ZN4core4iter6traits8iterator8Iterator8for_each17hc49183b8c223967eE+0x26> + } + 80012b4c: 70a2 ld ra,40(sp) + 80012b4e: 6145 addi sp,sp,48 + 80012b50: 8082 ret + +Disassembly of section .text._ZN4core4iter8adapters9enumerate18Enumerate$LT$I$GT$3new17h24261d7743f82d90E: + +0000000080012b52 <_ZN4core4iter8adapters9enumerate18Enumerate$LT$I$GT$3new17h24261d7743f82d90E>: + pub(in crate::iter) fn new(iter: I) -> Enumerate { + 80012b52: 1101 addi sp,sp,-32 + 80012b54: e42e sd a1,8(sp) + 80012b56: 85aa mv a1,a0 + 80012b58: 6522 ld a0,8(sp) + 80012b5a: e82a sd a0,16(sp) + 80012b5c: ec32 sd a2,24(sp) + Enumerate { iter, count: 0 } + 80012b5e: e188 sd a0,0(a1) + 80012b60: e590 sd a2,8(a1) + 80012b62: 4501 li a0,0 + 80012b64: e988 sd a0,16(a1) + } + 80012b66: 6105 addi sp,sp,32 + 80012b68: 8082 ret + +Disassembly of section .text._ZN4core4iter8adapters9enumerate18Enumerate$LT$I$GT$3new17h6d37c7662d298f80E: + +0000000080012b6a <_ZN4core4iter8adapters9enumerate18Enumerate$LT$I$GT$3new17h6d37c7662d298f80E>: + pub(in crate::iter) fn new(iter: I) -> Enumerate { + 80012b6a: 1101 addi sp,sp,-32 + 80012b6c: e42e sd a1,8(sp) + 80012b6e: 85aa mv a1,a0 + 80012b70: 6522 ld a0,8(sp) + 80012b72: e82a sd a0,16(sp) + 80012b74: ec32 sd a2,24(sp) + Enumerate { iter, count: 0 } + 80012b76: e188 sd a0,0(a1) + 80012b78: e590 sd a2,8(a1) + 80012b7a: 4501 li a0,0 + 80012b7c: e988 sd a0,16(a1) + } + 80012b7e: 6105 addi sp,sp,32 + 80012b80: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h04cf438071e1a0e6E: + +0000000080012b82 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h04cf438071e1a0e6E>: + fn into_iter(self) -> I { + 80012b82: 1141 addi sp,sp,-16 + 80012b84: e42e sd a1,8(sp) + 80012b86: 85aa mv a1,a0 + self + 80012b88: 6522 ld a0,8(sp) + 80012b8a: 6910 ld a2,16(a0) + 80012b8c: e990 sd a2,16(a1) + 80012b8e: 6510 ld a2,8(a0) + 80012b90: e590 sd a2,8(a1) + 80012b92: 6108 ld a0,0(a0) + 80012b94: e188 sd a0,0(a1) + } + 80012b96: 0141 addi sp,sp,16 + 80012b98: 8082 ret + +Disassembly of section .text._ZN6kernel7process7context7Context10write_zero17hffd0e59e9c54d2c3E: + +0000000080012b9a <_ZN6kernel7process7context7Context10write_zero17hffd0e59e9c54d2c3E>: + + pub fn ra(&self) -> usize { + self.ra + } + + pub fn write_zero(&mut self) { + 80012b9a: 1141 addi sp,sp,-16 + 80012b9c: 85aa mv a1,a0 + 80012b9e: e42e sd a1,8(sp) + 80012ba0: 4501 li a0,0 + self.ra = 0; + 80012ba2: e188 sd a0,0(a1) + self.sp = 0; + 80012ba4: e588 sd a0,8(a1) + self.s0 = 0; + 80012ba6: e988 sd a0,16(a1) + self.s1 = 0; + 80012ba8: ed88 sd a0,24(a1) + self.s2 = 0; + 80012baa: f188 sd a0,32(a1) + self.s3 = 0; + 80012bac: f588 sd a0,40(a1) + self.s4 = 0; + 80012bae: f988 sd a0,48(a1) + self.s5 = 0; + 80012bb0: fd88 sd a0,56(a1) + self.s6 = 0; + 80012bb2: e1a8 sd a0,64(a1) + self.s7 = 0; + 80012bb4: e5a8 sd a0,72(a1) + self.s8 = 0; + 80012bb6: e9a8 sd a0,80(a1) + self.s9 = 0; + 80012bb8: eda8 sd a0,88(a1) + self.s10 = 0; + 80012bba: f1a8 sd a0,96(a1) + self.s11 = 0; + 80012bbc: f5a8 sd a0,104(a1) + } + 80012bbe: 0141 addi sp,sp,16 + 80012bc0: 8082 ret + +Disassembly of section .text._ZN6kernel7process7context7Context8write_ra17h453112740fa52877E: + +0000000080012bc2 <_ZN6kernel7process7context7Context8write_ra17h453112740fa52877E>: + + pub fn write_ra(&mut self, ra: usize) { + 80012bc2: 1141 addi sp,sp,-16 + 80012bc4: e02a sd a0,0(sp) + 80012bc6: e42e sd a1,8(sp) + self.ra = ra; + 80012bc8: e10c sd a1,0(a0) + } + 80012bca: 0141 addi sp,sp,16 + 80012bcc: 8082 ret + +Disassembly of section .text._ZN6kernel7process7context7Context8write_sp17h0ed724aed1960a6aE: + +0000000080012bce <_ZN6kernel7process7context7Context8write_sp17h0ed724aed1960a6aE>: + + pub fn write_sp(&mut self, sp: usize) { + 80012bce: 1141 addi sp,sp,-16 + 80012bd0: e02a sd a0,0(sp) + 80012bd2: e42e sd a1,8(sp) + self.sp = sp; + 80012bd4: e50c sd a1,8(a0) + } + 80012bd6: 0141 addi sp,sp,16 + 80012bd8: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E: + +0000000080012bda <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E>: +use crate::trap::TICKS_LOCK; +use super::*; + +impl Syscall<'_> { + pub fn sys_fork(&mut self) -> SysResult { + 80012bda: 711d addi sp,sp,-96 + 80012bdc: ec86 sd ra,88(sp) + 80012bde: f82a sd a0,48(sp) + + let child_proc = self.process.fork().ok_or(())?; + 80012be0: 6108 ld a0,0(a0) + 80012be2: 00004097 auipc ra,0x4 + 80012be6: 67c080e7 jalr 1660(ra) # 8001725e <_ZN6kernel7process7process11task_struct4fork17hbc50404a2563983cE> + 80012bea: e82a sd a0,16(sp) + 80012bec: a009 j 80012bee <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x14> + 80012bee: 6542 ld a0,16(sp) + 80012bf0: ffffc097 auipc ra,0xffffc + 80012bf4: 434080e7 jalr 1076(ra) # 8000f024 <_ZN4core6option15Option$LT$T$GT$5ok_or17h13b9e8b5fbd6a973E> + 80012bf8: e42a sd a0,8(sp) + 80012bfa: a009 j 80012bfc <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x22> + 80012bfc: 6522 ld a0,8(sp) + 80012bfe: ffffb097 auipc ra,0xffffb + 80012c02: f4e080e7 jalr -178(ra) # 8000db4c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hba461275fa0bc2dbE> + 80012c06: f42a sd a0,40(sp) + 80012c08: a009 j 80012c0a <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x30> + 80012c0a: 7522 ld a0,40(sp) + 80012c0c: 00153593 seqz a1,a0 + 80012c10: 4581 li a1,0 + 80012c12: 00b51463 bne a0,a1,80012c1a <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x40> + 80012c16: a009 j 80012c18 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x3e> + 80012c18: a821 j 80012c30 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x56> + 80012c1a: 7522 ld a0,40(sp) + 80012c1c: e0aa sd a0,64(sp) + 80012c1e: e4aa sd a0,72(sp) + + let pid = child_proc.pid; + 80012c20: 3f053503 ld a0,1008(a0) + 80012c24: e8aa sd a0,80(sp) + + Ok(pid) + 80012c26: f02a sd a0,32(sp) + 80012c28: 4501 li a0,0 + 80012c2a: ec2a sd a0,24(sp) + } + 80012c2c: a831 j 80012c48 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x6e> + let child_proc = self.process.fork().ok_or(())?; + 80012c2e: 0000 unimp + 80012c30: ffff9097 auipc ra,0xffff9 + 80012c34: 750080e7 jalr 1872(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80012c38: a009 j 80012c3a <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x60> + 80012c3a: ffffb097 auipc ra,0xffffb + 80012c3e: dc8080e7 jalr -568(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 80012c42: ec2a sd a0,24(sp) + 80012c44: f02e sd a1,32(sp) + 80012c46: a009 j 80012c48 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E+0x6e> + } + 80012c48: 6562 ld a0,24(sp) + 80012c4a: 7582 ld a1,32(sp) + 80012c4c: 60e6 ld ra,88(sp) + 80012c4e: 6125 addi sp,sp,96 + 80012c50: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_clone17h33021d255812765cE: + +0000000080012c52 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_clone17h33021d255812765cE>: + + pub fn sys_clone(&mut self) -> SysResult { + 80012c52: 716d addi sp,sp,-272 + 80012c54: e606 sd ra,264(sp) + 80012c56: e4aa sd a0,72(sp) + 80012c58: e5aa sd a0,200(sp) + 80012c5a: 4581 li a1,0 + let func = self.arg(0); + 80012c5c: 00003097 auipc ra,0x3 + 80012c60: 21e080e7 jalr 542(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80012c64: 85aa mv a1,a0 + 80012c66: e8ae sd a1,80(sp) + 80012c68: e9aa sd a0,208(sp) + 80012c6a: a009 j 80012c6c <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_clone17h33021d255812765cE+0x1a> + + let ustack = self.arg(1); + 80012c6c: 6526 ld a0,72(sp) + 80012c6e: 4585 li a1,1 + 80012c70: 00003097 auipc ra,0x3 + 80012c74: 20a080e7 jalr 522(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80012c78: 85aa mv a1,a0 + 80012c7a: e0ae sd a1,64(sp) + 80012c7c: edaa sd a0,216(sp) + 80012c7e: a009 j 80012c80 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_clone17h33021d255812765cE+0x2e> + + let ret = self.process.threadclone(func, ustack); + 80012c80: 6606 ld a2,64(sp) + 80012c82: 65c6 ld a1,80(sp) + 80012c84: 6526 ld a0,72(sp) + 80012c86: 6108 ld a0,0(a0) + 80012c88: 00004097 auipc ra,0x4 + 80012c8c: 7f8080e7 jalr 2040(ra) # 80017480 <_ZN6kernel7process6thread55_$LT$impl$u20$kernel..process..process..task_struct$GT$11threadclone17ha25e98bd1351ab4dE> + 80012c90: 85aa mv a1,a0 + 80012c92: fc2e sd a1,56(sp) + 80012c94: f1aa sd a0,224(sp) + 80012c96: a009 j 80012c98 <.LBB1_10> + +0000000080012c98 <.LBB1_10>: + + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80012c98: 00053517 auipc a0,0x53 + 80012c9c: 4a850513 addi a0,a0,1192 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80012ca0: fffff097 auipc ra,0xfffff + 80012ca4: 7b8080e7 jalr 1976(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80012ca8: f82a sd a0,48(sp) + 80012caa: a009 j 80012cac <.LBB1_10+0x14> + 80012cac: 7542 ld a0,48(sp) + +0000000080012cae <.LBB1_11>: + 80012cae: 00017597 auipc a1,0x17 + 80012cb2: 72258593 addi a1,a1,1826 # 8002a3d0 <.L__unnamed_1> + 80012cb6: ffffd097 auipc ra,0xffffd + 80012cba: ada080e7 jalr -1318(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80012cbe: f42a sd a0,40(sp) + 80012cc0: a009 j 80012cc2 <.LBB1_11+0x14> + 80012cc2: 7522 ld a0,40(sp) + 80012cc4: f5aa sd a0,232(sp) + let tf = unsafe { &mut *task.trapframe } ; + 80012cc6: 710c ld a1,32(a0) + 80012cc8: f9ae sd a1,240(sp) + println!("In sys_clone, pid {} epc {}", task.pid, tf.epc); + 80012cca: 3f050513 addi a0,a0,1008 + 80012cce: 05e1 addi a1,a1,24 + 80012cd0: e82e sd a1,16(sp) + 80012cd2: fd2a sd a0,184(sp) + 80012cd4: e1ae sd a1,192(sp) + 80012cd6: fdaa sd a0,248(sp) + 80012cd8: e22e sd a1,256(sp) + +0000000080012cda <.LBB1_12>: + 80012cda: 00013597 auipc a1,0x13 + 80012cde: bc658593 addi a1,a1,-1082 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80012ce2: 0000e097 auipc ra,0xe + 80012ce6: 88c080e7 jalr -1908(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80012cea: ec2a sd a0,24(sp) + 80012cec: f02e sd a1,32(sp) + 80012cee: a009 j 80012cf0 <.LBB1_12+0x16> + 80012cf0: 6542 ld a0,16(sp) + +0000000080012cf2 <.LBB1_13>: + 80012cf2: 00013597 auipc a1,0x13 + 80012cf6: bae58593 addi a1,a1,-1106 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80012cfa: 0000e097 auipc ra,0xe + 80012cfe: 874080e7 jalr -1932(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80012d02: e02a sd a0,0(sp) + 80012d04: e42e sd a1,8(sp) + 80012d06: a009 j 80012d08 <.LBB1_13+0x16> + 80012d08: 6522 ld a0,8(sp) + 80012d0a: 6582 ld a1,0(sp) + 80012d0c: 7602 ld a2,32(sp) + 80012d0e: 66e2 ld a3,24(sp) + 80012d10: ed36 sd a3,152(sp) + 80012d12: f132 sd a2,160(sp) + 80012d14: f52e sd a1,168(sp) + 80012d16: f92a sd a0,176(sp) + +0000000080012d18 <.LBB1_14>: + 80012d18: 00017597 auipc a1,0x17 + 80012d1c: 6e858593 addi a1,a1,1768 # 8002a400 <.L__unnamed_2> + 80012d20: 10a8 addi a0,sp,104 + 80012d22: 460d li a2,3 + 80012d24: 0934 addi a3,sp,152 + 80012d26: 4709 li a4,2 + 80012d28: ffff3097 auipc ra,0xffff3 + 80012d2c: 862080e7 jalr -1950(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80012d30: a009 j 80012d32 <.LBB1_14+0x1a> + 80012d32: 10a8 addi a0,sp,104 + 80012d34: 0000c097 auipc ra,0xc + 80012d38: ec4080e7 jalr -316(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80012d3c: a009 j 80012d3e <.LBB1_14+0x26> + Ok(ret) + 80012d3e: 75e2 ld a1,56(sp) + 80012d40: f0ae sd a1,96(sp) + 80012d42: 4501 li a0,0 + 80012d44: ecaa sd a0,88(sp) + } + 80012d46: 60b2 ld ra,264(sp) + 80012d48: 6151 addi sp,sp,272 + 80012d4a: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exit17hae1a7a01ef6f0180E: + +0000000080012d4c <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exit17hae1a7a01ef6f0180E>: + + pub fn sys_exit(&self) -> SysResult { + 80012d4c: 1101 addi sp,sp,-32 + 80012d4e: ec06 sd ra,24(sp) + 80012d50: e42a sd a0,8(sp) + 80012d52: 4581 li a1,0 + let status = self.arg(0); + 80012d54: 00003097 auipc ra,0x3 + 80012d58: 126080e7 jalr 294(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80012d5c: 85aa mv a1,a0 + 80012d5e: e02e sd a1,0(sp) + 80012d60: e82a sd a0,16(sp) + 80012d62: a009 j 80012d64 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exit17hae1a7a01ef6f0180E+0x18> + unsafe { + PROC_MANAGER.exit(status) + 80012d64: 6582 ld a1,0(sp) + +0000000080012d66 <.LBB2_2>: + 80012d66: 00046517 auipc a0,0x46 + 80012d6a: 66a50513 addi a0,a0,1642 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80012d6e: ffffb097 auipc ra,0xffffb + 80012d72: 61c080e7 jalr 1564(ra) # 8000e38a <_ZN6kernel7process7manager11ProcManager4exit17hfa49a8445fc58f81E> + ... + +Disassembly of section .text._ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_wait17h7b4815682cca4a8dE: + +0000000080012d78 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_wait17h7b4815682cca4a8dE>: + } + } + + pub fn sys_wait(&self) -> SysResult { + 80012d78: 715d addi sp,sp,-80 + 80012d7a: e486 sd ra,72(sp) + 80012d7c: f82a sd a0,48(sp) + 80012d7e: 4581 li a1,0 + let addr = self.arg(0); + 80012d80: 00003097 auipc ra,0x3 + 80012d84: 0fa080e7 jalr 250(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80012d88: 85aa mv a1,a0 + 80012d8a: e42e sd a1,8(sp) + 80012d8c: fc2a sd a0,56(sp) + 80012d8e: a009 j 80012d90 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_wait17h7b4815682cca4a8dE+0x18> + match unsafe { + PROC_MANAGER.wait(addr) + 80012d90: 65a2 ld a1,8(sp) + +0000000080012d92 <.LBB3_8>: + 80012d92: 00046517 auipc a0,0x46 + 80012d96: 63e50513 addi a0,a0,1598 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80012d9a: ffffc097 auipc ra,0xffffc + 80012d9e: 84e080e7 jalr -1970(ra) # 8000e5e8 <_ZN6kernel7process7manager11ProcManager4wait17h7c4c80095cf78f04E> + 80012da2: f02a sd a0,32(sp) + 80012da4: f42e sd a1,40(sp) + 80012da6: a009 j 80012da8 <.LBB3_8+0x16> + } { + Some(pid) => { + 80012da8: 7502 ld a0,32(sp) + 80012daa: 4581 li a1,0 + 80012dac: 00b50463 beq a0,a1,80012db4 <.LBB3_8+0x22> + 80012db0: a009 j 80012db2 <.LBB3_8+0x20> + 80012db2: a029 j 80012dbc <.LBB3_8+0x2a> + 80012db4: 4505 li a0,1 + Ok(pid) + }, + + None => { + Err(()) + 80012db6: e82a sd a0,16(sp) + match unsafe { + 80012db8: a801 j 80012dc8 <.LBB3_8+0x36> + 80012dba: 0000 unimp + Some(pid) => { + 80012dbc: 7522 ld a0,40(sp) + 80012dbe: e0aa sd a0,64(sp) + Ok(pid) + 80012dc0: ec2a sd a0,24(sp) + 80012dc2: 4501 li a0,0 + 80012dc4: e82a sd a0,16(sp) + match unsafe { + 80012dc6: a009 j 80012dc8 <.LBB3_8+0x36> + } + } + } + 80012dc8: 6542 ld a0,16(sp) + 80012dca: 65e2 ld a1,24(sp) + 80012dcc: 60a6 ld ra,72(sp) + 80012dce: 6161 addi sp,sp,80 + 80012dd0: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_join17hcdda9ca2f2e537bbE: + +0000000080012dd2 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_join17hcdda9ca2f2e537bbE>: + + pub fn sys_join(&self) -> SysResult { + 80012dd2: 715d addi sp,sp,-80 + 80012dd4: e486 sd ra,72(sp) + 80012dd6: f82a sd a0,48(sp) + 80012dd8: 4581 li a1,0 + let ustack_addr = self.arg(0); + 80012dda: 00003097 auipc ra,0x3 + 80012dde: 0a0080e7 jalr 160(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80012de2: 85aa mv a1,a0 + 80012de4: e42e sd a1,8(sp) + 80012de6: fc2a sd a0,56(sp) + 80012de8: a009 j 80012dea <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_join17hcdda9ca2f2e537bbE+0x18> + match unsafe { + PROC_MANAGER.join(ustack_addr) + 80012dea: 65a2 ld a1,8(sp) + +0000000080012dec <.LBB4_8>: + 80012dec: 00046517 auipc a0,0x46 + 80012df0: 5e450513 addi a0,a0,1508 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80012df4: ffffc097 auipc ra,0xffffc + 80012df8: a88080e7 jalr -1400(ra) # 8000e87c <_ZN6kernel7process7manager11ProcManager4join17h0acabc4ce5dd65bdE> + 80012dfc: f02a sd a0,32(sp) + 80012dfe: f42e sd a1,40(sp) + 80012e00: a009 j 80012e02 <.LBB4_8+0x16> + } { + Some(ret) => { + 80012e02: 7502 ld a0,32(sp) + 80012e04: 4581 li a1,0 + 80012e06: 00b50463 beq a0,a1,80012e0e <.LBB4_8+0x22> + 80012e0a: a009 j 80012e0c <.LBB4_8+0x20> + 80012e0c: a029 j 80012e16 <.LBB4_8+0x2a> + 80012e0e: 4505 li a0,1 + Ok(ret) + }, + + None => { + Err(()) + 80012e10: e82a sd a0,16(sp) + match unsafe { + 80012e12: a801 j 80012e22 <.LBB4_8+0x36> + 80012e14: 0000 unimp + Some(ret) => { + 80012e16: 7522 ld a0,40(sp) + 80012e18: e0aa sd a0,64(sp) + Ok(ret) + 80012e1a: ec2a sd a0,24(sp) + 80012e1c: 4501 li a0,0 + 80012e1e: e82a sd a0,16(sp) + match unsafe { + 80012e20: a009 j 80012e22 <.LBB4_8+0x36> + } + } + } + 80012e22: 6542 ld a0,16(sp) + 80012e24: 65e2 ld a1,24(sp) + 80012e26: 60a6 ld ra,72(sp) + 80012e28: 6161 addi sp,sp,80 + 80012e2a: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_sbrk17h620cfc1119b978cdE: + +0000000080012e2c <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_sbrk17h620cfc1119b978cdE>: + + Ok(pid) + } + + + pub fn sys_sbrk(&mut self) -> SysResult { + 80012e2c: 7155 addi sp,sp,-208 + 80012e2e: e586 sd ra,200(sp) + 80012e30: ec2a sd a0,24(sp) + 80012e32: f12a sd a0,160(sp) + 80012e34: 4581 li a1,0 + let size = self.arg(0); + 80012e36: 00003097 auipc ra,0x3 + 80012e3a: 044080e7 jalr 68(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80012e3e: 85aa mv a1,a0 + 80012e40: f02e sd a1,32(sp) + 80012e42: f52a sd a0,168(sp) + 80012e44: a009 j 80012e46 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_sbrk17h620cfc1119b978cdE+0x1a> + + let task = unsafe{ &*self.process }; + 80012e46: 7582 ld a1,32(sp) + 80012e48: 6562 ld a0,24(sp) + 80012e4a: 6110 ld a2,0(a0) + 80012e4c: f932 sd a2,176(sp) + let addr = task.size; + 80012e4e: 6a10 ld a2,16(a2) + 80012e50: e832 sd a2,16(sp) + 80012e52: fd32 sd a2,184(sp) + + match self.process.grow_proc(size as isize) { + 80012e54: 6108 ld a0,0(a0) + 80012e56: 00004097 auipc ra,0x4 + 80012e5a: 1c4080e7 jalr 452(ra) # 8001701a <_ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E> + 80012e5e: fc2a sd a0,56(sp) + 80012e60: e0ae sd a1,64(sp) + 80012e62: a009 j 80012e64 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_sbrk17h620cfc1119b978cdE+0x38> + Ok(()) => { + 80012e64: 7562 ld a0,56(sp) + 80012e66: 00a035b3 snez a1,a0 + 80012e6a: 4581 li a1,0 + 80012e6c: 02b50663 beq a0,a1,80012e98 <.LBB5_9+0x18> + 80012e70: a009 j 80012e72 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_sbrk17h620cfc1119b978cdE+0x46> + return Ok(addr) + } + + Err(err) => { + 80012e72: 75e2 ld a1,56(sp) + 80012e74: 6506 ld a0,64(sp) + 80012e76: e4ae sd a1,72(sp) + 80012e78: e8aa sd a0,80(sp) + 80012e7a: 00a8 addi a0,sp,72 + panic!("err: {:?}", err); + 80012e7c: ed2a sd a0,152(sp) + 80012e7e: e1aa sd a0,192(sp) + +0000000080012e80 <.LBB5_9>: + 80012e80: 0000c597 auipc a1,0xc + 80012e84: 59e58593 addi a1,a1,1438 # 8001f41e <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h8e05789f6aa15028E> + 80012e88: 0000c097 auipc ra,0xc + 80012e8c: 5fc080e7 jalr 1532(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80012e90: e02a sd a0,0(sp) + 80012e92: e42e sd a1,8(sp) + 80012e94: a809 j 80012ea6 <.LBB5_9+0x26> + match self.process.grow_proc(size as isize) { + 80012e96: 0000 unimp + return Ok(addr) + 80012e98: 65c2 ld a1,16(sp) + 80012e9a: f82e sd a1,48(sp) + 80012e9c: 4501 li a0,0 + 80012e9e: f42a sd a0,40(sp) + } + } + } + 80012ea0: 60ae ld ra,200(sp) + 80012ea2: 6169 addi sp,sp,208 + 80012ea4: 8082 ret + panic!("err: {:?}", err); + 80012ea6: 6522 ld a0,8(sp) + 80012ea8: 6582 ld a1,0(sp) + 80012eaa: e52e sd a1,136(sp) + 80012eac: e92a sd a0,144(sp) + +0000000080012eae <.LBB5_10>: + 80012eae: 00017597 auipc a1,0x17 + 80012eb2: 58a58593 addi a1,a1,1418 # 8002a438 <.L__unnamed_3> + 80012eb6: 08a8 addi a0,sp,88 + 80012eb8: 0134 addi a3,sp,136 + 80012eba: 4705 li a4,1 + 80012ebc: 863a mv a2,a4 + 80012ebe: ffff2097 auipc ra,0xffff2 + 80012ec2: 6cc080e7 jalr 1740(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80012ec6: a009 j 80012ec8 <.LBB5_11> + +0000000080012ec8 <.LBB5_11>: + 80012ec8: 00017597 auipc a1,0x17 + 80012ecc: 58058593 addi a1,a1,1408 # 8002a448 <.L__unnamed_4> + 80012ed0: 08a8 addi a0,sp,88 + 80012ed2: 00010097 auipc ra,0x10 + 80012ed6: 2de080e7 jalr 734(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$7sys_dup17h638e7e7819355743E: + +0000000080012edc <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$7sys_dup17h638e7e7819355743E>: + pub fn sys_dup(&self) -> SysResult { + 80012edc: 7135 addi sp,sp,-160 + 80012ede: ed06 sd ra,152(sp) + 80012ee0: f8aa sd a0,112(sp) + 80012ee2: 4581 li a1,0 + let old_fd = self.arg(0); + 80012ee4: 00003097 auipc ra,0x3 + 80012ee8: f96080e7 jalr -106(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80012eec: 85aa mv a1,a0 + 80012eee: f82e sd a1,48(sp) + 80012ef0: fcaa sd a0,120(sp) + 80012ef2: a009 j 80012ef4 <.LBB6_16> + +0000000080012ef4 <.LBB6_16>: + let curtask = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80012ef4: 00053517 auipc a0,0x53 + 80012ef8: 24c50513 addi a0,a0,588 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80012efc: fffff097 auipc ra,0xfffff + 80012f00: 55c080e7 jalr 1372(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80012f04: f42a sd a0,40(sp) + 80012f06: a009 j 80012f08 <.LBB6_16+0x14> + 80012f08: 7522 ld a0,40(sp) + +0000000080012f0a <.LBB6_17>: + 80012f0a: 00017597 auipc a1,0x17 + 80012f0e: 56e58593 addi a1,a1,1390 # 8002a478 <.L__unnamed_5> + 80012f12: ffffd097 auipc ra,0xffffd + 80012f16: 87e080e7 jalr -1922(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80012f1a: f02a sd a0,32(sp) + 80012f1c: a009 j 80012f1e <.LBB6_17+0x14> + 80012f1e: 75c2 ld a1,48(sp) + 80012f20: 7502 ld a0,32(sp) + 80012f22: e12a sd a0,128(sp) + 80012f24: 06300513 li a0,99 + let file = curtask.open_files[old_fd].as_ref().unwrap(); + 80012f28: 0cb56263 bltu a0,a1,80012fec <.LBB6_20+0x6c> + 80012f2c: a009 j 80012f2e <.LBB6_17+0x24> + 80012f2e: 7502 ld a0,32(sp) + 80012f30: 75c2 ld a1,48(sp) + 80012f32: 058e slli a1,a1,0x3 + 80012f34: 952e add a0,a0,a1 + 80012f36: 0a850513 addi a0,a0,168 + 80012f3a: ffffc097 auipc ra,0xffffc + 80012f3e: 43e080e7 jalr 1086(ra) # 8000f378 <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E> + 80012f42: ec2a sd a0,24(sp) + 80012f44: a009 j 80012f46 <.LBB6_17+0x3c> + 80012f46: 6562 ld a0,24(sp) + +0000000080012f48 <.LBB6_18>: + 80012f48: 00017597 auipc a1,0x17 + 80012f4c: 56058593 addi a1,a1,1376 # 8002a4a8 <.L__unnamed_6> + 80012f50: ffffc097 auipc ra,0xffffc + 80012f54: 732080e7 jalr 1842(ra) # 8000f682 <_ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E> + 80012f58: e4aa sd a0,72(sp) + 80012f5a: a009 j 80012f5c <.LBB6_18+0x14> + let new_fd = unsafe{ CPU_MANAGER.alloc_fd(&file) }.unwrap(); + 80012f5c: 6526 ld a0,72(sp) + 80012f5e: fffef097 auipc ra,0xfffef + 80012f62: 66c080e7 jalr 1644(ra) # 800025ca <_ZN69_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7c280ba665690166E> + 80012f66: e82a sd a0,16(sp) + 80012f68: a009 j 80012f6a <.LBB6_18+0x22> + 80012f6a: 6642 ld a2,16(sp) + +0000000080012f6c <.LBB6_19>: + 80012f6c: 00053597 auipc a1,0x53 + 80012f70: 1d458593 addi a1,a1,468 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80012f74: 0888 addi a0,sp,80 + 80012f76: fffff097 auipc ra,0xfffff + 80012f7a: 660080e7 jalr 1632(ra) # 800125d6 <_ZN6kernel7process3cpu10CPUManager8alloc_fd17h6273585a0cf04a04E> + 80012f7e: a009 j 80012f80 <.LBB6_20> + +0000000080012f80 <.LBB6_20>: + 80012f80: 00017597 auipc a1,0x17 + 80012f84: 54058593 addi a1,a1,1344 # 8002a4c0 <.L__unnamed_7> + 80012f88: 0888 addi a0,sp,80 + 80012f8a: ffffb097 auipc ra,0xffffb + 80012f8e: 830080e7 jalr -2000(ra) # 8000d7ba <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h6115c21749654733E> + 80012f92: 85aa mv a1,a0 + 80012f94: e42e sd a1,8(sp) + 80012f96: e52a sd a0,136(sp) + 80012f98: a009 j 80012f9a <.LBB6_20+0x1a> + let new_file = Arc::clone(&file); + 80012f9a: 6526 ld a0,72(sp) + 80012f9c: fffef097 auipc ra,0xfffef + 80012fa0: 5da080e7 jalr 1498(ra) # 80002576 <_ZN64_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd600a08a186c4518E> + 80012fa4: 85aa mv a1,a0 + 80012fa6: e02e sd a1,0(sp) + 80012fa8: e92a sd a0,144(sp) + 80012faa: a009 j 80012fac <.LBB6_20+0x2c> + 80012fac: 65a2 ld a1,8(sp) + 80012fae: 06300513 li a0,99 + curtask.open_files[new_fd].replace(new_file); + 80012fb2: 04b56963 bltu a0,a1,80013004 <.LBB6_21+0x16> + 80012fb6: a009 j 80012fb8 <.LBB6_20+0x38> + 80012fb8: 6582 ld a1,0(sp) + 80012fba: 7502 ld a0,32(sp) + 80012fbc: 6622 ld a2,8(sp) + 80012fbe: 060e slli a2,a2,0x3 + 80012fc0: 9532 add a0,a0,a2 + 80012fc2: 0a850513 addi a0,a0,168 + 80012fc6: ffffd097 auipc ra,0xffffd + 80012fca: 9be080e7 jalr -1602(ra) # 8000f984 <_ZN4core6option15Option$LT$T$GT$7replace17hf852e6bb4a32ec9aE> + 80012fce: f4aa sd a0,104(sp) + 80012fd0: a009 j 80012fd2 <.LBB6_20+0x52> + 80012fd2: 10a8 addi a0,sp,104 + 80012fd4: ffff4097 auipc ra,0xffff4 + 80012fd8: 242080e7 jalr 578(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80012fdc: a009 j 80012fde <.LBB6_20+0x5e> + Ok(new_fd) + 80012fde: 65a2 ld a1,8(sp) + 80012fe0: e0ae sd a1,64(sp) + 80012fe2: 4501 li a0,0 + 80012fe4: fc2a sd a0,56(sp) + } + 80012fe6: 60ea ld ra,152(sp) + 80012fe8: 610d addi sp,sp,160 + 80012fea: 8082 ret + let file = curtask.open_files[old_fd].as_ref().unwrap(); + 80012fec: 7542 ld a0,48(sp) + +0000000080012fee <.LBB6_21>: + 80012fee: 00017617 auipc a2,0x17 + 80012ff2: 4a260613 addi a2,a2,1186 # 8002a490 <.L__unnamed_8> + 80012ff6: 06400593 li a1,100 + 80012ffa: 00010097 auipc ra,0x10 + 80012ffe: 176080e7 jalr 374(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80013002: 0000 unimp + curtask.open_files[new_fd].replace(new_file); + 80013004: 6522 ld a0,8(sp) + +0000000080013006 <.LBB6_22>: + 80013006: 00017617 auipc a2,0x17 + 8001300a: 4d260613 addi a2,a2,1234 # 8002a4d8 <.L__unnamed_9> + 8001300e: 06400593 li a1,100 + 80013012: 00010097 auipc ra,0x10 + 80013016: 15e080e7 jalr 350(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_read17hd83bd4f92523a35cE: + +000000008001301c <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_read17hd83bd4f92523a35cE>: + pub fn sys_read(&self) -> SysResult { + 8001301c: 7169 addi sp,sp,-304 + 8001301e: f606 sd ra,296(sp) + 80013020: e8aa sd a0,80(sp) + 80013022: f1aa sd a0,224(sp) + 80013024: 4581 li a1,0 + let fd = self.arg(0); + 80013026: 00003097 auipc ra,0x3 + 8001302a: e54080e7 jalr -428(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 8001302e: 85aa mv a1,a0 + 80013030: ecae sd a1,88(sp) + 80013032: f5aa sd a0,232(sp) + 80013034: a009 j 80013036 <.LBB7_20> + +0000000080013036 <.LBB7_20>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80013036: 00053517 auipc a0,0x53 + 8001303a: 10a50513 addi a0,a0,266 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001303e: fffff097 auipc ra,0xfffff + 80013042: 41a080e7 jalr 1050(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80013046: e4aa sd a0,72(sp) + 80013048: a009 j 8001304a <.LBB7_20+0x14> + 8001304a: 6526 ld a0,72(sp) + +000000008001304c <.LBB7_21>: + 8001304c: 00017597 auipc a1,0x17 + 80013050: 4a458593 addi a1,a1,1188 # 8002a4f0 <.L__unnamed_10> + 80013054: ffffc097 auipc ra,0xffffc + 80013058: 73c080e7 jalr 1852(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001305c: e0aa sd a0,64(sp) + 8001305e: a009 j 80013060 <.LBB7_21+0x14> + 80013060: 65e6 ld a1,88(sp) + 80013062: 6506 ld a0,64(sp) + 80013064: f9aa sd a0,240(sp) + 80013066: 06300513 li a0,99 + let file = task.open_files[fd].as_ref().unwrap(); + 8001306a: 0eb56e63 bltu a0,a1,80013166 <.LBB7_24+0x36> + 8001306e: a009 j 80013070 <.LBB7_21+0x24> + 80013070: 6506 ld a0,64(sp) + 80013072: 65e6 ld a1,88(sp) + 80013074: 058e slli a1,a1,0x3 + 80013076: 952e add a0,a0,a1 + 80013078: 0a850513 addi a0,a0,168 + 8001307c: ffffc097 auipc ra,0xffffc + 80013080: 2fc080e7 jalr 764(ra) # 8000f378 <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E> + 80013084: fc2a sd a0,56(sp) + 80013086: a009 j 80013088 <.LBB7_21+0x3c> + 80013088: 7562 ld a0,56(sp) + +000000008001308a <.LBB7_22>: + 8001308a: 00017597 auipc a1,0x17 + 8001308e: 49658593 addi a1,a1,1174 # 8002a520 <.L__unnamed_11> + 80013092: ffffc097 auipc ra,0xffffc + 80013096: 5f0080e7 jalr 1520(ra) # 8000f682 <_ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E> + 8001309a: 85aa mv a1,a0 + 8001309c: f82e sd a1,48(sp) + 8001309e: fdaa sd a0,248(sp) + 800130a0: a009 j 800130a2 <.LBB7_22+0x18> + let ptr = self.arg(1); + 800130a2: 6546 ld a0,80(sp) + 800130a4: 4585 li a1,1 + 800130a6: 00003097 auipc ra,0x3 + 800130aa: dd4080e7 jalr -556(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800130ae: 85aa mv a1,a0 + 800130b0: f42e sd a1,40(sp) + 800130b2: e22a sd a0,256(sp) + 800130b4: a009 j 800130b6 <.LBB7_22+0x2c> + let len = self.arg(2); + 800130b6: 6546 ld a0,80(sp) + 800130b8: 4589 li a1,2 + 800130ba: 00003097 auipc ra,0x3 + 800130be: dc0080e7 jalr -576(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800130c2: 85aa mv a1,a0 + 800130c4: f02e sd a1,32(sp) + 800130c6: e62a sd a0,264(sp) + 800130c8: a009 j 800130ca <.LBB7_22+0x40> + match file.read(ptr, len) { + 800130ca: 7542 ld a0,48(sp) + 800130cc: fffef097 auipc ra,0xfffef + 800130d0: 4fe080e7 jalr 1278(ra) # 800025ca <_ZN69_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7c280ba665690166E> + 800130d4: ec2a sd a0,24(sp) + 800130d6: a009 j 800130d8 <.LBB7_22+0x4e> + 800130d8: 7682 ld a3,32(sp) + 800130da: 7622 ld a2,40(sp) + 800130dc: 65e2 ld a1,24(sp) + 800130de: 1888 addi a0,sp,112 + 800130e0: ffff2097 auipc ra,0xffff2 + 800130e4: 77a080e7 jalr 1914(ra) # 8000585a <_ZN6kernel2fs4file5VFile4read17h537db93950e2de6aE> + 800130e8: a009 j 800130ea <.LBB7_22+0x60> + Ok(cur_size) => { + 800130ea: 7546 ld a0,112(sp) + 800130ec: 4581 li a1,0 + 800130ee: 02b50663 beq a0,a1,8001311a <.LBB7_23+0x18> + 800130f2: a009 j 800130f4 <.LBB7_22+0x6a> + Err(err) => { + 800130f4: 75e6 ld a1,120(sp) + 800130f6: 650a ld a0,128(sp) + 800130f8: e52e sd a1,136(sp) + 800130fa: e92a sd a0,144(sp) + 800130fc: 0128 addi a0,sp,136 + println!("[kernel] sys_read: err: {}", err); + 800130fe: edaa sd a0,216(sp) + 80013100: ea2a sd a0,272(sp) + +0000000080013102 <.LBB7_23>: + 80013102: 0000c597 auipc a1,0xc + 80013106: 35e58593 addi a1,a1,862 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8001310a: 0000c097 auipc ra,0xc + 8001310e: 37a080e7 jalr 890(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80013112: e42a sd a0,8(sp) + 80013114: e82e sd a1,16(sp) + 80013116: a809 j 80013128 <.LBB7_23+0x26> + match file.read(ptr, len) { + 80013118: 0000 unimp + Ok(cur_size) => { + 8001311a: 7566 ld a0,120(sp) + 8001311c: ee2a sd a0,280(sp) + size = cur_size; + 8001311e: f22a sd a0,288(sp) + Ok(size) + 80013120: f4aa sd a0,104(sp) + 80013122: 4501 li a0,0 + 80013124: f0aa sd a0,96(sp) + } + 80013126: a81d j 8001315c <.LBB7_24+0x2c> + println!("[kernel] sys_read: err: {}", err); + 80013128: 6542 ld a0,16(sp) + 8001312a: 65a2 ld a1,8(sp) + 8001312c: e5ae sd a1,200(sp) + 8001312e: e9aa sd a0,208(sp) + +0000000080013130 <.LBB7_24>: + 80013130: 00017597 auipc a1,0x17 + 80013134: 42058593 addi a1,a1,1056 # 8002a550 <.L__unnamed_12> + 80013138: 0928 addi a0,sp,152 + 8001313a: 4609 li a2,2 + 8001313c: 01b4 addi a3,sp,200 + 8001313e: 4705 li a4,1 + 80013140: ffff2097 auipc ra,0xffff2 + 80013144: 44a080e7 jalr 1098(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80013148: a009 j 8001314a <.LBB7_24+0x1a> + 8001314a: 0928 addi a0,sp,152 + 8001314c: 0000c097 auipc ra,0xc + 80013150: aac080e7 jalr -1364(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80013154: a009 j 80013156 <.LBB7_24+0x26> + 80013156: 4505 li a0,1 + return Err(()) + 80013158: f0aa sd a0,96(sp) + } + 8001315a: a009 j 8001315c <.LBB7_24+0x2c> + 8001315c: 7506 ld a0,96(sp) + 8001315e: 75a6 ld a1,104(sp) + 80013160: 70b2 ld ra,296(sp) + 80013162: 6155 addi sp,sp,304 + 80013164: 8082 ret + let file = task.open_files[fd].as_ref().unwrap(); + 80013166: 6566 ld a0,88(sp) + +0000000080013168 <.LBB7_25>: + 80013168: 00017617 auipc a2,0x17 + 8001316c: 3a060613 addi a2,a2,928 # 8002a508 <.L__unnamed_13> + 80013170: 06400593 li a1,100 + 80013174: 00010097 auipc ra,0x10 + 80013178: ffc080e7 jalr -4(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_write17hc5a72fe3cb6d9324E: + +000000008001317e <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_write17hc5a72fe3cb6d9324E>: + pub fn sys_write(&self) -> SysResult { + 8001317e: 7169 addi sp,sp,-304 + 80013180: f606 sd ra,296(sp) + 80013182: e8aa sd a0,80(sp) + 80013184: f1aa sd a0,224(sp) + 80013186: 4581 li a1,0 + let fd = self.arg(0); + 80013188: 00003097 auipc ra,0x3 + 8001318c: cf2080e7 jalr -782(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013190: 85aa mv a1,a0 + 80013192: ecae sd a1,88(sp) + 80013194: f5aa sd a0,232(sp) + 80013196: a009 j 80013198 <.LBB8_20> + +0000000080013198 <.LBB8_20>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80013198: 00053517 auipc a0,0x53 + 8001319c: fa850513 addi a0,a0,-88 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 800131a0: fffff097 auipc ra,0xfffff + 800131a4: 2b8080e7 jalr 696(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 800131a8: e4aa sd a0,72(sp) + 800131aa: a009 j 800131ac <.LBB8_20+0x14> + 800131ac: 6526 ld a0,72(sp) + +00000000800131ae <.LBB8_21>: + 800131ae: 00017597 auipc a1,0x17 + 800131b2: 3c258593 addi a1,a1,962 # 8002a570 <.L__unnamed_14> + 800131b6: ffffc097 auipc ra,0xffffc + 800131ba: 5da080e7 jalr 1498(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 800131be: e0aa sd a0,64(sp) + 800131c0: a009 j 800131c2 <.LBB8_21+0x14> + 800131c2: 65e6 ld a1,88(sp) + 800131c4: 6506 ld a0,64(sp) + 800131c6: f9aa sd a0,240(sp) + 800131c8: 06300513 li a0,99 + let file = task.open_files[fd].as_ref().unwrap(); + 800131cc: 0eb56e63 bltu a0,a1,800132c8 <.LBB8_24+0x36> + 800131d0: a009 j 800131d2 <.LBB8_21+0x24> + 800131d2: 6506 ld a0,64(sp) + 800131d4: 65e6 ld a1,88(sp) + 800131d6: 058e slli a1,a1,0x3 + 800131d8: 952e add a0,a0,a1 + 800131da: 0a850513 addi a0,a0,168 + 800131de: ffffc097 auipc ra,0xffffc + 800131e2: 19a080e7 jalr 410(ra) # 8000f378 <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E> + 800131e6: fc2a sd a0,56(sp) + 800131e8: a009 j 800131ea <.LBB8_21+0x3c> + 800131ea: 7562 ld a0,56(sp) + +00000000800131ec <.LBB8_22>: + 800131ec: 00017597 auipc a1,0x17 + 800131f0: 3b458593 addi a1,a1,948 # 8002a5a0 <.L__unnamed_15> + 800131f4: ffffc097 auipc ra,0xffffc + 800131f8: 48e080e7 jalr 1166(ra) # 8000f682 <_ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E> + 800131fc: 85aa mv a1,a0 + 800131fe: f82e sd a1,48(sp) + 80013200: fdaa sd a0,248(sp) + 80013202: a009 j 80013204 <.LBB8_22+0x18> + let ptr = self.arg(1); + 80013204: 6546 ld a0,80(sp) + 80013206: 4585 li a1,1 + 80013208: 00003097 auipc ra,0x3 + 8001320c: c72080e7 jalr -910(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013210: 85aa mv a1,a0 + 80013212: f42e sd a1,40(sp) + 80013214: e22a sd a0,256(sp) + 80013216: a009 j 80013218 <.LBB8_22+0x2c> + let len = self.arg(2); + 80013218: 6546 ld a0,80(sp) + 8001321a: 4589 li a1,2 + 8001321c: 00003097 auipc ra,0x3 + 80013220: c5e080e7 jalr -930(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013224: 85aa mv a1,a0 + 80013226: f02e sd a1,32(sp) + 80013228: e62a sd a0,264(sp) + 8001322a: a009 j 8001322c <.LBB8_22+0x40> + match file.write(ptr, len) { + 8001322c: 7542 ld a0,48(sp) + 8001322e: fffef097 auipc ra,0xfffef + 80013232: 39c080e7 jalr 924(ra) # 800025ca <_ZN69_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7c280ba665690166E> + 80013236: ec2a sd a0,24(sp) + 80013238: a009 j 8001323a <.LBB8_22+0x4e> + 8001323a: 7682 ld a3,32(sp) + 8001323c: 7622 ld a2,40(sp) + 8001323e: 65e2 ld a1,24(sp) + 80013240: 1888 addi a0,sp,112 + 80013242: ffff3097 auipc ra,0xffff3 + 80013246: 99c080e7 jalr -1636(ra) # 80005bde <_ZN6kernel2fs4file5VFile5write17h6504f6f101707b61E> + 8001324a: a009 j 8001324c <.LBB8_22+0x60> + Ok(cur_size) => { + 8001324c: 7546 ld a0,112(sp) + 8001324e: 4581 li a1,0 + 80013250: 02b50663 beq a0,a1,8001327c <.LBB8_23+0x18> + 80013254: a009 j 80013256 <.LBB8_22+0x6a> + Err(err) => { + 80013256: 75e6 ld a1,120(sp) + 80013258: 650a ld a0,128(sp) + 8001325a: e52e sd a1,136(sp) + 8001325c: e92a sd a0,144(sp) + 8001325e: 0128 addi a0,sp,136 + println!("[Kernel] sys_write: err: {}", err); + 80013260: edaa sd a0,216(sp) + 80013262: ea2a sd a0,272(sp) + +0000000080013264 <.LBB8_23>: + 80013264: 0000c597 auipc a1,0xc + 80013268: 1fc58593 addi a1,a1,508 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8001326c: 0000c097 auipc ra,0xc + 80013270: 218080e7 jalr 536(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80013274: e42a sd a0,8(sp) + 80013276: e82e sd a1,16(sp) + 80013278: a809 j 8001328a <.LBB8_23+0x26> + match file.write(ptr, len) { + 8001327a: 0000 unimp + Ok(cur_size) => { + 8001327c: 7566 ld a0,120(sp) + 8001327e: ee2a sd a0,280(sp) + size = cur_size; + 80013280: f22a sd a0,288(sp) + Ok(size) + 80013282: f4aa sd a0,104(sp) + 80013284: 4501 li a0,0 + 80013286: f0aa sd a0,96(sp) + } + 80013288: a81d j 800132be <.LBB8_24+0x2c> + println!("[Kernel] sys_write: err: {}", err); + 8001328a: 6542 ld a0,16(sp) + 8001328c: 65a2 ld a1,8(sp) + 8001328e: e5ae sd a1,200(sp) + 80013290: e9aa sd a0,208(sp) + +0000000080013292 <.LBB8_24>: + 80013292: 00017597 auipc a1,0x17 + 80013296: 34658593 addi a1,a1,838 # 8002a5d8 <.L__unnamed_16> + 8001329a: 0928 addi a0,sp,152 + 8001329c: 4609 li a2,2 + 8001329e: 01b4 addi a3,sp,200 + 800132a0: 4705 li a4,1 + 800132a2: ffff2097 auipc ra,0xffff2 + 800132a6: 2e8080e7 jalr 744(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800132aa: a009 j 800132ac <.LBB8_24+0x1a> + 800132ac: 0928 addi a0,sp,152 + 800132ae: 0000c097 auipc ra,0xc + 800132b2: 94a080e7 jalr -1718(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800132b6: a009 j 800132b8 <.LBB8_24+0x26> + 800132b8: 4505 li a0,1 + return Err(()) + 800132ba: f0aa sd a0,96(sp) + } + 800132bc: a009 j 800132be <.LBB8_24+0x2c> + 800132be: 7506 ld a0,96(sp) + 800132c0: 75a6 ld a1,104(sp) + 800132c2: 70b2 ld ra,296(sp) + 800132c4: 6155 addi sp,sp,304 + 800132c6: 8082 ret + let file = task.open_files[fd].as_ref().unwrap(); + 800132c8: 6566 ld a0,88(sp) + +00000000800132ca <.LBB8_25>: + 800132ca: 00017617 auipc a2,0x17 + 800132ce: 2be60613 addi a2,a2,702 # 8002a588 <.L__unnamed_17> + 800132d2: 06400593 li a1,100 + 800132d6: 00010097 auipc ra,0x10 + 800132da: e9a080e7 jalr -358(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_open17h5b5b1f6af7439fbcE: + +00000000800132e0 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_open17h5b5b1f6af7439fbcE>: + pub fn sys_open(&self) -> SysResult { + 800132e0: c4010113 addi sp,sp,-960 + 800132e4: 3a113c23 sd ra,952(sp) + 800132e8: fd2a sd a0,184(sp) + 800132ea: 38a13423 sd a0,904(sp) + 800132ee: 4581 li a1,0 + let mut path = [0;MAXPATH]; + 800132f0: f92e sd a1,176(sp) + 800132f2: 38b103a3 sb a1,903(sp) + 800132f6: 38b10323 sb a1,902(sp) + 800132fa: 09a8 addi a0,sp,216 + 800132fc: 08000613 li a2,128 + 80013300: 00013097 auipc ra,0x13 + 80013304: dd4080e7 jalr -556(ra) # 800260d4 + 80013308: 75ca ld a1,176(sp) + let addr = self.arg(0); + 8001330a: 756a ld a0,184(sp) + 8001330c: 00003097 auipc ra,0x3 + 80013310: b6e080e7 jalr -1170(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013314: 85aa mv a1,a0 + 80013316: e1ae sd a1,192(sp) + 80013318: 38a13823 sd a0,912(sp) + 8001331c: a009 j 8001331e <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_open17h5b5b1f6af7439fbcE+0x3e> + self.copy_from_str(addr, &mut path, MAXPATH).unwrap(); + 8001331e: 658e ld a1,192(sp) + 80013320: 756a ld a0,184(sp) + 80013322: 09b0 addi a2,sp,216 + 80013324: 08000713 li a4,128 + 80013328: 86ba mv a3,a4 + 8001332a: 00003097 auipc ra,0x3 + 8001332e: c00080e7 jalr -1024(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80013332: f52a sd a0,168(sp) + 80013334: a009 j 80013336 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_open17h5b5b1f6af7439fbcE+0x56> + 80013336: 752a ld a0,168(sp) + +0000000080013338 <.LBB9_80>: + 80013338: 00017597 auipc a1,0x17 + 8001333c: 2c058593 addi a1,a1,704 # 8002a5f8 <.L__unnamed_18> + 80013340: ffffa097 auipc ra,0xffffa + 80013344: 50e080e7 jalr 1294(ra) # 8000d84e <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17hea14d8d7b2208f82E> + 80013348: a009 j 8001334a <.LBB9_80+0x12> + let open_mode = self.arg(1); + 8001334a: 756a ld a0,184(sp) + 8001334c: 4585 li a1,1 + 8001334e: 00003097 auipc ra,0x3 + 80013352: b2c080e7 jalr -1236(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013356: fb2a sd a0,432(sp) + 80013358: a009 j 8001335a <.LBB9_81> + +000000008001335a <.LBB9_81>: + LOG.begin_op(); + 8001335a: 00048517 auipc a0,0x48 + 8001335e: 17e50513 addi a0,a0,382 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80013362: ffff6097 auipc ra,0xffff6 + 80013366: 078080e7 jalr 120(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 8001336a: a009 j 8001336c <.LBB9_81+0x12> + match OpenMode::mode(open_mode) { + 8001336c: 755a ld a0,432(sp) + 8001336e: 00006097 auipc ra,0x6 + 80013372: ed6080e7 jalr -298(ra) # 80019244 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E> + 80013376: ff2a sd a0,440(sp) + 80013378: a009 j 8001337a <.LBB9_81+0x20> + OpenMode::CREATE => { + 8001337a: 757a ld a0,440(sp) + 8001337c: 20000593 li a1,512 + 80013380: 02b50063 beq a0,a1,800133a0 <.LBB9_82+0x1a> + 80013384: a009 j 80013386 <.LBB9_82> + +0000000080013386 <.LBB9_82>: + match ICACHE.namei(&path) { + 80013386: 00048597 auipc a1,0x48 + 8001338a: 1fa58593 addi a1,a1,506 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 8001338e: 0ca8 addi a0,sp,600 + 80013390: 09b0 addi a2,sp,216 + 80013392: 08000693 li a3,128 + 80013396: 00007097 auipc ra,0x7 + 8001339a: e92080e7 jalr -366(ra) # 8001a228 <_ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E> + 8001339e: a8e1 j 80013476 <.LBB9_86+0x2c> + 800133a0: 4709 li a4,2 + match ICACHE.create(&path, crate::fs::InodeType::File, 0, 0) { + 800133a2: 1ce11f23 sh a4,478(sp) + +00000000800133a6 <.LBB9_83>: + 800133a6: 00048597 auipc a1,0x48 + 800133aa: 1da58593 addi a1,a1,474 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 800133ae: 0388 addi a0,sp,448 + 800133b0: 09b0 addi a2,sp,216 + 800133b2: 08000693 li a3,128 + 800133b6: 4801 li a6,0 + 800133b8: 87c2 mv a5,a6 + 800133ba: 00007097 auipc ra,0x7 + 800133be: eb2080e7 jalr -334(ra) # 8001a26c <_ZN6kernel2fs5inode10InodeCache6create17hf2583436fcb9d2ecE> + 800133c2: a009 j 800133c4 <.LBB9_83+0x1e> + Ok(cur_inode) => { + 800133c4: 651e ld a0,448(sp) + 800133c6: 4581 li a1,0 + 800133c8: 02b50363 beq a0,a1,800133ee <.LBB9_84+0x14> + 800133cc: a009 j 800133ce <.LBB9_83+0x28> + Err(err) => { + 800133ce: 65be ld a1,456(sp) + 800133d0: 655e ld a0,464(sp) + 800133d2: 20b13023 sd a1,512(sp) + 800133d6: 20a13423 sd a0,520(sp) + +00000000800133da <.LBB9_84>: + LOG.end_op(); + 800133da: 00048517 auipc a0,0x48 + 800133de: 0fe50513 addi a0,a0,254 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800133e2: ffff6097 auipc ra,0xffff6 + 800133e6: 5de080e7 jalr 1502(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800133ea: a815 j 8001341e <.LBB9_84+0x44> + match ICACHE.create(&path, crate::fs::InodeType::File, 0, 0) { + 800133ec: 0000 unimp + Ok(cur_inode) => { + 800133ee: 655e ld a0,464(sp) + 800133f0: f7aa sd a0,488(sp) + 800133f2: 65be ld a1,456(sp) + 800133f4: f3ae sd a1,480(sp) + inode = cur_inode; + 800133f6: fbae sd a1,496(sp) + 800133f8: ffaa sd a0,504(sp) + 800133fa: 4605 li a2,1 + 800133fc: 38c103a3 sb a2,903(sp) + 80013400: eeae sd a1,344(sp) + 80013402: f2aa sd a0,352(sp) + 80013404: 0aa8 addi a0,sp,344 + inode_guard = inode.lock(); + 80013406: 00009097 auipc ra,0x9 + 8001340a: 866080e7 jalr -1946(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 8001340e: ed2a sd a0,152(sp) + 80013410: f12e sd a1,160(sp) + 80013412: a009 j 80013414 <.LBB9_84+0x3a> + 80013414: 750a ld a0,160(sp) + 80013416: 65ea ld a1,152(sp) + 80013418: f32e sd a1,416(sp) + 8001341a: f72a sd a0,424(sp) + match OpenMode::mode(open_mode) { + 8001341c: aa15 j 80013550 <.LBB9_89+0x1e> + 8001341e: 0408 addi a0,sp,512 + println!("[Kernel] syscall: sys_open: {}", err); + 80013420: 24a13823 sd a0,592(sp) + 80013424: 38a13c23 sd a0,920(sp) + +0000000080013428 <.LBB9_85>: + 80013428: 0000c597 auipc a1,0xc + 8001342c: 03858593 addi a1,a1,56 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80013430: 0000c097 auipc ra,0xc + 80013434: 054080e7 jalr 84(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80013438: e52a sd a0,136(sp) + 8001343a: e92e sd a1,144(sp) + 8001343c: a009 j 8001343e <.LBB9_85+0x16> + 8001343e: 654a ld a0,144(sp) + 80013440: 65aa ld a1,136(sp) + 80013442: 24b13023 sd a1,576(sp) + 80013446: 24a13423 sd a0,584(sp) + +000000008001344a <.LBB9_86>: + 8001344a: 00017597 auipc a1,0x17 + 8001344e: 1e658593 addi a1,a1,486 # 8002a630 <.L__unnamed_19> + 80013452: 0c08 addi a0,sp,528 + 80013454: 4609 li a2,2 + 80013456: 0494 addi a3,sp,576 + 80013458: 4705 li a4,1 + 8001345a: ffff2097 auipc ra,0xffff2 + 8001345e: 130080e7 jalr 304(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80013462: a009 j 80013464 <.LBB9_86+0x1a> + 80013464: 0c08 addi a0,sp,528 + 80013466: 0000b097 auipc ra,0xb + 8001346a: 792080e7 jalr 1938(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001346e: a009 j 80013470 <.LBB9_86+0x26> + 80013470: 4505 li a0,1 + return Err(()) + 80013472: e5aa sd a0,200(sp) + 80013474: ae0d j 800137a6 <.LBB9_94+0x38> + Some(cur_inode) => { + 80013476: 25813503 ld a0,600(sp) + 8001347a: 4581 li a1,0 + 8001347c: 00b50463 beq a0,a1,80013484 <.LBB9_87> + 80013480: a009 j 80013482 <.LBB9_86+0x38> + 80013482: a819 j 80013498 <.LBB9_87+0x14> + +0000000080013484 <.LBB9_87>: + LOG.end_op(); + 80013484: 00048517 auipc a0,0x48 + 80013488: 05450513 addi a0,a0,84 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001348c: ffff6097 auipc ra,0xffff6 + 80013490: 534080e7 jalr 1332(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80013494: a85d j 8001354a <.LBB9_89+0x18> + match ICACHE.namei(&path) { + 80013496: 0000 unimp + Some(cur_inode) => { + 80013498: 26813503 ld a0,616(sp) + 8001349c: 26a13c23 sd a0,632(sp) + 800134a0: 26013583 ld a1,608(sp) + 800134a4: 26b13823 sd a1,624(sp) + inode = cur_inode; + 800134a8: 28b13023 sd a1,640(sp) + 800134ac: 28a13423 sd a0,648(sp) + 800134b0: 4605 li a2,1 + 800134b2: 38c103a3 sb a2,903(sp) + 800134b6: eeae sd a1,344(sp) + 800134b8: f2aa sd a0,352(sp) + 800134ba: 0aa8 addi a0,sp,344 + inode_guard = inode.lock(); + 800134bc: 00008097 auipc ra,0x8 + 800134c0: 7b0080e7 jalr 1968(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 800134c4: fcaa sd a0,120(sp) + 800134c6: e12e sd a1,128(sp) + 800134c8: a009 j 800134ca <.LBB9_87+0x46> + 800134ca: 650a ld a0,128(sp) + 800134cc: 75e6 ld a1,120(sp) + 800134ce: f32e sd a1,416(sp) + 800134d0: f72a sd a0,424(sp) + 800134d2: 1308 addi a0,sp,416 + if inode_guard.dinode.itype == InodeType::Directory && open_mode != OpenMode::RDONLY as usize { + 800134d4: 0000b097 auipc ra,0xb + 800134d8: fbe080e7 jalr -66(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 800134dc: f8aa sd a0,112(sp) + 800134de: a01d j 80013504 <.LBB9_87+0x80> + 800134e0: 4505 li a0,1 + 800134e2: 28a10ba3 sb a0,663(sp) + 800134e6: a811 j 800134fa <.LBB9_87+0x76> + 800134e8: 4501 li a0,0 + 800134ea: 28a10ba3 sb a0,663(sp) + 800134ee: a031 j 800134fa <.LBB9_87+0x76> + 800134f0: 755a ld a0,432(sp) + 800134f2: 4581 li a1,0 + 800134f4: feb516e3 bne a0,a1,800134e0 <.LBB9_87+0x5c> + 800134f8: bfc5 j 800134e8 <.LBB9_87+0x64> + 800134fa: 29714503 lbu a0,663(sp) + 800134fe: 8905 andi a0,a0,1 + 80013500: e10d bnez a0,80013522 <.LBB9_88+0x1a> + 80013502: a03d j 80013530 <.LBB9_88+0x28> + 80013504: 7546 ld a0,112(sp) + 80013506: 0521 addi a0,a0,8 + +0000000080013508 <.LBB9_88>: + 80013508: 00017597 auipc a1,0x17 + 8001350c: 10858593 addi a1,a1,264 # 8002a610 <.L__unnamed_20> + 80013510: ffff5097 auipc ra,0xffff5 + 80013514: 088080e7 jalr 136(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 80013518: f4aa sd a0,104(sp) + 8001351a: a009 j 8001351c <.LBB9_88+0x14> + 8001351c: 7526 ld a0,104(sp) + 8001351e: f969 bnez a0,800134f0 <.LBB9_87+0x6c> + 80013520: b7e1 j 800134e8 <.LBB9_87+0x64> + drop(inode_guard); + 80013522: 751a ld a0,416(sp) + 80013524: 75ba ld a1,424(sp) + 80013526: 0000b097 auipc ra,0xb + 8001352a: 914080e7 jalr -1772(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001352e: a011 j 80013532 <.LBB9_89> + match OpenMode::mode(open_mode) { + 80013530: a005 j 80013550 <.LBB9_89+0x1e> + +0000000080013532 <.LBB9_89>: + LOG.end_op(); + 80013532: 00048517 auipc a0,0x48 + 80013536: fa650513 addi a0,a0,-90 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001353a: ffff6097 auipc ra,0xffff6 + 8001353e: 486080e7 jalr 1158(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80013542: a009 j 80013544 <.LBB9_89+0x12> + 80013544: 4505 li a0,1 + return Err(()); + 80013546: e5aa sd a0,200(sp) + 80013548: a4e5 j 80013830 <.LBB9_94+0xc2> + 8001354a: 4505 li a0,1 + return Err(()) + 8001354c: e5aa sd a0,200(sp) + 8001354e: a4cd j 80013830 <.LBB9_94+0xc2> + 80013550: 0d28 addi a0,sp,664 + file = VFile::init(); + 80013552: ffff2097 auipc ra,0xffff2 + 80013556: 2d8080e7 jalr 728(ra) # 8000582a <_ZN6kernel2fs4file5VFile4init17h000c38ec0bf103cfE> + 8001355a: a4b5 j 800137c6 <.LBB9_94+0x58> + InodeType::Device => { + 8001355c: 2d013503 ld a0,720(sp) + 80013560: 00855503 lhu a0,8(a0) + 80013564: f0aa sd a0,96(sp) + 80013566: 458d li a1,3 + 80013568: 02b50563 beq a0,a1,80013592 <.LBB9_89+0x60> + 8001356c: a009 j 8001356e <.LBB9_89+0x3c> + 8001356e: 7506 ld a0,96(sp) + 80013570: 4591 li a1,4 + 80013572: 04b50663 beq a0,a1,800135be <.LBB9_89+0x8c> + 80013576: a009 j 80013578 <.LBB9_89+0x46> + 80013578: 4509 li a0,2 + file.ftype = FileType::Inode; + 8001357a: 2ca11e23 sh a0,732(sp) + 8001357e: 18a11a23 sh a0,404(sp) + 80013582: 4501 li a0,0 + file.offset = 0; + 80013584: 18a12823 sw a0,400(sp) + 80013588: 10100513 li a0,257 + file.readable = true; + 8001358c: 18a11c23 sh a0,408(sp) + match inode_guard.dinode.itype { + 80013590: a0a1 j 800135d8 <.LBB9_89+0xa6> + 80013592: 450d li a0,3 + file.ftype = FileType::Device; + 80013594: 2ca11c23 sh a0,728(sp) + 80013598: 18a11a23 sh a0,404(sp) + 8001359c: 1308 addi a0,sp,416 + file.major = inode_guard.dinode.major; + 8001359e: 0000b097 auipc ra,0xb + 800135a2: ef4080e7 jalr -268(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 800135a6: ecaa sd a0,88(sp) + 800135a8: a009 j 800135aa <.LBB9_89+0x78> + 800135aa: 6566 ld a0,88(sp) + 800135ac: 00a51503 lh a0,10(a0) + 800135b0: 18a11b23 sh a0,406(sp) + 800135b4: 10100513 li a0,257 + file.readable = true; + 800135b8: 18a11c23 sh a0,408(sp) + match inode_guard.dinode.itype { + 800135bc: a831 j 800135d8 <.LBB9_89+0xa6> + 800135be: 4515 li a0,5 + file.ftype = FileType::Fifo; + 800135c0: 2ca11d23 sh a0,730(sp) + 800135c4: 18a11a23 sh a0,404(sp) + 800135c8: 4501 li a0,0 + file.offset= 0; + 800135ca: 18a12823 sw a0,400(sp) + 800135ce: 10100513 li a0,257 + file.readable = true; + 800135d2: 18a11c23 sh a0,408(sp) + match inode_guard.dinode.itype { + 800135d6: a009 j 800135d8 <.LBB9_89+0xa6> + 800135d8: 1b08 addi a0,sp,432 + 800135da: 45ad li a1,11 + if open_mode.get_bit(11) && inode_guard.dinode.itype == InodeType::File { + 800135dc: ffff0097 auipc ra,0xffff0 + 800135e0: 7d8080e7 jalr 2008(ra) # 80003db4 <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E> + 800135e4: e8aa sd a0,80(sp) + 800135e6: a02d j 80013610 <.LBB9_89+0xde> + 800135e8: 4505 li a0,1 + 800135ea: 2ca10fa3 sb a0,735(sp) + 800135ee: a821 j 80013606 <.LBB9_89+0xd4> + 800135f0: 4501 li a0,0 + 800135f2: 2ca10fa3 sb a0,735(sp) + 800135f6: a801 j 80013606 <.LBB9_89+0xd4> + 800135f8: 1308 addi a0,sp,416 + 800135fa: 0000b097 auipc ra,0xb + 800135fe: e98080e7 jalr -360(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80013602: e4aa sd a0,72(sp) + 80013604: a809 j 80013616 <.LBB9_89+0xe4> + 80013606: 2df14503 lbu a0,735(sp) + 8001360a: 8905 andi a0,a0,1 + 8001360c: e505 bnez a0,80013634 <.LBB9_90+0x1a> + 8001360e: a815 j 80013642 <.LBB9_90+0x28> + 80013610: 6546 ld a0,80(sp) + 80013612: f17d bnez a0,800135f8 <.LBB9_89+0xc6> + 80013614: bff1 j 800135f0 <.LBB9_89+0xbe> + 80013616: 6526 ld a0,72(sp) + 80013618: 0521 addi a0,a0,8 + +000000008001361a <.LBB9_90>: + 8001361a: 00017597 auipc a1,0x17 + 8001361e: 03658593 addi a1,a1,54 # 8002a650 <.L__unnamed_21> + 80013622: ffff5097 auipc ra,0xffff5 + 80013626: f76080e7 jalr -138(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 8001362a: e0aa sd a0,64(sp) + 8001362c: a009 j 8001362e <.LBB9_90+0x14> + 8001362e: 6506 ld a0,64(sp) + 80013630: fd45 bnez a0,800135e8 <.LBB9_89+0xb6> + 80013632: bf7d j 800135f0 <.LBB9_89+0xbe> + 80013634: 1308 addi a0,sp,416 + inode_guard.truncate(&inode); + 80013636: 0000b097 auipc ra,0xb + 8001363a: e70080e7 jalr -400(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001363e: fc2a sd a0,56(sp) + 80013640: a011 j 80013644 <.LBB9_90+0x2a> + if open_mode.get_bit(11) && inode_guard.dinode.itype == InodeType::File { + 80013642: a809 j 80013654 <.LBB9_90+0x3a> + inode_guard.truncate(&inode); + 80013644: 7562 ld a0,56(sp) + 80013646: 0aac addi a1,sp,344 + 80013648: 00007097 auipc ra,0x7 + 8001364c: 4a8080e7 jalr 1192(ra) # 8001aaf0 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E> + 80013650: a009 j 80013652 <.LBB9_90+0x38> + if open_mode.get_bit(11) && inode_guard.dinode.itype == InodeType::File { + 80013652: a009 j 80013654 <.LBB9_90+0x3a> + drop(inode_guard); + 80013654: 751a ld a0,416(sp) + 80013656: 75ba ld a1,424(sp) + 80013658: 0000a097 auipc ra,0xa + 8001365c: 7e2080e7 jalr 2018(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80013660: a009 j 80013662 <.LBB9_91> + +0000000080013662 <.LBB9_91>: + LOG.end_op(); + 80013662: 00048517 auipc a0,0x48 + 80013666: e7650513 addi a0,a0,-394 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001366a: ffff6097 auipc ra,0xffff6 + 8001366e: 356080e7 jalr 854(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80013672: a009 j 80013674 <.LBB9_91+0x12> + 80013674: 4501 li a0,0 + file.inode = Some(inode); + 80013676: 38a103a3 sb a0,903(sp) + 8001367a: 65f6 ld a1,344(sp) + 8001367c: 2eb13c23 sd a1,760(sp) + 80013680: 7516 ld a0,352(sp) + 80013682: 30a13023 sd a0,768(sp) + 80013686: 2eb13423 sd a1,744(sp) + 8001368a: 2ea13823 sd a0,752(sp) + 8001368e: 4505 li a0,1 + 80013690: 2ea13023 sd a0,736(sp) + 80013694: 1aa8 addi a0,sp,376 + 80013696: ffff4097 auipc ra,0xffff4 + 8001369a: a9a080e7 jalr -1382(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8001369e: a2a5 j 80013806 <.LBB9_94+0x98> + 800136a0: 1b08 addi a0,sp,432 + 800136a2: 4585 li a1,1 + file.writeable = open_mode.get_bit(0) | open_mode.get_bit(1); + 800136a4: ffff0097 auipc ra,0xffff0 + 800136a8: 710080e7 jalr 1808(ra) # 80003db4 <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E> + 800136ac: f82a sd a0,48(sp) + 800136ae: a009 j 800136b0 <.LBB9_91+0x4e> + 800136b0: 75c2 ld a1,48(sp) + 800136b2: 30f10503 lb a0,783(sp) + 800136b6: 8d4d or a0,a0,a1 + 800136b8: 8905 andi a0,a0,1 + 800136ba: 18a10ca3 sb a0,409(sp) + 800136be: 1b08 addi a0,sp,432 + 800136c0: 4581 li a1,0 + file.readable = !open_mode.get_bit(0) | open_mode.get_bit(1); + 800136c2: ffff0097 auipc ra,0xffff0 + 800136c6: 6f2080e7 jalr 1778(ra) # 80003db4 <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E> + 800136ca: f42a sd a0,40(sp) + 800136cc: a009 j 800136ce <.LBB9_91+0x6c> + 800136ce: 7522 ld a0,40(sp) + 800136d0: 00154513 xori a0,a0,1 + 800136d4: ec2a sd a0,24(sp) + 800136d6: 1b08 addi a0,sp,432 + 800136d8: 4585 li a1,1 + 800136da: ffff0097 auipc ra,0xffff0 + 800136de: 6da080e7 jalr 1754(ra) # 80003db4 <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E> + 800136e2: f02a sd a0,32(sp) + 800136e4: a009 j 800136e6 <.LBB9_91+0x84> + 800136e6: 6562 ld a0,24(sp) + 800136e8: 7582 ld a1,32(sp) + 800136ea: 8d4d or a0,a0,a1 + 800136ec: 18a10c23 sb a0,408(sp) + +00000000800136f0 <.LBB9_92>: + match unsafe { CPU_MANAGER.alloc_fd(&file) } { + 800136f0: 00053597 auipc a1,0x53 + 800136f4: a5058593 addi a1,a1,-1456 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 800136f8: 0e08 addi a0,sp,784 + 800136fa: 12b0 addi a2,sp,360 + 800136fc: fffff097 auipc ra,0xfffff + 80013700: eda080e7 jalr -294(ra) # 800125d6 <_ZN6kernel7process3cpu10CPUManager8alloc_fd17h6273585a0cf04a04E> + 80013704: a009 j 80013706 <.LBB9_92+0x16> + Ok(new_fd) => { + 80013706: 31013503 ld a0,784(sp) + 8001370a: 4581 li a1,0 + 8001370c: 02b50c63 beq a0,a1,80013744 <.LBB9_93+0x18> + 80013710: a009 j 80013712 <.LBB9_92+0x22> + Err(err) => { + 80013712: 31813583 ld a1,792(sp) + 80013716: 32013503 ld a0,800(sp) + 8001371a: 32b13423 sd a1,808(sp) + 8001371e: 32a13823 sd a0,816(sp) + 80013722: 1628 addi a0,sp,808 + println!("[Kernel] sys_open: err: {}", err); + 80013724: 36a13c23 sd a0,888(sp) + 80013728: 3aa13023 sd a0,928(sp) + +000000008001372c <.LBB9_93>: + 8001372c: 0000c597 auipc a1,0xc + 80013730: d3458593 addi a1,a1,-716 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80013734: 0000c097 auipc ra,0xc + 80013738: d50080e7 jalr -688(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 8001373c: e42a sd a0,8(sp) + 8001373e: e82e sd a1,16(sp) + 80013740: a00d j 80013762 <.LBB9_93+0x36> + match unsafe { CPU_MANAGER.alloc_fd(&file) } { + 80013742: 0000 unimp + Ok(new_fd) => { + 80013744: 31813503 ld a0,792(sp) + 80013748: 3aa13423 sd a0,936(sp) + fd = new_fd; + 8001374c: 3aa13823 sd a0,944(sp) + Ok(fd) + 80013750: e9aa sd a0,208(sp) + 80013752: 4501 li a0,0 + 80013754: e5aa sd a0,200(sp) + 80013756: 12a8 addi a0,sp,360 + } + 80013758: ffff4097 auipc ra,0xffff4 + 8001375c: 8f6080e7 jalr -1802(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 80013760: a82d j 8001379a <.LBB9_94+0x2c> + println!("[Kernel] sys_open: err: {}", err); + 80013762: 6542 ld a0,16(sp) + 80013764: 65a2 ld a1,8(sp) + 80013766: 36b13423 sd a1,872(sp) + 8001376a: 36a13823 sd a0,880(sp) + +000000008001376e <.LBB9_94>: + 8001376e: 00017597 auipc a1,0x17 + 80013772: f0258593 addi a1,a1,-254 # 8002a670 <.L__unnamed_22> + 80013776: 1e28 addi a0,sp,824 + 80013778: 4609 li a2,2 + 8001377a: 16b4 addi a3,sp,872 + 8001377c: 4705 li a4,1 + 8001377e: ffff2097 auipc ra,0xffff2 + 80013782: e0c080e7 jalr -500(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80013786: a009 j 80013788 <.LBB9_94+0x1a> + 80013788: 1e28 addi a0,sp,824 + 8001378a: 0000b097 auipc ra,0xb + 8001378e: 46e080e7 jalr 1134(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80013792: a009 j 80013794 <.LBB9_94+0x26> + 80013794: 4505 li a0,1 + return Err(()) + 80013796: e5aa sd a0,200(sp) + 80013798: a039 j 800137a6 <.LBB9_94+0x38> + 8001379a: 4501 li a0,0 + } + 8001379c: 38a10323 sb a0,902(sp) + 800137a0: 38a103a3 sb a0,903(sp) + 800137a4: a811 j 800137b8 <.LBB9_94+0x4a> + 800137a6: 38614503 lbu a0,902(sp) + 800137aa: 8905 andi a0,a0,1 + 800137ac: e959 bnez a0,80013842 <.LBB9_94+0xd4> + 800137ae: a051 j 80013832 <.LBB9_94+0xc4> + 800137b0: 4501 li a0,0 + 800137b2: 38a103a3 sb a0,903(sp) + 800137b6: a009 j 800137b8 <.LBB9_94+0x4a> + 800137b8: 652e ld a0,200(sp) + 800137ba: 65ce ld a1,208(sp) + 800137bc: 3b813083 ld ra,952(sp) + 800137c0: 3c010113 addi sp,sp,960 + 800137c4: 8082 ret + 800137c6: 4505 li a0,1 + file = VFile::init(); + 800137c8: 38a10323 sb a0,902(sp) + 800137cc: 29813503 ld a0,664(sp) + 800137d0: f6aa sd a0,360(sp) + 800137d2: 2a013503 ld a0,672(sp) + 800137d6: faaa sd a0,368(sp) + 800137d8: 2a813503 ld a0,680(sp) + 800137dc: feaa sd a0,376(sp) + 800137de: 2b013503 ld a0,688(sp) + 800137e2: e32a sd a0,384(sp) + 800137e4: 2b813503 ld a0,696(sp) + 800137e8: e72a sd a0,392(sp) + 800137ea: 2c013503 ld a0,704(sp) + 800137ee: eb2a sd a0,400(sp) + 800137f0: 2c813503 ld a0,712(sp) + 800137f4: ef2a sd a0,408(sp) + 800137f6: 1308 addi a0,sp,416 + match inode_guard.dinode.itype { + 800137f8: 0000b097 auipc ra,0xb + 800137fc: c9a080e7 jalr -870(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80013800: 2ca13823 sd a0,720(sp) + 80013804: bba1 j 8001355c <.LBB9_89+0x2a> + 80013806: 4505 li a0,1 + file.inode = Some(inode); + 80013808: 38a10323 sb a0,902(sp) + 8001380c: 2e013503 ld a0,736(sp) + 80013810: feaa sd a0,376(sp) + 80013812: 2e813503 ld a0,744(sp) + 80013816: e32a sd a0,384(sp) + 80013818: 2f013503 ld a0,752(sp) + 8001381c: e72a sd a0,392(sp) + 8001381e: 1b08 addi a0,sp,432 + 80013820: 4581 li a1,0 + file.writeable = open_mode.get_bit(0) | open_mode.get_bit(1); + 80013822: ffff0097 auipc ra,0xffff0 + 80013826: 592080e7 jalr 1426(ra) # 80003db4 <_ZN45_$LT$usize$u20$as$u20$bit_field..BitField$GT$7get_bit17ha84b909d1dae7859E> + 8001382a: 30a107a3 sb a0,783(sp) + 8001382e: bd8d j 800136a0 <.LBB9_91+0x3e> + 80013830: bf9d j 800137a6 <.LBB9_94+0x38> + 80013832: 4501 li a0,0 + } + 80013834: 38a10323 sb a0,902(sp) + 80013838: 38714503 lbu a0,903(sp) + 8001383c: 8905 andi a0,a0,1 + 8001383e: e901 bnez a0,8001384e <.LBB9_94+0xe0> + 80013840: bf85 j 800137b0 <.LBB9_94+0x42> + 80013842: 1aa8 addi a0,sp,376 + 80013844: ffff4097 auipc ra,0xffff4 + 80013848: 8ec080e7 jalr -1812(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8001384c: b7dd j 80013832 <.LBB9_94+0xc4> + 8001384e: 0aa8 addi a0,sp,344 + 80013850: ffff4097 auipc ra,0xffff4 + 80013854: 816080e7 jalr -2026(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80013858: bfa1 j 800137b0 <.LBB9_94+0x42> + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec17h5f20106c7a7bbe80E: + +000000008001385a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec17h5f20106c7a7bbe80E>: + pub fn sys_exec(&self) -> SysResult { + 8001385a: bb010113 addi sp,sp,-1104 + 8001385e: 44113423 sd ra,1096(sp) + 80013862: ee2a sd a0,280(sp) + 80013864: 38a13c23 sd a0,920(sp) + 80013868: 0288 addi a0,sp,320 + 8001386a: 4581 li a1,0 + 8001386c: 08000613 li a2,128 + let mut path = [0u8;MAXPATH]; + 80013870: 00013097 auipc ra,0x13 + 80013874: 864080e7 jalr -1948(ra) # 800260d4 + 80013878: 0388 addi a0,sp,448 + let mut argv = [0 as *mut u8; MAXARG]; + 8001387a: 058c addi a1,sp,704 + 8001387c: f22e sd a1,288(sp) + 8001387e: f62a sd a0,296(sp) + 80013880: aeed j 80013c7a <.LBB10_86+0x3a4> + self.copy_from_str(addr, &mut path, MAXPATH).unwrap(); + 80013882: 65b2 ld a1,264(sp) + 80013884: 6572 ld a0,280(sp) + 80013886: 0290 addi a2,sp,320 + 80013888: 08000713 li a4,128 + 8001388c: 86ba mv a3,a4 + 8001388e: 00002097 auipc ra,0x2 + 80013892: 69c080e7 jalr 1692(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80013896: ea2a sd a0,272(sp) + 80013898: a009 j 8001389a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec17h5f20106c7a7bbe80E+0x40> + 8001389a: 6552 ld a0,272(sp) + +000000008001389c <.LBB10_85>: + 8001389c: 00017597 auipc a1,0x17 + 800138a0: df458593 addi a1,a1,-524 # 8002a690 <.L__unnamed_23> + 800138a4: ffffa097 auipc ra,0xffffa + 800138a8: faa080e7 jalr -86(ra) # 8000d84e <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17hea14d8d7b2208f82E> + 800138ac: a009 j 800138ae <.LBB10_85+0x12> + let user_argv = self.arg(1); + 800138ae: 6572 ld a0,280(sp) + 800138b0: 4585 li a1,1 + 800138b2: 00002097 auipc ra,0x2 + 800138b6: 5c8080e7 jalr 1480(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800138ba: 85aa mv a1,a0 + 800138bc: e22e sd a1,256(sp) + 800138be: 3ca13823 sd a0,976(sp) + 800138c2: a009 j 800138c4 <.LBB10_85+0x28> + 800138c4: 0588 addi a0,sp,704 + 800138c6: 028c addi a1,sp,320 + 800138c8: 08000613 li a2,128 + let path = from_utf8(&path).unwrap(); + 800138cc: 00011097 auipc ra,0x11 + 800138d0: 0c6080e7 jalr 198(ra) # 80024992 <_ZN4core3str8converts9from_utf817h3f0a2d8686bfd9bbE> + 800138d4: a009 j 800138d6 <.LBB10_86> + +00000000800138d6 <.LBB10_86>: + 800138d6: 00017597 auipc a1,0x17 + 800138da: dd258593 addi a1,a1,-558 # 8002a6a8 <.L__unnamed_24> + 800138de: 0588 addi a0,sp,704 + 800138e0: ffffa097 auipc ra,0xffffa + 800138e4: f22080e7 jalr -222(ra) # 8000d802 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17he7e280ca90d46427E> + 800138e8: 862a mv a2,a0 + 800138ea: f9b2 sd a2,240(sp) + 800138ec: 862e mv a2,a1 + 800138ee: fdb2 sd a2,248(sp) + 800138f0: 3ca13c23 sd a0,984(sp) + 800138f4: 3eb13023 sd a1,992(sp) + 800138f8: a009 j 800138fa <.LBB10_86+0x24> + 800138fa: 4501 li a0,0 + let mut count = 0; + 800138fc: 2ca13c23 sd a0,728(sp) + loop { + 80013900: a009 j 80013902 <.LBB10_86+0x2c> + if count >= argv.len() { + 80013902: 2d813503 ld a0,728(sp) + 80013906: f1aa sd a0,224(sp) + 80013908: 0388 addi a0,sp,448 + 8001390a: 02000593 li a1,32 + 8001390e: 0000d097 auipc ra,0xd + 80013912: b80080e7 jalr -1152(ra) # 8002048e <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17ha6c4bb93a093d49eE> + 80013916: f5aa sd a0,232(sp) + 80013918: a009 j 8001391a <.LBB10_86+0x44> + 8001391a: 750e ld a0,224(sp) + 8001391c: 75ae ld a1,232(sp) + 8001391e: 02b56163 bltu a0,a1,80013940 <.LBB10_86+0x6a> + 80013922: a009 j 80013924 <.LBB10_86+0x4e> + 80013924: 4501 li a0,0 + for i in 0..MAXARG { + 80013926: 2ea13023 sd a0,736(sp) + 8001392a: 02000593 li a1,32 + 8001392e: 2eb13423 sd a1,744(sp) + 80013932: 0000d097 auipc ra,0xd + 80013936: ede080e7 jalr -290(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8001393a: e9aa sd a0,208(sp) + 8001393c: edae sd a1,216(sp) + 8001393e: a801 j 8001394e <.LBB10_86+0x78> + 80013940: 4501 li a0,0 + let mut buf = [0u8;8]; + 80013942: 30a13823 sd a0,784(sp) + user_argv + count * size_of::(), + 80013946: 2d813503 ld a0,728(sp) + 8001394a: e5aa sd a0,200(sp) + 8001394c: a8b5 j 800139c8 <.LBB10_86+0xf2> + for i in 0..MAXARG { + 8001394e: 656e ld a0,216(sp) + 80013950: 65ce ld a1,208(sp) + 80013952: 2eb13823 sd a1,752(sp) + 80013956: 2ea13c23 sd a0,760(sp) + 8001395a: a009 j 8001395c <.LBB10_86+0x86> + 8001395c: 1d88 addi a0,sp,752 + 8001395e: 0000d097 auipc ra,0xd + 80013962: e44080e7 jalr -444(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80013966: 30a13023 sd a0,768(sp) + 8001396a: 30b13423 sd a1,776(sp) + 8001396e: a009 j 80013970 <.LBB10_86+0x9a> + 80013970: 30013503 ld a0,768(sp) + 80013974: 4581 li a1,0 + 80013976: 00b50463 beq a0,a1,8001397e <.LBB10_86+0xa8> + 8001397a: a009 j 8001397c <.LBB10_86+0xa6> + 8001397c: a029 j 80013986 <.LBB10_86+0xb0> + 8001397e: 4505 li a0,1 + return Err(()); + 80013980: fa2a sd a0,304(sp) + 80013982: a4ed j 80013c6c <.LBB10_86+0x396> + for i in 0..MAXARG { + 80013984: 0000 unimp + 80013986: 30813583 ld a1,776(sp) + 8001398a: e1ae sd a1,192(sp) + 8001398c: 3eb13423 sd a1,1000(sp) + 80013990: 3eb13823 sd a1,1008(sp) + 80013994: 3eb13c23 sd a1,1016(sp) + 80013998: 457d li a0,31 + if argv[i] != 0 as *mut u8 { + 8001399a: 30b56763 bltu a0,a1,80013ca8 <.LBB10_86+0x3d2> + 8001399e: a009 j 800139a0 <.LBB10_86+0xca> + 800139a0: 650e ld a0,192(sp) + 800139a2: 00351593 slli a1,a0,0x3 + 800139a6: 0388 addi a0,sp,448 + 800139a8: 952e add a0,a0,a1 + 800139aa: 6108 ld a0,0(a0) + 800139ac: 4581 li a1,0 + 800139ae: 00b50963 beq a0,a1,800139c0 <.LBB10_86+0xea> + 800139b2: a009 j 800139b4 <.LBB10_86+0xde> + 800139b4: 650e ld a0,192(sp) + 800139b6: 02000593 li a1,32 + unsafe{ drop_in_place(argv[i] as *mut RawPage) }; + 800139ba: 00b56463 bltu a0,a1,800139c2 <.LBB10_86+0xec> + 800139be: a609 j 80013cc0 <.LBB10_87+0x16> + if argv[i] != 0 as *mut u8 { + 800139c0: a019 j 800139c6 <.LBB10_86+0xf0> + unsafe{ drop_in_place(argv[i] as *mut RawPage) }; + 800139c2: a009 j 800139c4 <.LBB10_86+0xee> + if argv[i] != 0 as *mut u8 { + 800139c4: a009 j 800139c6 <.LBB10_86+0xf0> + for i in 0..MAXARG { + 800139c6: bf59 j 8001395c <.LBB10_86+0x86> + 800139c8: 65ae ld a1,200(sp) + 800139ca: 4505 li a0,1 + 800139cc: 1576 slli a0,a0,0x3d + 800139ce: 157d addi a0,a0,-1 + user_argv + count * size_of::(), + 800139d0: 8d6d and a0,a0,a1 + 800139d2: 00359613 slli a2,a1,0x3 + 800139d6: fd32 sd a2,184(sp) + 800139d8: 30b51063 bne a0,a1,80013cd8 <.LBB10_89> + 800139dc: a009 j 800139de <.LBB10_86+0x108> + 800139de: 6592 ld a1,256(sp) + 800139e0: 756a ld a0,184(sp) + 800139e2: 952e add a0,a0,a1 + 800139e4: f92a sd a0,176(sp) + 800139e6: 30b56863 bltu a0,a1,80013cf6 <.LBB10_91> + 800139ea: a009 j 800139ec <.LBB10_86+0x116> + self.copy_form_addr( + 800139ec: 75ca ld a1,176(sp) + 800139ee: 6572 ld a0,280(sp) + 800139f0: 0e10 addi a2,sp,784 + 800139f2: 4721 li a4,8 + 800139f4: 86ba mv a3,a4 + 800139f6: 00002097 auipc ra,0x2 + 800139fa: 602080e7 jalr 1538(ra) # 80015ff8 <_ZN6kernel7syscall7Syscall14copy_form_addr17h37cb4654fc973487E> + 800139fe: f52a sd a0,168(sp) + 80013a00: a009 j 80013a02 <.LBB10_86+0x12c> + 80013a02: 752a ld a0,168(sp) + 80013a04: ffffa097 auipc ra,0xffffa + 80013a08: 12a080e7 jalr 298(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 80013a0c: 30a10fa3 sb a0,799(sp) + 80013a10: a009 j 80013a12 <.LBB10_86+0x13c> + )?; + 80013a12: 31f14503 lbu a0,799(sp) + 80013a16: 8905 andi a0,a0,1 + 80013a18: 4581 li a1,0 + 80013a1a: 00b50463 beq a0,a1,80013a22 <.LBB10_86+0x14c> + 80013a1e: a009 j 80013a20 <.LBB10_86+0x14a> + 80013a20: a821 j 80013a38 <.LBB10_86+0x162> + user_arg = usize::from_le_bytes(buf); + 80013a22: 31013503 ld a0,784(sp) + 80013a26: 32a13023 sd a0,800(sp) + 80013a2a: 0000b097 auipc ra,0xb + 80013a2e: 54e080e7 jalr 1358(ra) # 8001ef78 <_ZN4core3num23_$LT$impl$u20$usize$GT$13from_le_bytes17h3bceb23301b73de9E> + 80013a32: f12a sd a0,160(sp) + 80013a34: a831 j 80013a50 <.LBB10_86+0x17a> + self.copy_form_addr( + 80013a36: 0000 unimp + )?; + 80013a38: ffff9097 auipc ra,0xffff9 + 80013a3c: 948080e7 jalr -1720(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80013a40: a009 j 80013a42 <.LBB10_86+0x16c> + self.copy_form_addr( + 80013a42: ffffa097 auipc ra,0xffffa + 80013a46: fc0080e7 jalr -64(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 80013a4a: fa2a sd a0,304(sp) + 80013a4c: fe2e sd a1,312(sp) + 80013a4e: ac39 j 80013c6c <.LBB10_86+0x396> + user_arg = usize::from_le_bytes(buf); + 80013a50: 750a ld a0,160(sp) + 80013a52: 40a13023 sd a0,1024(sp) + 80013a56: 4581 li a1,0 + if user_arg == 0 { + 80013a58: 00b51b63 bne a0,a1,80013a6e <.LBB10_86+0x198> + 80013a5c: a009 j 80013a5e <.LBB10_86+0x188> + argv[count] = 0 as *mut u8; + 80013a5e: 2d813503 ld a0,728(sp) + 80013a62: ed2a sd a0,152(sp) + 80013a64: 02000593 li a1,32 + 80013a68: 00b56963 bltu a0,a1,80013a7a <.LBB10_86+0x1a4> + 80013a6c: ace9 j 80013d46 <.LBB10_95+0x14> + let mem = unsafe{ RawPage::new_zeroed() as *mut u8 }; + 80013a6e: ffff7097 auipc ra,0xffff7 + 80013a72: d1e080e7 jalr -738(ra) # 8000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E> + 80013a76: e92a sd a0,144(sp) + 80013a78: a00d j 80013a9a <.LBB10_86+0x1c4> + argv[count] = 0 as *mut u8; + 80013a7a: 656a ld a0,152(sp) + 80013a7c: 00351593 slli a1,a0,0x3 + 80013a80: 0388 addi a0,sp,448 + 80013a82: 00b50633 add a2,a0,a1 + 80013a86: 4581 li a1,0 + 80013a88: e20c sd a1,0(a2) + 80013a8a: 02000593 li a1,32 + argv.as_ptr() as *const *const u8, + 80013a8e: 0000d097 auipc ra,0xd + 80013a92: a66080e7 jalr -1434(ra) # 800204f4 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hc3575ad36de0bb27E> + 80013a96: e52a sd a0,136(sp) + 80013a98: a065 j 80013b40 <.LBB10_86+0x26a> + let mem = unsafe{ RawPage::new_zeroed() as *mut u8 }; + 80013a9a: 654a ld a0,144(sp) + 80013a9c: 85aa mv a1,a0 + 80013a9e: fcae sd a1,120(sp) + 80013aa0: 40a13423 sd a0,1032(sp) + argv[count] = mem; + 80013aa4: 2d813583 ld a1,728(sp) + 80013aa8: e12e sd a1,128(sp) + 80013aaa: 457d li a0,31 + 80013aac: 26b56363 bltu a0,a1,80013d12 <.LBB10_92+0x14> + 80013ab0: a009 j 80013ab2 <.LBB10_86+0x1dc> + 80013ab2: 7566 ld a0,120(sp) + 80013ab4: 658a ld a1,128(sp) + 80013ab6: 00359613 slli a2,a1,0x3 + 80013aba: 038c addi a1,sp,448 + 80013abc: 95b2 add a1,a1,a2 + 80013abe: e188 sd a0,0(a1) + 80013ac0: 6585 lui a1,0x1 + let buf = unsafe { from_raw_parts_mut(mem, PGSIZE) }; + 80013ac2: ffff2097 auipc ra,0xffff2 + 80013ac6: a4c080e7 jalr -1460(ra) # 8000550e <_ZN4core5slice3raw18from_raw_parts_mut17h0bc9e5c0c3217bc8E> + 80013aca: f4aa sd a0,104(sp) + 80013acc: f8ae sd a1,112(sp) + 80013ace: a009 j 80013ad0 <.LBB10_86+0x1fa> + 80013ad0: 76c6 ld a3,112(sp) + 80013ad2: 7626 ld a2,104(sp) + 80013ad4: 758a ld a1,160(sp) + 80013ad6: 6572 ld a0,280(sp) + 80013ad8: 40c13823 sd a2,1040(sp) + 80013adc: 40d13c23 sd a3,1048(sp) + 80013ae0: 6705 lui a4,0x1 + self.copy_from_str( + 80013ae2: 00002097 auipc ra,0x2 + 80013ae6: 448080e7 jalr 1096(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80013aea: f0aa sd a0,96(sp) + 80013aec: a009 j 80013aee <.LBB10_86+0x218> + 80013aee: 7506 ld a0,96(sp) + 80013af0: ffffa097 auipc ra,0xffffa + 80013af4: 03e080e7 jalr 62(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 80013af8: 32a107a3 sb a0,815(sp) + 80013afc: a009 j 80013afe <.LBB10_86+0x228> + )?; + 80013afe: 32f14503 lbu a0,815(sp) + 80013b02: 8905 andi a0,a0,1 + 80013b04: 4581 li a1,0 + 80013b06: 00b50463 beq a0,a1,80013b0e <.LBB10_86+0x238> + 80013b0a: a009 j 80013b0c <.LBB10_86+0x236> + 80013b0c: a811 j 80013b20 <.LBB10_86+0x24a> + count += 1; + 80013b0e: 2d813583 ld a1,728(sp) + 80013b12: 00158513 addi a0,a1,1 # 1001 <.Lline_table_start0+0x141> + 80013b16: ecaa sd a0,88(sp) + 80013b18: 20b56963 bltu a0,a1,80013d2a <.LBB10_94> + 80013b1c: a831 j 80013b38 <.LBB10_86+0x262> + self.copy_from_str( + 80013b1e: 0000 unimp + )?; + 80013b20: ffff9097 auipc ra,0xffff9 + 80013b24: 860080e7 jalr -1952(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80013b28: a009 j 80013b2a <.LBB10_86+0x254> + self.copy_from_str( + 80013b2a: ffffa097 auipc ra,0xffffa + 80013b2e: ed8080e7 jalr -296(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 80013b32: fa2a sd a0,304(sp) + 80013b34: fe2e sd a1,312(sp) + 80013b36: aa1d j 80013c6c <.LBB10_86+0x396> + count += 1; + 80013b38: 6566 ld a0,88(sp) + 80013b3a: 2ca13c23 sd a0,728(sp) + loop { + 80013b3e: b3d1 j 80013902 <.LBB10_86+0x2c> + from_raw_parts( + 80013b40: 652a ld a0,136(sp) + 80013b42: 02000593 li a1,32 + 80013b46: ffff2097 auipc ra,0xffff2 + 80013b4a: 988080e7 jalr -1656(ra) # 800054ce <_ZN4core5slice3raw14from_raw_parts17h24ea7267a8aa7c05E> + 80013b4e: 32a13823 sd a0,816(sp) + 80013b52: 32b13c23 sd a1,824(sp) + 80013b56: a009 j 80013b58 <.LBB10_86+0x282> + exec(path, &argv).map_err( + 80013b58: 766e ld a2,248(sp) + 80013b5a: 75ce ld a1,240(sp) + 80013b5c: 33013683 ld a3,816(sp) + 80013b60: 33813703 ld a4,824(sp) + 80013b64: 0e88 addi a0,sp,848 + 80013b66: fffee097 auipc ra,0xfffee + 80013b6a: 81a080e7 jalr -2022(ra) # 80001380 <_ZN6kernel7process3elf4exec17h6cecf459cb29fe26E> + 80013b6e: a009 j 80013b70 <.LBB10_86+0x29a> + 80013b70: 0e88 addi a0,sp,848 + 80013b72: ffffa097 auipc ra,0xffffa + 80013b76: dea080e7 jalr -534(ra) # 8000d95c <_ZN4core6result19Result$LT$T$C$E$GT$7map_err17hacf552840fbd34a9E> + 80013b7a: e4aa sd a0,72(sp) + 80013b7c: e8ae sd a1,80(sp) + 80013b7e: a009 j 80013b80 <.LBB10_86+0x2aa> + 80013b80: 65c6 ld a1,80(sp) + 80013b82: 6526 ld a0,72(sp) + 80013b84: ffffa097 auipc ra,0xffffa + 80013b88: fbe080e7 jalr -66(ra) # 8000db42 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb8d2d18a4141e592E> + 80013b8c: 34a13023 sd a0,832(sp) + 80013b90: 34b13423 sd a1,840(sp) + 80013b94: a009 j 80013b96 <.LBB10_86+0x2c0> + )? + 80013b96: 34013503 ld a0,832(sp) + 80013b9a: 4581 li a1,0 + 80013b9c: 00b50463 beq a0,a1,80013ba4 <.LBB10_86+0x2ce> + 80013ba0: a009 j 80013ba2 <.LBB10_86+0x2cc> + 80013ba2: a03d j 80013bd0 <.LBB10_86+0x2fa> + exec(path, &argv).map_err( + 80013ba4: 34813503 ld a0,840(sp) + 80013ba8: f82a sd a0,48(sp) + 80013baa: 42a13023 sd a0,1056(sp) + 80013bae: 42a13423 sd a0,1064(sp) + 80013bb2: 4501 li a0,0 + }; + + for i in 0..MAXARG { + 80013bb4: 36a13423 sd a0,872(sp) + 80013bb8: 02000593 li a1,32 + 80013bbc: 36b13823 sd a1,880(sp) + 80013bc0: 0000d097 auipc ra,0xd + 80013bc4: c50080e7 jalr -944(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80013bc8: fc2a sd a0,56(sp) + 80013bca: e0ae sd a1,64(sp) + 80013bcc: a831 j 80013be8 <.LBB10_86+0x312> + exec(path, &argv).map_err( + 80013bce: 0000 unimp + )? + 80013bd0: ffff8097 auipc ra,0xffff8 + 80013bd4: 7b0080e7 jalr 1968(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80013bd8: a009 j 80013bda <.LBB10_86+0x304> + exec(path, &argv).map_err( + 80013bda: ffffa097 auipc ra,0xffffa + 80013bde: e28080e7 jalr -472(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 80013be2: fa2a sd a0,304(sp) + 80013be4: fe2e sd a1,312(sp) + 80013be6: a059 j 80013c6c <.LBB10_86+0x396> + for i in 0..MAXARG { + 80013be8: 6506 ld a0,64(sp) + 80013bea: 75e2 ld a1,56(sp) + 80013bec: 36b13c23 sd a1,888(sp) + 80013bf0: 38a13023 sd a0,896(sp) + 80013bf4: a009 j 80013bf6 <.LBB10_86+0x320> + 80013bf6: 1ea8 addi a0,sp,888 + 80013bf8: 0000d097 auipc ra,0xd + 80013bfc: baa080e7 jalr -1110(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80013c00: 38a13423 sd a0,904(sp) + 80013c04: 38b13823 sd a1,912(sp) + 80013c08: a009 j 80013c0a <.LBB10_86+0x334> + 80013c0a: 38813503 ld a0,904(sp) + 80013c0e: 4581 li a1,0 + 80013c10: 00b50463 beq a0,a1,80013c18 <.LBB10_86+0x342> + 80013c14: a009 j 80013c16 <.LBB10_86+0x340> + 80013c16: a039 j 80013c24 <.LBB10_86+0x34e> + if argv[i] != 0 as *mut u8 { + unsafe{ drop_in_place(argv[i] as *mut RawPage) }; + } + } + // println!("[Debug] sys_exec return {}", ret); + Ok(ret) + 80013c18: 7542 ld a0,48(sp) + 80013c1a: fe2a sd a0,312(sp) + 80013c1c: 4501 li a0,0 + 80013c1e: fa2a sd a0,304(sp) + } + 80013c20: a0b1 j 80013c6c <.LBB10_86+0x396> + for i in 0..MAXARG { + 80013c22: 0000 unimp + 80013c24: 39013503 ld a0,912(sp) + 80013c28: f02a sd a0,32(sp) + 80013c2a: 42a13823 sd a0,1072(sp) + 80013c2e: 42a13c23 sd a0,1080(sp) + 80013c32: 44a13023 sd a0,1088(sp) + if argv[i] != 0 as *mut u8 { + 80013c36: 33813583 ld a1,824(sp) + 80013c3a: f42e sd a1,40(sp) + 80013c3c: 12b57163 bgeu a0,a1,80013d5e <.LBB10_96+0x16> + 80013c40: a009 j 80013c42 <.LBB10_86+0x36c> + 80013c42: 7582 ld a1,32(sp) + 80013c44: 33013503 ld a0,816(sp) + 80013c48: 058e slli a1,a1,0x3 + 80013c4a: 952e add a0,a0,a1 + 80013c4c: 6108 ld a0,0(a0) + 80013c4e: 4581 li a1,0 + 80013c50: 00b50a63 beq a0,a1,80013c64 <.LBB10_86+0x38e> + 80013c54: a009 j 80013c56 <.LBB10_86+0x380> + unsafe{ drop_in_place(argv[i] as *mut RawPage) }; + 80013c56: 7502 ld a0,32(sp) + 80013c58: 33813583 ld a1,824(sp) + 80013c5c: ec2e sd a1,24(sp) + 80013c5e: 00b56463 bltu a0,a1,80013c66 <.LBB10_86+0x390> + 80013c62: aa09 j 80013d74 <.LBB10_97+0x12> + if argv[i] != 0 as *mut u8 { + 80013c64: a019 j 80013c6a <.LBB10_86+0x394> + unsafe{ drop_in_place(argv[i] as *mut RawPage) }; + 80013c66: a009 j 80013c68 <.LBB10_86+0x392> + if argv[i] != 0 as *mut u8 { + 80013c68: a009 j 80013c6a <.LBB10_86+0x394> + for i in 0..MAXARG { + 80013c6a: b771 j 80013bf6 <.LBB10_86+0x320> + } + 80013c6c: 7552 ld a0,304(sp) + 80013c6e: 75f2 ld a1,312(sp) + 80013c70: 44813083 ld ra,1096(sp) + 80013c74: 45010113 addi sp,sp,1104 + 80013c78: 8082 ret + 80013c7a: 7592 ld a1,288(sp) + 80013c7c: 7532 ld a0,296(sp) + 80013c7e: e82a sd a0,16(sp) + 80013c80: 00b50963 beq a0,a1,80013c92 <.LBB10_86+0x3bc> + 80013c84: a009 j 80013c86 <.LBB10_86+0x3b0> + 80013c86: 6542 ld a0,16(sp) + 80013c88: 4581 li a1,0 + 80013c8a: e10c sd a1,0(a0) + 80013c8c: 0521 addi a0,a0,8 + 80013c8e: f62a sd a0,296(sp) + 80013c90: b7ed j 80013c7a <.LBB10_86+0x3a4> + let addr = self.arg(0); + 80013c92: 6572 ld a0,280(sp) + 80013c94: 4581 li a1,0 + 80013c96: 00002097 auipc ra,0x2 + 80013c9a: 1e4080e7 jalr 484(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013c9e: 85aa mv a1,a0 + 80013ca0: e62e sd a1,264(sp) + 80013ca2: 3ca13423 sd a0,968(sp) + 80013ca6: bef1 j 80013882 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec17h5f20106c7a7bbe80E+0x28> + if argv[i] != 0 as *mut u8 { + 80013ca8: 650e ld a0,192(sp) + +0000000080013caa <.LBB10_87>: + 80013caa: 00017617 auipc a2,0x17 + 80013cae: a1660613 addi a2,a2,-1514 # 8002a6c0 <.L__unnamed_25> + 80013cb2: 02000593 li a1,32 + 80013cb6: 0000f097 auipc ra,0xf + 80013cba: 4ba080e7 jalr 1210(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80013cbe: 0000 unimp + unsafe{ drop_in_place(argv[i] as *mut RawPage) }; + 80013cc0: 650e ld a0,192(sp) + +0000000080013cc2 <.LBB10_88>: + 80013cc2: 00017617 auipc a2,0x17 + 80013cc6: a1660613 addi a2,a2,-1514 # 8002a6d8 <.L__unnamed_26> + 80013cca: 02000593 li a1,32 + 80013cce: 0000f097 auipc ra,0xf + 80013cd2: 4a2080e7 jalr 1186(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080013cd8 <.LBB10_89>: + user_argv + count * size_of::(), + 80013cd8: 00017517 auipc a0,0x17 + 80013cdc: a3850513 addi a0,a0,-1480 # 8002a710 + +0000000080013ce0 <.LBB10_90>: + 80013ce0: 00017617 auipc a2,0x17 + 80013ce4: a1060613 addi a2,a2,-1520 # 8002a6f0 <.L__unnamed_27> + 80013ce8: 02100593 li a1,33 + 80013cec: 0000f097 auipc ra,0xf + 80013cf0: 458080e7 jalr 1112(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080013cf6 <.LBB10_91>: + 80013cf6: 00017517 auipc a0,0x17 + 80013cfa: a5a50513 addi a0,a0,-1446 # 8002a750 + +0000000080013cfe <.LBB10_92>: + 80013cfe: 00017617 auipc a2,0x17 + 80013d02: a3a60613 addi a2,a2,-1478 # 8002a738 <.L__unnamed_28> + 80013d06: 45f1 li a1,28 + 80013d08: 0000f097 auipc ra,0xf + 80013d0c: 43c080e7 jalr 1084(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80013d10: 0000 unimp + argv[count] = mem; + 80013d12: 650a ld a0,128(sp) + +0000000080013d14 <.LBB10_93>: + 80013d14: 00017617 auipc a2,0x17 + 80013d18: a5c60613 addi a2,a2,-1444 # 8002a770 <.L__unnamed_29> + 80013d1c: 02000593 li a1,32 + 80013d20: 0000f097 auipc ra,0xf + 80013d24: 450080e7 jalr 1104(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080013d2a <.LBB10_94>: + count += 1; + 80013d2a: 00017517 auipc a0,0x17 + 80013d2e: a2650513 addi a0,a0,-1498 # 8002a750 + +0000000080013d32 <.LBB10_95>: + 80013d32: 00017617 auipc a2,0x17 + 80013d36: a5660613 addi a2,a2,-1450 # 8002a788 <.L__unnamed_30> + 80013d3a: 45f1 li a1,28 + 80013d3c: 0000f097 auipc ra,0xf + 80013d40: 408080e7 jalr 1032(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80013d44: 0000 unimp + argv[count] = 0 as *mut u8; + 80013d46: 656a ld a0,152(sp) + +0000000080013d48 <.LBB10_96>: + 80013d48: 00017617 auipc a2,0x17 + 80013d4c: a5860613 addi a2,a2,-1448 # 8002a7a0 <.L__unnamed_31> + 80013d50: 02000593 li a1,32 + 80013d54: 0000f097 auipc ra,0xf + 80013d58: 41c080e7 jalr 1052(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80013d5c: 0000 unimp + if argv[i] != 0 as *mut u8 { + 80013d5e: 75a2 ld a1,40(sp) + 80013d60: 7502 ld a0,32(sp) + +0000000080013d62 <.LBB10_97>: + 80013d62: 00017617 auipc a2,0x17 + 80013d66: a5660613 addi a2,a2,-1450 # 8002a7b8 <.L__unnamed_32> + 80013d6a: 0000f097 auipc ra,0xf + 80013d6e: 406080e7 jalr 1030(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80013d72: 0000 unimp + unsafe{ drop_in_place(argv[i] as *mut RawPage) }; + 80013d74: 65e2 ld a1,24(sp) + 80013d76: 7502 ld a0,32(sp) + +0000000080013d78 <.LBB10_98>: + 80013d78: 00017617 auipc a2,0x17 + 80013d7c: a5860613 addi a2,a2,-1448 # 8002a7d0 <.L__unnamed_33> + 80013d80: 0000f097 auipc ra,0xf + 80013d84: 3f0080e7 jalr 1008(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_mknod17h6bbc97745668998fE: + +0000000080013d8a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_mknod17h6bbc97745668998fE>: + + pub fn sys_mknod(&self) -> SysResult { + 80013d8a: 7161 addi sp,sp,-432 + 80013d8c: f706 sd ra,424(sp) + 80013d8e: f82a sd a0,48(sp) + 80013d90: faaa sd a0,368(sp) + 80013d92: 05710513 addi a0,sp,87 + 80013d96: 4581 li a1,0 + 80013d98: 08000613 li a2,128 + let mut path: [u8; MAXPATH] = [0;MAXPATH]; + 80013d9c: 00012097 auipc ra,0x12 + 80013da0: 338080e7 jalr 824(ra) # 800260d4 + let major = self.arg(1); + 80013da4: 7542 ld a0,48(sp) + 80013da6: 4585 li a1,1 + 80013da8: 00002097 auipc ra,0x2 + 80013dac: 0d2080e7 jalr 210(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013db0: 85aa mv a1,a0 + 80013db2: fc2e sd a1,56(sp) + 80013db4: e72a sd a0,392(sp) + 80013db6: a009 j 80013db8 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_mknod17h6bbc97745668998fE+0x2e> + let minor = self.arg(2); + 80013db8: 7542 ld a0,48(sp) + 80013dba: 4589 li a1,2 + 80013dbc: 00002097 auipc ra,0x2 + 80013dc0: 0be080e7 jalr 190(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013dc4: 85aa mv a1,a0 + 80013dc6: f42e sd a1,40(sp) + 80013dc8: eb2a sd a0,400(sp) + 80013dca: a009 j 80013dcc <.LBB11_25> + +0000000080013dcc <.LBB11_25>: + LOG.begin_op(); + 80013dcc: 00047517 auipc a0,0x47 + 80013dd0: 70c50513 addi a0,a0,1804 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80013dd4: ffff5097 auipc ra,0xffff5 + 80013dd8: 606080e7 jalr 1542(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 80013ddc: a009 j 80013dde <.LBB11_25+0x12> + // Get file path + let addr = self.arg(0); + 80013dde: 7542 ld a0,48(sp) + 80013de0: 4581 li a1,0 + 80013de2: 00002097 auipc ra,0x2 + 80013de6: 098080e7 jalr 152(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013dea: 85aa mv a1,a0 + 80013dec: f02e sd a1,32(sp) + 80013dee: ef2a sd a0,408(sp) + 80013df0: a009 j 80013df2 <.LBB11_25+0x26> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 80013df2: 7582 ld a1,32(sp) + 80013df4: 7542 ld a0,48(sp) + 80013df6: 05710613 addi a2,sp,87 + 80013dfa: 08000713 li a4,128 + 80013dfe: 86ba mv a3,a4 + 80013e00: 00002097 auipc ra,0x2 + 80013e04: 12a080e7 jalr 298(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80013e08: ec2a sd a0,24(sp) + 80013e0a: a009 j 80013e0c <.LBB11_25+0x40> + 80013e0c: 6562 ld a0,24(sp) + 80013e0e: ffffa097 auipc ra,0xffffa + 80013e12: d20080e7 jalr -736(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 80013e16: 0ca10ba3 sb a0,215(sp) + 80013e1a: a009 j 80013e1c <.LBB11_25+0x50> + 80013e1c: 0d714503 lbu a0,215(sp) + 80013e20: 8905 andi a0,a0,1 + 80013e22: 4581 li a1,0 + 80013e24: 00b50463 beq a0,a1,80013e2c <.LBB11_25+0x60> + 80013e28: a009 j 80013e2a <.LBB11_25+0x5e> + 80013e2a: a02d j 80013e54 <.LBB11_26+0x1e> + 80013e2c: 7822 ld a6,40(sp) + 80013e2e: 77e2 ld a5,56(sp) + 80013e30: 470d li a4,3 + match ICACHE.create( + &path, + InodeType::Device, + 80013e32: 0ee11b23 sh a4,246(sp) + +0000000080013e36 <.LBB11_26>: + match ICACHE.create( + 80013e36: 00047597 auipc a1,0x47 + 80013e3a: 74a58593 addi a1,a1,1866 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 80013e3e: 09a8 addi a0,sp,216 + 80013e40: 05710613 addi a2,sp,87 + 80013e44: 08000693 li a3,128 + 80013e48: 00006097 auipc ra,0x6 + 80013e4c: 424080e7 jalr 1060(ra) # 8001a26c <_ZN6kernel2fs5inode10InodeCache6create17hf2583436fcb9d2ecE> + 80013e50: a831 j 80013e6c <.LBB11_26+0x36> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 80013e52: 0000 unimp + 80013e54: ffff8097 auipc ra,0xffff8 + 80013e58: 52c080e7 jalr 1324(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80013e5c: a009 j 80013e5e <.LBB11_26+0x28> + 80013e5e: ffffa097 auipc ra,0xffffa + 80013e62: ba4080e7 jalr -1116(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 80013e66: e0aa sd a0,64(sp) + 80013e68: e4ae sd a1,72(sp) + 80013e6a: a07d j 80013f18 <.LBB11_30+0x1a> + major as i16, + minor as i16 + ) { + Ok(inode) => { + 80013e6c: 656e ld a0,216(sp) + 80013e6e: 4581 li a1,0 + 80013e70: 02b50663 beq a0,a1,80013e9c <.LBB11_27+0x18> + 80013e74: a009 j 80013e76 <.LBB11_26+0x40> + LOG.end_op(); + drop(inode); + Ok(0) + }, + + Err(err) => { + 80013e76: 758e ld a1,224(sp) + 80013e78: 752e ld a0,232(sp) + 80013e7a: ee2e sd a1,280(sp) + 80013e7c: f22a sd a0,288(sp) + 80013e7e: 0a28 addi a0,sp,280 + println!("[Kernel] sys_mknod: err: {}", err); + 80013e80: f6aa sd a0,360(sp) + 80013e82: f32a sd a0,416(sp) + +0000000080013e84 <.LBB11_27>: + 80013e84: 0000b597 auipc a1,0xb + 80013e88: 5dc58593 addi a1,a1,1500 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80013e8c: 0000b097 auipc ra,0xb + 80013e90: 5f8080e7 jalr 1528(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 80013e94: e42a sd a0,8(sp) + 80013e96: e82e sd a1,16(sp) + 80013e98: a825 j 80013ed0 <.LBB11_28+0x2c> + match ICACHE.create( + 80013e9a: 0000 unimp + Ok(inode) => { + 80013e9c: 752e ld a0,232(sp) + 80013e9e: e22a sd a0,256(sp) + 80013ea0: 750e ld a0,224(sp) + 80013ea2: fdaa sd a0,248(sp) + +0000000080013ea4 <.LBB11_28>: + LOG.end_op(); + 80013ea4: 00047517 auipc a0,0x47 + 80013ea8: 63450513 addi a0,a0,1588 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80013eac: ffff6097 auipc ra,0xffff6 + 80013eb0: b14080e7 jalr -1260(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80013eb4: a009 j 80013eb6 <.LBB11_28+0x12> + drop(inode); + 80013eb6: 6592 ld a1,256(sp) + 80013eb8: ea2e sd a1,272(sp) + 80013eba: 756e ld a0,248(sp) + 80013ebc: e62a sd a0,264(sp) + 80013ebe: 0000a097 auipc ra,0xa + 80013ec2: 042080e7 jalr 66(ra) # 8001df00 <_ZN4core3mem4drop17hb93abdfe16b94be5E> + 80013ec6: a009 j 80013ec8 <.LBB11_28+0x24> + 80013ec8: 4501 li a0,0 + Ok(0) + 80013eca: e4aa sd a0,72(sp) + 80013ecc: e0aa sd a0,64(sp) + match ICACHE.create( + 80013ece: a0a1 j 80013f16 <.LBB11_30+0x18> + println!("[Kernel] sys_mknod: err: {}", err); + 80013ed0: 6542 ld a0,16(sp) + 80013ed2: 65a2 ld a1,8(sp) + 80013ed4: eeae sd a1,344(sp) + 80013ed6: f2aa sd a0,352(sp) + +0000000080013ed8 <.LBB11_29>: + 80013ed8: 00017597 auipc a1,0x17 + 80013edc: 93058593 addi a1,a1,-1744 # 8002a808 <.L__unnamed_34> + 80013ee0: 1228 addi a0,sp,296 + 80013ee2: 4609 li a2,2 + 80013ee4: 0ab4 addi a3,sp,344 + 80013ee6: 4705 li a4,1 + 80013ee8: ffff1097 auipc ra,0xffff1 + 80013eec: 6a2080e7 jalr 1698(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80013ef0: a009 j 80013ef2 <.LBB11_29+0x1a> + 80013ef2: 1228 addi a0,sp,296 + 80013ef4: 0000b097 auipc ra,0xb + 80013ef8: d04080e7 jalr -764(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80013efc: a009 j 80013efe <.LBB11_30> + +0000000080013efe <.LBB11_30>: + LOG.end_op(); + 80013efe: 00047517 auipc a0,0x47 + 80013f02: 5da50513 addi a0,a0,1498 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80013f06: ffff6097 auipc ra,0xffff6 + 80013f0a: aba080e7 jalr -1350(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80013f0e: a009 j 80013f10 <.LBB11_30+0x12> + 80013f10: 4505 li a0,1 + Err(()) + 80013f12: e0aa sd a0,64(sp) + match ICACHE.create( + 80013f14: a009 j 80013f16 <.LBB11_30+0x18> + } + } + + } + 80013f16: a009 j 80013f18 <.LBB11_30+0x1a> + 80013f18: 6506 ld a0,64(sp) + 80013f1a: 65a6 ld a1,72(sp) + 80013f1c: 70ba ld ra,424(sp) + 80013f1e: 615d addi sp,sp,432 + 80013f20: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_close17haaef41d651f2f6f7E: + +0000000080013f22 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_close17haaef41d651f2f6f7E>: + + pub fn sys_close(&self) -> SysResult { + 80013f22: 715d addi sp,sp,-80 + 80013f24: e486 sd ra,72(sp) + 80013f26: f82a sd a0,48(sp) + 80013f28: 4581 li a1,0 + let fd = self.arg(0); + 80013f2a: 00002097 auipc ra,0x2 + 80013f2e: f50080e7 jalr -176(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013f32: 85aa mv a1,a0 + 80013f34: e82e sd a1,16(sp) + 80013f36: fc2a sd a0,56(sp) + 80013f38: a009 j 80013f3a <.LBB12_8> + +0000000080013f3a <.LBB12_8>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80013f3a: 00052517 auipc a0,0x52 + 80013f3e: 20650513 addi a0,a0,518 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80013f42: ffffe097 auipc ra,0xffffe + 80013f46: 516080e7 jalr 1302(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80013f4a: e42a sd a0,8(sp) + 80013f4c: a009 j 80013f4e <.LBB12_8+0x14> + 80013f4e: 6522 ld a0,8(sp) + +0000000080013f50 <.LBB12_9>: + 80013f50: 00017597 auipc a1,0x17 + 80013f54: 8d858593 addi a1,a1,-1832 # 8002a828 <.L__unnamed_35> + 80013f58: ffffc097 auipc ra,0xffffc + 80013f5c: 838080e7 jalr -1992(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80013f60: e02a sd a0,0(sp) + 80013f62: a009 j 80013f64 <.LBB12_9+0x14> + 80013f64: 65c2 ld a1,16(sp) + 80013f66: 6502 ld a0,0(sp) + 80013f68: e0aa sd a0,64(sp) + 80013f6a: 06300513 li a0,99 + // 使用 take() 夺取所有权来将引用数减 1 + task.open_files[fd].take(); + 80013f6e: 02b56c63 bltu a0,a1,80013fa6 <.LBB12_9+0x56> + 80013f72: a009 j 80013f74 <.LBB12_9+0x24> + 80013f74: 6502 ld a0,0(sp) + 80013f76: 65c2 ld a1,16(sp) + 80013f78: 058e slli a1,a1,0x3 + 80013f7a: 952e add a0,a0,a1 + 80013f7c: 0a850513 addi a0,a0,168 + 80013f80: ffffb097 auipc ra,0xffffb + 80013f84: 08a080e7 jalr 138(ra) # 8000f00a <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E> + 80013f88: f42a sd a0,40(sp) + 80013f8a: a009 j 80013f8c <.LBB12_9+0x3c> + 80013f8c: 1028 addi a0,sp,40 + 80013f8e: ffff3097 auipc ra,0xffff3 + 80013f92: 288080e7 jalr 648(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80013f96: a009 j 80013f98 <.LBB12_9+0x48> + 80013f98: 4581 li a1,0 + Ok(0) + 80013f9a: f02e sd a1,32(sp) + 80013f9c: ec2e sd a1,24(sp) + } + 80013f9e: 852e mv a0,a1 + 80013fa0: 60a6 ld ra,72(sp) + 80013fa2: 6161 addi sp,sp,80 + 80013fa4: 8082 ret + task.open_files[fd].take(); + 80013fa6: 6542 ld a0,16(sp) + +0000000080013fa8 <.LBB12_10>: + 80013fa8: 00017617 auipc a2,0x17 + 80013fac: 89860613 addi a2,a2,-1896 # 8002a840 <.L__unnamed_36> + 80013fb0: 06400593 li a1,100 + 80013fb4: 0000f097 auipc ra,0xf + 80013fb8: 1bc080e7 jalr 444(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_fstat17h0c7ad2f655d0446dE: + +0000000080013fbe <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_fstat17h0c7ad2f655d0446dE>: + + pub fn sys_fstat(&self) -> SysResult { + 80013fbe: 7111 addi sp,sp,-256 + 80013fc0: fd86 sd ra,248(sp) + 80013fc2: e0aa sd a0,64(sp) + 80013fc4: e5aa sd a0,200(sp) + 80013fc6: 4581 li a1,0 + let fd = self.arg(0); + 80013fc8: 00002097 auipc ra,0x2 + 80013fcc: eb2080e7 jalr -334(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013fd0: 85aa mv a1,a0 + 80013fd2: e4ae sd a1,72(sp) + 80013fd4: e9aa sd a0,208(sp) + 80013fd6: a009 j 80013fd8 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_fstat17h0c7ad2f655d0446dE+0x1a> + let stat = self.arg(1); + 80013fd8: 6506 ld a0,64(sp) + 80013fda: 4585 li a1,1 + 80013fdc: 00002097 auipc ra,0x2 + 80013fe0: e9e080e7 jalr -354(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80013fe4: 85aa mv a1,a0 + 80013fe6: fc2e sd a1,56(sp) + 80013fe8: edaa sd a0,216(sp) + 80013fea: a009 j 80013fec <.LBB13_19> + +0000000080013fec <.LBB13_19>: + + #[cfg(feature = "kernel_debug")] + println!("[Kernel] sys_fstat: fd: {}, stat:0x{:x}", fd, stat); + + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80013fec: 00052517 auipc a0,0x52 + 80013ff0: 15450513 addi a0,a0,340 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80013ff4: ffffe097 auipc ra,0xffffe + 80013ff8: 464080e7 jalr 1124(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80013ffc: f82a sd a0,48(sp) + 80013ffe: a009 j 80014000 <.LBB13_19+0x14> + 80014000: 7542 ld a0,48(sp) + +0000000080014002 <.LBB13_20>: + 80014002: 00017597 auipc a1,0x17 + 80014006: 85658593 addi a1,a1,-1962 # 8002a858 <.L__unnamed_37> + 8001400a: ffffb097 auipc ra,0xffffb + 8001400e: 786080e7 jalr 1926(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80014012: f42a sd a0,40(sp) + 80014014: a009 j 80014016 <.LBB13_20+0x14> + 80014016: 65a6 ld a1,72(sp) + 80014018: 7522 ld a0,40(sp) + 8001401a: f1aa sd a0,224(sp) + 8001401c: 06300513 li a0,99 + let file = task.open_files[fd].as_ref().unwrap(); + 80014020: 0cb56963 bltu a0,a1,800140f2 <.LBB13_23+0x36> + 80014024: a009 j 80014026 <.LBB13_20+0x24> + 80014026: 7522 ld a0,40(sp) + 80014028: 65a6 ld a1,72(sp) + 8001402a: 058e slli a1,a1,0x3 + 8001402c: 952e add a0,a0,a1 + 8001402e: 0a850513 addi a0,a0,168 + 80014032: ffffb097 auipc ra,0xffffb + 80014036: 346080e7 jalr 838(ra) # 8000f378 <_ZN4core6option15Option$LT$T$GT$6as_ref17h0cd8921964ab0966E> + 8001403a: f02a sd a0,32(sp) + 8001403c: a009 j 8001403e <.LBB13_20+0x3c> + 8001403e: 7502 ld a0,32(sp) + +0000000080014040 <.LBB13_21>: + 80014040: 00017597 auipc a1,0x17 + 80014044: 84858593 addi a1,a1,-1976 # 8002a888 <.L__unnamed_38> + 80014048: ffffb097 auipc ra,0xffffb + 8001404c: 63a080e7 jalr 1594(ra) # 8000f682 <_ZN4core6option15Option$LT$T$GT$6unwrap17h84dba6f31c77e511E> + 80014050: 85aa mv a1,a0 + 80014052: ec2e sd a1,24(sp) + 80014054: f5aa sd a0,232(sp) + 80014056: a009 j 80014058 <.LBB13_21+0x18> + + #[cfg(feature = "kernel_debug")] + println!("[Kernel] sys_fstat: File Type: {:?}", file.ftype); + + match file.stat(stat) { + 80014058: 6562 ld a0,24(sp) + 8001405a: fffee097 auipc ra,0xfffee + 8001405e: 570080e7 jalr 1392(ra) # 800025ca <_ZN69_$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h7c280ba665690166E> + 80014062: e82a sd a0,16(sp) + 80014064: a009 j 80014066 <.LBB13_21+0x26> + 80014066: 75e2 ld a1,56(sp) + 80014068: 6542 ld a0,16(sp) + 8001406a: ffff2097 auipc ra,0xffff2 + 8001406e: ffc080e7 jalr -4(ra) # 80006066 <_ZN6kernel2fs4file5VFile4stat17heebdb0d64a039b86E> + 80014072: f0aa sd a0,96(sp) + 80014074: f4ae sd a1,104(sp) + 80014076: a009 j 80014078 <.LBB13_21+0x38> + Ok(()) => { + 80014078: 7506 ld a0,96(sp) + 8001407a: 00a035b3 snez a1,a0 + 8001407e: 4581 li a1,0 + 80014080: 02b50663 beq a0,a1,800140ac <.LBB13_22+0x18> + 80014084: a009 j 80014086 <.LBB13_21+0x46> + return Ok(0) + }, + + Err(err) => { + 80014086: 7586 ld a1,96(sp) + 80014088: 7526 ld a0,104(sp) + 8001408a: f8ae sd a1,112(sp) + 8001408c: fcaa sd a0,120(sp) + 8001408e: 1888 addi a0,sp,112 + println!("[Kernel] sys_stat: err: {}", err); + 80014090: e1aa sd a0,192(sp) + 80014092: f9aa sd a0,240(sp) + +0000000080014094 <.LBB13_22>: + 80014094: 0000b597 auipc a1,0xb + 80014098: 3cc58593 addi a1,a1,972 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 8001409c: 0000b097 auipc ra,0xb + 800140a0: 3e8080e7 jalr 1000(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 800140a4: e02a sd a0,0(sp) + 800140a6: e42e sd a1,8(sp) + 800140a8: a031 j 800140b4 <.LBB13_22+0x20> + match file.stat(stat) { + 800140aa: 0000 unimp + 800140ac: 4501 li a0,0 + return Ok(0) + 800140ae: ecaa sd a0,88(sp) + 800140b0: e8aa sd a0,80(sp) + 800140b2: a81d j 800140e8 <.LBB13_23+0x2c> + println!("[Kernel] sys_stat: err: {}", err); + 800140b4: 6522 ld a0,8(sp) + 800140b6: 6582 ld a1,0(sp) + 800140b8: f92e sd a1,176(sp) + 800140ba: fd2a sd a0,184(sp) + +00000000800140bc <.LBB13_23>: + 800140bc: 00016597 auipc a1,0x16 + 800140c0: 7fc58593 addi a1,a1,2044 # 8002a8b8 <.L__unnamed_39> + 800140c4: 0108 addi a0,sp,128 + 800140c6: 4609 li a2,2 + 800140c8: 1914 addi a3,sp,176 + 800140ca: 4705 li a4,1 + 800140cc: ffff1097 auipc ra,0xffff1 + 800140d0: 4be080e7 jalr 1214(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800140d4: a009 j 800140d6 <.LBB13_23+0x1a> + 800140d6: 0108 addi a0,sp,128 + 800140d8: 0000b097 auipc ra,0xb + 800140dc: b20080e7 jalr -1248(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800140e0: a009 j 800140e2 <.LBB13_23+0x26> + 800140e2: 4505 li a0,1 + return Err(()) + 800140e4: e8aa sd a0,80(sp) + 800140e6: a009 j 800140e8 <.LBB13_23+0x2c> + } + } + } + 800140e8: 6546 ld a0,80(sp) + 800140ea: 65e6 ld a1,88(sp) + 800140ec: 70ee ld ra,248(sp) + 800140ee: 6111 addi sp,sp,256 + 800140f0: 8082 ret + let file = task.open_files[fd].as_ref().unwrap(); + 800140f2: 6526 ld a0,72(sp) + +00000000800140f4 <.LBB13_24>: + 800140f4: 00016617 auipc a2,0x16 + 800140f8: 77c60613 addi a2,a2,1916 # 8002a870 <.L__unnamed_40> + 800140fc: 06400593 li a1,100 + 80014100: 0000f097 auipc ra,0xf + 80014104: 070080e7 jalr 112(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_chdir17he6ad16137b6ff3daE: + +000000008001410a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_chdir17he6ad16137b6ff3daE>: + + pub fn sys_chdir(&self) -> SysResult { + 8001410a: 7109 addi sp,sp,-384 + 8001410c: fe86 sd ra,376(sp) + 8001410e: f82a sd a0,48(sp) + 80014110: eaaa sd a0,336(sp) + 80014112: 4581 li a1,0 + let mut path = [0u8; MAXPATH]; + 80014114: 14b107a3 sb a1,335(sp) + 80014118: 04f10513 addi a0,sp,79 + 8001411c: 08000613 li a2,128 + 80014120: 00012097 auipc ra,0x12 + 80014124: fb4080e7 jalr -76(ra) # 800260d4 + +0000000080014128 <.LBB14_33>: + LOG.begin_op(); + 80014128: 00047517 auipc a0,0x47 + 8001412c: 3b050513 addi a0,a0,944 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014130: ffff5097 auipc ra,0xffff5 + 80014134: 2aa080e7 jalr 682(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 80014138: a009 j 8001413a <.LBB14_33+0x12> + let addr = self.arg(0); + 8001413a: 7542 ld a0,48(sp) + 8001413c: 4581 li a1,0 + 8001413e: 00002097 auipc ra,0x2 + 80014142: d3c080e7 jalr -708(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80014146: 85aa mv a1,a0 + 80014148: f42e sd a1,40(sp) + 8001414a: f6aa sd a0,360(sp) + 8001414c: a009 j 8001414e <.LBB14_33+0x26> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 8001414e: 75a2 ld a1,40(sp) + 80014150: 7542 ld a0,48(sp) + 80014152: 04f10613 addi a2,sp,79 + 80014156: 08000713 li a4,128 + 8001415a: 86ba mv a3,a4 + 8001415c: 00002097 auipc ra,0x2 + 80014160: dce080e7 jalr -562(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80014164: f02a sd a0,32(sp) + 80014166: a009 j 80014168 <.LBB14_33+0x40> + 80014168: 7502 ld a0,32(sp) + 8001416a: ffffa097 auipc ra,0xffffa + 8001416e: 9c4080e7 jalr -1596(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 80014172: 0ca107a3 sb a0,207(sp) + 80014176: a009 j 80014178 <.LBB14_33+0x50> + 80014178: 0cf14503 lbu a0,207(sp) + 8001417c: 8905 andi a0,a0,1 + 8001417e: 4581 li a1,0 + 80014180: 00b50463 beq a0,a1,80014188 <.LBB14_34> + 80014184: a009 j 80014186 <.LBB14_33+0x5e> + 80014186: a005 j 800141a6 <.LBB14_34+0x1e> + +0000000080014188 <.LBB14_34>: + match ICACHE.namei(&path) { + 80014188: 00047597 auipc a1,0x47 + 8001418c: 3f858593 addi a1,a1,1016 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 80014190: 0988 addi a0,sp,208 + 80014192: 04f10613 addi a2,sp,79 + 80014196: 08000693 li a3,128 + 8001419a: 00006097 auipc ra,0x6 + 8001419e: 08e080e7 jalr 142(ra) # 8001a228 <_ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E> + 800141a2: a831 j 800141be <.LBB14_34+0x36> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 800141a4: 0000 unimp + 800141a6: ffff8097 auipc ra,0xffff8 + 800141aa: 1da080e7 jalr 474(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 800141ae: a009 j 800141b0 <.LBB14_34+0x28> + 800141b0: ffffa097 auipc ra,0xffffa + 800141b4: 852080e7 jalr -1966(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 800141b8: fc2a sd a0,56(sp) + 800141ba: e0ae sd a1,64(sp) + 800141bc: a225 j 800142e4 <.LBB14_39+0x48> + Some(inode) => { + 800141be: 654e ld a0,208(sp) + 800141c0: 4581 li a1,0 + 800141c2: 00b50463 beq a0,a1,800141ca <.LBB14_35> + 800141c6: a009 j 800141c8 <.LBB14_34+0x40> + 800141c8: a819 j 800141de <.LBB14_35+0x14> + +00000000800141ca <.LBB14_35>: + } + } + }, + + None => { + LOG.end_op(); + 800141ca: 00047517 auipc a0,0x47 + 800141ce: 30e50513 addi a0,a0,782 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800141d2: ffff5097 auipc ra,0xffff5 + 800141d6: 7ee080e7 jalr 2030(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800141da: a8c5 j 800142ca <.LBB14_39+0x2e> + match ICACHE.namei(&path) { + 800141dc: 0000 unimp + 800141de: 4505 li a0,1 + Some(inode) => { + 800141e0: 14a107a3 sb a0,335(sp) + 800141e4: 656e ld a0,216(sp) + 800141e6: f5aa sd a0,232(sp) + 800141e8: 750e ld a0,224(sp) + 800141ea: f9aa sd a0,240(sp) + 800141ec: 11a8 addi a0,sp,232 + let inode_guard = inode.lock(); + 800141ee: 00008097 auipc ra,0x8 + 800141f2: a7e080e7 jalr -1410(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 800141f6: fdaa sd a0,248(sp) + 800141f8: e22e sd a1,256(sp) + 800141fa: a009 j 800141fc <.LBB14_35+0x32> + 800141fc: 19a8 addi a0,sp,248 + match inode_guard.dinode.itype { + 800141fe: 0000a097 auipc ra,0xa + 80014202: 294080e7 jalr 660(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80014206: ec2a sd a0,24(sp) + 80014208: a009 j 8001420a <.LBB14_35+0x40> + InodeType::Directory => { + 8001420a: 6562 ld a0,24(sp) + 8001420c: 00855503 lhu a0,8(a0) + 80014210: 4585 li a1,1 + 80014212: 00b50c63 beq a0,a1,8001422a <.LBB14_36+0x12> + 80014216: a009 j 80014218 <.LBB14_36> + +0000000080014218 <.LBB14_36>: + LOG.end_op(); + 80014218: 00047517 auipc a0,0x47 + 8001421c: 2c050513 addi a0,a0,704 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014220: ffff5097 auipc ra,0xffff5 + 80014224: 7a0080e7 jalr 1952(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014228: a079 j 800142b6 <.LBB14_39+0x1a> + drop(inode_guard); + 8001422a: 756e ld a0,248(sp) + 8001422c: 6592 ld a1,256(sp) + 8001422e: 0000a097 auipc ra,0xa + 80014232: c0c080e7 jalr -1012(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014236: a009 j 80014238 <.LBB14_37> + +0000000080014238 <.LBB14_37>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80014238: 00052517 auipc a0,0x52 + 8001423c: f0850513 addi a0,a0,-248 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80014240: ffffe097 auipc ra,0xffffe + 80014244: 218080e7 jalr 536(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80014248: e82a sd a0,16(sp) + 8001424a: a009 j 8001424c <.LBB14_37+0x14> + 8001424c: 6542 ld a0,16(sp) + +000000008001424e <.LBB14_38>: + 8001424e: 00016597 auipc a1,0x16 + 80014252: 68a58593 addi a1,a1,1674 # 8002a8d8 <.L__unnamed_41> + 80014256: ffffb097 auipc ra,0xffffb + 8001425a: 53a080e7 jalr 1338(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001425e: e42a sd a0,8(sp) + 80014260: a009 j 80014262 <.LBB14_38+0x14> + 80014262: 6522 ld a0,8(sp) + 80014264: faaa sd a0,368(sp) + let old_cwd = task.cwd.replace(inode); + 80014266: 3c850593 addi a1,a0,968 + 8001426a: 4501 li a0,0 + 8001426c: 14a107a3 sb a0,335(sp) + 80014270: 76ce ld a3,240(sp) + 80014272: f636 sd a3,296(sp) + 80014274: 762e ld a2,232(sp) + 80014276: f232 sd a2,288(sp) + 80014278: 0228 addi a0,sp,264 + 8001427a: ffffb097 auipc ra,0xffffb + 8001427e: 6de080e7 jalr 1758(ra) # 8000f958 <_ZN4core6option15Option$LT$T$GT$7replace17h3b8bd4435d2ae84bE> + 80014282: a009 j 80014284 <.LBB14_38+0x36> + drop(old_cwd); + 80014284: 6572 ld a0,280(sp) + 80014286: e2aa sd a0,320(sp) + 80014288: 6552 ld a0,272(sp) + 8001428a: fe2a sd a0,312(sp) + 8001428c: 6532 ld a0,264(sp) + 8001428e: fa2a sd a0,304(sp) + 80014290: 1a08 addi a0,sp,304 + 80014292: 0000a097 auipc ra,0xa + 80014296: be4080e7 jalr -1052(ra) # 8001de76 <_ZN4core3mem4drop17h66bc7e80d0a41b3aE> + 8001429a: a009 j 8001429c <.LBB14_39> + +000000008001429c <.LBB14_39>: + LOG.end_op(); + 8001429c: 00047517 auipc a0,0x47 + 800142a0: 23c50513 addi a0,a0,572 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800142a4: ffff5097 auipc ra,0xffff5 + 800142a8: 71c080e7 jalr 1820(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800142ac: a009 j 800142ae <.LBB14_39+0x12> + 800142ae: 4501 li a0,0 + return Ok(0) + 800142b0: e0aa sd a0,64(sp) + 800142b2: fc2a sd a0,56(sp) + 800142b4: a831 j 800142d0 <.LBB14_39+0x34> + drop(inode_guard); + 800142b6: 756e ld a0,248(sp) + 800142b8: 6592 ld a1,256(sp) + 800142ba: 0000a097 auipc ra,0xa + 800142be: b80080e7 jalr -1152(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800142c2: a009 j 800142c4 <.LBB14_39+0x28> + 800142c4: 4505 li a0,1 + return Err(()) + 800142c6: fc2a sd a0,56(sp) + 800142c8: a021 j 800142d0 <.LBB14_39+0x34> + 800142ca: 4505 li a0,1 + return Err(()) + 800142cc: fc2a sd a0,56(sp) + 800142ce: a811 j 800142e2 <.LBB14_39+0x46> + }, + 800142d0: 14f14503 lbu a0,335(sp) + 800142d4: 8905 andi a0,a0,1 + 800142d6: ed01 bnez a0,800142ee <.LBB14_39+0x52> + 800142d8: a009 j 800142da <.LBB14_39+0x3e> + 800142da: 4501 li a0,0 + 800142dc: 14a107a3 sb a0,335(sp) + 800142e0: a009 j 800142e2 <.LBB14_39+0x46> + 800142e2: a009 j 800142e4 <.LBB14_39+0x48> + } + } + + } + 800142e4: 7562 ld a0,56(sp) + 800142e6: 6586 ld a1,64(sp) + 800142e8: 70f6 ld ra,376(sp) + 800142ea: 6119 addi sp,sp,384 + 800142ec: 8082 ret + 800142ee: 11a8 addi a0,sp,232 + }, + 800142f0: ffff3097 auipc ra,0xffff3 + 800142f4: d76080e7 jalr -650(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 800142f8: b7cd j 800142da <.LBB14_39+0x3e> + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_pipe17h56ef7a0a7762279bE: + +00000000800142fa <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_pipe17h56ef7a0a7762279bE>: + + pub unsafe fn sys_pipe(&self) -> SysResult { + 800142fa: d5010113 addi sp,sp,-688 + 800142fe: 2a113423 sd ra,680(sp) + 80014302: e92a sd a0,144(sp) + 80014304: 24a13c23 sd a0,600(sp) + 80014308: 1908 addi a0,sp,176 + // User use an array to represent two file. + // let mut fd_array: usize = 0; + let mut rf = &mut VFile::init() as *mut VFile; + 8001430a: ffff1097 auipc ra,0xffff1 + 8001430e: 520080e7 jalr 1312(ra) # 8000582a <_ZN6kernel2fs4file5VFile4init17h000c38ec0bf103cfE> + 80014312: a009 j 80014314 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_pipe17h56ef7a0a7762279bE+0x1a> + 80014314: 1908 addi a0,sp,176 + 80014316: f52a sd a0,168(sp) + 80014318: 1988 addi a0,sp,240 + let mut wf = &mut VFile::init() as *mut VFile; + 8001431a: ffff1097 auipc ra,0xffff1 + 8001431e: 510080e7 jalr 1296(ra) # 8000582a <_ZN6kernel2fs4file5VFile4init17h000c38ec0bf103cfE> + 80014322: a009 j 80014324 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_pipe17h56ef7a0a7762279bE+0x2a> + 80014324: 654a ld a0,144(sp) + 80014326: 198c addi a1,sp,240 + 80014328: f5ae sd a1,232(sp) + 8001432a: 4581 li a1,0 + // arg_addr(0, &mut &mut fd_array)?; + let fd_array = self.arg(0); + 8001432c: 00002097 auipc ra,0x2 + 80014330: b4e080e7 jalr -1202(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80014334: 85aa mv a1,a0 + 80014336: e52e sd a1,136(sp) + 80014338: 26a13023 sd a0,608(sp) + 8001433c: a009 j 8001433e <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_pipe17h56ef7a0a7762279bE+0x44> + 8001433e: 1128 addi a0,sp,168 + 80014340: 11ac addi a1,sp,232 + Pipe::alloc(&mut rf, &mut wf); + 80014342: ffff6097 auipc ra,0xffff6 + 80014346: 4e6080e7 jalr 1254(ra) # 8000a828 <_ZN6kernel2fs4pipe4Pipe5alloc17h34f49160398961fbE> + 8001434a: a009 j 8001434c <.LBB15_55> + +000000008001434c <.LBB15_55>: + + let p = unsafe { + CPU_MANAGER.myproc().expect("Fail to get my process.") + 8001434c: 00052517 auipc a0,0x52 + 80014350: df450513 addi a0,a0,-524 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80014354: ffffe097 auipc ra,0xffffe + 80014358: 104080e7 jalr 260(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001435c: e12a sd a0,128(sp) + 8001435e: a009 j 80014360 <.LBB15_55+0x14> + 80014360: 650a ld a0,128(sp) + +0000000080014362 <.LBB15_56>: + 80014362: 00016597 auipc a1,0x16 + 80014366: 58e58593 addi a1,a1,1422 # 8002a8f0 <.L__unnamed_42> + +000000008001436a <.LBB15_57>: + 8001436a: 00016697 auipc a3,0x16 + 8001436e: 59e68693 addi a3,a3,1438 # 8002a908 <.L__unnamed_43> + 80014372: 465d li a2,23 + 80014374: ffffb097 auipc ra,0xffffb + 80014378: 086080e7 jalr 134(ra) # 8000f3fa <_ZN4core6option15Option$LT$T$GT$6expect17h08a1091d701304abE> + 8001437c: fcaa sd a0,120(sp) + 8001437e: a009 j 80014380 <.LBB15_57+0x16> + 80014380: 75e6 ld a1,120(sp) + 80014382: 26b13423 sd a1,616(sp) + }; + + // Allocate file descriptor for r/w file. + let rfd: usize; + let wfd: usize; + match p.fd_alloc(&mut *rf) { + 80014386: 762a ld a2,168(sp) + 80014388: 1a28 addi a0,sp,312 + 8001438a: 00003097 auipc ra,0x3 + 8001438e: df6080e7 jalr -522(ra) # 80017180 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE> + 80014392: a009 j 80014394 <.LBB15_57+0x2a> + Ok(fd) => { + 80014394: 7572 ld a0,312(sp) + 80014396: 4581 li a1,0 + 80014398: 02b50763 beq a0,a1,800143c6 <.LBB15_58+0x18> + 8001439c: a009 j 8001439e <.LBB15_57+0x34> + rfd = fd; + }, + + Err(err) => { + 8001439e: 6596 ld a1,320(sp) + 800143a0: 6536 ld a0,328(sp) + 800143a2: eaae sd a1,336(sp) + 800143a4: eeaa sd a0,344(sp) + 800143a6: 0a88 addi a0,sp,336 + // rf.close(); + println!("[Kernel] sys_pipe: err: {}", err); + 800143a8: f32a sd a0,416(sp) + 800143aa: 26a13823 sd a0,624(sp) + +00000000800143ae <.LBB15_58>: + 800143ae: 0000b597 auipc a1,0xb + 800143b2: 0b258593 addi a1,a1,178 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 800143b6: 0000b097 auipc ra,0xb + 800143ba: 0ce080e7 jalr 206(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 800143be: f4aa sd a0,104(sp) + 800143c0: f8ae sd a1,112(sp) + 800143c2: a831 j 800143de <.LBB15_58+0x30> + match p.fd_alloc(&mut *rf) { + 800143c4: 0000 unimp + Ok(fd) => { + 800143c6: 75e6 ld a1,120(sp) + 800143c8: 6516 ld a0,320(sp) + 800143ca: 26a13c23 sd a0,632(sp) + rfd = fd; + 800143ce: f62a sd a0,296(sp) + return Err(()) + } + } + + match p.fd_alloc(&mut*wf) { + 800143d0: 762e ld a2,232(sp) + 800143d2: 1328 addi a0,sp,424 + 800143d4: 00003097 auipc ra,0x3 + 800143d8: dac080e7 jalr -596(ra) # 80017180 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE> + 800143dc: a81d j 80014412 <.LBB15_59+0x2c> + println!("[Kernel] sys_pipe: err: {}", err); + 800143de: 7546 ld a0,112(sp) + 800143e0: 75a6 ld a1,104(sp) + 800143e2: eb2e sd a1,400(sp) + 800143e4: ef2a sd a0,408(sp) + +00000000800143e6 <.LBB15_59>: + 800143e6: 00016597 auipc a1,0x16 + 800143ea: 55258593 addi a1,a1,1362 # 8002a938 <.L__unnamed_44> + 800143ee: 1288 addi a0,sp,352 + 800143f0: 4609 li a2,2 + 800143f2: 0b14 addi a3,sp,400 + 800143f4: 4705 li a4,1 + 800143f6: ffff1097 auipc ra,0xffff1 + 800143fa: 194080e7 jalr 404(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800143fe: a009 j 80014400 <.LBB15_59+0x1a> + 80014400: 1288 addi a0,sp,352 + 80014402: 0000a097 auipc ra,0xa + 80014406: 7f6080e7 jalr 2038(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001440a: a009 j 8001440c <.LBB15_59+0x26> + 8001440c: 4505 li a0,1 + return Err(()) + 8001440e: ed2a sd a0,152(sp) + 80014410: ac19 j 80014626 <.LBB15_63+0x180> + Ok(fd) => { + 80014412: 753a ld a0,424(sp) + 80014414: 4581 li a1,0 + 80014416: 02b50863 beq a0,a1,80014446 <.LBB15_60+0x18> + 8001441a: a009 j 8001441c <.LBB15_59+0x36> + wfd = fd; + }, + + Err(err) => { + 8001441c: 75da ld a1,432(sp) + 8001441e: 757a ld a0,440(sp) + 80014420: e3ae sd a1,448(sp) + 80014422: e7aa sd a0,456(sp) + 80014424: 0388 addi a0,sp,448 + // rf.close(); + // wf.close(); + println!("[Kernel] sys_pipe: err: {}", err); + 80014426: 20a13823 sd a0,528(sp) + 8001442a: 28a13023 sd a0,640(sp) + +000000008001442e <.LBB15_60>: + 8001442e: 0000b597 auipc a1,0xb + 80014432: 03258593 addi a1,a1,50 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80014436: 0000b097 auipc ra,0xb + 8001443a: 04e080e7 jalr 78(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 8001443e: ecaa sd a0,88(sp) + 80014440: f0ae sd a1,96(sp) + 80014442: a02d j 8001446c <.LBB15_61+0x14> + match p.fd_alloc(&mut*wf) { + 80014444: 0000 unimp + Ok(fd) => { + 80014446: 7566 ld a0,120(sp) + 80014448: 75da ld a1,432(sp) + 8001444a: 28b13423 sd a1,648(sp) + wfd = fd; + 8001444e: fa2e sd a1,304(sp) + return Err(()) + } + } + + let pgt = unsafe { &mut *p.pagetable }; + 80014450: 6d08 ld a0,24(a0) + 80014452: e4aa sd a0,72(sp) + 80014454: 28a13823 sd a0,656(sp) + +0000000080014458 <.LBB15_61>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80014458: 00052517 auipc a0,0x52 + 8001445c: ce850513 addi a0,a0,-792 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80014460: ffffe097 auipc ra,0xffffe + 80014464: ff8080e7 jalr -8(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80014468: e8aa sd a0,80(sp) + 8001446a: a82d j 800144a4 <.LBB15_62+0x2c> + println!("[Kernel] sys_pipe: err: {}", err); + 8001446c: 7506 ld a0,96(sp) + 8001446e: 65e6 ld a1,88(sp) + 80014470: 20b13023 sd a1,512(sp) + 80014474: 20a13423 sd a0,520(sp) + +0000000080014478 <.LBB15_62>: + 80014478: 00016597 auipc a1,0x16 + 8001447c: 4c058593 addi a1,a1,1216 # 8002a938 <.L__unnamed_44> + 80014480: 0b88 addi a0,sp,464 + 80014482: 4609 li a2,2 + 80014484: 0414 addi a3,sp,512 + 80014486: 4705 li a4,1 + 80014488: ffff1097 auipc ra,0xffff1 + 8001448c: 102080e7 jalr 258(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80014490: a009 j 80014492 <.LBB15_62+0x1a> + 80014492: 0b88 addi a0,sp,464 + 80014494: 0000a097 auipc ra,0xa + 80014498: 764080e7 jalr 1892(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001449c: a009 j 8001449e <.LBB15_62+0x26> + 8001449e: 4505 li a0,1 + return Err(()) + 800144a0: ed2a sd a0,152(sp) + 800144a2: a251 j 80014626 <.LBB15_63+0x180> + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 800144a4: 6546 ld a0,80(sp) + +00000000800144a6 <.LBB15_63>: + 800144a6: 00016597 auipc a1,0x16 + 800144aa: 4b258593 addi a1,a1,1202 # 8002a958 <.L__unnamed_45> + 800144ae: ffffb097 auipc ra,0xffffb + 800144b2: 2e2080e7 jalr 738(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 800144b6: e0aa sd a0,64(sp) + 800144b8: a009 j 800144ba <.LBB15_63+0x14> + 800144ba: 65aa ld a1,136(sp) + 800144bc: 6526 ld a0,72(sp) + 800144be: 6606 ld a2,64(sp) + 800144c0: 28c13c23 sd a2,664(sp) + let open_files = &mut task.open_files; + 800144c4: 0a860613 addi a2,a2,168 + 800144c8: fc32 sd a2,56(sp) + 800144ca: 2ac13023 sd a2,672(sp) + 800144ce: 1230 addi a2,sp,296 + 800144d0: 4691 li a3,4 + if pgt.copy_out(fd_array, &rfd as *const _ as *const u8, 4).is_err() { + 800144d2: 00004097 auipc ra,0x4 + 800144d6: 4ac080e7 jalr 1196(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 800144da: 20a13c23 sd a0,536(sp) + 800144de: 22b13023 sd a1,544(sp) + 800144e2: a009 j 800144e4 <.LBB15_63+0x3e> + 800144e4: 0c28 addi a0,sp,536 + 800144e6: ffff9097 auipc ra,0xffff9 + 800144ea: 192080e7 jalr 402(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 800144ee: f82a sd a0,48(sp) + 800144f0: a009 j 800144f2 <.LBB15_63+0x4c> + 800144f2: 7542 ld a0,48(sp) + 800144f4: 4581 li a1,0 + 800144f6: 00b50a63 beq a0,a1,8001450a <.LBB15_63+0x64> + 800144fa: a009 j 800144fc <.LBB15_63+0x56> + open_files[rfd].take(); + 800144fc: 7532 ld a0,296(sp) + 800144fe: f42a sd a0,40(sp) + 80014500: 06400593 li a1,100 + 80014504: 00b56a63 bltu a0,a1,80014518 <.LBB15_63+0x72> + 80014508: a291 j 8001464c <.LBB15_63+0x1a6> + // wf.close(); + return Err(()) + } + + if pgt.copy_out( + fd_array + 4, + 8001450a: 65aa ld a1,136(sp) + 8001450c: 00458513 addi a0,a1,4 + 80014510: f02a sd a0,32(sp) + 80014512: 16b56563 bltu a0,a1,8001467c <.LBB15_66> + 80014516: a8a9 j 80014570 <.LBB15_63+0xca> + open_files[rfd].take(); + 80014518: 7562 ld a0,56(sp) + 8001451a: 75a2 ld a1,40(sp) + 8001451c: 058e slli a1,a1,0x3 + 8001451e: 952e add a0,a0,a1 + 80014520: ffffb097 auipc ra,0xffffb + 80014524: aea080e7 jalr -1302(ra) # 8000f00a <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E> + 80014528: 22a13423 sd a0,552(sp) + 8001452c: a009 j 8001452e <.LBB15_63+0x88> + 8001452e: 1428 addi a0,sp,552 + 80014530: ffff3097 auipc ra,0xffff3 + 80014534: ce6080e7 jalr -794(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80014538: a009 j 8001453a <.LBB15_63+0x94> + open_files[wfd].take(); + 8001453a: 75d2 ld a1,304(sp) + 8001453c: ec2e sd a1,24(sp) + 8001453e: 06300513 li a0,99 + 80014542: 12b56163 bltu a0,a1,80014664 <.LBB15_64+0x16> + 80014546: a009 j 80014548 <.LBB15_63+0xa2> + 80014548: 7562 ld a0,56(sp) + 8001454a: 65e2 ld a1,24(sp) + 8001454c: 058e slli a1,a1,0x3 + 8001454e: 952e add a0,a0,a1 + 80014550: ffffb097 auipc ra,0xffffb + 80014554: aba080e7 jalr -1350(ra) # 8000f00a <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E> + 80014558: 22a13823 sd a0,560(sp) + 8001455c: a009 j 8001455e <.LBB15_63+0xb8> + 8001455e: 1c08 addi a0,sp,560 + 80014560: ffff3097 auipc ra,0xffff3 + 80014564: cb6080e7 jalr -842(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80014568: a009 j 8001456a <.LBB15_63+0xc4> + 8001456a: 4505 li a0,1 + return Err(()) + 8001456c: ed2a sd a0,152(sp) + 8001456e: a865 j 80014626 <.LBB15_63+0x180> + if pgt.copy_out( + 80014570: 7582 ld a1,32(sp) + 80014572: 6526 ld a0,72(sp) + 80014574: 1a10 addi a2,sp,304 + 80014576: 4691 li a3,4 + 80014578: 00004097 auipc ra,0x4 + 8001457c: 406080e7 jalr 1030(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 80014580: 22a13c23 sd a0,568(sp) + 80014584: 24b13023 sd a1,576(sp) + 80014588: a009 j 8001458a <.LBB15_63+0xe4> + 8001458a: 1c28 addi a0,sp,568 + 8001458c: ffff9097 auipc ra,0xffff9 + 80014590: 0ec080e7 jalr 236(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 80014594: e82a sd a0,16(sp) + 80014596: a009 j 80014598 <.LBB15_63+0xf2> + 80014598: 6542 ld a0,16(sp) + 8001459a: 4581 li a1,0 + 8001459c: 00b50a63 beq a0,a1,800145b0 <.LBB15_63+0x10a> + 800145a0: a009 j 800145a2 <.LBB15_63+0xfc> + &wfd as *const usize as *const u8, + 4 + ).is_err() { + open_files[rfd].take(); + 800145a2: 7532 ld a0,296(sp) + 800145a4: e42a sd a0,8(sp) + 800145a6: 06400593 li a1,100 + 800145aa: 00b56c63 bltu a0,a1,800145c2 <.LBB15_63+0x11c> + 800145ae: a0ed j 80014698 <.LBB15_67+0x14> + 800145b0: 4501 li a0,0 + open_files[wfd].take(); + // rf.close(); + // wf.close(); + return Err(()) + } + Ok(0) + 800145b2: f12a sd a0,160(sp) + 800145b4: ed2a sd a0,152(sp) + 800145b6: 1988 addi a0,sp,240 + } + 800145b8: ffff3097 auipc ra,0xffff3 + 800145bc: a96080e7 jalr -1386(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 800145c0: a8a9 j 8001461a <.LBB15_63+0x174> + open_files[rfd].take(); + 800145c2: 7562 ld a0,56(sp) + 800145c4: 65a2 ld a1,8(sp) + 800145c6: 058e slli a1,a1,0x3 + 800145c8: 952e add a0,a0,a1 + 800145ca: ffffb097 auipc ra,0xffffb + 800145ce: a40080e7 jalr -1472(ra) # 8000f00a <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E> + 800145d2: 24a13423 sd a0,584(sp) + 800145d6: a009 j 800145d8 <.LBB15_63+0x132> + 800145d8: 04a8 addi a0,sp,584 + 800145da: ffff3097 auipc ra,0xffff3 + 800145de: c3c080e7 jalr -964(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 800145e2: a009 j 800145e4 <.LBB15_63+0x13e> + open_files[wfd].take(); + 800145e4: 75d2 ld a1,304(sp) + 800145e6: e02e sd a1,0(sp) + 800145e8: 06300513 li a0,99 + 800145ec: 0cb56263 bltu a0,a1,800146b0 <.LBB15_68+0x16> + 800145f0: a009 j 800145f2 <.LBB15_63+0x14c> + 800145f2: 7562 ld a0,56(sp) + 800145f4: 6582 ld a1,0(sp) + 800145f6: 058e slli a1,a1,0x3 + 800145f8: 952e add a0,a0,a1 + 800145fa: ffffb097 auipc ra,0xffffb + 800145fe: a10080e7 jalr -1520(ra) # 8000f00a <_ZN4core6option15Option$LT$T$GT$4take17h80e6997975665939E> + 80014602: 24a13823 sd a0,592(sp) + 80014606: a009 j 80014608 <.LBB15_63+0x162> + 80014608: 0c88 addi a0,sp,592 + 8001460a: ffff3097 auipc ra,0xffff3 + 8001460e: c0c080e7 jalr -1012(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80014612: a009 j 80014614 <.LBB15_63+0x16e> + 80014614: 4505 li a0,1 + return Err(()) + 80014616: ed2a sd a0,152(sp) + 80014618: a039 j 80014626 <.LBB15_63+0x180> + 8001461a: 1908 addi a0,sp,176 + } + 8001461c: ffff3097 auipc ra,0xffff3 + 80014620: a32080e7 jalr -1486(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 80014624: a829 j 8001463e <.LBB15_63+0x198> + 80014626: 1988 addi a0,sp,240 + 80014628: ffff3097 auipc ra,0xffff3 + 8001462c: a26080e7 jalr -1498(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 80014630: a009 j 80014632 <.LBB15_63+0x18c> + 80014632: 1908 addi a0,sp,176 + 80014634: ffff3097 auipc ra,0xffff3 + 80014638: a1a080e7 jalr -1510(ra) # 8000704e <_ZN4core3ptr44drop_in_place$LT$kernel..fs..file..VFile$GT$17h7a3c9775c1583e88E> + 8001463c: a009 j 8001463e <.LBB15_63+0x198> + 8001463e: 656a ld a0,152(sp) + 80014640: 758a ld a1,160(sp) + 80014642: 2a813083 ld ra,680(sp) + 80014646: 2b010113 addi sp,sp,688 + 8001464a: 8082 ret + open_files[rfd].take(); + 8001464c: 7522 ld a0,40(sp) + +000000008001464e <.LBB15_64>: + 8001464e: 00016617 auipc a2,0x16 + 80014652: 32260613 addi a2,a2,802 # 8002a970 <.L__unnamed_46> + 80014656: 06400593 li a1,100 + 8001465a: 0000f097 auipc ra,0xf + 8001465e: b16080e7 jalr -1258(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80014662: 0000 unimp + open_files[wfd].take(); + 80014664: 6562 ld a0,24(sp) + +0000000080014666 <.LBB15_65>: + 80014666: 00016617 auipc a2,0x16 + 8001466a: 32260613 addi a2,a2,802 # 8002a988 <.L__unnamed_47> + 8001466e: 06400593 li a1,100 + 80014672: 0000f097 auipc ra,0xf + 80014676: afe080e7 jalr -1282(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008001467c <.LBB15_66>: + fd_array + 4, + 8001467c: 00016517 auipc a0,0x16 + 80014680: 0d450513 addi a0,a0,212 # 8002a750 + +0000000080014684 <.LBB15_67>: + 80014684: 00016617 auipc a2,0x16 + 80014688: 31c60613 addi a2,a2,796 # 8002a9a0 <.L__unnamed_48> + 8001468c: 45f1 li a1,28 + 8001468e: 0000f097 auipc ra,0xf + 80014692: ab6080e7 jalr -1354(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80014696: 0000 unimp + open_files[rfd].take(); + 80014698: 6522 ld a0,8(sp) + +000000008001469a <.LBB15_68>: + 8001469a: 00016617 auipc a2,0x16 + 8001469e: 31e60613 addi a2,a2,798 # 8002a9b8 <.L__unnamed_49> + 800146a2: 06400593 li a1,100 + 800146a6: 0000f097 auipc ra,0xf + 800146aa: aca080e7 jalr -1334(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 800146ae: 0000 unimp + open_files[wfd].take(); + 800146b0: 6502 ld a0,0(sp) + +00000000800146b2 <.LBB15_69>: + 800146b2: 00016617 auipc a2,0x16 + 800146b6: 31e60613 addi a2,a2,798 # 8002a9d0 <.L__unnamed_50> + 800146ba: 06400593 li a1,100 + 800146be: 0000f097 auipc ra,0xf + 800146c2: ab2080e7 jalr -1358(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_unlink17h041fe6edd5a3dcecE: + +00000000800146c8 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_unlink17h041fe6edd5a3dcecE>: + + pub fn sys_unlink(&self) -> SysResult { + 800146c8: d6010113 addi sp,sp,-672 + 800146cc: 28113c23 sd ra,664(sp) + 800146d0: e1aa sd a0,192(sp) + 800146d2: 22a13c23 sd a0,568(sp) + 800146d6: 4581 li a1,0 + let mut path = [0u8; MAXPATH]; + 800146d8: fd2e sd a1,184(sp) + 800146da: 22b10ba3 sb a1,567(sp) + 800146de: 22b10b23 sb a1,566(sp) + 800146e2: 1188 addi a0,sp,224 + 800146e4: 08000613 li a2,128 + 800146e8: 00012097 auipc ra,0x12 + 800146ec: 9ec080e7 jalr -1556(ra) # 800260d4 + 800146f0: 75ea ld a1,184(sp) + let mut name = [0u8; DIRSIZ]; + 800146f2: 650e ld a0,192(sp) + 800146f4: f2ae sd a1,352(sp) + 800146f6: 16b12423 sw a1,360(sp) + 800146fa: 16b11623 sh a1,364(sp) + let parent: Inode; + let inode: Inode; + + let addr = self.arg(0); + 800146fe: 00001097 auipc ra,0x1 + 80014702: 77c080e7 jalr 1916(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80014706: 85aa mv a1,a0 + 80014708: e5ae sd a1,200(sp) + 8001470a: 24a13823 sd a0,592(sp) + 8001470e: a009 j 80014710 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_unlink17h041fe6edd5a3dcecE+0x48> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 80014710: 65ae ld a1,200(sp) + 80014712: 650e ld a0,192(sp) + 80014714: 1190 addi a2,sp,224 + 80014716: 08000713 li a4,128 + 8001471a: 86ba mv a3,a4 + 8001471c: 00002097 auipc ra,0x2 + 80014720: 80e080e7 jalr -2034(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80014724: f92a sd a0,176(sp) + 80014726: a009 j 80014728 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_unlink17h041fe6edd5a3dcecE+0x60> + 80014728: 754a ld a0,176(sp) + 8001472a: ffff9097 auipc ra,0xffff9 + 8001472e: 404080e7 jalr 1028(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 80014732: 18a10ba3 sb a0,407(sp) + 80014736: a009 j 80014738 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_unlink17h041fe6edd5a3dcecE+0x70> + 80014738: 19714503 lbu a0,407(sp) + 8001473c: 8905 andi a0,a0,1 + 8001473e: 4581 li a1,0 + 80014740: 00b50463 beq a0,a1,80014748 <.LBB16_78> + 80014744: a009 j 80014746 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_unlink17h041fe6edd5a3dcecE+0x7e> + 80014746: a819 j 8001475c <.LBB16_78+0x14> + +0000000080014748 <.LBB16_78>: + + LOG.begin_op(); + 80014748: 00047517 auipc a0,0x47 + 8001474c: d9050513 addi a0,a0,-624 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014750: ffff5097 auipc ra,0xffff5 + 80014754: c8a080e7 jalr -886(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 80014758: a831 j 80014774 <.LBB16_79> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 8001475a: 0000 unimp + 8001475c: ffff8097 auipc ra,0xffff8 + 80014760: c24080e7 jalr -988(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80014764: a009 j 80014766 <.LBB16_78+0x1e> + 80014766: ffff9097 auipc ra,0xffff9 + 8001476a: 29c080e7 jalr 668(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 8001476e: e9aa sd a0,208(sp) + 80014770: edae sd a1,216(sp) + 80014772: ae5d j 80014b28 <.LBB16_90+0x3e> + +0000000080014774 <.LBB16_79>: + match ICACHE.namei_parent(&path, &mut name) { + 80014774: 00047597 auipc a1,0x47 + 80014778: e0c58593 addi a1,a1,-500 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 8001477c: 0b28 addi a0,sp,408 + 8001477e: 1190 addi a2,sp,224 + 80014780: 08000693 li a3,128 + 80014784: 1298 addi a4,sp,352 + 80014786: 00006097 auipc ra,0x6 + 8001478a: ac8080e7 jalr -1336(ra) # 8001a24e <_ZN6kernel2fs5inode10InodeCache12namei_parent17h24bebf98ccd9b34eE> + 8001478e: a009 j 80014790 <.LBB16_79+0x1c> + Some(cur) => { + 80014790: 657a ld a0,408(sp) + 80014792: 4581 li a1,0 + 80014794: 00b50463 beq a0,a1,8001479c <.LBB16_80> + 80014798: a009 j 8001479a <.LBB16_79+0x26> + 8001479a: a819 j 800147b0 <.LBB16_80+0x14> + +000000008001479c <.LBB16_80>: + parent = cur; + }, + None => { + LOG.end_op(); + 8001479c: 00047517 auipc a0,0x47 + 800147a0: d3c50513 addi a0,a0,-708 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800147a4: ffff5097 auipc ra,0xffff5 + 800147a8: 21c080e7 jalr 540(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800147ac: a02d j 800147d6 <.LBB16_80+0x3a> + match ICACHE.namei_parent(&path, &mut name) { + 800147ae: 0000 unimp + Some(cur) => { + 800147b0: 753a ld a0,424(sp) + 800147b2: ff2a sd a0,440(sp) + 800147b4: 759a ld a1,416(sp) + 800147b6: fb2e sd a1,432(sp) + parent = cur; + 800147b8: e3ae sd a1,448(sp) + 800147ba: e7aa sd a0,456(sp) + 800147bc: 4605 li a2,1 + 800147be: 22c10ba3 sb a2,567(sp) + 800147c2: faae sd a1,368(sp) + 800147c4: feaa sd a0,376(sp) + 800147c6: 1a88 addi a0,sp,368 + return Err(()) + } + } + let mut parent_guard = parent.lock(); + 800147c8: 00007097 auipc ra,0x7 + 800147cc: 4a4080e7 jalr 1188(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 800147d0: ebaa sd a0,464(sp) + 800147d2: efae sd a1,472(sp) + 800147d4: a021 j 800147dc <.LBB16_80+0x40> + 800147d6: 4505 li a0,1 + return Err(()) + 800147d8: e9aa sd a0,208(sp) + 800147da: a6b9 j 80014b28 <.LBB16_90+0x3e> + 800147dc: 1288 addi a0,sp,352 + 800147de: ed2a sd a0,152(sp) + +00000000800147e0 <.LBB16_81>: + 800147e0: 00016597 auipc a1,0x16 + 800147e4: 20858593 addi a1,a1,520 # 8002a9e8 <.L__unnamed_51> + 800147e8: f12e sd a1,160(sp) + 800147ea: 24b13c23 sd a1,600(sp) + 800147ee: 4505 li a0,1 + 800147f0: f52a sd a0,168(sp) + 800147f2: 26a13023 sd a0,608(sp) + 800147f6: 26b13423 sd a1,616(sp) + 800147fa: 26a13823 sd a0,624(sp) + if str_cmp(&name, ".".as_bytes(), DIRSIZ) && + 800147fe: a081 j 8001483e <.LBB16_82+0x2a> + 80014800: 4505 li a0,1 + 80014802: 1ea103a3 sb a0,487(sp) + 80014806: a03d j 80014834 <.LBB16_82+0x20> + 80014808: 4501 li a0,0 + 8001480a: 1ea103a3 sb a0,487(sp) + 8001480e: a01d j 80014834 <.LBB16_82+0x20> + 80014810: 1288 addi a0,sp,352 + 80014812: e12a sd a0,128(sp) + +0000000080014814 <.LBB16_82>: + 80014814: 00016597 auipc a1,0x16 + 80014818: 1d558593 addi a1,a1,469 # 8002a9e9 <.L__unnamed_52> + 8001481c: e52e sd a1,136(sp) + 8001481e: 26b13c23 sd a1,632(sp) + 80014822: 4509 li a0,2 + 80014824: e92a sd a0,144(sp) + 80014826: 28a13023 sd a0,640(sp) + 8001482a: 28b13423 sd a1,648(sp) + 8001482e: 28a13823 sd a0,656(sp) + str_cmp(&name, "..".as_bytes(), DIRSIZ) { + 80014832: a025 j 8001485a <.LBB16_82+0x46> + if str_cmp(&name, ".".as_bytes(), DIRSIZ) && + 80014834: 1e714503 lbu a0,487(sp) + 80014838: 8905 andi a0,a0,1 + 8001483a: ed15 bnez a0,80014876 <.LBB16_82+0x62> + 8001483c: a0a1 j 80014884 <.LBB16_82+0x70> + 8001483e: 76aa ld a3,168(sp) + 80014840: 760a ld a2,160(sp) + 80014842: 656a ld a0,152(sp) + 80014844: 4739 li a4,14 + 80014846: 85ba mv a1,a4 + 80014848: ffff3097 auipc ra,0xffff3 + 8001484c: 378080e7 jalr 888(ra) # 80007bc0 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E> + 80014850: fcaa sd a0,120(sp) + 80014852: a009 j 80014854 <.LBB16_82+0x40> + 80014854: 7566 ld a0,120(sp) + 80014856: fd4d bnez a0,80014810 <.LBB16_81+0x30> + 80014858: bf45 j 80014808 <.LBB16_81+0x28> + str_cmp(&name, "..".as_bytes(), DIRSIZ) { + 8001485a: 66ca ld a3,144(sp) + 8001485c: 662a ld a2,136(sp) + 8001485e: 650a ld a0,128(sp) + 80014860: 4739 li a4,14 + 80014862: 85ba mv a1,a4 + 80014864: ffff3097 auipc ra,0xffff3 + 80014868: 35c080e7 jalr 860(ra) # 80007bc0 <_ZN6kernel4misc7str_cmp17h91115d5ee259e480E> + 8001486c: f8aa sd a0,112(sp) + 8001486e: a009 j 80014870 <.LBB16_82+0x5c> + if str_cmp(&name, ".".as_bytes(), DIRSIZ) && + 80014870: 7546 ld a0,112(sp) + 80014872: f559 bnez a0,80014800 <.LBB16_81+0x20> + 80014874: bf51 j 80014808 <.LBB16_81+0x28> + drop(parent_guard); + 80014876: 655e ld a0,464(sp) + 80014878: 65fe ld a1,472(sp) + 8001487a: 00009097 auipc ra,0x9 + 8001487e: 5c0080e7 jalr 1472(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014882: a801 j 80014892 <.LBB16_83> + 80014884: 0b88 addi a0,sp,464 + LOG.end_op(); + return Err(()) + } + match parent_guard.dir_lookup(&name) { + 80014886: 0000a097 auipc ra,0xa + 8001488a: c20080e7 jalr -992(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001488e: f4aa sd a0,104(sp) + 80014890: a829 j 800148aa <.LBB16_83+0x18> + +0000000080014892 <.LBB16_83>: + LOG.end_op(); + 80014892: 00047517 auipc a0,0x47 + 80014896: c4650513 addi a0,a0,-954 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001489a: ffff5097 auipc ra,0xffff5 + 8001489e: 126080e7 jalr 294(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 800148a2: a009 j 800148a4 <.LBB16_83+0x12> + 800148a4: 4505 li a0,1 + return Err(()) + 800148a6: e9aa sd a0,208(sp) + 800148a8: a441 j 80014b28 <.LBB16_90+0x3e> + match parent_guard.dir_lookup(&name) { + 800148aa: 75a6 ld a1,104(sp) + 800148ac: 13a8 addi a0,sp,488 + 800148ae: 1290 addi a2,sp,352 + 800148b0: 46b9 li a3,14 + 800148b2: 00007097 auipc ra,0x7 + 800148b6: dd0080e7 jalr -560(ra) # 8001b682 <_ZN6kernel2fs5inode9InodeData10dir_lookup17h2ffc093ee3be0a35E> + 800148ba: a009 j 800148bc <.LBB16_83+0x2a> + Some(cur) => { + 800148bc: 753e ld a0,488(sp) + 800148be: 4581 li a1,0 + 800148c0: 00b51a63 bne a0,a1,800148d4 <.LBB16_83+0x42> + 800148c4: a009 j 800148c6 <.LBB16_83+0x34> + inode = cur; + }, + _ => { + drop(parent_guard); + 800148c6: 655e ld a0,464(sp) + 800148c8: 65fe ld a1,472(sp) + 800148ca: 00009097 auipc ra,0x9 + 800148ce: 570080e7 jalr 1392(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800148d2: a815 j 80014906 <.LBB16_84> + Some(cur) => { + 800148d4: 757e ld a0,504(sp) + 800148d6: 20a13423 sd a0,520(sp) + 800148da: 75de ld a1,496(sp) + 800148dc: 20b13023 sd a1,512(sp) + inode = cur; + 800148e0: 20b13823 sd a1,528(sp) + 800148e4: 20a13c23 sd a0,536(sp) + 800148e8: 4605 li a2,1 + 800148ea: 22c10b23 sb a2,566(sp) + 800148ee: e32e sd a1,384(sp) + 800148f0: e72a sd a0,392(sp) + 800148f2: 0308 addi a0,sp,384 + LOG.end_op(); + return Err(()) + } + } + + let mut inode_guard = inode.lock(); + 800148f4: 00007097 auipc ra,0x7 + 800148f8: 378080e7 jalr 888(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 800148fc: 22a13023 sd a0,544(sp) + 80014900: 22b13423 sd a1,552(sp) + 80014904: a015 j 80014928 <.LBB16_84+0x22> + +0000000080014906 <.LBB16_84>: + LOG.end_op(); + 80014906: 00047517 auipc a0,0x47 + 8001490a: bd250513 addi a0,a0,-1070 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001490e: ffff5097 auipc ra,0xffff5 + 80014912: 0b2080e7 jalr 178(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014916: a009 j 80014918 <.LBB16_84+0x12> + 80014918: 4505 li a0,1 + return Err(()) + 8001491a: e9aa sd a0,208(sp) + 8001491c: 13a8 addi a0,sp,488 + } + 8001491e: ffff3097 auipc ra,0xffff3 + 80014922: 812080e7 jalr -2030(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 80014926: a409 j 80014b28 <.LBB16_90+0x3e> + 80014928: 1408 addi a0,sp,544 + if inode_guard.dinode.nlink < 1 { + 8001492a: 0000a097 auipc ra,0xa + 8001492e: b68080e7 jalr -1176(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80014932: f0aa sd a0,96(sp) + 80014934: a009 j 80014936 <.LBB16_84+0x30> + 80014936: 7506 ld a0,96(sp) + 80014938: 00e51583 lh a1,14(a0) + 8001493c: 4501 li a0,0 + 8001493e: 02b54263 blt a0,a1,80014962 <.LBB16_86+0x16> + 80014942: a009 j 80014944 <.LBB16_85> + +0000000080014944 <.LBB16_85>: + panic!("sys_unlink: inods's nlink must be larger than 1."); + 80014944: 00016517 auipc a0,0x16 + 80014948: 0a750513 addi a0,a0,167 # 8002a9eb <.L__unnamed_53> + +000000008001494c <.LBB16_86>: + 8001494c: 00016617 auipc a2,0x16 + 80014950: 0d460613 addi a2,a2,212 # 8002aa20 <.L__unnamed_54> + 80014954: 03000593 li a1,48 + 80014958: 0000e097 auipc ra,0xe + 8001495c: 7ec080e7 jalr 2028(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80014960: 0000 unimp + 80014962: 1408 addi a0,sp,544 + } + + if inode_guard.dinode.itype == InodeType::Directory && + 80014964: 0000a097 auipc ra,0xa + 80014968: b2e080e7 jalr -1234(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001496c: ecaa sd a0,88(sp) + 8001496e: a02d j 80014998 <.LBB16_86+0x4c> + 80014970: 4505 li a0,1 + 80014972: 22a10aa3 sb a0,565(sp) + 80014976: a821 j 8001498e <.LBB16_86+0x42> + 80014978: 4501 li a0,0 + 8001497a: 22a10aa3 sb a0,565(sp) + 8001497e: a801 j 8001498e <.LBB16_86+0x42> + 80014980: 1408 addi a0,sp,544 + !inode_guard.is_dir_empty() { + 80014982: 0000a097 auipc ra,0xa + 80014986: b24080e7 jalr -1244(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001498a: e8aa sd a0,80(sp) + 8001498c: a02d j 800149b6 <.LBB16_87+0x1a> + if inode_guard.dinode.itype == InodeType::Directory && + 8001498e: 23514503 lbu a0,565(sp) + 80014992: 8905 andi a0,a0,1 + 80014994: ed0d bnez a0,800149ce <.LBB16_87+0x32> + 80014996: a0a9 j 800149e0 <.LBB16_87+0x44> + 80014998: 6566 ld a0,88(sp) + 8001499a: 0521 addi a0,a0,8 + +000000008001499c <.LBB16_87>: + 8001499c: 00016597 auipc a1,0x16 + 800149a0: c7458593 addi a1,a1,-908 # 8002a610 <.L__unnamed_20> + 800149a4: ffff4097 auipc ra,0xffff4 + 800149a8: bf4080e7 jalr -1036(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 800149ac: e4aa sd a0,72(sp) + 800149ae: a009 j 800149b0 <.LBB16_87+0x14> + 800149b0: 6526 ld a0,72(sp) + 800149b2: f579 bnez a0,80014980 <.LBB16_86+0x34> + 800149b4: b7d1 j 80014978 <.LBB16_86+0x2c> + !inode_guard.is_dir_empty() { + 800149b6: 6546 ld a0,80(sp) + 800149b8: 00007097 auipc ra,0x7 + 800149bc: 15e080e7 jalr 350(ra) # 8001bb16 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E> + 800149c0: e0aa sd a0,64(sp) + 800149c2: a009 j 800149c4 <.LBB16_87+0x28> + 800149c4: 6506 ld a0,64(sp) + 800149c6: 4581 li a1,0 + if inode_guard.dinode.itype == InodeType::Directory && + 800149c8: fab504e3 beq a0,a1,80014970 <.LBB16_86+0x24> + 800149cc: b775 j 80014978 <.LBB16_86+0x2c> + drop(inode_guard); + 800149ce: 22013503 ld a0,544(sp) + 800149d2: 22813583 ld a1,552(sp) + 800149d6: 00009097 auipc ra,0x9 + 800149da: 464080e7 jalr 1124(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800149de: a801 j 800149ee <.LBB16_87+0x52> + 800149e0: 1408 addi a0,sp,544 + drop(parent_guard); + LOG.end_op(); + return Err(()) + } + + if inode_guard.dinode.itype == InodeType::Directory { + 800149e2: 0000a097 auipc ra,0xa + 800149e6: ab0080e7 jalr -1360(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 800149ea: fc2a sd a0,56(sp) + 800149ec: a025 j 80014a14 <.LBB16_88+0x18> + drop(parent_guard); + 800149ee: 655e ld a0,464(sp) + 800149f0: 65fe ld a1,472(sp) + 800149f2: 00009097 auipc ra,0x9 + 800149f6: 448080e7 jalr 1096(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800149fa: a009 j 800149fc <.LBB16_88> + +00000000800149fc <.LBB16_88>: + LOG.end_op(); + 800149fc: 00047517 auipc a0,0x47 + 80014a00: adc50513 addi a0,a0,-1316 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014a04: ffff5097 auipc ra,0xffff5 + 80014a08: fbc080e7 jalr -68(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014a0c: a009 j 80014a0e <.LBB16_88+0x12> + 80014a0e: 4505 li a0,1 + return Err(()) + 80014a10: e9aa sd a0,208(sp) + 80014a12: aa19 j 80014b28 <.LBB16_90+0x3e> + if inode_guard.dinode.itype == InodeType::Directory { + 80014a14: 7562 ld a0,56(sp) + 80014a16: 0521 addi a0,a0,8 + +0000000080014a18 <.LBB16_89>: + 80014a18: 00016597 auipc a1,0x16 + 80014a1c: bf858593 addi a1,a1,-1032 # 8002a610 <.L__unnamed_20> + 80014a20: ffff4097 auipc ra,0xffff4 + 80014a24: b78080e7 jalr -1160(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 80014a28: f82a sd a0,48(sp) + 80014a2a: a009 j 80014a2c <.LBB16_89+0x14> + 80014a2c: 7542 ld a0,48(sp) + 80014a2e: 4581 li a1,0 + 80014a30: 00b50a63 beq a0,a1,80014a44 <.LBB16_89+0x2c> + 80014a34: a009 j 80014a36 <.LBB16_89+0x1e> + 80014a36: 0b88 addi a0,sp,464 + parent_guard.dinode.nlink -= 1; + 80014a38: 0000a097 auipc ra,0xa + 80014a3c: a6e080e7 jalr -1426(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014a40: f42a sd a0,40(sp) + 80014a42: a011 j 80014a46 <.LBB16_89+0x2e> + if inode_guard.dinode.itype == InodeType::Directory { + 80014a44: a83d j 80014a82 <.LBB16_89+0x6a> + parent_guard.dinode.nlink -= 1; + 80014a46: 7522 ld a0,40(sp) + 80014a48: 00e51503 lh a0,14(a0) + 80014a4c: fff50593 addi a1,a0,-1 + 80014a50: f02e sd a1,32(sp) + 80014a52: 03059513 slli a0,a1,0x30 + 80014a56: 9541 srai a0,a0,0x30 + 80014a58: 10b51c63 bne a0,a1,80014b70 <.LBB16_91> + 80014a5c: a009 j 80014a5e <.LBB16_89+0x46> + 80014a5e: 7502 ld a0,32(sp) + 80014a60: 75a2 ld a1,40(sp) + 80014a62: 00a59723 sh a0,14(a1) + 80014a66: 0b88 addi a0,sp,464 + parent_guard.update(); + 80014a68: 0000a097 auipc ra,0xa + 80014a6c: a3e080e7 jalr -1474(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014a70: ec2a sd a0,24(sp) + 80014a72: a009 j 80014a74 <.LBB16_89+0x5c> + 80014a74: 6562 ld a0,24(sp) + 80014a76: 00006097 auipc ra,0x6 + 80014a7a: 28a080e7 jalr 650(ra) # 8001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE> + 80014a7e: a009 j 80014a80 <.LBB16_89+0x68> + if inode_guard.dinode.itype == InodeType::Directory { + 80014a80: a009 j 80014a82 <.LBB16_89+0x6a> + } + drop(parent_guard); + 80014a82: 655e ld a0,464(sp) + 80014a84: 65fe ld a1,472(sp) + 80014a86: 00009097 auipc ra,0x9 + 80014a8a: 3b4080e7 jalr 948(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014a8e: a009 j 80014a90 <.LBB16_89+0x78> + 80014a90: 1408 addi a0,sp,544 + + inode_guard.dinode.nlink -= 1; + 80014a92: 0000a097 auipc ra,0xa + 80014a96: a14080e7 jalr -1516(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014a9a: e82a sd a0,16(sp) + 80014a9c: a009 j 80014a9e <.LBB16_89+0x86> + 80014a9e: 6542 ld a0,16(sp) + 80014aa0: 00e51503 lh a0,14(a0) + 80014aa4: fff50593 addi a1,a0,-1 + 80014aa8: e42e sd a1,8(sp) + 80014aaa: 03059513 slli a0,a1,0x30 + 80014aae: 9541 srai a0,a0,0x30 + 80014ab0: 0cb51f63 bne a0,a1,80014b8e <.LBB16_93> + 80014ab4: a009 j 80014ab6 <.LBB16_89+0x9e> + 80014ab6: 6522 ld a0,8(sp) + 80014ab8: 65c2 ld a1,16(sp) + 80014aba: 00a59723 sh a0,14(a1) + 80014abe: 1408 addi a0,sp,544 + inode_guard.update(); + 80014ac0: 0000a097 auipc ra,0xa + 80014ac4: 9e6080e7 jalr -1562(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014ac8: e02a sd a0,0(sp) + 80014aca: a009 j 80014acc <.LBB16_89+0xb4> + 80014acc: 6502 ld a0,0(sp) + 80014ace: 00006097 auipc ra,0x6 + 80014ad2: 232080e7 jalr 562(ra) # 8001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE> + 80014ad6: a009 j 80014ad8 <.LBB16_89+0xc0> + drop(inode_guard); + 80014ad8: 22013503 ld a0,544(sp) + 80014adc: 22813583 ld a1,552(sp) + 80014ae0: 00009097 auipc ra,0x9 + 80014ae4: 35a080e7 jalr 858(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014ae8: a009 j 80014aea <.LBB16_90> + +0000000080014aea <.LBB16_90>: + + LOG.end_op(); + 80014aea: 00047517 auipc a0,0x47 + 80014aee: 9ee50513 addi a0,a0,-1554 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014af2: ffff5097 auipc ra,0xffff5 + 80014af6: ece080e7 jalr -306(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014afa: a009 j 80014afc <.LBB16_90+0x12> + 80014afc: 4501 li a0,0 + Ok(0) + 80014afe: edaa sd a0,216(sp) + 80014b00: e9aa sd a0,208(sp) + 80014b02: 0308 addi a0,sp,384 + } + 80014b04: ffff2097 auipc ra,0xffff2 + 80014b08: 562080e7 jalr 1378(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80014b0c: a009 j 80014b0e <.LBB16_90+0x24> + 80014b0e: 4501 li a0,0 + 80014b10: 22a10b23 sb a0,566(sp) + 80014b14: 1a88 addi a0,sp,368 + 80014b16: ffff2097 auipc ra,0xffff2 + 80014b1a: 550080e7 jalr 1360(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80014b1e: a009 j 80014b20 <.LBB16_90+0x36> + 80014b20: 4501 li a0,0 + 80014b22: 22a10ba3 sb a0,567(sp) + 80014b26: a015 j 80014b4a <.LBB16_90+0x60> + 80014b28: 23614503 lbu a0,566(sp) + 80014b2c: 8905 andi a0,a0,1 + 80014b2e: e50d bnez a0,80014b58 <.LBB16_90+0x6e> + 80014b30: a009 j 80014b32 <.LBB16_90+0x48> + 80014b32: 4501 li a0,0 + 80014b34: 22a10b23 sb a0,566(sp) + 80014b38: 23714503 lbu a0,567(sp) + 80014b3c: 8905 andi a0,a0,1 + 80014b3e: e11d bnez a0,80014b64 <.LBB16_90+0x7a> + 80014b40: a009 j 80014b42 <.LBB16_90+0x58> + 80014b42: 4501 li a0,0 + 80014b44: 22a10ba3 sb a0,567(sp) + 80014b48: a009 j 80014b4a <.LBB16_90+0x60> + 80014b4a: 654e ld a0,208(sp) + 80014b4c: 65ee ld a1,216(sp) + 80014b4e: 29813083 ld ra,664(sp) + 80014b52: 2a010113 addi sp,sp,672 + 80014b56: 8082 ret + 80014b58: 0308 addi a0,sp,384 + 80014b5a: ffff2097 auipc ra,0xffff2 + 80014b5e: 50c080e7 jalr 1292(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80014b62: bfc1 j 80014b32 <.LBB16_90+0x48> + 80014b64: 1a88 addi a0,sp,368 + 80014b66: ffff2097 auipc ra,0xffff2 + 80014b6a: 500080e7 jalr 1280(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80014b6e: bfd1 j 80014b42 <.LBB16_90+0x58> + +0000000080014b70 <.LBB16_91>: + parent_guard.dinode.nlink -= 1; + 80014b70: 00016517 auipc a0,0x16 + 80014b74: ee050513 addi a0,a0,-288 # 8002aa50 + +0000000080014b78 <.LBB16_92>: + 80014b78: 00016617 auipc a2,0x16 + 80014b7c: ec060613 addi a2,a2,-320 # 8002aa38 <.L__unnamed_55> + 80014b80: 02100593 li a1,33 + 80014b84: 0000e097 auipc ra,0xe + 80014b88: 5c0080e7 jalr 1472(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080014b8e <.LBB16_93>: + inode_guard.dinode.nlink -= 1; + 80014b8e: 00016517 auipc a0,0x16 + 80014b92: ec250513 addi a0,a0,-318 # 8002aa50 + +0000000080014b96 <.LBB16_94>: + 80014b96: 00016617 auipc a2,0x16 + 80014b9a: ee260613 addi a2,a2,-286 # 8002aa78 <.L__unnamed_56> + 80014b9e: 02100593 li a1,33 + 80014ba2: 0000e097 auipc ra,0xe + 80014ba6: 5a2080e7 jalr 1442(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE: + +0000000080014bac <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE>: + + /// Create the path new as a link to the same inode as old. + pub fn sys_link(&self) -> SysResult { + 80014bac: d2010113 addi sp,sp,-736 + 80014bb0: 2c113c23 sd ra,728(sp) + 80014bb4: ed2a sd a0,152(sp) + 80014bb6: 2aa13023 sd a0,672(sp) + 80014bba: 4581 li a1,0 + let mut new_path = [0u8; MAXPATH]; + 80014bbc: e92e sd a1,144(sp) + 80014bbe: 28b10fa3 sb a1,671(sp) + 80014bc2: 28b10ea3 sb a1,669(sp) + 80014bc6: 28b10f23 sb a1,670(sp) + 80014bca: 1928 addi a0,sp,184 + 80014bcc: 08000613 li a2,128 + 80014bd0: e532 sd a2,136(sp) + 80014bd2: 00011097 auipc ra,0x11 + 80014bd6: 502080e7 jalr 1282(ra) # 800260d4 + 80014bda: 662a ld a2,136(sp) + 80014bdc: 65ca ld a1,144(sp) + 80014bde: 1a28 addi a0,sp,312 + let mut old_path = [0u8; MAXPATH]; + 80014be0: 00011097 auipc ra,0x11 + 80014be4: 4f4080e7 jalr 1268(ra) # 800260d4 + 80014be8: 65ca ld a1,144(sp) + let mut name = [0u8; DIRSIZ]; + 80014bea: 656a ld a0,152(sp) + 80014bec: ff2e sd a1,440(sp) + 80014bee: 1cb12023 sw a1,448(sp) + 80014bf2: 1cb11223 sh a1,452(sp) + let inode: Inode; + let parent: Inode; + + let old_path_addr = self.arg(0); + 80014bf6: 00001097 auipc ra,0x1 + 80014bfa: 284080e7 jalr 644(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80014bfe: 85aa mv a1,a0 + 80014c00: f12e sd a1,160(sp) + 80014c02: 2ca13423 sd a0,712(sp) + 80014c06: a009 j 80014c08 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0x5c> + let new_path_addr = self.arg(1); + 80014c08: 656a ld a0,152(sp) + 80014c0a: 4585 li a1,1 + 80014c0c: 00001097 auipc ra,0x1 + 80014c10: 26e080e7 jalr 622(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80014c14: 85aa mv a1,a0 + 80014c16: e12e sd a1,128(sp) + 80014c18: 2ca13823 sd a0,720(sp) + 80014c1c: a009 j 80014c1e <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0x72> + self.copy_from_str(old_path_addr, &mut old_path, MAXPATH)?; + 80014c1e: 758a ld a1,160(sp) + 80014c20: 656a ld a0,152(sp) + 80014c22: 1a30 addi a2,sp,312 + 80014c24: 08000713 li a4,128 + 80014c28: 86ba mv a3,a4 + 80014c2a: 00001097 auipc ra,0x1 + 80014c2e: 300080e7 jalr 768(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80014c32: fcaa sd a0,120(sp) + 80014c34: a009 j 80014c36 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0x8a> + 80014c36: 7566 ld a0,120(sp) + 80014c38: ffff9097 auipc ra,0xffff9 + 80014c3c: ef6080e7 jalr -266(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 80014c40: 1ea10723 sb a0,494(sp) + 80014c44: a009 j 80014c46 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0x9a> + 80014c46: 1ee14503 lbu a0,494(sp) + 80014c4a: 8905 andi a0,a0,1 + 80014c4c: 4581 li a1,0 + 80014c4e: 00b50463 beq a0,a1,80014c56 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0xaa> + 80014c52: a009 j 80014c54 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0xa8> + 80014c54: a831 j 80014c70 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0xc4> + self.copy_from_str(new_path_addr, &mut new_path, MAXPATH)?; + 80014c56: 658a ld a1,128(sp) + 80014c58: 656a ld a0,152(sp) + 80014c5a: 1930 addi a2,sp,184 + 80014c5c: 08000713 li a4,128 + 80014c60: 86ba mv a3,a4 + 80014c62: 00001097 auipc ra,0x1 + 80014c66: 2c8080e7 jalr 712(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 80014c6a: f8aa sd a0,112(sp) + 80014c6c: a831 j 80014c88 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0xdc> + self.copy_from_str(old_path_addr, &mut old_path, MAXPATH)?; + 80014c6e: 0000 unimp + 80014c70: ffff7097 auipc ra,0xffff7 + 80014c74: 710080e7 jalr 1808(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80014c78: a009 j 80014c7a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0xce> + 80014c7a: ffff9097 auipc ra,0xffff9 + 80014c7e: d88080e7 jalr -632(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 80014c82: f52a sd a0,168(sp) + 80014c84: f92e sd a1,176(sp) + 80014c86: ae81 j 80014fd6 <.LBB17_81+0x22> + self.copy_from_str(new_path_addr, &mut new_path, MAXPATH)?; + 80014c88: 7546 ld a0,112(sp) + 80014c8a: ffff9097 auipc ra,0xffff9 + 80014c8e: ea4080e7 jalr -348(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 80014c92: 1ea107a3 sb a0,495(sp) + 80014c96: a009 j 80014c98 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0xec> + 80014c98: 1ef14503 lbu a0,495(sp) + 80014c9c: 8905 andi a0,a0,1 + 80014c9e: 4581 li a1,0 + 80014ca0: 00b50463 beq a0,a1,80014ca8 <.LBB17_72> + 80014ca4: a009 j 80014ca6 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE+0xfa> + 80014ca6: a819 j 80014cbc <.LBB17_72+0x14> + +0000000080014ca8 <.LBB17_72>: + + LOG.begin_op(); + 80014ca8: 00047517 auipc a0,0x47 + 80014cac: 83050513 addi a0,a0,-2000 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014cb0: ffff4097 auipc ra,0xffff4 + 80014cb4: 72a080e7 jalr 1834(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 80014cb8: a831 j 80014cd4 <.LBB17_73> + self.copy_from_str(new_path_addr, &mut new_path, MAXPATH)?; + 80014cba: 0000 unimp + 80014cbc: ffff7097 auipc ra,0xffff7 + 80014cc0: 6c4080e7 jalr 1732(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80014cc4: a009 j 80014cc6 <.LBB17_72+0x1e> + 80014cc6: ffff9097 auipc ra,0xffff9 + 80014cca: d3c080e7 jalr -708(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 80014cce: f52a sd a0,168(sp) + 80014cd0: f92e sd a1,176(sp) + 80014cd2: a611 j 80014fd6 <.LBB17_81+0x22> + +0000000080014cd4 <.LBB17_73>: + match ICACHE.namei(&old_path) { + 80014cd4: 00047597 auipc a1,0x47 + 80014cd8: 8ac58593 addi a1,a1,-1876 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 80014cdc: 1b88 addi a0,sp,496 + 80014cde: 1a30 addi a2,sp,312 + 80014ce0: 08000693 li a3,128 + 80014ce4: 00005097 auipc ra,0x5 + 80014ce8: 544080e7 jalr 1348(ra) # 8001a228 <_ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E> + 80014cec: a009 j 80014cee <.LBB17_73+0x1a> + Some(cur) => { + 80014cee: 755e ld a0,496(sp) + 80014cf0: 4581 li a1,0 + 80014cf2: 00b50463 beq a0,a1,80014cfa <.LBB17_74> + 80014cf6: a009 j 80014cf8 <.LBB17_73+0x24> + 80014cf8: a819 j 80014d0e <.LBB17_74+0x14> + +0000000080014cfa <.LBB17_74>: + inode = cur; + }, + + None => { + LOG.end_op(); + 80014cfa: 00046517 auipc a0,0x46 + 80014cfe: 7de50513 addi a0,a0,2014 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014d02: ffff5097 auipc ra,0xffff5 + 80014d06: cbe080e7 jalr -834(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014d0a: a825 j 80014d42 <.LBB17_74+0x48> + match ICACHE.namei(&old_path) { + 80014d0c: 0000 unimp + Some(cur) => { + 80014d0e: 20013503 ld a0,512(sp) + 80014d12: 20a13823 sd a0,528(sp) + 80014d16: 75fe ld a1,504(sp) + 80014d18: 20b13423 sd a1,520(sp) + inode = cur; + 80014d1c: 20b13c23 sd a1,536(sp) + 80014d20: 22a13023 sd a0,544(sp) + 80014d24: 4605 li a2,1 + 80014d26: 28c10fa3 sb a2,671(sp) + 80014d2a: e7ae sd a1,456(sp) + 80014d2c: ebaa sd a0,464(sp) + 80014d2e: 03a8 addi a0,sp,456 + return Err(()) + } + } + let mut inode_guard = inode.lock(); + 80014d30: 00007097 auipc ra,0x7 + 80014d34: f3c080e7 jalr -196(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 80014d38: 22a13423 sd a0,552(sp) + 80014d3c: 22b13823 sd a1,560(sp) + 80014d40: a021 j 80014d48 <.LBB17_74+0x4e> + 80014d42: 4505 li a0,1 + return Err(()) + 80014d44: f52a sd a0,168(sp) + 80014d46: ac41 j 80014fd6 <.LBB17_81+0x22> + 80014d48: 1428 addi a0,sp,552 + if inode_guard.dinode.itype == InodeType::Directory { + 80014d4a: 00009097 auipc ra,0x9 + 80014d4e: 748080e7 jalr 1864(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80014d52: f4aa sd a0,104(sp) + 80014d54: a009 j 80014d56 <.LBB17_74+0x5c> + 80014d56: 7526 ld a0,104(sp) + 80014d58: 0521 addi a0,a0,8 + +0000000080014d5a <.LBB17_75>: + 80014d5a: 00016597 auipc a1,0x16 + 80014d5e: 8b658593 addi a1,a1,-1866 # 8002a610 <.L__unnamed_20> + 80014d62: ffff4097 auipc ra,0xffff4 + 80014d66: 836080e7 jalr -1994(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 80014d6a: f0aa sd a0,96(sp) + 80014d6c: a009 j 80014d6e <.LBB17_75+0x14> + 80014d6e: 7506 ld a0,96(sp) + 80014d70: 4581 li a1,0 + 80014d72: 00b50c63 beq a0,a1,80014d8a <.LBB17_75+0x30> + 80014d76: a009 j 80014d78 <.LBB17_75+0x1e> + drop(inode_guard); + 80014d78: 22813503 ld a0,552(sp) + 80014d7c: 23013583 ld a1,560(sp) + 80014d80: 00009097 auipc ra,0x9 + 80014d84: 0ba080e7 jalr 186(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014d88: a801 j 80014d98 <.LBB17_76> + 80014d8a: 1428 addi a0,sp,552 + LOG.end_op(); + return Err(()) + } + + inode_guard.dinode.nlink += 1; + 80014d8c: 00009097 auipc ra,0x9 + 80014d90: 71a080e7 jalr 1818(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014d94: ecaa sd a0,88(sp) + 80014d96: a829 j 80014db0 <.LBB17_76+0x18> + +0000000080014d98 <.LBB17_76>: + LOG.end_op(); + 80014d98: 00046517 auipc a0,0x46 + 80014d9c: 74050513 addi a0,a0,1856 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014da0: ffff5097 auipc ra,0xffff5 + 80014da4: c20080e7 jalr -992(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014da8: a009 j 80014daa <.LBB17_76+0x12> + 80014daa: 4505 li a0,1 + return Err(()) + 80014dac: f52a sd a0,168(sp) + 80014dae: a425 j 80014fd6 <.LBB17_81+0x22> + inode_guard.dinode.nlink += 1; + 80014db0: 6566 ld a0,88(sp) + 80014db2: 00e51503 lh a0,14(a0) + 80014db6: 00150593 addi a1,a0,1 + 80014dba: e8ae sd a1,80(sp) + 80014dbc: 03059513 slli a0,a1,0x30 + 80014dc0: 9541 srai a0,a0,0x30 + 80014dc2: 26b51863 bne a0,a1,80015032 <.LBB17_82> + 80014dc6: a009 j 80014dc8 <.LBB17_76+0x30> + 80014dc8: 6546 ld a0,80(sp) + 80014dca: 65e6 ld a1,88(sp) + 80014dcc: 00a59723 sh a0,14(a1) + +0000000080014dd0 <.LBB17_77>: + + match ICACHE.namei_parent(&new_path, &mut name) { + 80014dd0: 00046597 auipc a1,0x46 + 80014dd4: 7b058593 addi a1,a1,1968 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 80014dd8: 1c28 addi a0,sp,568 + 80014dda: 1930 addi a2,sp,184 + 80014ddc: 08000693 li a3,128 + 80014de0: 1b38 addi a4,sp,440 + 80014de2: 00005097 auipc ra,0x5 + 80014de6: 46c080e7 jalr 1132(ra) # 8001a24e <_ZN6kernel2fs5inode10InodeCache12namei_parent17h24bebf98ccd9b34eE> + 80014dea: a009 j 80014dec <.LBB17_77+0x1c> + Some(cur) => { + 80014dec: 23813503 ld a0,568(sp) + 80014df0: 4581 li a1,0 + 80014df2: 00b51a63 bne a0,a1,80014e06 <.LBB17_77+0x36> + 80014df6: a009 j 80014df8 <.LBB17_77+0x28> + 80014df8: 1428 addi a0,sp,552 + parent = cur; + }, + + _ => { + inode_guard.dinode.nlink -= 1; + 80014dfa: 00009097 auipc ra,0x9 + 80014dfe: 6ac080e7 jalr 1708(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014e02: e4aa sd a0,72(sp) + 80014e04: a835 j 80014e40 <.LBB17_77+0x70> + Some(cur) => { + 80014e06: 24813583 ld a1,584(sp) + 80014e0a: 24b13c23 sd a1,600(sp) + 80014e0e: 24013603 ld a2,576(sp) + 80014e12: 24c13823 sd a2,592(sp) + parent = cur; + 80014e16: 26c13023 sd a2,608(sp) + 80014e1a: 26b13423 sd a1,616(sp) + 80014e1e: 4505 li a0,1 + 80014e20: 28a10f23 sb a0,670(sp) + 80014e24: efb2 sd a2,472(sp) + 80014e26: f3ae sd a1,480(sp) + drop(inode_guard); + LOG.end_op(); + return Err(()) + } + } + let mut parent_guard = parent.lock(); + 80014e28: 28a10ea3 sb a0,669(sp) + 80014e2c: 0ba8 addi a0,sp,472 + 80014e2e: 00007097 auipc ra,0x7 + 80014e32: e3e080e7 jalr -450(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 80014e36: 26a13823 sd a0,624(sp) + 80014e3a: 26b13c23 sd a1,632(sp) + 80014e3e: a899 j 80014e94 <.LBB17_78+0x22> + inode_guard.dinode.nlink -= 1; + 80014e40: 6526 ld a0,72(sp) + 80014e42: 00e51503 lh a0,14(a0) + 80014e46: fff50593 addi a1,a0,-1 + 80014e4a: e0ae sd a1,64(sp) + 80014e4c: 03059513 slli a0,a1,0x30 + 80014e50: 9541 srai a0,a0,0x30 + 80014e52: 1eb51e63 bne a0,a1,8001504e <.LBB17_84> + 80014e56: a009 j 80014e58 <.LBB17_77+0x88> + 80014e58: 6506 ld a0,64(sp) + 80014e5a: 65a6 ld a1,72(sp) + 80014e5c: 00a59723 sh a0,14(a1) + drop(inode_guard); + 80014e60: 22813503 ld a0,552(sp) + 80014e64: 23013583 ld a1,560(sp) + 80014e68: 00009097 auipc ra,0x9 + 80014e6c: fd2080e7 jalr -46(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014e70: a009 j 80014e72 <.LBB17_78> + +0000000080014e72 <.LBB17_78>: + LOG.end_op(); + 80014e72: 00046517 auipc a0,0x46 + 80014e76: 66650513 addi a0,a0,1638 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014e7a: ffff5097 auipc ra,0xffff5 + 80014e7e: b46080e7 jalr -1210(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014e82: a009 j 80014e84 <.LBB17_78+0x12> + 80014e84: 4505 li a0,1 + return Err(()) + 80014e86: f52a sd a0,168(sp) + 80014e88: 1c28 addi a0,sp,568 + } + 80014e8a: ffff2097 auipc ra,0xffff2 + 80014e8e: 2a6080e7 jalr 678(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 80014e92: a291 j 80014fd6 <.LBB17_81+0x22> + 80014e94: 1c88 addi a0,sp,624 + if parent_guard.dinode.itype != InodeType::Directory || + 80014e96: 00009097 auipc ra,0x9 + 80014e9a: 5fc080e7 jalr 1532(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80014e9e: fc2a sd a0,56(sp) + 80014ea0: a02d j 80014eca <.LBB17_78+0x58> + 80014ea2: 4505 li a0,1 + 80014ea4: 28a103a3 sb a0,647(sp) + 80014ea8: a821 j 80014ec0 <.LBB17_78+0x4e> + 80014eaa: 4501 li a0,0 + 80014eac: 28a103a3 sb a0,647(sp) + 80014eb0: a801 j 80014ec0 <.LBB17_78+0x4e> + 80014eb2: 1c88 addi a0,sp,624 + parent_guard.dir_link(&name, inode.inum).is_ok() { + 80014eb4: 00009097 auipc ra,0x9 + 80014eb8: 5f2080e7 jalr 1522(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014ebc: f82a sd a0,48(sp) + 80014ebe: a02d j 80014ee8 <.LBB17_79+0x1a> + if parent_guard.dinode.itype != InodeType::Directory || + 80014ec0: 28714503 lbu a0,647(sp) + 80014ec4: 8905 andi a0,a0,1 + 80014ec6: e929 bnez a0,80014f18 <.LBB17_79+0x4a> + 80014ec8: a0a5 j 80014f30 <.LBB17_79+0x62> + 80014eca: 7562 ld a0,56(sp) + 80014ecc: 0521 addi a0,a0,8 + +0000000080014ece <.LBB17_79>: + 80014ece: 00015597 auipc a1,0x15 + 80014ed2: 74258593 addi a1,a1,1858 # 8002a610 <.L__unnamed_20> + 80014ed6: 00004097 auipc ra,0x4 + 80014eda: 310080e7 jalr 784(ra) # 800191e6 <_ZN4core3cmp9PartialEq2ne17ha4fd141ed85850e3E> + 80014ede: f42a sd a0,40(sp) + 80014ee0: a009 j 80014ee2 <.LBB17_79+0x14> + 80014ee2: 7522 ld a0,40(sp) + 80014ee4: fd5d bnez a0,80014ea2 <.LBB17_78+0x30> + 80014ee6: b7f1 j 80014eb2 <.LBB17_78+0x40> + parent_guard.dir_link(&name, inode.inum).is_ok() { + 80014ee8: 7542 ld a0,48(sp) + 80014eea: 1d412683 lw a3,468(sp) + 80014eee: 1b2c addi a1,sp,440 + 80014ef0: 4639 li a2,14 + 80014ef2: 00007097 auipc ra,0x7 + 80014ef6: 9ba080e7 jalr -1606(ra) # 8001b8ac <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE> + 80014efa: 28a13423 sd a0,648(sp) + 80014efe: 28b13823 sd a1,656(sp) + 80014f02: a009 j 80014f04 <.LBB17_79+0x36> + 80014f04: 0528 addi a0,sp,648 + 80014f06: ffff8097 auipc ra,0xffff8 + 80014f0a: 6c0080e7 jalr 1728(ra) # 8000d5c6 <_ZN4core6result19Result$LT$T$C$E$GT$5is_ok17h5bbc2715c9ad6c41E> + 80014f0e: f02a sd a0,32(sp) + 80014f10: a009 j 80014f12 <.LBB17_79+0x44> + if parent_guard.dinode.itype != InodeType::Directory || + 80014f12: 7502 ld a0,32(sp) + 80014f14: f559 bnez a0,80014ea2 <.LBB17_78+0x30> + 80014f16: bf51 j 80014eaa <.LBB17_78+0x38> + 80014f18: 4501 li a0,0 + drop(parent_guard); + 80014f1a: 28a10ea3 sb a0,669(sp) + 80014f1e: 27013503 ld a0,624(sp) + 80014f22: 27813583 ld a1,632(sp) + 80014f26: 00009097 auipc ra,0x9 + 80014f2a: f14080e7 jalr -236(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014f2e: a801 j 80014f3e <.LBB17_79+0x70> + 80014f30: 1428 addi a0,sp,552 + drop(inode_guard); + LOG.end_op(); + return Err(()) + } + + inode_guard.update(); + 80014f32: 00009097 auipc ra,0x9 + 80014f36: 574080e7 jalr 1396(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014f3a: ec2a sd a0,24(sp) + 80014f3c: a8a9 j 80014f96 <.LBB17_80+0x18> + 80014f3e: 1428 addi a0,sp,552 + inode_guard.dinode.nlink -= 1; + 80014f40: 00009097 auipc ra,0x9 + 80014f44: 566080e7 jalr 1382(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80014f48: e82a sd a0,16(sp) + 80014f4a: a009 j 80014f4c <.LBB17_79+0x7e> + 80014f4c: 6542 ld a0,16(sp) + 80014f4e: 00e51503 lh a0,14(a0) + 80014f52: fff50593 addi a1,a0,-1 + 80014f56: e42e sd a1,8(sp) + 80014f58: 03059513 slli a0,a1,0x30 + 80014f5c: 9541 srai a0,a0,0x30 + 80014f5e: 10b51763 bne a0,a1,8001506c <.LBB17_86> + 80014f62: a009 j 80014f64 <.LBB17_79+0x96> + 80014f64: 6522 ld a0,8(sp) + 80014f66: 65c2 ld a1,16(sp) + 80014f68: 00a59723 sh a0,14(a1) + drop(inode_guard); + 80014f6c: 22813503 ld a0,552(sp) + 80014f70: 23013583 ld a1,560(sp) + 80014f74: 00009097 auipc ra,0x9 + 80014f78: ec6080e7 jalr -314(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014f7c: a009 j 80014f7e <.LBB17_80> + +0000000080014f7e <.LBB17_80>: + LOG.end_op(); + 80014f7e: 00046517 auipc a0,0x46 + 80014f82: 55a50513 addi a0,a0,1370 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014f86: ffff5097 auipc ra,0xffff5 + 80014f8a: a3a080e7 jalr -1478(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014f8e: a009 j 80014f90 <.LBB17_80+0x12> + 80014f90: 4505 li a0,1 + return Err(()) + 80014f92: f52a sd a0,168(sp) + 80014f94: a8b5 j 80015010 <.LBB17_81+0x5c> + inode_guard.update(); + 80014f96: 6562 ld a0,24(sp) + 80014f98: 00006097 auipc ra,0x6 + 80014f9c: d68080e7 jalr -664(ra) # 8001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE> + 80014fa0: a009 j 80014fa2 <.LBB17_80+0x24> + drop(inode_guard); + 80014fa2: 22813503 ld a0,552(sp) + 80014fa6: 23013583 ld a1,560(sp) + 80014faa: 00009097 auipc ra,0x9 + 80014fae: e90080e7 jalr -368(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 80014fb2: a009 j 80014fb4 <.LBB17_81> + +0000000080014fb4 <.LBB17_81>: + LOG.end_op(); + 80014fb4: 00046517 auipc a0,0x46 + 80014fb8: 52450513 addi a0,a0,1316 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80014fbc: ffff5097 auipc ra,0xffff5 + 80014fc0: a04080e7 jalr -1532(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 80014fc4: a009 j 80014fc6 <.LBB17_81+0x12> + 80014fc6: 4501 li a0,0 + return Ok(0) + 80014fc8: f92a sd a0,176(sp) + 80014fca: f52a sd a0,168(sp) + 80014fcc: a091 j 80015010 <.LBB17_81+0x5c> + 80014fce: 4501 li a0,0 + } + 80014fd0: 28a10ea3 sb a0,669(sp) + 80014fd4: a009 j 80014fd6 <.LBB17_81+0x22> + 80014fd6: 29e14503 lbu a0,670(sp) + 80014fda: 8905 andi a0,a0,1 + 80014fdc: ed1d bnez a0,8001501a <.LBB17_81+0x66> + 80014fde: a009 j 80014fe0 <.LBB17_81+0x2c> + 80014fe0: 4501 li a0,0 + 80014fe2: 28a10f23 sb a0,670(sp) + 80014fe6: 29f14503 lbu a0,671(sp) + 80014fea: 8905 andi a0,a0,1 + 80014fec: ed0d bnez a0,80015026 <.LBB17_81+0x72> + 80014fee: a009 j 80014ff0 <.LBB17_81+0x3c> + 80014ff0: 4501 li a0,0 + 80014ff2: 28a10fa3 sb a0,671(sp) + 80014ff6: 752a ld a0,168(sp) + 80014ff8: 75ca ld a1,176(sp) + 80014ffa: 2d813083 ld ra,728(sp) + 80014ffe: 2e010113 addi sp,sp,736 + 80015002: 8082 ret + 80015004: 1c88 addi a0,sp,624 + 80015006: ffff2097 auipc ra,0xffff2 + 8001500a: 234080e7 jalr 564(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 8001500e: b7c1 j 80014fce <.LBB17_81+0x1a> + 80015010: 29d14503 lbu a0,669(sp) + 80015014: 8905 andi a0,a0,1 + 80015016: f57d bnez a0,80015004 <.LBB17_81+0x50> + 80015018: bf5d j 80014fce <.LBB17_81+0x1a> + 8001501a: 0ba8 addi a0,sp,472 + 8001501c: ffff2097 auipc ra,0xffff2 + 80015020: 04a080e7 jalr 74(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80015024: bf75 j 80014fe0 <.LBB17_81+0x2c> + 80015026: 03a8 addi a0,sp,456 + 80015028: ffff2097 auipc ra,0xffff2 + 8001502c: 03e080e7 jalr 62(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 80015030: b7c1 j 80014ff0 <.LBB17_81+0x3c> + +0000000080015032 <.LBB17_82>: + inode_guard.dinode.nlink += 1; + 80015032: 00015517 auipc a0,0x15 + 80015036: 71e50513 addi a0,a0,1822 # 8002a750 + +000000008001503a <.LBB17_83>: + 8001503a: 00016617 auipc a2,0x16 + 8001503e: a5660613 addi a2,a2,-1450 # 8002aa90 <.L__unnamed_57> + 80015042: 45f1 li a1,28 + 80015044: 0000e097 auipc ra,0xe + 80015048: 100080e7 jalr 256(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001504e <.LBB17_84>: + inode_guard.dinode.nlink -= 1; + 8001504e: 00016517 auipc a0,0x16 + 80015052: a0250513 addi a0,a0,-1534 # 8002aa50 + +0000000080015056 <.LBB17_85>: + 80015056: 00016617 auipc a2,0x16 + 8001505a: a5260613 addi a2,a2,-1454 # 8002aaa8 <.L__unnamed_58> + 8001505e: 02100593 li a1,33 + 80015062: 0000e097 auipc ra,0xe + 80015066: 0e2080e7 jalr 226(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001506c <.LBB17_86>: + inode_guard.dinode.nlink -= 1; + 8001506c: 00016517 auipc a0,0x16 + 80015070: 9e450513 addi a0,a0,-1564 # 8002aa50 + +0000000080015074 <.LBB17_87>: + 80015074: 00016617 auipc a2,0x16 + 80015078: a4c60613 addi a2,a2,-1460 # 8002aac0 <.L__unnamed_59> + 8001507c: 02100593 li a1,33 + 80015080: 0000e097 auipc ra,0xe + 80015084: 0c4080e7 jalr 196(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_mkdir17h9fc2155a1c553da1E: + +000000008001508a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_mkdir17h9fc2155a1c553da1E>: + + pub fn sys_mkdir(&self) -> SysResult { + 8001508a: 7165 addi sp,sp,-400 + 8001508c: e706 sd ra,392(sp) + 8001508e: f42a sd a0,40(sp) + 80015090: f2aa sd a0,352(sp) + 80015092: 04710513 addi a0,sp,71 + 80015096: 4581 li a1,0 + 80015098: 08000613 li a2,128 + let mut path = [0u8; MAXPATH]; + 8001509c: 00011097 auipc ra,0x11 + 800150a0: 038080e7 jalr 56(ra) # 800260d4 + +00000000800150a4 <.LBB18_22>: + LOG.begin_op(); + 800150a4: 00046517 auipc a0,0x46 + 800150a8: 43450513 addi a0,a0,1076 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 800150ac: ffff4097 auipc ra,0xffff4 + 800150b0: 32e080e7 jalr 814(ra) # 800093da <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$8begin_op17he5b49a48c716e372E> + 800150b4: a009 j 800150b6 <.LBB18_22+0x12> + let addr = self.arg(0); + 800150b6: 7522 ld a0,40(sp) + 800150b8: 4581 li a1,0 + 800150ba: 00001097 auipc ra,0x1 + 800150be: dc0080e7 jalr -576(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800150c2: 85aa mv a1,a0 + 800150c4: f02e sd a1,32(sp) + 800150c6: feaa sd a0,376(sp) + 800150c8: a009 j 800150ca <.LBB18_22+0x26> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 800150ca: 7582 ld a1,32(sp) + 800150cc: 7522 ld a0,40(sp) + 800150ce: 04710613 addi a2,sp,71 + 800150d2: 08000713 li a4,128 + 800150d6: 86ba mv a3,a4 + 800150d8: 00001097 auipc ra,0x1 + 800150dc: e52080e7 jalr -430(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 800150e0: ec2a sd a0,24(sp) + 800150e2: a009 j 800150e4 <.LBB18_22+0x40> + 800150e4: 6562 ld a0,24(sp) + 800150e6: ffff9097 auipc ra,0xffff9 + 800150ea: a48080e7 jalr -1464(ra) # 8000db2e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h9e3ff03fe8989dd2E> + 800150ee: 0ca103a3 sb a0,199(sp) + 800150f2: a009 j 800150f4 <.LBB18_22+0x50> + 800150f4: 0c714503 lbu a0,199(sp) + 800150f8: 8905 andi a0,a0,1 + 800150fa: 4581 li a1,0 + 800150fc: 00b50463 beq a0,a1,80015104 <.LBB18_22+0x60> + 80015100: a009 j 80015102 <.LBB18_22+0x5e> + 80015102: a02d j 8001512c <.LBB18_23+0x22> + 80015104: 4705 li a4,1 + match ICACHE.create(&path, InodeType::Directory, 0, 0) { + 80015106: 0ee11323 sh a4,230(sp) + +000000008001510a <.LBB18_23>: + 8001510a: 00046597 auipc a1,0x46 + 8001510e: 47658593 addi a1,a1,1142 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 80015112: 01a8 addi a0,sp,200 + 80015114: 04710613 addi a2,sp,71 + 80015118: 08000693 li a3,128 + 8001511c: 4801 li a6,0 + 8001511e: 87c2 mv a5,a6 + 80015120: 00005097 auipc ra,0x5 + 80015124: 14c080e7 jalr 332(ra) # 8001a26c <_ZN6kernel2fs5inode10InodeCache6create17hf2583436fcb9d2ecE> + 80015128: a831 j 80015144 <.LBB18_23+0x3a> + self.copy_from_str(addr, &mut path, MAXPATH)?; + 8001512a: 0000 unimp + 8001512c: ffff7097 auipc ra,0xffff7 + 80015130: 254080e7 jalr 596(ra) # 8000c380 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2e645b443ebf2dc7E> + 80015134: a009 j 80015136 <.LBB18_23+0x2c> + 80015136: ffff9097 auipc ra,0xffff9 + 8001513a: 8cc080e7 jalr -1844(ra) # 8000da02 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h74072cf57097ff24E> + 8001513e: f82a sd a0,48(sp) + 80015140: fc2e sd a1,56(sp) + 80015142: a861 j 800151da <.LBB18_26+0x2e> + Ok(inode) => { + 80015144: 652e ld a0,200(sp) + 80015146: 4581 li a1,0 + 80015148: 02b50663 beq a0,a1,80015174 <.LBB18_24+0x18> + 8001514c: a009 j 8001514e <.LBB18_23+0x44> + drop(inode); + LOG.end_op(); + Ok(0) + }, + + Err(err) => { + 8001514e: 65ce ld a1,208(sp) + 80015150: 656e ld a0,216(sp) + 80015152: e62e sd a1,264(sp) + 80015154: ea2a sd a0,272(sp) + 80015156: 0228 addi a0,sp,264 + println!("[Kernel] sys_mkdir: err: {}", err); + 80015158: eeaa sd a0,344(sp) + 8001515a: e32a sd a0,384(sp) + +000000008001515c <.LBB18_24>: + 8001515c: 0000a597 auipc a1,0xa + 80015160: 30458593 addi a1,a1,772 # 8001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E> + 80015164: 0000a097 auipc ra,0xa + 80015168: 320080e7 jalr 800(ra) # 8001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE> + 8001516c: e42a sd a0,8(sp) + 8001516e: e82e sd a1,16(sp) + 80015170: a815 j 800151a4 <.LBB18_25+0x1a> + match ICACHE.create(&path, InodeType::Directory, 0, 0) { + 80015172: 0000 unimp + Ok(inode) => { + 80015174: 65ee ld a1,216(sp) + 80015176: f9ae sd a1,240(sp) + 80015178: 654e ld a0,208(sp) + 8001517a: f5aa sd a0,232(sp) + drop(inode); + 8001517c: e22e sd a1,256(sp) + 8001517e: fdaa sd a0,248(sp) + 80015180: 00009097 auipc ra,0x9 + 80015184: d80080e7 jalr -640(ra) # 8001df00 <_ZN4core3mem4drop17hb93abdfe16b94be5E> + 80015188: a009 j 8001518a <.LBB18_25> + +000000008001518a <.LBB18_25>: + LOG.end_op(); + 8001518a: 00046517 auipc a0,0x46 + 8001518e: 34e50513 addi a0,a0,846 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 80015192: ffff5097 auipc ra,0xffff5 + 80015196: 82e080e7 jalr -2002(ra) # 800099c0 <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$6end_op17h345c15f0248f080bE> + 8001519a: a009 j 8001519c <.LBB18_25+0x12> + 8001519c: 4501 li a0,0 + Ok(0) + 8001519e: fc2a sd a0,56(sp) + 800151a0: f82a sd a0,48(sp) + match ICACHE.create(&path, InodeType::Directory, 0, 0) { + 800151a2: a81d j 800151d8 <.LBB18_26+0x2c> + println!("[Kernel] sys_mkdir: err: {}", err); + 800151a4: 6542 ld a0,16(sp) + 800151a6: 65a2 ld a1,8(sp) + 800151a8: e6ae sd a1,328(sp) + 800151aa: eaaa sd a0,336(sp) + +00000000800151ac <.LBB18_26>: + 800151ac: 00016597 auipc a1,0x16 + 800151b0: 94c58593 addi a1,a1,-1716 # 8002aaf8 <.L__unnamed_60> + 800151b4: 0a28 addi a0,sp,280 + 800151b6: 4609 li a2,2 + 800151b8: 02b4 addi a3,sp,328 + 800151ba: 4705 li a4,1 + 800151bc: ffff0097 auipc ra,0xffff0 + 800151c0: 3ce080e7 jalr 974(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800151c4: a009 j 800151c6 <.LBB18_26+0x1a> + 800151c6: 0a28 addi a0,sp,280 + 800151c8: 0000a097 auipc ra,0xa + 800151cc: a30080e7 jalr -1488(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800151d0: a009 j 800151d2 <.LBB18_26+0x26> + 800151d2: 4505 li a0,1 + Err(()) + 800151d4: f82a sd a0,48(sp) + match ICACHE.create(&path, InodeType::Directory, 0, 0) { + 800151d6: a009 j 800151d8 <.LBB18_26+0x2c> + } + } + } + 800151d8: a009 j 800151da <.LBB18_26+0x2e> + 800151da: 7542 ld a0,48(sp) + 800151dc: 75e2 ld a1,56(sp) + 800151de: 60ba ld ra,392(sp) + 800151e0: 6159 addi sp,sp,400 + 800151e2: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$11sys_sem_get17hb3397bd9d36c7bd4E: + +00000000800151e4 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$11sys_sem_get17hb3397bd9d36c7bd4E>: + +impl Syscall<'_>{ + + + /**Semaphore */ + pub fn sys_sem_get(&mut self) -> SysResult{ + 800151e4: 7135 addi sp,sp,-160 + 800151e6: ed06 sd ra,152(sp) + 800151e8: e82a sd a0,16(sp) + 800151ea: e52a sd a0,136(sp) + +00000000800151ec <.LBB19_10>: + println!("sys_sem_get in ipc.rs"); + 800151ec: 00016597 auipc a1,0x16 + 800151f0: 94458593 addi a1,a1,-1724 # 8002ab30 <.L__unnamed_61> + +00000000800151f4 <.LBB19_11>: + 800151f4: 00016697 auipc a3,0x16 + 800151f8: 94c68693 addi a3,a3,-1716 # 8002ab40 <.L__unnamed_139> + 800151fc: 1028 addi a0,sp,40 + 800151fe: 4605 li a2,1 + 80015200: 4701 li a4,0 + 80015202: ffff0097 auipc ra,0xffff0 + 80015206: 388080e7 jalr 904(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001520a: a009 j 8001520c <.LBB19_11+0x18> + 8001520c: 1028 addi a0,sp,40 + 8001520e: 0000a097 auipc ra,0xa + 80015212: 9ea080e7 jalr -1558(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80015216: a009 j 80015218 <.LBB19_11+0x24> + let id = self.arg(0) as i32; + 80015218: 6542 ld a0,16(sp) + 8001521a: 4581 li a1,0 + 8001521c: 00001097 auipc ra,0x1 + 80015220: c5e080e7 jalr -930(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80015224: e42a sd a0,8(sp) + 80015226: a009 j 80015228 <.LBB19_11+0x34> + 80015228: 65a2 ld a1,8(sp) + 8001522a: c92e sw a1,144(sp) + +000000008001522c <.LBB19_12>: + let res = unsafe{SEM_MANAGER.get(id)}; + 8001522c: 00048517 auipc a0,0x48 + 80015230: 17450513 addi a0,a0,372 # 8005d3a0 <_ZN6kernel3ipc9semaphore11SEM_MANAGER17hc708ed55c8325c4cE> + 80015234: 00008097 auipc ra,0x8 + 80015238: 6ec080e7 jalr 1772(ra) # 8001d920 <_ZN6kernel3ipc9semaphore8SemTable3get17h969ea55db514a2ceE> + 8001523c: 0005059b sext.w a1,a0 + 80015240: e02e sd a1,0(sp) + 80015242: cb2a sw a0,148(sp) + 80015244: a009 j 80015246 <.LBB19_12+0x1a> + 80015246: 6502 ld a0,0(sp) + 80015248: 4581 li a1,0 + if res >= 0 { + 8001524a: 02b54363 blt a0,a1,80015270 <.LBB19_14+0x18> + 8001524e: a009 j 80015250 <.LBB19_13> + +0000000080015250 <.LBB19_13>: + println!("sys_sem_get res >= 0 in ipc.rs"); + 80015250: 00016597 auipc a1,0x16 + 80015254: 91058593 addi a1,a1,-1776 # 8002ab60 <.L__unnamed_63> + +0000000080015258 <.LBB19_14>: + 80015258: 00016697 auipc a3,0x16 + 8001525c: 8e868693 addi a3,a3,-1816 # 8002ab40 <.L__unnamed_139> + 80015260: 08a8 addi a0,sp,88 + 80015262: 4605 li a2,1 + 80015264: 4701 li a4,0 + 80015266: ffff0097 auipc ra,0xffff0 + 8001526a: 324080e7 jalr 804(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001526e: a021 j 80015276 <.LBB19_14+0x1e> + 80015270: 4505 li a0,1 + Ok(res as usize) + }else{ + Err(()) + 80015272: ec2a sd a0,24(sp) + if res >= 0 { + 80015274: a821 j 8001528c <.LBB19_14+0x34> + 80015276: 08a8 addi a0,sp,88 + println!("sys_sem_get res >= 0 in ipc.rs"); + 80015278: 0000a097 auipc ra,0xa + 8001527c: 980080e7 jalr -1664(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80015280: a009 j 80015282 <.LBB19_14+0x2a> + Ok(res as usize) + 80015282: 6502 ld a0,0(sp) + 80015284: f02a sd a0,32(sp) + 80015286: 4501 li a0,0 + 80015288: ec2a sd a0,24(sp) + if res >= 0 { + 8001528a: a009 j 8001528c <.LBB19_14+0x34> + } + // let res = SEM_MANAGER.get(id); + // Ok(res); + } + 8001528c: 6562 ld a0,24(sp) + 8001528e: 7582 ld a1,32(sp) + 80015290: 60ea ld ra,152(sp) + 80015292: 610d addi sp,sp,160 + 80015294: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$11sys_sem_put17h3b21147033dd4825E: + +0000000080015296 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$11sys_sem_put17h3b21147033dd4825E>: + + pub fn sys_sem_put(&mut self) -> SysResult{ + 80015296: 7119 addi sp,sp,-128 + 80015298: fc86 sd ra,120(sp) + 8001529a: ec2a sd a0,24(sp) + 8001529c: f0aa sd a0,96(sp) + +000000008001529e <.LBB20_8>: + println!("sys_sem_put in ipc.rs"); + 8001529e: 00016597 auipc a1,0x16 + 800152a2: 8ea58593 addi a1,a1,-1814 # 8002ab88 <.L__unnamed_64> + +00000000800152a6 <.LBB20_9>: + 800152a6: 00016697 auipc a3,0x16 + 800152aa: 89a68693 addi a3,a3,-1894 # 8002ab40 <.L__unnamed_139> + 800152ae: 1808 addi a0,sp,48 + 800152b0: 4605 li a2,1 + 800152b2: 4701 li a4,0 + 800152b4: ffff0097 auipc ra,0xffff0 + 800152b8: 2d6080e7 jalr 726(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800152bc: a009 j 800152be <.LBB20_9+0x18> + 800152be: 1808 addi a0,sp,48 + 800152c0: 0000a097 auipc ra,0xa + 800152c4: 938080e7 jalr -1736(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800152c8: a009 j 800152ca <.LBB20_9+0x24> + let id = self.arg(0) as i32; + 800152ca: 6562 ld a0,24(sp) + 800152cc: 4581 li a1,0 + 800152ce: 00001097 auipc ra,0x1 + 800152d2: bac080e7 jalr -1108(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800152d6: e82a sd a0,16(sp) + 800152d8: a009 j 800152da <.LBB20_9+0x34> + 800152da: 65c2 ld a1,16(sp) + 800152dc: d6ae sw a1,108(sp) + +00000000800152de <.LBB20_10>: + let res = unsafe{SEM_MANAGER.put(id) as usize}; + 800152de: 00048517 auipc a0,0x48 + 800152e2: 0c250513 addi a0,a0,194 # 8005d3a0 <_ZN6kernel3ipc9semaphore11SEM_MANAGER17hc708ed55c8325c4cE> + 800152e6: 00008097 auipc ra,0x8 + 800152ea: 75e080e7 jalr 1886(ra) # 8001da44 <_ZN6kernel3ipc9semaphore8SemTable3put17hf81380ccacc98283E> + 800152ee: e42a sd a0,8(sp) + 800152f0: a009 j 800152f2 <.LBB20_10+0x14> + 800152f2: 6522 ld a0,8(sp) + 800152f4: 2501 sext.w a0,a0 + 800152f6: e02a sd a0,0(sp) + 800152f8: f8aa sd a0,112(sp) + 800152fa: 4581 li a1,0 + if res == 0 { + 800152fc: 00b51863 bne a0,a1,8001530c <.LBB20_10+0x2e> + 80015300: a009 j 80015302 <.LBB20_10+0x24> + Ok(res) + 80015302: 6502 ld a0,0(sp) + 80015304: f42a sd a0,40(sp) + 80015306: 4501 li a0,0 + 80015308: f02a sd a0,32(sp) + if res == 0 { + 8001530a: a021 j 80015312 <.LBB20_10+0x34> + 8001530c: 4505 li a0,1 + }else{ + Err(()) + 8001530e: f02a sd a0,32(sp) + if res == 0 { + 80015310: a009 j 80015312 <.LBB20_10+0x34> + } + } + 80015312: 7502 ld a0,32(sp) + 80015314: 75a2 ld a1,40(sp) + 80015316: 70e6 ld ra,120(sp) + 80015318: 6109 addi sp,sp,128 + 8001531a: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_sem_up17h66299e2e1eef50b0E: + +000000008001531c <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_sem_up17h66299e2e1eef50b0E>: + + pub fn sys_sem_up(&mut self) -> SysResult{ + 8001531c: 7119 addi sp,sp,-128 + 8001531e: fc86 sd ra,120(sp) + 80015320: e82a sd a0,16(sp) + 80015322: f0aa sd a0,96(sp) + +0000000080015324 <.LBB21_11>: + println!("sys_sem_up in ipc.rs"); + 80015324: 00016597 auipc a1,0x16 + 80015328: 88c58593 addi a1,a1,-1908 # 8002abb0 <.L__unnamed_65> + +000000008001532c <.LBB21_12>: + 8001532c: 00016697 auipc a3,0x16 + 80015330: 81468693 addi a3,a3,-2028 # 8002ab40 <.L__unnamed_139> + 80015334: 1028 addi a0,sp,40 + 80015336: 4605 li a2,1 + 80015338: 4701 li a4,0 + 8001533a: ffff0097 auipc ra,0xffff0 + 8001533e: 250080e7 jalr 592(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80015342: a009 j 80015344 <.LBB21_12+0x18> + 80015344: 1028 addi a0,sp,40 + 80015346: 0000a097 auipc ra,0xa + 8001534a: 8b2080e7 jalr -1870(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001534e: a009 j 80015350 <.LBB21_12+0x24> + let id = self.arg(0) as i32; + 80015350: 6542 ld a0,16(sp) + 80015352: 4581 li a1,0 + 80015354: 00001097 auipc ra,0x1 + 80015358: b26080e7 jalr -1242(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 8001535c: e42a sd a0,8(sp) + 8001535e: a009 j 80015360 <.LBB21_12+0x34> + 80015360: 65a2 ld a1,8(sp) + 80015362: d6ae sw a1,108(sp) + +0000000080015364 <.LBB21_13>: + let semOption = unsafe{SEM_MANAGER.getSemById(id)}; + 80015364: 00048517 auipc a0,0x48 + 80015368: 03c50513 addi a0,a0,60 # 8005d3a0 <_ZN6kernel3ipc9semaphore11SEM_MANAGER17hc708ed55c8325c4cE> + 8001536c: 00008097 auipc ra,0x8 + 80015370: 798080e7 jalr 1944(ra) # 8001db04 <_ZN6kernel3ipc9semaphore8SemTable10getSemById17hc45b63cab7252ea2E> + 80015374: ecaa sd a0,88(sp) + 80015376: a009 j 80015378 <.LBB21_13+0x14> + match semOption{ + Some(sem) => { + 80015378: 6566 ld a0,88(sp) + 8001537a: 00a035b3 snez a1,a0 + 8001537e: 4581 li a1,0 + 80015380: 00b50463 beq a0,a1,80015388 <.LBB21_13+0x24> + 80015384: a009 j 80015386 <.LBB21_13+0x22> + 80015386: a029 j 80015390 <.LBB21_13+0x2c> + 80015388: 4505 li a0,1 + sem.sem_up(); + Ok(0) + } + None => Err(()) + 8001538a: ec2a sd a0,24(sp) + match semOption{ + 8001538c: a829 j 800153a6 <.LBB21_13+0x42> + 8001538e: 0000 unimp + Some(sem) => { + 80015390: 6566 ld a0,88(sp) + 80015392: f8aa sd a0,112(sp) + sem.sem_up(); + 80015394: 00008097 auipc ra,0x8 + 80015398: 2b6080e7 jalr 694(ra) # 8001d64a <_ZN6kernel3ipc9semaphore5sem_t6sem_up17hff2b195f2e6585ecE> + 8001539c: a009 j 8001539e <.LBB21_13+0x3a> + 8001539e: 4501 li a0,0 + Ok(0) + 800153a0: f02a sd a0,32(sp) + 800153a2: ec2a sd a0,24(sp) + match semOption{ + 800153a4: a009 j 800153a6 <.LBB21_13+0x42> + } + } + 800153a6: 6562 ld a0,24(sp) + 800153a8: 7582 ld a1,32(sp) + 800153aa: 70e6 ld ra,120(sp) + 800153ac: 6109 addi sp,sp,128 + 800153ae: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_sem_down17hf3708c0cac81b44dE: + +00000000800153b0 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_sem_down17hf3708c0cac81b44dE>: + + pub fn sys_sem_down(&mut self) -> SysResult{ + 800153b0: 7119 addi sp,sp,-128 + 800153b2: fc86 sd ra,120(sp) + 800153b4: e82a sd a0,16(sp) + 800153b6: f0aa sd a0,96(sp) + +00000000800153b8 <.LBB22_11>: + println!("sys_sem_down in ipc.rs"); + 800153b8: 00016597 auipc a1,0x16 + 800153bc: 82058593 addi a1,a1,-2016 # 8002abd8 <.L__unnamed_66> + +00000000800153c0 <.LBB22_12>: + 800153c0: 00015697 auipc a3,0x15 + 800153c4: 78068693 addi a3,a3,1920 # 8002ab40 <.L__unnamed_139> + 800153c8: 1028 addi a0,sp,40 + 800153ca: 4605 li a2,1 + 800153cc: 4701 li a4,0 + 800153ce: ffff0097 auipc ra,0xffff0 + 800153d2: 1bc080e7 jalr 444(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800153d6: a009 j 800153d8 <.LBB22_12+0x18> + 800153d8: 1028 addi a0,sp,40 + 800153da: 0000a097 auipc ra,0xa + 800153de: 81e080e7 jalr -2018(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800153e2: a009 j 800153e4 <.LBB22_12+0x24> + let id = self.arg(0) as i32; + 800153e4: 6542 ld a0,16(sp) + 800153e6: 4581 li a1,0 + 800153e8: 00001097 auipc ra,0x1 + 800153ec: a92080e7 jalr -1390(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800153f0: e42a sd a0,8(sp) + 800153f2: a009 j 800153f4 <.LBB22_12+0x34> + 800153f4: 65a2 ld a1,8(sp) + 800153f6: d6ae sw a1,108(sp) + +00000000800153f8 <.LBB22_13>: + let semOption = unsafe{SEM_MANAGER.getSemById(id)}; + 800153f8: 00048517 auipc a0,0x48 + 800153fc: fa850513 addi a0,a0,-88 # 8005d3a0 <_ZN6kernel3ipc9semaphore11SEM_MANAGER17hc708ed55c8325c4cE> + 80015400: 00008097 auipc ra,0x8 + 80015404: 704080e7 jalr 1796(ra) # 8001db04 <_ZN6kernel3ipc9semaphore8SemTable10getSemById17hc45b63cab7252ea2E> + 80015408: ecaa sd a0,88(sp) + 8001540a: a009 j 8001540c <.LBB22_13+0x14> + match semOption{ + Some(sem) => { + 8001540c: 6566 ld a0,88(sp) + 8001540e: 00a035b3 snez a1,a0 + 80015412: 4581 li a1,0 + 80015414: 00b50463 beq a0,a1,8001541c <.LBB22_13+0x24> + 80015418: a009 j 8001541a <.LBB22_13+0x22> + 8001541a: a029 j 80015424 <.LBB22_13+0x2c> + 8001541c: 4505 li a0,1 + sem.sem_down(); + Ok(0) + } + None => Err(()) + 8001541e: ec2a sd a0,24(sp) + match semOption{ + 80015420: a829 j 8001543a <.LBB22_13+0x42> + 80015422: 0000 unimp + Some(sem) => { + 80015424: 6566 ld a0,88(sp) + 80015426: f8aa sd a0,112(sp) + sem.sem_down(); + 80015428: 00008097 auipc ra,0x8 + 8001542c: 09c080e7 jalr 156(ra) # 8001d4c4 <_ZN6kernel3ipc9semaphore5sem_t8sem_down17h0b823d8c0372af65E> + 80015430: a009 j 80015432 <.LBB22_13+0x3a> + 80015432: 4501 li a0,0 + Ok(0) + 80015434: f02a sd a0,32(sp) + 80015436: ec2a sd a0,24(sp) + match semOption{ + 80015438: a009 j 8001543a <.LBB22_13+0x42> + } + } + 8001543a: 6562 ld a0,24(sp) + 8001543c: 7582 ld a1,32(sp) + 8001543e: 70e6 ld ra,120(sp) + 80015440: 6109 addi sp,sp,128 + 80015442: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_sem_init17h9d42fffbf875ebeaE: + +0000000080015444 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_sem_init17h9d42fffbf875ebeaE>: + + pub fn sys_sem_init(&mut self) -> SysResult{ + 80015444: 7175 addi sp,sp,-144 + 80015446: e506 sd ra,136(sp) + 80015448: f02a sd a0,32(sp) + 8001544a: f8aa sd a0,112(sp) + +000000008001544c <.LBB23_12>: + println!("sys_sem_init in ipc.rs"); + 8001544c: 00015597 auipc a1,0x15 + 80015450: 7b458593 addi a1,a1,1972 # 8002ac00 <.L__unnamed_67> + +0000000080015454 <.LBB23_13>: + 80015454: 00015697 auipc a3,0x15 + 80015458: 6ec68693 addi a3,a3,1772 # 8002ab40 <.L__unnamed_139> + 8001545c: 1828 addi a0,sp,56 + 8001545e: 4605 li a2,1 + 80015460: 4701 li a4,0 + 80015462: ffff0097 auipc ra,0xffff0 + 80015466: 128080e7 jalr 296(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001546a: a009 j 8001546c <.LBB23_13+0x18> + 8001546c: 1828 addi a0,sp,56 + 8001546e: 00009097 auipc ra,0x9 + 80015472: 78a080e7 jalr 1930(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80015476: a009 j 80015478 <.LBB23_13+0x24> + let id = self.arg(0) as i32; + 80015478: 7502 ld a0,32(sp) + 8001547a: 4581 li a1,0 + 8001547c: 00001097 auipc ra,0x1 + 80015480: 9fe080e7 jalr -1538(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80015484: ec2a sd a0,24(sp) + 80015486: a009 j 80015488 <.LBB23_13+0x34> + 80015488: 7502 ld a0,32(sp) + 8001548a: 65e2 ld a1,24(sp) + 8001548c: 862e mv a2,a1 + 8001548e: e432 sd a2,8(sp) + 80015490: dcae sw a1,120(sp) + 80015492: 4585 li a1,1 + let cnt = self.arg(1) as i32; + 80015494: 00001097 auipc ra,0x1 + 80015498: 9e6080e7 jalr -1562(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 8001549c: e82a sd a0,16(sp) + 8001549e: a009 j 800154a0 <.LBB23_13+0x4c> + 800154a0: 65a2 ld a1,8(sp) + 800154a2: 6542 ld a0,16(sp) + 800154a4: 862a mv a2,a0 + 800154a6: e032 sd a2,0(sp) + 800154a8: deaa sw a0,124(sp) + +00000000800154aa <.LBB23_14>: + let semOption = unsafe{SEM_MANAGER.getSemById(id)}; + 800154aa: 00048517 auipc a0,0x48 + 800154ae: ef650513 addi a0,a0,-266 # 8005d3a0 <_ZN6kernel3ipc9semaphore11SEM_MANAGER17hc708ed55c8325c4cE> + 800154b2: 00008097 auipc ra,0x8 + 800154b6: 652080e7 jalr 1618(ra) # 8001db04 <_ZN6kernel3ipc9semaphore8SemTable10getSemById17hc45b63cab7252ea2E> + 800154ba: f4aa sd a0,104(sp) + 800154bc: a009 j 800154be <.LBB23_14+0x14> + match semOption{ + Some(sem) => { + 800154be: 7526 ld a0,104(sp) + 800154c0: 00a035b3 snez a1,a0 + 800154c4: 4581 li a1,0 + 800154c6: 00b50463 beq a0,a1,800154ce <.LBB23_14+0x24> + 800154ca: a009 j 800154cc <.LBB23_14+0x22> + 800154cc: a029 j 800154d6 <.LBB23_14+0x2c> + 800154ce: 4505 li a0,1 + sem.sem_init(cnt); + // println!("sys_sem_get in ipc.rs"); + Ok(0) + } + None => Err(()) + 800154d0: f42a sd a0,40(sp) + match semOption{ + 800154d2: a831 j 800154ee <.LBB23_14+0x44> + 800154d4: 0000 unimp + Some(sem) => { + 800154d6: 6582 ld a1,0(sp) + 800154d8: 7526 ld a0,104(sp) + 800154da: e12a sd a0,128(sp) + sem.sem_init(cnt); + 800154dc: 00008097 auipc ra,0x8 + 800154e0: f82080e7 jalr -126(ra) # 8001d45e <_ZN6kernel3ipc9semaphore5sem_t8sem_init17h922a2e9695ae8884E> + 800154e4: a009 j 800154e6 <.LBB23_14+0x3c> + 800154e6: 4501 li a0,0 + Ok(0) + 800154e8: f82a sd a0,48(sp) + 800154ea: f42a sd a0,40(sp) + match semOption{ + 800154ec: a009 j 800154ee <.LBB23_14+0x44> + } + } + 800154ee: 7522 ld a0,40(sp) + 800154f0: 75c2 ld a1,48(sp) + 800154f2: 60aa ld ra,136(sp) + 800154f4: 6149 addi sp,sp,144 + 800154f6: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_mkfifo17ha5fafffc64e6bceeE: + +00000000800154f8 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_mkfifo17ha5fafffc64e6bceeE>: + + + + pub fn sys_mkfifo(&self) -> SysResult { + 800154f8: 7125 addi sp,sp,-416 + 800154fa: ef06 sd ra,408(sp) + 800154fc: f8aa sd a0,112(sp) + 800154fe: f2aa sd a0,352(sp) + 80015500: 4581 li a1,0 + let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + 80015502: e92e sd a1,144(sp) + 80015504: ed2e sd a1,152(sp) + 80015506: f12e sd a1,160(sp) + let addr = self.arg(0); + 80015508: 00001097 auipc ra,0x1 + 8001550c: 972080e7 jalr -1678(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80015510: 85aa mv a1,a0 + 80015512: fcae sd a1,120(sp) + 80015514: f6aa sd a0,360(sp) + 80015516: a009 j 80015518 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_mkfifo17ha5fafffc64e6bceeE+0x20> + self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + 80015518: 75e6 ld a1,120(sp) + 8001551a: 7546 ld a0,112(sp) + 8001551c: 0910 addi a2,sp,144 + 8001551e: 4761 li a4,24 + 80015520: 86ba mv a3,a4 + 80015522: 00001097 auipc ra,0x1 + 80015526: a08080e7 jalr -1528(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 8001552a: f4aa sd a0,104(sp) + 8001552c: a009 j 8001552e <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_mkfifo17ha5fafffc64e6bceeE+0x36> + 8001552e: 7526 ld a0,104(sp) + +0000000080015530 <.LBB24_16>: + 80015530: 00015597 auipc a1,0x15 + 80015534: 6f858593 addi a1,a1,1784 # 8002ac28 <.L__unnamed_68> + 80015538: ffff8097 auipc ra,0xffff8 + 8001553c: 316080e7 jalr 790(ra) # 8000d84e <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17hea14d8d7b2208f82E> + 80015540: a009 j 80015542 <.LBB24_16+0x12> + // let mode = self.arg(1); + + + // Fifo_t::alloc(&mut rf, &mut wf, name); + + let fifo_opt = unsafe{FIFO_MANAGER.alloc(name)}; + 80015542: 750a ld a0,160(sp) + 80015544: e5aa sd a0,200(sp) + 80015546: 656a ld a0,152(sp) + 80015548: e1aa sd a0,192(sp) + 8001554a: 654a ld a0,144(sp) + 8001554c: fd2a sd a0,184(sp) + +000000008001554e <.LBB24_17>: + 8001554e: 00023517 auipc a0,0x23 + 80015552: ff250513 addi a0,a0,-14 # 80038540 <_ZN6kernel3ipc4fifo12FIFO_MANAGER17h7487f36cc9de2bcfE> + 80015556: 192c addi a1,sp,184 + 80015558: ffff3097 auipc ra,0xffff3 + 8001555c: 1f2080e7 jalr 498(ra) # 8000874a <_ZN6kernel3ipc4fifo9FifoTable5alloc17hd20ea1d658b85b5dE> + 80015560: f52a sd a0,168(sp) + 80015562: f92e sd a1,176(sp) + 80015564: a009 j 80015566 <.LBB24_17+0x18> + match fifo_opt { + Some(i) => { + 80015566: 752a ld a0,168(sp) + 80015568: 4581 li a1,0 + 8001556a: 00b50463 beq a0,a1,80015572 <.LBB24_17+0x24> + 8001556e: a009 j 80015570 <.LBB24_17+0x22> + 80015570: a029 j 8001557a <.LBB24_17+0x2c> + 80015572: 4505 li a0,1 + // let ret = unsafe { (*i).ID }; + Ok(i) + } + + None => { + Err(()) + 80015574: e12a sd a0,128(sp) + match fifo_opt { + 80015576: a8f1 j 80015652 <.LBB24_22+0x30> + 80015578: 0000 unimp + Some(i) => { + 8001557a: 754a ld a0,176(sp) + 8001557c: fc2a sd a0,56(sp) + 8001557e: faaa sd a0,368(sp) + println!("In sys_mkfifo, {} {} {} {}", name[0], name[1], name[2], name[3]); + 80015580: 09110693 addi a3,sp,145 + 80015584: e0b6 sd a3,64(sp) + 80015586: 09210613 addi a2,sp,146 + 8001558a: e4b2 sd a2,72(sp) + 8001558c: 09310593 addi a1,sp,147 + 80015590: e8ae sd a1,80(sp) + 80015592: 0908 addi a0,sp,144 + 80015594: e2aa sd a0,320(sp) + 80015596: e6b6 sd a3,328(sp) + 80015598: eab2 sd a2,336(sp) + 8001559a: eeae sd a1,344(sp) + 8001559c: feaa sd a0,376(sp) + 8001559e: e336 sd a3,384(sp) + 800155a0: e732 sd a2,392(sp) + 800155a2: eb2e sd a1,400(sp) + +00000000800155a4 <.LBB24_18>: + 800155a4: 00010597 auipc a1,0x10 + 800155a8: e9458593 addi a1,a1,-364 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 800155ac: 0000a097 auipc ra,0xa + 800155b0: f1c080e7 jalr -228(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 800155b4: ecaa sd a0,88(sp) + 800155b6: f0ae sd a1,96(sp) + 800155b8: a009 j 800155ba <.LBB24_18+0x16> + 800155ba: 6506 ld a0,64(sp) + +00000000800155bc <.LBB24_19>: + 800155bc: 00010597 auipc a1,0x10 + 800155c0: e7c58593 addi a1,a1,-388 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 800155c4: 0000a097 auipc ra,0xa + 800155c8: f04080e7 jalr -252(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 800155cc: f42a sd a0,40(sp) + 800155ce: f82e sd a1,48(sp) + 800155d0: a009 j 800155d2 <.LBB24_19+0x16> + 800155d2: 6526 ld a0,72(sp) + +00000000800155d4 <.LBB24_20>: + 800155d4: 00010597 auipc a1,0x10 + 800155d8: e6458593 addi a1,a1,-412 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 800155dc: 0000a097 auipc ra,0xa + 800155e0: eec080e7 jalr -276(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 800155e4: ec2a sd a0,24(sp) + 800155e6: f02e sd a1,32(sp) + 800155e8: a009 j 800155ea <.LBB24_20+0x16> + 800155ea: 6546 ld a0,80(sp) + +00000000800155ec <.LBB24_21>: + 800155ec: 00010597 auipc a1,0x10 + 800155f0: e4c58593 addi a1,a1,-436 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 800155f4: 0000a097 auipc ra,0xa + 800155f8: ed4080e7 jalr -300(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 800155fc: e42a sd a0,8(sp) + 800155fe: e82e sd a1,16(sp) + 80015600: a009 j 80015602 <.LBB24_21+0x16> + 80015602: 6542 ld a0,16(sp) + 80015604: 65a2 ld a1,8(sp) + 80015606: 7602 ld a2,32(sp) + 80015608: 66e2 ld a3,24(sp) + 8001560a: 7742 ld a4,48(sp) + 8001560c: 77a2 ld a5,40(sp) + 8001560e: 7806 ld a6,96(sp) + 80015610: 68e6 ld a7,88(sp) + 80015612: e246 sd a7,256(sp) + 80015614: e642 sd a6,264(sp) + 80015616: ea3e sd a5,272(sp) + 80015618: ee3a sd a4,280(sp) + 8001561a: f236 sd a3,288(sp) + 8001561c: f632 sd a2,296(sp) + 8001561e: fa2e sd a1,304(sp) + 80015620: fe2a sd a0,312(sp) + +0000000080015622 <.LBB24_22>: + 80015622: 00015597 auipc a1,0x15 + 80015626: 62e58593 addi a1,a1,1582 # 8002ac50 <.L__unnamed_69> + 8001562a: 0988 addi a0,sp,208 + 8001562c: 4615 li a2,5 + 8001562e: 0214 addi a3,sp,256 + 80015630: 4711 li a4,4 + 80015632: ffff0097 auipc ra,0xffff0 + 80015636: f58080e7 jalr -168(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001563a: a009 j 8001563c <.LBB24_22+0x1a> + 8001563c: 0988 addi a0,sp,208 + 8001563e: 00009097 auipc ra,0x9 + 80015642: 5ba080e7 jalr 1466(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80015646: a009 j 80015648 <.LBB24_22+0x26> + Ok(i) + 80015648: 7562 ld a0,56(sp) + 8001564a: e52a sd a0,136(sp) + 8001564c: 4501 li a0,0 + 8001564e: e12a sd a0,128(sp) + match fifo_opt { + 80015650: a009 j 80015652 <.LBB24_22+0x30> + } + } + + } + 80015652: 650a ld a0,128(sp) + 80015654: 65aa ld a1,136(sp) + 80015656: 60fa ld ra,408(sp) + 80015658: 611d addi sp,sp,416 + 8001565a: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_get17ha24beea98224282cE: + +000000008001565c <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_get17ha24beea98224282cE>: + + // to_do fd + pub fn sys_fifo_get(&self) -> SysResult{ + 8001565c: 7125 addi sp,sp,-416 + 8001565e: ef06 sd ra,408(sp) + 80015660: f4aa sd a0,104(sp) + 80015662: eeaa sd a0,344(sp) + 80015664: 4581 li a1,0 + let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + 80015666: e52e sd a1,136(sp) + 80015668: e92e sd a1,144(sp) + 8001566a: ed2e sd a1,152(sp) + let addr = self.arg(0); + 8001566c: 00001097 auipc ra,0x1 + 80015670: 80e080e7 jalr -2034(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80015674: 85aa mv a1,a0 + 80015676: f8ae sd a1,112(sp) + 80015678: f2aa sd a0,352(sp) + 8001567a: a009 j 8001567c <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_get17ha24beea98224282cE+0x20> + self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + 8001567c: 75c6 ld a1,112(sp) + 8001567e: 7526 ld a0,104(sp) + 80015680: 0130 addi a2,sp,136 + 80015682: 4761 li a4,24 + 80015684: 86ba mv a3,a4 + 80015686: 00001097 auipc ra,0x1 + 8001568a: 8a4080e7 jalr -1884(ra) # 80015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE> + 8001568e: f0aa sd a0,96(sp) + 80015690: a009 j 80015692 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_get17ha24beea98224282cE+0x36> + 80015692: 7506 ld a0,96(sp) + +0000000080015694 <.LBB25_17>: + 80015694: 00015597 auipc a1,0x15 + 80015698: 60c58593 addi a1,a1,1548 # 8002aca0 <.L__unnamed_70> + 8001569c: ffff8097 auipc ra,0xffff8 + 800156a0: 1b2080e7 jalr 434(ra) # 8000d84e <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17hea14d8d7b2208f82E> + 800156a4: a009 j 800156a6 <.LBB25_17+0x12> + + let id = self.arg(0); + 800156a6: 7526 ld a0,104(sp) + 800156a8: 4581 li a1,0 + 800156aa: 00000097 auipc ra,0x0 + 800156ae: 7d0080e7 jalr 2000(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800156b2: f6aa sd a0,360(sp) + 800156b4: a009 j 800156b6 <.LBB25_17+0x22> + + let fifo_opt = unsafe{FIFO_MANAGER.get(name)}; + 800156b6: 656a ld a0,152(sp) + 800156b8: e1aa sd a0,192(sp) + 800156ba: 654a ld a0,144(sp) + 800156bc: fd2a sd a0,184(sp) + 800156be: 652a ld a0,136(sp) + 800156c0: f92a sd a0,176(sp) + +00000000800156c2 <.LBB25_18>: + 800156c2: 00023517 auipc a0,0x23 + 800156c6: e7e50513 addi a0,a0,-386 # 80038540 <_ZN6kernel3ipc4fifo12FIFO_MANAGER17h7487f36cc9de2bcfE> + 800156ca: 190c addi a1,sp,176 + 800156cc: ffff3097 auipc ra,0xffff3 + 800156d0: 274080e7 jalr 628(ra) # 80008940 <_ZN6kernel3ipc4fifo9FifoTable3get17h090d4f507de33913E> + 800156d4: f12a sd a0,160(sp) + 800156d6: f52e sd a1,168(sp) + 800156d8: a009 j 800156da <.LBB25_18+0x18> + match fifo_opt { + Some(i) => { + 800156da: 750a ld a0,160(sp) + 800156dc: 4581 li a1,0 + 800156de: 00b50463 beq a0,a1,800156e6 <.LBB25_18+0x24> + 800156e2: a009 j 800156e4 <.LBB25_18+0x22> + 800156e4: a029 j 800156ee <.LBB25_18+0x2c> + 800156e6: 4505 li a0,1 + println!("In sys_fifo_get, {} {} {} {}", name[0], name[1], name[2], name[3]); + Ok(i) + } + + None => { + Err(()) + 800156e8: fcaa sd a0,120(sp) + match fifo_opt { + 800156ea: a8f1 j 800157c6 <.LBB25_23+0x30> + 800156ec: 0000 unimp + Some(i) => { + 800156ee: 752a ld a0,168(sp) + 800156f0: f82a sd a0,48(sp) + 800156f2: faaa sd a0,368(sp) + println!("In sys_fifo_get, {} {} {} {}", name[0], name[1], name[2], name[3]); + 800156f4: 08910693 addi a3,sp,137 + 800156f8: fc36 sd a3,56(sp) + 800156fa: 08a10613 addi a2,sp,138 + 800156fe: e0b2 sd a2,64(sp) + 80015700: 08b10593 addi a1,sp,139 + 80015704: e4ae sd a1,72(sp) + 80015706: 0128 addi a0,sp,136 + 80015708: fe2a sd a0,312(sp) + 8001570a: e2b6 sd a3,320(sp) + 8001570c: e6b2 sd a2,328(sp) + 8001570e: eaae sd a1,336(sp) + 80015710: feaa sd a0,376(sp) + 80015712: e336 sd a3,384(sp) + 80015714: e732 sd a2,392(sp) + 80015716: eb2e sd a1,400(sp) + +0000000080015718 <.LBB25_19>: + 80015718: 00010597 auipc a1,0x10 + 8001571c: d2058593 addi a1,a1,-736 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 80015720: 0000a097 auipc ra,0xa + 80015724: da8080e7 jalr -600(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 80015728: e8aa sd a0,80(sp) + 8001572a: ecae sd a1,88(sp) + 8001572c: a009 j 8001572e <.LBB25_19+0x16> + 8001572e: 7562 ld a0,56(sp) + +0000000080015730 <.LBB25_20>: + 80015730: 00010597 auipc a1,0x10 + 80015734: d0858593 addi a1,a1,-760 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 80015738: 0000a097 auipc ra,0xa + 8001573c: d90080e7 jalr -624(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 80015740: f02a sd a0,32(sp) + 80015742: f42e sd a1,40(sp) + 80015744: a009 j 80015746 <.LBB25_20+0x16> + 80015746: 6506 ld a0,64(sp) + +0000000080015748 <.LBB25_21>: + 80015748: 00010597 auipc a1,0x10 + 8001574c: cf058593 addi a1,a1,-784 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 80015750: 0000a097 auipc ra,0xa + 80015754: d78080e7 jalr -648(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 80015758: e82a sd a0,16(sp) + 8001575a: ec2e sd a1,24(sp) + 8001575c: a009 j 8001575e <.LBB25_21+0x16> + 8001575e: 6526 ld a0,72(sp) + +0000000080015760 <.LBB25_22>: + 80015760: 00010597 auipc a1,0x10 + 80015764: cd858593 addi a1,a1,-808 # 80025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E> + 80015768: 0000a097 auipc ra,0xa + 8001576c: d60080e7 jalr -672(ra) # 8001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E> + 80015770: e02a sd a0,0(sp) + 80015772: e42e sd a1,8(sp) + 80015774: a009 j 80015776 <.LBB25_22+0x16> + 80015776: 6522 ld a0,8(sp) + 80015778: 6582 ld a1,0(sp) + 8001577a: 6662 ld a2,24(sp) + 8001577c: 66c2 ld a3,16(sp) + 8001577e: 7722 ld a4,40(sp) + 80015780: 7782 ld a5,32(sp) + 80015782: 6866 ld a6,88(sp) + 80015784: 68c6 ld a7,80(sp) + 80015786: fdc6 sd a7,248(sp) + 80015788: e242 sd a6,256(sp) + 8001578a: e63e sd a5,264(sp) + 8001578c: ea3a sd a4,272(sp) + 8001578e: ee36 sd a3,280(sp) + 80015790: f232 sd a2,288(sp) + 80015792: f62e sd a1,296(sp) + 80015794: fa2a sd a0,304(sp) + +0000000080015796 <.LBB25_23>: + 80015796: 00015597 auipc a1,0x15 + 8001579a: 53a58593 addi a1,a1,1338 # 8002acd0 <.L__unnamed_71> + 8001579e: 01a8 addi a0,sp,200 + 800157a0: 4615 li a2,5 + 800157a2: 19b4 addi a3,sp,248 + 800157a4: 4711 li a4,4 + 800157a6: ffff0097 auipc ra,0xffff0 + 800157aa: de4080e7 jalr -540(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800157ae: a009 j 800157b0 <.LBB25_23+0x1a> + 800157b0: 01a8 addi a0,sp,200 + 800157b2: 00009097 auipc ra,0x9 + 800157b6: 446080e7 jalr 1094(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800157ba: a009 j 800157bc <.LBB25_23+0x26> + Ok(i) + 800157bc: 7542 ld a0,48(sp) + 800157be: e12a sd a0,128(sp) + 800157c0: 4501 li a0,0 + 800157c2: fcaa sd a0,120(sp) + match fifo_opt { + 800157c4: a009 j 800157c6 <.LBB25_23+0x30> + } + } + } + 800157c6: 7566 ld a0,120(sp) + 800157c8: 658a ld a1,128(sp) + 800157ca: 60fa ld ra,408(sp) + 800157cc: 611d addi sp,sp,416 + 800157ce: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_put17h853b40814394db5eE: + +00000000800157d0 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_put17h853b40814394db5eE>: + + pub fn sys_fifo_put(&self) -> SysResult{ + 800157d0: 7135 addi sp,sp,-160 + 800157d2: ed06 sd ra,152(sp) + 800157d4: e12a sd a0,128(sp) + 800157d6: 4581 li a1,0 + // let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + // let addr = self.arg(0); + // self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + let id = self.arg(0); + 800157d8: 00000097 auipc ra,0x0 + 800157dc: 6a2080e7 jalr 1698(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800157e0: f02a sd a0,32(sp) + 800157e2: a009 j 800157e4 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_put17h853b40814394db5eE+0x14> + + let fifo_opt = unsafe{FIFO_MANAGER.put(id)}; + 800157e4: 7582 ld a1,32(sp) + +00000000800157e6 <.LBB26_11>: + 800157e6: 00023517 auipc a0,0x23 + 800157ea: d5a50513 addi a0,a0,-678 # 80038540 <_ZN6kernel3ipc4fifo12FIFO_MANAGER17h7487f36cc9de2bcfE> + 800157ee: ffff3097 auipc ra,0xffff3 + 800157f2: 326080e7 jalr 806(ra) # 80008b14 <_ZN6kernel3ipc4fifo9FifoTable3put17ha024d65e963e8526E> + 800157f6: f42a sd a0,40(sp) + 800157f8: f82e sd a1,48(sp) + 800157fa: a009 j 800157fc <.LBB26_11+0x16> + match fifo_opt { + Some(i) => { + 800157fc: 7522 ld a0,40(sp) + 800157fe: 4581 li a1,0 + 80015800: 00b50463 beq a0,a1,80015808 <.LBB26_11+0x22> + 80015804: a009 j 80015806 <.LBB26_11+0x20> + 80015806: a029 j 80015810 <.LBB26_11+0x2a> + 80015808: 4505 li a0,1 + println!("In sys_fifo_put, id {}", id); + Ok(0) + } + + None => { + Err(()) + 8001580a: e82a sd a0,16(sp) + match fifo_opt { + 8001580c: a8a9 j 80015866 <.LBB26_13+0x2e> + 8001580e: 0000 unimp + Some(i) => { + 80015810: 7542 ld a0,48(sp) + 80015812: e52a sd a0,136(sp) + 80015814: 1008 addi a0,sp,32 + println!("In sys_fifo_put, id {}", id); + 80015816: fcaa sd a0,120(sp) + 80015818: e92a sd a0,144(sp) + +000000008001581a <.LBB26_12>: + 8001581a: 00010597 auipc a1,0x10 + 8001581e: 08658593 addi a1,a1,134 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80015822: 0000b097 auipc ra,0xb + 80015826: d4c080e7 jalr -692(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001582a: e02a sd a0,0(sp) + 8001582c: e42e sd a1,8(sp) + 8001582e: a009 j 80015830 <.LBB26_12+0x16> + 80015830: 6522 ld a0,8(sp) + 80015832: 6582 ld a1,0(sp) + 80015834: f4ae sd a1,104(sp) + 80015836: f8aa sd a0,112(sp) + +0000000080015838 <.LBB26_13>: + 80015838: 00015597 auipc a1,0x15 + 8001583c: 50058593 addi a1,a1,1280 # 8002ad38 <.L__unnamed_72> + 80015840: 1828 addi a0,sp,56 + 80015842: 4609 li a2,2 + 80015844: 10b4 addi a3,sp,104 + 80015846: 4705 li a4,1 + 80015848: ffff0097 auipc ra,0xffff0 + 8001584c: d42080e7 jalr -702(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80015850: a009 j 80015852 <.LBB26_13+0x1a> + 80015852: 1828 addi a0,sp,56 + 80015854: 00009097 auipc ra,0x9 + 80015858: 3a4080e7 jalr 932(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001585c: a009 j 8001585e <.LBB26_13+0x26> + 8001585e: 4501 li a0,0 + Ok(0) + 80015860: ec2a sd a0,24(sp) + 80015862: e82a sd a0,16(sp) + match fifo_opt { + 80015864: a009 j 80015866 <.LBB26_13+0x2e> + } + } + } + 80015866: 6542 ld a0,16(sp) + 80015868: 65e2 ld a1,24(sp) + 8001586a: 60ea ld ra,152(sp) + 8001586c: 610d addi sp,sp,160 + 8001586e: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$13sys_fifo_read17h33e0b610eee1e940E: + +0000000080015870 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$13sys_fifo_read17h33e0b610eee1e940E>: + + pub fn sys_fifo_read(&self) -> SysResult{ + 80015870: 712d addi sp,sp,-288 + 80015872: ee06 sd ra,280(sp) + 80015874: f82a sd a0,48(sp) + 80015876: f5aa sd a0,232(sp) + 80015878: 4581 li a1,0 + // let addr = self.arg(0); + // self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + // let fifo_opt = unsafe{FIFO_MANAGER.get(name)}; + + let id = self.arg(0); + 8001587a: 00000097 auipc ra,0x0 + 8001587e: 600080e7 jalr 1536(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80015882: 85aa mv a1,a0 + 80015884: fc2e sd a1,56(sp) + 80015886: f9aa sd a0,240(sp) + 80015888: a009 j 8001588a <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$13sys_fifo_read17h33e0b610eee1e940E+0x1a> + let fifo_opt = unsafe { FIFO_MANAGER.getByID(id) }; + 8001588a: 75e2 ld a1,56(sp) + +000000008001588c <.LBB27_15>: + 8001588c: 00023517 auipc a0,0x23 + 80015890: cb450513 addi a0,a0,-844 # 80038540 <_ZN6kernel3ipc4fifo12FIFO_MANAGER17h7487f36cc9de2bcfE> + 80015894: ffff3097 auipc ra,0xffff3 + 80015898: 1c4080e7 jalr 452(ra) # 80008a58 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E> + 8001589c: e8aa sd a0,80(sp) + 8001589e: ecae sd a1,88(sp) + 800158a0: a009 j 800158a2 <.LBB27_15+0x16> + + let ptr = self.arg(1); + 800158a2: 7542 ld a0,48(sp) + 800158a4: 4585 li a1,1 + 800158a6: 00000097 auipc ra,0x0 + 800158aa: 5d4080e7 jalr 1492(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800158ae: f0aa sd a0,96(sp) + 800158b0: a009 j 800158b2 <.LBB27_15+0x26> + let len = self.arg(2); + 800158b2: 7542 ld a0,48(sp) + 800158b4: 4589 li a1,2 + 800158b6: 00000097 auipc ra,0x0 + 800158ba: 5c4080e7 jalr 1476(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800158be: f4aa sd a0,104(sp) + 800158c0: a009 j 800158c2 <.LBB27_15+0x36> + 800158c2: 1088 addi a0,sp,96 + + println!("the ptr is {}, the len is {}", ptr, len); + 800158c4: e1aa sd a0,192(sp) + 800158c6: 10ac addi a1,sp,104 + 800158c8: ec2e sd a1,24(sp) + 800158ca: e5ae sd a1,200(sp) + 800158cc: fdaa sd a0,248(sp) + 800158ce: e22e sd a1,256(sp) + +00000000800158d0 <.LBB27_16>: + 800158d0: 00010597 auipc a1,0x10 + 800158d4: fd058593 addi a1,a1,-48 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800158d8: 0000b097 auipc ra,0xb + 800158dc: c96080e7 jalr -874(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800158e0: f02a sd a0,32(sp) + 800158e2: f42e sd a1,40(sp) + 800158e4: a009 j 800158e6 <.LBB27_16+0x16> + 800158e6: 6562 ld a0,24(sp) + +00000000800158e8 <.LBB27_17>: + 800158e8: 00010597 auipc a1,0x10 + 800158ec: fb858593 addi a1,a1,-72 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800158f0: 0000b097 auipc ra,0xb + 800158f4: c7e080e7 jalr -898(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800158f8: e42a sd a0,8(sp) + 800158fa: e82e sd a1,16(sp) + 800158fc: a009 j 800158fe <.LBB27_17+0x16> + 800158fe: 6542 ld a0,16(sp) + 80015900: 65a2 ld a1,8(sp) + 80015902: 7622 ld a2,40(sp) + 80015904: 7682 ld a3,32(sp) + 80015906: f136 sd a3,160(sp) + 80015908: f532 sd a2,168(sp) + 8001590a: f92e sd a1,176(sp) + 8001590c: fd2a sd a0,184(sp) + +000000008001590e <.LBB27_18>: + 8001590e: 00015597 auipc a1,0x15 + 80015912: 46258593 addi a1,a1,1122 # 8002ad70 <.L__unnamed_73> + 80015916: 1888 addi a0,sp,112 + 80015918: 460d li a2,3 + 8001591a: 1114 addi a3,sp,160 + 8001591c: 4709 li a4,2 + 8001591e: ffff0097 auipc ra,0xffff0 + 80015922: c6c080e7 jalr -916(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80015926: a009 j 80015928 <.LBB27_18+0x1a> + 80015928: 1888 addi a0,sp,112 + 8001592a: 00009097 auipc ra,0x9 + 8001592e: 2ce080e7 jalr 718(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80015932: a009 j 80015934 <.LBB27_18+0x26> + match fifo_opt { + Some(fifo_ptr) => { + 80015934: 6546 ld a0,80(sp) + 80015936: 4581 li a1,0 + 80015938: 00b50463 beq a0,a1,80015940 <.LBB27_18+0x32> + 8001593c: a009 j 8001593e <.LBB27_18+0x30> + 8001593e: a029 j 80015948 <.LBB27_18+0x3a> + 80015940: 4505 li a0,1 + // println!("In sys_fifo_read, the name is {} {} {} {}", name[0], name[1], name[2], name[3]); + Ok(0) + } + + None => { + Err(()) + 80015942: e0aa sd a0,64(sp) + match fifo_opt { + 80015944: a00d j 80015966 <.LBB27_18+0x58> + 80015946: 0000 unimp + Some(fifo_ptr) => { + 80015948: 65e6 ld a1,88(sp) + 8001594a: e62e sd a1,264(sp) + let fifo = unsafe { &mut *fifo_ptr }; + 8001594c: ea2e sd a1,272(sp) + fifo.read(ptr, len); //to_do + 8001594e: 7606 ld a2,96(sp) + 80015950: 76a6 ld a3,104(sp) + 80015952: 0988 addi a0,sp,208 + 80015954: ffff3097 auipc ra,0xffff3 + 80015958: c96080e7 jalr -874(ra) # 800085ea <_ZN6kernel3ipc4fifo6Fifo_t4read17hbc09cc8bbfbda575E> + 8001595c: a009 j 8001595e <.LBB27_18+0x50> + 8001595e: 4501 li a0,0 + Ok(0) + 80015960: e4aa sd a0,72(sp) + 80015962: e0aa sd a0,64(sp) + match fifo_opt { + 80015964: a009 j 80015966 <.LBB27_18+0x58> + } + } + } + 80015966: 6506 ld a0,64(sp) + 80015968: 65a6 ld a1,72(sp) + 8001596a: 60f2 ld ra,280(sp) + 8001596c: 6115 addi sp,sp,288 + 8001596e: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$14sys_fifo_write17h98f0fee8bea374f3E: + +0000000080015970 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$14sys_fifo_write17h98f0fee8bea374f3E>: + + pub fn sys_fifo_write(&self) -> SysResult { + 80015970: 712d addi sp,sp,-288 + 80015972: ee06 sd ra,280(sp) + 80015974: f82a sd a0,48(sp) + 80015976: f5aa sd a0,232(sp) + 80015978: 4581 li a1,0 + // let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + // let addr = self.arg(0); + // self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + let id = self.arg(0); + 8001597a: 00000097 auipc ra,0x0 + 8001597e: 500080e7 jalr 1280(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 80015982: 85aa mv a1,a0 + 80015984: fc2e sd a1,56(sp) + 80015986: f9aa sd a0,240(sp) + 80015988: a009 j 8001598a <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$14sys_fifo_write17h98f0fee8bea374f3E+0x1a> + let fifo_opt = unsafe { FIFO_MANAGER.getByID(id) }; + 8001598a: 75e2 ld a1,56(sp) + +000000008001598c <.LBB28_15>: + 8001598c: 00023517 auipc a0,0x23 + 80015990: bb450513 addi a0,a0,-1100 # 80038540 <_ZN6kernel3ipc4fifo12FIFO_MANAGER17h7487f36cc9de2bcfE> + 80015994: ffff3097 auipc ra,0xffff3 + 80015998: 0c4080e7 jalr 196(ra) # 80008a58 <_ZN6kernel3ipc4fifo9FifoTable7getByID17h2a716ec56cc97291E> + 8001599c: e8aa sd a0,80(sp) + 8001599e: ecae sd a1,88(sp) + 800159a0: a009 j 800159a2 <.LBB28_15+0x16> + + + + let ptr = self.arg(1); + 800159a2: 7542 ld a0,48(sp) + 800159a4: 4585 li a1,1 + 800159a6: 00000097 auipc ra,0x0 + 800159aa: 4d4080e7 jalr 1236(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800159ae: f0aa sd a0,96(sp) + 800159b0: a009 j 800159b2 <.LBB28_15+0x26> + let len = self.arg(2); + 800159b2: 7542 ld a0,48(sp) + 800159b4: 4589 li a1,2 + 800159b6: 00000097 auipc ra,0x0 + 800159ba: 4c4080e7 jalr 1220(ra) # 80015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E> + 800159be: f4aa sd a0,104(sp) + 800159c0: a009 j 800159c2 <.LBB28_15+0x36> + 800159c2: 1088 addi a0,sp,96 + + // let mut char: [u8; 1] = [0; 1]; + // self.copy_from_str(ptr, &mut char, 1); + // println!("The first is {}", char[0]); + + println!("the ptr is {}, the len is {}", ptr, len); + 800159c4: e1aa sd a0,192(sp) + 800159c6: 10ac addi a1,sp,104 + 800159c8: ec2e sd a1,24(sp) + 800159ca: e5ae sd a1,200(sp) + 800159cc: fdaa sd a0,248(sp) + 800159ce: e22e sd a1,256(sp) + +00000000800159d0 <.LBB28_16>: + 800159d0: 00010597 auipc a1,0x10 + 800159d4: ed058593 addi a1,a1,-304 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800159d8: 0000b097 auipc ra,0xb + 800159dc: b96080e7 jalr -1130(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800159e0: f02a sd a0,32(sp) + 800159e2: f42e sd a1,40(sp) + 800159e4: a009 j 800159e6 <.LBB28_16+0x16> + 800159e6: 6562 ld a0,24(sp) + +00000000800159e8 <.LBB28_17>: + 800159e8: 00010597 auipc a1,0x10 + 800159ec: eb858593 addi a1,a1,-328 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800159f0: 0000b097 auipc ra,0xb + 800159f4: b7e080e7 jalr -1154(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800159f8: e42a sd a0,8(sp) + 800159fa: e82e sd a1,16(sp) + 800159fc: a009 j 800159fe <.LBB28_17+0x16> + 800159fe: 6542 ld a0,16(sp) + 80015a00: 65a2 ld a1,8(sp) + 80015a02: 7622 ld a2,40(sp) + 80015a04: 7682 ld a3,32(sp) + 80015a06: f136 sd a3,160(sp) + 80015a08: f532 sd a2,168(sp) + 80015a0a: f92e sd a1,176(sp) + 80015a0c: fd2a sd a0,184(sp) + +0000000080015a0e <.LBB28_18>: + 80015a0e: 00015597 auipc a1,0x15 + 80015a12: 36258593 addi a1,a1,866 # 8002ad70 <.L__unnamed_73> + 80015a16: 1888 addi a0,sp,112 + 80015a18: 460d li a2,3 + 80015a1a: 1114 addi a3,sp,160 + 80015a1c: 4709 li a4,2 + 80015a1e: ffff0097 auipc ra,0xffff0 + 80015a22: b6c080e7 jalr -1172(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80015a26: a009 j 80015a28 <.LBB28_18+0x1a> + 80015a28: 1888 addi a0,sp,112 + 80015a2a: 00009097 auipc ra,0x9 + 80015a2e: 1ce080e7 jalr 462(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80015a32: a009 j 80015a34 <.LBB28_18+0x26> + + match fifo_opt { + Some(fifo_ptr) => { + 80015a34: 6546 ld a0,80(sp) + 80015a36: 4581 li a1,0 + 80015a38: 00b50463 beq a0,a1,80015a40 <.LBB28_18+0x32> + 80015a3c: a009 j 80015a3e <.LBB28_18+0x30> + 80015a3e: a029 j 80015a48 <.LBB28_18+0x3a> + 80015a40: 4505 li a0,1 + // println!("In sys_fifo_write, finished, the name is {} {} {} {}", name[0], name[1], name[2], name[3]); + Ok(0) + } + + None => { + Err(()) + 80015a42: e0aa sd a0,64(sp) + match fifo_opt { + 80015a44: a00d j 80015a66 <.LBB28_18+0x58> + 80015a46: 0000 unimp + Some(fifo_ptr) => { + 80015a48: 65e6 ld a1,88(sp) + 80015a4a: e62e sd a1,264(sp) + let fifo = unsafe { &mut *fifo_ptr }; + 80015a4c: ea2e sd a1,272(sp) + fifo.write(ptr, len); //to_do + 80015a4e: 7606 ld a2,96(sp) + 80015a50: 76a6 ld a3,104(sp) + 80015a52: 0988 addi a0,sp,208 + 80015a54: ffff3097 auipc ra,0xffff3 + 80015a58: c06080e7 jalr -1018(ra) # 8000865a <_ZN6kernel3ipc4fifo6Fifo_t5write17h48134ffed519361eE> + 80015a5c: a009 j 80015a5e <.LBB28_18+0x50> + 80015a5e: 4501 li a0,0 + Ok(0) + 80015a60: e4aa sd a0,72(sp) + 80015a62: e0aa sd a0,64(sp) + match fifo_opt { + 80015a64: a009 j 80015a66 <.LBB28_18+0x58> + } + } + } + 80015a66: 6506 ld a0,64(sp) + 80015a68: 65a6 ld a1,72(sp) + 80015a6a: 60f2 ld ra,280(sp) + 80015a6c: 6115 addi sp,sp,288 + 80015a6e: 8082 ret + +Disassembly of section .text.handle_syscall: + +0000000080015a70 : +pub const SYSCALL_NUM:usize = 21; +pub const SHUTDOWN: usize = 8; +pub const REBOOT: usize = 9; + +#[no_mangle] +pub unsafe fn handle_syscall() { + 80015a70: 711d addi sp,sp,-96 + let proc = CPU_MANAGER.myproc().unwrap(); + 80015a72: ec86 sd ra,88(sp) + +0000000080015a74 <.LBB29_7>: + 80015a74: 00050517 auipc a0,0x50 + 80015a78: 6cc50513 addi a0,a0,1740 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80015a7c: ffffd097 auipc ra,0xffffd + 80015a80: 9dc080e7 jalr -1572(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80015a84: e82a sd a0,16(sp) + 80015a86: a009 j 80015a88 <.LBB29_7+0x14> + 80015a88: 6542 ld a0,16(sp) + +0000000080015a8a <.LBB29_8>: + 80015a8a: 00015597 auipc a1,0x15 + 80015a8e: 32e58593 addi a1,a1,814 # 8002adb8 <.L__unnamed_74> + 80015a92: ffffa097 auipc ra,0xffffa + 80015a96: cfe080e7 jalr -770(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80015a9a: 85aa mv a1,a0 + 80015a9c: e42e sd a1,8(sp) + 80015a9e: fc2a sd a0,56(sp) + 80015aa0: a009 j 80015aa2 <.LBB29_8+0x18> + let mut syscall = Syscall{ process: proc }; + 80015aa2: 6522 ld a0,8(sp) + 80015aa4: f02a sd a0,32(sp) + 80015aa6: 1008 addi a0,sp,32 + if let Ok(res) = syscall.syscall() { + 80015aa8: 00000097 auipc ra,0x0 + 80015aac: 134080e7 jalr 308(ra) # 80015bdc <_ZN6kernel7syscall7Syscall7syscall17h26fb265f8f05ef9eE> + 80015ab0: f42a sd a0,40(sp) + 80015ab2: f82e sd a1,48(sp) + 80015ab4: a009 j 80015ab6 <.LBB29_8+0x2c> + 80015ab6: 7522 ld a0,40(sp) + 80015ab8: 4581 li a1,0 + 80015aba: 00b50963 beq a0,a1,80015acc <.LBB29_8+0x42> + 80015abe: a009 j 80015ac0 <.LBB29_8+0x36> + // if tf.a7 == 40 || tf.a7 == 1{ + // println!("In handle_syscall pid {} epc {}, sp {}",proc.pid, tf.epc, tf.sp); + // } + }else{ + + let tf = &mut *proc.trapframe; + 80015ac0: 6522 ld a0,8(sp) + 80015ac2: 710c ld a1,32(a0) + 80015ac4: e0ae sd a1,64(sp) + 80015ac6: 557d li a0,-1 + tf.a0 = -1 as isize as usize + 80015ac8: f9a8 sd a0,112(a1) + if let Ok(res) = syscall.syscall() { + 80015aca: a801 j 80015ada <.LBB29_8+0x50> + 80015acc: 65a2 ld a1,8(sp) + 80015ace: 7542 ld a0,48(sp) + 80015ad0: e4aa sd a0,72(sp) + let tf = &mut *proc.trapframe; + 80015ad2: 718c ld a1,32(a1) + 80015ad4: e8ae sd a1,80(sp) + tf.a0 = res; + 80015ad6: f9a8 sd a0,112(a1) + if let Ok(res) = syscall.syscall() { + 80015ad8: a009 j 80015ada <.LBB29_8+0x50> + } + +} + 80015ada: 60e6 ld ra,88(sp) + 80015adc: 6125 addi sp,sp,96 + 80015ade: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall9SysCallID3new17h71369ad526ed3399E: + +0000000080015ae0 <_ZN6kernel7syscall9SysCallID3new17h71369ad526ed3399E>: + + Unknown +} + +impl SysCallID { + pub fn new(id: usize) -> Self { + 80015ae0: 1101 addi sp,sp,-32 + 80015ae2: ec2a sd a0,24(sp) + match id { + 1 => { Self::SysFork }, + 80015ae4: fff50593 addi a1,a0,-1 + 80015ae8: e42e sd a1,8(sp) + 80015aea: 02800513 li a0,40 + 80015aee: 00b56b63 bltu a0,a1,80015b04 <.LBB30_2> + 80015af2: 6522 ld a0,8(sp) + 80015af4: 050e slli a0,a0,0x3 + +0000000080015af6 <.LBB30_37>: + 80015af6: 00014597 auipc a1,0x14 + 80015afa: 4b258593 addi a1,a1,1202 # 80029fa8 <.LJTI30_0> + 80015afe: 952e add a0,a0,a1 + 80015b00: 6108 ld a0,0(a0) + 80015b02: 8502 jr a0 + +0000000080015b04 <.LBB30_2>: + 80015b04: 02a00513 li a0,42 + 31 => { Self::SysFifoWrite}, + + 40 => { Self::SysClone}, + 41 => { Self::SysJoin}, + + _ => { Self::Unknown } + 80015b08: e82a sd a0,16(sp) + match id { + 80015b0a: a0f1 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b0c <.LBB30_3>: + 80015b0c: 4505 li a0,1 + 1 => { Self::SysFork }, + 80015b0e: e82a sd a0,16(sp) + match id { + 80015b10: a0d9 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b12 <.LBB30_4>: + 80015b12: 4509 li a0,2 + 2 => { Self::SysExit }, + 80015b14: e82a sd a0,16(sp) + match id { + 80015b16: a0c1 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b18 <.LBB30_5>: + 80015b18: 450d li a0,3 + 3 => { Self::SysWait }, + 80015b1a: e82a sd a0,16(sp) + match id { + 80015b1c: a86d j 80015bd6 <.LBB30_35+0x8> + +0000000080015b1e <.LBB30_6>: + 80015b1e: 4511 li a0,4 + 4 => { Self::SysPipe }, + 80015b20: e82a sd a0,16(sp) + match id { + 80015b22: a855 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b24 <.LBB30_7>: + 80015b24: 4515 li a0,5 + 5 => { Self::SysRead }, + 80015b26: e82a sd a0,16(sp) + match id { + 80015b28: a07d j 80015bd6 <.LBB30_35+0x8> + +0000000080015b2a <.LBB30_8>: + 80015b2a: 4519 li a0,6 + 6 => { Self::SysKill }, + 80015b2c: e82a sd a0,16(sp) + match id { + 80015b2e: a065 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b30 <.LBB30_9>: + 80015b30: 451d li a0,7 + 7 => { Self::SysExec }, + 80015b32: e82a sd a0,16(sp) + match id { + 80015b34: a04d j 80015bd6 <.LBB30_35+0x8> + +0000000080015b36 <.LBB30_10>: + 80015b36: 4521 li a0,8 + 8 => { Self::SysFstat }, + 80015b38: e82a sd a0,16(sp) + match id { + 80015b3a: a871 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b3c <.LBB30_11>: + 80015b3c: 4525 li a0,9 + 9 => { Self::SysChdir }, + 80015b3e: e82a sd a0,16(sp) + match id { + 80015b40: a859 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b42 <.LBB30_12>: + 80015b42: 4529 li a0,10 + 10 => { Self::SysDup }, + 80015b44: e82a sd a0,16(sp) + match id { + 80015b46: a841 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b48 <.LBB30_13>: + 80015b48: 452d li a0,11 + 11 => { Self::SysGetPid }, + 80015b4a: e82a sd a0,16(sp) + match id { + 80015b4c: a069 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b4e <.LBB30_14>: + 80015b4e: 4531 li a0,12 + 12 => { Self::SysSbrk }, + 80015b50: e82a sd a0,16(sp) + match id { + 80015b52: a051 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b54 <.LBB30_15>: + 80015b54: 4535 li a0,13 + 13 => { Self::SysSleep }, + 80015b56: e82a sd a0,16(sp) + match id { + 80015b58: a8bd j 80015bd6 <.LBB30_35+0x8> + +0000000080015b5a <.LBB30_16>: + 80015b5a: 4539 li a0,14 + 14 => { Self::SysUptime }, + 80015b5c: e82a sd a0,16(sp) + match id { + 80015b5e: a8a5 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b60 <.LBB30_17>: + 80015b60: 453d li a0,15 + 15 => { Self::SysOpen }, + 80015b62: e82a sd a0,16(sp) + match id { + 80015b64: a88d j 80015bd6 <.LBB30_35+0x8> + +0000000080015b66 <.LBB30_18>: + 80015b66: 4541 li a0,16 + 16 => { Self::SysWrite }, + 80015b68: e82a sd a0,16(sp) + match id { + 80015b6a: a0b5 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b6c <.LBB30_19>: + 80015b6c: 4545 li a0,17 + 17 => { Self::SysMknod }, + 80015b6e: e82a sd a0,16(sp) + match id { + 80015b70: a09d j 80015bd6 <.LBB30_35+0x8> + +0000000080015b72 <.LBB30_20>: + 80015b72: 4549 li a0,18 + 18 => { Self::SysUnlink }, + 80015b74: e82a sd a0,16(sp) + match id { + 80015b76: a085 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b78 <.LBB30_21>: + 80015b78: 454d li a0,19 + 19 => { Self::SysLink }, + 80015b7a: e82a sd a0,16(sp) + match id { + 80015b7c: a8a9 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b7e <.LBB30_22>: + 80015b7e: 4551 li a0,20 + 20 => { Self::SysMkdir }, + 80015b80: e82a sd a0,16(sp) + match id { + 80015b82: a891 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b84 <.LBB30_23>: + 80015b84: 4555 li a0,21 + 21 => { Self::SysClose }, + 80015b86: e82a sd a0,16(sp) + match id { + 80015b88: a0b9 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b8a <.LBB30_24>: + 80015b8a: 4559 li a0,22 + 22 => { Self::SysSemGet}, + 80015b8c: e82a sd a0,16(sp) + match id { + 80015b8e: a0a1 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b90 <.LBB30_25>: + 80015b90: 455d li a0,23 + 23 => { Self::SysSemPut}, + 80015b92: e82a sd a0,16(sp) + match id { + 80015b94: a089 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b96 <.LBB30_26>: + 80015b96: 4561 li a0,24 + 24 => { Self::SysSemUp}, + 80015b98: e82a sd a0,16(sp) + match id { + 80015b9a: a835 j 80015bd6 <.LBB30_35+0x8> + +0000000080015b9c <.LBB30_27>: + 80015b9c: 4565 li a0,25 + 25 => { Self::SysSemDown}, + 80015b9e: e82a sd a0,16(sp) + match id { + 80015ba0: a81d j 80015bd6 <.LBB30_35+0x8> + +0000000080015ba2 <.LBB30_28>: + 80015ba2: 4569 li a0,26 + 26 => { Self::SysSemInit}, + 80015ba4: e82a sd a0,16(sp) + match id { + 80015ba6: a805 j 80015bd6 <.LBB30_35+0x8> + +0000000080015ba8 <.LBB30_29>: + 80015ba8: 456d li a0,27 + 27 => { Self::SysMkfifo}, + 80015baa: e82a sd a0,16(sp) + match id { + 80015bac: a02d j 80015bd6 <.LBB30_35+0x8> + +0000000080015bae <.LBB30_30>: + 80015bae: 4571 li a0,28 + 28 => { Self::SysFifoGet}, + 80015bb0: e82a sd a0,16(sp) + match id { + 80015bb2: a015 j 80015bd6 <.LBB30_35+0x8> + +0000000080015bb4 <.LBB30_31>: + 80015bb4: 4575 li a0,29 + 29 => { Self::SysFifoPut}, + 80015bb6: e82a sd a0,16(sp) + match id { + 80015bb8: a839 j 80015bd6 <.LBB30_35+0x8> + +0000000080015bba <.LBB30_32>: + 80015bba: 4579 li a0,30 + 30 => { Self::SysFifoRead}, + 80015bbc: e82a sd a0,16(sp) + match id { + 80015bbe: a821 j 80015bd6 <.LBB30_35+0x8> + +0000000080015bc0 <.LBB30_33>: + 80015bc0: 457d li a0,31 + 31 => { Self::SysFifoWrite}, + 80015bc2: e82a sd a0,16(sp) + match id { + 80015bc4: a809 j 80015bd6 <.LBB30_35+0x8> + +0000000080015bc6 <.LBB30_34>: + 80015bc6: 02800513 li a0,40 + 40 => { Self::SysClone}, + 80015bca: e82a sd a0,16(sp) + match id { + 80015bcc: a029 j 80015bd6 <.LBB30_35+0x8> + +0000000080015bce <.LBB30_35>: + 80015bce: 02900513 li a0,41 + 41 => { Self::SysJoin}, + 80015bd2: e82a sd a0,16(sp) + match id { + 80015bd4: a009 j 80015bd6 <.LBB30_35+0x8> + } + } + 80015bd6: 6542 ld a0,16(sp) + 80015bd8: 6105 addi sp,sp,32 + 80015bda: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall7Syscall7syscall17h26fb265f8f05ef9eE: + +0000000080015bdc <_ZN6kernel7syscall7Syscall7syscall17h26fb265f8f05ef9eE>: +pub struct Syscall<'a>{ + process: &'a mut task_struct +} + +impl Syscall<'_> { + pub fn syscall(&mut self) -> SysResult { + 80015bdc: 7131 addi sp,sp,-192 + 80015bde: fd06 sd ra,184(sp) + 80015be0: f42a sd a0,40(sp) + 80015be2: ed2a sd a0,152(sp) + +0000000080015be4 <.LBB31_39>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80015be4: 00050517 auipc a0,0x50 + 80015be8: 55c50513 addi a0,a0,1372 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80015bec: ffffd097 auipc ra,0xffffd + 80015bf0: 86c080e7 jalr -1940(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80015bf4: f82a sd a0,48(sp) + 80015bf6: a009 j 80015bf8 <.LBB31_39+0x14> + 80015bf8: 7542 ld a0,48(sp) + +0000000080015bfa <.LBB31_40>: + 80015bfa: 00015597 auipc a1,0x15 + 80015bfe: 1d658593 addi a1,a1,470 # 8002add0 <.L__unnamed_75> + 80015c02: ffffa097 auipc ra,0xffffa + 80015c06: b8e080e7 jalr -1138(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80015c0a: f02a sd a0,32(sp) + 80015c0c: a009 j 80015c0e <.LBB31_40+0x14> + 80015c0e: 7502 ld a0,32(sp) + 80015c10: f12a sd a0,160(sp) + // 获取进程的trapframe + let tf = unsafe{ &mut *task.trapframe }; + 80015c12: 7108 ld a0,32(a0) + 80015c14: f52a sd a0,168(sp) + // 获取系统调用 id 号 + let sys_id = SysCallID::new(tf.a7); + 80015c16: 7548 ld a0,168(a0) + 80015c18: 00000097 auipc ra,0x0 + 80015c1c: ec8080e7 jalr -312(ra) # 80015ae0 <_ZN6kernel7syscall9SysCallID3new17h71369ad526ed3399E> + 80015c20: e4aa sd a0,72(sp) + 80015c22: a009 j 80015c24 <.LBB31_40+0x2a> + + match sys_id { + SysCallID::SysFork => { self.sys_fork() }, + 80015c24: 6526 ld a0,72(sp) + 80015c26: fff50593 addi a1,a0,-1 + 80015c2a: ec2e sd a1,24(sp) + 80015c2c: 02800513 li a0,40 + 80015c30: 00b56b63 bltu a0,a1,80015c46 <.LBB31_5> + 80015c34: 6562 ld a0,24(sp) + 80015c36: 050e slli a0,a0,0x3 + +0000000080015c38 <.LBB31_41>: + 80015c38: 00014597 auipc a1,0x14 + 80015c3c: 4b858593 addi a1,a1,1208 # 8002a0f0 <.LJTI31_0> + 80015c40: 952e add a0,a0,a1 + 80015c42: 6108 ld a0,0(a0) + 80015c44: 8502 jr a0 + +0000000080015c46 <.LBB31_5>: + 80015c46: 00a8 addi a0,sp,72 + SysCallID::SysFifoGet => { self.sys_fifo_get() }, + SysCallID::SysFifoPut => { self.sys_fifo_put() }, + SysCallID::SysFifoRead => { self.sys_fifo_read() }, + SysCallID::SysFifoWrite => { self.sys_fifo_write() }, + + _ => { panic!("Invalid syscall id: {:?}", sys_id) } + 80015c48: e92a sd a0,144(sp) + 80015c4a: f92a sd a0,176(sp) + +0000000080015c4c <.LBB31_42>: + 80015c4c: 00000597 auipc a1,0x0 + 80015c50: 5b458593 addi a1,a1,1460 # 80016200 <_ZN63_$LT$kernel..syscall..SysCallID$u20$as$u20$core..fmt..Debug$GT$3fmt17h1e62a6c91d257ea0E> + 80015c54: 0000a097 auipc ra,0xa + 80015c58: 8fc080e7 jalr -1796(ra) # 8001f550 <_ZN4core3fmt10ArgumentV13new17hd8cc9af5365c80feE> + 80015c5c: e42a sd a0,8(sp) + 80015c5e: e82e sd a1,16(sp) + 80015c60: aae9 j 80015e3a <.LBB31_35+0x10> + +0000000080015c62 <.LBB31_6>: + SysCallID::SysFork => { self.sys_fork() }, + 80015c62: 7522 ld a0,40(sp) + 80015c64: ffffd097 auipc ra,0xffffd + 80015c68: f76080e7 jalr -138(ra) # 80012bda <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_fork17h5c4cdf045541cf30E> + 80015c6c: fc2a sd a0,56(sp) + 80015c6e: e0ae sd a1,64(sp) + 80015c70: a401 j 80015e70 <.LBB31_44+0x14> + +0000000080015c72 <.LBB31_7>: + SysCallID::SysExit => { self.sys_exit() }, + 80015c72: 7522 ld a0,40(sp) + 80015c74: ffffd097 auipc ra,0xffffd + 80015c78: 0d8080e7 jalr 216(ra) # 80012d4c <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exit17hae1a7a01ef6f0180E> + 80015c7c: fc2a sd a0,56(sp) + 80015c7e: e0ae sd a1,64(sp) + 80015c80: aac5 j 80015e70 <.LBB31_44+0x14> + +0000000080015c82 <.LBB31_8>: + SysCallID::SysWait => { self.sys_wait() }, + 80015c82: 7522 ld a0,40(sp) + 80015c84: ffffd097 auipc ra,0xffffd + 80015c88: 0f4080e7 jalr 244(ra) # 80012d78 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_wait17h7b4815682cca4a8dE> + 80015c8c: fc2a sd a0,56(sp) + 80015c8e: e0ae sd a1,64(sp) + 80015c90: a2c5 j 80015e70 <.LBB31_44+0x14> + +0000000080015c92 <.LBB31_9>: + SysCallID::SysRead => { self.sys_read() }, + 80015c92: 7522 ld a0,40(sp) + 80015c94: ffffd097 auipc ra,0xffffd + 80015c98: 388080e7 jalr 904(ra) # 8001301c <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_read17hd83bd4f92523a35cE> + 80015c9c: fc2a sd a0,56(sp) + 80015c9e: e0ae sd a1,64(sp) + 80015ca0: aac1 j 80015e70 <.LBB31_44+0x14> + +0000000080015ca2 <.LBB31_10>: + SysCallID::SysWrite => { self.sys_write() }, + 80015ca2: 7522 ld a0,40(sp) + 80015ca4: ffffd097 auipc ra,0xffffd + 80015ca8: 4da080e7 jalr 1242(ra) # 8001317e <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_write17hc5a72fe3cb6d9324E> + 80015cac: fc2a sd a0,56(sp) + 80015cae: e0ae sd a1,64(sp) + 80015cb0: a2c1 j 80015e70 <.LBB31_44+0x14> + +0000000080015cb2 <.LBB31_11>: + SysCallID::SysOpen => { self.sys_open() }, + 80015cb2: 7522 ld a0,40(sp) + 80015cb4: ffffd097 auipc ra,0xffffd + 80015cb8: 62c080e7 jalr 1580(ra) # 800132e0 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_open17h5b5b1f6af7439fbcE> + 80015cbc: fc2a sd a0,56(sp) + 80015cbe: e0ae sd a1,64(sp) + 80015cc0: aa45 j 80015e70 <.LBB31_44+0x14> + +0000000080015cc2 <.LBB31_12>: + SysCallID::SysExec => { self.sys_exec() }, + 80015cc2: 7522 ld a0,40(sp) + 80015cc4: ffffe097 auipc ra,0xffffe + 80015cc8: b96080e7 jalr -1130(ra) # 8001385a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_exec17h5f20106c7a7bbe80E> + 80015ccc: fc2a sd a0,56(sp) + 80015cce: e0ae sd a1,64(sp) + 80015cd0: a245 j 80015e70 <.LBB31_44+0x14> + +0000000080015cd2 <.LBB31_13>: + SysCallID::SysMknod => { self.sys_mknod() }, + 80015cd2: 7522 ld a0,40(sp) + 80015cd4: ffffe097 auipc ra,0xffffe + 80015cd8: 0b6080e7 jalr 182(ra) # 80013d8a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_mknod17h6bbc97745668998fE> + 80015cdc: fc2a sd a0,56(sp) + 80015cde: e0ae sd a1,64(sp) + 80015ce0: aa41 j 80015e70 <.LBB31_44+0x14> + +0000000080015ce2 <.LBB31_14>: + SysCallID::SysClose => { self.sys_close() }, + 80015ce2: 7522 ld a0,40(sp) + 80015ce4: ffffe097 auipc ra,0xffffe + 80015ce8: 23e080e7 jalr 574(ra) # 80013f22 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_close17haaef41d651f2f6f7E> + 80015cec: fc2a sd a0,56(sp) + 80015cee: e0ae sd a1,64(sp) + 80015cf0: a241 j 80015e70 <.LBB31_44+0x14> + +0000000080015cf2 <.LBB31_15>: + SysCallID::SysDup => { self.sys_dup() }, + 80015cf2: 7522 ld a0,40(sp) + 80015cf4: ffffd097 auipc ra,0xffffd + 80015cf8: 1e8080e7 jalr 488(ra) # 80012edc <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$7sys_dup17h638e7e7819355743E> + 80015cfc: fc2a sd a0,56(sp) + 80015cfe: e0ae sd a1,64(sp) + 80015d00: aa85 j 80015e70 <.LBB31_44+0x14> + +0000000080015d02 <.LBB31_16>: + 80015d02: 4501 li a0,0 + SysCallID::SysUptime => { Ok(0) }, + 80015d04: e0aa sd a0,64(sp) + 80015d06: fc2a sd a0,56(sp) + match sys_id { + 80015d08: a2a5 j 80015e70 <.LBB31_44+0x14> + +0000000080015d0a <.LBB31_17>: + SysCallID::SysSbrk => { self.sys_sbrk() }, + 80015d0a: 7522 ld a0,40(sp) + 80015d0c: ffffd097 auipc ra,0xffffd + 80015d10: 120080e7 jalr 288(ra) # 80012e2c <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_sbrk17h620cfc1119b978cdE> + 80015d14: fc2a sd a0,56(sp) + 80015d16: e0ae sd a1,64(sp) + 80015d18: aaa1 j 80015e70 <.LBB31_44+0x14> + +0000000080015d1a <.LBB31_18>: + SysCallID::SysFstat => { self.sys_fstat() }, + 80015d1a: 7522 ld a0,40(sp) + 80015d1c: ffffe097 auipc ra,0xffffe + 80015d20: 2a2080e7 jalr 674(ra) # 80013fbe <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_fstat17h0c7ad2f655d0446dE> + 80015d24: fc2a sd a0,56(sp) + 80015d26: e0ae sd a1,64(sp) + 80015d28: a2a1 j 80015e70 <.LBB31_44+0x14> + +0000000080015d2a <.LBB31_19>: + SysCallID::SysChdir => { self.sys_chdir()}, + 80015d2a: 7522 ld a0,40(sp) + 80015d2c: ffffe097 auipc ra,0xffffe + 80015d30: 3de080e7 jalr 990(ra) # 8001410a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_chdir17he6ad16137b6ff3daE> + 80015d34: fc2a sd a0,56(sp) + 80015d36: e0ae sd a1,64(sp) + 80015d38: aa25 j 80015e70 <.LBB31_44+0x14> + +0000000080015d3a <.LBB31_20>: + SysCallID::SysPipe => { unsafe { self.sys_pipe() } }, + 80015d3a: 7522 ld a0,40(sp) + 80015d3c: ffffe097 auipc ra,0xffffe + 80015d40: 5be080e7 jalr 1470(ra) # 800142fa <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_pipe17h56ef7a0a7762279bE> + 80015d44: fc2a sd a0,56(sp) + 80015d46: e0ae sd a1,64(sp) + 80015d48: a225 j 80015e70 <.LBB31_44+0x14> + +0000000080015d4a <.LBB31_21>: + SysCallID::SysUnlink => { self.sys_unlink() }, + 80015d4a: 7522 ld a0,40(sp) + 80015d4c: fffff097 auipc ra,0xfffff + 80015d50: 97c080e7 jalr -1668(ra) # 800146c8 <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_unlink17h041fe6edd5a3dcecE> + 80015d54: fc2a sd a0,56(sp) + 80015d56: e0ae sd a1,64(sp) + 80015d58: aa21 j 80015e70 <.LBB31_44+0x14> + +0000000080015d5a <.LBB31_22>: + SysCallID::SysLink => { self.sys_link() }, + 80015d5a: 7522 ld a0,40(sp) + 80015d5c: fffff097 auipc ra,0xfffff + 80015d60: e50080e7 jalr -432(ra) # 80014bac <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_link17ha9dece5abe92404dE> + 80015d64: fc2a sd a0,56(sp) + 80015d66: e0ae sd a1,64(sp) + 80015d68: a221 j 80015e70 <.LBB31_44+0x14> + +0000000080015d6a <.LBB31_23>: + SysCallID::SysMkdir => { self.sys_mkdir() }, + 80015d6a: 7522 ld a0,40(sp) + 80015d6c: fffff097 auipc ra,0xfffff + 80015d70: 31e080e7 jalr 798(ra) # 8001508a <_ZN6kernel7syscall4file42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_mkdir17h9fc2155a1c553da1E> + 80015d74: fc2a sd a0,56(sp) + 80015d76: e0ae sd a1,64(sp) + 80015d78: a8e5 j 80015e70 <.LBB31_44+0x14> + +0000000080015d7a <.LBB31_24>: + SysCallID::SysSemGet => { self.sys_sem_get() }, + 80015d7a: 7522 ld a0,40(sp) + 80015d7c: fffff097 auipc ra,0xfffff + 80015d80: 468080e7 jalr 1128(ra) # 800151e4 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$11sys_sem_get17hb3397bd9d36c7bd4E> + 80015d84: fc2a sd a0,56(sp) + 80015d86: e0ae sd a1,64(sp) + 80015d88: a0e5 j 80015e70 <.LBB31_44+0x14> + +0000000080015d8a <.LBB31_25>: + SysCallID::SysSemPut => { self.sys_sem_put() }, + 80015d8a: 7522 ld a0,40(sp) + 80015d8c: fffff097 auipc ra,0xfffff + 80015d90: 50a080e7 jalr 1290(ra) # 80015296 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$11sys_sem_put17h3b21147033dd4825E> + 80015d94: fc2a sd a0,56(sp) + 80015d96: e0ae sd a1,64(sp) + 80015d98: a8e1 j 80015e70 <.LBB31_44+0x14> + +0000000080015d9a <.LBB31_26>: + SysCallID::SysSemUp => { self.sys_sem_up() }, + 80015d9a: 7522 ld a0,40(sp) + 80015d9c: fffff097 auipc ra,0xfffff + 80015da0: 580080e7 jalr 1408(ra) # 8001531c <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_sem_up17h66299e2e1eef50b0E> + 80015da4: fc2a sd a0,56(sp) + 80015da6: e0ae sd a1,64(sp) + 80015da8: a0e1 j 80015e70 <.LBB31_44+0x14> + +0000000080015daa <.LBB31_27>: + SysCallID::SysSemDown => { self.sys_sem_down() }, + 80015daa: 7522 ld a0,40(sp) + 80015dac: fffff097 auipc ra,0xfffff + 80015db0: 604080e7 jalr 1540(ra) # 800153b0 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_sem_down17hf3708c0cac81b44dE> + 80015db4: fc2a sd a0,56(sp) + 80015db6: e0ae sd a1,64(sp) + 80015db8: a865 j 80015e70 <.LBB31_44+0x14> + +0000000080015dba <.LBB31_28>: + SysCallID::SysSemInit => { self.sys_sem_init() }, + 80015dba: 7522 ld a0,40(sp) + 80015dbc: fffff097 auipc ra,0xfffff + 80015dc0: 688080e7 jalr 1672(ra) # 80015444 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_sem_init17h9d42fffbf875ebeaE> + 80015dc4: fc2a sd a0,56(sp) + 80015dc6: e0ae sd a1,64(sp) + 80015dc8: a065 j 80015e70 <.LBB31_44+0x14> + +0000000080015dca <.LBB31_29>: + self.sys_clone() + 80015dca: 7522 ld a0,40(sp) + 80015dcc: ffffd097 auipc ra,0xffffd + 80015dd0: e86080e7 jalr -378(ra) # 80012c52 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$9sys_clone17h33021d255812765cE> + 80015dd4: fc2a sd a0,56(sp) + 80015dd6: e0ae sd a1,64(sp) + 80015dd8: a861 j 80015e70 <.LBB31_44+0x14> + +0000000080015dda <.LBB31_30>: + SysCallID::SysJoin => { self.sys_join() }, + 80015dda: 7522 ld a0,40(sp) + 80015ddc: ffffd097 auipc ra,0xffffd + 80015de0: ff6080e7 jalr -10(ra) # 80012dd2 <_ZN6kernel7syscall4proc42_$LT$impl$u20$kernel..syscall..Syscall$GT$8sys_join17hcdda9ca2f2e537bbE> + 80015de4: fc2a sd a0,56(sp) + 80015de6: e0ae sd a1,64(sp) + 80015de8: a061 j 80015e70 <.LBB31_44+0x14> + +0000000080015dea <.LBB31_31>: + SysCallID::SysMkfifo => { self.sys_mkfifo()}, + 80015dea: 7522 ld a0,40(sp) + 80015dec: fffff097 auipc ra,0xfffff + 80015df0: 70c080e7 jalr 1804(ra) # 800154f8 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$10sys_mkfifo17ha5fafffc64e6bceeE> + 80015df4: fc2a sd a0,56(sp) + 80015df6: e0ae sd a1,64(sp) + 80015df8: a8a5 j 80015e70 <.LBB31_44+0x14> + +0000000080015dfa <.LBB31_32>: + SysCallID::SysFifoGet => { self.sys_fifo_get() }, + 80015dfa: 7522 ld a0,40(sp) + 80015dfc: 00000097 auipc ra,0x0 + 80015e00: 860080e7 jalr -1952(ra) # 8001565c <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_get17ha24beea98224282cE> + 80015e04: fc2a sd a0,56(sp) + 80015e06: e0ae sd a1,64(sp) + 80015e08: a0a5 j 80015e70 <.LBB31_44+0x14> + +0000000080015e0a <.LBB31_33>: + SysCallID::SysFifoPut => { self.sys_fifo_put() }, + 80015e0a: 7522 ld a0,40(sp) + 80015e0c: 00000097 auipc ra,0x0 + 80015e10: 9c4080e7 jalr -1596(ra) # 800157d0 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$12sys_fifo_put17h853b40814394db5eE> + 80015e14: fc2a sd a0,56(sp) + 80015e16: e0ae sd a1,64(sp) + 80015e18: a8a1 j 80015e70 <.LBB31_44+0x14> + +0000000080015e1a <.LBB31_34>: + SysCallID::SysFifoRead => { self.sys_fifo_read() }, + 80015e1a: 7522 ld a0,40(sp) + 80015e1c: 00000097 auipc ra,0x0 + 80015e20: a54080e7 jalr -1452(ra) # 80015870 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$13sys_fifo_read17h33e0b610eee1e940E> + 80015e24: fc2a sd a0,56(sp) + 80015e26: e0ae sd a1,64(sp) + 80015e28: a0a1 j 80015e70 <.LBB31_44+0x14> + +0000000080015e2a <.LBB31_35>: + SysCallID::SysFifoWrite => { self.sys_fifo_write() }, + 80015e2a: 7522 ld a0,40(sp) + 80015e2c: 00000097 auipc ra,0x0 + 80015e30: b44080e7 jalr -1212(ra) # 80015970 <_ZN6kernel7syscall3ipc42_$LT$impl$u20$kernel..syscall..Syscall$GT$14sys_fifo_write17h98f0fee8bea374f3E> + 80015e34: fc2a sd a0,56(sp) + 80015e36: e0ae sd a1,64(sp) + 80015e38: a825 j 80015e70 <.LBB31_44+0x14> + _ => { panic!("Invalid syscall id: {:?}", sys_id) } + 80015e3a: 6542 ld a0,16(sp) + 80015e3c: 65a2 ld a1,8(sp) + 80015e3e: e12e sd a1,128(sp) + 80015e40: e52a sd a0,136(sp) + +0000000080015e42 <.LBB31_43>: + 80015e42: 00015597 auipc a1,0x15 + 80015e46: fbe58593 addi a1,a1,-66 # 8002ae00 <.L__unnamed_76> + 80015e4a: 0888 addi a0,sp,80 + 80015e4c: 0114 addi a3,sp,128 + 80015e4e: 4705 li a4,1 + 80015e50: 863a mv a2,a4 + 80015e52: fffef097 auipc ra,0xfffef + 80015e56: 738080e7 jalr 1848(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80015e5a: a009 j 80015e5c <.LBB31_44> + +0000000080015e5c <.LBB31_44>: + 80015e5c: 00015597 auipc a1,0x15 + 80015e60: fb458593 addi a1,a1,-76 # 8002ae10 <.L__unnamed_77> + 80015e64: 0888 addi a0,sp,80 + 80015e66: 0000d097 auipc ra,0xd + 80015e6a: 34a080e7 jalr 842(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 80015e6e: 0000 unimp + } + } + 80015e70: 7562 ld a0,56(sp) + 80015e72: 6586 ld a1,64(sp) + 80015e74: 70ea ld ra,184(sp) + 80015e76: 6129 addi sp,sp,192 + 80015e78: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E: + +0000000080015e7a <_ZN6kernel7syscall7Syscall3arg17h3bc8cfe836411871E>: + + /// 获取第n个位置的参数 + pub fn arg(&self, id: usize) -> usize { + 80015e7a: 711d addi sp,sp,-96 + 80015e7c: ec86 sd ra,88(sp) + 80015e7e: f02e sd a1,32(sp) + 80015e80: fc2a sd a0,56(sp) + 80015e82: e0ae sd a1,64(sp) + +0000000080015e84 <.LBB32_12>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80015e84: 00050517 auipc a0,0x50 + 80015e88: 2bc50513 addi a0,a0,700 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80015e8c: ffffc097 auipc ra,0xffffc + 80015e90: 5cc080e7 jalr 1484(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80015e94: f42a sd a0,40(sp) + 80015e96: a009 j 80015e98 <.LBB32_12+0x14> + 80015e98: 7522 ld a0,40(sp) + +0000000080015e9a <.LBB32_13>: + 80015e9a: 00015597 auipc a1,0x15 + 80015e9e: f8e58593 addi a1,a1,-114 # 8002ae28 <.L__unnamed_78> + 80015ea2: ffffa097 auipc ra,0xffffa + 80015ea6: 8ee080e7 jalr -1810(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80015eaa: ec2a sd a0,24(sp) + 80015eac: a009 j 80015eae <.LBB32_13+0x14> + 80015eae: 7582 ld a1,32(sp) + 80015eb0: 6562 ld a0,24(sp) + 80015eb2: e4aa sd a0,72(sp) + let tf = unsafe{ &*task.trapframe }; + 80015eb4: 7108 ld a0,32(a0) + 80015eb6: e42a sd a0,8(sp) + 80015eb8: e8aa sd a0,80(sp) + match id { + 0 => tf.a0, + 80015eba: 852e mv a0,a1 + 80015ebc: e82a sd a0,16(sp) + 80015ebe: 4515 li a0,5 + 80015ec0: 00b56b63 bltu a0,a1,80015ed6 <.LBB32_15> + 80015ec4: 6542 ld a0,16(sp) + 80015ec6: 050e slli a0,a0,0x3 + +0000000080015ec8 <.LBB32_14>: + 80015ec8: 00014597 auipc a1,0x14 + 80015ecc: 37058593 addi a1,a1,880 # 8002a238 <.LJTI32_0> + 80015ed0: 952e add a0,a0,a1 + 80015ed2: 6108 ld a0,0(a0) + 80015ed4: 8502 jr a0 + +0000000080015ed6 <.LBB32_15>: + 1 => tf.a1, + 2 => tf.a2, + 3 => tf.a3, + 4 => tf.a4, + 5 => tf.a5, + _ => panic!("不能获取参数") + 80015ed6: 00015517 auipc a0,0x15 + 80015eda: f6a50513 addi a0,a0,-150 # 8002ae40 <.L__unnamed_79> + +0000000080015ede <.LBB32_16>: + 80015ede: 00015617 auipc a2,0x15 + 80015ee2: f7a60613 addi a2,a2,-134 # 8002ae58 <.L__unnamed_80> + 80015ee6: 45c9 li a1,18 + 80015ee8: 0000d097 auipc ra,0xd + 80015eec: 25c080e7 jalr 604(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080015ef2 <.LBB32_5>: + 0 => tf.a0, + 80015ef2: 6522 ld a0,8(sp) + 80015ef4: 7928 ld a0,112(a0) + 80015ef6: f82a sd a0,48(sp) + match id { + 80015ef8: a02d j 80015f22 <.LBB32_10+0x8> + +0000000080015efa <.LBB32_6>: + 1 => tf.a1, + 80015efa: 6522 ld a0,8(sp) + 80015efc: 7d28 ld a0,120(a0) + 80015efe: f82a sd a0,48(sp) + match id { + 80015f00: a00d j 80015f22 <.LBB32_10+0x8> + +0000000080015f02 <.LBB32_7>: + 2 => tf.a2, + 80015f02: 6522 ld a0,8(sp) + 80015f04: 6148 ld a0,128(a0) + 80015f06: f82a sd a0,48(sp) + match id { + 80015f08: a829 j 80015f22 <.LBB32_10+0x8> + +0000000080015f0a <.LBB32_8>: + 3 => tf.a3, + 80015f0a: 6522 ld a0,8(sp) + 80015f0c: 6548 ld a0,136(a0) + 80015f0e: f82a sd a0,48(sp) + match id { + 80015f10: a809 j 80015f22 <.LBB32_10+0x8> + +0000000080015f12 <.LBB32_9>: + 4 => tf.a4, + 80015f12: 6522 ld a0,8(sp) + 80015f14: 6948 ld a0,144(a0) + 80015f16: f82a sd a0,48(sp) + match id { + 80015f18: a029 j 80015f22 <.LBB32_10+0x8> + +0000000080015f1a <.LBB32_10>: + 5 => tf.a5, + 80015f1a: 6522 ld a0,8(sp) + 80015f1c: 6d48 ld a0,152(a0) + 80015f1e: f82a sd a0,48(sp) + match id { + 80015f20: a009 j 80015f22 <.LBB32_10+0x8> + } + } + 80015f22: 7542 ld a0,48(sp) + 80015f24: 60e6 ld ra,88(sp) + 80015f26: 6125 addi sp,sp,96 + 80015f28: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE: + +0000000080015f2a <_ZN6kernel7syscall7Syscall13copy_from_str17h5c83be6e0d4b822aE>: + + /// 通过地址获取str并将其填入到缓冲区中 + pub fn copy_from_str(&self, addr: usize, buf: &mut [u8], max_len: usize) -> Result<(), ()> { + 80015f2a: 7155 addi sp,sp,-208 + 80015f2c: e586 sd ra,200(sp) + 80015f2e: f03a sd a4,32(sp) + 80015f30: f436 sd a3,40(sp) + 80015f32: f832 sd a2,48(sp) + 80015f34: fc2e sd a1,56(sp) + 80015f36: e92a sd a0,144(sp) + 80015f38: ed2e sd a1,152(sp) + 80015f3a: f132 sd a2,160(sp) + 80015f3c: f536 sd a3,168(sp) + 80015f3e: f93a sd a4,176(sp) + +0000000080015f40 <.LBB33_11>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80015f40: 00050517 auipc a0,0x50 + 80015f44: 20050513 addi a0,a0,512 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80015f48: ffffc097 auipc ra,0xffffc + 80015f4c: 510080e7 jalr 1296(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80015f50: e0aa sd a0,64(sp) + 80015f52: a009 j 80015f54 <.LBB33_11+0x14> + 80015f54: 6506 ld a0,64(sp) + +0000000080015f56 <.LBB33_12>: + 80015f56: 00015597 auipc a1,0x15 + 80015f5a: f1a58593 addi a1,a1,-230 # 8002ae70 <.L__unnamed_81> + 80015f5e: ffffa097 auipc ra,0xffffa + 80015f62: 832080e7 jalr -1998(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80015f66: ec2a sd a0,24(sp) + 80015f68: a009 j 80015f6a <.LBB33_12+0x14> + 80015f6a: 75a2 ld a1,40(sp) + 80015f6c: 7542 ld a0,48(sp) + 80015f6e: 6662 ld a2,24(sp) + 80015f70: fd32 sd a2,184(sp) + let pgt = unsafe { &mut *task.pagetable }; + 80015f72: 6e10 ld a2,24(a2) + 80015f74: e432 sd a2,8(sp) + 80015f76: e1b2 sd a2,192(sp) + if pgt.copy_in_str(buf.as_mut_ptr(), addr, max_len).is_err() { + 80015f78: 0000a097 auipc ra,0xa + 80015f7c: 4e4080e7 jalr 1252(ra) # 8002045c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h69a6648c691317bcE> + 80015f80: e82a sd a0,16(sp) + 80015f82: a009 j 80015f84 <.LBB33_12+0x2e> + 80015f84: 7682 ld a3,32(sp) + 80015f86: 7662 ld a2,56(sp) + 80015f88: 65c2 ld a1,16(sp) + 80015f8a: 6522 ld a0,8(sp) + 80015f8c: 00003097 auipc ra,0x3 + 80015f90: e60080e7 jalr -416(ra) # 80018dec <_ZN6kernel6memory7mapping10page_table9PageTable11copy_in_str17hce5a6c8720f87e9cE> + 80015f94: e8aa sd a0,80(sp) + 80015f96: ecae sd a1,88(sp) + 80015f98: a009 j 80015f9a <.LBB33_12+0x44> + 80015f9a: 0888 addi a0,sp,80 + 80015f9c: ffff7097 auipc ra,0xffff7 + 80015fa0: 6dc080e7 jalr 1756(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 80015fa4: e02a sd a0,0(sp) + 80015fa6: a009 j 80015fa8 <.LBB33_12+0x52> + 80015fa8: 6502 ld a0,0(sp) + 80015faa: 4581 li a1,0 + 80015fac: 02b50363 beq a0,a1,80015fd2 <.LBB33_14+0x18> + 80015fb0: a009 j 80015fb2 <.LBB33_13> + +0000000080015fb2 <.LBB33_13>: + println!("Fail to copy in str"); + 80015fb2: 00015597 auipc a1,0x15 + 80015fb6: eee58593 addi a1,a1,-274 # 8002aea0 <.L__unnamed_82> + +0000000080015fba <.LBB33_14>: + 80015fba: 00015697 auipc a3,0x15 + 80015fbe: b8668693 addi a3,a3,-1146 # 8002ab40 <.L__unnamed_139> + 80015fc2: 1088 addi a0,sp,96 + 80015fc4: 4605 li a2,1 + 80015fc6: 4701 li a4,0 + 80015fc8: fffef097 auipc ra,0xfffef + 80015fcc: 5c2080e7 jalr 1474(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80015fd0: a029 j 80015fda <.LBB33_14+0x20> + 80015fd2: 4501 li a0,0 + return Err(()) + } + Ok(()) + 80015fd4: 04a107a3 sb a0,79(sp) + } + 80015fd8: a819 j 80015fee <.LBB33_14+0x34> + 80015fda: 1088 addi a0,sp,96 + println!("Fail to copy in str"); + 80015fdc: 00009097 auipc ra,0x9 + 80015fe0: c1c080e7 jalr -996(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80015fe4: a009 j 80015fe6 <.LBB33_14+0x2c> + 80015fe6: 4505 li a0,1 + return Err(()) + 80015fe8: 04a107a3 sb a0,79(sp) + } + 80015fec: a009 j 80015fee <.LBB33_14+0x34> + 80015fee: 04f14503 lbu a0,79(sp) + 80015ff2: 60ae ld ra,200(sp) + 80015ff4: 6169 addi sp,sp,208 + 80015ff6: 8082 ret + +Disassembly of section .text._ZN6kernel7syscall7Syscall14copy_form_addr17h37cb4654fc973487E: + +0000000080015ff8 <_ZN6kernel7syscall7Syscall14copy_form_addr17h37cb4654fc973487E>: + + pub fn copy_form_addr(&self, addr: usize, buf: &mut [u8], len: usize) -> Result<(), ()> { + 80015ff8: 7125 addi sp,sp,-416 + 80015ffa: ef06 sd ra,408(sp) + 80015ffc: ecba sd a4,88(sp) + 80015ffe: f0b6 sd a3,96(sp) + 80016000: f4b2 sd a2,104(sp) + 80016002: fcae sd a1,120(sp) + 80016004: eeaa sd a0,344(sp) + 80016006: f2b2 sd a2,352(sp) + 80016008: f6b6 sd a3,360(sp) + 8001600a: faba sd a4,368(sp) + +000000008001600c <.LBB34_26>: + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 8001600c: 00050517 auipc a0,0x50 + 80016010: 13450513 addi a0,a0,308 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80016014: ffffc097 auipc ra,0xffffc + 80016018: 444080e7 jalr 1092(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001601c: f8aa sd a0,112(sp) + 8001601e: a009 j 80016020 <.LBB34_26+0x14> + 80016020: 7546 ld a0,112(sp) + +0000000080016022 <.LBB34_27>: + 80016022: 00015597 auipc a1,0x15 + 80016026: e8e58593 addi a1,a1,-370 # 8002aeb0 <.L__unnamed_83> + 8001602a: ffff9097 auipc ra,0xffff9 + 8001602e: 766080e7 jalr 1894(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80016032: e8aa sd a0,80(sp) + 80016034: a009 j 80016036 <.LBB34_27+0x14> + 80016036: 6546 ld a0,80(sp) + 80016038: feaa sd a0,376(sp) + + if addr > task.size || addr + size_of::() > task.size { + 8001603a: 75e6 ld a1,120(sp) + 8001603c: 6908 ld a0,16(a0) + 8001603e: 00b57b63 bgeu a0,a1,80016054 <.LBB34_27+0x32> + 80016042: a009 j 80016044 <.LBB34_27+0x22> + 80016044: 4505 li a0,1 + 80016046: 08a103a3 sb a0,135(sp) + 8001604a: a801 j 8001605a <.LBB34_27+0x38> + 8001604c: 4501 li a0,0 + 8001604e: 08a103a3 sb a0,135(sp) + 80016052: a021 j 8001605a <.LBB34_27+0x38> + 80016054: 7566 ld a0,120(sp) + 80016056: e4aa sd a0,72(sp) + 80016058: a031 j 80016064 <.LBB34_27+0x42> + 8001605a: 08714503 lbu a0,135(sp) + 8001605e: 8905 andi a0,a0,1 + 80016060: ed19 bnez a0,8001607e <.LBB34_27+0x5c> + 80016062: a825 j 8001609a <.LBB34_28+0x16> + 80016064: 65a6 ld a1,72(sp) + 80016066: 00858513 addi a0,a1,8 + 8001606a: e0aa sd a0,64(sp) + 8001606c: 14b56963 bltu a0,a1,800161be <.LBB34_36> + 80016070: a009 j 80016072 <.LBB34_27+0x50> + 80016072: 6586 ld a1,64(sp) + 80016074: 6546 ld a0,80(sp) + 80016076: 6908 ld a0,16(a0) + 80016078: fcb566e3 bltu a0,a1,80016044 <.LBB34_27+0x22> + 8001607c: bfc1 j 8001604c <.LBB34_27+0x2a> + 8001607e: 18a8 addi a0,sp,120 + println!("[Debug] addr: 0x{:x}", addr); + 80016080: e5aa sd a0,200(sp) + 80016082: e32a sd a0,384(sp) + +0000000080016084 <.LBB34_28>: + 80016084: 0000f597 auipc a1,0xf + 80016088: 1fe58593 addi a1,a1,510 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 8001608c: 0000a097 auipc ra,0xa + 80016090: 4e2080e7 jalr 1250(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80016094: f82a sd a0,48(sp) + 80016096: fc2e sd a1,56(sp) + 80016098: a829 j 800160b2 <.LBB34_28+0x2e> + println!("[Debug] task size: 0x{:x}", task.size); + panic!("拷贝的地址值超出了进程") + } + + let pgt = unsafe { &mut *task.pagetable }; + 8001609a: 7586 ld a1,96(sp) + 8001609c: 7526 ld a0,104(sp) + 8001609e: 6646 ld a2,80(sp) + 800160a0: 6e10 ld a2,24(a2) + 800160a2: f032 sd a2,32(sp) + 800160a4: eb32 sd a2,400(sp) + if pgt.copy_in(buf.as_mut_ptr(), addr, len).is_err() { + 800160a6: 0000a097 auipc ra,0xa + 800160aa: 3b6080e7 jalr 950(ra) # 8002045c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h69a6648c691317bcE> + 800160ae: f42a sd a0,40(sp) + 800160b0: a869 j 8001614a <.LBB34_33+0x16> + println!("[Debug] addr: 0x{:x}", addr); + 800160b2: 7562 ld a0,56(sp) + 800160b4: 75c2 ld a1,48(sp) + 800160b6: fd2e sd a1,184(sp) + 800160b8: e1aa sd a0,192(sp) + +00000000800160ba <.LBB34_29>: + 800160ba: 00015597 auipc a1,0x15 + 800160be: e2658593 addi a1,a1,-474 # 8002aee0 <.L__unnamed_84> + 800160c2: 0128 addi a0,sp,136 + 800160c4: 4609 li a2,2 + 800160c6: 1934 addi a3,sp,184 + 800160c8: 4705 li a4,1 + 800160ca: fffef097 auipc ra,0xfffef + 800160ce: 4c0080e7 jalr 1216(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800160d2: a009 j 800160d4 <.LBB34_29+0x1a> + 800160d4: 0128 addi a0,sp,136 + 800160d6: 00009097 auipc ra,0x9 + 800160da: b22080e7 jalr -1246(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800160de: a009 j 800160e0 <.LBB34_29+0x26> + println!("[Debug] task size: 0x{:x}", task.size); + 800160e0: 6546 ld a0,80(sp) + 800160e2: 0541 addi a0,a0,16 + 800160e4: ea2a sd a0,272(sp) + 800160e6: e72a sd a0,392(sp) + +00000000800160e8 <.LBB34_30>: + 800160e8: 0000f597 auipc a1,0xf + 800160ec: 19a58593 addi a1,a1,410 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 800160f0: 0000a097 auipc ra,0xa + 800160f4: 47e080e7 jalr 1150(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800160f8: e82a sd a0,16(sp) + 800160fa: ec2e sd a1,24(sp) + 800160fc: a009 j 800160fe <.LBB34_30+0x16> + 800160fe: 6562 ld a0,24(sp) + 80016100: 65c2 ld a1,16(sp) + 80016102: e22e sd a1,256(sp) + 80016104: e62a sd a0,264(sp) + +0000000080016106 <.LBB34_31>: + 80016106: 00015597 auipc a1,0x15 + 8001610a: e1258593 addi a1,a1,-494 # 8002af18 <.L__unnamed_85> + 8001610e: 0988 addi a0,sp,208 + 80016110: 4609 li a2,2 + 80016112: 0214 addi a3,sp,256 + 80016114: 4705 li a4,1 + 80016116: fffef097 auipc ra,0xfffef + 8001611a: 474080e7 jalr 1140(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001611e: a009 j 80016120 <.LBB34_31+0x1a> + 80016120: 0988 addi a0,sp,208 + 80016122: 00009097 auipc ra,0x9 + 80016126: ad6080e7 jalr -1322(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001612a: a009 j 8001612c <.LBB34_32> + +000000008001612c <.LBB34_32>: + panic!("拷贝的地址值超出了进程") + 8001612c: 00015517 auipc a0,0x15 + 80016130: e0c50513 addi a0,a0,-500 # 8002af38 <.L__unnamed_86> + +0000000080016134 <.LBB34_33>: + 80016134: 00015617 auipc a2,0x15 + 80016138: e2c60613 addi a2,a2,-468 # 8002af60 <.L__unnamed_87> + 8001613c: 02100593 li a1,33 + 80016140: 0000d097 auipc ra,0xd + 80016144: 004080e7 jalr 4(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80016148: 0000 unimp + if pgt.copy_in(buf.as_mut_ptr(), addr, len).is_err() { + 8001614a: 66e6 ld a3,88(sp) + 8001614c: 75a2 ld a1,40(sp) + 8001614e: 7502 ld a0,32(sp) + 80016150: 7666 ld a2,120(sp) + 80016152: 00003097 auipc ra,0x3 + 80016156: a5c080e7 jalr -1444(ra) # 80018bae <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E> + 8001615a: ee2a sd a0,280(sp) + 8001615c: f22e sd a1,288(sp) + 8001615e: a009 j 80016160 <.LBB34_33+0x2c> + 80016160: 0a28 addi a0,sp,280 + 80016162: ffff7097 auipc ra,0xffff7 + 80016166: 516080e7 jalr 1302(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8001616a: e42a sd a0,8(sp) + 8001616c: a009 j 8001616e <.LBB34_33+0x3a> + 8001616e: 6522 ld a0,8(sp) + 80016170: 4581 li a1,0 + 80016172: 02b50363 beq a0,a1,80016198 <.LBB34_35+0x18> + 80016176: a009 j 80016178 <.LBB34_34> + +0000000080016178 <.LBB34_34>: + println!("Fail copy data from pagetable!"); + 80016178: 00015597 auipc a1,0x15 + 8001617c: e2058593 addi a1,a1,-480 # 8002af98 <.L__unnamed_88> + +0000000080016180 <.LBB34_35>: + 80016180: 00015697 auipc a3,0x15 + 80016184: 9c068693 addi a3,a3,-1600 # 8002ab40 <.L__unnamed_139> + 80016188: 1228 addi a0,sp,296 + 8001618a: 4605 li a2,1 + 8001618c: 4701 li a4,0 + 8001618e: fffef097 auipc ra,0xfffef + 80016192: 3fc080e7 jalr 1020(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80016196: a029 j 800161a0 <.LBB34_35+0x20> + 80016198: 4501 li a0,0 + return Err(()) + } + + + Ok(()) + 8001619a: 08a10323 sb a0,134(sp) + } + 8001619e: a819 j 800161b4 <.LBB34_35+0x34> + 800161a0: 1228 addi a0,sp,296 + println!("Fail copy data from pagetable!"); + 800161a2: 00009097 auipc ra,0x9 + 800161a6: a56080e7 jalr -1450(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800161aa: a009 j 800161ac <.LBB34_35+0x2c> + 800161ac: 4505 li a0,1 + return Err(()) + 800161ae: 08a10323 sb a0,134(sp) + } + 800161b2: a009 j 800161b4 <.LBB34_35+0x34> + 800161b4: 08614503 lbu a0,134(sp) + 800161b8: 60fa ld ra,408(sp) + 800161ba: 611d addi sp,sp,416 + 800161bc: 8082 ret + +00000000800161be <.LBB34_36>: + if addr > task.size || addr + size_of::() > task.size { + 800161be: 00014517 auipc a0,0x14 + 800161c2: 59250513 addi a0,a0,1426 # 8002a750 + +00000000800161c6 <.LBB34_37>: + 800161c6: 00015617 auipc a2,0x15 + 800161ca: d0260613 addi a2,a2,-766 # 8002aec8 <.L__unnamed_89> + 800161ce: 45f1 li a1,28 + 800161d0: 0000d097 auipc ra,0xd + 800161d4: f74080e7 jalr -140(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7syscall15kernel_env_call17h9e1a25b47e8ef67bE: + +00000000800161da <_ZN6kernel7syscall15kernel_env_call17h9e1a25b47e8ef67bE>: +} + +#[inline] +pub fn kernel_env_call( + 800161da: 7139 addi sp,sp,-64 + 800161dc: e036 sd a3,0(sp) + 800161de: 86b2 mv a3,a2 + 800161e0: 6602 ld a2,0(sp) + 800161e2: e436 sd a3,8(sp) + 800161e4: 86ae mv a3,a1 + 800161e6: 65a2 ld a1,8(sp) + 800161e8: e836 sd a3,16(sp) + 800161ea: 88aa mv a7,a0 + 800161ec: 6542 ld a0,16(sp) + 800161ee: f046 sd a7,32(sp) + 800161f0: f42a sd a0,40(sp) + 800161f2: f82e sd a1,48(sp) + 800161f4: fc32 sd a2,56(sp) + arg1: usize, + arg2: usize, +) -> usize { + let mut ret; + unsafe { + llvm_asm!("ecall" + 800161f6: 00000073 ecall + 800161fa: ec2a sd a0,24(sp) + : "memory" + : "volatile" + ); + } + ret +} + 800161fc: 6121 addi sp,sp,64 + 800161fe: 8082 ret + +Disassembly of section .text._ZN63_$LT$kernel..syscall..SysCallID$u20$as$u20$core..fmt..Debug$GT$3fmt17h1e62a6c91d257ea0E: + +0000000080016200 <_ZN63_$LT$kernel..syscall..SysCallID$u20$as$u20$core..fmt..Debug$GT$3fmt17h1e62a6c91d257ea0E>: +#[derive(Debug)] + 80016200: b8010113 addi sp,sp,-1152 + 80016204: 46113c23 sd ra,1144(sp) + 80016208: e42e sd a1,8(sp) + 8001620a: 34a13c23 sd a0,856(sp) + 8001620e: 36b13023 sd a1,864(sp) + 80016212: f02a sd a0,32(sp) + 80016214: 6108 ld a0,0(a0) + 80016216: 157d addi a0,a0,-1 + 80016218: e82a sd a0,16(sp) + 8001621a: 6542 ld a0,16(sp) + 8001621c: 050e slli a0,a0,0x3 + +000000008001621e <.LBB36_72>: + 8001621e: 00014597 auipc a1,0x14 + 80016222: 04a58593 addi a1,a1,74 # 8002a268 <.LJTI36_0> + 80016226: 952e add a0,a0,a1 + 80016228: 6108 ld a0,0(a0) + 8001622a: 8502 jr a0 + +000000008001622c <.LBB36_2>: + 8001622c: 65a2 ld a1,8(sp) + +000000008001622e <.LBB36_73>: + 8001622e: 00015617 auipc a2,0x15 + 80016232: d7a60613 addi a2,a2,-646 # 8002afa8 <.L__unnamed_90> + 80016236: 0688 addi a0,sp,832 + 80016238: 469d li a3,7 + 8001623a: 0000e097 auipc ra,0xe + 8001623e: e88080e7 jalr -376(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016242: ab45 j 800167f2 <.LBB36_106+0x2a> + +0000000080016244 <.LBB36_3>: + ... + +0000000080016246 <.LBB36_4>: + 80016246: 65a2 ld a1,8(sp) + +0000000080016248 <.LBB36_74>: + 80016248: 00015617 auipc a2,0x15 + 8001624c: e2860613 addi a2,a2,-472 # 8002b070 <.L__unnamed_91> + 80016250: 1028 addi a0,sp,40 + 80016252: 469d li a3,7 + 80016254: 0000e097 auipc ra,0xe + 80016258: e6e080e7 jalr -402(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001625c: a009 j 8001625e <.LBB36_74+0x16> + 8001625e: 1028 addi a0,sp,40 + 80016260: 46a13823 sd a0,1136(sp) + 80016264: 0000d097 auipc ra,0xd + 80016268: 4b6080e7 jalr 1206(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001626c: 00a10fa3 sb a0,31(sp) + 80016270: ab59 j 80016806 <.LBB36_106+0x3e> + +0000000080016272 <.LBB36_6>: + 80016272: 65a2 ld a1,8(sp) + +0000000080016274 <.LBB36_75>: + 80016274: 00015617 auipc a2,0x15 + 80016278: df560613 addi a2,a2,-523 # 8002b069 <.L__unnamed_92> + 8001627c: 0088 addi a0,sp,64 + 8001627e: 469d li a3,7 + 80016280: 0000e097 auipc ra,0xe + 80016284: e42080e7 jalr -446(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016288: a009 j 8001628a <.LBB36_75+0x16> + 8001628a: 0088 addi a0,sp,64 + 8001628c: 46a13423 sd a0,1128(sp) + 80016290: 0000d097 auipc ra,0xd + 80016294: 48a080e7 jalr 1162(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016298: 00a10fa3 sb a0,31(sp) + 8001629c: a3ad j 80016806 <.LBB36_106+0x3e> + +000000008001629e <.LBB36_8>: + 8001629e: 65a2 ld a1,8(sp) + +00000000800162a0 <.LBB36_76>: + 800162a0: 00015617 auipc a2,0x15 + 800162a4: dc260613 addi a2,a2,-574 # 8002b062 <.L__unnamed_93> + 800162a8: 08a8 addi a0,sp,88 + 800162aa: 469d li a3,7 + 800162ac: 0000e097 auipc ra,0xe + 800162b0: e16080e7 jalr -490(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800162b4: a009 j 800162b6 <.LBB36_76+0x16> + 800162b6: 08a8 addi a0,sp,88 + 800162b8: 46a13023 sd a0,1120(sp) + 800162bc: 0000d097 auipc ra,0xd + 800162c0: 45e080e7 jalr 1118(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800162c4: 00a10fa3 sb a0,31(sp) + 800162c8: ab3d j 80016806 <.LBB36_106+0x3e> + +00000000800162ca <.LBB36_10>: + 800162ca: 65a2 ld a1,8(sp) + +00000000800162cc <.LBB36_77>: + 800162cc: 00015617 auipc a2,0x15 + 800162d0: d8f60613 addi a2,a2,-625 # 8002b05b <.L__unnamed_94> + 800162d4: 1888 addi a0,sp,112 + 800162d6: 469d li a3,7 + 800162d8: 0000e097 auipc ra,0xe + 800162dc: dea080e7 jalr -534(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800162e0: a009 j 800162e2 <.LBB36_77+0x16> + 800162e2: 1888 addi a0,sp,112 + 800162e4: 44a13c23 sd a0,1112(sp) + 800162e8: 0000d097 auipc ra,0xd + 800162ec: 432080e7 jalr 1074(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800162f0: 00a10fa3 sb a0,31(sp) + 800162f4: ab09 j 80016806 <.LBB36_106+0x3e> + +00000000800162f6 <.LBB36_12>: + 800162f6: 65a2 ld a1,8(sp) + +00000000800162f8 <.LBB36_78>: + 800162f8: 00015617 auipc a2,0x15 + 800162fc: d5c60613 addi a2,a2,-676 # 8002b054 <.L__unnamed_95> + 80016300: 0128 addi a0,sp,136 + 80016302: 469d li a3,7 + 80016304: 0000e097 auipc ra,0xe + 80016308: dbe080e7 jalr -578(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001630c: a009 j 8001630e <.LBB36_78+0x16> + 8001630e: 0128 addi a0,sp,136 + 80016310: 44a13823 sd a0,1104(sp) + 80016314: 0000d097 auipc ra,0xd + 80016318: 406080e7 jalr 1030(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001631c: 00a10fa3 sb a0,31(sp) + 80016320: a1dd j 80016806 <.LBB36_106+0x3e> + +0000000080016322 <.LBB36_14>: + 80016322: 65a2 ld a1,8(sp) + +0000000080016324 <.LBB36_79>: + 80016324: 00015617 auipc a2,0x15 + 80016328: d2960613 addi a2,a2,-727 # 8002b04d <.L__unnamed_96> + 8001632c: 1108 addi a0,sp,160 + 8001632e: 469d li a3,7 + 80016330: 0000e097 auipc ra,0xe + 80016334: d92080e7 jalr -622(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016338: a009 j 8001633a <.LBB36_79+0x16> + 8001633a: 1108 addi a0,sp,160 + 8001633c: 44a13423 sd a0,1096(sp) + 80016340: 0000d097 auipc ra,0xd + 80016344: 3da080e7 jalr 986(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016348: 00a10fa3 sb a0,31(sp) + 8001634c: a96d j 80016806 <.LBB36_106+0x3e> + +000000008001634e <.LBB36_16>: + 8001634e: 65a2 ld a1,8(sp) + +0000000080016350 <.LBB36_80>: + 80016350: 00015617 auipc a2,0x15 + 80016354: cf660613 addi a2,a2,-778 # 8002b046 <.L__unnamed_97> + 80016358: 1928 addi a0,sp,184 + 8001635a: 469d li a3,7 + 8001635c: 0000e097 auipc ra,0xe + 80016360: d66080e7 jalr -666(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016364: a009 j 80016366 <.LBB36_80+0x16> + 80016366: 1928 addi a0,sp,184 + 80016368: 44a13023 sd a0,1088(sp) + 8001636c: 0000d097 auipc ra,0xd + 80016370: 3ae080e7 jalr 942(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016374: 00a10fa3 sb a0,31(sp) + 80016378: a179 j 80016806 <.LBB36_106+0x3e> + +000000008001637a <.LBB36_18>: + 8001637a: 65a2 ld a1,8(sp) + +000000008001637c <.LBB36_81>: + 8001637c: 00011617 auipc a2,0x11 + 80016380: 47c60613 addi a2,a2,1148 # 800277f8 <.L__unnamed_6+0x68> + 80016384: 0988 addi a0,sp,208 + 80016386: 46a1 li a3,8 + 80016388: 0000e097 auipc ra,0xe + 8001638c: d3a080e7 jalr -710(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016390: a009 j 80016392 <.LBB36_81+0x16> + 80016392: 0988 addi a0,sp,208 + 80016394: 42a13c23 sd a0,1080(sp) + 80016398: 0000d097 auipc ra,0xd + 8001639c: 382080e7 jalr 898(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800163a0: 00a10fa3 sb a0,31(sp) + 800163a4: a18d j 80016806 <.LBB36_106+0x3e> + +00000000800163a6 <.LBB36_20>: + 800163a6: 65a2 ld a1,8(sp) + +00000000800163a8 <.LBB36_82>: + 800163a8: 00011617 auipc a2,0x11 + 800163ac: 43060613 addi a2,a2,1072 # 800277d8 <.L__unnamed_6+0x48> + 800163b0: 11a8 addi a0,sp,232 + 800163b2: 46a1 li a3,8 + 800163b4: 0000e097 auipc ra,0xe + 800163b8: d0e080e7 jalr -754(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800163bc: a009 j 800163be <.LBB36_82+0x16> + 800163be: 11a8 addi a0,sp,232 + 800163c0: 42a13823 sd a0,1072(sp) + 800163c4: 0000d097 auipc ra,0xd + 800163c8: 356080e7 jalr 854(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800163cc: 00a10fa3 sb a0,31(sp) + 800163d0: a91d j 80016806 <.LBB36_106+0x3e> + +00000000800163d2 <.LBB36_22>: + 800163d2: 65a2 ld a1,8(sp) + +00000000800163d4 <.LBB36_83>: + 800163d4: 00015617 auipc a2,0x15 + 800163d8: c6c60613 addi a2,a2,-916 # 8002b040 <.L__unnamed_100> + 800163dc: 0208 addi a0,sp,256 + 800163de: 4699 li a3,6 + 800163e0: 0000e097 auipc ra,0xe + 800163e4: ce2080e7 jalr -798(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800163e8: a009 j 800163ea <.LBB36_83+0x16> + 800163ea: 0208 addi a0,sp,256 + 800163ec: 42a13423 sd a0,1064(sp) + 800163f0: 0000d097 auipc ra,0xd + 800163f4: 32a080e7 jalr 810(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800163f8: 00a10fa3 sb a0,31(sp) + 800163fc: a129 j 80016806 <.LBB36_106+0x3e> + +00000000800163fe <.LBB36_24>: + 800163fe: 65a2 ld a1,8(sp) + +0000000080016400 <.LBB36_84>: + 80016400: 00015617 auipc a2,0x15 + 80016404: c3760613 addi a2,a2,-969 # 8002b037 <.L__unnamed_101> + 80016408: 0a28 addi a0,sp,280 + 8001640a: 46a5 li a3,9 + 8001640c: 0000e097 auipc ra,0xe + 80016410: cb6080e7 jalr -842(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016414: a009 j 80016416 <.LBB36_84+0x16> + 80016416: 0a28 addi a0,sp,280 + 80016418: 42a13023 sd a0,1056(sp) + 8001641c: 0000d097 auipc ra,0xd + 80016420: 2fe080e7 jalr 766(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016424: 00a10fa3 sb a0,31(sp) + 80016428: aef9 j 80016806 <.LBB36_106+0x3e> + +000000008001642a <.LBB36_26>: + 8001642a: 65a2 ld a1,8(sp) + +000000008001642c <.LBB36_85>: + 8001642c: 00015617 auipc a2,0x15 + 80016430: c0460613 addi a2,a2,-1020 # 8002b030 <.L__unnamed_102> + 80016434: 1a08 addi a0,sp,304 + 80016436: 469d li a3,7 + 80016438: 0000e097 auipc ra,0xe + 8001643c: c8a080e7 jalr -886(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016440: a009 j 80016442 <.LBB36_85+0x16> + 80016442: 1a08 addi a0,sp,304 + 80016444: 40a13c23 sd a0,1048(sp) + 80016448: 0000d097 auipc ra,0xd + 8001644c: 2d2080e7 jalr 722(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016450: 00a10fa3 sb a0,31(sp) + 80016454: ae4d j 80016806 <.LBB36_106+0x3e> + +0000000080016456 <.LBB36_28>: + 80016456: 65a2 ld a1,8(sp) + +0000000080016458 <.LBB36_86>: + 80016458: 00011617 auipc a2,0x11 + 8001645c: 3e860613 addi a2,a2,1000 # 80027840 <.L__unnamed_6+0xb0> + 80016460: 02a8 addi a0,sp,328 + 80016462: 46a1 li a3,8 + 80016464: 0000e097 auipc ra,0xe + 80016468: c5e080e7 jalr -930(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001646c: a009 j 8001646e <.LBB36_86+0x16> + 8001646e: 02a8 addi a0,sp,328 + 80016470: 40a13823 sd a0,1040(sp) + 80016474: 0000d097 auipc ra,0xd + 80016478: 2a6080e7 jalr 678(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001647c: 00a10fa3 sb a0,31(sp) + 80016480: a659 j 80016806 <.LBB36_106+0x3e> + +0000000080016482 <.LBB36_30>: + 80016482: 65a2 ld a1,8(sp) + +0000000080016484 <.LBB36_87>: + 80016484: 00015617 auipc a2,0x15 + 80016488: ba360613 addi a2,a2,-1117 # 8002b027 <.L__unnamed_104> + 8001648c: 1288 addi a0,sp,352 + 8001648e: 46a5 li a3,9 + 80016490: 0000e097 auipc ra,0xe + 80016494: c32080e7 jalr -974(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016498: a009 j 8001649a <.LBB36_87+0x16> + 8001649a: 1288 addi a0,sp,352 + 8001649c: 40a13423 sd a0,1032(sp) + 800164a0: 0000d097 auipc ra,0xd + 800164a4: 27a080e7 jalr 634(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800164a8: 00a10fa3 sb a0,31(sp) + 800164ac: aea9 j 80016806 <.LBB36_106+0x3e> + +00000000800164ae <.LBB36_32>: + 800164ae: 65a2 ld a1,8(sp) + +00000000800164b0 <.LBB36_88>: + 800164b0: 00015617 auipc a2,0x15 + 800164b4: b7060613 addi a2,a2,-1168 # 8002b020 <.L__unnamed_105> + 800164b8: 1aa8 addi a0,sp,376 + 800164ba: 469d li a3,7 + 800164bc: 0000e097 auipc ra,0xe + 800164c0: c06080e7 jalr -1018(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800164c4: a009 j 800164c6 <.LBB36_88+0x16> + 800164c6: 1aa8 addi a0,sp,376 + 800164c8: 40a13023 sd a0,1024(sp) + 800164cc: 0000d097 auipc ra,0xd + 800164d0: 24e080e7 jalr 590(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800164d4: 00a10fa3 sb a0,31(sp) + 800164d8: a63d j 80016806 <.LBB36_106+0x3e> + +00000000800164da <.LBB36_34>: + 800164da: 65a2 ld a1,8(sp) + +00000000800164dc <.LBB36_89>: + 800164dc: 00011617 auipc a2,0x11 + 800164e0: 34c60613 addi a2,a2,844 # 80027828 <.L__unnamed_6+0x98> + 800164e4: 0b08 addi a0,sp,400 + 800164e6: 46a1 li a3,8 + 800164e8: 0000e097 auipc ra,0xe + 800164ec: bda080e7 jalr -1062(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800164f0: a009 j 800164f2 <.LBB36_89+0x16> + 800164f2: 0b08 addi a0,sp,400 + 800164f4: 3ea13c23 sd a0,1016(sp) + 800164f8: 0000d097 auipc ra,0xd + 800164fc: 222080e7 jalr 546(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016500: 00a10fa3 sb a0,31(sp) + 80016504: a609 j 80016806 <.LBB36_106+0x3e> + +0000000080016506 <.LBB36_36>: + 80016506: 65a2 ld a1,8(sp) + +0000000080016508 <.LBB36_90>: + 80016508: 00011617 auipc a2,0x11 + 8001650c: 2c060613 addi a2,a2,704 # 800277c8 <.L__unnamed_6+0x38> + 80016510: 1328 addi a0,sp,424 + 80016512: 46a1 li a3,8 + 80016514: 0000e097 auipc ra,0xe + 80016518: bae080e7 jalr -1106(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001651c: a009 j 8001651e <.LBB36_90+0x16> + 8001651e: 1328 addi a0,sp,424 + 80016520: 3ea13823 sd a0,1008(sp) + 80016524: 0000d097 auipc ra,0xd + 80016528: 1f6080e7 jalr 502(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001652c: 00a10fa3 sb a0,31(sp) + 80016530: acd9 j 80016806 <.LBB36_106+0x3e> + +0000000080016532 <.LBB36_38>: + 80016532: 65a2 ld a1,8(sp) + +0000000080016534 <.LBB36_91>: + 80016534: 00015617 auipc a2,0x15 + 80016538: ae360613 addi a2,a2,-1309 # 8002b017 <.L__unnamed_108> + 8001653c: 0388 addi a0,sp,448 + 8001653e: 46a5 li a3,9 + 80016540: 0000e097 auipc ra,0xe + 80016544: b82080e7 jalr -1150(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016548: a009 j 8001654a <.LBB36_91+0x16> + 8001654a: 0388 addi a0,sp,448 + 8001654c: 3ea13423 sd a0,1000(sp) + 80016550: 0000d097 auipc ra,0xd + 80016554: 1ca080e7 jalr 458(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016558: 00a10fa3 sb a0,31(sp) + 8001655c: a46d j 80016806 <.LBB36_106+0x3e> + +000000008001655e <.LBB36_40>: + 8001655e: 65a2 ld a1,8(sp) + +0000000080016560 <.LBB36_92>: + 80016560: 00015617 auipc a2,0x15 + 80016564: ab060613 addi a2,a2,-1360 # 8002b010 <.L__unnamed_109> + 80016568: 0ba8 addi a0,sp,472 + 8001656a: 469d li a3,7 + 8001656c: 0000e097 auipc ra,0xe + 80016570: b56080e7 jalr -1194(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016574: a009 j 80016576 <.LBB36_92+0x16> + 80016576: 0ba8 addi a0,sp,472 + 80016578: 3ea13023 sd a0,992(sp) + 8001657c: 0000d097 auipc ra,0xd + 80016580: 19e080e7 jalr 414(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016584: 00a10fa3 sb a0,31(sp) + 80016588: acbd j 80016806 <.LBB36_106+0x3e> + +000000008001658a <.LBB36_42>: + 8001658a: 65a2 ld a1,8(sp) + +000000008001658c <.LBB36_93>: + 8001658c: 00011617 auipc a2,0x11 + 80016590: 23460613 addi a2,a2,564 # 800277c0 <.L__unnamed_6+0x30> + 80016594: 1b88 addi a0,sp,496 + 80016596: 46a1 li a3,8 + 80016598: 0000e097 auipc ra,0xe + 8001659c: b2a080e7 jalr -1238(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800165a0: a009 j 800165a2 <.LBB36_93+0x16> + 800165a2: 1b88 addi a0,sp,496 + 800165a4: 3ca13c23 sd a0,984(sp) + 800165a8: 0000d097 auipc ra,0xd + 800165ac: 172080e7 jalr 370(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800165b0: 00a10fa3 sb a0,31(sp) + 800165b4: ac89 j 80016806 <.LBB36_106+0x3e> + +00000000800165b6 <.LBB36_44>: + 800165b6: 65a2 ld a1,8(sp) + +00000000800165b8 <.LBB36_94>: + 800165b8: 00011617 auipc a2,0x11 + 800165bc: 23860613 addi a2,a2,568 # 800277f0 <.L__unnamed_6+0x60> + 800165c0: 0428 addi a0,sp,520 + 800165c2: 46a1 li a3,8 + 800165c4: 0000e097 auipc ra,0xe + 800165c8: afe080e7 jalr -1282(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800165cc: a009 j 800165ce <.LBB36_94+0x16> + 800165ce: 0428 addi a0,sp,520 + 800165d0: 3ca13823 sd a0,976(sp) + 800165d4: 0000d097 auipc ra,0xd + 800165d8: 146080e7 jalr 326(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800165dc: 00a10fa3 sb a0,31(sp) + 800165e0: a41d j 80016806 <.LBB36_106+0x3e> + +00000000800165e2 <.LBB36_46>: + 800165e2: 65a2 ld a1,8(sp) + +00000000800165e4 <.LBB36_95>: + 800165e4: 00015617 auipc a2,0x15 + 800165e8: a2360613 addi a2,a2,-1501 # 8002b007 <.L__unnamed_112> + 800165ec: 1408 addi a0,sp,544 + 800165ee: 46a5 li a3,9 + 800165f0: 0000e097 auipc ra,0xe + 800165f4: ad2080e7 jalr -1326(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800165f8: a009 j 800165fa <.LBB36_95+0x16> + 800165fa: 1408 addi a0,sp,544 + 800165fc: 3ca13423 sd a0,968(sp) + 80016600: 0000d097 auipc ra,0xd + 80016604: 11a080e7 jalr 282(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016608: 00a10fa3 sb a0,31(sp) + 8001660c: aaed j 80016806 <.LBB36_106+0x3e> + +000000008001660e <.LBB36_48>: + 8001660e: 65a2 ld a1,8(sp) + +0000000080016610 <.LBB36_96>: + 80016610: 00015617 auipc a2,0x15 + 80016614: 9ee60613 addi a2,a2,-1554 # 8002affe <.L__unnamed_113> + 80016618: 1c28 addi a0,sp,568 + 8001661a: 46a5 li a3,9 + 8001661c: 0000e097 auipc ra,0xe + 80016620: aa6080e7 jalr -1370(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016624: a009 j 80016626 <.LBB36_96+0x16> + 80016626: 1c28 addi a0,sp,568 + 80016628: 3ca13023 sd a0,960(sp) + 8001662c: 0000d097 auipc ra,0xd + 80016630: 0ee080e7 jalr 238(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016634: 00a10fa3 sb a0,31(sp) + 80016638: a2f9 j 80016806 <.LBB36_106+0x3e> + +000000008001663a <.LBB36_50>: + 8001663a: 65a2 ld a1,8(sp) + +000000008001663c <.LBB36_97>: + 8001663c: 00011617 auipc a2,0x11 + 80016640: 1e460613 addi a2,a2,484 # 80027820 <.L__unnamed_6+0x90> + 80016644: 0c88 addi a0,sp,592 + 80016646: 46a1 li a3,8 + 80016648: 0000e097 auipc ra,0xe + 8001664c: a7a080e7 jalr -1414(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016650: a009 j 80016652 <.LBB36_97+0x16> + 80016652: 0c88 addi a0,sp,592 + 80016654: 3aa13c23 sd a0,952(sp) + 80016658: 0000d097 auipc ra,0xd + 8001665c: 0c2080e7 jalr 194(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016660: 00a10fa3 sb a0,31(sp) + 80016664: a24d j 80016806 <.LBB36_106+0x3e> + +0000000080016666 <.LBB36_52>: + 80016666: 65a2 ld a1,8(sp) + +0000000080016668 <.LBB36_98>: + 80016668: 00015617 auipc a2,0x15 + 8001666c: 98c60613 addi a2,a2,-1652 # 8002aff4 <.L__unnamed_115> + 80016670: 14a8 addi a0,sp,616 + 80016672: 46a9 li a3,10 + 80016674: 0000e097 auipc ra,0xe + 80016678: a4e080e7 jalr -1458(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001667c: a009 j 8001667e <.LBB36_98+0x16> + 8001667e: 14a8 addi a0,sp,616 + 80016680: 3aa13823 sd a0,944(sp) + 80016684: 0000d097 auipc ra,0xd + 80016688: 096080e7 jalr 150(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001668c: 00a10fa3 sb a0,31(sp) + 80016690: aa9d j 80016806 <.LBB36_106+0x3e> + +0000000080016692 <.LBB36_54>: + 80016692: 65a2 ld a1,8(sp) + +0000000080016694 <.LBB36_99>: + 80016694: 00015617 auipc a2,0x15 + 80016698: 95660613 addi a2,a2,-1706 # 8002afea <.L__unnamed_116> + 8001669c: 0508 addi a0,sp,640 + 8001669e: 46a9 li a3,10 + 800166a0: 0000e097 auipc ra,0xe + 800166a4: a22080e7 jalr -1502(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800166a8: a009 j 800166aa <.LBB36_99+0x16> + 800166aa: 0508 addi a0,sp,640 + 800166ac: 3aa13423 sd a0,936(sp) + 800166b0: 0000d097 auipc ra,0xd + 800166b4: 06a080e7 jalr 106(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800166b8: 00a10fa3 sb a0,31(sp) + 800166bc: a2a9 j 80016806 <.LBB36_106+0x3e> + +00000000800166be <.LBB36_56>: + 800166be: 65a2 ld a1,8(sp) + +00000000800166c0 <.LBB36_100>: + 800166c0: 00015617 auipc a2,0x15 + 800166c4: 92160613 addi a2,a2,-1759 # 8002afe1 <.L__unnamed_117> + 800166c8: 0d28 addi a0,sp,664 + 800166ca: 46a5 li a3,9 + 800166cc: 0000e097 auipc ra,0xe + 800166d0: 9f6080e7 jalr -1546(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800166d4: a009 j 800166d6 <.LBB36_100+0x16> + 800166d6: 0d28 addi a0,sp,664 + 800166d8: 3aa13023 sd a0,928(sp) + 800166dc: 0000d097 auipc ra,0xd + 800166e0: 03e080e7 jalr 62(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800166e4: 00a10fa3 sb a0,31(sp) + 800166e8: aa39 j 80016806 <.LBB36_106+0x3e> + +00000000800166ea <.LBB36_58>: + 800166ea: 65a2 ld a1,8(sp) + +00000000800166ec <.LBB36_101>: + 800166ec: 00015617 auipc a2,0x15 + 800166f0: 8eb60613 addi a2,a2,-1813 # 8002afd7 <.L__unnamed_118> + 800166f4: 1d08 addi a0,sp,688 + 800166f6: 46a9 li a3,10 + 800166f8: 0000e097 auipc ra,0xe + 800166fc: 9ca080e7 jalr -1590(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016700: a009 j 80016702 <.LBB36_101+0x16> + 80016702: 1d08 addi a0,sp,688 + 80016704: 38a13c23 sd a0,920(sp) + 80016708: 0000d097 auipc ra,0xd + 8001670c: 012080e7 jalr 18(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016710: 00a10fa3 sb a0,31(sp) + 80016714: a8cd j 80016806 <.LBB36_106+0x3e> + +0000000080016716 <.LBB36_60>: + 80016716: 65a2 ld a1,8(sp) + +0000000080016718 <.LBB36_102>: + 80016718: 00015617 auipc a2,0x15 + 8001671c: 8b560613 addi a2,a2,-1867 # 8002afcd <.L__unnamed_119> + 80016720: 05a8 addi a0,sp,712 + 80016722: 46a9 li a3,10 + 80016724: 0000e097 auipc ra,0xe + 80016728: 99e080e7 jalr -1634(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001672c: a009 j 8001672e <.LBB36_102+0x16> + 8001672e: 05a8 addi a0,sp,712 + 80016730: 38a13823 sd a0,912(sp) + 80016734: 0000d097 auipc ra,0xd + 80016738: fe6080e7 jalr -26(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001673c: 00a10fa3 sb a0,31(sp) + 80016740: a0d9 j 80016806 <.LBB36_106+0x3e> + +0000000080016742 <.LBB36_62>: + 80016742: 65a2 ld a1,8(sp) + +0000000080016744 <.LBB36_103>: + 80016744: 00015617 auipc a2,0x15 + 80016748: 87e60613 addi a2,a2,-1922 # 8002afc2 <.L__unnamed_120> + 8001674c: 1588 addi a0,sp,736 + 8001674e: 46ad li a3,11 + 80016750: 0000e097 auipc ra,0xe + 80016754: 972080e7 jalr -1678(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016758: a009 j 8001675a <.LBB36_103+0x16> + 8001675a: 1588 addi a0,sp,736 + 8001675c: 38a13423 sd a0,904(sp) + 80016760: 0000d097 auipc ra,0xd + 80016764: fba080e7 jalr -70(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016768: 00a10fa3 sb a0,31(sp) + 8001676c: a869 j 80016806 <.LBB36_106+0x3e> + +000000008001676e <.LBB36_64>: + 8001676e: 65a2 ld a1,8(sp) + +0000000080016770 <.LBB36_104>: + 80016770: 00015617 auipc a2,0x15 + 80016774: 84660613 addi a2,a2,-1978 # 8002afb6 <.L__unnamed_121> + 80016778: 1da8 addi a0,sp,760 + 8001677a: 46b1 li a3,12 + 8001677c: 0000e097 auipc ra,0xe + 80016780: 946080e7 jalr -1722(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80016784: a009 j 80016786 <.LBB36_104+0x16> + 80016786: 1da8 addi a0,sp,760 + 80016788: 38a13023 sd a0,896(sp) + 8001678c: 0000d097 auipc ra,0xd + 80016790: f8e080e7 jalr -114(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016794: 00a10fa3 sb a0,31(sp) + 80016798: a0bd j 80016806 <.LBB36_106+0x3e> + +000000008001679a <.LBB36_66>: + 8001679a: 65a2 ld a1,8(sp) + +000000008001679c <.LBB36_105>: + 8001679c: 00011617 auipc a2,0x11 + 800167a0: 0d460613 addi a2,a2,212 # 80027870 <.L__unnamed_6+0xe0> + 800167a4: 0e08 addi a0,sp,784 + 800167a6: 46a1 li a3,8 + 800167a8: 0000e097 auipc ra,0xe + 800167ac: 91a080e7 jalr -1766(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800167b0: a009 j 800167b2 <.LBB36_105+0x16> + 800167b2: 0e08 addi a0,sp,784 + 800167b4: 36a13c23 sd a0,888(sp) + 800167b8: 0000d097 auipc ra,0xd + 800167bc: f62080e7 jalr -158(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800167c0: 00a10fa3 sb a0,31(sp) + 800167c4: a089 j 80016806 <.LBB36_106+0x3e> + +00000000800167c6 <.LBB36_68>: + 800167c6: 65a2 ld a1,8(sp) + +00000000800167c8 <.LBB36_106>: + 800167c8: 00014617 auipc a2,0x14 + 800167cc: 7e760613 addi a2,a2,2023 # 8002afaf <.L__unnamed_123> + 800167d0: 1628 addi a0,sp,808 + 800167d2: 469d li a3,7 + 800167d4: 0000e097 auipc ra,0xe + 800167d8: 8ee080e7 jalr -1810(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800167dc: a009 j 800167de <.LBB36_106+0x16> + 800167de: 1628 addi a0,sp,808 + 800167e0: 36a13823 sd a0,880(sp) + 800167e4: 0000d097 auipc ra,0xd + 800167e8: f36080e7 jalr -202(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800167ec: 00a10fa3 sb a0,31(sp) + 800167f0: a819 j 80016806 <.LBB36_106+0x3e> + 800167f2: 0688 addi a0,sp,832 + 800167f4: 36a13423 sd a0,872(sp) + 800167f8: 0000d097 auipc ra,0xd + 800167fc: f22080e7 jalr -222(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80016800: 00a10fa3 sb a0,31(sp) + 80016804: a009 j 80016806 <.LBB36_106+0x3e> + 80016806: 01f14503 lbu a0,31(sp) + 8001680a: 47813083 ld ra,1144(sp) + 8001680e: 48010113 addi sp,sp,1152 + 80016812: 8082 ret + +Disassembly of section .text._ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h00cb4931a375be30E: + +0000000080016814 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h00cb4931a375be30E>: + fn from(t: T) -> T { + 80016814: 1141 addi sp,sp,-16 + 80016816: e02a sd a0,0(sp) + 80016818: e42e sd a1,8(sp) + } + 8001681a: 0141 addi sp,sp,16 + 8001681c: 8082 ret + +Disassembly of section .text._ZN4core5array103_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$B$u3b$$u20$N$u5d$$GT$$u20$for$u20$$u5b$A$u3b$$u20$N$u5d$$GT$2eq17h3cd1f867d341989fE: + +000000008001681e <_ZN4core5array103_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$B$u3b$$u20$N$u5d$$GT$$u20$for$u20$$u5b$A$u3b$$u20$N$u5d$$GT$2eq17h3cd1f867d341989fE>: +impl PartialEq<[B; N]> for [A; N] +where + A: PartialEq, +{ + #[inline] + fn eq(&self, other: &[B; N]) -> bool { + 8001681e: 715d addi sp,sp,-80 + 80016820: e486 sd ra,72(sp) + 80016822: f02e sd a1,32(sp) + 80016824: fc2a sd a0,56(sp) + 80016826: e0ae sd a1,64(sp) + +0000000080016828 <.LBB0_4>: + self[..] == other[..] + 80016828: 00015597 auipc a1,0x15 + 8001682c: 8d058593 addi a1,a1,-1840 # 8002b0f8 <.L__unnamed_1> + 80016830: 00000097 auipc ra,0x0 + 80016834: 042080e7 jalr 66(ra) # 80016872 <_ZN4core5array85_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u3b$$u20$N$u5d$$GT$5index17hb0840ea75acd5341E> + 80016838: f42a sd a0,40(sp) + 8001683a: f82e sd a1,48(sp) + 8001683c: a009 j 8001683e <.LBB0_4+0x16> + 8001683e: 7502 ld a0,32(sp) + +0000000080016840 <.LBB0_5>: + 80016840: 00015597 auipc a1,0x15 + 80016844: 8d058593 addi a1,a1,-1840 # 8002b110 <.L__unnamed_2> + 80016848: 00000097 auipc ra,0x0 + 8001684c: 02a080e7 jalr 42(ra) # 80016872 <_ZN4core5array85_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u3b$$u20$N$u5d$$GT$5index17hb0840ea75acd5341E> + 80016850: e82a sd a0,16(sp) + 80016852: ec2e sd a1,24(sp) + 80016854: a009 j 80016856 <.LBB0_5+0x16> + 80016856: 66e2 ld a3,24(sp) + 80016858: 6642 ld a2,16(sp) + 8001685a: 75c2 ld a1,48(sp) + 8001685c: 7522 ld a0,40(sp) + 8001685e: fffee097 auipc ra,0xfffee + 80016862: 408080e7 jalr 1032(ra) # 80004c66 <_ZN4core5slice3cmp81_$LT$impl$u20$core..cmp..PartialEq$LT$$u5b$B$u5d$$GT$$u20$for$u20$$u5b$A$u5d$$GT$2eq17hb066b813a10237c1E> + 80016866: e42a sd a0,8(sp) + 80016868: a009 j 8001686a <.LBB0_5+0x2a> + } + 8001686a: 6522 ld a0,8(sp) + 8001686c: 60a6 ld ra,72(sp) + 8001686e: 6161 addi sp,sp,80 + 80016870: 8082 ret + +Disassembly of section .text._ZN4core5array85_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u3b$$u20$N$u5d$$GT$5index17hb0840ea75acd5341E: + +0000000080016872 <_ZN4core5array85_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u3b$$u20$N$u5d$$GT$5index17hb0840ea75acd5341E>: + fn index(&self, index: I) -> &Self::Output { + 80016872: 7179 addi sp,sp,-48 + 80016874: f406 sd ra,40(sp) + 80016876: 862e mv a2,a1 + 80016878: ec2a sd a0,24(sp) + 8001687a: 45e1 li a1,24 + Index::index(self as &[T], index) + 8001687c: ffffb097 auipc ra,0xffffb + 80016880: 600080e7 jalr 1536(ra) # 80011e7c <_ZN4core5slice5index74_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$5index17h0c420969feecb596E> + 80016884: e42a sd a0,8(sp) + 80016886: e82e sd a1,16(sp) + 80016888: a009 j 8001688a <_ZN4core5array85_$LT$impl$u20$core..ops..index..Index$LT$I$GT$$u20$for$u20$$u5b$T$u3b$$u20$N$u5d$$GT$5index17hb0840ea75acd5341E+0x18> + } + 8001688a: 65c2 ld a1,16(sp) + 8001688c: 6522 ld a0,8(sp) + 8001688e: 70a2 ld ra,40(sp) + 80016890: 6145 addi sp,sp,48 + 80016892: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct13get_trapframe17h63d8e269c84e49aeE: + +0000000080016894 <_ZN6kernel7process7process11task_struct13get_trapframe17h63d8e269c84e49aeE>: + pub fn get_trapframe(&self) -> *mut Trapframe { + 80016894: 1141 addi sp,sp,-16 + 80016896: e42a sd a0,8(sp) + self.trapframe + 80016898: 7108 ld a0,32(a0) + } + 8001689a: 0141 addi sp,sp,16 + 8001689c: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct8set_name17h9731c8514bd185a5E: + +000000008001689e <_ZN6kernel7process7process11task_struct8set_name17h9731c8514bd185a5E>: + pub fn set_name(&mut self, name: &[u8]) { + 8001689e: 715d addi sp,sp,-80 + 800168a0: e486 sd ra,72(sp) + 800168a2: e832 sd a2,16(sp) + 800168a4: 862e mv a2,a1 + 800168a6: 65c2 ld a1,16(sp) + 800168a8: ec32 sd a2,24(sp) + 800168aa: 862a mv a2,a0 + 800168ac: 6562 ld a0,24(sp) + 800168ae: f032 sd a2,32(sp) + 800168b0: f832 sd a2,48(sp) + 800168b2: fc2a sd a0,56(sp) + 800168b4: e0ae sd a1,64(sp) + name.as_ptr(), + 800168b6: 0000a097 auipc ra,0xa + 800168ba: c48080e7 jalr -952(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 800168be: f42a sd a0,40(sp) + 800168c0: a009 j 800168c2 <_ZN6kernel7process7process11task_struct8set_name17h9731c8514bd185a5E+0x24> + self.name.as_mut_ptr(), + 800168c2: 7502 ld a0,32(sp) + 800168c4: 40050513 addi a0,a0,1024 + 800168c8: 45c1 li a1,16 + 800168ca: 0000a097 auipc ra,0xa + 800168ce: b92080e7 jalr -1134(ra) # 8002045c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h69a6648c691317bcE> + 800168d2: e42a sd a0,8(sp) + 800168d4: a009 j 800168d6 <_ZN6kernel7process7process11task_struct8set_name17h9731c8514bd185a5E+0x38> + name.len() + 800168d6: 65c2 ld a1,16(sp) + 800168d8: 6562 ld a0,24(sp) + 800168da: 0000a097 auipc ra,0xa + 800168de: bc8080e7 jalr -1080(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 800168e2: e02a sd a0,0(sp) + 800168e4: a009 j 800168e6 <_ZN6kernel7process7process11task_struct8set_name17h9731c8514bd185a5E+0x48> + copy_nonoverlapping( + 800168e6: 6602 ld a2,0(sp) + 800168e8: 75a2 ld a1,40(sp) + 800168ea: 6522 ld a0,8(sp) + 800168ec: 0000f097 auipc ra,0xf + 800168f0: 796080e7 jalr 1942(ra) # 80026082 + } + 800168f4: 60a6 ld ra,72(sp) + 800168f6: 6161 addi sp,sp,80 + 800168f8: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct10set_parent17hab868657323d1f54E: + +00000000800168fa <_ZN6kernel7process7process11task_struct10set_parent17hab868657323d1f54E>: + pub fn set_parent(&mut self, parent: Option<*mut task_struct>) { + 800168fa: 1101 addi sp,sp,-32 + 800168fc: e42a sd a0,8(sp) + 800168fe: e82e sd a1,16(sp) + 80016900: ec32 sd a2,24(sp) + self.parent = parent; + 80016902: ed4c sd a1,152(a0) + 80016904: f150 sd a2,160(a0) + } + 80016906: 6105 addi sp,sp,32 + 80016908: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct10set_kstack17h3123dd7e5cc69e61E: + +000000008001690a <_ZN6kernel7process7process11task_struct10set_kstack17h3123dd7e5cc69e61E>: + pub fn set_kstack(&mut self, ksatck: usize) { + 8001690a: 1141 addi sp,sp,-16 + 8001690c: e02a sd a0,0(sp) + 8001690e: e42e sd a1,8(sp) + self.kstack = ksatck; + 80016910: e10c sd a1,0(a0) + } + 80016912: 0141 addi sp,sp,16 + 80016914: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct13set_trapframe17h3ad216f12fff42cbE: + +0000000080016916 <_ZN6kernel7process7process11task_struct13set_trapframe17h3ad216f12fff42cbE>: + pub fn set_trapframe(&mut self, trapframe: *mut Trapframe) { + 80016916: 1141 addi sp,sp,-16 + 80016918: e02a sd a0,0(sp) + 8001691a: e42e sd a1,8(sp) + self.trapframe = trapframe; + 8001691c: f10c sd a1,32(a0) + } + 8001691e: 0141 addi sp,sp,16 + 80016920: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct13set_pagetable17h22e1e806bdd9e310E: + +0000000080016922 <_ZN6kernel7process7process11task_struct13set_pagetable17h22e1e806bdd9e310E>: + pub fn set_pagetable(&mut self, pagetable: *mut PageTable) { + 80016922: 1141 addi sp,sp,-16 + 80016924: e02a sd a0,0(sp) + 80016926: e42e sd a1,8(sp) + self.pagetable = pagetable + 80016928: ed0c sd a1,24(a0) + } + 8001692a: 0141 addi sp,sp,16 + 8001692c: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct12init_context17h19c1fbb71ecd5bedE: + +000000008001692e <_ZN6kernel7process7process11task_struct12init_context17h19c1fbb71ecd5bedE>: + pub fn init_context(&mut self) { + 8001692e: 7139 addi sp,sp,-64 + 80016930: fc06 sd ra,56(sp) + 80016932: ec2a sd a0,24(sp) + 80016934: f42a sd a0,40(sp) + let kstack = self.kstack; + 80016936: 610c ld a1,0(a0) + 80016938: f02e sd a1,32(sp) + 8001693a: f82e sd a1,48(sp) + self.context.write_zero(); + 8001693c: 02850513 addi a0,a0,40 + 80016940: ffffc097 auipc ra,0xffffc + 80016944: 25a080e7 jalr 602(ra) # 80012b9a <_ZN6kernel7process7context7Context10write_zero17hffd0e59e9c54d2c3E> + 80016948: a009 j 8001694a <_ZN6kernel7process7process11task_struct12init_context17h19c1fbb71ecd5bedE+0x1c> + self.context.write_ra(fork_ret as usize); + 8001694a: 6562 ld a0,24(sp) + 8001694c: 02850513 addi a0,a0,40 + +0000000080016950 <.LBB6_6>: + 80016950: 00008597 auipc a1,0x8 + 80016954: b6058593 addi a1,a1,-1184 # 8001e4b0 <_ZN6kernel7process8fork_ret17hc655e7da156c9445E> + 80016958: ffffc097 auipc ra,0xffffc + 8001695c: 26a080e7 jalr 618(ra) # 80012bc2 <_ZN6kernel7process7context7Context8write_ra17h453112740fa52877E> + 80016960: a009 j 80016962 <.LBB6_6+0x12> + self.context.write_sp(kstack + PGSIZE); + 80016962: 7582 ld a1,32(sp) + 80016964: 6562 ld a0,24(sp) + 80016966: 02850513 addi a0,a0,40 + 8001696a: e42a sd a0,8(sp) + 8001696c: 6505 lui a0,0x1 + 8001696e: 952e add a0,a0,a1 + 80016970: e82a sd a0,16(sp) + 80016972: 00b56d63 bltu a0,a1,8001698c <.LBB6_7> + 80016976: a009 j 80016978 <.LBB6_6+0x28> + 80016978: 65c2 ld a1,16(sp) + 8001697a: 6522 ld a0,8(sp) + 8001697c: ffffc097 auipc ra,0xffffc + 80016980: 252080e7 jalr 594(ra) # 80012bce <_ZN6kernel7process7context7Context8write_sp17h0ed724aed1960a6aE> + 80016984: a009 j 80016986 <.LBB6_6+0x36> + } + 80016986: 70e2 ld ra,56(sp) + 80016988: 6121 addi sp,sp,64 + 8001698a: 8082 ret + +000000008001698c <.LBB6_7>: + self.context.write_sp(kstack + PGSIZE); + 8001698c: 00015517 auipc a0,0x15 + 80016990: 80450513 addi a0,a0,-2044 # 8002b190 + +0000000080016994 <.LBB6_8>: + 80016994: 00014617 auipc a2,0x14 + 80016998: 7e460613 addi a2,a2,2020 # 8002b178 <.L__unnamed_1> + 8001699c: 45f1 li a1,28 + 8001699e: 0000c097 auipc ra,0xc + 800169a2: 7a6080e7 jalr 1958(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E: + +00000000800169a8 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E>: + pub fn find_unallocated_fd(&self) -> Result { + 800169a8: 7175 addi sp,sp,-144 + 800169aa: e506 sd ra,136(sp) + 800169ac: f02e sd a1,32(sp) + 800169ae: f42a sd a0,40(sp) + 800169b0: f4ae sd a1,104(sp) + for fd in 0..self.open_files.len() { + 800169b2: 0a858513 addi a0,a1,168 + 800169b6: 06400593 li a1,100 + 800169ba: ffff8097 auipc ra,0xffff8 + 800169be: 40c080e7 jalr 1036(ra) # 8000edc6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h659c29622d59b861E> + 800169c2: f82a sd a0,48(sp) + 800169c4: a009 j 800169c6 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E+0x1e> + 800169c6: 75c2 ld a1,48(sp) + 800169c8: 4501 li a0,0 + 800169ca: fc2a sd a0,56(sp) + 800169cc: e0ae sd a1,64(sp) + 800169ce: 0000a097 auipc ra,0xa + 800169d2: e42080e7 jalr -446(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 800169d6: e82a sd a0,16(sp) + 800169d8: ec2e sd a1,24(sp) + 800169da: a009 j 800169dc <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E+0x34> + 800169dc: 6562 ld a0,24(sp) + 800169de: 65c2 ld a1,16(sp) + 800169e0: e4ae sd a1,72(sp) + 800169e2: e8aa sd a0,80(sp) + 800169e4: a009 j 800169e6 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E+0x3e> + 800169e6: 00a8 addi a0,sp,72 + 800169e8: 0000a097 auipc ra,0xa + 800169ec: dba080e7 jalr -582(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 800169f0: ecaa sd a0,88(sp) + 800169f2: f0ae sd a1,96(sp) + 800169f4: a009 j 800169f6 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E+0x4e> + 800169f6: 6566 ld a0,88(sp) + 800169f8: 4581 li a1,0 + 800169fa: 00b50463 beq a0,a1,80016a02 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E+0x5a> + 800169fe: a009 j 80016a00 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E+0x58> + 80016a00: a829 j 80016a1a <.LBB7_15+0x16> + Err("Fail to find unallocted fd") + 80016a02: 75a2 ld a1,40(sp) + +0000000080016a04 <.LBB7_15>: + 80016a04: 00014517 auipc a0,0x14 + 80016a08: 7c450513 addi a0,a0,1988 # 8002b1c8 <.L__unnamed_2> + 80016a0c: e588 sd a0,8(a1) + 80016a0e: 4569 li a0,26 + 80016a10: e988 sd a0,16(a1) + 80016a12: 4505 li a0,1 + 80016a14: e188 sd a0,0(a1) + } + 80016a16: a0a1 j 80016a5e <.LBB7_15+0x5a> + for fd in 0..self.open_files.len() { + 80016a18: 0000 unimp + 80016a1a: 7586 ld a1,96(sp) + 80016a1c: e42e sd a1,8(sp) + 80016a1e: f8ae sd a1,112(sp) + 80016a20: fcae sd a1,120(sp) + 80016a22: e12e sd a1,128(sp) + 80016a24: 06300513 li a0,99 + if self.open_files[fd].is_none() { + 80016a28: 02b56e63 bltu a0,a1,80016a64 <.LBB7_15+0x60> + 80016a2c: a009 j 80016a2e <.LBB7_15+0x2a> + 80016a2e: 7502 ld a0,32(sp) + 80016a30: 65a2 ld a1,8(sp) + 80016a32: 058e slli a1,a1,0x3 + 80016a34: 952e add a0,a0,a1 + 80016a36: 0a850513 addi a0,a0,168 + 80016a3a: ffff9097 auipc ra,0xffff9 + 80016a3e: e2c080e7 jalr -468(ra) # 8000f866 <_ZN4core6option15Option$LT$T$GT$7is_none17h8590a3c5c2d3d42aE> + 80016a42: e02a sd a0,0(sp) + 80016a44: a009 j 80016a46 <.LBB7_15+0x42> + 80016a46: 6502 ld a0,0(sp) + 80016a48: 4581 li a1,0 + 80016a4a: 00b50963 beq a0,a1,80016a5c <.LBB7_15+0x58> + 80016a4e: a009 j 80016a50 <.LBB7_15+0x4c> + return Ok(fd) + 80016a50: 75a2 ld a1,40(sp) + 80016a52: 6522 ld a0,8(sp) + 80016a54: e588 sd a0,8(a1) + 80016a56: 4501 li a0,0 + 80016a58: e188 sd a0,0(a1) + } + 80016a5a: a011 j 80016a5e <.LBB7_15+0x5a> + for fd in 0..self.open_files.len() { + 80016a5c: b769 j 800169e6 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E+0x3e> + } + 80016a5e: 60aa ld ra,136(sp) + 80016a60: 6149 addi sp,sp,144 + 80016a62: 8082 ret + if self.open_files[fd].is_none() { + 80016a64: 6522 ld a0,8(sp) + +0000000080016a66 <.LBB7_16>: + 80016a66: 00014617 auipc a2,0x14 + 80016a6a: 74a60613 addi a2,a2,1866 # 8002b1b0 <.L__unnamed_3> + 80016a6e: 06400593 li a1,100 + 80016a72: 0000c097 auipc ra,0xc + 80016a76: 6fe080e7 jalr 1790(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E: + +0000000080016a7c <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E>: + pub fn init(&mut self, kstack: usize) { + 80016a7c: 81010113 addi sp,sp,-2032 + 80016a80: 7e113423 sd ra,2024(sp) + 80016a84: 660d lui a2,0x3 + 80016a86: 7e06061b addiw a2,a2,2016 + 80016a8a: 40c10133 sub sp,sp,a2 + 80016a8e: fd2e sd a1,184(sp) + 80016a90: e1aa sd a0,192(sp) + 80016a92: 660d lui a2,0x3 + 80016a94: 6206061b addiw a2,a2,1568 + 80016a98: 960a add a2,a2,sp + 80016a9a: e208 sd a0,0(a2) + 80016a9c: 650d lui a0,0x3 + 80016a9e: 6285051b addiw a0,a0,1576 + 80016aa2: 950a add a0,a0,sp + 80016aa4: e10c sd a1,0(a0) + self.open_files = array![_ => None; NFILE]; + 80016aa6: a009 j 80016aa8 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x2c> + 80016aa8: 650d lui a0,0x3 + 80016aaa: 6405051b addiw a0,a0,1600 + 80016aae: 950a add a0,a0,sp + 80016ab0: 852a mv a0,a0 + 80016ab2: f52a sd a0,168(sp) + 80016ab4: 6585 lui a1,0x1 + 80016ab6: 6b85859b addiw a1,a1,1720 + 80016aba: 958a add a1,a1,sp + 80016abc: 85ae mv a1,a1 + 80016abe: 32000613 li a2,800 + #[must_use = "if you don't need the wrapper, you can use `mem::forget` instead"] + #[stable(feature = "manually_drop", since = "1.20.0")] + #[rustc_const_stable(feature = "const_manually_drop", since = "1.36.0")] + #[inline(always)] + pub const fn new(value: T) -> ManuallyDrop { + ManuallyDrop { value } + 80016ac2: f932 sd a2,176(sp) + 80016ac4: 0000f097 auipc ra,0xf + 80016ac8: 5be080e7 jalr 1470(ra) # 80026082 + 80016acc: 75aa ld a1,168(sp) + 80016ace: 764a ld a2,176(sp) + 80016ad0: 6505 lui a0,0x1 + 80016ad2: 3985051b addiw a0,a0,920 + 80016ad6: 950a add a0,a0,sp + 80016ad8: 852a mv a0,a0 + 80016ada: 0000f097 auipc ra,0xf + 80016ade: 5a8080e7 jalr 1448(ra) # 80026082 + 80016ae2: a009 j 80016ae4 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x68> + 80016ae4: 6505 lui a0,0x1 + 80016ae6: 0785051b addiw a0,a0,120 + 80016aea: 950a add a0,a0,sp + 80016aec: 852a mv a0,a0 + 80016aee: e92a sd a0,144(sp) + 80016af0: 6585 lui a1,0x1 + 80016af2: 3985859b addiw a1,a1,920 + 80016af6: 958a add a1,a1,sp + 80016af8: 85ae mv a1,a1 + 80016afa: 32000613 li a2,800 + 80016afe: f132 sd a2,160(sp) + 80016b00: 0000f097 auipc ra,0xf + 80016b04: 582080e7 jalr 1410(ra) # 80026082 + 80016b08: 65ca ld a1,144(sp) + 80016b0a: 760a ld a2,160(sp) + 80016b0c: 6505 lui a0,0x1 + 80016b0e: d585051b addiw a0,a0,-680 + 80016b12: 950a add a0,a0,sp + 80016b14: 852a mv a0,a0 + 80016b16: ed2a sd a0,152(sp) + 80016b18: 0000f097 auipc ra,0xf + 80016b1c: 56a080e7 jalr 1386(ra) # 80026082 + 80016b20: 65ea ld a1,152(sp) + 80016b22: 760a ld a2,160(sp) + 80016b24: 6505 lui a0,0x1 + 80016b26: a385051b addiw a0,a0,-1480 + 80016b2a: 950a add a0,a0,sp + 80016b2c: 852a mv a0,a0 + /// ``` + #[stable(feature = "manually_drop", since = "1.20.0")] + #[rustc_const_stable(feature = "const_manually_drop", since = "1.36.0")] + #[inline(always)] + pub const fn into_inner(slot: ManuallyDrop) -> T { + slot.value + 80016b2e: 0000f097 auipc ra,0xf + 80016b32: 554080e7 jalr 1364(ra) # 80026082 + 80016b36: a009 j 80016b38 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0xbc> + 80016b38: 71010513 addi a0,sp,1808 + 80016b3c: 6585 lui a1,0x1 + 80016b3e: a385859b addiw a1,a1,-1480 + 80016b42: 958a add a1,a1,sp + 80016b44: 85ae mv a1,a1 + 80016b46: ffff5097 auipc ra,0xffff5 + 80016b4a: 816080e7 jalr -2026(ra) # 8000b35c <_ZN11array_macro28__ArrayVecInner$LT$T$C$_$GT$3new17h8c73fc7516a84ce9E> + 80016b4e: a009 j 80016b50 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0xd4> + 80016b50: 17a8 addi a0,sp,1000 + 80016b52: 71010593 addi a1,sp,1808 + 80016b56: 32800613 li a2,808 + 80016b5a: 0000f097 auipc ra,0xf + 80016b5e: 528080e7 jalr 1320(ra) # 80026082 + 80016b62: a009 j 80016b64 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0xe8> + 80016b64: 70813503 ld a0,1800(sp) + 80016b68: e12a sd a0,128(sp) + 80016b6a: 17a8 addi a0,sp,1000 + 80016b6c: ffff4097 auipc ra,0xffff4 + 80016b70: 7e4080e7 jalr 2020(ra) # 8000b350 <_ZN11array_macro19__Capacity$LT$_$GT$3get17hecfc1cf2bb733562E> + 80016b74: e52a sd a0,136(sp) + 80016b76: a009 j 80016b78 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0xfc> + 80016b78: 650a ld a0,128(sp) + 80016b7a: 65aa ld a1,136(sp) + 80016b7c: 04b56963 bltu a0,a1,80016bce <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x152> + 80016b80: a009 j 80016b82 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x106> + 80016b82: 6509 lui a0,0x2 + 80016b84: 6785051b addiw a0,a0,1656 + 80016b88: 950a add a0,a0,sp + 80016b8a: 852a mv a0,a0 + 80016b8c: f4aa sd a0,104(sp) + 80016b8e: 17ac addi a1,sp,1000 + 80016b90: 32800613 li a2,808 + 80016b94: fcb2 sd a2,120(sp) + 80016b96: 0000f097 auipc ra,0xf + 80016b9a: 4ec080e7 jalr 1260(ra) # 80026082 + 80016b9e: 75a6 ld a1,104(sp) + 80016ba0: 7666 ld a2,120(sp) + 80016ba2: 6511 lui a0,0x4 + 80016ba4: ca05051b addiw a0,a0,-864 + 80016ba8: 950a add a0,a0,sp + 80016baa: 852a mv a0,a0 + ManuallyDrop { value } + 80016bac: f8aa sd a0,112(sp) + 80016bae: 0000f097 auipc ra,0xf + 80016bb2: 4d4080e7 jalr 1236(ra) # 80026082 + 80016bb6: 75c6 ld a1,112(sp) + 80016bb8: 7666 ld a2,120(sp) + 80016bba: 6509 lui a0,0x2 + 80016bbc: 3505051b addiw a0,a0,848 + 80016bc0: 950a add a0,a0,sp + 80016bc2: 852a mv a0,a0 + 80016bc4: 0000f097 auipc ra,0xf + 80016bc8: 4be080e7 jalr 1214(ra) # 80026082 + 80016bcc: a0bd j 80016c3a <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x1be> + 80016bce: 4501 li a0,0 + 80016bd0: 658d lui a1,0x3 + 80016bd2: 6385859b addiw a1,a1,1592 + 80016bd6: 958a add a1,a1,sp + 80016bd8: e188 sd a0,0(a1) + 80016bda: 6591 lui a1,0x4 + 80016bdc: c885859b addiw a1,a1,-888 + 80016be0: 958a add a1,a1,sp + 80016be2: e188 sd a0,0(a1) + 80016be4: 6591 lui a1,0x4 + 80016be6: c985859b addiw a1,a1,-872 + 80016bea: 958a add a1,a1,sp + 80016bec: e188 sd a0,0(a1) + 80016bee: 6591 lui a1,0x4 + 80016bf0: c905859b addiw a1,a1,-880 + 80016bf4: 958a add a1,a1,sp + 80016bf6: e188 sd a0,0(a1) + /// [`assume_init`]: MaybeUninit::assume_init + #[stable(feature = "maybe_uninit", since = "1.36.0")] + #[rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0")] + #[inline(always)] + pub const fn new(val: T) -> MaybeUninit { + MaybeUninit { value: ManuallyDrop::new(val) } + 80016bf8: 6591 lui a1,0x4 + 80016bfa: c805859b addiw a1,a1,-896 + 80016bfe: 958a add a1,a1,sp + 80016c00: e188 sd a0,0(a1) + 80016c02: a009 j 80016c04 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x188> + 80016c04: 70813583 ld a1,1800(sp) + 80016c08: f0ae sd a1,96(sp) + 80016c0a: 06300513 li a0,99 + 80016c0e: 16b56063 bltu a0,a1,80016d6e <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x2f2> + 80016c12: a009 j 80016c14 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x198> + 80016c14: 7506 ld a0,96(sp) + 80016c16: 00351593 slli a1,a0,0x3 + 80016c1a: 17a8 addi a0,sp,1000 + 80016c1c: 95aa add a1,a1,a0 + 80016c1e: 4501 li a0,0 + 80016c20: e188 sd a0,0(a1) + 80016c22: 70813583 ld a1,1800(sp) + 80016c26: 00158513 addi a0,a1,1 # 4001 <.Lline_table_start0+0x90> + 80016c2a: ecaa sd a0,88(sp) + 80016c2c: 14b56d63 bltu a0,a1,80016d86 <.LBB8_21> + 80016c30: a009 j 80016c32 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x1b6> + 80016c32: 6566 ld a0,88(sp) + 80016c34: 70a13423 sd a0,1800(sp) + 80016c38: b735 j 80016b64 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0xe8> + 80016c3a: 6509 lui a0,0x2 + 80016c3c: 0285051b addiw a0,a0,40 + 80016c40: 950a add a0,a0,sp + 80016c42: 852a mv a0,a0 + 80016c44: e0aa sd a0,64(sp) + 80016c46: 6589 lui a1,0x2 + 80016c48: 3505859b addiw a1,a1,848 + 80016c4c: 958a add a1,a1,sp + 80016c4e: 85ae mv a1,a1 + 80016c50: 32800613 li a2,808 + 80016c54: e8b2 sd a2,80(sp) + 80016c56: 0000f097 auipc ra,0xf + 80016c5a: 42c080e7 jalr 1068(ra) # 80026082 + 80016c5e: 6586 ld a1,64(sp) + 80016c60: 6646 ld a2,80(sp) + 80016c62: 6509 lui a0,0x2 + 80016c64: d005051b addiw a0,a0,-768 + 80016c68: 950a add a0,a0,sp + 80016c6a: 852a mv a0,a0 + 80016c6c: e4aa sd a0,72(sp) + 80016c6e: 0000f097 auipc ra,0xf + 80016c72: 414080e7 jalr 1044(ra) # 80026082 + 80016c76: 65a6 ld a1,72(sp) + 80016c78: 6646 ld a2,80(sp) + 80016c7a: 6509 lui a0,0x2 + 80016c7c: 9d85051b addiw a0,a0,-1576 + 80016c80: 950a add a0,a0,sp + 80016c82: 852a mv a0,a0 + slot.value + 80016c84: 0000f097 auipc ra,0xf + 80016c88: 3fe080e7 jalr 1022(ra) # 80026082 + 80016c8c: a009 j 80016c8e <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x212> + 80016c8e: 650d lui a0,0x3 + 80016c90: 3005051b addiw a0,a0,768 + 80016c94: 950a add a0,a0,sp + 80016c96: 852a mv a0,a0 + 80016c98: f42a sd a0,40(sp) + 80016c9a: 6589 lui a1,0x2 + 80016c9c: 9d85859b addiw a1,a1,-1576 + 80016ca0: 958a add a1,a1,sp + 80016ca2: 85ae mv a1,a1 + 80016ca4: 32000613 li a2,800 + 80016ca8: fc32 sd a2,56(sp) + 80016caa: 0000f097 auipc ra,0xf + 80016cae: 3d8080e7 jalr 984(ra) # 80026082 + 80016cb2: 75a2 ld a1,40(sp) + 80016cb4: 7662 ld a2,56(sp) + 80016cb6: 6511 lui a0,0x4 + 80016cb8: 9605051b addiw a0,a0,-1696 + 80016cbc: 950a add a0,a0,sp + 80016cbe: 852a mv a0,a0 + ManuallyDrop { value } + 80016cc0: f82a sd a0,48(sp) + 80016cc2: 0000f097 auipc ra,0xf + 80016cc6: 3c0080e7 jalr 960(ra) # 80026082 + 80016cca: 75c2 ld a1,48(sp) + 80016ccc: 7662 ld a2,56(sp) + 80016cce: 650d lui a0,0x3 + 80016cd0: 3501 addiw a0,a0,-32 + 80016cd2: 950a add a0,a0,sp + 80016cd4: 852a mv a0,a0 + 80016cd6: 0000f097 auipc ra,0xf + 80016cda: 3ac080e7 jalr 940(ra) # 80026082 + 80016cde: a009 j 80016ce0 <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x264> + 80016ce0: 650d lui a0,0x3 + 80016ce2: cc05051b addiw a0,a0,-832 + 80016ce6: 950a add a0,a0,sp + 80016ce8: 852a mv a0,a0 + 80016cea: e82a sd a0,16(sp) + 80016cec: 658d lui a1,0x3 + 80016cee: 3581 addiw a1,a1,-32 + 80016cf0: 958a add a1,a1,sp + 80016cf2: 85ae mv a1,a1 + 80016cf4: 32000613 li a2,800 + 80016cf8: f032 sd a2,32(sp) + 80016cfa: 0000f097 auipc ra,0xf + 80016cfe: 388080e7 jalr 904(ra) # 80026082 + 80016d02: 65c2 ld a1,16(sp) + 80016d04: 7602 ld a2,32(sp) + 80016d06: 650d lui a0,0x3 + 80016d08: 9a05051b addiw a0,a0,-1632 + 80016d0c: 950a add a0,a0,sp + 80016d0e: 852a mv a0,a0 + 80016d10: ec2a sd a0,24(sp) + 80016d12: 0000f097 auipc ra,0xf + 80016d16: 370080e7 jalr 880(ra) # 80026082 + 80016d1a: 65e2 ld a1,24(sp) + 80016d1c: 7602 ld a2,32(sp) + 80016d1e: 01a8 addi a0,sp,200 + slot.value + 80016d20: 0000f097 auipc ra,0xf + 80016d24: 362080e7 jalr 866(ra) # 80026082 + 80016d28: a009 j 80016d2a <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x2ae> + 80016d2a: 650e ld a0,192(sp) + 80016d2c: 0a850513 addi a0,a0,168 # 30a8 <.Lline_table_start0+0xb5> + 80016d30: ffff0097 auipc ra,0xffff0 + 80016d34: 240080e7 jalr 576(ra) # 80006f70 <_ZN4core3ptr119drop_in_place$LT$$u5b$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$u3b$$u20$100$u5d$$GT$17ha293b69a65138838E> + 80016d38: a811 j 80016d4c <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x2d0> + } + 80016d3a: 650d lui a0,0x3 + 80016d3c: 7e05051b addiw a0,a0,2016 + 80016d40: 912a add sp,sp,a0 + 80016d42: 7e813083 ld ra,2024(sp) + 80016d46: 7f010113 addi sp,sp,2032 + 80016d4a: 8082 ret + self.open_files = array![_ => None; NFILE]; + 80016d4c: 650e ld a0,192(sp) + 80016d4e: 0a850513 addi a0,a0,168 # 30a8 <.Lline_table_start0+0xb5> + 80016d52: 01ac addi a1,sp,200 + 80016d54: 32000613 li a2,800 + 80016d58: 0000f097 auipc ra,0xf + 80016d5c: 32a080e7 jalr 810(ra) # 80026082 + 80016d60: 75ea ld a1,184(sp) + self.set_kstack(kstack); + 80016d62: 650e ld a0,192(sp) + 80016d64: 00000097 auipc ra,0x0 + 80016d68: ba6080e7 jalr -1114(ra) # 8001690a <_ZN6kernel7process7process11task_struct10set_kstack17h3123dd7e5cc69e61E> + 80016d6c: b7f9 j 80016d3a <_ZN6kernel7process7process11task_struct4init17hfed2bbe904210117E+0x2be> + self.open_files = array![_ => None; NFILE]; + 80016d6e: 7506 ld a0,96(sp) + +0000000080016d70 <.LBB8_20>: + 80016d70: 00014617 auipc a2,0x14 + 80016d74: 47860613 addi a2,a2,1144 # 8002b1e8 <.L__unnamed_4> + 80016d78: 06400593 li a1,100 + 80016d7c: 0000c097 auipc ra,0xc + 80016d80: 3f4080e7 jalr 1012(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080016d86 <.LBB8_21>: + 80016d86: 00014517 auipc a0,0x14 + 80016d8a: 40a50513 addi a0,a0,1034 # 8002b190 + +0000000080016d8e <.LBB8_22>: + 80016d8e: 00014617 auipc a2,0x14 + 80016d92: 45a60613 addi a2,a2,1114 # 8002b1e8 <.L__unnamed_4> + 80016d96: 45f1 li a1,28 + 80016d98: 0000c097 auipc ra,0xc + 80016d9c: 3ac080e7 jalr 940(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7process7process11task_struct6killed17h6ef392cf7098b250E: + +0000000080016da2 <_ZN6kernel7process7process11task_struct6killed17h6ef392cf7098b250E>: + pub fn killed(&self) -> bool { + 80016da2: 1141 addi sp,sp,-16 + 80016da4: e42a sd a0,8(sp) + self.killed + 80016da6: 41154503 lbu a0,1041(a0) + } + 80016daa: 0141 addi sp,sp,16 + 80016dac: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct3pid17h731646b24aa3a8ceE: + +0000000080016dae <_ZN6kernel7process7process11task_struct3pid17h731646b24aa3a8ceE>: + pub fn pid(&self) -> usize { + 80016dae: 1141 addi sp,sp,-16 + 80016db0: e42a sd a0,8(sp) + self.pid + 80016db2: 3f053503 ld a0,1008(a0) + } + 80016db6: 0141 addi sp,sp,16 + 80016db8: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E: + +0000000080016dba <_ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E>: + pub fn set_state(&mut self, state: ProcState) { + 80016dba: 1141 addi sp,sp,-16 + 80016dbc: e02a sd a0,0(sp) + 80016dbe: 00b107a3 sb a1,15(sp) + self.state = state; + 80016dc2: 40b50823 sb a1,1040(a0) + } + 80016dc6: 0141 addi sp,sp,16 + 80016dc8: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct5state17h5a6e14064666f40dE: + +0000000080016dca <_ZN6kernel7process7process11task_struct5state17h5a6e14064666f40dE>: + pub fn state(&self) -> ProcState { + 80016dca: 1141 addi sp,sp,-16 + 80016dcc: e42a sd a0,8(sp) + } + 80016dce: 41050503 lb a0,1040(a0) + 80016dd2: 0141 addi sp,sp,16 + 80016dd4: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct4name17hd751dc9eed384ff3E: + +0000000080016dd6 <_ZN6kernel7process7process11task_struct4name17hd751dc9eed384ff3E>: + pub fn name(&self) -> &str { + 80016dd6: 7139 addi sp,sp,-64 + 80016dd8: fc06 sd ra,56(sp) + 80016dda: f82a sd a0,48(sp) + from_utf8(&self.name).unwrap() + 80016ddc: 40050593 addi a1,a0,1024 + 80016de0: 0828 addi a0,sp,24 + 80016de2: 4641 li a2,16 + 80016de4: 0000e097 auipc ra,0xe + 80016de8: bae080e7 jalr -1106(ra) # 80024992 <_ZN4core3str8converts9from_utf817h3f0a2d8686bfd9bbE> + 80016dec: a009 j 80016dee <.LBB13_3> + +0000000080016dee <.LBB13_3>: + 80016dee: 00014597 auipc a1,0x14 + 80016df2: 41258593 addi a1,a1,1042 # 8002b200 <.L__unnamed_5> + 80016df6: 0828 addi a0,sp,24 + 80016df8: ffff7097 auipc ra,0xffff7 + 80016dfc: a0a080e7 jalr -1526(ra) # 8000d802 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17he7e280ca90d46427E> + 80016e00: e42a sd a0,8(sp) + 80016e02: e82e sd a1,16(sp) + 80016e04: a009 j 80016e06 <.LBB13_3+0x18> + } + 80016e06: 65c2 ld a1,16(sp) + 80016e08: 6522 ld a0,8(sp) + 80016e0a: 70e2 ld ra,56(sp) + 80016e0c: 6121 addi sp,sp,64 + 80016e0e: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct11modify_kill17h9fdb297017f75e37E: + +0000000080016e10 <_ZN6kernel7process7process11task_struct11modify_kill17h9fdb297017f75e37E>: + pub fn modify_kill(&mut self, killed: bool) { + 80016e10: 1141 addi sp,sp,-16 + 80016e12: e02a sd a0,0(sp) + 80016e14: 00b107a3 sb a1,15(sp) + self.killed = killed; + 80016e18: 40b508a3 sb a1,1041(a0) + } + 80016e1c: 0141 addi sp,sp,16 + 80016e1e: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct14proc_pagetable17h83123d92b87bdd8cE: + +0000000080016e20 <_ZN6kernel7process7process11task_struct14proc_pagetable17h83123d92b87bdd8cE>: + pub fn proc_pagetable(&self) -> *mut PageTable { + 80016e20: 7175 addi sp,sp,-144 + 80016e22: e506 sd ra,136(sp) + 80016e24: ecaa sd a0,88(sp) + 80016e26: f8aa sd a0,112(sp) + let mut page_table = unsafe{ PageTable::uvmcreate() }; + 80016e28: 00001097 auipc ra,0x1 + 80016e2c: 3f2080e7 jalr 1010(ra) # 8001821a <_ZN6kernel6memory7mapping10page_table9PageTable9uvmcreate17hc2bd2b6aed1ce488E> + 80016e30: 85aa mv a1,a0 + 80016e32: f0ae sd a1,96(sp) + 80016e34: fcaa sd a0,120(sp) + 80016e36: a009 j 80016e38 <_ZN6kernel7process7process11task_struct14proc_pagetable17h83123d92b87bdd8cE+0x18> + let pagetable = unsafe { &mut *page_table }; + 80016e38: 7506 ld a0,96(sp) + 80016e3a: e12a sd a0,128(sp) + 80016e3c: 04000537 lui a0,0x4000 + 80016e40: 357d addiw a0,a0,-1 + 80016e42: 0532 slli a0,a0,0xc + VirtualAddress::new(TRAMPOLINE), + 80016e44: ffffb097 auipc ra,0xffffb + 80016e48: 102080e7 jalr 258(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80016e4c: e8aa sd a0,80(sp) + 80016e4e: a009 j 80016e50 <.LBB15_20> + +0000000080016e50 <.LBB15_20>: + PhysicalAddress::new(trampoline as usize), + 80016e50: fffea517 auipc a0,0xfffea + 80016e54: 1b050513 addi a0,a0,432 # 80001000 + 80016e58: ffffb097 auipc ra,0xffffb + 80016e5c: 19e080e7 jalr 414(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 80016e60: e4aa sd a0,72(sp) + 80016e62: a009 j 80016e64 <.LBB15_20+0x14> + 80016e64: 4509 li a0,2 + 80016e66: 45a1 li a1,8 + PteFlags::R | PteFlags::X + 80016e68: ffff2097 auipc ra,0xffff2 + 80016e6c: 210080e7 jalr 528(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80016e70: e0aa sd a0,64(sp) + 80016e72: a009 j 80016e74 <.LBB15_20+0x24> + if !pagetable.map( + 80016e74: 6706 ld a4,64(sp) + 80016e76: 6626 ld a2,72(sp) + 80016e78: 65c6 ld a1,80(sp) + 80016e7a: 7506 ld a0,96(sp) + 80016e7c: 6685 lui a3,0x1 + 80016e7e: 00001097 auipc ra,0x1 + 80016e82: 172080e7 jalr 370(ra) # 80017ff0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE> + 80016e86: fc2a sd a0,56(sp) + 80016e88: a009 j 80016e8a <.LBB15_20+0x3a> + 80016e8a: 7562 ld a0,56(sp) + 80016e8c: e909 bnez a0,80016e9e <.LBB15_20+0x4e> + 80016e8e: a009 j 80016e90 <.LBB15_20+0x40> + pagetable.uvm_free(0); + 80016e90: 7506 ld a0,96(sp) + 80016e92: 4581 li a1,0 + 80016e94: 00001097 auipc ra,0x1 + 80016e98: 606080e7 jalr 1542(ra) # 8001849a <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE> + 80016e9c: a819 j 80016eb2 <.LBB15_20+0x62> + 80016e9e: 02000537 lui a0,0x2000 + 80016ea2: 357d addiw a0,a0,-1 + 80016ea4: 0536 slli a0,a0,0xd + VirtualAddress::new(TRAPFRAME), + 80016ea6: ffffb097 auipc ra,0xffffb + 80016eaa: 0a0080e7 jalr 160(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80016eae: f82a sd a0,48(sp) + 80016eb0: a021 j 80016eb8 <.LBB15_20+0x68> + 80016eb2: 4501 li a0,0 + return null_mut(); + 80016eb4: f4aa sd a0,104(sp) + 80016eb6: a069 j 80016f40 <.LBB15_20+0xf0> + PhysicalAddress::new(self.get_trapframe() as usize), + 80016eb8: 6566 ld a0,88(sp) + 80016eba: 00000097 auipc ra,0x0 + 80016ebe: 9da080e7 jalr -1574(ra) # 80016894 <_ZN6kernel7process7process11task_struct13get_trapframe17h63d8e269c84e49aeE> + 80016ec2: f42a sd a0,40(sp) + 80016ec4: a009 j 80016ec6 <.LBB15_20+0x76> + 80016ec6: 7522 ld a0,40(sp) + 80016ec8: ffffb097 auipc ra,0xffffb + 80016ecc: 12e080e7 jalr 302(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 80016ed0: f02a sd a0,32(sp) + 80016ed2: a009 j 80016ed4 <.LBB15_20+0x84> + 80016ed4: 4509 li a0,2 + 80016ed6: 4591 li a1,4 + PteFlags::R | PteFlags::W + 80016ed8: ffff2097 auipc ra,0xffff2 + 80016edc: 1a0080e7 jalr 416(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80016ee0: ec2a sd a0,24(sp) + 80016ee2: a009 j 80016ee4 <.LBB15_20+0x94> + if !pagetable.map( + 80016ee4: 6762 ld a4,24(sp) + 80016ee6: 7602 ld a2,32(sp) + 80016ee8: 75c2 ld a1,48(sp) + 80016eea: 7506 ld a0,96(sp) + 80016eec: 6685 lui a3,0x1 + 80016eee: 00001097 auipc ra,0x1 + 80016ef2: 102080e7 jalr 258(ra) # 80017ff0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE> + 80016ef6: e82a sd a0,16(sp) + 80016ef8: a009 j 80016efa <.LBB15_20+0xaa> + 80016efa: 6542 ld a0,16(sp) + 80016efc: ed01 bnez a0,80016f14 <.LBB15_20+0xc4> + 80016efe: a009 j 80016f00 <.LBB15_20+0xb0> + 80016f00: 02000537 lui a0,0x2000 + 80016f04: 357d addiw a0,a0,-1 + 80016f06: 0536 slli a0,a0,0xd + VirtualAddress::new(TRAPFRAME), + 80016f08: ffffb097 auipc ra,0xffffb + 80016f0c: 03e080e7 jalr 62(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80016f10: e42a sd a0,8(sp) + 80016f12: a021 j 80016f1a <.LBB15_20+0xca> + page_table + 80016f14: 7506 ld a0,96(sp) + 80016f16: f4aa sd a0,104(sp) + } + 80016f18: a025 j 80016f40 <.LBB15_20+0xf0> + pagetable.uvm_unmap( + 80016f1a: 65a2 ld a1,8(sp) + 80016f1c: 7506 ld a0,96(sp) + 80016f1e: 4605 li a2,1 + 80016f20: 4681 li a3,0 + 80016f22: 00001097 auipc ra,0x1 + 80016f26: 6ba080e7 jalr 1722(ra) # 800185dc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E> + 80016f2a: a009 j 80016f2c <.LBB15_20+0xdc> + pagetable.uvm_free(0); + 80016f2c: 7506 ld a0,96(sp) + 80016f2e: 4581 li a1,0 + 80016f30: 00001097 auipc ra,0x1 + 80016f34: 56a080e7 jalr 1386(ra) # 8001849a <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE> + 80016f38: a009 j 80016f3a <.LBB15_20+0xea> + 80016f3a: 4501 li a0,0 + return null_mut(); + 80016f3c: f4aa sd a0,104(sp) + 80016f3e: a009 j 80016f40 <.LBB15_20+0xf0> + } + 80016f40: 7526 ld a0,104(sp) + 80016f42: 60aa ld ra,136(sp) + 80016f44: 6149 addi sp,sp,144 + 80016f46: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E: + +0000000080016f48 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E>: + pub fn free_proc(&mut self) { + 80016f48: 715d addi sp,sp,-80 + 80016f4a: e486 sd ra,72(sp) + 80016f4c: e42a sd a0,8(sp) + 80016f4e: fc2a sd a0,56(sp) + if !self.trapframe.is_null() { + 80016f50: 7108 ld a0,32(a0) + 80016f52: 00008097 auipc ra,0x8 + 80016f56: c84080e7 jalr -892(ra) # 8001ebd6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h188cc5d34f3b14d9E> + 80016f5a: e82a sd a0,16(sp) + 80016f5c: a009 j 80016f5e <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x16> + 80016f5e: 6542 ld a0,16(sp) + 80016f60: e119 bnez a0,80016f66 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x1e> + 80016f62: a009 j 80016f64 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x1c> + unsafe { drop_in_place(self.trapframe as *mut RawPage) }; + 80016f64: a011 j 80016f68 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x20> + if !self.trapframe.is_null() { + 80016f66: a0b1 j 80016fb2 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x6a> + self.set_trapframe(0 as *mut Trapframe); + 80016f68: 6522 ld a0,8(sp) + 80016f6a: 4581 li a1,0 + 80016f6c: 00000097 auipc ra,0x0 + 80016f70: 9aa080e7 jalr -1622(ra) # 80016916 <_ZN6kernel7process7process11task_struct13set_trapframe17h3ad216f12fff42cbE> + 80016f74: a009 j 80016f76 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x2e> + let pagetable = unsafe { &mut *self.pagetable }; + 80016f76: 6522 ld a0,8(sp) + 80016f78: 6d0c ld a1,24(a0) + 80016f7a: e0ae sd a1,64(sp) + 80016f7c: 4581 li a1,0 + self.set_parent(None); + 80016f7e: f02e sd a1,32(sp) + 80016f80: 7622 ld a2,40(sp) + 80016f82: 00000097 auipc ra,0x0 + 80016f86: 978080e7 jalr -1672(ra) # 800168fa <_ZN6kernel7process7process11task_struct10set_parent17hab868657323d1f54E> + 80016f8a: a009 j 80016f8c <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x44> + 80016f8c: 6522 ld a0,8(sp) + 80016f8e: 4581 li a1,0 + self.size = 0; + 80016f90: e90c sd a1,16(a0) + self.pid = 0; + 80016f92: 3eb53823 sd a1,1008(a0) # 20003f0 <.Lline_table_start0+0x1fc8f8b> + self.channel = 0; + 80016f96: 3eb53023 sd a1,992(a0) + self.killed = false; + 80016f9a: 40b508a3 sb a1,1041(a0) + self.xstate = 0; + 80016f9e: 3eb53423 sd a1,1000(a0) + self.set_state(ProcState::UNUSED); + 80016fa2: 02b10ba3 sb a1,55(sp) + 80016fa6: 00000097 auipc ra,0x0 + 80016faa: e14080e7 jalr -492(ra) # 80016dba <_ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E> + 80016fae: a009 j 80016fb0 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x68> + if !self.trapframe.is_null() { + 80016fb0: a009 j 80016fb2 <_ZN6kernel7process7process11task_struct9free_proc17h30e39b350bb97994E+0x6a> + } + 80016fb2: 60a6 ld ra,72(sp) + 80016fb4: 6161 addi sp,sp,80 + 80016fb6: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct11free_thread17he6786fef99445e3bE: + +0000000080016fb8 <_ZN6kernel7process7process11task_struct11free_thread17he6786fef99445e3bE>: + pub fn free_thread(&mut self) { + 80016fb8: 7139 addi sp,sp,-64 + 80016fba: fc06 sd ra,56(sp) + 80016fbc: e82a sd a0,16(sp) + 80016fbe: f82a sd a0,48(sp) + 80016fc0: 4581 li a1,0 + self.set_pagetable(0 as *mut PageTable); + 80016fc2: 00000097 auipc ra,0x0 + 80016fc6: 960080e7 jalr -1696(ra) # 80016922 <_ZN6kernel7process7process11task_struct13set_pagetable17h22e1e806bdd9e310E> + 80016fca: a009 j 80016fcc <_ZN6kernel7process7process11task_struct11free_thread17he6786fef99445e3bE+0x14> + self.set_trapframe(0 as *mut Trapframe); + 80016fcc: 6542 ld a0,16(sp) + 80016fce: 4581 li a1,0 + 80016fd0: 00000097 auipc ra,0x0 + 80016fd4: 946080e7 jalr -1722(ra) # 80016916 <_ZN6kernel7process7process11task_struct13set_trapframe17h3ad216f12fff42cbE> + 80016fd8: a009 j 80016fda <_ZN6kernel7process7process11task_struct11free_thread17he6786fef99445e3bE+0x22> + 80016fda: 6542 ld a0,16(sp) + 80016fdc: 4581 li a1,0 + self.set_parent(None); + 80016fde: ec2e sd a1,24(sp) + 80016fe0: 7602 ld a2,32(sp) + 80016fe2: 00000097 auipc ra,0x0 + 80016fe6: 918080e7 jalr -1768(ra) # 800168fa <_ZN6kernel7process7process11task_struct10set_parent17hab868657323d1f54E> + 80016fea: a009 j 80016fec <_ZN6kernel7process7process11task_struct11free_thread17he6786fef99445e3bE+0x34> + 80016fec: 6542 ld a0,16(sp) + 80016fee: 4581 li a1,0 + self.size = 0; + 80016ff0: e42e sd a1,8(sp) + 80016ff2: e90c sd a1,16(a0) + self.thread_ustack = 0; + 80016ff4: e50c sd a1,8(a0) + self.pid = 0; + 80016ff6: 3eb53823 sd a1,1008(a0) + self.channel = 0; + 80016ffa: 3eb53023 sd a1,992(a0) + self.killed = false; + 80016ffe: 40b508a3 sb a1,1041(a0) + self.xstate = 0; + 80017002: 3eb53423 sd a1,1000(a0) + self.set_state(ProcState::UNUSED); + 80017006: 02b107a3 sb a1,47(sp) + 8001700a: 00000097 auipc ra,0x0 + 8001700e: db0080e7 jalr -592(ra) # 80016dba <_ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E> + 80017012: a009 j 80017014 <_ZN6kernel7process7process11task_struct11free_thread17he6786fef99445e3bE+0x5c> + } + 80017014: 70e2 ld ra,56(sp) + 80017016: 6121 addi sp,sp,64 + 80017018: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E: + +000000008001701a <_ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E>: + pub fn grow_proc(&mut self, count: isize) -> Result<(), &'static str> { + 8001701a: 7175 addi sp,sp,-144 + 8001701c: e506 sd ra,136(sp) + 8001701e: f02e sd a1,32(sp) + 80017020: f42a sd a0,40(sp) + 80017022: f0aa sd a0,96(sp) + 80017024: f4ae sd a1,104(sp) + let mut size = self.size; + 80017026: 6910 ld a2,16(a0) + 80017028: e4b2 sd a2,72(sp) + let page_table = unsafe { &mut *self.pagetable }; + 8001702a: 6d08 ld a0,24(a0) + 8001702c: f82a sd a0,48(sp) + 8001702e: f8aa sd a0,112(sp) + 80017030: 4505 li a0,1 + if count > 0 { + 80017032: 00a5cb63 blt a1,a0,80017048 <_ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E+0x2e> + 80017036: a009 j 80017038 <_ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E+0x1e> + match unsafe { page_table.uvm_alloc(size, size + count as usize) } { + 80017038: 7502 ld a0,32(sp) + 8001703a: 65a6 ld a1,72(sp) + 8001703c: e82e sd a1,16(sp) + 8001703e: 952e add a0,a0,a1 + 80017040: ec2a sd a0,24(sp) + 80017042: 08b56b63 bltu a0,a1,800170d8 <.LBB18_18> + 80017046: a031 j 80017052 <_ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E+0x38> + 80017048: 7502 ld a0,32(sp) + 8001704a: 4581 li a1,0 + } else if count < 0 { + 8001704c: 04b54163 blt a0,a1,8001708e <.LBB18_17+0x1c> + 80017050: a899 j 800170a6 <.LBB18_17+0x34> + match unsafe { page_table.uvm_alloc(size, size + count as usize) } { + 80017052: 6662 ld a2,24(sp) + 80017054: 65c2 ld a1,16(sp) + 80017056: 7542 ld a0,48(sp) + 80017058: 00001097 auipc ra,0x1 + 8001705c: 300080e7 jalr 768(ra) # 80018358 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE> + 80017060: e8aa sd a0,80(sp) + 80017062: ecae sd a1,88(sp) + 80017064: a009 j 80017066 <_ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E+0x4c> + Some(new_size) => { + 80017066: 6546 ld a0,80(sp) + 80017068: 4581 li a1,0 + 8001706a: 00b50463 beq a0,a1,80017072 <.LBB18_17> + 8001706e: a009 j 80017070 <_ZN6kernel7process7process11task_struct9grow_proc17h9cf071bf9754ba59E+0x56> + 80017070: a819 j 80017086 <.LBB18_17+0x14> + +0000000080017072 <.LBB18_17>: + return Err("Fail to allocate virtual memory for user") + 80017072: 00014517 auipc a0,0x14 + 80017076: 1be50513 addi a0,a0,446 # 8002b230 <.L__unnamed_6> + 8001707a: fc2a sd a0,56(sp) + 8001707c: 02800513 li a0,40 + 80017080: e0aa sd a0,64(sp) + } + 80017082: a0b1 j 800170ce <.LBB18_17+0x5c> + match unsafe { page_table.uvm_alloc(size, size + count as usize) } { + 80017084: 0000 unimp + Some(new_size) => { + 80017086: 6566 ld a0,88(sp) + 80017088: fcaa sd a0,120(sp) + size = new_size; + 8001708a: e4aa sd a0,72(sp) + if count > 0 { + 8001708c: a81d j 800170c2 <.LBB18_17+0x50> + let new_size = (size as isize + count) as usize; + 8001708e: 7502 ld a0,32(sp) + 80017090: 6626 ld a2,72(sp) + 80017092: 00a605b3 add a1,a2,a0 + 80017096: e42e sd a1,8(sp) + 80017098: 00c5a5b3 slt a1,a1,a2 + 8001709c: 00052513 slti a0,a0,0 + 800170a0: 8d2d xor a0,a0,a1 + 800170a2: e929 bnez a0,800170f4 <.LBB18_20> + 800170a4: a011 j 800170a8 <.LBB18_17+0x36> + } else if count < 0 { + 800170a6: a831 j 800170c2 <.LBB18_17+0x50> + let new_size = (size as isize + count) as usize; + 800170a8: 6622 ld a2,8(sp) + 800170aa: 7542 ld a0,48(sp) + 800170ac: e132 sd a2,128(sp) + size = page_table.uvm_dealloc(size, new_size); + 800170ae: 65a6 ld a1,72(sp) + 800170b0: 00001097 auipc ra,0x1 + 800170b4: 458080e7 jalr 1112(ra) # 80018508 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E> + 800170b8: e02a sd a0,0(sp) + 800170ba: a009 j 800170bc <.LBB18_17+0x4a> + 800170bc: 6502 ld a0,0(sp) + 800170be: e4aa sd a0,72(sp) + } else if count < 0 { + 800170c0: a009 j 800170c2 <.LBB18_17+0x50> + self.size = size; + 800170c2: 75a2 ld a1,40(sp) + 800170c4: 6526 ld a0,72(sp) + 800170c6: e988 sd a0,16(a1) + 800170c8: 4501 li a0,0 + Ok(()) + 800170ca: fc2a sd a0,56(sp) + } + 800170cc: a009 j 800170ce <.LBB18_17+0x5c> + 800170ce: 7562 ld a0,56(sp) + 800170d0: 6586 ld a1,64(sp) + 800170d2: 60aa ld ra,136(sp) + 800170d4: 6149 addi sp,sp,144 + 800170d6: 8082 ret + +00000000800170d8 <.LBB18_18>: + match unsafe { page_table.uvm_alloc(size, size + count as usize) } { + 800170d8: 00014517 auipc a0,0x14 + 800170dc: 0b850513 addi a0,a0,184 # 8002b190 + +00000000800170e0 <.LBB18_19>: + 800170e0: 00014617 auipc a2,0x14 + 800170e4: 13860613 addi a2,a2,312 # 8002b218 <.L__unnamed_7> + 800170e8: 45f1 li a1,28 + 800170ea: 0000c097 auipc ra,0xc + 800170ee: 05a080e7 jalr 90(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800170f4 <.LBB18_20>: + let new_size = (size as isize + count) as usize; + 800170f4: 00014517 auipc a0,0x14 + 800170f8: 09c50513 addi a0,a0,156 # 8002b190 + +00000000800170fc <.LBB18_21>: + 800170fc: 00014617 auipc a2,0x14 + 80017100: 15c60613 addi a2,a2,348 # 8002b258 <.L__unnamed_8> + 80017104: 45f1 li a1,28 + 80017106: 0000c097 auipc ra,0xc + 8001710a: 03e080e7 jalr 62(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel7process7process11task_struct8yielding17ha01fb6496bdc4c3eE: + +0000000080017110 <_ZN6kernel7process7process11task_struct8yielding17ha01fb6496bdc4c3eE>: + pub fn yielding(&mut self) { + 80017110: 7139 addi sp,sp,-64 + 80017112: fc06 sd ra,56(sp) + 80017114: e42a sd a0,8(sp) + 80017116: f02a sd a0,32(sp) + 80017118: 6509 lui a0,0x2 + 8001711a: 0c85059b addiw a1,a0,200 + +000000008001711e <.LBB19_6>: + 8001711e: 00042517 auipc a0,0x42 + 80017122: 2b250513 addi a0,a0,690 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80017126: 952e add a0,a0,a1 + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 80017128: ffffa097 auipc ra,0xffffa + 8001712c: f1a080e7 jalr -230(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80017130: 85aa mv a1,a0 + 80017132: e82e sd a1,16(sp) + 80017134: f42a sd a0,40(sp) + 80017136: a009 j 80017138 <.LBB19_6+0x1a> + 80017138: 6522 ld a0,8(sp) + 8001713a: 458d li a1,3 + self.set_state(ProcState::RUNNABLE); + 8001713c: 00b10fa3 sb a1,31(sp) + 80017140: 00000097 auipc ra,0x0 + 80017144: c7a080e7 jalr -902(ra) # 80016dba <_ZN6kernel7process7process11task_struct9set_state17h1805a369c1bf6897E> + 80017148: a009 j 8001714a <.LBB19_7> + +000000008001714a <.LBB19_7>: + let my_cpu = CPU_MANAGER.mycpu(); + 8001714a: 0004f517 auipc a0,0x4f + 8001714e: ff650513 addi a0,a0,-10 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80017152: ffffb097 auipc ra,0xffffb + 80017156: 2ba080e7 jalr 698(ra) # 8001240c <_ZN6kernel7process3cpu10CPUManager5mycpu17hac5ae6ce2070e7c3E> + 8001715a: 85aa mv a1,a0 + 8001715c: e02e sd a1,0(sp) + 8001715e: f82a sd a0,48(sp) + 80017160: a009 j 80017162 <.LBB19_7+0x18> + my_cpu.sched(); + 80017162: 6502 ld a0,0(sp) + 80017164: ffffb097 auipc ra,0xffffb + 80017168: 51a080e7 jalr 1306(ra) # 8001267e <_ZN6kernel7process3cpu3CPU5sched17h6aec64bf33990cbcE> + 8001716c: a009 j 8001716e <.LBB19_7+0x24> + drop(guard); + 8001716e: 6542 ld a0,16(sp) + 80017170: 00007097 auipc ra,0x7 + 80017174: c78080e7 jalr -904(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 80017178: a009 j 8001717a <.LBB19_7+0x30> + } + 8001717a: 70e2 ld ra,56(sp) + 8001717c: 6121 addi sp,sp,64 + 8001717e: 8082 ret + +Disassembly of section .text._ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE: + +0000000080017180 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE>: + + /// Find a unallocated fd + pub fn fd_alloc(&mut self, file: &VFile) -> Result{ + 80017180: 7151 addi sp,sp,-240 + 80017182: f586 sd ra,232(sp) + 80017184: f832 sd a2,48(sp) + 80017186: fc2e sd a1,56(sp) + 80017188: e0aa sd a0,64(sp) + 8001718a: fd2e sd a1,184(sp) + 8001718c: e1b2 sd a2,192(sp) + 8001718e: 1088 addi a0,sp,96 + + let fd = self.find_unallocated_fd()?; + 80017190: 00000097 auipc ra,0x0 + 80017194: 818080e7 jalr -2024(ra) # 800169a8 <_ZN6kernel7process7process11task_struct19find_unallocated_fd17h084fe1eaa6d38e77E> + 80017198: a009 j 8001719a <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x1a> + 8001719a: 00a8 addi a0,sp,72 + 8001719c: 108c addi a1,sp,96 + 8001719e: ffff7097 auipc ra,0xffff7 + 800171a2: 8f6080e7 jalr -1802(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 800171a6: a009 j 800171a8 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x28> + 800171a8: 6526 ld a0,72(sp) + 800171aa: 4581 li a1,0 + 800171ac: 00b50463 beq a0,a1,800171b4 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x34> + 800171b0: a009 j 800171b2 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x32> + 800171b2: a819 j 800171c8 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x48> + 800171b4: 6546 ld a0,80(sp) + 800171b6: f42a sd a0,40(sp) + 800171b8: edaa sd a0,216(sp) + 800171ba: f1aa sd a0,224(sp) + 800171bc: 06400593 li a1,100 + self.open_files[fd].replace(Arc::new(file.clone())); + 800171c0: 02b56763 bltu a0,a1,800171ee <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x6e> + 800171c4: a049 j 80017246 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0xc6> + let fd = self.find_unallocated_fd()?; + 800171c6: 0000 unimp + 800171c8: 6546 ld a0,80(sp) + 800171ca: 65e6 ld a1,88(sp) + 800171cc: e5aa sd a0,200(sp) + 800171ce: e9ae sd a1,208(sp) + 800171d0: ffff5097 auipc ra,0xffff5 + 800171d4: 1b6080e7 jalr 438(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 800171d8: ec2a sd a0,24(sp) + 800171da: f02e sd a1,32(sp) + 800171dc: a009 j 800171de <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x5e> + 800171de: 7602 ld a2,32(sp) + 800171e0: 65e2 ld a1,24(sp) + 800171e2: 6506 ld a0,64(sp) + 800171e4: ffff6097 auipc ra,0xffff6 + 800171e8: 7e2080e7 jalr 2018(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 800171ec: a891 j 80017240 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0xc0> + self.open_files[fd].replace(Arc::new(file.clone())); + 800171ee: 75c2 ld a1,48(sp) + 800171f0: 7562 ld a0,56(sp) + 800171f2: 7622 ld a2,40(sp) + 800171f4: 060e slli a2,a2,0x3 + 800171f6: 9532 add a0,a0,a2 + 800171f8: 0a850513 addi a0,a0,168 + 800171fc: e82a sd a0,16(sp) + 800171fe: 0108 addi a0,sp,128 + 80017200: fffef097 auipc ra,0xfffef + 80017204: fc2080e7 jalr -62(ra) # 800061c2 <_ZN62_$LT$kernel..fs..file..VFile$u20$as$u20$core..clone..Clone$GT$5clone17hec76716ecfa94dd4E> + 80017208: a009 j 8001720a <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x8a> + 8001720a: 0108 addi a0,sp,128 + 8001720c: fffeb097 auipc ra,0xfffeb + 80017210: 20c080e7 jalr 524(ra) # 80002418 <_ZN5alloc4sync12Arc$LT$T$GT$3new17h678276cd59118dbbE> + 80017214: e42a sd a0,8(sp) + 80017216: a009 j 80017218 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0x98> + 80017218: 65a2 ld a1,8(sp) + 8001721a: 6542 ld a0,16(sp) + 8001721c: ffff8097 auipc ra,0xffff8 + 80017220: 768080e7 jalr 1896(ra) # 8000f984 <_ZN4core6option15Option$LT$T$GT$7replace17hf852e6bb4a32ec9aE> + 80017224: fcaa sd a0,120(sp) + 80017226: a009 j 80017228 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0xa8> + 80017228: 18a8 addi a0,sp,120 + 8001722a: ffff0097 auipc ra,0xffff0 + 8001722e: fec080e7 jalr -20(ra) # 80007216 <_ZN4core3ptr96drop_in_place$LT$core..option..Option$LT$alloc..sync..Arc$LT$kernel..fs..file..VFile$GT$$GT$$GT$17hc79d9c89cd1d7f36E> + 80017232: a009 j 80017234 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0xb4> + Ok(fd) + 80017234: 6586 ld a1,64(sp) + 80017236: 7522 ld a0,40(sp) + 80017238: e588 sd a0,8(a1) + 8001723a: 4501 li a0,0 + 8001723c: e188 sd a0,0(a1) + } + 8001723e: a009 j 80017240 <_ZN6kernel7process7process11task_struct8fd_alloc17hb161d64d4a172dccE+0xc0> + 80017240: 70ae ld ra,232(sp) + 80017242: 616d addi sp,sp,240 + 80017244: 8082 ret + self.open_files[fd].replace(Arc::new(file.clone())); + 80017246: 7522 ld a0,40(sp) + +0000000080017248 <.LBB20_15>: + 80017248: 00014617 auipc a2,0x14 + 8001724c: 02860613 addi a2,a2,40 # 8002b270 <.L__unnamed_9> + 80017250: 06400593 li a1,100 + 80017254: 0000c097 auipc ra,0xc + 80017258: f1c080e7 jalr -228(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel7process7process11task_struct4fork17hbc50404a2563983cE: + +000000008001725e <_ZN6kernel7process7process11task_struct4fork17hbc50404a2563983cE>: + + pub fn fork(&mut self) -> Option<&mut Self> { + 8001725e: 7151 addi sp,sp,-240 + 80017260: f586 sd ra,232(sp) + 80017262: e0aa sd a0,64(sp) + 80017264: e1aa sd a0,192(sp) + // 从表中获取未被分配的子进程 + if let Some(child_proc) = ProcManager::alloc_proc() { + 80017266: ffff7097 auipc ra,0xffff7 + 8001726a: cc4080e7 jalr -828(ra) # 8000df2a <_ZN6kernel7process7manager11ProcManager10alloc_proc17h1cffa348e6417c04E> + 8001726e: e8aa sd a0,80(sp) + 80017270: a009 j 80017272 <_ZN6kernel7process7process11task_struct4fork17hbc50404a2563983cE+0x14> + 80017272: 6546 ld a0,80(sp) + 80017274: 4581 li a1,0 + 80017276: 02b51363 bne a0,a1,8001729c <.LBB21_20+0x18> + 8001727a: a009 j 8001727c <.LBB21_19> + +000000008001727c <.LBB21_19>: + drop(guard); + + // println!("Self pid is {}, child pid is {}", self.pid, child_proc.pid); + Some(child_proc) + }else { + println!("[Kernel] fork: None"); + 8001727c: 00014597 auipc a1,0x14 + 80017280: 02458593 addi a1,a1,36 # 8002b2a0 <.L__unnamed_10> + +0000000080017284 <.LBB21_20>: + 80017284: 00014697 auipc a3,0x14 + 80017288: 02c68693 addi a3,a3,44 # 8002b2b0 <.L__unnamed_12> + 8001728c: 0908 addi a0,sp,144 + 8001728e: 4605 li a2,1 + 80017290: 4701 li a4,0 + 80017292: fffee097 auipc ra,0xfffee + 80017296: 2f8080e7 jalr 760(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001729a: a2f1 j 80017466 <.LBB21_25+0x38> + if let Some(child_proc) = ProcManager::alloc_proc() { + 8001729c: 6506 ld a0,64(sp) + 8001729e: 65c6 ld a1,80(sp) + 800172a0: f82e sd a1,48(sp) + 800172a2: e5ae sd a1,200(sp) + if unsafe{ self.pagetable.as_mut().unwrap().uvm_copy( + 800172a4: 6d08 ld a0,24(a0) + 800172a6: ffff6097 auipc ra,0xffff6 + 800172aa: 204080e7 jalr 516(ra) # 8000d4aa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E> + 800172ae: fc2a sd a0,56(sp) + 800172b0: a009 j 800172b2 <.LBB21_20+0x2e> + 800172b2: 7562 ld a0,56(sp) + +00000000800172b4 <.LBB21_21>: + 800172b4: 00014597 auipc a1,0x14 + 800172b8: ffc58593 addi a1,a1,-4 # 8002b2b0 <.L__unnamed_12> + 800172bc: ffff8097 auipc ra,0xffff8 + 800172c0: 24c080e7 jalr 588(ra) # 8000f508 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E> + 800172c4: f42a sd a0,40(sp) + 800172c6: a009 j 800172c8 <.LBB21_21+0x14> + child_proc.pagetable.as_mut().unwrap(), + 800172c8: 7542 ld a0,48(sp) + 800172ca: 6d08 ld a0,24(a0) + 800172cc: ffff6097 auipc ra,0xffff6 + 800172d0: 1de080e7 jalr 478(ra) # 8000d4aa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E> + 800172d4: f02a sd a0,32(sp) + 800172d6: a009 j 800172d8 <.LBB21_21+0x24> + 800172d8: 7502 ld a0,32(sp) + +00000000800172da <.LBB21_22>: + 800172da: 00014597 auipc a1,0x14 + 800172de: fee58593 addi a1,a1,-18 # 8002b2c8 <.L__unnamed_13> + 800172e2: ffff8097 auipc ra,0xffff8 + 800172e6: 226080e7 jalr 550(ra) # 8000f508 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E> + 800172ea: ec2a sd a0,24(sp) + 800172ec: a009 j 800172ee <.LBB21_22+0x14> + self.size + 800172ee: 65e2 ld a1,24(sp) + 800172f0: 7522 ld a0,40(sp) + 800172f2: 6606 ld a2,64(sp) + 800172f4: 6a10 ld a2,16(a2) + if unsafe{ self.pagetable.as_mut().unwrap().uvm_copy( + 800172f6: 00001097 auipc ra,0x1 + 800172fa: 492080e7 jalr 1170(ra) # 80018788 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E> + 800172fe: ecaa sd a0,88(sp) + 80017300: f0ae sd a1,96(sp) + 80017302: a009 j 80017304 <.LBB21_22+0x2a> + 80017304: 08a8 addi a0,sp,88 + 80017306: ffff6097 auipc ra,0xffff6 + 8001730a: 372080e7 jalr 882(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8001730e: e82a sd a0,16(sp) + 80017310: a009 j 80017312 <.LBB21_22+0x38> + 80017312: 6542 ld a0,16(sp) + 80017314: 4581 li a1,0 + 80017316: 02b50263 beq a0,a1,8001733a <.LBB21_24+0x16> + 8001731a: a009 j 8001731c <.LBB21_23> + +000000008001731c <.LBB21_23>: + panic!("fork: Fail to copy data from parent process.") + 8001731c: 00014517 auipc a0,0x14 + 80017320: fc450513 addi a0,a0,-60 # 8002b2e0 <.L__unnamed_14> + +0000000080017324 <.LBB21_24>: + 80017324: 00014617 auipc a2,0x14 + 80017328: fec60613 addi a2,a2,-20 # 8002b310 <.L__unnamed_15> + 8001732c: 02c00593 li a1,44 + 80017330: 0000c097 auipc ra,0xc + 80017334: e14080e7 jalr -492(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80017338: 0000 unimp + let ptf = self.trapframe as *const Trapframe; + 8001733a: 6586 ld a1,64(sp) + 8001733c: 7542 ld a0,48(sp) + 8001733e: 718c ld a1,32(a1) + 80017340: e9ae sd a1,208(sp) + let child_tf = unsafe{ &mut *child_proc.trapframe }; + 80017342: 7108 ld a0,32(a0) + 80017344: e42a sd a0,8(sp) + 80017346: edaa sd a0,216(sp) + 80017348: 12000613 li a2,288 + unsafe{ copy_nonoverlapping(ptf, child_tf, 1); } + 8001734c: 0000f097 auipc ra,0xf + 80017350: d36080e7 jalr -714(ra) # 80026082 + 80017354: 66a2 ld a3,8(sp) + 80017356: 6586 ld a1,64(sp) + 80017358: 7542 ld a0,48(sp) + 8001735a: 4601 li a2,0 + child_tf.a0 = 0; + 8001735c: fab0 sd a2,112(a3) + child_proc.open_files.clone_from(&self.open_files); + 8001735e: 0a850513 addi a0,a0,168 + 80017362: 0a858593 addi a1,a1,168 + 80017366: ffff8097 auipc ra,0xffff8 + 8001736a: a1c080e7 jalr -1508(ra) # 8000ed82 <_ZN4core5clone5Clone10clone_from17h2b52fdc155b58fc3E> + 8001736e: a009 j 80017370 <.LBB21_24+0x4c> + child_proc.cwd.clone_from(&self.cwd); + 80017370: 6586 ld a1,64(sp) + 80017372: 7542 ld a0,48(sp) + 80017374: 3c850513 addi a0,a0,968 + 80017378: 3c858593 addi a1,a1,968 + 8001737c: ffff8097 auipc ra,0xffff8 + 80017380: 65c080e7 jalr 1628(ra) # 8000f9d8 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE> + 80017384: a009 j 80017386 <.LBB21_24+0x62> + child_proc.name = self.name; + 80017386: 6586 ld a1,64(sp) + 80017388: 7542 ld a0,48(sp) + 8001738a: 4085c683 lbu a3,1032(a1) + 8001738e: 4095c603 lbu a2,1033(a1) + 80017392: 0622 slli a2,a2,0x8 + 80017394: 8ed1 or a3,a3,a2 + 80017396: 40a5c703 lbu a4,1034(a1) + 8001739a: 40b5c603 lbu a2,1035(a1) + 8001739e: 0622 slli a2,a2,0x8 + 800173a0: 8e59 or a2,a2,a4 + 800173a2: 0642 slli a2,a2,0x10 + 800173a4: 8ed1 or a3,a3,a2 + 800173a6: 40c5c703 lbu a4,1036(a1) + 800173aa: 40d5c603 lbu a2,1037(a1) + 800173ae: 0622 slli a2,a2,0x8 + 800173b0: 8f51 or a4,a4,a2 + 800173b2: 40e5c783 lbu a5,1038(a1) + 800173b6: 40f5c603 lbu a2,1039(a1) + 800173ba: 0622 slli a2,a2,0x8 + 800173bc: 8e5d or a2,a2,a5 + 800173be: 0642 slli a2,a2,0x10 + 800173c0: 8e59 or a2,a2,a4 + 800173c2: 1602 slli a2,a2,0x20 + 800173c4: 8e55 or a2,a2,a3 + 800173c6: f8b2 sd a2,112(sp) + 800173c8: 4005c683 lbu a3,1024(a1) + 800173cc: 4015c603 lbu a2,1025(a1) + 800173d0: 0622 slli a2,a2,0x8 + 800173d2: 8ed1 or a3,a3,a2 + 800173d4: 4025c703 lbu a4,1026(a1) + 800173d8: 4035c603 lbu a2,1027(a1) + 800173dc: 0622 slli a2,a2,0x8 + 800173de: 8e59 or a2,a2,a4 + 800173e0: 0642 slli a2,a2,0x10 + 800173e2: 8e55 or a2,a2,a3 + 800173e4: 4045c703 lbu a4,1028(a1) + 800173e8: 4055c683 lbu a3,1029(a1) + 800173ec: 06a2 slli a3,a3,0x8 + 800173ee: 8ed9 or a3,a3,a4 + 800173f0: 4065c703 lbu a4,1030(a1) + 800173f4: 4075c583 lbu a1,1031(a1) + 800173f8: 05a2 slli a1,a1,0x8 + 800173fa: 8dd9 or a1,a1,a4 + 800173fc: 05c2 slli a1,a1,0x10 + 800173fe: 8dd5 or a1,a1,a3 + 80017400: 1582 slli a1,a1,0x20 + 80017402: 8dd1 or a1,a1,a2 + 80017404: f4ae sd a1,104(sp) + 80017406: 40050513 addi a0,a0,1024 + 8001740a: 10ac addi a1,sp,104 + 8001740c: 4641 li a2,16 + 8001740e: 0000f097 auipc ra,0xf + 80017412: c74080e7 jalr -908(ra) # 80026082 + 80017416: 75c2 ld a1,48(sp) + child_proc.size = self.size; + 80017418: 6506 ld a0,64(sp) + 8001741a: 6910 ld a2,16(a0) + 8001741c: e990 sd a2,16(a1) + child_proc.parent = Some(self as *mut task_struct); + 8001741e: e12a sd a0,128(sp) + 80017420: 4605 li a2,1 + 80017422: fcb2 sd a2,120(sp) + 80017424: edd0 sd a2,152(a1) + 80017426: f1c8 sd a0,160(a1) + 80017428: 6509 lui a0,0x2 + 8001742a: 0c85059b addiw a1,a0,200 + +000000008001742e <.LBB21_25>: + 8001742e: 00042517 auipc a0,0x42 + 80017432: fa250513 addi a0,a0,-94 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80017436: 952e add a0,a0,a1 + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 80017438: ffffa097 auipc ra,0xffffa + 8001743c: c0a080e7 jalr -1014(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80017440: 85aa mv a1,a0 + 80017442: e02e sd a1,0(sp) + 80017444: f1aa sd a0,224(sp) + 80017446: a009 j 80017448 <.LBB21_25+0x1a> + 80017448: 6502 ld a0,0(sp) + 8001744a: 7642 ld a2,48(sp) + 8001744c: 458d li a1,3 + child_proc.state = ProcState::RUNNABLE; + 8001744e: 08b107a3 sb a1,143(sp) + 80017452: 40b60823 sb a1,1040(a2) + drop(guard); + 80017456: 00007097 auipc ra,0x7 + 8001745a: 992080e7 jalr -1646(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001745e: a009 j 80017460 <.LBB21_25+0x32> + Some(child_proc) + 80017460: 7542 ld a0,48(sp) + 80017462: e4aa sd a0,72(sp) + if let Some(child_proc) = ProcManager::alloc_proc() { + 80017464: a811 j 80017478 <.LBB21_25+0x4a> + 80017466: 0908 addi a0,sp,144 + println!("[Kernel] fork: None"); + 80017468: 00007097 auipc ra,0x7 + 8001746c: 790080e7 jalr 1936(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 80017470: a009 j 80017472 <.LBB21_25+0x44> + 80017472: 4501 li a0,0 + None + 80017474: e4aa sd a0,72(sp) + if let Some(child_proc) = ProcManager::alloc_proc() { + 80017476: a009 j 80017478 <.LBB21_25+0x4a> + } + } + 80017478: 6526 ld a0,72(sp) + 8001747a: 70ae ld ra,232(sp) + 8001747c: 616d addi sp,sp,240 + 8001747e: 8082 ret + +Disassembly of section .text._ZN6kernel7process6thread55_$LT$impl$u20$kernel..process..process..task_struct$GT$11threadclone17ha25e98bd1351ab4dE: + +0000000080017480 <_ZN6kernel7process6thread55_$LT$impl$u20$kernel..process..process..task_struct$GT$11threadclone17ha25e98bd1351ab4dE>: +use crate::{process::*, arch::riscv::layout::PGSIZE}; + +impl task_struct { + pub fn threadclone(&mut self, func: usize, ustack: usize) -> usize { + 80017480: 7109 addi sp,sp,-384 + 80017482: fe86 sd ra,376(sp) + 80017484: f4b2 sd a2,104(sp) + 80017486: f8ae sd a1,112(sp) + 80017488: fcaa sd a0,120(sp) + 8001748a: f22a sd a0,288(sp) + 8001748c: f62e sd a1,296(sp) + 8001748e: fa32 sd a2,304(sp) + + let thread = ProcManager::alloc_thread().unwrap(); + 80017490: ffff7097 auipc ra,0xffff7 + 80017494: bba080e7 jalr -1094(ra) # 8000e04a <_ZN6kernel7process7manager11ProcManager12alloc_thread17h8a0457fc1a013afeE> + 80017498: e12a sd a0,128(sp) + 8001749a: a009 j 8001749c <_ZN6kernel7process6thread55_$LT$impl$u20$kernel..process..process..task_struct$GT$11threadclone17ha25e98bd1351ab4dE+0x1c> + 8001749c: 650a ld a0,128(sp) + +000000008001749e <.LBB22_16>: + 8001749e: 00014597 auipc a1,0x14 + 800174a2: ea258593 addi a1,a1,-350 # 8002b340 <.L__unnamed_16> + 800174a6: ffff8097 auipc ra,0xffff8 + 800174aa: 2ea080e7 jalr 746(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 800174ae: 85aa mv a1,a0 + 800174b0: f0ae sd a1,96(sp) + 800174b2: fe2a sd a0,312(sp) + 800174b4: a009 j 800174b6 <.LBB22_16+0x18> + thread.parent = Some(self as *mut task_struct); + 800174b6: 75e6 ld a1,120(sp) + 800174b8: 7506 ld a0,96(sp) + 800174ba: e92e sd a1,144(sp) + 800174bc: 4605 li a2,1 + 800174be: e532 sd a2,136(sp) + 800174c0: ed50 sd a2,152(a0) + 800174c2: f14c sd a1,160(a0) + + // let pgt_p = self.pagetable.as_mut().unwrap(); + // let pgt_t = thread.pagetable.as_mut().unwrap(); + + // pgt_p.copy_pagetable(pgt_t); + thread.pagetable = self.pagetable; + 800174c4: 6d90 ld a2,24(a1) + 800174c6: ed10 sd a2,24(a0) + + thread.open_files.clone_from(&self.open_files); + 800174c8: 0a850513 addi a0,a0,168 + 800174cc: 0a858593 addi a1,a1,168 + 800174d0: ffff8097 auipc ra,0xffff8 + 800174d4: 8b2080e7 jalr -1870(ra) # 8000ed82 <_ZN4core5clone5Clone10clone_from17h2b52fdc155b58fc3E> + 800174d8: a009 j 800174da <.LBB22_16+0x3c> + thread.cwd.clone_from(&self.cwd); + 800174da: 75e6 ld a1,120(sp) + 800174dc: 7506 ld a0,96(sp) + 800174de: 3c850513 addi a0,a0,968 + 800174e2: 3c858593 addi a1,a1,968 + 800174e6: ffff8097 auipc ra,0xffff8 + 800174ea: 4f2080e7 jalr 1266(ra) # 8000f9d8 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$10clone_from17hf5f00fe6cb298a0dE> + 800174ee: a009 j 800174f0 <.LBB22_16+0x52> + // println!("++++++++++++++++++++++"); + // while (true){ + + // } + // println!("In threadclone pid is {} the child is {} func is {} ustack is {}", self.pid, thread.pid, func, ustack); + thread.size = self.size; + 800174f0: 75e6 ld a1,120(sp) + 800174f2: 7506 ld a0,96(sp) + 800174f4: 6990 ld a2,16(a1) + 800174f6: e910 sd a2,16(a0) + thread.name = self.name; //to do + 800174f8: 4085c683 lbu a3,1032(a1) + 800174fc: 4095c603 lbu a2,1033(a1) + 80017500: 0622 slli a2,a2,0x8 + 80017502: 8ed1 or a3,a3,a2 + 80017504: 40a5c703 lbu a4,1034(a1) + 80017508: 40b5c603 lbu a2,1035(a1) + 8001750c: 0622 slli a2,a2,0x8 + 8001750e: 8e59 or a2,a2,a4 + 80017510: 0642 slli a2,a2,0x10 + 80017512: 8ed1 or a3,a3,a2 + 80017514: 40c5c703 lbu a4,1036(a1) + 80017518: 40d5c603 lbu a2,1037(a1) + 8001751c: 0622 slli a2,a2,0x8 + 8001751e: 8f51 or a4,a4,a2 + 80017520: 40e5c783 lbu a5,1038(a1) + 80017524: 40f5c603 lbu a2,1039(a1) + 80017528: 0622 slli a2,a2,0x8 + 8001752a: 8e5d or a2,a2,a5 + 8001752c: 0642 slli a2,a2,0x10 + 8001752e: 8e59 or a2,a2,a4 + 80017530: 1602 slli a2,a2,0x20 + 80017532: 8e55 or a2,a2,a3 + 80017534: f132 sd a2,160(sp) + 80017536: 4005c683 lbu a3,1024(a1) + 8001753a: 4015c603 lbu a2,1025(a1) + 8001753e: 0622 slli a2,a2,0x8 + 80017540: 8ed1 or a3,a3,a2 + 80017542: 4025c703 lbu a4,1026(a1) + 80017546: 4035c603 lbu a2,1027(a1) + 8001754a: 0622 slli a2,a2,0x8 + 8001754c: 8e59 or a2,a2,a4 + 8001754e: 0642 slli a2,a2,0x10 + 80017550: 8e55 or a2,a2,a3 + 80017552: 4045c703 lbu a4,1028(a1) + 80017556: 4055c683 lbu a3,1029(a1) + 8001755a: 06a2 slli a3,a3,0x8 + 8001755c: 8ed9 or a3,a3,a4 + 8001755e: 4065c703 lbu a4,1030(a1) + 80017562: 4075c583 lbu a1,1031(a1) + 80017566: 05a2 slli a1,a1,0x8 + 80017568: 8dd9 or a1,a1,a4 + 8001756a: 05c2 slli a1,a1,0x10 + 8001756c: 8dd5 or a1,a1,a3 + 8001756e: 1582 slli a1,a1,0x20 + 80017570: 8dd1 or a1,a1,a2 + 80017572: ed2e sd a1,152(sp) + 80017574: 40050513 addi a0,a0,1024 + 80017578: 092c addi a1,sp,152 + 8001757a: 4641 li a2,16 + 8001757c: 0000f097 auipc ra,0xf + 80017580: b06080e7 jalr -1274(ra) # 80026082 + 80017584: 7606 ld a2,96(sp) + 80017586: 75a6 ld a1,104(sp) + thread.thread_ustack = ustack; + 80017588: 7566 ld a0,120(sp) + 8001758a: e60c sd a1,8(a2) + + + + let ptf = self.trapframe as *const Trapframe; + 8001758c: 7108 ld a0,32(a0) + 8001758e: e8aa sd a0,80(sp) + 80017590: e2aa sd a0,320(sp) + + let ptfaddr = ptf as usize; + 80017592: 85aa mv a1,a0 + 80017594: ecae sd a1,88(sp) + 80017596: e6aa sd a0,328(sp) + let ttfaddr = ptfaddr + size_of::(); + 80017598: a009 j 8001759a <.LBB22_16+0xfc> + 8001759a: 65e6 ld a1,88(sp) + 8001759c: 12058513 addi a0,a1,288 + 800175a0: e4aa sd a0,72(sp) + 800175a2: 0eb56d63 bltu a0,a1,8001769c <.LBB22_21> + 800175a6: a009 j 800175a8 <.LBB22_16+0x10a> + 800175a8: 6526 ld a0,72(sp) + 800175aa: 65c6 ld a1,80(sp) + 800175ac: 7606 ld a2,96(sp) + 800175ae: eaaa sd a0,336(sp) + thread.trapframe = ttfaddr as *mut Trapframe; + 800175b0: f208 sd a0,32(a2) + let ttf = unsafe { &mut *(ttfaddr as *mut Trapframe) }; + 800175b2: 862a mv a2,a0 + 800175b4: f432 sd a2,40(sp) + 800175b6: eeaa sd a0,344(sp) + + println!("In clone ptf {} ttf {}", ptf as usize, ttf as *const _ as usize); + 800175b8: e62e sd a1,264(sp) + 800175ba: ea2a sd a0,272(sp) + 800175bc: 0228 addi a0,sp,264 + 800175be: fdaa sd a0,248(sp) + 800175c0: 0a0c addi a1,sp,272 + 800175c2: f82e sd a1,48(sp) + 800175c4: e22e sd a1,256(sp) + 800175c6: f2aa sd a0,352(sp) + 800175c8: f6ae sd a1,360(sp) + +00000000800175ca <.LBB22_17>: + 800175ca: 0000e597 auipc a1,0xe + 800175ce: 2d658593 addi a1,a1,726 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800175d2: 00009097 auipc ra,0x9 + 800175d6: f9c080e7 jalr -100(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800175da: fc2a sd a0,56(sp) + 800175dc: e0ae sd a1,64(sp) + 800175de: a009 j 800175e0 <.LBB22_17+0x16> + 800175e0: 7542 ld a0,48(sp) + +00000000800175e2 <.LBB22_18>: + 800175e2: 0000e597 auipc a1,0xe + 800175e6: 2be58593 addi a1,a1,702 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800175ea: 00009097 auipc ra,0x9 + 800175ee: f84080e7 jalr -124(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800175f2: ec2a sd a0,24(sp) + 800175f4: f02e sd a1,32(sp) + 800175f6: a009 j 800175f8 <.LBB22_18+0x16> + 800175f8: 7502 ld a0,32(sp) + 800175fa: 65e2 ld a1,24(sp) + 800175fc: 6606 ld a2,64(sp) + 800175fe: 76e2 ld a3,56(sp) + 80017600: edb6 sd a3,216(sp) + 80017602: f1b2 sd a2,224(sp) + 80017604: f5ae sd a1,232(sp) + 80017606: f9aa sd a0,240(sp) + +0000000080017608 <.LBB22_19>: + 80017608: 00014597 auipc a1,0x14 + 8001760c: d8058593 addi a1,a1,-640 # 8002b388 <.L__unnamed_17> + 80017610: 1128 addi a0,sp,168 + 80017612: 460d li a2,3 + 80017614: 09b4 addi a3,sp,216 + 80017616: 4709 li a4,2 + 80017618: fffee097 auipc ra,0xfffee + 8001761c: f72080e7 jalr -142(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80017620: a009 j 80017622 <.LBB22_19+0x1a> + 80017622: 1128 addi a0,sp,168 + 80017624: 00007097 auipc ra,0x7 + 80017628: 5d4080e7 jalr 1492(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001762c: a009 j 8001762e <.LBB22_19+0x26> + unsafe{ copy_nonoverlapping(ptf, ttf, 1); } + 8001762e: 7522 ld a0,40(sp) + 80017630: 65c6 ld a1,80(sp) + 80017632: 12000613 li a2,288 + 80017636: 0000f097 auipc ra,0xf + 8001763a: a4c080e7 jalr -1460(ra) # 80026082 + 8001763e: 7622 ld a2,40(sp) + 80017640: 75a6 ld a1,104(sp) + // ttf.a0 = 0; + + ttf.epc = func; + 80017642: 7546 ld a0,112(sp) + 80017644: ee08 sd a0,24(a2) + 80017646: 6505 lui a0,0x1 + + ttf.sp = ustack + PGSIZE; + 80017648: 952e add a0,a0,a1 + 8001764a: e82a sd a0,16(sp) + 8001764c: 06b56663 bltu a0,a1,800176b8 <.LBB22_23> + 80017650: a009 j 80017652 <.LBB22_19+0x4a> + 80017652: 6542 ld a0,16(sp) + 80017654: 75a2 ld a1,40(sp) + 80017656: f988 sd a0,48(a1) + 80017658: 6509 lui a0,0x2 + 8001765a: 0c85059b addiw a1,a0,200 + +000000008001765e <.LBB22_20>: + 8001765e: 00042517 auipc a0,0x42 + 80017662: d7250513 addi a0,a0,-654 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80017666: 952e add a0,a0,a1 + // ttf.ra = 0; + // ttf.s0 = ttf.sp; + //file + + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + 80017668: ffffa097 auipc ra,0xffffa + 8001766c: 9da080e7 jalr -1574(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 80017670: 85aa mv a1,a0 + 80017672: e42e sd a1,8(sp) + 80017674: faaa sd a0,368(sp) + 80017676: a009 j 80017678 <.LBB22_20+0x1a> + 80017678: 6522 ld a0,8(sp) + 8001767a: 7606 ld a2,96(sp) + 8001767c: 458d li a1,3 + thread.state = ProcState::RUNNABLE; + 8001767e: 10b10fa3 sb a1,287(sp) + 80017682: 40b60823 sb a1,1040(a2) + drop(guard); + 80017686: 00006097 auipc ra,0x6 + 8001768a: 762080e7 jalr 1890(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001768e: a009 j 80017690 <.LBB22_20+0x32> + // println!("In threadclone proc {}, ctx_p {}, thread {} ctx_t {}", self.pid, ctx_p.ra(), thread.pid, ctx_t.ra()); + + + // let tf = unsafe{ &mut *thread.trapframe }; + // println!("In threadclone pid {} epc {}", thread.pid, tf.epc); + thread.pid + 80017690: 7506 ld a0,96(sp) + 80017692: 3f053503 ld a0,1008(a0) + } + 80017696: 70f6 ld ra,376(sp) + 80017698: 6119 addi sp,sp,384 + 8001769a: 8082 ret + +000000008001769c <.LBB22_21>: + let ttfaddr = ptfaddr + size_of::(); + 8001769c: 00014517 auipc a0,0x14 + 800176a0: af450513 addi a0,a0,-1292 # 8002b190 + +00000000800176a4 <.LBB22_22>: + 800176a4: 00014617 auipc a2,0x14 + 800176a8: cb460613 addi a2,a2,-844 # 8002b358 <.L__unnamed_18> + 800176ac: 45f1 li a1,28 + 800176ae: 0000c097 auipc ra,0xc + 800176b2: a96080e7 jalr -1386(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800176b8 <.LBB22_23>: + ttf.sp = ustack + PGSIZE; + 800176b8: 00014517 auipc a0,0x14 + 800176bc: ad850513 addi a0,a0,-1320 # 8002b190 + +00000000800176c0 <.LBB22_24>: + 800176c0: 00014617 auipc a2,0x14 + 800176c4: cf860613 addi a2,a2,-776 # 8002b3b8 <.L__unnamed_19> + 800176c8: 45f1 li a1,28 + 800176ca: 0000c097 auipc ra,0xc + 800176ce: a7a080e7 jalr -1414(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN72_$LT$kernel..process..process..ProcState$u20$as$u20$core..fmt..Debug$GT$3fmt17hf525681892d4cccaE: + +00000000800176d4 <_ZN72_$LT$kernel..process..process..ProcState$u20$as$u20$core..fmt..Debug$GT$3fmt17hf525681892d4cccaE>: +#[derive(PartialEq, Copy, Clone, Debug)] + 800176d4: 712d addi sp,sp,-288 + 800176d6: ee06 sd ra,280(sp) + 800176d8: e42e sd a1,8(sp) + 800176da: e9aa sd a0,208(sp) + 800176dc: edae sd a1,216(sp) + 800176de: f02a sd a0,32(sp) + 800176e0: 00054503 lbu a0,0(a0) + 800176e4: e82a sd a0,16(sp) + 800176e6: 6542 ld a0,16(sp) + 800176e8: 050e slli a0,a0,0x3 + +00000000800176ea <.LBB23_18>: + 800176ea: 00014597 auipc a1,0x14 + 800176ee: a3e58593 addi a1,a1,-1474 # 8002b128 <.LJTI23_0> + 800176f2: 952e add a0,a0,a1 + 800176f4: 6108 ld a0,0(a0) + 800176f6: 8502 jr a0 + +00000000800176f8 <.LBB23_2>: + 800176f8: 65a2 ld a1,8(sp) + +00000000800176fa <.LBB23_19>: + 800176fa: 00014617 auipc a2,0x14 + 800176fe: cd660613 addi a2,a2,-810 # 8002b3d0 <.L__unnamed_20> + 80017702: 1928 addi a0,sp,184 + 80017704: 46a5 li a3,9 + 80017706: 0000d097 auipc ra,0xd + 8001770a: 9bc080e7 jalr -1604(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001770e: a201 j 8001780e <.LBB23_25+0x28> + ... + +0000000080017712 <.LBB23_4>: + 80017712: 65a2 ld a1,8(sp) + +0000000080017714 <.LBB23_20>: + 80017714: 00014617 auipc a2,0x14 + 80017718: cd260613 addi a2,a2,-814 # 8002b3e6 <.L__unnamed_21> + 8001771c: 1028 addi a0,sp,40 + 8001771e: 4699 li a3,6 + 80017720: 0000d097 auipc ra,0xd + 80017724: 9a2080e7 jalr -1630(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80017728: a009 j 8001772a <.LBB23_20+0x16> + 8001772a: 1028 addi a0,sp,40 + 8001772c: ea2a sd a0,272(sp) + 8001772e: 0000c097 auipc ra,0xc + 80017732: fec080e7 jalr -20(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80017736: 00a10fa3 sb a0,31(sp) + 8001773a: a0dd j 80017820 <.LBB23_25+0x3a> + +000000008001773c <.LBB23_6>: + 8001773c: 65a2 ld a1,8(sp) + +000000008001773e <.LBB23_21>: + 8001773e: 00010617 auipc a2,0x10 + 80017742: fba60613 addi a2,a2,-70 # 800276f8 <.LJTI3_0+0x78> + 80017746: 0088 addi a0,sp,64 + 80017748: 4691 li a3,4 + 8001774a: 0000d097 auipc ra,0xd + 8001774e: 978080e7 jalr -1672(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 80017752: a009 j 80017754 <.LBB23_21+0x16> + 80017754: 0088 addi a0,sp,64 + 80017756: e62a sd a0,264(sp) + 80017758: 0000c097 auipc ra,0xc + 8001775c: fc2080e7 jalr -62(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80017760: 00a10fa3 sb a0,31(sp) + 80017764: a875 j 80017820 <.LBB23_25+0x3a> + +0000000080017766 <.LBB23_8>: + 80017766: 65a2 ld a1,8(sp) + +0000000080017768 <.LBB23_22>: + 80017768: 00010617 auipc a2,0x10 + 8001776c: 0e060613 addi a2,a2,224 # 80027848 <.L__unnamed_6+0xb8> + 80017770: 08a8 addi a0,sp,88 + 80017772: 46a1 li a3,8 + 80017774: 0000d097 auipc ra,0xd + 80017778: 94e080e7 jalr -1714(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 8001777c: a009 j 8001777e <.LBB23_22+0x16> + 8001777e: 08a8 addi a0,sp,88 + 80017780: e22a sd a0,256(sp) + 80017782: 0000c097 auipc ra,0xc + 80017786: f98080e7 jalr -104(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001778a: 00a10fa3 sb a0,31(sp) + 8001778e: a849 j 80017820 <.LBB23_25+0x3a> + +0000000080017790 <.LBB23_10>: + 80017790: 65a2 ld a1,8(sp) + +0000000080017792 <.LBB23_23>: + 80017792: 00010617 auipc a2,0x10 + 80017796: 0e660613 addi a2,a2,230 # 80027878 <.L__unnamed_6+0xe8> + 8001779a: 1888 addi a0,sp,112 + 8001779c: 46a1 li a3,8 + 8001779e: 0000d097 auipc ra,0xd + 800177a2: 924080e7 jalr -1756(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800177a6: a009 j 800177a8 <.LBB23_23+0x16> + 800177a8: 1888 addi a0,sp,112 + 800177aa: fdaa sd a0,248(sp) + 800177ac: 0000c097 auipc ra,0xc + 800177b0: f6e080e7 jalr -146(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800177b4: 00a10fa3 sb a0,31(sp) + 800177b8: a0a5 j 80017820 <.LBB23_25+0x3a> + +00000000800177ba <.LBB23_12>: + 800177ba: 65a2 ld a1,8(sp) + +00000000800177bc <.LBB23_24>: + 800177bc: 00014617 auipc a2,0x14 + 800177c0: c2360613 addi a2,a2,-989 # 8002b3df <.L__unnamed_25> + 800177c4: 0128 addi a0,sp,136 + 800177c6: 469d li a3,7 + 800177c8: 0000d097 auipc ra,0xd + 800177cc: 8fa080e7 jalr -1798(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800177d0: a009 j 800177d2 <.LBB23_24+0x16> + 800177d2: 0128 addi a0,sp,136 + 800177d4: f9aa sd a0,240(sp) + 800177d6: 0000c097 auipc ra,0xc + 800177da: f44080e7 jalr -188(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 800177de: 00a10fa3 sb a0,31(sp) + 800177e2: a83d j 80017820 <.LBB23_25+0x3a> + +00000000800177e4 <.LBB23_14>: + 800177e4: 65a2 ld a1,8(sp) + +00000000800177e6 <.LBB23_25>: + 800177e6: 00014617 auipc a2,0x14 + 800177ea: bf360613 addi a2,a2,-1037 # 8002b3d9 <.L__unnamed_26> + 800177ee: 1108 addi a0,sp,160 + 800177f0: 4699 li a3,6 + 800177f2: 0000d097 auipc ra,0xd + 800177f6: 8d0080e7 jalr -1840(ra) # 800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E> + 800177fa: a009 j 800177fc <.LBB23_25+0x16> + 800177fc: 1108 addi a0,sp,160 + 800177fe: f5aa sd a0,232(sp) + 80017800: 0000c097 auipc ra,0xc + 80017804: f1a080e7 jalr -230(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 80017808: 00a10fa3 sb a0,31(sp) + 8001780c: a811 j 80017820 <.LBB23_25+0x3a> + 8001780e: 1928 addi a0,sp,184 + 80017810: f1aa sd a0,224(sp) + 80017812: 0000c097 auipc ra,0xc + 80017816: f08080e7 jalr -248(ra) # 8002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE> + 8001781a: 00a10fa3 sb a0,31(sp) + 8001781e: a009 j 80017820 <.LBB23_25+0x3a> + 80017820: 01f14503 lbu a0,31(sp) + 80017824: 60f2 ld ra,280(sp) + 80017826: 6115 addi sp,sp,288 + 80017828: 8082 ret + +Disassembly of section .text._ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE: + +000000008001782a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE>: + 8001782a: 7179 addi sp,sp,-48 + 8001782c: e82a sd a0,16(sp) + 8001782e: ec2e sd a1,24(sp) + 80017830: 00054503 lbu a0,0(a0) + 80017834: f02a sd a0,32(sp) + 80017836: 0005c583 lbu a1,0(a1) + 8001783a: f42e sd a1,40(sp) + 8001783c: 00b51763 bne a0,a1,8001784a <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x20> + 80017840: a009 j 80017842 <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x18> + 80017842: 4505 li a0,1 + 80017844: 00a107a3 sb a0,15(sp) + 80017848: a029 j 80017852 <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x28> + 8001784a: 4501 li a0,0 + 8001784c: 00a107a3 sb a0,15(sp) + 80017850: a009 j 80017852 <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x28> + 80017852: 00f14503 lbu a0,15(sp) + 80017856: 8905 andi a0,a0,1 + 80017858: 4581 li a1,0 + 8001785a: 00b50763 beq a0,a1,80017868 <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x3e> + 8001785e: a009 j 80017860 <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x36> + 80017860: 4505 li a0,1 + 80017862: 00a10723 sb a0,14(sp) + 80017866: a029 j 80017870 <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x46> + 80017868: 4501 li a0,0 + 8001786a: 00a10723 sb a0,14(sp) + 8001786e: a009 j 80017870 <_ZN76_$LT$kernel..process..process..ProcState$u20$as$u20$core..cmp..PartialEq$GT$2eq17hc7c8c767a75b25feE+0x46> + 80017870: 00e14503 lbu a0,14(sp) + 80017874: 6145 addi sp,sp,48 + 80017876: 8082 ret + +Disassembly of section .text._ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17hbbfc32722f2025bdE: + +0000000080017878 <_ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17hbbfc32722f2025bdE>: + +impl<'a, T: 'a, A: Allocator + 'a> SpecExtend<&'a T, slice::Iter<'a, T>> for Vec +where + T: Copy, +{ + fn spec_extend(&mut self, iterator: slice::Iter<'a, T>) { + 80017878: 715d addi sp,sp,-80 + 8001787a: e486 sd ra,72(sp) + 8001787c: e42a sd a0,8(sp) + 8001787e: f02e sd a1,32(sp) + 80017880: f432 sd a2,40(sp) + 80017882: f82a sd a0,48(sp) + 80017884: 1008 addi a0,sp,32 + let slice = iterator.as_slice(); + 80017886: ffff4097 auipc ra,0xffff4 + 8001788a: cd6080e7 jalr -810(ra) # 8000b55c <_ZN4core5slice4iter13Iter$LT$T$GT$8as_slice17hddf2d5a72581ec8fE> + 8001788e: 862a mv a2,a0 + 80017890: e832 sd a2,16(sp) + 80017892: 862e mv a2,a1 + 80017894: ec32 sd a2,24(sp) + 80017896: fc2a sd a0,56(sp) + 80017898: e0ae sd a1,64(sp) + 8001789a: a009 j 8001789c <_ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17hbbfc32722f2025bdE+0x24> + unsafe { self.append_elements(slice) }; + 8001789c: 6662 ld a2,24(sp) + 8001789e: 65c2 ld a1,16(sp) + 800178a0: 6522 ld a0,8(sp) + 800178a2: 00000097 auipc ra,0x0 + 800178a6: 054080e7 jalr 84(ra) # 800178f6 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E> + 800178aa: a009 j 800178ac <_ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17hbbfc32722f2025bdE+0x34> + } + 800178ac: 60a6 ld ra,72(sp) + 800178ae: 6161 addi sp,sp,80 + 800178b0: 8082 ret + +Disassembly of section .text._ZN5alloc3vec12Vec$LT$T$GT$3new17hfad72d6537ee9e7bE: + +00000000800178b2 <_ZN5alloc3vec12Vec$LT$T$GT$3new17hfad72d6537ee9e7bE>: + pub const fn new() -> Self { + 800178b2: 85aa mv a1,a0 + +00000000800178b4 <.LBB1_1>: + 800178b4: 0000f517 auipc a0,0xf + 800178b8: dcc50513 addi a0,a0,-564 # 80026680 <.L__unnamed_35+0x48> + Vec { buf: RawVec::NEW, len: 0 } + 800178bc: 6110 ld a2,0(a0) + 800178be: 6508 ld a0,8(a0) + 800178c0: e190 sd a2,0(a1) + 800178c2: e588 sd a0,8(a1) + 800178c4: 4501 li a0,0 + 800178c6: e988 sd a0,16(a1) + } + 800178c8: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE: + +00000000800178ca <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE>: + pub fn as_mut_ptr(&mut self) -> *mut T { + 800178ca: 1101 addi sp,sp,-32 + 800178cc: ec06 sd ra,24(sp) + 800178ce: e42a sd a0,8(sp) + let ptr = self.buf.ptr(); + 800178d0: fffeb097 auipc ra,0xfffeb + 800178d4: 440080e7 jalr 1088(ra) # 80002d10 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$3ptr17h887fa3437b1e26b7E> + 800178d8: 85aa mv a1,a0 + 800178da: e02e sd a1,0(sp) + 800178dc: e82a sd a0,16(sp) + 800178de: a009 j 800178e0 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE+0x16> + assume(!ptr.is_null()); + 800178e0: 6502 ld a0,0(sp) + 800178e2: 00009097 auipc ra,0x9 + 800178e6: d6e080e7 jalr -658(ra) # 80020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E> + 800178ea: a009 j 800178ec <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE+0x22> + 800178ec: a009 j 800178ee <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE+0x24> + } + 800178ee: 6502 ld a0,0(sp) + 800178f0: 60e2 ld ra,24(sp) + 800178f2: 6105 addi sp,sp,32 + 800178f4: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E: + +00000000800178f6 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E>: + unsafe fn append_elements(&mut self, other: *const [T]) { + 800178f6: 7159 addi sp,sp,-112 + 800178f8: f486 sd ra,104(sp) + 800178fa: f032 sd a2,32(sp) + 800178fc: 862e mv a2,a1 + 800178fe: 7582 ld a1,32(sp) + 80017900: f432 sd a2,40(sp) + 80017902: 862a mv a2,a0 + 80017904: 7522 ld a0,40(sp) + 80017906: f832 sd a2,48(sp) + 80017908: e0b2 sd a2,64(sp) + 8001790a: e4aa sd a0,72(sp) + 8001790c: e8ae sd a1,80(sp) + let count = unsafe { (*other).len() }; + 8001790e: 00009097 auipc ra,0x9 + 80017912: b94080e7 jalr -1132(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80017916: 85aa mv a1,a0 + 80017918: fc2e sd a1,56(sp) + 8001791a: ecaa sd a0,88(sp) + 8001791c: a009 j 8001791e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E+0x28> + self.reserve(count); + 8001791e: 75e2 ld a1,56(sp) + 80017920: 7542 ld a0,48(sp) + 80017922: 00000097 auipc ra,0x0 + 80017926: 178080e7 jalr 376(ra) # 80017a9a <_ZN5alloc3vec16Vec$LT$T$C$A$GT$7reserve17h4180bbdadc64f26bE> + 8001792a: a009 j 8001792c <_ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E+0x36> + let len = self.len(); + 8001792c: 7542 ld a0,48(sp) + 8001792e: 00000097 auipc ra,0x0 + 80017932: 0bc080e7 jalr 188(ra) # 800179ea <_ZN5alloc3vec16Vec$LT$T$C$A$GT$3len17h0f145fd3397d7265E> + 80017936: 85aa mv a1,a0 + 80017938: ec2e sd a1,24(sp) + 8001793a: f0aa sd a0,96(sp) + 8001793c: a009 j 8001793e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E+0x48> + unsafe { ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) }; + 8001793e: 7542 ld a0,48(sp) + 80017940: 75a2 ld a1,40(sp) + 80017942: e42e sd a1,8(sp) + 80017944: 00000097 auipc ra,0x0 + 80017948: f86080e7 jalr -122(ra) # 800178ca <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE> + 8001794c: e82a sd a0,16(sp) + 8001794e: a009 j 80017950 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E+0x5a> + 80017950: 65e2 ld a1,24(sp) + 80017952: 6542 ld a0,16(sp) + 80017954: 00009097 auipc ra,0x9 + 80017958: c78080e7 jalr -904(ra) # 800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E> + 8001795c: e02a sd a0,0(sp) + 8001795e: a009 j 80017960 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$15append_elements17h8b8f278f0e0e7850E+0x6a> + 80017960: 7662 ld a2,56(sp) + 80017962: 65a2 ld a1,8(sp) + 80017964: 6502 ld a0,0(sp) + 80017966: 0000e097 auipc ra,0xe + 8001796a: 71c080e7 jalr 1820(ra) # 80026082 + 8001796e: 7662 ld a2,56(sp) + 80017970: 75c2 ld a1,48(sp) + self.len += count; + 80017972: 6988 ld a0,16(a1) + 80017974: 9532 add a0,a0,a2 + 80017976: e988 sd a0,16(a1) + } + 80017978: 70a6 ld ra,104(sp) + 8001797a: 6165 addi sp,sp,112 + 8001797c: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$16with_capacity_in17hb324b531b744c1e4E: + +000000008001797e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$16with_capacity_in17hb324b531b744c1e4E>: + pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { + 8001797e: 7139 addi sp,sp,-64 + 80017980: fc06 sd ra,56(sp) + 80017982: e42e sd a1,8(sp) + 80017984: 85aa mv a1,a0 + 80017986: 6522 ld a0,8(sp) + 80017988: e82e sd a1,16(sp) + 8001798a: f42a sd a0,40(sp) + Vec { buf: RawVec::with_capacity_in(capacity, alloc), len: 0 } + 8001798c: fffeb097 auipc ra,0xfffeb + 80017990: 30c080e7 jalr 780(ra) # 80002c98 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$16with_capacity_in17hb06502444696164dE> + 80017994: ec2a sd a0,24(sp) + 80017996: f02e sd a1,32(sp) + 80017998: a009 j 8001799a <_ZN5alloc3vec16Vec$LT$T$C$A$GT$16with_capacity_in17hb324b531b744c1e4E+0x1c> + 8001799a: 65c2 ld a1,16(sp) + 8001799c: 7502 ld a0,32(sp) + 8001799e: 6662 ld a2,24(sp) + 800179a0: e190 sd a2,0(a1) + 800179a2: e588 sd a0,8(a1) + 800179a4: 4501 li a0,0 + 800179a6: e988 sd a0,16(a1) + } + 800179a8: 70e2 ld ra,56(sp) + 800179aa: 6121 addi sp,sp,64 + 800179ac: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$17extend_from_slice17hce4d1786c1c715b0E: + +00000000800179ae <_ZN5alloc3vec16Vec$LT$T$C$A$GT$17extend_from_slice17hce4d1786c1c715b0E>: + pub fn extend_from_slice(&mut self, other: &[T]) { + 800179ae: 715d addi sp,sp,-80 + 800179b0: e486 sd ra,72(sp) + 800179b2: e432 sd a2,8(sp) + 800179b4: 862e mv a2,a1 + 800179b6: 65a2 ld a1,8(sp) + 800179b8: e832 sd a2,16(sp) + 800179ba: 862a mv a2,a0 + 800179bc: 6542 ld a0,16(sp) + 800179be: ec32 sd a2,24(sp) + 800179c0: f832 sd a2,48(sp) + 800179c2: fc2a sd a0,56(sp) + 800179c4: e0ae sd a1,64(sp) + self.spec_extend(other.iter()) + 800179c6: 00009097 auipc ra,0x9 + 800179ca: b04080e7 jalr -1276(ra) # 800204ca <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17h8f308ca2182773f1E> + 800179ce: f02a sd a0,32(sp) + 800179d0: f42e sd a1,40(sp) + 800179d2: a009 j 800179d4 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$17extend_from_slice17hce4d1786c1c715b0E+0x26> + 800179d4: 7622 ld a2,40(sp) + 800179d6: 7582 ld a1,32(sp) + 800179d8: 6562 ld a0,24(sp) + 800179da: 00000097 auipc ra,0x0 + 800179de: e9e080e7 jalr -354(ra) # 80017878 <_ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17hbbfc32722f2025bdE> + 800179e2: a009 j 800179e4 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$17extend_from_slice17hce4d1786c1c715b0E+0x36> + } + 800179e4: 60a6 ld ra,72(sp) + 800179e6: 6161 addi sp,sp,80 + 800179e8: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$3len17h0f145fd3397d7265E: + +00000000800179ea <_ZN5alloc3vec16Vec$LT$T$C$A$GT$3len17h0f145fd3397d7265E>: + pub fn len(&self) -> usize { + 800179ea: 1141 addi sp,sp,-16 + 800179ec: e42a sd a0,8(sp) + self.len + 800179ee: 6908 ld a0,16(a0) + } + 800179f0: 0141 addi sp,sp,16 + 800179f2: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E: + +00000000800179f4 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E>: + pub fn push(&mut self, value: T) { + 800179f4: 711d addi sp,sp,-96 + 800179f6: ec86 sd ra,88(sp) + 800179f8: e82a sd a0,16(sp) + 800179fa: 862e mv a2,a1 + 800179fc: ec32 sd a2,24(sp) + 800179fe: f82a sd a0,48(sp) + 80017a00: 02b10fa3 sb a1,63(sp) + if self.len == self.buf.capacity() { + 80017a04: 690c ld a1,16(a0) + 80017a06: f02e sd a1,32(sp) + 80017a08: e8aa sd a0,80(sp) + if mem::size_of::() == 0 { usize::MAX } else { self.cap } + 80017a0a: 6508 ld a0,8(a0) + 80017a0c: f42a sd a0,40(sp) + 80017a0e: e4aa sd a0,72(sp) + 80017a10: a009 j 80017a12 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x1e> + 80017a12: 7502 ld a0,32(sp) + 80017a14: 75a2 ld a1,40(sp) + 80017a16: 00b51a63 bne a0,a1,80017a2a <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x36> + 80017a1a: a009 j 80017a1c <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x28> + self.reserve(1); + 80017a1c: 6542 ld a0,16(sp) + 80017a1e: 4585 li a1,1 + 80017a20: 00000097 auipc ra,0x0 + 80017a24: 07a080e7 jalr 122(ra) # 80017a9a <_ZN5alloc3vec16Vec$LT$T$C$A$GT$7reserve17h4180bbdadc64f26bE> + 80017a28: a011 j 80017a2c <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x38> + if self.len == self.buf.capacity() { + 80017a2a: a011 j 80017a2e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x3a> + 80017a2c: a009 j 80017a2e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x3a> + let end = self.as_mut_ptr().add(self.len); + 80017a2e: 6542 ld a0,16(sp) + 80017a30: 00000097 auipc ra,0x0 + 80017a34: e9a080e7 jalr -358(ra) # 800178ca <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE> + 80017a38: e42a sd a0,8(sp) + 80017a3a: a009 j 80017a3c <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x48> + 80017a3c: 6522 ld a0,8(sp) + 80017a3e: 65c2 ld a1,16(sp) + 80017a40: 698c ld a1,16(a1) + 80017a42: 00009097 auipc ra,0x9 + 80017a46: b8a080e7 jalr -1142(ra) # 800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E> + 80017a4a: 85aa mv a1,a0 + 80017a4c: e02e sd a1,0(sp) + 80017a4e: e0aa sd a0,64(sp) + 80017a50: a009 j 80017a52 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x5e> + ptr::write(end, value); + 80017a52: 65e2 ld a1,24(sp) + 80017a54: 6502 ld a0,0(sp) + 80017a56: 00002097 auipc ra,0x2 + 80017a5a: c26080e7 jalr -986(ra) # 8001967c <_ZN4core3ptr5write17h0fb1ba83ac2984c7E> + 80017a5e: a009 j 80017a60 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E+0x6c> + self.len += 1; + 80017a60: 65c2 ld a1,16(sp) + 80017a62: 6988 ld a0,16(a1) + 80017a64: 0505 addi a0,a0,1 + 80017a66: e988 sd a0,16(a1) + } + 80017a68: 60e6 ld ra,88(sp) + 80017a6a: 6125 addi sp,sp,96 + 80017a6c: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$6as_ptr17h07b3ea85571460a0E: + +0000000080017a6e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$6as_ptr17h07b3ea85571460a0E>: + pub fn as_ptr(&self) -> *const T { + 80017a6e: 1101 addi sp,sp,-32 + 80017a70: ec06 sd ra,24(sp) + 80017a72: e42a sd a0,8(sp) + let ptr = self.buf.ptr(); + 80017a74: fffeb097 auipc ra,0xfffeb + 80017a78: 29c080e7 jalr 668(ra) # 80002d10 <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$3ptr17h887fa3437b1e26b7E> + 80017a7c: 85aa mv a1,a0 + 80017a7e: e02e sd a1,0(sp) + 80017a80: e82a sd a0,16(sp) + 80017a82: a009 j 80017a84 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$6as_ptr17h07b3ea85571460a0E+0x16> + assume(!ptr.is_null()); + 80017a84: 6502 ld a0,0(sp) + 80017a86: 00009097 auipc ra,0x9 + 80017a8a: bca080e7 jalr -1078(ra) # 80020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E> + 80017a8e: a009 j 80017a90 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$6as_ptr17h07b3ea85571460a0E+0x22> + 80017a90: a009 j 80017a92 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$6as_ptr17h07b3ea85571460a0E+0x24> + } + 80017a92: 6502 ld a0,0(sp) + 80017a94: 60e2 ld ra,24(sp) + 80017a96: 6105 addi sp,sp,32 + 80017a98: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$7reserve17h4180bbdadc64f26bE: + +0000000080017a9a <_ZN5alloc3vec16Vec$LT$T$C$A$GT$7reserve17h4180bbdadc64f26bE>: + pub fn reserve(&mut self, additional: usize) { + 80017a9a: 1101 addi sp,sp,-32 + 80017a9c: ec06 sd ra,24(sp) + 80017a9e: 862e mv a2,a1 + 80017aa0: e42a sd a0,8(sp) + 80017aa2: e832 sd a2,16(sp) + self.buf.reserve(self.len, additional); + 80017aa4: 690c ld a1,16(a0) + 80017aa6: fffeb097 auipc ra,0xfffeb + 80017aaa: 2a4080e7 jalr 676(ra) # 80002d4a <_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve17hb5cb67f1b8f5bd01E> + 80017aae: a009 j 80017ab0 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$7reserve17h4180bbdadc64f26bE+0x16> + } + 80017ab0: 60e2 ld ra,24(sp) + 80017ab2: 6105 addi sp,sp,32 + 80017ab4: 8082 ret + +Disassembly of section .text._ZN5alloc3vec16Vec$LT$T$C$A$GT$7set_len17h69219cf242af5cbaE: + +0000000080017ab6 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$7set_len17h69219cf242af5cbaE>: + pub unsafe fn set_len(&mut self, new_len: usize) { + 80017ab6: 1141 addi sp,sp,-16 + 80017ab8: e02a sd a0,0(sp) + 80017aba: e42e sd a1,8(sp) + self.len = new_len; + 80017abc: e90c sd a1,16(a0) + } + 80017abe: 0141 addi sp,sp,16 + 80017ac0: 8082 ret + +Disassembly of section .text._ZN5alloc3vec9from_elem17h254506728307fd13E: + +0000000080017ac2 <_ZN5alloc3vec9from_elem17h254506728307fd13E>: +pub fn from_elem(elem: T, n: usize) -> Vec { + 80017ac2: 1101 addi sp,sp,-32 + 80017ac4: ec06 sd ra,24(sp) + 80017ac6: 00b107a3 sb a1,15(sp) + 80017aca: e832 sd a2,16(sp) + ::from_elem(elem, n, Global) + 80017acc: fffeb097 auipc ra,0xfffeb + 80017ad0: b1a080e7 jalr -1254(ra) # 800025e6 <_ZN63_$LT$u8$u20$as$u20$alloc..vec..spec_from_elem..SpecFromElem$GT$9from_elem17h7bf881e84d821ad0E> + 80017ad4: a009 j 80017ad6 <_ZN5alloc3vec9from_elem17h254506728307fd13E+0x14> +} + 80017ad6: 60e2 ld ra,24(sp) + 80017ad8: 6105 addi sp,sp,32 + 80017ada: 8082 ret + +Disassembly of section .text._ZN72_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h57bbbed72157e211E: + +0000000080017adc <_ZN72_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h57bbbed72157e211E>: + fn deref(&self) -> &[T] { + 80017adc: 7179 addi sp,sp,-48 + 80017ade: f406 sd ra,40(sp) + 80017ae0: e82a sd a0,16(sp) + 80017ae2: f02a sd a0,32(sp) + unsafe { slice::from_raw_parts(self.as_ptr(), self.len) } + 80017ae4: 00000097 auipc ra,0x0 + 80017ae8: f8a080e7 jalr -118(ra) # 80017a6e <_ZN5alloc3vec16Vec$LT$T$C$A$GT$6as_ptr17h07b3ea85571460a0E> + 80017aec: ec2a sd a0,24(sp) + 80017aee: a009 j 80017af0 <_ZN72_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h57bbbed72157e211E+0x14> + 80017af0: 6562 ld a0,24(sp) + 80017af2: 65c2 ld a1,16(sp) + 80017af4: 698c ld a1,16(a1) + 80017af6: fffee097 auipc ra,0xfffee + 80017afa: 9f8080e7 jalr -1544(ra) # 800054ee <_ZN4core5slice3raw14from_raw_parts17hf1accf0e45b69f71E> + 80017afe: e02a sd a0,0(sp) + 80017b00: e42e sd a1,8(sp) + 80017b02: a009 j 80017b04 <_ZN72_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h57bbbed72157e211E+0x28> + } + 80017b04: 65a2 ld a1,8(sp) + 80017b06: 6502 ld a0,0(sp) + 80017b08: 70a2 ld ra,40(sp) + 80017b0a: 6145 addi sp,sp,48 + 80017b0c: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register5mtvec5write17h0d760c5cb091ccffE: + +0000000080017b0e <_ZN6kernel4arch5riscv8register5mtvec5write17h0d760c5cb091ccffE>: + llvm_asm!("csrr $0, mtvec":"=r"(ret):::"volatile"); + ret +} + +#[inline] +pub unsafe fn write(x:usize){ + 80017b0e: 1141 addi sp,sp,-16 + 80017b10: e42a sd a0,8(sp) + llvm_asm!("csrw mtvec, $0"::"r"(x)::"volatile"); + 80017b12: 30551073 csrw mtvec,a0 + 80017b16: 0141 addi sp,sp,16 + 80017b18: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable7as_addr17hcce185773f2c85f7E: + +0000000080017b1a <_ZN6kernel6memory7mapping10page_table9PageTable7as_addr17hcce185773f2c85f7E>: + +static mut KERNEL_PAGETABLE:PageTable = PageTable::empty(); + + +impl PageTable{ + pub fn as_addr(&self) -> usize{ + 80017b1a: 1101 addi sp,sp,-32 + 80017b1c: ec06 sd ra,24(sp) + 80017b1e: e82a sd a0,16(sp) + 80017b20: 20000593 li a1,512 + self.entries.as_ptr() as usize + 80017b24: 00006097 auipc ra,0x6 + 80017b28: 0da080e7 jalr 218(ra) # 8001dbfe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hc0b1197304dd53e6E> + 80017b2c: e42a sd a0,8(sp) + 80017b2e: a009 j 80017b30 <_ZN6kernel6memory7mapping10page_table9PageTable7as_addr17hcce185773f2c85f7E+0x16> + } + 80017b30: 6522 ld a0,8(sp) + 80017b32: 60e2 ld ra,24(sp) + 80017b34: 6105 addi sp,sp,32 + 80017b36: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable7as_satp17h97121d8f678f163eE: + +0000000080017b38 <_ZN6kernel6memory7mapping10page_table9PageTable7as_satp17h97121d8f678f163eE>: + } + } + + /// Convert the page table to be the usize + /// that can be written in satp register + pub fn as_satp(&self) -> usize { + 80017b38: 1101 addi sp,sp,-32 + 80017b3a: ec06 sd ra,24(sp) + 80017b3c: e82a sd a0,16(sp) + 80017b3e: 20000593 li a1,512 + satp::SATP_SV39 | ((self.entries.as_ptr() as usize) >> PGSHIFT) + 80017b42: 00006097 auipc ra,0x6 + 80017b46: 0bc080e7 jalr 188(ra) # 8001dbfe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hc0b1197304dd53e6E> + 80017b4a: e42a sd a0,8(sp) + 80017b4c: a009 j 80017b4e <_ZN6kernel6memory7mapping10page_table9PageTable7as_satp17h97121d8f678f163eE+0x16> + 80017b4e: 6522 ld a0,8(sp) + 80017b50: 8131 srli a0,a0,0xc + 80017b52: e02a sd a0,0(sp) + 80017b54: a009 j 80017b56 <_ZN6kernel6memory7mapping10page_table9PageTable7as_satp17h97121d8f678f163eE+0x1e> + 80017b56: 6502 ld a0,0(sp) + 80017b58: 55fd li a1,-1 + 80017b5a: 15fe slli a1,a1,0x3f + 80017b5c: 8d4d or a0,a0,a1 + } + 80017b5e: 60e2 ld ra,24(sp) + 80017b60: 6105 addi sp,sp,32 + 80017b62: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE: + +0000000080017b64 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE>: + for pte in self.entries.iter_mut(){ + pte.write_zero(); + } + } + + pub fn write(&mut self, page_table: &PageTable) { + 80017b64: 7135 addi sp,sp,-160 + 80017b66: ed06 sd ra,152(sp) + 80017b68: f02e sd a1,32(sp) + 80017b6a: f42a sd a0,40(sp) + 80017b6c: f8aa sd a0,112(sp) + 80017b6e: fcae sd a1,120(sp) + 80017b70: 4501 li a0,0 + for i in 0..512 { + 80017b72: e0aa sd a0,64(sp) + 80017b74: 20000593 li a1,512 + 80017b78: e4ae sd a1,72(sp) + 80017b7a: 00009097 auipc ra,0x9 + 80017b7e: c96080e7 jalr -874(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80017b82: f82a sd a0,48(sp) + 80017b84: fc2e sd a1,56(sp) + 80017b86: a009 j 80017b88 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x24> + 80017b88: 7562 ld a0,56(sp) + 80017b8a: 75c2 ld a1,48(sp) + 80017b8c: e8ae sd a1,80(sp) + 80017b8e: ecaa sd a0,88(sp) + 80017b90: a009 j 80017b92 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x2e> + 80017b92: 0888 addi a0,sp,80 + 80017b94: 00009097 auipc ra,0x9 + 80017b98: c0e080e7 jalr -1010(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80017b9c: f0aa sd a0,96(sp) + 80017b9e: f4ae sd a1,104(sp) + 80017ba0: a009 j 80017ba2 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x3e> + 80017ba2: 7506 ld a0,96(sp) + 80017ba4: 4581 li a1,0 + 80017ba6: 00b50463 beq a0,a1,80017bae <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x4a> + 80017baa: a009 j 80017bac <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x48> + 80017bac: a029 j 80017bb6 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x52> + self.entries[i].write(page_table.entries[i].as_usize()); + } + } + 80017bae: 60ea ld ra,152(sp) + 80017bb0: 610d addi sp,sp,160 + 80017bb2: 8082 ret + for i in 0..512 { + 80017bb4: 0000 unimp + 80017bb6: 75a6 ld a1,104(sp) + 80017bb8: ec2e sd a1,24(sp) + 80017bba: e12e sd a1,128(sp) + 80017bbc: e52e sd a1,136(sp) + 80017bbe: e92e sd a1,144(sp) + 80017bc0: 1ff00513 li a0,511 + self.entries[i].write(page_table.entries[i].as_usize()); + 80017bc4: 04b56063 bltu a0,a1,80017c04 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0xa0> + 80017bc8: a009 j 80017bca <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x66> + 80017bca: 65e2 ld a1,24(sp) + 80017bcc: 7522 ld a0,40(sp) + 80017bce: 00359613 slli a2,a1,0x3 + 80017bd2: 9532 add a0,a0,a2 + 80017bd4: e82a sd a0,16(sp) + 80017bd6: 1ff00513 li a0,511 + 80017bda: 04b56163 bltu a0,a1,80017c1c <.LBB2_14+0x16> + 80017bde: a009 j 80017be0 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x7c> + 80017be0: 7502 ld a0,32(sp) + 80017be2: 65e2 ld a1,24(sp) + 80017be4: 058e slli a1,a1,0x3 + 80017be6: 952e add a0,a0,a1 + 80017be8: ffff1097 auipc ra,0xffff1 + 80017bec: 306080e7 jalr 774(ra) # 80008eee <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_usize17h85d0d27e00f735b4E> + 80017bf0: e42a sd a0,8(sp) + 80017bf2: a009 j 80017bf4 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x90> + 80017bf4: 65a2 ld a1,8(sp) + 80017bf6: 6542 ld a0,16(sp) + 80017bf8: ffff1097 auipc ra,0xffff1 + 80017bfc: 46a080e7 jalr 1130(ra) # 80009062 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry5write17h80740d4aa6720343E> + 80017c00: a009 j 80017c02 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x9e> + for i in 0..512 { + 80017c02: bf41 j 80017b92 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE+0x2e> + self.entries[i].write(page_table.entries[i].as_usize()); + 80017c04: 6562 ld a0,24(sp) + +0000000080017c06 <.LBB2_14>: + 80017c06: 00013617 auipc a2,0x13 + 80017c0a: 7ea60613 addi a2,a2,2026 # 8002b3f0 <.L__unnamed_1> + 80017c0e: 20000593 li a1,512 + 80017c12: 0000b097 auipc ra,0xb + 80017c16: 55e080e7 jalr 1374(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80017c1a: 0000 unimp + 80017c1c: 6562 ld a0,24(sp) + +0000000080017c1e <.LBB2_15>: + 80017c1e: 00013617 auipc a2,0x13 + 80017c22: 7ea60613 addi a2,a2,2026 # 8002b408 <.L__unnamed_2> + 80017c26: 20000593 li a1,512 + 80017c2a: 0000b097 auipc ra,0xb + 80017c2e: 546080e7 jalr 1350(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E: + +0000000080017c34 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E>: + /// + /// Look up a virtual address, return the physical address, + /// or 0 if not mapped. + /// Can only be used to look up user pages. + /// 将虚拟地址翻译成物理地址,返回页表项 + fn translate( + 80017c34: 7111 addi sp,sp,-256 + 80017c36: fd86 sd ra,248(sp) + 80017c38: f82a sd a0,48(sp) + 80017c3a: e0ae sd a1,64(sp) + 80017c3c: e5aa sd a0,200(sp) + 80017c3e: 0088 addi a0,sp,64 + &mut self, + va: VirtualAddress + ) -> Option<&mut PageTableEntry> { + if va.as_usize() > MAXVA { + 80017c40: ffffa097 auipc ra,0xffffa + 80017c44: 2e2080e7 jalr 738(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80017c48: fc2a sd a0,56(sp) + 80017c4a: a009 j 80017c4c <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x18> + 80017c4c: 7562 ld a0,56(sp) + 80017c4e: 4585 li a1,1 + 80017c50: 159a slli a1,a1,0x26 + 80017c52: 0585 addi a1,a1,1 + 80017c54: 00b56663 bltu a0,a1,80017c60 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x2c> + 80017c58: a009 j 80017c5a <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x26> + 80017c5a: 4501 li a0,0 + return None + 80017c5c: e4aa sd a0,72(sp) + 80017c5e: a0dd j 80017d44 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x110> + } + let mut page_table = self as *mut PageTable; + 80017c60: 7542 ld a0,48(sp) + 80017c62: e8aa sd a0,80(sp) + 80017c64: 0128 addi a0,sp,136 + 80017c66: 4585 li a1,1 + 80017c68: 4609 li a2,2 + for level in (1..=2).rev() { + 80017c6a: ffff4097 auipc ra,0xffff4 + 80017c6e: 2c4080e7 jalr 708(ra) # 8000bf2e <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$3new17h55e0942ec6ff79cbE> + 80017c72: a009 j 80017c74 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x40> + 80017c74: 1888 addi a0,sp,112 + 80017c76: 012c addi a1,sp,136 + 80017c78: ffff4097 auipc ra,0xffff4 + 80017c7c: 686080e7 jalr 1670(ra) # 8000c2fe <_ZN4core4iter6traits8iterator8Iterator3rev17h6d9067942ad94ebeE> + 80017c80: a009 j 80017c82 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x4e> + 80017c82: 08a8 addi a0,sp,88 + 80017c84: 188c addi a1,sp,112 + 80017c86: 00005097 auipc ra,0x5 + 80017c8a: 96a080e7 jalr -1686(ra) # 8001c5f0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h07513ad1b93938d8E> + 80017c8e: a009 j 80017c90 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x5c> + 80017c90: 7526 ld a0,104(sp) + 80017c92: f92a sd a0,176(sp) + 80017c94: 7506 ld a0,96(sp) + 80017c96: f52a sd a0,168(sp) + 80017c98: 6566 ld a0,88(sp) + 80017c9a: f12a sd a0,160(sp) + 80017c9c: a009 j 80017c9e <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x6a> + 80017c9e: 1108 addi a0,sp,160 + 80017ca0: 00005097 auipc ra,0x5 + 80017ca4: 968080e7 jalr -1688(ra) # 8001c608 <_ZN98_$LT$core..iter..adapters..rev..Rev$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hfb8b31ee37e3cf8fE> + 80017ca8: fd2a sd a0,184(sp) + 80017caa: e1ae sd a1,192(sp) + 80017cac: a009 j 80017cae <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x7a> + 80017cae: 756a ld a0,184(sp) + 80017cb0: 4581 li a1,0 + 80017cb2: 00b50463 beq a0,a1,80017cba <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x86> + 80017cb6: a009 j 80017cb8 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x84> + 80017cb8: a811 j 80017ccc <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x98> + 80017cba: 0088 addi a0,sp,64 + 80017cbc: 4581 li a1,0 + + }else{ + return None + } + } + let pte = unsafe{&mut (*page_table).entries[va.page_num(0)]}; + 80017cbe: ffffa097 auipc ra,0xffffa + 80017cc2: 292080e7 jalr 658(ra) # 80011f50 <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE> + 80017cc6: f42a sd a0,40(sp) + 80017cc8: a08d j 80017d2a <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0xf6> + for level in (1..=2).rev() { + 80017cca: 0000 unimp + 80017ccc: 658e ld a1,192(sp) + 80017cce: e9ae sd a1,208(sp) + 80017cd0: edae sd a1,216(sp) + 80017cd2: f1ae sd a1,224(sp) + 80017cd4: 0088 addi a0,sp,64 + let pte = unsafe{ &mut (*page_table).entries[va.page_num(level)] }; + 80017cd6: ffffa097 auipc ra,0xffffa + 80017cda: 27a080e7 jalr 634(ra) # 80011f50 <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE> + 80017cde: f02a sd a0,32(sp) + 80017ce0: a009 j 80017ce2 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0xae> + 80017ce2: 7582 ld a1,32(sp) + 80017ce4: 1ff00513 li a0,511 + 80017ce8: 06b56263 bltu a0,a1,80017d4c <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x118> + 80017cec: a009 j 80017cee <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0xba> + 80017cee: 7582 ld a1,32(sp) + 80017cf0: 6546 ld a0,80(sp) + 80017cf2: 058e slli a1,a1,0x3 + 80017cf4: 952e add a0,a0,a1 + 80017cf6: e82a sd a0,16(sp) + 80017cf8: f5aa sd a0,232(sp) + if pte.is_valid() { + 80017cfa: ffff1097 auipc ra,0xffff1 + 80017cfe: 1fe080e7 jalr 510(ra) # 80008ef8 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E> + 80017d02: ec2a sd a0,24(sp) + 80017d04: a009 j 80017d06 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0xd2> + 80017d06: 6562 ld a0,24(sp) + 80017d08: 4581 li a1,0 + 80017d0a: 00b50a63 beq a0,a1,80017d1e <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0xea> + 80017d0e: a009 j 80017d10 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0xdc> + page_table = pte.as_pagetable(); + 80017d10: 6542 ld a0,16(sp) + 80017d12: ffff1097 auipc ra,0xffff1 + 80017d16: 2bc080e7 jalr 700(ra) # 80008fce <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE> + 80017d1a: e42a sd a0,8(sp) + 80017d1c: a021 j 80017d24 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0xf0> + 80017d1e: 4501 li a0,0 + return None + 80017d20: e4aa sd a0,72(sp) + 80017d22: a00d j 80017d44 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x110> + page_table = pte.as_pagetable(); + 80017d24: 6522 ld a0,8(sp) + 80017d26: e8aa sd a0,80(sp) + for level in (1..=2).rev() { + 80017d28: bf9d j 80017c9e <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x6a> + 80017d2a: 75a2 ld a1,40(sp) + 80017d2c: 1ff00513 li a0,511 + let pte = unsafe{&mut (*page_table).entries[va.page_num(0)]}; + 80017d30: 02b56a63 bltu a0,a1,80017d64 <.LBB3_24+0x16> + 80017d34: a009 j 80017d36 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x102> + 80017d36: 75a2 ld a1,40(sp) + 80017d38: 6546 ld a0,80(sp) + 80017d3a: 058e slli a1,a1,0x3 + 80017d3c: 952e add a0,a0,a1 + 80017d3e: f9aa sd a0,240(sp) + Some(pte) + 80017d40: e4aa sd a0,72(sp) + } + 80017d42: a009 j 80017d44 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E+0x110> + 80017d44: 6526 ld a0,72(sp) + 80017d46: 70ee ld ra,248(sp) + 80017d48: 6111 addi sp,sp,256 + 80017d4a: 8082 ret + let pte = unsafe{ &mut (*page_table).entries[va.page_num(level)] }; + 80017d4c: 7502 ld a0,32(sp) + +0000000080017d4e <.LBB3_24>: + 80017d4e: 00013617 auipc a2,0x13 + 80017d52: 6d260613 addi a2,a2,1746 # 8002b420 <.L__unnamed_3> + 80017d56: 20000593 li a1,512 + 80017d5a: 0000b097 auipc ra,0xb + 80017d5e: 416080e7 jalr 1046(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80017d62: 0000 unimp + let pte = unsafe{&mut (*page_table).entries[va.page_num(0)]}; + 80017d64: 7522 ld a0,40(sp) + +0000000080017d66 <.LBB3_25>: + 80017d66: 00013617 auipc a2,0x13 + 80017d6a: 6d260613 addi a2,a2,1746 # 8002b438 <.L__unnamed_4> + 80017d6e: 20000593 li a1,512 + 80017d72: 0000b097 auipc ra,0xb + 80017d76: 3fe080e7 jalr 1022(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable18translate_or_alloc17ha9e02f6e0feabdb7E: + +0000000080017d7c <_ZN6kernel6memory7mapping10page_table9PageTable18translate_or_alloc17ha9e02f6e0feabdb7E>: + + /// 将虚拟地址翻译成物理地址或者直接映射 + fn translate_or_alloc( + 80017d7c: 7169 addi sp,sp,-304 + 80017d7e: f606 sd ra,296(sp) + 80017d80: f4ae sd a1,104(sp) + 80017d82: f9aa sd a0,240(sp) + &mut self, + va: VirtualAddress + ) -> Option<&mut PageTableEntry> { + let mut pagetable = self as *mut PageTable; + 80017d84: fcaa sd a0,120(sp) + 80017d86: 10a8 addi a0,sp,104 + let real_addr:usize = va.as_usize(); + 80017d88: ffffa097 auipc ra,0xffffa + 80017d8c: 19a080e7 jalr 410(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80017d90: 85aa mv a1,a0 + 80017d92: f0ae sd a1,96(sp) + 80017d94: fdaa sd a0,248(sp) + 80017d96: a009 j 80017d98 <_ZN6kernel6memory7mapping10page_table9PageTable18translate_or_alloc17ha9e02f6e0feabdb7E+0x1c> + 80017d98: 7506 ld a0,96(sp) + 80017d9a: 4585 li a1,1 + 80017d9c: 159a slli a1,a1,0x26 + 80017d9e: 0585 addi a1,a1,1 + if real_addr > MAXVA { + 80017da0: 02b56163 bltu a0,a1,80017dc2 <.LBB4_31+0x14> + 80017da4: a009 j 80017da6 <.LBB4_30> + +0000000080017da6 <.LBB4_30>: + panic!("walk"); + 80017da6: 00010517 auipc a0,0x10 + 80017daa: 94650513 addi a0,a0,-1722 # 800276ec <.LJTI3_0+0x6c> + +0000000080017dae <.LBB4_31>: + 80017dae: 00013617 auipc a2,0x13 + 80017db2: 6a260613 addi a2,a2,1698 # 8002b450 <.L__unnamed_6> + 80017db6: 4591 li a1,4 + 80017db8: 0000b097 auipc ra,0xb + 80017dbc: 38c080e7 jalr 908(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80017dc0: 0000 unimp + 80017dc2: 1908 addi a0,sp,176 + 80017dc4: 4585 li a1,1 + 80017dc6: 4609 li a2,2 + } + for level in (1..=2).rev() { + 80017dc8: ffff4097 auipc ra,0xffff4 + 80017dcc: 166080e7 jalr 358(ra) # 8000bf2e <_ZN4core3ops5range25RangeInclusive$LT$Idx$GT$3new17h55e0942ec6ff79cbE> + 80017dd0: a009 j 80017dd2 <.LBB4_31+0x24> + 80017dd2: 0928 addi a0,sp,152 + 80017dd4: 190c addi a1,sp,176 + 80017dd6: ffff4097 auipc ra,0xffff4 + 80017dda: 528080e7 jalr 1320(ra) # 8000c2fe <_ZN4core4iter6traits8iterator8Iterator3rev17h6d9067942ad94ebeE> + 80017dde: a009 j 80017de0 <.LBB4_31+0x32> + 80017de0: 0108 addi a0,sp,128 + 80017de2: 092c addi a1,sp,152 + 80017de4: 00005097 auipc ra,0x5 + 80017de8: 80c080e7 jalr -2036(ra) # 8001c5f0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h07513ad1b93938d8E> + 80017dec: a009 j 80017dee <.LBB4_31+0x40> + 80017dee: 654a ld a0,144(sp) + 80017df0: edaa sd a0,216(sp) + 80017df2: 652a ld a0,136(sp) + 80017df4: e9aa sd a0,208(sp) + 80017df6: 650a ld a0,128(sp) + 80017df8: e5aa sd a0,200(sp) + 80017dfa: a009 j 80017dfc <.LBB4_31+0x4e> + 80017dfc: 01a8 addi a0,sp,200 + 80017dfe: 00005097 auipc ra,0x5 + 80017e02: 80a080e7 jalr -2038(ra) # 8001c608 <_ZN98_$LT$core..iter..adapters..rev..Rev$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hfb8b31ee37e3cf8fE> + 80017e06: f1aa sd a0,224(sp) + 80017e08: f5ae sd a1,232(sp) + 80017e0a: a009 j 80017e0c <.LBB4_31+0x5e> + 80017e0c: 750e ld a0,224(sp) + 80017e0e: 4581 li a1,0 + 80017e10: 00b50463 beq a0,a1,80017e18 <.LBB4_31+0x6a> + 80017e14: a009 j 80017e16 <.LBB4_31+0x68> + 80017e16: a811 j 80017e2a <.LBB4_31+0x7c> + 80017e18: 10a8 addi a0,sp,104 + 80017e1a: 4581 li a1,0 + }; + pagetable = Box::into_raw(zeroed_pgt); + pte.0 = (((pagetable as usize) >> 12) << 10) | (PteFlags::V.bits()); + } + } + Some(unsafe{&mut (*pagetable).entries[va.page_num(0)]}) + 80017e1c: ffffa097 auipc ra,0xffffa + 80017e20: 134080e7 jalr 308(ra) # 80011f50 <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE> + 80017e24: ecaa sd a0,88(sp) + 80017e26: a875 j 80017ee2 <.LBB4_32+0x22> + for level in (1..=2).rev() { + 80017e28: 0000 unimp + 80017e2a: 75ae ld a1,232(sp) + 80017e2c: e22e sd a1,256(sp) + 80017e2e: e62e sd a1,264(sp) + 80017e30: ea2e sd a1,272(sp) + 80017e32: 10a8 addi a0,sp,104 + let pte = unsafe{ &mut (*pagetable).entries[va.page_num(level)] }; + 80017e34: ffffa097 auipc ra,0xffffa + 80017e38: 11c080e7 jalr 284(ra) # 80011f50 <_ZN6kernel6memory7address14VirtualAddress8page_num17h81ae42a65c302f7eE> + 80017e3c: e8aa sd a0,80(sp) + 80017e3e: a009 j 80017e40 <.LBB4_31+0x92> + 80017e40: 65c6 ld a1,80(sp) + 80017e42: 1ff00513 li a0,511 + 80017e46: 0ab56c63 bltu a0,a1,80017efe <.LBB4_32+0x3e> + 80017e4a: a009 j 80017e4c <.LBB4_31+0x9e> + 80017e4c: 65c6 ld a1,80(sp) + 80017e4e: 7566 ld a0,120(sp) + 80017e50: 058e slli a1,a1,0x3 + 80017e52: 952e add a0,a0,a1 + 80017e54: e0aa sd a0,64(sp) + 80017e56: ee2a sd a0,280(sp) + if pte.is_valid() { + 80017e58: ffff1097 auipc ra,0xffff1 + 80017e5c: 0a0080e7 jalr 160(ra) # 80008ef8 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E> + 80017e60: e4aa sd a0,72(sp) + 80017e62: a009 j 80017e64 <.LBB4_31+0xb6> + 80017e64: 6526 ld a0,72(sp) + 80017e66: 4581 li a1,0 + 80017e68: 00b50a63 beq a0,a1,80017e7c <.LBB4_31+0xce> + 80017e6c: a009 j 80017e6e <.LBB4_31+0xc0> + pagetable = pte.as_pagetable(); + 80017e6e: 6506 ld a0,64(sp) + 80017e70: ffff1097 auipc ra,0xffff1 + 80017e74: 15e080e7 jalr 350(ra) # 80008fce <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE> + 80017e78: fc2a sd a0,56(sp) + 80017e7a: a039 j 80017e88 <.LBB4_31+0xda> + Box::new_zeroed().assume_init() + 80017e7c: 00004097 auipc ra,0x4 + 80017e80: 7f2080e7 jalr 2034(ra) # 8001c66e <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he11e171c2ca6c076E> + 80017e84: f82a sd a0,48(sp) + 80017e86: a021 j 80017e8e <.LBB4_31+0xe0> + pagetable = pte.as_pagetable(); + 80017e88: 7562 ld a0,56(sp) + 80017e8a: fcaa sd a0,120(sp) + if pte.is_valid() { + 80017e8c: a891 j 80017ee0 <.LBB4_32+0x20> + Box::new_zeroed().assume_init() + 80017e8e: 7542 ld a0,48(sp) + 80017e90: 00005097 auipc ra,0x5 + 80017e94: 350080e7 jalr 848(ra) # 8001d1e0 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h2fe4f6739411edd0E> + 80017e98: 85aa mv a1,a0 + 80017e9a: f42e sd a1,40(sp) + 80017e9c: f22a sd a0,288(sp) + 80017e9e: a009 j 80017ea0 <.LBB4_31+0xf2> + pagetable = Box::into_raw(zeroed_pgt); + 80017ea0: 7522 ld a0,40(sp) + 80017ea2: 00005097 auipc ra,0x5 + 80017ea6: 2b4080e7 jalr 692(ra) # 8001d156 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h11a22cb7d9ea1552E> + 80017eaa: f02a sd a0,32(sp) + 80017eac: a009 j 80017eae <.LBB4_31+0x100> + 80017eae: 7502 ld a0,32(sp) + 80017eb0: fcaa sd a0,120(sp) + pte.0 = (((pagetable as usize) >> 12) << 10) | (PteFlags::V.bits()); + 80017eb2: 8131 srli a0,a0,0xc + 80017eb4: ec2a sd a0,24(sp) + 80017eb6: a009 j 80017eb8 <.LBB4_31+0x10a> + 80017eb8: 6562 ld a0,24(sp) + 80017eba: 052a slli a0,a0,0xa + 80017ebc: e82a sd a0,16(sp) + 80017ebe: a009 j 80017ec0 <.LBB4_32> + +0000000080017ec0 <.LBB4_32>: + 80017ec0: 00010517 auipc a0,0x10 + 80017ec4: 97050513 addi a0,a0,-1680 # 80027830 <.L__unnamed_6+0xa0> + 80017ec8: ffff1097 auipc ra,0xffff1 + 80017ecc: 1a6080e7 jalr 422(ra) # 8000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E> + 80017ed0: e42a sd a0,8(sp) + 80017ed2: a009 j 80017ed4 <.LBB4_32+0x14> + 80017ed4: 6586 ld a1,64(sp) + 80017ed6: 6542 ld a0,16(sp) + 80017ed8: 6622 ld a2,8(sp) + 80017eda: 8d51 or a0,a0,a2 + 80017edc: e188 sd a0,0(a1) + if pte.is_valid() { + 80017ede: a009 j 80017ee0 <.LBB4_32+0x20> + for level in (1..=2).rev() { + 80017ee0: bf31 j 80017dfc <.LBB4_31+0x4e> + 80017ee2: 65e6 ld a1,88(sp) + 80017ee4: 1ff00513 li a0,511 + Some(unsafe{&mut (*pagetable).entries[va.page_num(0)]}) + 80017ee8: 02b56763 bltu a0,a1,80017f16 <.LBB4_33+0x16> + 80017eec: a009 j 80017eee <.LBB4_32+0x2e> + 80017eee: 65e6 ld a1,88(sp) + 80017ef0: 7566 ld a0,120(sp) + 80017ef2: 058e slli a1,a1,0x3 + 80017ef4: 952e add a0,a0,a1 + 80017ef6: f8aa sd a0,112(sp) + } + 80017ef8: 70b2 ld ra,296(sp) + 80017efa: 6155 addi sp,sp,304 + 80017efc: 8082 ret + let pte = unsafe{ &mut (*pagetable).entries[va.page_num(level)] }; + 80017efe: 6546 ld a0,80(sp) + +0000000080017f00 <.LBB4_33>: + 80017f00: 00013617 auipc a2,0x13 + 80017f04: 56860613 addi a2,a2,1384 # 8002b468 <.L__unnamed_8> + 80017f08: 20000593 li a1,512 + 80017f0c: 0000b097 auipc ra,0xb + 80017f10: 264080e7 jalr 612(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80017f14: 0000 unimp + Some(unsafe{&mut (*pagetable).entries[va.page_num(0)]}) + 80017f16: 6566 ld a0,88(sp) + +0000000080017f18 <.LBB4_34>: + 80017f18: 00013617 auipc a2,0x13 + 80017f1c: 56860613 addi a2,a2,1384 # 8002b480 <.L__unnamed_9> + 80017f20: 20000593 li a1,512 + 80017f24: 0000b097 auipc ra,0xb + 80017f28: 24c080e7 jalr 588(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E: + +0000000080017f2e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E>: + + /// Look up a virtual address, return the physical address, + /// or 0 if not mapped. + /// Can only be used to look up user pages. + /// 通过给定的页表,将对应的虚拟地址转换成物理地址 + pub fn pgt_translate( + 80017f2e: 7119 addi sp,sp,-128 + 80017f30: fc86 sd ra,120(sp) + 80017f32: f42a sd a0,40(sp) + 80017f34: fc2e sd a1,56(sp) + 80017f36: ecaa sd a0,88(sp) + 80017f38: 1828 addi a0,sp,56 + &mut self, + va: VirtualAddress + ) -> Option { + let addr = va.as_usize(); + 80017f3a: ffffa097 auipc ra,0xffffa + 80017f3e: fe8080e7 jalr -24(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80017f42: 85aa mv a1,a0 + 80017f44: f82e sd a1,48(sp) + 80017f46: f0aa sd a0,96(sp) + 80017f48: a009 j 80017f4a <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x1c> + 80017f4a: 7542 ld a0,48(sp) + 80017f4c: 4585 li a1,1 + 80017f4e: 159a slli a1,a1,0x26 + 80017f50: 0585 addi a1,a1,1 + if addr > MAXVA { + 80017f52: 00b56663 bltu a0,a1,80017f5e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x30> + 80017f56: a009 j 80017f58 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x2a> + 80017f58: 4501 li a0,0 + return None + 80017f5a: e0aa sd a0,64(sp) + 80017f5c: a069 j 80017fe6 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0xb8> + } + match self.translate(va){ + 80017f5e: 7522 ld a0,40(sp) + 80017f60: 75e2 ld a1,56(sp) + 80017f62: 00000097 auipc ra,0x0 + 80017f66: cd2080e7 jalr -814(ra) # 80017c34 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E> + 80017f6a: e8aa sd a0,80(sp) + 80017f6c: a009 j 80017f6e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x40> + Some(pte) => { + 80017f6e: 6546 ld a0,80(sp) + 80017f70: 00a035b3 snez a1,a0 + 80017f74: 4581 li a1,0 + 80017f76: 00b50463 beq a0,a1,80017f7e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x50> + 80017f7a: a009 j 80017f7c <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x4e> + 80017f7c: a029 j 80017f86 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x58> + 80017f7e: 4501 li a0,0 + + let pagetable_addr = pte.as_pagetable() as usize; + Some(PhysicalAddress::new(pagetable_addr)) + } + + None => { None } + 80017f80: e0aa sd a0,64(sp) + match self.translate(va){ + 80017f82: a095 j 80017fe6 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0xb8> + 80017f84: 0000 unimp + Some(pte) => { + 80017f86: 6546 ld a0,80(sp) + 80017f88: ec2a sd a0,24(sp) + 80017f8a: f4aa sd a0,104(sp) + if !pte.is_valid(){ + 80017f8c: ffff1097 auipc ra,0xffff1 + 80017f90: f6c080e7 jalr -148(ra) # 80008ef8 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E> + 80017f94: f02a sd a0,32(sp) + 80017f96: a009 j 80017f98 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x6a> + 80017f98: 7502 ld a0,32(sp) + 80017f9a: e509 bnez a0,80017fa4 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x76> + 80017f9c: a009 j 80017f9e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x70> + 80017f9e: 4501 li a0,0 + return None + 80017fa0: e0aa sd a0,64(sp) + 80017fa2: a091 j 80017fe6 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0xb8> + if !pte.is_user(){ + 80017fa4: 6562 ld a0,24(sp) + 80017fa6: ffff1097 auipc ra,0xffff1 + 80017faa: f80080e7 jalr -128(ra) # 80008f26 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_user17ha81b2d62b11ea775E> + 80017fae: e82a sd a0,16(sp) + 80017fb0: a009 j 80017fb2 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x84> + 80017fb2: 6542 ld a0,16(sp) + 80017fb4: e509 bnez a0,80017fbe <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x90> + 80017fb6: a009 j 80017fb8 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x8a> + 80017fb8: 4501 li a0,0 + return None + 80017fba: e0aa sd a0,64(sp) + 80017fbc: a02d j 80017fe6 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0xb8> + let pagetable_addr = pte.as_pagetable() as usize; + 80017fbe: 6562 ld a0,24(sp) + 80017fc0: ffff1097 auipc ra,0xffff1 + 80017fc4: 00e080e7 jalr 14(ra) # 80008fce <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE> + 80017fc8: e42a sd a0,8(sp) + 80017fca: a009 j 80017fcc <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0x9e> + 80017fcc: 6522 ld a0,8(sp) + 80017fce: f8aa sd a0,112(sp) + Some(PhysicalAddress::new(pagetable_addr)) + 80017fd0: ffffa097 auipc ra,0xffffa + 80017fd4: 026080e7 jalr 38(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 80017fd8: e02a sd a0,0(sp) + 80017fda: a009 j 80017fdc <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0xae> + 80017fdc: 6502 ld a0,0(sp) + 80017fde: e4aa sd a0,72(sp) + 80017fe0: 4505 li a0,1 + 80017fe2: e0aa sd a0,64(sp) + match self.translate(va){ + 80017fe4: a009 j 80017fe6 <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E+0xb8> + } + } + 80017fe6: 6506 ld a0,64(sp) + 80017fe8: 65a6 ld a1,72(sp) + 80017fea: 70e6 ld ra,120(sp) + 80017fec: 6109 addi sp,sp,128 + 80017fee: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE: + +0000000080017ff0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE>: + /// Create PTEs for virtual addresses starting at va that refer to + /// physical addresses starting at pa. va and size might not + /// be page-aligned. Returns 0 on success, -1 if walk() couldn't + /// allocate a needed page-table page. + /// 将虚拟地址与物理地址建立映射,并写入MMU中 + pub unsafe fn map( + 80017ff0: 7149 addi sp,sp,-368 + 80017ff2: f686 sd ra,360(sp) + 80017ff4: f0ba sd a4,96(sp) + 80017ff6: f4b6 sd a3,104(sp) + 80017ff8: f8aa sd a0,112(sp) + 80017ffa: e12e sd a1,128(sp) + 80017ffc: e532 sd a2,136(sp) + 80017ffe: fa2a sd a0,304(sp) + 80018000: fe36 sd a3,312(sp) + 80018002: e2ba sd a4,320(sp) + 80018004: 0108 addi a0,sp,128 + mut va: VirtualAddress, + mut pa: PhysicalAddress, + size:usize, + perm:PteFlags + ) -> bool { + let mut last = VirtualAddress::new(va.as_usize() + size); + 80018006: ffffa097 auipc ra,0xffffa + 8001800a: f1c080e7 jalr -228(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 8001800e: fcaa sd a0,120(sp) + 80018010: a009 j 80018012 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x22> + 80018012: 75e6 ld a1,120(sp) + 80018014: 7526 ld a0,104(sp) + 80018016: 952e add a0,a0,a1 + 80018018: ecaa sd a0,88(sp) + 8001801a: 1ab56163 bltu a0,a1,800181bc <.LBB6_36> + 8001801e: a009 j 80018020 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x30> + 80018020: 6566 ld a0,88(sp) + 80018022: ffffa097 auipc ra,0xffffa + 80018026: f24080e7 jalr -220(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8001802a: ed2a sd a0,152(sp) + 8001802c: a009 j 8001802e <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x3e> + 8001802e: 0108 addi a0,sp,128 + va.pg_round_down(); + 80018030: fffed097 auipc ra,0xfffed + 80018034: a1a080e7 jalr -1510(ra) # 80004a4a <_ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE> + 80018038: a009 j 8001803a <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x4a> + 8001803a: 0928 addi a0,sp,152 + last.pg_round_up(); + 8001803c: fffed097 auipc ra,0xfffed + 80018040: 8fa080e7 jalr -1798(ra) # 80004936 <_ZN6kernel6memory7address4Addr11pg_round_up17h43579bab3405c977E> + 80018044: a009 j 80018046 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x56> + 80018046: 0108 addi a0,sp,128 + 80018048: 092c addi a1,sp,152 + while va != last{ + 8001804a: ffffa097 auipc ra,0xffffa + 8001804e: fb6080e7 jalr -74(ra) # 80012000 <_ZN80_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$core..cmp..PartialEq$GT$2ne17h594c009ca6e35357E> + 80018052: e8aa sd a0,80(sp) + 80018054: a009 j 80018056 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x66> + 80018056: 6546 ld a0,80(sp) + 80018058: e511 bnez a0,80018064 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x74> + 8001805a: a009 j 8001805c <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x6c> + 8001805c: 4505 li a0,1 + + } + None => return false + } + } + true + 8001805e: 08a10ba3 sb a0,151(sp) + } + 80018062: aa81 j 800181b2 <.LBB6_35+0x2e> + match self.translate_or_alloc(va){ + 80018064: 7546 ld a0,112(sp) + 80018066: 658a ld a1,128(sp) + 80018068: 00000097 auipc ra,0x0 + 8001806c: d14080e7 jalr -748(ra) # 80017d7c <_ZN6kernel6memory7mapping10page_table9PageTable18translate_or_alloc17ha9e02f6e0feabdb7E> + 80018070: f12a sd a0,160(sp) + 80018072: a009 j 80018074 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x84> + Some(pte) => { + 80018074: 750a ld a0,160(sp) + 80018076: 00a035b3 snez a1,a0 + 8001807a: 4581 li a1,0 + 8001807c: 00b50463 beq a0,a1,80018084 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x94> + 80018080: a009 j 80018082 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x92> + 80018082: a031 j 8001808e <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x9e> + 80018084: 4501 li a0,0 + None => return false + 80018086: 08a10ba3 sb a0,151(sp) + } + 8001808a: a225 j 800181b2 <.LBB6_35+0x2e> + match self.translate_or_alloc(va){ + 8001808c: 0000 unimp + Some(pte) => { + 8001808e: 750a ld a0,160(sp) + 80018090: e0aa sd a0,64(sp) + 80018092: e6aa sd a0,328(sp) + if pte.is_valid() { + 80018094: ffff1097 auipc ra,0xffff1 + 80018098: e64080e7 jalr -412(ra) # 80008ef8 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E> + 8001809c: e4aa sd a0,72(sp) + 8001809e: a009 j 800180a0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0xb0> + 800180a0: 6526 ld a0,72(sp) + 800180a2: 4581 li a1,0 + 800180a4: 00b50a63 beq a0,a1,800180b8 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0xc8> + 800180a8: a009 j 800180aa <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0xba> + 800180aa: 0108 addi a0,sp,128 + va.as_usize(), + 800180ac: ffffa097 auipc ra,0xffffa + 800180b0: e76080e7 jalr -394(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 800180b4: f22a sd a0,288(sp) + 800180b6: a809 j 800180c8 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0xd8> + pte.write_perm(pa, perm); + 800180b8: 7606 ld a2,96(sp) + 800180ba: 6506 ld a0,64(sp) + 800180bc: 65aa ld a1,136(sp) + 800180be: ffff1097 auipc ra,0xffff1 + 800180c2: f4a080e7 jalr -182(ra) # 80009008 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry10write_perm17h2feb85df16db2682E> + 800180c6: a8c9 j 80018198 <.LBB6_35+0x14> + 800180c8: 0128 addi a0,sp,136 + pa.as_usize(), + 800180ca: ffffa097 auipc ra,0xffffa + 800180ce: e6a080e7 jalr -406(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 800180d2: f62a sd a0,296(sp) + 800180d4: a009 j 800180d6 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0xe6> + 800180d6: 6586 ld a1,64(sp) + 800180d8: 1208 addi a0,sp,288 + println!( + 800180da: e62a sd a0,264(sp) + 800180dc: 1230 addi a2,sp,296 + 800180de: f032 sd a2,32(sp) + 800180e0: ea32 sd a2,272(sp) + 800180e2: ee2e sd a1,280(sp) + 800180e4: eaaa sd a0,336(sp) + 800180e6: eeb2 sd a2,344(sp) + 800180e8: 862e mv a2,a1 + 800180ea: f432 sd a2,40(sp) + 800180ec: f2ae sd a1,352(sp) + +00000000800180ee <.LBB6_29>: + 800180ee: 0000d597 auipc a1,0xd + 800180f2: 19458593 addi a1,a1,404 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 800180f6: 00008097 auipc ra,0x8 + 800180fa: 478080e7 jalr 1144(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800180fe: f82a sd a0,48(sp) + 80018100: fc2e sd a1,56(sp) + 80018102: a009 j 80018104 <.LBB6_29+0x16> + 80018104: 7502 ld a0,32(sp) + +0000000080018106 <.LBB6_30>: + 80018106: 0000d597 auipc a1,0xd + 8001810a: 17c58593 addi a1,a1,380 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 8001810e: 00008097 auipc ra,0x8 + 80018112: 460080e7 jalr 1120(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 80018116: e82a sd a0,16(sp) + 80018118: ec2e sd a1,24(sp) + 8001811a: a009 j 8001811c <.LBB6_30+0x16> + 8001811c: 7522 ld a0,40(sp) + +000000008001811e <.LBB6_31>: + 8001811e: 0000d597 auipc a1,0xd + 80018122: 16458593 addi a1,a1,356 # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80018126: 00008097 auipc ra,0x8 + 8001812a: 448080e7 jalr 1096(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001812e: e02a sd a0,0(sp) + 80018130: e42e sd a1,8(sp) + 80018132: a009 j 80018134 <.LBB6_31+0x16> + 80018134: 6522 ld a0,8(sp) + 80018136: 6582 ld a1,0(sp) + 80018138: 6662 ld a2,24(sp) + 8001813a: 66c2 ld a3,16(sp) + 8001813c: 7762 ld a4,56(sp) + 8001813e: 77c2 ld a5,48(sp) + 80018140: edbe sd a5,216(sp) + 80018142: f1ba sd a4,224(sp) + 80018144: f5b6 sd a3,232(sp) + 80018146: f9b2 sd a2,240(sp) + 80018148: fdae sd a1,248(sp) + 8001814a: e22a sd a0,256(sp) + +000000008001814c <.LBB6_32>: + 8001814c: 00013597 auipc a1,0x13 + 80018150: 39458593 addi a1,a1,916 # 8002b4e0 <.L__unnamed_10> + +0000000080018154 <.LBB6_33>: + 80018154: 00013797 auipc a5,0x13 + 80018158: 3cc78793 addi a5,a5,972 # 8002b520 <.L__unnamed_11> + 8001815c: 1128 addi a0,sp,168 + 8001815e: 4611 li a2,4 + 80018160: 09b4 addi a3,sp,216 + 80018162: 480d li a6,3 + 80018164: 8742 mv a4,a6 + 80018166: fffed097 auipc ra,0xfffed + 8001816a: 3fe080e7 jalr 1022(ra) # 80005564 <_ZN4core3fmt9Arguments16new_v1_formatted17hf6d3ed0f8e821319E> + 8001816e: a009 j 80018170 <.LBB6_33+0x1c> + 80018170: 1128 addi a0,sp,168 + 80018172: 00007097 auipc ra,0x7 + 80018176: a86080e7 jalr -1402(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001817a: a009 j 8001817c <.LBB6_34> + +000000008001817c <.LBB6_34>: + panic!("remap"); + 8001817c: 00013517 auipc a0,0x13 + 80018180: 44c50513 addi a0,a0,1100 # 8002b5c8 <.L__unnamed_12> + +0000000080018184 <.LBB6_35>: + 80018184: 00013617 auipc a2,0x13 + 80018188: 44c60613 addi a2,a2,1100 # 8002b5d0 <.L__unnamed_13> + 8001818c: 4595 li a1,5 + 8001818e: 0000b097 auipc ra,0xb + 80018192: fb6080e7 jalr -74(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80018196: 0000 unimp + 80018198: 0108 addi a0,sp,128 + va.add_page(); + 8001819a: fffed097 auipc ra,0xfffed + 8001819e: 932080e7 jalr -1742(ra) # 80004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE> + 800181a2: a009 j 800181a4 <.LBB6_35+0x20> + 800181a4: 0128 addi a0,sp,136 + pa.add_page(); + 800181a6: fffed097 auipc ra,0xfffed + 800181aa: 8dc080e7 jalr -1828(ra) # 80004a82 <_ZN6kernel6memory7address4Addr8add_page17h93c7d6ddd860f6baE> + 800181ae: a009 j 800181b0 <.LBB6_35+0x2c> + while va != last{ + 800181b0: bd59 j 80018046 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE+0x56> + } + 800181b2: 09714503 lbu a0,151(sp) + 800181b6: 70b6 ld ra,360(sp) + 800181b8: 6175 addi sp,sp,368 + 800181ba: 8082 ret + +00000000800181bc <.LBB6_36>: + let mut last = VirtualAddress::new(va.as_usize() + size); + 800181bc: 00013517 auipc a0,0x13 + 800181c0: 2f450513 addi a0,a0,756 # 8002b4b0 + +00000000800181c4 <.LBB6_37>: + 800181c4: 00013617 auipc a2,0x13 + 800181c8: 2d460613 addi a2,a2,724 # 8002b498 <.L__unnamed_14> + 800181cc: 45f1 li a1,28 + 800181ce: 0000b097 auipc ra,0xb + 800181d2: f76080e7 jalr -138(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E: + +00000000800181d8 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E>: + + /// add a mapping to the kernel page table. + /// only used when booting + /// does not flush TLB or enable paging + pub unsafe fn kernel_map( + 800181d8: 7139 addi sp,sp,-64 + 800181da: fc06 sd ra,56(sp) + 800181dc: e82a sd a0,16(sp) + 800181de: ec2e sd a1,24(sp) + 800181e0: f032 sd a2,32(sp) + 800181e2: f436 sd a3,40(sp) + 800181e4: f83a sd a4,48(sp) + // "kvm_map: va={:#x}, pa={:#x}, size={:#x}", + // va.as_usize(), + // pa.as_usize(), + // size + // ); + if !self.map(va, pa, size, perm){ + 800181e6: 00000097 auipc ra,0x0 + 800181ea: e0a080e7 jalr -502(ra) # 80017ff0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE> + 800181ee: e42a sd a0,8(sp) + 800181f0: a009 j 800181f2 <_ZN6kernel6memory7mapping10page_table9PageTable10kernel_map17h284e6512c0cc8b52E+0x1a> + 800181f2: 6522 ld a0,8(sp) + 800181f4: e105 bnez a0,80018214 <.LBB7_5+0x14> + 800181f6: a009 j 800181f8 <.LBB7_4> + +00000000800181f8 <.LBB7_4>: + panic!("内核虚拟地址映射失败"); + 800181f8: 00013517 auipc a0,0x13 + 800181fc: 3f050513 addi a0,a0,1008 # 8002b5e8 <.L__unnamed_15> + +0000000080018200 <.LBB7_5>: + 80018200: 00013617 auipc a2,0x13 + 80018204: 40860613 addi a2,a2,1032 # 8002b608 <.L__unnamed_16> + 80018208: 45f9 li a1,30 + 8001820a: 0000b097 auipc ra,0xb + 8001820e: f3a080e7 jalr -198(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80018212: 0000 unimp + } + } + 80018214: 70e2 ld ra,56(sp) + 80018216: 6121 addi sp,sp,64 + 80018218: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable9uvmcreate17hc2bd2b6aed1ce488E: + +000000008001821a <_ZN6kernel6memory7mapping10page_table9PageTable9uvmcreate17hc2bd2b6aed1ce488E>: + + + /// Create an empty user page table. + /// return None if out of memory + pub unsafe fn uvmcreate() -> *mut PageTable{ + 8001821a: 7179 addi sp,sp,-48 + let pagetable: Box = Box::new_zeroed().assume_init(); + 8001821c: f406 sd ra,40(sp) + 8001821e: 00004097 auipc ra,0x4 + 80018222: 450080e7 jalr 1104(ra) # 8001c66e <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he11e171c2ca6c076E> + 80018226: e82a sd a0,16(sp) + 80018228: a009 j 8001822a <_ZN6kernel6memory7mapping10page_table9PageTable9uvmcreate17hc2bd2b6aed1ce488E+0x10> + 8001822a: 6542 ld a0,16(sp) + 8001822c: 00005097 auipc ra,0x5 + 80018230: fb4080e7 jalr -76(ra) # 8001d1e0 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h2fe4f6739411edd0E> + 80018234: 85aa mv a1,a0 + 80018236: e42e sd a1,8(sp) + 80018238: ec2a sd a0,24(sp) + 8001823a: a009 j 8001823c <_ZN6kernel6memory7mapping10page_table9PageTable9uvmcreate17hc2bd2b6aed1ce488E+0x22> + let ptr = Box::into_raw(pagetable); + 8001823c: 6522 ld a0,8(sp) + 8001823e: 00005097 auipc ra,0x5 + 80018242: f18080e7 jalr -232(ra) # 8001d156 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h11a22cb7d9ea1552E> + 80018246: 85aa mv a1,a0 + 80018248: e02e sd a1,0(sp) + 8001824a: f02a sd a0,32(sp) + 8001824c: a009 j 8001824e <_ZN6kernel6memory7mapping10page_table9PageTable9uvmcreate17hc2bd2b6aed1ce488E+0x34> + ptr + } + 8001824e: 6502 ld a0,0(sp) + 80018250: 70a2 ld ra,40(sp) + 80018252: 6145 addi sp,sp,48 + 80018254: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable8uvm_init17h1e8988bec17c91edE: + +0000000080018256 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_init17h1e8988bec17c91edE>: + + /// Load the user initcode into address 0 of pagetable + /// for the very first process + /// size must be less than a page + pub unsafe fn uvm_init(&mut self, src: &[u8]){ + 80018256: 7175 addi sp,sp,-144 + 80018258: e506 sd ra,136(sp) + 8001825a: e4b2 sd a2,72(sp) + 8001825c: 862e mv a2,a1 + 8001825e: 65a6 ld a1,72(sp) + 80018260: e8b2 sd a2,80(sp) + 80018262: 862a mv a2,a0 + 80018264: 6546 ld a0,80(sp) + 80018266: ecb2 sd a2,88(sp) + 80018268: f4b2 sd a2,104(sp) + 8001826a: f8aa sd a0,112(sp) + 8001826c: fcae sd a1,120(sp) + if src.len() >= PGSIZE{ + 8001826e: 00008097 auipc ra,0x8 + 80018272: 234080e7 jalr 564(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80018276: f0aa sd a0,96(sp) + 80018278: a009 j 8001827a <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_init17h1e8988bec17c91edE+0x24> + 8001827a: 7506 ld a0,96(sp) + 8001827c: 8131 srli a0,a0,0xc + 8001827e: 4581 li a1,0 + 80018280: 02b50163 beq a0,a1,800182a2 <.LBB9_15+0x14> + 80018284: a009 j 80018286 <.LBB9_14> + +0000000080018286 <.LBB9_14>: + panic!("inituvm: more than a page"); + 80018286: 00013517 auipc a0,0x13 + 8001828a: 39a50513 addi a0,a0,922 # 8002b620 <.L__unnamed_17> + +000000008001828e <.LBB9_15>: + 8001828e: 00013617 auipc a2,0x13 + 80018292: 3b260613 addi a2,a2,946 # 8002b640 <.L__unnamed_18> + 80018296: 45e5 li a1,25 + 80018298: 0000b097 auipc ra,0xb + 8001829c: eac080e7 jalr -340(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800182a0: 0000 unimp + } + + let mem = RawPage::new_zeroed() as *mut u8; + 800182a2: ffff2097 auipc ra,0xffff2 + 800182a6: 4ea080e7 jalr 1258(ra) # 8000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E> + 800182aa: e0aa sd a0,64(sp) + 800182ac: a009 j 800182ae <.LBB9_15+0x20> + 800182ae: 6506 ld a0,64(sp) + 800182b0: 85aa mv a1,a0 + 800182b2: fc2e sd a1,56(sp) + 800182b4: e12a sd a0,128(sp) + 800182b6: 4581 li a1,0 + 800182b8: 6605 lui a2,0x1 + write_bytes(mem, 0, PGSIZE); + 800182ba: 0000a097 auipc ra,0xa + 800182be: 744080e7 jalr 1860(ra) # 800229fe <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E> + 800182c2: a009 j 800182c4 <.LBB9_15+0x36> + 800182c4: 4501 li a0,0 + + self.map( + VirtualAddress::new(0), + 800182c6: ffffa097 auipc ra,0xffffa + 800182ca: c80080e7 jalr -896(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 800182ce: f82a sd a0,48(sp) + 800182d0: a009 j 800182d2 <.LBB9_15+0x44> + PhysicalAddress::new(mem as usize), + 800182d2: 7562 ld a0,56(sp) + 800182d4: ffffa097 auipc ra,0xffffa + 800182d8: d22080e7 jalr -734(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 800182dc: f42a sd a0,40(sp) + 800182de: a009 j 800182e0 <.LBB9_15+0x52> + 800182e0: 4511 li a0,4 + 800182e2: 4589 li a1,2 + PGSIZE, + PteFlags::W | PteFlags::R | PteFlags::X | PteFlags::U + 800182e4: ffff1097 auipc ra,0xffff1 + 800182e8: d94080e7 jalr -620(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 800182ec: f02a sd a0,32(sp) + 800182ee: a009 j 800182f0 <.LBB9_15+0x62> + 800182f0: 7502 ld a0,32(sp) + 800182f2: 45a1 li a1,8 + 800182f4: ffff1097 auipc ra,0xffff1 + 800182f8: d84080e7 jalr -636(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 800182fc: ec2a sd a0,24(sp) + 800182fe: a009 j 80018300 <.LBB9_15+0x72> + 80018300: 6562 ld a0,24(sp) + 80018302: 45c1 li a1,16 + 80018304: ffff1097 auipc ra,0xffff1 + 80018308: d74080e7 jalr -652(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 8001830c: e82a sd a0,16(sp) + 8001830e: a009 j 80018310 <.LBB9_15+0x82> + self.map( + 80018310: 6742 ld a4,16(sp) + 80018312: 7622 ld a2,40(sp) + 80018314: 75c2 ld a1,48(sp) + 80018316: 6566 ld a0,88(sp) + 80018318: 6685 lui a3,0x1 + 8001831a: 00000097 auipc ra,0x0 + 8001831e: cd6080e7 jalr -810(ra) # 80017ff0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE> + 80018322: a009 j 80018324 <.LBB9_15+0x96> + ); + + copy_nonoverlapping(src.as_ptr(), mem, src.len()); + 80018324: 65a6 ld a1,72(sp) + 80018326: 6546 ld a0,80(sp) + 80018328: 00008097 auipc ra,0x8 + 8001832c: 1d6080e7 jalr 470(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 80018330: e42a sd a0,8(sp) + 80018332: a009 j 80018334 <.LBB9_15+0xa6> + 80018334: 65a6 ld a1,72(sp) + 80018336: 6546 ld a0,80(sp) + 80018338: 00008097 auipc ra,0x8 + 8001833c: 16a080e7 jalr 362(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 80018340: e02a sd a0,0(sp) + 80018342: a009 j 80018344 <.LBB9_15+0xb6> + 80018344: 6602 ld a2,0(sp) + 80018346: 65a2 ld a1,8(sp) + 80018348: 7562 ld a0,56(sp) + 8001834a: 0000e097 auipc ra,0xe + 8001834e: d38080e7 jalr -712(ra) # 80026082 + } + 80018352: 60aa ld ra,136(sp) + 80018354: 6149 addi sp,sp,144 + 80018356: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE: + +0000000080018358 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE>: + + + /// Allocate PTEs and physical memory to grow process from old_size to + /// new_size, which need not be page aligned. Returns new size or 0 on error. + pub unsafe fn uvm_alloc( + 80018358: 7169 addi sp,sp,-304 + 8001835a: f606 sd ra,296(sp) + 8001835c: e8b2 sd a2,80(sp) + 8001835e: ecaa sd a0,88(sp) + 80018360: f0ae sd a1,96(sp) + 80018362: fdaa sd a0,248(sp) + 80018364: e232 sd a2,256(sp) + &mut self, + mut old_size: usize, + new_size: usize + ) -> Option { + if new_size < old_size { + 80018366: 00b67863 bgeu a2,a1,80018376 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x1e> + 8001836a: a009 j 8001836c <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x14> + return Some(old_size) + 8001836c: 7506 ld a0,96(sp) + 8001836e: f8aa sd a0,112(sp) + 80018370: 4505 li a0,1 + 80018372: f4aa sd a0,104(sp) + 80018374: aa31 j 80018490 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x138> + } + + old_size = page_round_up(old_size); + 80018376: 7506 ld a0,96(sp) + 80018378: 00006097 auipc ra,0x6 + 8001837c: 356080e7 jalr 854(ra) # 8001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE> + 80018380: e4aa sd a0,72(sp) + 80018382: a009 j 80018384 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x2c> + 80018384: 6646 ld a2,80(sp) + 80018386: 65a6 ld a1,72(sp) + 80018388: f0ae sd a1,96(sp) + + for cur_size in (old_size..new_size).step_by(PGSIZE) { + 8001838a: fd2e sd a1,184(sp) + 8001838c: e1b2 sd a2,192(sp) + 8001838e: 0928 addi a0,sp,152 + 80018390: 6685 lui a3,0x1 + 80018392: ffff4097 auipc ra,0xffff4 + 80018396: fa8080e7 jalr -88(ra) # 8000c33a <_ZN4core4iter6traits8iterator8Iterator7step_by17hcae6c74a630fccd6E> + 8001839a: a009 j 8001839c <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x44> + 8001839c: 18a8 addi a0,sp,120 + 8001839e: 092c addi a1,sp,152 + 800183a0: 00006097 auipc ra,0x6 + 800183a4: 9be080e7 jalr -1602(ra) # 8001dd5e <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h119fa1ab69bc712dE> + 800183a8: a009 j 800183aa <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x52> + 800183aa: 654a ld a0,144(sp) + 800183ac: f1aa sd a0,224(sp) + 800183ae: 652a ld a0,136(sp) + 800183b0: edaa sd a0,216(sp) + 800183b2: 650a ld a0,128(sp) + 800183b4: e9aa sd a0,208(sp) + 800183b6: 7566 ld a0,120(sp) + 800183b8: e5aa sd a0,200(sp) + 800183ba: a009 j 800183bc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x64> + 800183bc: 01a8 addi a0,sp,200 + 800183be: 00006097 auipc ra,0x6 + 800183c2: 89c080e7 jalr -1892(ra) # 8001dc5a <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E> + 800183c6: f5aa sd a0,232(sp) + 800183c8: f9ae sd a1,240(sp) + 800183ca: a009 j 800183cc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x74> + 800183cc: 752e ld a0,232(sp) + 800183ce: 4581 li a1,0 + 800183d0: 00b50463 beq a0,a1,800183d8 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x80> + 800183d4: a009 j 800183d6 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x7e> + 800183d6: a039 j 800183e4 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x8c> + self.uvm_dealloc(cur_size, old_size); + return None + } + } + + Some(new_size) + 800183d8: 6546 ld a0,80(sp) + 800183da: f8aa sd a0,112(sp) + 800183dc: 4505 li a0,1 + 800183de: f4aa sd a0,104(sp) + } + 800183e0: a845 j 80018490 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x138> + for cur_size in (old_size..new_size).step_by(PGSIZE) { + 800183e2: 0000 unimp + 800183e4: 754e ld a0,240(sp) + 800183e6: fc2a sd a0,56(sp) + 800183e8: e62a sd a0,264(sp) + 800183ea: ea2a sd a0,272(sp) + 800183ec: ee2a sd a0,280(sp) + let memory = RawPage::new_zeroed(); + 800183ee: ffff2097 auipc ra,0xffff2 + 800183f2: 39e080e7 jalr 926(ra) # 8000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E> + 800183f6: 85aa mv a1,a0 + 800183f8: e0ae sd a1,64(sp) + 800183fa: f22a sd a0,288(sp) + 800183fc: a009 j 800183fe <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0xa6> + write_bytes(memory as *mut u8, 0, PGSIZE); + 800183fe: 6506 ld a0,64(sp) + 80018400: 4581 li a1,0 + 80018402: 6605 lui a2,0x1 + 80018404: 0000a097 auipc ra,0xa + 80018408: 5fa080e7 jalr 1530(ra) # 800229fe <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E> + 8001840c: a009 j 8001840e <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0xb6> + VirtualAddress::new(cur_size), + 8001840e: 7562 ld a0,56(sp) + 80018410: ffffa097 auipc ra,0xffffa + 80018414: b36080e7 jalr -1226(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80018418: f82a sd a0,48(sp) + 8001841a: a009 j 8001841c <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0xc4> + PhysicalAddress::new(memory), + 8001841c: 6506 ld a0,64(sp) + 8001841e: ffffa097 auipc ra,0xffffa + 80018422: bd8080e7 jalr -1064(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 80018426: f42a sd a0,40(sp) + 80018428: a009 j 8001842a <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0xd2> + 8001842a: 4511 li a0,4 + 8001842c: 4589 li a1,2 + PteFlags::W | PteFlags::R | PteFlags::X | PteFlags::U + 8001842e: ffff1097 auipc ra,0xffff1 + 80018432: c4a080e7 jalr -950(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80018436: f02a sd a0,32(sp) + 80018438: a009 j 8001843a <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0xe2> + 8001843a: 7502 ld a0,32(sp) + 8001843c: 45a1 li a1,8 + 8001843e: ffff1097 auipc ra,0xffff1 + 80018442: c3a080e7 jalr -966(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80018446: ec2a sd a0,24(sp) + 80018448: a009 j 8001844a <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0xf2> + 8001844a: 6562 ld a0,24(sp) + 8001844c: 45c1 li a1,16 + 8001844e: ffff1097 auipc ra,0xffff1 + 80018452: c2a080e7 jalr -982(ra) # 80009078 <_ZN93_$LT$kernel..memory..mapping..page_table_entry..PteFlags$u20$as$u20$core..ops..bit..BitOr$GT$5bitor17h95bfa721b377cbd2E> + 80018456: e82a sd a0,16(sp) + 80018458: a009 j 8001845a <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x102> + if !self.map( + 8001845a: 6742 ld a4,16(sp) + 8001845c: 7622 ld a2,40(sp) + 8001845e: 75c2 ld a1,48(sp) + 80018460: 6566 ld a0,88(sp) + 80018462: 6685 lui a3,0x1 + 80018464: 00000097 auipc ra,0x0 + 80018468: b8c080e7 jalr -1140(ra) # 80017ff0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE> + 8001846c: e42a sd a0,8(sp) + 8001846e: a009 j 80018470 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x118> + 80018470: 6522 ld a0,8(sp) + 80018472: e119 bnez a0,80018478 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x120> + 80018474: a009 j 80018476 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x11e> + drop_in_place(memory as *mut RawPage); + 80018476: a011 j 8001847a <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x122> + for cur_size in (old_size..new_size).step_by(PGSIZE) { + 80018478: b791 j 800183bc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x64> + self.uvm_dealloc(cur_size, old_size); + 8001847a: 75e2 ld a1,56(sp) + 8001847c: 6566 ld a0,88(sp) + 8001847e: 7606 ld a2,96(sp) + 80018480: 00000097 auipc ra,0x0 + 80018484: 088080e7 jalr 136(ra) # 80018508 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E> + 80018488: a009 j 8001848a <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x132> + 8001848a: 4501 li a0,0 + return None + 8001848c: f4aa sd a0,104(sp) + 8001848e: a009 j 80018490 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_alloc17h600a2c8e8dc8349aE+0x138> + } + 80018490: 7526 ld a0,104(sp) + 80018492: 75c6 ld a1,112(sp) + 80018494: 70b2 ld ra,296(sp) + 80018496: 6155 addi sp,sp,304 + 80018498: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE: + +000000008001849a <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE>: + + /// Free user memory pages, + /// then free page-table pages + pub fn uvm_free(&mut self, size: usize) { + 8001849a: 711d addi sp,sp,-96 + 8001849c: ec86 sd ra,88(sp) + 8001849e: f02e sd a1,32(sp) + 800184a0: f42a sd a0,40(sp) + 800184a2: e0aa sd a0,64(sp) + 800184a4: e4ae sd a1,72(sp) + 800184a6: 4501 li a0,0 + if size > 0 { + 800184a8: 00a58a63 beq a1,a0,800184bc <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x22> + 800184ac: a009 j 800184ae <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x14> + let mut pa = PhysicalAddress::new(size); + 800184ae: 7502 ld a0,32(sp) + 800184b0: ffffa097 auipc ra,0xffffa + 800184b4: b46080e7 jalr -1210(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 800184b8: fc2a sd a0,56(sp) + 800184ba: a011 j 800184be <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x24> + if size > 0 { + 800184bc: a099 j 80018502 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x68> + 800184be: 1828 addi a0,sp,56 + pa.pg_round_up(); + 800184c0: fffec097 auipc ra,0xfffec + 800184c4: 500080e7 jalr 1280(ra) # 800049c0 <_ZN6kernel6memory7address4Addr11pg_round_up17h93ce0bf629830ebdE> + 800184c8: a009 j 800184ca <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x30> + 800184ca: 1828 addi a0,sp,56 + let ppn = pa.as_usize() / PGSIZE; + 800184cc: ffffa097 auipc ra,0xffffa + 800184d0: a68080e7 jalr -1432(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 800184d4: ec2a sd a0,24(sp) + 800184d6: a009 j 800184d8 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x3e> + 800184d8: 6562 ld a0,24(sp) + 800184da: 8131 srli a0,a0,0xc + 800184dc: e42a sd a0,8(sp) + 800184de: e8aa sd a0,80(sp) + 800184e0: 4501 li a0,0 + self.uvm_unmap( + VirtualAddress::new(0), + 800184e2: ffffa097 auipc ra,0xffffa + 800184e6: a64080e7 jalr -1436(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 800184ea: e82a sd a0,16(sp) + 800184ec: a009 j 800184ee <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x54> + self.uvm_unmap( + 800184ee: 6622 ld a2,8(sp) + 800184f0: 65c2 ld a1,16(sp) + 800184f2: 7522 ld a0,40(sp) + 800184f4: 4685 li a3,1 + 800184f6: 00000097 auipc ra,0x0 + 800184fa: 0e6080e7 jalr 230(ra) # 800185dc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E> + 800184fe: a009 j 80018500 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x66> + if size > 0 { + 80018500: a009 j 80018502 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE+0x68> + ppn, + true + ); + } + // drop(self); + } + 80018502: 60e6 ld ra,88(sp) + 80018504: 6125 addi sp,sp,96 + 80018506: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E: + +0000000080018508 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E>: + + /// Deallocate user pages to bring the process size from old_size to + /// new_size. old_size and new_size need not be page-aligned, nor does new_size + /// need to be less than old_size. old_size can be larger than the actual + /// process size. Returns the new process size. + pub fn uvm_dealloc( + 80018508: 7175 addi sp,sp,-144 + 8001850a: e506 sd ra,136(sp) + 8001850c: e4b2 sd a2,72(sp) + 8001850e: e8ae sd a1,80(sp) + 80018510: ecaa sd a0,88(sp) + 80018512: f4aa sd a0,104(sp) + 80018514: f8ae sd a1,112(sp) + 80018516: fcb2 sd a2,120(sp) + &mut self, + old_size:usize, + new_size:usize + ) -> usize { + if new_size >= old_size { + 80018518: 00b66663 bltu a2,a1,80018524 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x1c> + 8001851c: a009 j 8001851e <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x16> + return old_size + 8001851e: 6546 ld a0,80(sp) + 80018520: f0aa sd a0,96(sp) + ); + } + + new_size + + } + 80018522: a851 j 800185b6 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0xae> + if page_round_up(new_size) < page_round_up(old_size) { + 80018524: 6526 ld a0,72(sp) + 80018526: 00006097 auipc ra,0x6 + 8001852a: 1a8080e7 jalr 424(ra) # 8001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE> + 8001852e: e0aa sd a0,64(sp) + 80018530: a009 j 80018532 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x2a> + 80018532: 6546 ld a0,80(sp) + 80018534: 00006097 auipc ra,0x6 + 80018538: 19a080e7 jalr 410(ra) # 8001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE> + 8001853c: fc2a sd a0,56(sp) + 8001853e: a009 j 80018540 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x38> + 80018540: 6506 ld a0,64(sp) + 80018542: 75e2 ld a1,56(sp) + 80018544: 00b57a63 bgeu a0,a1,80018558 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x50> + 80018548: a009 j 8001854a <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x42> + let pages_num = (page_round_up(old_size) - page_round_up(new_size)) / PGSIZE; + 8001854a: 6546 ld a0,80(sp) + 8001854c: 00006097 auipc ra,0x6 + 80018550: 182080e7 jalr 386(ra) # 8001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE> + 80018554: f82a sd a0,48(sp) + 80018556: a011 j 8001855a <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x52> + if page_round_up(new_size) < page_round_up(old_size) { + 80018558: a8a1 j 800185b0 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0xa8> + let pages_num = (page_round_up(old_size) - page_round_up(new_size)) / PGSIZE; + 8001855a: 6526 ld a0,72(sp) + 8001855c: 00006097 auipc ra,0x6 + 80018560: 172080e7 jalr 370(ra) # 8001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE> + 80018564: f42a sd a0,40(sp) + 80018566: a009 j 80018568 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x60> + 80018568: 7542 ld a0,48(sp) + 8001856a: 75a2 ld a1,40(sp) + 8001856c: 40b505b3 sub a1,a0,a1 + 80018570: f02e sd a1,32(sp) + 80018572: 04b56663 bltu a0,a1,800185be <.LBB12_16> + 80018576: a009 j 80018578 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x70> + 80018578: 6526 ld a0,72(sp) + 8001857a: 7582 ld a1,32(sp) + 8001857c: 81b1 srli a1,a1,0xc + 8001857e: e82e sd a1,16(sp) + 80018580: e12e sd a1,128(sp) + VirtualAddress::new(page_round_up(new_size)), + 80018582: 00006097 auipc ra,0x6 + 80018586: 14c080e7 jalr 332(ra) # 8001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE> + 8001858a: ec2a sd a0,24(sp) + 8001858c: a009 j 8001858e <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x86> + 8001858e: 6562 ld a0,24(sp) + 80018590: ffffa097 auipc ra,0xffffa + 80018594: 9b6080e7 jalr -1610(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80018598: e42a sd a0,8(sp) + 8001859a: a009 j 8001859c <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0x94> + self.uvm_unmap( + 8001859c: 6642 ld a2,16(sp) + 8001859e: 65a2 ld a1,8(sp) + 800185a0: 6566 ld a0,88(sp) + 800185a2: 4685 li a3,1 + 800185a4: 00000097 auipc ra,0x0 + 800185a8: 038080e7 jalr 56(ra) # 800185dc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E> + 800185ac: a009 j 800185ae <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0xa6> + if page_round_up(new_size) < page_round_up(old_size) { + 800185ae: a009 j 800185b0 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0xa8> + new_size + 800185b0: 6526 ld a0,72(sp) + 800185b2: f0aa sd a0,96(sp) + } + 800185b4: a009 j 800185b6 <_ZN6kernel6memory7mapping10page_table9PageTable11uvm_dealloc17hf5596dd69dc9e626E+0xae> + 800185b6: 7506 ld a0,96(sp) + 800185b8: 60aa ld ra,136(sp) + 800185ba: 6149 addi sp,sp,144 + 800185bc: 8082 ret + +00000000800185be <.LBB12_16>: + let pages_num = (page_round_up(old_size) - page_round_up(new_size)) / PGSIZE; + 800185be: 00013517 auipc a0,0x13 + 800185c2: 0b250513 addi a0,a0,178 # 8002b670 + +00000000800185c6 <.LBB12_17>: + 800185c6: 00013617 auipc a2,0x13 + 800185ca: 09260613 addi a2,a2,146 # 8002b658 <.L__unnamed_19> + 800185ce: 02100593 li a1,33 + 800185d2: 0000b097 auipc ra,0xb + 800185d6: b72080e7 jalr -1166(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E: + +00000000800185dc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E>: + + + /// Remove npages of mappings starting from va. va must be + /// page-aligned. The mappings must exist. + /// Optionally free the physical memory. + pub fn uvm_unmap( + 800185dc: 7115 addi sp,sp,-224 + 800185de: ed86 sd ra,216(sp) + 800185e0: e0b2 sd a2,64(sp) + 800185e2: e4aa sd a0,72(sp) + 800185e4: 8736 mv a4,a3 + 800185e6: e8ba sd a4,80(sp) + 800185e8: f0ae sd a1,96(sp) + 800185ea: f12a sd a0,160(sp) + 800185ec: f532 sd a2,168(sp) + 800185ee: 0ad10ba3 sb a3,183(sp) + 800185f2: 1088 addi a0,sp,96 + &mut self, + mut va: VirtualAddress, + npages: usize, + free: bool + ){ + if !va.is_page_aligned() { + 800185f4: fffec097 auipc ra,0xfffec + 800185f8: 304080e7 jalr 772(ra) # 800048f8 <_ZN6kernel6memory7address4Addr15is_page_aligned17h21d9aa1b7bd151ebE> + 800185fc: ecaa sd a0,88(sp) + 800185fe: a009 j 80018600 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E+0x24> + 80018600: 6566 ld a0,88(sp) + 80018602: e105 bnez a0,80018622 <.LBB13_33+0x14> + 80018604: a009 j 80018606 <.LBB13_32> + +0000000080018606 <.LBB13_32>: + panic!("uvm_unmap: not aligned"); + 80018606: 00013517 auipc a0,0x13 + 8001860a: 08b50513 addi a0,a0,139 # 8002b691 <.L__unnamed_20> + +000000008001860e <.LBB13_33>: + 8001860e: 00013617 auipc a2,0x13 + 80018612: 09a60613 addi a2,a2,154 # 8002b6a8 <.L__unnamed_21> + 80018616: 45d9 li a1,22 + 80018618: 0000b097 auipc ra,0xb + 8001861c: b2c080e7 jalr -1236(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80018620: 0000 unimp + 80018622: 6586 ld a1,64(sp) + 80018624: 4501 li a0,0 + } + + for _ in 0..npages { + 80018626: f4aa sd a0,104(sp) + 80018628: f8ae sd a1,112(sp) + 8001862a: 00008097 auipc ra,0x8 + 8001862e: 1e6080e7 jalr 486(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80018632: f82a sd a0,48(sp) + 80018634: fc2e sd a1,56(sp) + 80018636: a009 j 80018638 <.LBB13_33+0x2a> + 80018638: 7562 ld a0,56(sp) + 8001863a: 75c2 ld a1,48(sp) + 8001863c: fcae sd a1,120(sp) + 8001863e: e12a sd a0,128(sp) + 80018640: a009 j 80018642 <.LBB13_33+0x34> + 80018642: 18a8 addi a0,sp,120 + 80018644: 00008097 auipc ra,0x8 + 80018648: 15e080e7 jalr 350(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001864c: e52a sd a0,136(sp) + 8001864e: e92e sd a1,144(sp) + 80018650: a009 j 80018652 <.LBB13_33+0x44> + 80018652: 652a ld a0,136(sp) + 80018654: 4581 li a1,0 + 80018656: 00b50463 beq a0,a1,8001865e <.LBB13_33+0x50> + 8001865a: a009 j 8001865c <.LBB13_33+0x4e> + 8001865c: a029 j 80018666 <.LBB13_33+0x58> + panic!("uvm_unmap"); + } + } + va.add_page(); + } + } + 8001865e: 60ee ld ra,216(sp) + 80018660: 612d addi sp,sp,224 + 80018662: 8082 ret + for _ in 0..npages { + 80018664: 0000 unimp + 80018666: 6526 ld a0,72(sp) + 80018668: 65ca ld a1,144(sp) + 8001866a: fd2e sd a1,184(sp) + 8001866c: e1ae sd a1,192(sp) + match self.translate(va) { + 8001866e: 7586 ld a1,96(sp) + 80018670: fffff097 auipc ra,0xfffff + 80018674: 5c4080e7 jalr 1476(ra) # 80017c34 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E> + 80018678: ed2a sd a0,152(sp) + 8001867a: a009 j 8001867c <.LBB13_33+0x6e> + Some(pte) => { + 8001867c: 656a ld a0,152(sp) + 8001867e: 00a035b3 snez a1,a0 + 80018682: 4581 li a1,0 + 80018684: 00b50463 beq a0,a1,8001868c <.LBB13_34> + 80018688: a009 j 8001868a <.LBB13_33+0x7c> + 8001868a: a005 j 800186aa <.LBB13_35+0x16> + +000000008001868c <.LBB13_34>: + panic!("uvm_unmap"); + 8001868c: 00013517 auipc a0,0x13 + 80018690: 0bc50513 addi a0,a0,188 # 8002b748 <.L__unnamed_22> + +0000000080018694 <.LBB13_35>: + 80018694: 00013617 auipc a2,0x13 + 80018698: 0c460613 addi a2,a2,196 # 8002b758 <.L__unnamed_23> + 8001869c: 45a5 li a1,9 + 8001869e: 0000b097 auipc ra,0xb + 800186a2: aa6080e7 jalr -1370(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800186a6: 0000 unimp + match self.translate(va) { + 800186a8: 0000 unimp + Some(pte) => { + 800186aa: 656a ld a0,152(sp) + 800186ac: f02a sd a0,32(sp) + 800186ae: e5aa sd a0,200(sp) + if !pte.is_valid() { + 800186b0: ffff1097 auipc ra,0xffff1 + 800186b4: 848080e7 jalr -1976(ra) # 80008ef8 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E> + 800186b8: f42a sd a0,40(sp) + 800186ba: a009 j 800186bc <.LBB13_35+0x28> + 800186bc: 7522 ld a0,40(sp) + 800186be: e105 bnez a0,800186de <.LBB13_37+0x14> + 800186c0: a009 j 800186c2 <.LBB13_36> + +00000000800186c2 <.LBB13_36>: + panic!("uvm_unmap: not mapped"); + 800186c2: 00013517 auipc a0,0x13 + 800186c6: ffe50513 addi a0,a0,-2 # 8002b6c0 <.L__unnamed_24> + +00000000800186ca <.LBB13_37>: + 800186ca: 00013617 auipc a2,0x13 + 800186ce: 00e60613 addi a2,a2,14 # 8002b6d8 <.L__unnamed_25> + 800186d2: 45d5 li a1,21 + 800186d4: 0000b097 auipc ra,0xb + 800186d8: a70080e7 jalr -1424(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800186dc: 0000 unimp + if !pte.is_leaf() { + 800186de: 7502 ld a0,32(sp) + 800186e0: ffff1097 auipc ra,0xffff1 + 800186e4: 874080e7 jalr -1932(ra) # 80008f54 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry7is_leaf17h30d4b7c99c6d4286E> + 800186e8: ec2a sd a0,24(sp) + 800186ea: a009 j 800186ec <.LBB13_37+0x22> + 800186ec: 6562 ld a0,24(sp) + 800186ee: e105 bnez a0,8001870e <.LBB13_39+0x14> + 800186f0: a009 j 800186f2 <.LBB13_38> + +00000000800186f2 <.LBB13_38>: + panic!("IS NOT LEAF"); + 800186f2: 00013517 auipc a0,0x13 + 800186f6: ffe50513 addi a0,a0,-2 # 8002b6f0 <.L__unnamed_26> + +00000000800186fa <.LBB13_39>: + 800186fa: 00013617 auipc a2,0x13 + 800186fe: 00660613 addi a2,a2,6 # 8002b700 <.L__unnamed_27> + 80018702: 45ad li a1,11 + 80018704: 0000b097 auipc ra,0xb + 80018708: a40080e7 jalr -1472(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001870c: 0000 unimp + if pte.as_flags() == PteFlags::V.bits() { + 8001870e: 7502 ld a0,32(sp) + 80018710: ffff1097 auipc ra,0xffff1 + 80018714: 8da080e7 jalr -1830(ra) # 80008fea <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_flags17hf18e3bbee6201d61E> + 80018718: e82a sd a0,16(sp) + 8001871a: a009 j 8001871c <.LBB13_40> + +000000008001871c <.LBB13_40>: + 8001871c: 0000f517 auipc a0,0xf + 80018720: 11450513 addi a0,a0,276 # 80027830 <.L__unnamed_6+0xa0> + 80018724: ffff1097 auipc ra,0xffff1 + 80018728: 94a080e7 jalr -1718(ra) # 8000906e <_ZN6kernel6memory7mapping16page_table_entry8PteFlags4bits17hec41972a30d9c1c3E> + 8001872c: e42a sd a0,8(sp) + 8001872e: a009 j 80018730 <.LBB13_40+0x14> + 80018730: 6542 ld a0,16(sp) + 80018732: 65a2 ld a1,8(sp) + 80018734: 02b51163 bne a0,a1,80018756 <.LBB13_42+0x14> + 80018738: a009 j 8001873a <.LBB13_41> + +000000008001873a <.LBB13_41>: + panic!("uvm_unmap: not a leaf"); + 8001873a: 00013517 auipc a0,0x13 + 8001873e: fde50513 addi a0,a0,-34 # 8002b718 <.L__unnamed_28> + +0000000080018742 <.LBB13_42>: + 80018742: 00013617 auipc a2,0x13 + 80018746: fee60613 addi a2,a2,-18 # 8002b730 <.L__unnamed_29> + 8001874a: 45d5 li a1,21 + 8001874c: 0000b097 auipc ra,0xb + 80018750: 9f8080e7 jalr -1544(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80018754: 0000 unimp + 80018756: 6546 ld a0,80(sp) + 80018758: 4581 li a1,0 + if free { + 8001875a: 00b50a63 beq a0,a1,8001876e <.LBB13_42+0x2c> + 8001875e: a009 j 80018760 <.LBB13_42+0x1e> + let pa = pte.as_pagetable(); + 80018760: 7502 ld a0,32(sp) + 80018762: ffff1097 auipc ra,0xffff1 + 80018766: 86c080e7 jalr -1940(ra) # 80008fce <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE> + 8001876a: e9aa sd a0,208(sp) + 8001876c: a011 j 80018770 <.LBB13_42+0x2e> + if free { + 8001876e: a031 j 8001877a <.LBB13_42+0x38> + unsafe{ drop_in_place(pa) }; + 80018770: a009 j 80018772 <.LBB13_42+0x30> + 80018772: 7582 ld a1,32(sp) + 80018774: 4501 li a0,0 + pte.0 = 0; + 80018776: e188 sd a0,0(a1) + if free { + 80018778: a009 j 8001877a <.LBB13_42+0x38> + 8001877a: 1088 addi a0,sp,96 + va.add_page(); + 8001877c: fffec097 auipc ra,0xfffec + 80018780: 350080e7 jalr 848(ra) # 80004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE> + 80018784: a009 j 80018786 <.LBB13_42+0x44> + for _ in 0..npages { + 80018786: bd75 j 80018642 <.LBB13_33+0x34> + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E: + +0000000080018788 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E>: + /// its memory into a child's page table. + /// Copies both the page table and the + /// physical memory. + /// returns 0 on success, -1 on failure. + /// frees any allocated pages on failure. + pub unsafe fn uvm_copy( + 80018788: 7151 addi sp,sp,-240 + 8001878a: f586 sd ra,232(sp) + 8001878c: f8b2 sd a2,112(sp) + 8001878e: fcae sd a1,120(sp) + 80018790: e12a sd a0,128(sp) + 80018792: f52a sd a0,168(sp) + 80018794: f92e sd a1,176(sp) + 80018796: fd32 sd a2,184(sp) + 80018798: 4501 li a0,0 + &mut self, + child_pgt: &mut Self, + size: usize + ) -> Result<(), &'static str> { + let mut va = VirtualAddress::new(0); + 8001879a: ffff9097 auipc ra,0xffff9 + 8001879e: 7ac080e7 jalr 1964(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 800187a2: ed2a sd a0,152(sp) + 800187a4: a009 j 800187a6 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E+0x1e> + 800187a6: 0928 addi a0,sp,152 + while va.as_usize() != size { + 800187a8: ffff9097 auipc ra,0xffff9 + 800187ac: 77a080e7 jalr 1914(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 800187b0: f4aa sd a0,104(sp) + 800187b2: a009 j 800187b4 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E+0x2c> + 800187b4: 7526 ld a0,104(sp) + 800187b6: 75c6 ld a1,112(sp) + 800187b8: 00b51663 bne a0,a1,800187c4 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E+0x3c> + 800187bc: a009 j 800187be <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E+0x36> + 800187be: 4501 li a0,0 + } + } + va.add_page(); + } + + Ok(()) + 800187c0: e52a sd a0,136(sp) + } + 800187c2: a28d j 80018924 <.LBB14_33+0x12> + match self.translate(va) { + 800187c4: 650a ld a0,128(sp) + 800187c6: 65ea ld a1,152(sp) + 800187c8: fffff097 auipc ra,0xfffff + 800187cc: 46c080e7 jalr 1132(ra) # 80017c34 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E> + 800187d0: f12a sd a0,160(sp) + 800187d2: a009 j 800187d4 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E+0x4c> + Some(pte) => { + 800187d4: 750a ld a0,160(sp) + 800187d6: 00a035b3 snez a1,a0 + 800187da: 4581 li a1,0 + 800187dc: 00b50463 beq a0,a1,800187e4 <.LBB14_29> + 800187e0: a009 j 800187e2 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E+0x5a> + 800187e2: a00d j 80018804 <.LBB14_30+0x18> + +00000000800187e4 <.LBB14_29>: + panic!("uvmcopy: No exist pte(pte should exist)"); + 800187e4: 00013517 auipc a0,0x13 + 800187e8: fd250513 addi a0,a0,-46 # 8002b7b6 <.L__unnamed_30> + +00000000800187ec <.LBB14_30>: + 800187ec: 00013617 auipc a2,0x13 + 800187f0: ff460613 addi a2,a2,-12 # 8002b7e0 <.L__unnamed_31> + 800187f4: 02700593 li a1,39 + 800187f8: 0000b097 auipc ra,0xb + 800187fc: 94c080e7 jalr -1716(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80018800: 0000 unimp + match self.translate(va) { + 80018802: 0000 unimp + Some(pte) => { + 80018804: 750a ld a0,160(sp) + 80018806: ecaa sd a0,88(sp) + 80018808: e1aa sd a0,192(sp) + if !pte.is_valid() { + 8001880a: ffff0097 auipc ra,0xffff0 + 8001880e: 6ee080e7 jalr 1774(ra) # 80008ef8 <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8is_valid17h2b3a673d14ed09c6E> + 80018812: f0aa sd a0,96(sp) + 80018814: a009 j 80018816 <.LBB14_30+0x2a> + 80018816: 7506 ld a0,96(sp) + 80018818: e105 bnez a0,80018838 <.LBB14_32+0x14> + 8001881a: a009 j 8001881c <.LBB14_31> + +000000008001881c <.LBB14_31>: + panic!("uvmcopy(): page not present"); + 8001881c: 00013517 auipc a0,0x13 + 80018820: f5450513 addi a0,a0,-172 # 8002b770 <.L__unnamed_32> + +0000000080018824 <.LBB14_32>: + 80018824: 00013617 auipc a2,0x13 + 80018828: f6c60613 addi a2,a2,-148 # 8002b790 <.L__unnamed_33> + 8001882c: 45ed li a1,27 + 8001882e: 0000b097 auipc ra,0xb + 80018832: 916080e7 jalr -1770(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80018836: 0000 unimp + let page_table = pte.as_pagetable(); + 80018838: 6566 ld a0,88(sp) + 8001883a: ffff0097 auipc ra,0xffff0 + 8001883e: 794080e7 jalr 1940(ra) # 80008fce <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry12as_pagetable17h89cf44fefbbd4b4eE> + 80018842: 85aa mv a1,a0 + 80018844: e8ae sd a1,80(sp) + 80018846: e5aa sd a0,200(sp) + 80018848: a009 j 8001884a <.LBB14_32+0x26> + let flags = pte.as_flags(); + 8001884a: 6566 ld a0,88(sp) + 8001884c: ffff0097 auipc ra,0xffff0 + 80018850: 79e080e7 jalr 1950(ra) # 80008fea <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry8as_flags17hf18e3bbee6201d61E> + 80018854: 85aa mv a1,a0 + 80018856: e4ae sd a1,72(sp) + 80018858: e9aa sd a0,208(sp) + 8001885a: a009 j 8001885c <.LBB14_32+0x38> + let flags = PteFlags::new(flags); + 8001885c: 6526 ld a0,72(sp) + 8001885e: ffff0097 auipc ra,0xffff0 + 80018862: 686080e7 jalr 1670(ra) # 80008ee4 <_ZN6kernel6memory7mapping16page_table_entry8PteFlags3new17h46b0ea84c5bd5a31E> + 80018866: 85aa mv a1,a0 + 80018868: e0ae sd a1,64(sp) + 8001886a: edaa sd a0,216(sp) + 8001886c: a009 j 8001886e <.LBB14_32+0x4a> + let allocated_pgt = &mut *(RawPage::new_zeroed() as *mut PageTable); + 8001886e: ffff2097 auipc ra,0xffff2 + 80018872: f1e080e7 jalr -226(ra) # 8000a78c <_ZN6kernel6memory13PageAllocator10new_zeroed17hbc99bdbca8d1d931E> + 80018876: fc2a sd a0,56(sp) + 80018878: a009 j 8001887a <.LBB14_32+0x56> + 8001887a: 65c6 ld a1,80(sp) + 8001887c: 7562 ld a0,56(sp) + 8001887e: 862a mv a2,a0 + 80018880: f832 sd a2,48(sp) + 80018882: f1aa sd a0,224(sp) + allocated_pgt.write(& *page_table); + 80018884: fffff097 auipc ra,0xfffff + 80018888: 2e0080e7 jalr 736(ra) # 80017b64 <_ZN6kernel6memory7mapping10page_table9PageTable5write17h1197b2bc60e8313aE> + 8001888c: a009 j 8001888e <.LBB14_32+0x6a> + va, + 8001888e: 7542 ld a0,48(sp) + 80018890: 65ea ld a1,152(sp) + PhysicalAddress::new(allocated_pgt.as_addr()), + 80018892: f02e sd a1,32(sp) + 80018894: fffff097 auipc ra,0xfffff + 80018898: 286080e7 jalr 646(ra) # 80017b1a <_ZN6kernel6memory7mapping10page_table9PageTable7as_addr17hcce185773f2c85f7E> + 8001889c: f42a sd a0,40(sp) + 8001889e: a009 j 800188a0 <.LBB14_32+0x7c> + 800188a0: 7522 ld a0,40(sp) + 800188a2: ffff9097 auipc ra,0xffff9 + 800188a6: 754080e7 jalr 1876(ra) # 80011ff6 <_ZN6kernel6memory7address15PhysicalAddress3new17hf2b76f8479ac6235E> + 800188aa: ec2a sd a0,24(sp) + 800188ac: a009 j 800188ae <.LBB14_32+0x8a> + if !child_pgt.map( + 800188ae: 6706 ld a4,64(sp) + 800188b0: 6662 ld a2,24(sp) + 800188b2: 7582 ld a1,32(sp) + 800188b4: 7566 ld a0,120(sp) + 800188b6: 6685 lui a3,0x1 + 800188b8: fffff097 auipc ra,0xfffff + 800188bc: 738080e7 jalr 1848(ra) # 80017ff0 <_ZN6kernel6memory7mapping10page_table9PageTable3map17h08dc54e6ac3f590cE> + 800188c0: e82a sd a0,16(sp) + 800188c2: a009 j 800188c4 <.LBB14_32+0xa0> + 800188c4: 6542 ld a0,16(sp) + 800188c6: e901 bnez a0,800188d6 <.LBB14_32+0xb2> + 800188c8: a009 j 800188ca <.LBB14_32+0xa6> + drop(allocated_pgt); + 800188ca: 7542 ld a0,48(sp) + 800188cc: 00005097 auipc ra,0x5 + 800188d0: 608080e7 jalr 1544(ra) # 8001ded4 <_ZN4core3mem4drop17ha184dbcd1a83d607E> + 800188d4: a039 j 800188e2 <.LBB14_32+0xbe> + 800188d6: 0928 addi a0,sp,152 + va.add_page(); + 800188d8: fffec097 auipc ra,0xfffec + 800188dc: 1f4080e7 jalr 500(ra) # 80004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE> + 800188e0: a089 j 80018922 <.LBB14_33+0x10> + 800188e2: 4501 li a0,0 + VirtualAddress::new(0), + 800188e4: ffff9097 auipc ra,0xffff9 + 800188e8: 662080e7 jalr 1634(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 800188ec: e42a sd a0,8(sp) + 800188ee: a009 j 800188f0 <.LBB14_32+0xcc> + 800188f0: 0928 addi a0,sp,152 + va.as_usize() / PGSIZE, + 800188f2: ffff9097 auipc ra,0xffff9 + 800188f6: 630080e7 jalr 1584(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 800188fa: e02a sd a0,0(sp) + 800188fc: a009 j 800188fe <.LBB14_32+0xda> + 800188fe: 65a2 ld a1,8(sp) + 80018900: 7566 ld a0,120(sp) + 80018902: 6602 ld a2,0(sp) + 80018904: 8231 srli a2,a2,0xc + 80018906: 4685 li a3,1 + child_pgt.uvm_unmap( + 80018908: 00000097 auipc ra,0x0 + 8001890c: cd4080e7 jalr -812(ra) # 800185dc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E> + 80018910: a009 j 80018912 <.LBB14_33> + +0000000080018912 <.LBB14_33>: + return Err("uvmcopy: Fail.") + 80018912: 00013517 auipc a0,0x13 + 80018916: e9650513 addi a0,a0,-362 # 8002b7a8 <.L__unnamed_34> + 8001891a: e52a sd a0,136(sp) + 8001891c: 4539 li a0,14 + 8001891e: e92a sd a0,144(sp) + } + 80018920: a011 j 80018924 <.LBB14_33+0x12> + while va.as_usize() != size { + 80018922: b551 j 800187a6 <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_copy17h09757305193d69e4E+0x1e> + } + 80018924: 652a ld a0,136(sp) + 80018926: 65ca ld a1,144(sp) + 80018928: 70ae ld ra,232(sp) + 8001892a: 616d addi sp,sp,240 + 8001892c: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable9uvm_clear17hb623751aee30bcf2E: + +000000008001892e <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_clear17hb623751aee30bcf2E>: + + + + /// mark a PTE invalid for user access. + /// used by exec for the user stack guard page. + pub fn uvm_clear(&mut self, va: VirtualAddress) { + 8001892e: 7179 addi sp,sp,-48 + 80018930: f406 sd ra,40(sp) + 80018932: e82a sd a0,16(sp) + 80018934: ec2e sd a1,24(sp) + if let Some(pte) = self.translate(va) { + 80018936: fffff097 auipc ra,0xfffff + 8001893a: 2fe080e7 jalr 766(ra) # 80017c34 <_ZN6kernel6memory7mapping10page_table9PageTable9translate17h0a84bb7f836f6989E> + 8001893e: e42a sd a0,8(sp) + 80018940: a009 j 80018942 <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_clear17hb623751aee30bcf2E+0x14> + 80018942: 6522 ld a0,8(sp) + 80018944: 4581 li a1,0 + 80018946: 02b51263 bne a0,a1,8001896a <.LBB15_6+0x16> + 8001894a: a009 j 8001894c <.LBB15_5> + +000000008001894c <.LBB15_5>: + pte.rm_user_bit(); + }else { + panic!("uvmclear(): Not found valid pte for virtualaddress"); + 8001894c: 00013517 auipc a0,0x13 + 80018950: eac50513 addi a0,a0,-340 # 8002b7f8 <.L__unnamed_35> + +0000000080018954 <.LBB15_6>: + 80018954: 00013617 auipc a2,0x13 + 80018958: edc60613 addi a2,a2,-292 # 8002b830 <.L__unnamed_36> + 8001895c: 03200593 li a1,50 + 80018960: 0000a097 auipc ra,0xa + 80018964: 7e4080e7 jalr 2020(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80018968: 0000 unimp + if let Some(pte) = self.translate(va) { + 8001896a: 6522 ld a0,8(sp) + 8001896c: f02a sd a0,32(sp) + pte.rm_user_bit(); + 8001896e: ffff0097 auipc ra,0xffff0 + 80018972: 630080e7 jalr 1584(ra) # 80008f9e <_ZN6kernel6memory7mapping16page_table_entry14PageTableEntry11rm_user_bit17hf6078e39c3f185baE> + 80018976: a009 j 80018978 <.LBB15_6+0x24> + } + } + 80018978: 70a2 ld ra,40(sp) + 8001897a: 6145 addi sp,sp,48 + 8001897c: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E: + +000000008001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E>: + + /// Copy from kernel to user. + /// Copy len bytes from src to virtual address dstva in a given page table. + /// Return Result<(), Err>. + pub fn copy_out( + 8001897e: 7111 addi sp,sp,-256 + 80018980: fd86 sd ra,248(sp) + 80018982: e532 sd a2,136(sp) + 80018984: e92e sd a1,144(sp) + 80018986: 85aa mv a1,a0 + 80018988: 654a ld a0,144(sp) + 8001898a: ed2e sd a1,152(sp) + 8001898c: f136 sd a3,160(sp) + 8001898e: f1ae sd a1,224(sp) + 80018990: f5aa sd a0,232(sp) + 80018992: f9b2 sd a2,240(sp) + mut len: usize + ) -> Result<(), &'static str> { + // 从内核空间向用户空间拷贝数据 + // 拷贝的起始地址为 dst, 拷贝的结束地址为 dst + len + // 首先将目标地址转成虚拟地址并进行页对齐 + let mut va = VirtualAddress::new(dst); + 80018994: ffff9097 auipc ra,0xffff9 + 80018998: 5b2080e7 jalr 1458(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 8001899c: fd2a sd a0,184(sp) + 8001899e: a009 j 800189a0 <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E+0x22> + 800189a0: 1928 addi a0,sp,184 + va.pg_round_down(); + 800189a2: fffec097 auipc ra,0xfffec + 800189a6: 0a8080e7 jalr 168(ra) # 80004a4a <_ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE> + 800189aa: a009 j 800189ac <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E+0x2e> + 800189ac: 1928 addi a0,sp,184 + + // println!("[Debug] va: 0x{:x}, dst: 0x{:x}", va.as_usize(), dst); + // 计算第一次需要拷贝的字节数,需要进行页对齐 + let mut count = PGSIZE - (dst - va.as_usize()); + 800189ae: ffff9097 auipc ra,0xffff9 + 800189b2: 574080e7 jalr 1396(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 800189b6: e12a sd a0,128(sp) + 800189b8: a009 j 800189ba <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E+0x3c> + 800189ba: 654a ld a0,144(sp) + 800189bc: 658a ld a1,128(sp) + 800189be: 40b505b3 sub a1,a0,a1 + 800189c2: fcae sd a1,120(sp) + 800189c4: 14b56b63 bltu a0,a1,80018b1a <.LBB16_31> + 800189c8: a009 j 800189ca <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E+0x4c> + 800189ca: 75e6 ld a1,120(sp) + 800189cc: 6505 lui a0,0x1 + 800189ce: 40b505b3 sub a1,a0,a1 + 800189d2: f8ae sd a1,112(sp) + 800189d4: 16b56263 bltu a0,a1,80018b38 <.LBB16_33> + 800189d8: a009 j 800189da <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E+0x5c> + 800189da: 656a ld a0,152(sp) + 800189dc: 75c6 ld a1,112(sp) + 800189de: e1ae sd a1,192(sp) + 800189e0: 4581 li a1,0 + // 拷贝地址的偏移量,即已经拷贝了多少字节 + let mut offset = 0; + 800189e2: e5ae sd a1,200(sp) + // 将目标地址的虚拟地址翻译成物理地址 + let mut pa = self.pgt_translate(va).unwrap(); + 800189e4: 75ea ld a1,184(sp) + 800189e6: fffff097 auipc ra,0xfffff + 800189ea: 548080e7 jalr 1352(ra) # 80017f2e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E> + 800189ee: f0aa sd a0,96(sp) + 800189f0: f4ae sd a1,104(sp) + 800189f2: a009 j 800189f4 <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E+0x76> + 800189f4: 75a6 ld a1,104(sp) + 800189f6: 7506 ld a0,96(sp) + +00000000800189f8 <.LBB16_29>: + 800189f8: 00013617 auipc a2,0x13 + 800189fc: e8060613 addi a2,a2,-384 # 8002b878 <.L__unnamed_37> + 80018a00: ffff7097 auipc ra,0xffff7 + 80018a04: c4e080e7 jalr -946(ra) # 8000f64e <_ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E> + 80018a08: e9aa sd a0,208(sp) + 80018a0a: a009 j 80018a0c <.LBB16_29+0x14> + 80018a0c: 0988 addi a0,sp,208 + // 计算需要拷贝的虚拟地址的位置 + let mut dst_ptr = unsafe{ + pa.as_mut_ptr().offset((dst - va.as_usize()) as isize) + 80018a0e: fffec097 auipc ra,0xfffec + 80018a12: f0e080e7 jalr -242(ra) # 8000491c <_ZN6kernel6memory7address4Addr10as_mut_ptr17hfa59607f4391fdb5E> + 80018a16: ecaa sd a0,88(sp) + 80018a18: a009 j 80018a1a <.LBB16_29+0x22> + 80018a1a: 1928 addi a0,sp,184 + 80018a1c: ffff9097 auipc ra,0xffff9 + 80018a20: 506080e7 jalr 1286(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80018a24: e8aa sd a0,80(sp) + 80018a26: a009 j 80018a28 <.LBB16_29+0x30> + 80018a28: 654a ld a0,144(sp) + 80018a2a: 65c6 ld a1,80(sp) + 80018a2c: 40b505b3 sub a1,a0,a1 + 80018a30: e4ae sd a1,72(sp) + 80018a32: 12b56263 bltu a0,a1,80018b56 <.LBB16_35> + 80018a36: a009 j 80018a38 <.LBB16_29+0x40> + 80018a38: 65a6 ld a1,72(sp) + 80018a3a: 6566 ld a0,88(sp) + 80018a3c: 00008097 auipc ra,0x8 + 80018a40: c00080e7 jalr -1024(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 80018a44: edaa sd a0,216(sp) + 80018a46: a009 j 80018a48 <.LBB16_29+0x50> + // 由于在 syscall 的时候将用户页表切换成了内核页表, + // 因此在拷贝的时候需要将用户态的虚拟地址转换成物理地址, + // 由于在内核中数据区是直接映射,因此在访问物理地址的时候 + // 经过 MMU 不会报错 + // println!("[Debug] count: {}, len: {}", count, len); + if count > len { + 80018a48: 658e ld a1,192(sp) + 80018a4a: 750a ld a0,160(sp) + 80018a4c: 00b57d63 bgeu a0,a1,80018a66 <.LBB16_29+0x6e> + 80018a50: a009 j 80018a52 <.LBB16_29+0x5a> + // 如果页内剩余的容量大于生于要拷贝的容量,则将count替换成len + count = len; + 80018a52: 652a ld a0,136(sp) + 80018a54: 758a ld a1,160(sp) + 80018a56: e1ae sd a1,192(sp) + unsafe{ + copy( + src.offset(offset as isize), + 80018a58: 65ae ld a1,200(sp) + 80018a5a: 00008097 auipc ra,0x8 + 80018a5e: cb0080e7 jalr -848(ra) # 8002070a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE> + 80018a62: e0aa sd a0,64(sp) + 80018a64: a809 j 80018a76 <.LBB16_29+0x7e> + } + return Ok(()) + }else { + unsafe{ + copy( + src.offset(offset as isize), + 80018a66: 652a ld a0,136(sp) + 80018a68: 65ae ld a1,200(sp) + 80018a6a: 00008097 auipc ra,0x8 + 80018a6e: ca0080e7 jalr -864(ra) # 8002070a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE> + 80018a72: fc2a sd a0,56(sp) + 80018a74: a839 j 80018a92 <.LBB16_29+0x9a> + dst_ptr, + 80018a76: 6586 ld a1,64(sp) + 80018a78: 656e ld a0,216(sp) + count + 80018a7a: 660e ld a2,192(sp) + copy( + 80018a7c: 0000d097 auipc ra,0xd + 80018a80: 61c080e7 jalr 1564(ra) # 80026098 + 80018a84: a009 j 80018a86 <.LBB16_29+0x8e> + 80018a86: 4501 li a0,0 + return Ok(()) + 80018a88: f52a sd a0,168(sp) + pa = self.pgt_translate(va).unwrap(); + count = PGSIZE; + dst_ptr = pa.as_mut_ptr(); + } + } + } + 80018a8a: 75ca ld a1,176(sp) + 80018a8c: 70ee ld ra,248(sp) + 80018a8e: 6111 addi sp,sp,256 + 80018a90: 8082 ret + dst_ptr, + 80018a92: 75e2 ld a1,56(sp) + 80018a94: 656e ld a0,216(sp) + count + 80018a96: 660e ld a2,192(sp) + copy( + 80018a98: 0000d097 auipc ra,0xd + 80018a9c: 600080e7 jalr 1536(ra) # 80026098 + 80018aa0: a009 j 80018aa2 <.LBB16_29+0xaa> + len -= count; + 80018aa2: 658e ld a1,192(sp) + 80018aa4: 750a ld a0,160(sp) + 80018aa6: 40b505b3 sub a1,a0,a1 + 80018aaa: f82e sd a1,48(sp) + 80018aac: 0cb56463 bltu a0,a1,80018b74 <.LBB16_37> + 80018ab0: a009 j 80018ab2 <.LBB16_29+0xba> + 80018ab2: 7542 ld a0,48(sp) + 80018ab4: f12a sd a0,160(sp) + offset += count; + 80018ab6: 650e ld a0,192(sp) + 80018ab8: 65ae ld a1,200(sp) + 80018aba: 952e add a0,a0,a1 + 80018abc: f42a sd a0,40(sp) + 80018abe: 0cb56a63 bltu a0,a1,80018b92 <.LBB16_39> + 80018ac2: a009 j 80018ac4 <.LBB16_29+0xcc> + 80018ac4: 7522 ld a0,40(sp) + 80018ac6: e5aa sd a0,200(sp) + 80018ac8: 1928 addi a0,sp,184 + va.add_page(); + 80018aca: fffec097 auipc ra,0xfffec + 80018ace: 002080e7 jalr 2(ra) # 80004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE> + 80018ad2: a009 j 80018ad4 <.LBB16_29+0xdc> + pa = self.pgt_translate(va).unwrap(); + 80018ad4: 656a ld a0,152(sp) + 80018ad6: 75ea ld a1,184(sp) + 80018ad8: fffff097 auipc ra,0xfffff + 80018adc: 456080e7 jalr 1110(ra) # 80017f2e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E> + 80018ae0: ec2a sd a0,24(sp) + 80018ae2: f02e sd a1,32(sp) + 80018ae4: a009 j 80018ae6 <.LBB16_29+0xee> + 80018ae6: 7582 ld a1,32(sp) + 80018ae8: 6562 ld a0,24(sp) + +0000000080018aea <.LBB16_30>: + 80018aea: 00013617 auipc a2,0x13 + 80018aee: dee60613 addi a2,a2,-530 # 8002b8d8 <.L__unnamed_38> + 80018af2: ffff7097 auipc ra,0xffff7 + 80018af6: b5c080e7 jalr -1188(ra) # 8000f64e <_ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E> + 80018afa: e82a sd a0,16(sp) + 80018afc: a009 j 80018afe <.LBB16_30+0x14> + 80018afe: 6542 ld a0,16(sp) + 80018b00: e9aa sd a0,208(sp) + 80018b02: 6505 lui a0,0x1 + count = PGSIZE; + 80018b04: e1aa sd a0,192(sp) + 80018b06: 0988 addi a0,sp,208 + dst_ptr = pa.as_mut_ptr(); + 80018b08: fffec097 auipc ra,0xfffec + 80018b0c: e14080e7 jalr -492(ra) # 8000491c <_ZN6kernel6memory7address4Addr10as_mut_ptr17hfa59607f4391fdb5E> + 80018b10: e42a sd a0,8(sp) + 80018b12: a009 j 80018b14 <.LBB16_30+0x2a> + 80018b14: 6522 ld a0,8(sp) + 80018b16: edaa sd a0,216(sp) + loop { + 80018b18: bf05 j 80018a48 <.LBB16_29+0x50> + +0000000080018b1a <.LBB16_31>: + let mut count = PGSIZE - (dst - va.as_usize()); + 80018b1a: 00013517 auipc a0,0x13 + 80018b1e: b5650513 addi a0,a0,-1194 # 8002b670 + +0000000080018b22 <.LBB16_32>: + 80018b22: 00013617 auipc a2,0x13 + 80018b26: d2660613 addi a2,a2,-730 # 8002b848 <.L__unnamed_39> + 80018b2a: 02100593 li a1,33 + 80018b2e: 0000a097 auipc ra,0xa + 80018b32: 616080e7 jalr 1558(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018b38 <.LBB16_33>: + 80018b38: 00013517 auipc a0,0x13 + 80018b3c: b3850513 addi a0,a0,-1224 # 8002b670 + +0000000080018b40 <.LBB16_34>: + 80018b40: 00013617 auipc a2,0x13 + 80018b44: d2060613 addi a2,a2,-736 # 8002b860 <.L__unnamed_40> + 80018b48: 02100593 li a1,33 + 80018b4c: 0000a097 auipc ra,0xa + 80018b50: 5f8080e7 jalr 1528(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018b56 <.LBB16_35>: + pa.as_mut_ptr().offset((dst - va.as_usize()) as isize) + 80018b56: 00013517 auipc a0,0x13 + 80018b5a: b1a50513 addi a0,a0,-1254 # 8002b670 + +0000000080018b5e <.LBB16_36>: + 80018b5e: 00013617 auipc a2,0x13 + 80018b62: d3260613 addi a2,a2,-718 # 8002b890 <.L__unnamed_41> + 80018b66: 02100593 li a1,33 + 80018b6a: 0000a097 auipc ra,0xa + 80018b6e: 5da080e7 jalr 1498(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018b74 <.LBB16_37>: + len -= count; + 80018b74: 00013517 auipc a0,0x13 + 80018b78: afc50513 addi a0,a0,-1284 # 8002b670 + +0000000080018b7c <.LBB16_38>: + 80018b7c: 00013617 auipc a2,0x13 + 80018b80: d2c60613 addi a2,a2,-724 # 8002b8a8 <.L__unnamed_42> + 80018b84: 02100593 li a1,33 + 80018b88: 0000a097 auipc ra,0xa + 80018b8c: 5bc080e7 jalr 1468(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018b92 <.LBB16_39>: + offset += count; + 80018b92: 00013517 auipc a0,0x13 + 80018b96: 91e50513 addi a0,a0,-1762 # 8002b4b0 + +0000000080018b9a <.LBB16_40>: + 80018b9a: 00013617 auipc a2,0x13 + 80018b9e: d2660613 addi a2,a2,-730 # 8002b8c0 <.L__unnamed_43> + 80018ba2: 45f1 li a1,28 + 80018ba4: 0000a097 auipc ra,0xa + 80018ba8: 5a0080e7 jalr 1440(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E: + +0000000080018bae <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E>: + + + /// Copy from user to kernel. + /// Copy len bytes to dst from virtual address srcva in a given page table. + /// Return Result<(), Err> + pub fn copy_in( + 80018bae: 7151 addi sp,sp,-240 + 80018bb0: f586 sd ra,232(sp) + 80018bb2: e932 sd a2,144(sp) + 80018bb4: 862e mv a2,a1 + 80018bb6: 85aa mv a1,a0 + 80018bb8: 654a ld a0,144(sp) + 80018bba: ed2e sd a1,152(sp) + 80018bbc: f132 sd a2,160(sp) + 80018bbe: f536 sd a3,168(sp) + 80018bc0: e9ae sd a1,208(sp) + 80018bc2: edaa sd a0,216(sp) + &mut self, + mut dst: *mut u8, + src: usize, + mut len: usize + ) -> Result<(), &'static str> { + let mut va = VirtualAddress::new(src); + 80018bc4: ffff9097 auipc ra,0xffff9 + 80018bc8: 382080e7 jalr 898(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80018bcc: e1aa sd a0,192(sp) + 80018bce: a009 j 80018bd0 <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E+0x22> + 80018bd0: 0188 addi a0,sp,192 + va.pg_round_down(); + 80018bd2: fffec097 auipc ra,0xfffec + 80018bd6: e78080e7 jalr -392(ra) # 80004a4a <_ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE> + 80018bda: a009 j 80018bdc <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E+0x2e> + loop { + // Get physical address by virtual address + let pa = self.pgt_translate(va).unwrap(); + 80018bdc: 656a ld a0,152(sp) + 80018bde: 658e ld a1,192(sp) + 80018be0: fffff097 auipc ra,0xfffff + 80018be4: 34e080e7 jalr 846(ra) # 80017f2e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E> + 80018be8: e12a sd a0,128(sp) + 80018bea: e52e sd a1,136(sp) + 80018bec: a009 j 80018bee <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E+0x40> + 80018bee: 65aa ld a1,136(sp) + 80018bf0: 650a ld a0,128(sp) + +0000000080018bf2 <.LBB17_30>: + 80018bf2: 00013617 auipc a2,0x13 + 80018bf6: cfe60613 addi a2,a2,-770 # 8002b8f0 <.L__unnamed_44> + 80018bfa: ffff7097 auipc ra,0xffff7 + 80018bfe: a54080e7 jalr -1452(ra) # 8000f64e <_ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E> + 80018c02: e5aa sd a0,200(sp) + 80018c04: a009 j 80018c06 <.LBB17_30+0x14> + 80018c06: 0188 addi a0,sp,192 + // Get copy bytes of current page. + let count = PGSIZE - (src - va.as_usize()); + 80018c08: ffff9097 auipc ra,0xffff9 + 80018c0c: 31a080e7 jalr 794(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80018c10: fcaa sd a0,120(sp) + 80018c12: a009 j 80018c14 <.LBB17_30+0x22> + 80018c14: 654a ld a0,144(sp) + 80018c16: 75e6 ld a1,120(sp) + 80018c18: 40b505b3 sub a1,a0,a1 + 80018c1c: f8ae sd a1,112(sp) + 80018c1e: 10b56063 bltu a0,a1,80018d1e <.LBB17_31> + 80018c22: a009 j 80018c24 <.LBB17_30+0x32> + 80018c24: 75c6 ld a1,112(sp) + 80018c26: 6505 lui a0,0x1 + 80018c28: 40b505b3 sub a1,a0,a1 + 80018c2c: f4ae sd a1,104(sp) + 80018c2e: 10b56763 bltu a0,a1,80018d3c <.LBB17_33> + 80018c32: a009 j 80018c34 <.LBB17_30+0x42> + 80018c34: 75a6 ld a1,104(sp) + 80018c36: f1ae sd a1,224(sp) + if len < count { + 80018c38: 752a ld a0,168(sp) + 80018c3a: 00b57c63 bgeu a0,a1,80018c52 <.LBB17_30+0x60> + 80018c3e: a009 j 80018c40 <.LBB17_30+0x4e> + mem_copy( + dst as usize, + 80018c40: 750a ld a0,160(sp) + pa.as_usize() + ( src - va.as_usize() ), + 80018c42: ecaa sd a0,88(sp) + 80018c44: 01a8 addi a0,sp,200 + 80018c46: ffff9097 auipc ra,0xffff9 + 80018c4a: 2ee080e7 jalr 750(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 80018c4e: f0aa sd a0,96(sp) + 80018c50: a811 j 80018c64 <.LBB17_30+0x72> + len + ); + return Ok(()) + } + mem_copy( + dst as usize, + 80018c52: 750a ld a0,160(sp) + pa.as_usize() + ( src - va.as_usize() ), + 80018c54: e4aa sd a0,72(sp) + 80018c56: 01a8 addi a0,sp,200 + 80018c58: ffff9097 auipc ra,0xffff9 + 80018c5c: 2dc080e7 jalr 732(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 80018c60: e8aa sd a0,80(sp) + 80018c62: a0a9 j 80018cac <.LBB17_30+0xba> + 80018c64: 0188 addi a0,sp,192 + pa.as_usize() + ( src - va.as_usize() ), + 80018c66: ffff9097 auipc ra,0xffff9 + 80018c6a: 2bc080e7 jalr 700(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80018c6e: e0aa sd a0,64(sp) + 80018c70: a009 j 80018c72 <.LBB17_30+0x80> + 80018c72: 654a ld a0,144(sp) + 80018c74: 6586 ld a1,64(sp) + 80018c76: 40b505b3 sub a1,a0,a1 + 80018c7a: fc2e sd a1,56(sp) + 80018c7c: 0cb56f63 bltu a0,a1,80018d5a <.LBB17_35> + 80018c80: a009 j 80018c82 <.LBB17_30+0x90> + 80018c82: 7586 ld a1,96(sp) + 80018c84: 7562 ld a0,56(sp) + 80018c86: 952e add a0,a0,a1 + 80018c88: f82a sd a0,48(sp) + 80018c8a: 0eb56763 bltu a0,a1,80018d78 <.LBB17_37> + 80018c8e: a009 j 80018c90 <.LBB17_30+0x9e> + len + 80018c90: 75c2 ld a1,48(sp) + 80018c92: 6566 ld a0,88(sp) + 80018c94: 762a ld a2,168(sp) + mem_copy( + 80018c96: fffef097 auipc ra,0xfffef + 80018c9a: e50080e7 jalr -432(ra) # 80007ae6 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE> + 80018c9e: a009 j 80018ca0 <.LBB17_30+0xae> + 80018ca0: 4501 li a0,0 + return Ok(()) + 80018ca2: f92a sd a0,176(sp) + + len -= count; + dst = unsafe{ dst.offset(count as isize) }; + va.add_page(); + } + } + 80018ca4: 75ea ld a1,184(sp) + 80018ca6: 70ae ld ra,232(sp) + 80018ca8: 616d addi sp,sp,240 + 80018caa: 8082 ret + 80018cac: 0188 addi a0,sp,192 + pa.as_usize() + ( src - va.as_usize() ), + 80018cae: ffff9097 auipc ra,0xffff9 + 80018cb2: 274080e7 jalr 628(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80018cb6: f42a sd a0,40(sp) + 80018cb8: a009 j 80018cba <.LBB17_30+0xc8> + 80018cba: 654a ld a0,144(sp) + 80018cbc: 75a2 ld a1,40(sp) + 80018cbe: 40b505b3 sub a1,a0,a1 + 80018cc2: f02e sd a1,32(sp) + 80018cc4: 0cb56863 bltu a0,a1,80018d94 <.LBB17_39> + 80018cc8: a009 j 80018cca <.LBB17_30+0xd8> + 80018cca: 65c6 ld a1,80(sp) + 80018ccc: 7502 ld a0,32(sp) + 80018cce: 952e add a0,a0,a1 + 80018cd0: ec2a sd a0,24(sp) + 80018cd2: 0eb56063 bltu a0,a1,80018db2 <.LBB17_41> + 80018cd6: a009 j 80018cd8 <.LBB17_30+0xe6> + mem_copy( + 80018cd8: 7626 ld a2,104(sp) + 80018cda: 65e2 ld a1,24(sp) + 80018cdc: 6526 ld a0,72(sp) + 80018cde: fffef097 auipc ra,0xfffef + 80018ce2: e08080e7 jalr -504(ra) # 80007ae6 <_ZN6kernel4misc8mem_copy17h5e55f1040770ffdeE> + 80018ce6: a009 j 80018ce8 <.LBB17_30+0xf6> + len -= count; + 80018ce8: 75a6 ld a1,104(sp) + 80018cea: 752a ld a0,168(sp) + 80018cec: 40b505b3 sub a1,a0,a1 + 80018cf0: e82e sd a1,16(sp) + 80018cf2: 0cb56e63 bltu a0,a1,80018dce <.LBB17_43> + 80018cf6: a009 j 80018cf8 <.LBB17_30+0x106> + 80018cf8: 75a6 ld a1,104(sp) + 80018cfa: 6542 ld a0,16(sp) + 80018cfc: f52a sd a0,168(sp) + dst = unsafe{ dst.offset(count as isize) }; + 80018cfe: 750a ld a0,160(sp) + 80018d00: 00008097 auipc ra,0x8 + 80018d04: 93c080e7 jalr -1732(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 80018d08: e42a sd a0,8(sp) + 80018d0a: a009 j 80018d0c <.LBB17_30+0x11a> + 80018d0c: 6522 ld a0,8(sp) + 80018d0e: f12a sd a0,160(sp) + 80018d10: 0188 addi a0,sp,192 + va.add_page(); + 80018d12: fffec097 auipc ra,0xfffec + 80018d16: dba080e7 jalr -582(ra) # 80004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE> + 80018d1a: a009 j 80018d1c <.LBB17_30+0x12a> + loop { + 80018d1c: b5c1 j 80018bdc <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E+0x2e> + +0000000080018d1e <.LBB17_31>: + let count = PGSIZE - (src - va.as_usize()); + 80018d1e: 00013517 auipc a0,0x13 + 80018d22: 95250513 addi a0,a0,-1710 # 8002b670 + +0000000080018d26 <.LBB17_32>: + 80018d26: 00013617 auipc a2,0x13 + 80018d2a: be260613 addi a2,a2,-1054 # 8002b908 <.L__unnamed_45> + 80018d2e: 02100593 li a1,33 + 80018d32: 0000a097 auipc ra,0xa + 80018d36: 412080e7 jalr 1042(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018d3c <.LBB17_33>: + 80018d3c: 00013517 auipc a0,0x13 + 80018d40: 93450513 addi a0,a0,-1740 # 8002b670 + +0000000080018d44 <.LBB17_34>: + 80018d44: 00013617 auipc a2,0x13 + 80018d48: bdc60613 addi a2,a2,-1060 # 8002b920 <.L__unnamed_46> + 80018d4c: 02100593 li a1,33 + 80018d50: 0000a097 auipc ra,0xa + 80018d54: 3f4080e7 jalr 1012(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018d5a <.LBB17_35>: + pa.as_usize() + ( src - va.as_usize() ), + 80018d5a: 00013517 auipc a0,0x13 + 80018d5e: 91650513 addi a0,a0,-1770 # 8002b670 + +0000000080018d62 <.LBB17_36>: + 80018d62: 00013617 auipc a2,0x13 + 80018d66: bd660613 addi a2,a2,-1066 # 8002b938 <.L__unnamed_47> + 80018d6a: 02100593 li a1,33 + 80018d6e: 0000a097 auipc ra,0xa + 80018d72: 3d6080e7 jalr 982(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018d78 <.LBB17_37>: + 80018d78: 00012517 auipc a0,0x12 + 80018d7c: 73850513 addi a0,a0,1848 # 8002b4b0 + +0000000080018d80 <.LBB17_38>: + 80018d80: 00013617 auipc a2,0x13 + 80018d84: bd060613 addi a2,a2,-1072 # 8002b950 <.L__unnamed_48> + 80018d88: 45f1 li a1,28 + 80018d8a: 0000a097 auipc ra,0xa + 80018d8e: 3ba080e7 jalr 954(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018d94 <.LBB17_39>: + pa.as_usize() + ( src - va.as_usize() ), + 80018d94: 00013517 auipc a0,0x13 + 80018d98: 8dc50513 addi a0,a0,-1828 # 8002b670 + +0000000080018d9c <.LBB17_40>: + 80018d9c: 00013617 auipc a2,0x13 + 80018da0: bcc60613 addi a2,a2,-1076 # 8002b968 <.L__unnamed_49> + 80018da4: 02100593 li a1,33 + 80018da8: 0000a097 auipc ra,0xa + 80018dac: 39c080e7 jalr 924(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018db2 <.LBB17_41>: + 80018db2: 00012517 auipc a0,0x12 + 80018db6: 6fe50513 addi a0,a0,1790 # 8002b4b0 + +0000000080018dba <.LBB17_42>: + 80018dba: 00013617 auipc a2,0x13 + 80018dbe: bc660613 addi a2,a2,-1082 # 8002b980 <.L__unnamed_50> + 80018dc2: 45f1 li a1,28 + 80018dc4: 0000a097 auipc ra,0xa + 80018dc8: 380080e7 jalr 896(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080018dce <.LBB17_43>: + len -= count; + 80018dce: 00013517 auipc a0,0x13 + 80018dd2: 8a250513 addi a0,a0,-1886 # 8002b670 + +0000000080018dd6 <.LBB17_44>: + 80018dd6: 00013617 auipc a2,0x13 + 80018dda: bc260613 addi a2,a2,-1086 # 8002b998 <.L__unnamed_51> + 80018dde: 02100593 li a1,33 + 80018de2: 0000a097 auipc ra,0xa + 80018de6: 362080e7 jalr 866(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable11copy_in_str17hce5a6c8720f87e9cE: + +0000000080018dec <_ZN6kernel6memory7mapping10page_table9PageTable11copy_in_str17hce5a6c8720f87e9cE>: + + /// Copy a null-trrminated string from user to kernel. + /// Copy bytes to dst from virtual address src in a given table. + /// until a '\0', or max. + /// Return Result. + pub fn copy_in_str( + 80018dec: 7141 addi sp,sp,-496 + 80018dee: f786 sd ra,488(sp) + 80018df0: e5b2 sd a2,200(sp) + 80018df2: e1ae sd a1,192(sp) + 80018df4: 862a mv a2,a0 + 80018df6: 652e ld a0,200(sp) + 80018df8: e9b2 sd a2,208(sp) + 80018dfa: edb6 sd a3,216(sp) + 80018dfc: f2b2 sd a2,352(sp) + 80018dfe: f6ae sd a1,360(sp) + 80018e00: faaa sd a0,368(sp) + dst: *mut u8, + src: usize, + mut max: usize + ) -> Result<(),&'static str> { + // 将 src 作为虚拟地址 + let mut va = VirtualAddress::new(src as usize); + 80018e02: ffff9097 auipc ra,0xffff9 + 80018e06: 144080e7 jalr 324(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80018e0a: f9aa sd a0,240(sp) + 80018e0c: a009 j 80018e0e <_ZN6kernel6memory7mapping10page_table9PageTable11copy_in_str17hce5a6c8720f87e9cE+0x22> + 80018e0e: 1988 addi a0,sp,240 + // 将虚拟地址进行页对齐 + va.pg_round_down(); + 80018e10: fffec097 auipc ra,0xfffec + 80018e14: c3a080e7 jalr -966(ra) # 80004a4a <_ZN6kernel6memory7address4Addr13pg_round_down17h7ab358be9f94b06bE> + 80018e18: a009 j 80018e1a <_ZN6kernel6memory7mapping10page_table9PageTable11copy_in_str17hce5a6c8720f87e9cE+0x2e> + loop { + // 将用户态的虚拟地址转成物理地址 + let pa = self.pgt_translate(va).unwrap(); + 80018e1a: 654e ld a0,208(sp) + 80018e1c: 75ce ld a1,240(sp) + 80018e1e: fffff097 auipc ra,0xfffff + 80018e22: 110080e7 jalr 272(ra) # 80017f2e <_ZN6kernel6memory7mapping10page_table9PageTable13pgt_translate17h8fe9f71b8d139103E> + 80018e26: f92a sd a0,176(sp) + 80018e28: fd2e sd a1,184(sp) + 80018e2a: a009 j 80018e2c <_ZN6kernel6memory7mapping10page_table9PageTable11copy_in_str17hce5a6c8720f87e9cE+0x40> + 80018e2c: 75ea ld a1,184(sp) + 80018e2e: 754a ld a0,176(sp) + +0000000080018e30 <.LBB18_48>: + 80018e30: 00013617 auipc a2,0x13 + 80018e34: b8060613 addi a2,a2,-1152 # 8002b9b0 <.L__unnamed_52> + 80018e38: ffff7097 auipc ra,0xffff7 + 80018e3c: 816080e7 jalr -2026(ra) # 8000f64e <_ZN4core6option15Option$LT$T$GT$6unwrap17h70b9b96f373d4183E> + 80018e40: fdaa sd a0,248(sp) + 80018e42: a009 j 80018e44 <.LBB18_48+0x14> + 80018e44: 1988 addi a0,sp,240 + // 计算该页所要读取的字节数 + let count = PGSIZE - (src - va.as_usize()); + 80018e46: ffff9097 auipc ra,0xffff9 + 80018e4a: 0dc080e7 jalr 220(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80018e4e: f52a sd a0,168(sp) + 80018e50: a009 j 80018e52 <.LBB18_48+0x22> + 80018e52: 652e ld a0,200(sp) + 80018e54: 75aa ld a1,168(sp) + 80018e56: 40b505b3 sub a1,a0,a1 + 80018e5a: f12e sd a1,160(sp) + 80018e5c: 1eb56263 bltu a0,a1,80019040 <.LBB18_49> + 80018e60: a009 j 80018e62 <.LBB18_48+0x32> + 80018e62: 758a ld a1,160(sp) + 80018e64: 6505 lui a0,0x1 + 80018e66: 40b505b3 sub a1,a0,a1 + 80018e6a: ed2e sd a1,152(sp) + 80018e6c: 1eb56963 bltu a0,a1,8001905e <.LBB18_51> + 80018e70: a009 j 80018e72 <.LBB18_48+0x42> + 80018e72: 656a ld a0,152(sp) + 80018e74: feaa sd a0,376(sp) + 80018e76: 19a8 addi a0,sp,248 + let s = (pa.as_usize() + (src - va.as_usize())) as *const u8; + 80018e78: ffff9097 auipc ra,0xffff9 + 80018e7c: 0bc080e7 jalr 188(ra) # 80011f34 <_ZN90_$LT$kernel..memory..address..PhysicalAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17hea2eecdb80a1a2b2E> + 80018e80: e92a sd a0,144(sp) + 80018e82: a009 j 80018e84 <.LBB18_48+0x54> + 80018e84: 1988 addi a0,sp,240 + 80018e86: ffff9097 auipc ra,0xffff9 + 80018e8a: 09c080e7 jalr 156(ra) # 80011f22 <_ZN89_$LT$kernel..memory..address..VirtualAddress$u20$as$u20$kernel..memory..address..Addr$GT$8as_usize17h7916c21610008a66E> + 80018e8e: e52a sd a0,136(sp) + 80018e90: a009 j 80018e92 <.LBB18_48+0x62> + 80018e92: 652e ld a0,200(sp) + 80018e94: 65aa ld a1,136(sp) + 80018e96: 40b505b3 sub a1,a0,a1 + 80018e9a: e12e sd a1,128(sp) + 80018e9c: 1eb56063 bltu a0,a1,8001907c <.LBB18_53> + 80018ea0: a009 j 80018ea2 <.LBB18_48+0x72> + 80018ea2: 65ca ld a1,144(sp) + 80018ea4: 650a ld a0,128(sp) + 80018ea6: 952e add a0,a0,a1 + 80018ea8: fcaa sd a0,120(sp) + 80018eaa: 1eb56863 bltu a0,a1,8001909a <.LBB18_55> + 80018eae: a009 j 80018eb0 <.LBB18_48+0x80> + 80018eb0: 65ea ld a1,152(sp) + 80018eb2: 7566 ld a0,120(sp) + 80018eb4: 862a mv a2,a0 + 80018eb6: f8b2 sd a2,112(sp) + 80018eb8: e32a sd a0,384(sp) + if max < count { + 80018eba: 656e ld a0,216(sp) + 80018ebc: 00b57e63 bgeu a0,a1,80018ed8 <.LBB18_48+0xa8> + 80018ec0: a009 j 80018ec2 <.LBB18_48+0x92> + // 所能读取的最大的字符数小于该页剩余字节 + for i in 0..max { + 80018ec2: 65ee ld a1,216(sp) + 80018ec4: 4501 li a0,0 + 80018ec6: e22a sd a0,256(sp) + 80018ec8: e62e sd a1,264(sp) + 80018eca: 00008097 auipc ra,0x8 + 80018ece: 946080e7 jalr -1722(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80018ed2: f0aa sd a0,96(sp) + 80018ed4: f4ae sd a1,104(sp) + 80018ed6: a821 j 80018eee <.LBB18_48+0xbe> + 80018ed8: 65ea ld a1,152(sp) + 80018eda: 4501 li a0,0 + } + } + return Ok(()) + } + + for i in 0..count { + 80018edc: fa2a sd a0,304(sp) + 80018ede: fe2e sd a1,312(sp) + 80018ee0: 00008097 auipc ra,0x8 + 80018ee4: 930080e7 jalr -1744(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80018ee8: e8aa sd a0,80(sp) + 80018eea: ecae sd a1,88(sp) + 80018eec: a861 j 80018f84 <.LBB18_48+0x154> + for i in 0..max { + 80018eee: 7526 ld a0,104(sp) + 80018ef0: 7586 ld a1,96(sp) + 80018ef2: ea2e sd a1,272(sp) + 80018ef4: ee2a sd a0,280(sp) + 80018ef6: a009 j 80018ef8 <.LBB18_48+0xc8> + 80018ef8: 0a08 addi a0,sp,272 + 80018efa: 00008097 auipc ra,0x8 + 80018efe: 8a8080e7 jalr -1880(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80018f02: f22a sd a0,288(sp) + 80018f04: f62e sd a1,296(sp) + 80018f06: a009 j 80018f08 <.LBB18_48+0xd8> + 80018f08: 7512 ld a0,288(sp) + 80018f0a: 4581 li a1,0 + 80018f0c: 00b50463 beq a0,a1,80018f14 <.LBB18_48+0xe4> + 80018f10: a009 j 80018f12 <.LBB18_48+0xe2> + 80018f12: a029 j 80018f1c <.LBB18_48+0xec> + 80018f14: 4501 li a0,0 + return Ok(()) + 80018f16: f1aa sd a0,224(sp) + 80018f18: aa39 j 80019036 <.LBB18_48+0x206> + for i in 0..max { + 80018f1a: 0000 unimp + 80018f1c: 7546 ld a0,112(sp) + 80018f1e: 75b2 ld a1,296(sp) + 80018f20: e0ae sd a1,64(sp) + 80018f22: e72e sd a1,392(sp) + 80018f24: eb2e sd a1,400(sp) + 80018f26: ef2e sd a1,408(sp) + let src_ptr = s.offset(i as isize); + 80018f28: 00007097 auipc ra,0x7 + 80018f2c: 7e2080e7 jalr 2018(ra) # 8002070a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE> + 80018f30: 85aa mv a1,a0 + 80018f32: e4ae sd a1,72(sp) + 80018f34: f32a sd a0,416(sp) + 80018f36: a009 j 80018f38 <.LBB18_48+0x108> + let val = read(src_ptr); + 80018f38: 6526 ld a0,72(sp) + 80018f3a: 00000097 auipc ra,0x0 + 80018f3e: 4b8080e7 jalr 1208(ra) # 800193f2 <_ZN4core3ptr4read17h018161c0cd37b3fbE> + 80018f42: 85aa mv a1,a0 + 80018f44: fc2e sd a1,56(sp) + 80018f46: 1aa107a3 sb a0,431(sp) + 80018f4a: a009 j 80018f4c <.LBB18_48+0x11c> + if val == 0 { return Ok(()) } + 80018f4c: 7562 ld a0,56(sp) + 80018f4e: 0ff57513 andi a0,a0,255 + 80018f52: 4581 li a1,0 + 80018f54: 00b51663 bne a0,a1,80018f60 <.LBB18_48+0x130> + 80018f58: a009 j 80018f5a <.LBB18_48+0x12a> + 80018f5a: 4501 li a0,0 + 80018f5c: f1aa sd a0,224(sp) + 80018f5e: a8e1 j 80019036 <.LBB18_48+0x206> + let dst_ptr = dst.offset(i as isize); + 80018f60: 6586 ld a1,64(sp) + 80018f62: 650e ld a0,192(sp) + 80018f64: 00007097 auipc ra,0x7 + 80018f68: 6d8080e7 jalr 1752(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 80018f6c: 85aa mv a1,a0 + 80018f6e: f82e sd a1,48(sp) + 80018f70: fb2a sd a0,432(sp) + 80018f72: a009 j 80018f74 <.LBB18_48+0x144> + write(dst_ptr, val); + 80018f74: 75e2 ld a1,56(sp) + 80018f76: 7542 ld a0,48(sp) + 80018f78: 00000097 auipc ra,0x0 + 80018f7c: 704080e7 jalr 1796(ra) # 8001967c <_ZN4core3ptr5write17h0fb1ba83ac2984c7E> + 80018f80: a009 j 80018f82 <.LBB18_48+0x152> + for i in 0..max { + 80018f82: bf9d j 80018ef8 <.LBB18_48+0xc8> + for i in 0..count { + 80018f84: 6566 ld a0,88(sp) + 80018f86: 65c6 ld a1,80(sp) + 80018f88: e2ae sd a1,320(sp) + 80018f8a: e6aa sd a0,328(sp) + 80018f8c: a009 j 80018f8e <.LBB18_48+0x15e> + 80018f8e: 0288 addi a0,sp,320 + 80018f90: 00008097 auipc ra,0x8 + 80018f94: 812080e7 jalr -2030(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80018f98: eaaa sd a0,336(sp) + 80018f9a: eeae sd a1,344(sp) + 80018f9c: a009 j 80018f9e <.LBB18_48+0x16e> + 80018f9e: 6556 ld a0,336(sp) + 80018fa0: 4581 li a1,0 + 80018fa2: 00b50463 beq a0,a1,80018faa <.LBB18_48+0x17a> + 80018fa6: a009 j 80018fa8 <.LBB18_48+0x178> + 80018fa8: a811 j 80018fbc <.LBB18_48+0x18c> + if src_val == 0 { return Ok(()) } + let dst_ptr = dst.offset(i as isize); + write(dst_ptr, src_val); + } + } + max -= count; + 80018faa: 65ea ld a1,152(sp) + 80018fac: 656e ld a0,216(sp) + 80018fae: 40b505b3 sub a1,a0,a1 + 80018fb2: f42e sd a1,40(sp) + 80018fb4: 10b56163 bltu a0,a1,800190b6 <.LBB18_57> + 80018fb8: a0b5 j 80019024 <.LBB18_48+0x1f4> + for i in 0..count { + 80018fba: 0000 unimp + 80018fbc: 7546 ld a0,112(sp) + 80018fbe: 65f6 ld a1,344(sp) + 80018fc0: ec2e sd a1,24(sp) + 80018fc2: ff2e sd a1,440(sp) + 80018fc4: e3ae sd a1,448(sp) + 80018fc6: e7ae sd a1,456(sp) + let src_ptr = s.offset(i as isize); + 80018fc8: 00007097 auipc ra,0x7 + 80018fcc: 742080e7 jalr 1858(ra) # 8002070a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE> + 80018fd0: 85aa mv a1,a0 + 80018fd2: f02e sd a1,32(sp) + 80018fd4: ebaa sd a0,464(sp) + 80018fd6: a009 j 80018fd8 <.LBB18_48+0x1a8> + let src_val = read(src_ptr); + 80018fd8: 7502 ld a0,32(sp) + 80018fda: 00000097 auipc ra,0x0 + 80018fde: 418080e7 jalr 1048(ra) # 800193f2 <_ZN4core3ptr4read17h018161c0cd37b3fbE> + 80018fe2: 85aa mv a1,a0 + 80018fe4: e82e sd a1,16(sp) + 80018fe6: 1ca10fa3 sb a0,479(sp) + 80018fea: a009 j 80018fec <.LBB18_48+0x1bc> + if src_val == 0 { return Ok(()) } + 80018fec: 6542 ld a0,16(sp) + 80018fee: 0ff57513 andi a0,a0,255 + 80018ff2: 4581 li a1,0 + 80018ff4: 00b51663 bne a0,a1,80019000 <.LBB18_48+0x1d0> + 80018ff8: a009 j 80018ffa <.LBB18_48+0x1ca> + 80018ffa: 4501 li a0,0 + 80018ffc: f1aa sd a0,224(sp) + 80018ffe: a825 j 80019036 <.LBB18_48+0x206> + let dst_ptr = dst.offset(i as isize); + 80019000: 65e2 ld a1,24(sp) + 80019002: 650e ld a0,192(sp) + 80019004: 00007097 auipc ra,0x7 + 80019008: 638080e7 jalr 1592(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 8001900c: 85aa mv a1,a0 + 8001900e: e42e sd a1,8(sp) + 80019010: f3aa sd a0,480(sp) + 80019012: a009 j 80019014 <.LBB18_48+0x1e4> + write(dst_ptr, src_val); + 80019014: 65c2 ld a1,16(sp) + 80019016: 6522 ld a0,8(sp) + 80019018: 00000097 auipc ra,0x0 + 8001901c: 664080e7 jalr 1636(ra) # 8001967c <_ZN4core3ptr5write17h0fb1ba83ac2984c7E> + 80019020: a009 j 80019022 <.LBB18_48+0x1f2> + for i in 0..count { + 80019022: b7b5 j 80018f8e <.LBB18_48+0x15e> + max -= count; + 80019024: 7522 ld a0,40(sp) + 80019026: edaa sd a0,216(sp) + 80019028: 1988 addi a0,sp,240 + va.add_page(); + 8001902a: fffec097 auipc ra,0xfffec + 8001902e: aa2080e7 jalr -1374(ra) # 80004acc <_ZN6kernel6memory7address4Addr8add_page17hda9f7615eed2e36aE> + 80019032: a009 j 80019034 <.LBB18_48+0x204> + loop { + 80019034: b3dd j 80018e1a <_ZN6kernel6memory7mapping10page_table9PageTable11copy_in_str17hce5a6c8720f87e9cE+0x2e> + } + } + 80019036: 750e ld a0,224(sp) + 80019038: 75ae ld a1,232(sp) + 8001903a: 70be ld ra,488(sp) + 8001903c: 617d addi sp,sp,496 + 8001903e: 8082 ret + +0000000080019040 <.LBB18_49>: + let count = PGSIZE - (src - va.as_usize()); + 80019040: 00012517 auipc a0,0x12 + 80019044: 63050513 addi a0,a0,1584 # 8002b670 + +0000000080019048 <.LBB18_50>: + 80019048: 00013617 auipc a2,0x13 + 8001904c: 98060613 addi a2,a2,-1664 # 8002b9c8 <.L__unnamed_53> + 80019050: 02100593 li a1,33 + 80019054: 0000a097 auipc ra,0xa + 80019058: 0f0080e7 jalr 240(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001905e <.LBB18_51>: + 8001905e: 00012517 auipc a0,0x12 + 80019062: 61250513 addi a0,a0,1554 # 8002b670 + +0000000080019066 <.LBB18_52>: + 80019066: 00013617 auipc a2,0x13 + 8001906a: 97a60613 addi a2,a2,-1670 # 8002b9e0 <.L__unnamed_54> + 8001906e: 02100593 li a1,33 + 80019072: 0000a097 auipc ra,0xa + 80019076: 0d2080e7 jalr 210(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001907c <.LBB18_53>: + let s = (pa.as_usize() + (src - va.as_usize())) as *const u8; + 8001907c: 00012517 auipc a0,0x12 + 80019080: 5f450513 addi a0,a0,1524 # 8002b670 + +0000000080019084 <.LBB18_54>: + 80019084: 00013617 auipc a2,0x13 + 80019088: 97460613 addi a2,a2,-1676 # 8002b9f8 <.L__unnamed_55> + 8001908c: 02100593 li a1,33 + 80019090: 0000a097 auipc ra,0xa + 80019094: 0b4080e7 jalr 180(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001909a <.LBB18_55>: + 8001909a: 00012517 auipc a0,0x12 + 8001909e: 41650513 addi a0,a0,1046 # 8002b4b0 + +00000000800190a2 <.LBB18_56>: + 800190a2: 00013617 auipc a2,0x13 + 800190a6: 96e60613 addi a2,a2,-1682 # 8002ba10 <.L__unnamed_56> + 800190aa: 45f1 li a1,28 + 800190ac: 0000a097 auipc ra,0xa + 800190b0: 098080e7 jalr 152(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800190b6 <.LBB18_57>: + max -= count; + 800190b6: 00012517 auipc a0,0x12 + 800190ba: 5ba50513 addi a0,a0,1466 # 8002b670 + +00000000800190be <.LBB18_58>: + 800190be: 00013617 auipc a2,0x13 + 800190c2: 96a60613 addi a2,a2,-1686 # 8002ba28 <.L__unnamed_57> + 800190c6: 02100593 li a1,33 + 800190ca: 0000a097 auipc ra,0xa + 800190ce: 07a080e7 jalr 122(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E: + +00000000800190d4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E>: + + + /// Free a process's page table, and free the + /// physical memory it refers to. + pub fn proc_free_pagetable(&mut self, size: usize) { + 800190d4: 7139 addi sp,sp,-64 + 800190d6: fc06 sd ra,56(sp) + 800190d8: e82e sd a1,16(sp) + 800190da: ec2a sd a0,24(sp) + 800190dc: f42a sd a0,40(sp) + 800190de: f82e sd a1,48(sp) + 800190e0: 04000537 lui a0,0x4000 + 800190e4: 357d addiw a0,a0,-1 + 800190e6: 0532 slli a0,a0,0xc + self.uvm_unmap( + VirtualAddress::new(TRAMPOLINE ), + 800190e8: ffff9097 auipc ra,0xffff9 + 800190ec: e5e080e7 jalr -418(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 800190f0: f02a sd a0,32(sp) + 800190f2: a009 j 800190f4 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E+0x20> + self.uvm_unmap( + 800190f4: 7582 ld a1,32(sp) + 800190f6: 6562 ld a0,24(sp) + 800190f8: 4605 li a2,1 + 800190fa: 4681 li a3,0 + 800190fc: fffff097 auipc ra,0xfffff + 80019100: 4e0080e7 jalr 1248(ra) # 800185dc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E> + 80019104: a009 j 80019106 <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E+0x32> + 80019106: 02000537 lui a0,0x2000 + 8001910a: 357d addiw a0,a0,-1 + 8001910c: 0536 slli a0,a0,0xd + 1, + false + ); + + self.uvm_unmap( + VirtualAddress::new(TRAPFRAME), + 8001910e: ffff9097 auipc ra,0xffff9 + 80019112: e38080e7 jalr -456(ra) # 80011f46 <_ZN6kernel6memory7address14VirtualAddress3new17h716be423461f1938E> + 80019116: e42a sd a0,8(sp) + 80019118: a009 j 8001911a <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E+0x46> + self.uvm_unmap( + 8001911a: 65a2 ld a1,8(sp) + 8001911c: 6562 ld a0,24(sp) + 8001911e: 4605 li a2,1 + 80019120: 4681 li a3,0 + 80019122: fffff097 auipc ra,0xfffff + 80019126: 4ba080e7 jalr 1210(ra) # 800185dc <_ZN6kernel6memory7mapping10page_table9PageTable9uvm_unmap17hab395d2793038c03E> + 8001912a: a009 j 8001912c <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E+0x58> + 1, + false + ); + + self.uvm_free(size); + 8001912c: 65c2 ld a1,16(sp) + 8001912e: 6562 ld a0,24(sp) + 80019130: fffff097 auipc ra,0xfffff + 80019134: 36a080e7 jalr 874(ra) # 8001849a <_ZN6kernel6memory7mapping10page_table9PageTable8uvm_free17h541177c5e75f280dE> + 80019138: a009 j 8001913a <_ZN6kernel6memory7mapping10page_table9PageTable19proc_free_pagetable17h67102aea540089c1E+0x66> + // self.free(); + } + 8001913a: 70e2 ld ra,56(sp) + 8001913c: 6121 addi sp,sp,64 + 8001913e: 8082 ret + +Disassembly of section .text._ZN4core3str21_$LT$impl$u20$str$GT$5bytes17h8801f19f835ac923E: + +0000000080019140 <_ZN4core3str21_$LT$impl$u20$str$GT$5bytes17h8801f19f835ac923E>: + /// + /// assert_eq!(None, bytes.next()); + /// ``` + #[stable(feature = "rust1", since = "1.0.0")] + #[inline] + pub fn bytes(&self) -> Bytes<'_> { + 80019140: 7119 addi sp,sp,-128 + 80019142: fc86 sd ra,120(sp) + 80019144: e4aa sd a0,72(sp) + 80019146: e8ae sd a1,80(sp) + 80019148: ecaa sd a0,88(sp) + 8001914a: f0ae sd a1,96(sp) + unsafe { mem::transmute(self) } + 8001914c: f4aa sd a0,104(sp) + 8001914e: f8ae sd a1,112(sp) + Bytes(self.as_bytes().iter().copied()) + 80019150: f42a sd a0,40(sp) + 80019152: f82e sd a1,48(sp) + 80019154: a009 j 80019156 <_ZN4core3str21_$LT$impl$u20$str$GT$5bytes17h8801f19f835ac923E+0x16> + 80019156: 75c2 ld a1,48(sp) + 80019158: 7522 ld a0,40(sp) + 8001915a: 00007097 auipc ra,0x7 + 8001915e: 370080e7 jalr 880(ra) # 800204ca <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17h8f308ca2182773f1E> + 80019162: ec2a sd a0,24(sp) + 80019164: f02e sd a1,32(sp) + 80019166: a009 j 80019168 <_ZN4core3str21_$LT$impl$u20$str$GT$5bytes17h8801f19f835ac923E+0x28> + 80019168: 7582 ld a1,32(sp) + 8001916a: 6562 ld a0,24(sp) + 8001916c: ffff2097 auipc ra,0xffff2 + 80019170: 270080e7 jalr 624(ra) # 8000b3dc <_ZN4core4iter6traits8iterator8Iterator6copied17hc4f54d9039c4545bE> + 80019174: e42a sd a0,8(sp) + 80019176: e82e sd a1,16(sp) + 80019178: a009 j 8001917a <_ZN4core3str21_$LT$impl$u20$str$GT$5bytes17h8801f19f835ac923E+0x3a> + 8001917a: 65c2 ld a1,16(sp) + 8001917c: 6522 ld a0,8(sp) + 8001917e: fc2a sd a0,56(sp) + 80019180: e0ae sd a1,64(sp) + } + 80019182: 70e6 ld ra,120(sp) + 80019184: 6109 addi sp,sp,128 + 80019186: 8082 ret + +Disassembly of section .text._ZN4core3str21_$LT$impl$u20$str$GT$5chars17h18a0dd289a8edb0cE: + +0000000080019188 <_ZN4core3str21_$LT$impl$u20$str$GT$5chars17h18a0dd289a8edb0cE>: + pub fn chars(&self) -> Chars<'_> { + 80019188: 7159 addi sp,sp,-112 + 8001918a: f486 sd ra,104(sp) + 8001918c: fc2a sd a0,56(sp) + 8001918e: e0ae sd a1,64(sp) + 80019190: e4aa sd a0,72(sp) + 80019192: e8ae sd a1,80(sp) + unsafe { mem::transmute(self) } + 80019194: ecaa sd a0,88(sp) + 80019196: f0ae sd a1,96(sp) + Chars { iter: self.as_bytes().iter() } + 80019198: ec2a sd a0,24(sp) + 8001919a: f02e sd a1,32(sp) + 8001919c: a009 j 8001919e <_ZN4core3str21_$LT$impl$u20$str$GT$5chars17h18a0dd289a8edb0cE+0x16> + 8001919e: 7582 ld a1,32(sp) + 800191a0: 6562 ld a0,24(sp) + 800191a2: 00007097 auipc ra,0x7 + 800191a6: 328080e7 jalr 808(ra) # 800204ca <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17h8f308ca2182773f1E> + 800191aa: e42a sd a0,8(sp) + 800191ac: e82e sd a1,16(sp) + 800191ae: a009 j 800191b0 <_ZN4core3str21_$LT$impl$u20$str$GT$5chars17h18a0dd289a8edb0cE+0x28> + 800191b0: 65c2 ld a1,16(sp) + 800191b2: 6522 ld a0,8(sp) + 800191b4: f42a sd a0,40(sp) + 800191b6: f82e sd a1,48(sp) + } + 800191b8: 70a6 ld ra,104(sp) + 800191ba: 6165 addi sp,sp,112 + 800191bc: 8082 ret + +Disassembly of section .text._ZN4core3str21_$LT$impl$u20$str$GT$6as_ptr17h399b117e49285f4dE: + +00000000800191be <_ZN4core3str21_$LT$impl$u20$str$GT$6as_ptr17h399b117e49285f4dE>: + pub const fn as_ptr(&self) -> *const u8 { + 800191be: 1141 addi sp,sp,-16 + 800191c0: e02a sd a0,0(sp) + 800191c2: e42e sd a1,8(sp) + } + 800191c4: 0141 addi sp,sp,16 + 800191c6: 8082 ret + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hede063de0d7bedabE: + +00000000800191c8 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hede063de0d7bedabE>: + 800191c8: 1101 addi sp,sp,-32 + 800191ca: ec06 sd ra,24(sp) + 800191cc: e42a sd a0,8(sp) + 800191ce: e82e sd a1,16(sp) + 800191d0: 6108 ld a0,0(a0) + 800191d2: fffef097 auipc ra,0xfffef + 800191d6: 2c4080e7 jalr 708(ra) # 80008496 <_ZN66_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..fmt..Debug$GT$3fmt17hb18bbbb2274bc1adE> + 800191da: e02a sd a0,0(sp) + 800191dc: a009 j 800191de <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hede063de0d7bedabE+0x16> + 800191de: 6502 ld a0,0(sp) + 800191e0: 60e2 ld ra,24(sp) + 800191e2: 6105 addi sp,sp,32 + 800191e4: 8082 ret + +Disassembly of section .text._ZN4core3cmp9PartialEq2ne17ha4fd141ed85850e3E: + +00000000800191e6 <_ZN4core3cmp9PartialEq2ne17ha4fd141ed85850e3E>: + + /// This method tests for `!=`. + #[inline] + #[must_use] + #[stable(feature = "rust1", since = "1.0.0")] + fn ne(&self, other: &Rhs) -> bool { + 800191e6: 1101 addi sp,sp,-32 + 800191e8: ec06 sd ra,24(sp) + 800191ea: e42a sd a0,8(sp) + 800191ec: e82e sd a1,16(sp) + !self.eq(other) + 800191ee: fffef097 auipc ra,0xfffef + 800191f2: 3aa080e7 jalr 938(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 800191f6: e02a sd a0,0(sp) + 800191f8: a009 j 800191fa <_ZN4core3cmp9PartialEq2ne17ha4fd141ed85850e3E+0x14> + 800191fa: 6502 ld a0,0(sp) + 800191fc: 00154513 xori a0,a0,1 + } + 80019200: 60e2 ld ra,24(sp) + 80019202: 6105 addi sp,sp,32 + 80019204: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf7573a6302c08e61E: + +0000000080019206 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf7573a6302c08e61E>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 80019206: 1101 addi sp,sp,-32 + 80019208: e42a sd a0,8(sp) + 8001920a: e82e sd a1,16(sp) + unsafe { intrinsics::offset(self, count) as *mut T } + 8001920c: 059a slli a1,a1,0x6 + 8001920e: 952e add a0,a0,a1 + 80019210: e02a sd a0,0(sp) + 80019212: ec2a sd a0,24(sp) + 80019214: a009 j 80019216 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf7573a6302c08e61E+0x10> + } + 80019216: 6502 ld a0,0(sp) + 80019218: 6105 addi sp,sp,32 + 8001921a: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17hb9f56331d13383c1E: + +000000008001921c <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17hb9f56331d13383c1E>: + pub const unsafe fn offset(self, count: isize) -> *const T + 8001921c: 1101 addi sp,sp,-32 + 8001921e: e42a sd a0,8(sp) + 80019220: e82e sd a1,16(sp) + unsafe { intrinsics::offset(self, count) } + 80019222: 059a slli a1,a1,0x6 + 80019224: 952e add a0,a0,a1 + 80019226: e02a sd a0,0(sp) + 80019228: ec2a sd a0,24(sp) + 8001922a: a009 j 8001922c <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17hb9f56331d13383c1E+0x10> + } + 8001922c: 6502 ld a0,0(sp) + 8001922e: 6105 addi sp,sp,32 + 80019230: 8082 ret + +Disassembly of section .text._ZN4core3num7nonzero12NonZeroUsize13new_unchecked17h04f2481c8bf8ee85E: + +0000000080019232 <_ZN4core3num7nonzero12NonZeroUsize13new_unchecked17h04f2481c8bf8ee85E>: + /// + /// The value must not be zero. + #[$stability] + #[rustc_const_stable(feature = "nonzero", since = "1.34.0")] + #[inline] + pub const unsafe fn new_unchecked(n: $Int) -> Self { + 80019232: 1141 addi sp,sp,-16 + 80019234: e42a sd a0,8(sp) + // SAFETY: this is guaranteed to be safe by the caller. + unsafe { Self(n) } + 80019236: e02a sd a0,0(sp) + } + 80019238: 0141 addi sp,sp,16 + 8001923a: 8082 ret + +Disassembly of section .text._ZN4core3num7nonzero12NonZeroUsize3get17h9c9882678da2bc98E: + +000000008001923c <_ZN4core3num7nonzero12NonZeroUsize3get17h9c9882678da2bc98E>: + + /// Returns the value as a primitive type. + #[$stability] + #[inline] + #[rustc_const_stable(feature = "nonzero", since = "1.34.0")] + pub const fn get(self) -> $Int { + 8001923c: 1141 addi sp,sp,-16 + 8001923e: e42a sd a0,8(sp) + self.0 + } + 80019240: 0141 addi sp,sp,16 + 80019242: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E: + +0000000080019244 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E>: + TRUNC = 0x400, + INVALID +} + +impl OpenMode { + pub fn mode(item: usize) -> Self { + 80019244: 1101 addi sp,sp,-32 + 80019246: e42a sd a0,8(sp) + 80019248: ec2a sd a0,24(sp) + 8001924a: 4581 li a1,0 + match item { + 0x000 => { Self::RDONLY }, + 8001924c: 02b50d63 beq a0,a1,80019286 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x42> + 80019250: a009 j 80019252 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0xe> + 80019252: 6522 ld a0,8(sp) + 80019254: 4585 li a1,1 + 80019256: 02b50b63 beq a0,a1,8001928c <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x48> + 8001925a: a009 j 8001925c <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x18> + 8001925c: 6522 ld a0,8(sp) + 8001925e: 4589 li a1,2 + 80019260: 02b50963 beq a0,a1,80019292 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x4e> + 80019264: a009 j 80019266 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x22> + 80019266: 6522 ld a0,8(sp) + 80019268: 20000593 li a1,512 + 8001926c: 02b50663 beq a0,a1,80019298 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x54> + 80019270: a009 j 80019272 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x2e> + 80019272: 6522 ld a0,8(sp) + 80019274: 40000593 li a1,1024 + 80019278: 02b50463 beq a0,a1,800192a0 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x5c> + 8001927c: a009 j 8001927e <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x3a> + 8001927e: 40100513 li a0,1025 + 0x001 => { Self::WRONLY }, + 0x002 => { Self::RDWR }, + 0x200 => { Self::CREATE }, + 0x400 => { Self::TRUNC }, + _ => {Self::INVALID} + 80019282: e82a sd a0,16(sp) + match item { + 80019284: a015 j 800192a8 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x64> + 80019286: 4501 li a0,0 + 0x000 => { Self::RDONLY }, + 80019288: e82a sd a0,16(sp) + match item { + 8001928a: a839 j 800192a8 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x64> + 8001928c: 4505 li a0,1 + 0x001 => { Self::WRONLY }, + 8001928e: e82a sd a0,16(sp) + match item { + 80019290: a821 j 800192a8 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x64> + 80019292: 4509 li a0,2 + 0x002 => { Self::RDWR }, + 80019294: e82a sd a0,16(sp) + match item { + 80019296: a809 j 800192a8 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x64> + 80019298: 20000513 li a0,512 + 0x200 => { Self::CREATE }, + 8001929c: e82a sd a0,16(sp) + match item { + 8001929e: a029 j 800192a8 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x64> + 800192a0: 40000513 li a0,1024 + 0x400 => { Self::TRUNC }, + 800192a4: e82a sd a0,16(sp) + match item { + 800192a6: a009 j 800192a8 <_ZN6kernel4arch5riscv4qemu2fs8OpenMode4mode17h15bbb1ea8002b902E+0x64> + } + } + 800192a8: 6542 ld a0,16(sp) + 800192aa: 6105 addi sp,sp,32 + 800192ac: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register10sfence_vma17h7533c6c75a9febaaE: + +00000000800192ae <_ZN6kernel4arch5riscv8register10sfence_vma17h7533c6c75a9febaaE>: +pub mod clint; + + +#[inline] +// flush the TLB. +pub unsafe fn sfence_vma(){ + 800192ae: 7159 addi sp,sp,-112 + println!("flush the TLB"); + 800192b0: f486 sd ra,104(sp) + +00000000800192b2 <.LBB0_5>: + 800192b2: 00012597 auipc a1,0x12 + 800192b6: 79e58593 addi a1,a1,1950 # 8002ba50 <.L__unnamed_1> + +00000000800192ba <.LBB0_6>: + 800192ba: 00012697 auipc a3,0x12 + 800192be: 7a668693 addi a3,a3,1958 # 8002ba60 <.L__unnamed_5> + 800192c2: 0028 addi a0,sp,8 + 800192c4: 4605 li a2,1 + 800192c6: 4701 li a4,0 + 800192c8: fffec097 auipc ra,0xfffec + 800192cc: 2c2080e7 jalr 706(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 800192d0: a009 j 800192d2 <.LBB0_6+0x18> + 800192d2: 0028 addi a0,sp,8 + 800192d4: 00006097 auipc ra,0x6 + 800192d8: 924080e7 jalr -1756(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 800192dc: a009 j 800192de <.LBB0_6+0x24> + llvm_asm!("sfence.vma zero, zero"::::"volatile"); + 800192de: 12000073 sfence.vma + +00000000800192e2 <.LBB0_7>: + println!("finish sfence vma"); + 800192e2: 00012597 auipc a1,0x12 + 800192e6: 79658593 addi a1,a1,1942 # 8002ba78 <.L__unnamed_3> + +00000000800192ea <.LBB0_8>: + 800192ea: 00012697 auipc a3,0x12 + 800192ee: 77668693 addi a3,a3,1910 # 8002ba60 <.L__unnamed_5> + 800192f2: 1828 addi a0,sp,56 + 800192f4: 4605 li a2,1 + 800192f6: 4701 li a4,0 + 800192f8: fffec097 auipc ra,0xfffec + 800192fc: 292080e7 jalr 658(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 80019300: a009 j 80019302 <.LBB0_8+0x18> + 80019302: 1828 addi a0,sp,56 + 80019304: 00006097 auipc ra,0x6 + 80019308: 8f4080e7 jalr -1804(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001930c: a009 j 8001930e <.LBB0_8+0x24> + 8001930e: 70a6 ld ra,104(sp) + 80019310: 6165 addi sp,sp,112 + 80019312: 8082 ret + +Disassembly of section .text._ZN4core3ptr13read_volatile17h0ae297fe3f24e4caE: + +0000000080019314 <_ZN4core3ptr13read_volatile17h0ae297fe3f24e4caE>: +/// assert_eq!(std::ptr::read_volatile(y), 12); +/// } +/// ``` +#[inline] +#[stable(feature = "volatile", since = "1.9.0")] +pub unsafe fn read_volatile(src: *const T) -> T { + 80019314: 1101 addi sp,sp,-32 + 80019316: e82a sd a0,16(sp) + if cfg!(debug_assertions) && !is_aligned_and_not_null(src) { + // Not panicking to keep codegen impact smaller. + abort(); + } + // SAFETY: the caller must uphold the safety contract for `volatile_load`. + unsafe { intrinsics::volatile_load(src) } + 80019318: 00056503 lwu a0,0(a0) # 2000000 <.Lline_table_start0+0x1fc8b9b> + 8001931c: e42a sd a0,8(sp) + 8001931e: ce2a sw a0,28(sp) + 80019320: a009 j 80019322 <_ZN4core3ptr13read_volatile17h0ae297fe3f24e4caE+0xe> +} + 80019322: 6522 ld a0,8(sp) + 80019324: 6105 addi sp,sp,32 + 80019326: 8082 ret + +Disassembly of section .text._ZN4core3ptr13read_volatile17h48a61fef837248f4E: + +0000000080019328 <_ZN4core3ptr13read_volatile17h48a61fef837248f4E>: +pub unsafe fn read_volatile(src: *const T) -> T { + 80019328: 1101 addi sp,sp,-32 + 8001932a: e82a sd a0,16(sp) + unsafe { intrinsics::volatile_load(src) } + 8001932c: 00054503 lbu a0,0(a0) + 80019330: e42a sd a0,8(sp) + 80019332: 00a10fa3 sb a0,31(sp) + 80019336: a009 j 80019338 <_ZN4core3ptr13read_volatile17h48a61fef837248f4E+0x10> +} + 80019338: 6522 ld a0,8(sp) + 8001933a: 6105 addi sp,sp,32 + 8001933c: 8082 ret + +Disassembly of section .text._ZN4core3ptr13read_volatile17h53ed030574802bd4E: + +000000008001933e <_ZN4core3ptr13read_volatile17h53ed030574802bd4E>: +pub unsafe fn read_volatile(src: *const T) -> T { + 8001933e: 1101 addi sp,sp,-32 + 80019340: e82a sd a0,16(sp) + unsafe { intrinsics::volatile_load(src) } + 80019342: 6108 ld a0,0(a0) + 80019344: e42a sd a0,8(sp) + 80019346: ec2a sd a0,24(sp) + 80019348: a009 j 8001934a <_ZN4core3ptr13read_volatile17h53ed030574802bd4E+0xc> +} + 8001934a: 6522 ld a0,8(sp) + 8001934c: 6105 addi sp,sp,32 + 8001934e: 8082 ret + +Disassembly of section .text._ZN4core3ptr14write_volatile17h1c498a4c32cde7d4E: + +0000000080019350 <_ZN4core3ptr14write_volatile17h1c498a4c32cde7d4E>: +/// assert_eq!(std::ptr::read_volatile(y), 12); +/// } +/// ``` +#[inline] +#[stable(feature = "volatile", since = "1.9.0")] +pub unsafe fn write_volatile(dst: *mut T, src: T) { + 80019350: 1141 addi sp,sp,-16 + 80019352: e02a sd a0,0(sp) + 80019354: c62e sw a1,12(sp) + // Not panicking to keep codegen impact smaller. + abort(); + } + // SAFETY: the caller must uphold the safety contract for `volatile_store`. + unsafe { + intrinsics::volatile_store(dst, src); + 80019356: c10c sw a1,0(a0) + 80019358: a009 j 8001935a <_ZN4core3ptr14write_volatile17h1c498a4c32cde7d4E+0xa> + } +} + 8001935a: 0141 addi sp,sp,16 + 8001935c: 8082 ret + +Disassembly of section .text._ZN4core3ptr14write_volatile17h935b49f1a63f6714E: + +000000008001935e <_ZN4core3ptr14write_volatile17h935b49f1a63f6714E>: +pub unsafe fn write_volatile(dst: *mut T, src: T) { + 8001935e: 1141 addi sp,sp,-16 + 80019360: e02a sd a0,0(sp) + 80019362: e42e sd a1,8(sp) + intrinsics::volatile_store(dst, src); + 80019364: e10c sd a1,0(a0) + 80019366: a009 j 80019368 <_ZN4core3ptr14write_volatile17h935b49f1a63f6714E+0xa> +} + 80019368: 0141 addi sp,sp,16 + 8001936a: 8082 ret + +Disassembly of section .text._ZN4core3ptr14write_volatile17ha922d8ced3e01de5E: + +000000008001936c <_ZN4core3ptr14write_volatile17ha922d8ced3e01de5E>: +pub unsafe fn write_volatile(dst: *mut T, src: T) { + 8001936c: 1141 addi sp,sp,-16 + 8001936e: e02a sd a0,0(sp) + 80019370: 00b107a3 sb a1,15(sp) + intrinsics::volatile_store(dst, src); + 80019374: 00b50023 sb a1,0(a0) + 80019378: a009 j 8001937a <_ZN4core3ptr14write_volatile17ha922d8ced3e01de5E+0xe> +} + 8001937a: 0141 addi sp,sp,16 + 8001937c: 8082 ret + +Disassembly of section .text._ZN4core3ptr20slice_from_raw_parts17h19b34a977b1709d3E: + +000000008001937e <_ZN4core3ptr20slice_from_raw_parts17h19b34a977b1709d3E>: +pub const fn slice_from_raw_parts(data: *const T, len: usize) -> *const [T] { + 8001937e: 7139 addi sp,sp,-64 + 80019380: fc06 sd ra,56(sp) + 80019382: ec2e sd a1,24(sp) + 80019384: f42a sd a0,40(sp) + 80019386: f82e sd a1,48(sp) + from_raw_parts(data.cast(), len) + 80019388: fffeb097 auipc ra,0xfffeb + 8001938c: 552080e7 jalr 1362(ra) # 800048da <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$4cast17he44352a5ab45ee06E> + 80019390: f02a sd a0,32(sp) + 80019392: a009 j 80019394 <_ZN4core3ptr20slice_from_raw_parts17h19b34a977b1709d3E+0x16> + 80019394: 65e2 ld a1,24(sp) + 80019396: 7502 ld a0,32(sp) + 80019398: 00003097 auipc ra,0x3 + 8001939c: ad8080e7 jalr -1320(ra) # 8001be70 <_ZN4core3ptr8metadata14from_raw_parts17hb35c9d87c96e1656E> + 800193a0: e42a sd a0,8(sp) + 800193a2: e82e sd a1,16(sp) + 800193a4: a009 j 800193a6 <_ZN4core3ptr20slice_from_raw_parts17h19b34a977b1709d3E+0x28> +} + 800193a6: 65c2 ld a1,16(sp) + 800193a8: 6522 ld a0,8(sp) + 800193aa: 70e2 ld ra,56(sp) + 800193ac: 6121 addi sp,sp,64 + 800193ae: 8082 ret + +Disassembly of section .text._ZN4core3ptr20slice_from_raw_parts17h4c1ee3b844c20623E: + +00000000800193b0 <_ZN4core3ptr20slice_from_raw_parts17h4c1ee3b844c20623E>: +pub const fn slice_from_raw_parts(data: *const T, len: usize) -> *const [T] { + 800193b0: 7139 addi sp,sp,-64 + 800193b2: fc06 sd ra,56(sp) + 800193b4: ec2e sd a1,24(sp) + 800193b6: f42a sd a0,40(sp) + 800193b8: f82e sd a1,48(sp) + from_raw_parts(data.cast(), len) + 800193ba: fffeb097 auipc ra,0xfffeb + 800193be: 518080e7 jalr 1304(ra) # 800048d2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$4cast17h03bc1f4ed09a4b3cE> + 800193c2: f02a sd a0,32(sp) + 800193c4: a009 j 800193c6 <_ZN4core3ptr20slice_from_raw_parts17h4c1ee3b844c20623E+0x16> + 800193c6: 65e2 ld a1,24(sp) + 800193c8: 7502 ld a0,32(sp) + 800193ca: 00003097 auipc ra,0x3 + 800193ce: ab8080e7 jalr -1352(ra) # 8001be82 <_ZN4core3ptr8metadata14from_raw_parts17hd9330322b61d2f92E> + 800193d2: e42a sd a0,8(sp) + 800193d4: e82e sd a1,16(sp) + 800193d6: a009 j 800193d8 <_ZN4core3ptr20slice_from_raw_parts17h4c1ee3b844c20623E+0x28> +} + 800193d8: 65c2 ld a1,16(sp) + 800193da: 6522 ld a0,8(sp) + 800193dc: 70e2 ld ra,56(sp) + 800193de: 6121 addi sp,sp,64 + 800193e0: 8082 ret + +Disassembly of section .text._ZN4core3ptr2eq17h2ab91a60e465e9ebE: + +00000000800193e2 <_ZN4core3ptr2eq17h2ab91a60e465e9ebE>: +/// &wrapper.member as &dyn Trait as *const dyn Trait as *const u8, +/// )); +/// ``` +#[stable(feature = "ptr_eq", since = "1.17.0")] +#[inline] +pub fn eq(a: *const T, b: *const T) -> bool { + 800193e2: 1141 addi sp,sp,-16 + 800193e4: e02a sd a0,0(sp) + 800193e6: e42e sd a1,8(sp) + a == b + 800193e8: 8d2d xor a0,a0,a1 + 800193ea: 00153513 seqz a0,a0 +} + 800193ee: 0141 addi sp,sp,16 + 800193f0: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17h018161c0cd37b3fbE: + +00000000800193f2 <_ZN4core3ptr4read17h018161c0cd37b3fbE>: +pub const unsafe fn read(src: *const T) -> T { + 800193f2: 7179 addi sp,sp,-48 + 800193f4: e42a sd a0,8(sp) + 800193f6: ec2a sd a0,24(sp) + #[rustc_const_stable(feature = "const_maybe_uninit", since = "1.36.0")] + #[inline(always)] + #[rustc_diagnostic_item = "maybe_uninit_uninit"] + pub const fn uninit() -> MaybeUninit { + MaybeUninit { uninit: () } + } + 800193f8: 02510503 lb a0,37(sp) + let mut tmp = MaybeUninit::::uninit(); + 800193fc: 00a10ba3 sb a0,23(sp) + 80019400: a009 j 80019402 <_ZN4core3ptr4read17h018161c0cd37b3fbE+0x10> + 80019402: 01710513 addi a0,sp,23 + 80019406: f42a sd a0,40(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 80019408: a009 j 8001940a <_ZN4core3ptr4read17h018161c0cd37b3fbE+0x18> + 8001940a: 6522 ld a0,8(sp) + 8001940c: 00054503 lbu a0,0(a0) + 80019410: e02a sd a0,0(sp) + 80019412: 00a10ba3 sb a0,23(sp) + 80019416: 02a10323 sb a0,38(sp) + 8001941a: 02a103a3 sb a0,39(sp) + tmp.assume_init() + 8001941e: a009 j 80019420 <_ZN4core3ptr4read17h018161c0cd37b3fbE+0x2e> +} + 80019420: 6502 ld a0,0(sp) + 80019422: 6145 addi sp,sp,48 + 80019424: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17h260501ac2ae68563E: + +0000000080019426 <_ZN4core3ptr4read17h260501ac2ae68563E>: +pub const unsafe fn read(src: *const T) -> T { + 80019426: 7159 addi sp,sp,-112 + 80019428: e42e sd a1,8(sp) + 8001942a: e82a sd a0,16(sp) + 8001942c: e4ae sd a1,72(sp) + let mut tmp = MaybeUninit::::uninit(); + 8001942e: a009 j 80019430 <_ZN4core3ptr4read17h260501ac2ae68563E+0xa> + 80019430: 0828 addi a0,sp,24 + 80019432: e02a sd a0,0(sp) + 80019434: f4aa sd a0,104(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 80019436: a009 j 80019438 <_ZN4core3ptr4read17h260501ac2ae68563E+0x12> + 80019438: 65c2 ld a1,16(sp) + 8001943a: 6602 ld a2,0(sp) + 8001943c: 6522 ld a0,8(sp) + 8001943e: 6914 ld a3,16(a0) + 80019440: ea14 sd a3,16(a2) + 80019442: 6514 ld a3,8(a0) + 80019444: e614 sd a3,8(a2) + 80019446: 6108 ld a0,0(a0) + 80019448: e208 sd a0,0(a2) + tmp.assume_init() + 8001944a: 76a2 ld a3,40(sp) + 8001944c: e0b6 sd a3,64(sp) + 8001944e: 7602 ld a2,32(sp) + 80019450: fc32 sd a2,56(sp) + 80019452: 6562 ld a0,24(sp) + 80019454: f82a sd a0,48(sp) + pub const unsafe fn assume_init(self) -> T { + // SAFETY: the caller must guarantee that `self` is initialized. + // This also means that `self` must be a `value` variant. + unsafe { + intrinsics::assert_inhabited::(); + ManuallyDrop::into_inner(self.value) + 80019456: e8aa sd a0,80(sp) + 80019458: ecb2 sd a2,88(sp) + 8001945a: f0b6 sd a3,96(sp) + 8001945c: e994 sd a3,16(a1) + 8001945e: e590 sd a2,8(a1) + 80019460: e188 sd a0,0(a1) + 80019462: a009 j 80019464 <_ZN4core3ptr4read17h260501ac2ae68563E+0x3e> +} + 80019464: 6165 addi sp,sp,112 + 80019466: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17h49d73875721fb0a9E: + +0000000080019468 <_ZN4core3ptr4read17h49d73875721fb0a9E>: +pub const unsafe fn read(src: *const T) -> T { + 80019468: 7179 addi sp,sp,-48 + 8001946a: e42a sd a0,8(sp) + 8001946c: ec2a sd a0,24(sp) + } + 8001946e: 02211503 lh a0,34(sp) + let mut tmp = MaybeUninit::::uninit(); + 80019472: 00a11b23 sh a0,22(sp) + 80019476: a009 j 80019478 <_ZN4core3ptr4read17h49d73875721fb0a9E+0x10> + 80019478: 01610513 addi a0,sp,22 + 8001947c: f42a sd a0,40(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 8001947e: a009 j 80019480 <_ZN4core3ptr4read17h49d73875721fb0a9E+0x18> + 80019480: 6522 ld a0,8(sp) + 80019482: 00055503 lhu a0,0(a0) + 80019486: e02a sd a0,0(sp) + 80019488: 00a11b23 sh a0,22(sp) + 8001948c: 02a11223 sh a0,36(sp) + 80019490: 02a11323 sh a0,38(sp) + tmp.assume_init() + 80019494: a009 j 80019496 <_ZN4core3ptr4read17h49d73875721fb0a9E+0x2e> +} + 80019496: 6502 ld a0,0(sp) + 80019498: 6145 addi sp,sp,48 + 8001949a: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17h97f5e0e151e0fdc4E: + +000000008001949c <_ZN4core3ptr4read17h97f5e0e151e0fdc4E>: +pub const unsafe fn read(src: *const T) -> T { + 8001949c: 7139 addi sp,sp,-64 + 8001949e: e82a sd a0,16(sp) + 800194a0: f02a sd a0,32(sp) + 800194a2: 5532 lw a0,44(sp) + let mut tmp = MaybeUninit::::uninit(); + 800194a4: ce2a sw a0,28(sp) + 800194a6: a009 j 800194a8 <_ZN4core3ptr4read17h97f5e0e151e0fdc4E+0xc> + 800194a8: 0868 addi a0,sp,28 + 800194aa: fc2a sd a0,56(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 800194ac: a009 j 800194ae <_ZN4core3ptr4read17h97f5e0e151e0fdc4E+0x12> + 800194ae: 6542 ld a0,16(sp) + 800194b0: 00056503 lwu a0,0(a0) + 800194b4: e42a sd a0,8(sp) + 800194b6: ce2a sw a0,28(sp) + 800194b8: d82a sw a0,48(sp) + 800194ba: da2a sw a0,52(sp) + tmp.assume_init() + 800194bc: a009 j 800194be <_ZN4core3ptr4read17h97f5e0e151e0fdc4E+0x22> +} + 800194be: 6522 ld a0,8(sp) + 800194c0: 6121 addi sp,sp,64 + 800194c2: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hb68b0b8aaefcfe70E: + +00000000800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E>: +pub const unsafe fn read(src: *const T) -> T { + 800194c4: 1101 addi sp,sp,-32 + 800194c6: e42a sd a0,8(sp) + let mut tmp = MaybeUninit::::uninit(); + 800194c8: a009 j 800194ca <_ZN4core3ptr4read17hb68b0b8aaefcfe70E+0x6> + 800194ca: 850a mv a0,sp + 800194cc: ec2a sd a0,24(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 800194ce: a009 j 800194d0 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E+0xc> + tmp.assume_init() + 800194d0: a009 j 800194d2 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E+0xe> +} + 800194d2: 6105 addi sp,sp,32 + 800194d4: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hbe38e0f78fffdc49E: + +00000000800194d6 <_ZN4core3ptr4read17hbe38e0f78fffdc49E>: +pub const unsafe fn read(src: *const T) -> T { + 800194d6: 715d addi sp,sp,-80 + 800194d8: ec2a sd a0,24(sp) + 800194da: f42a sd a0,40(sp) + 800194dc: 7542 ld a0,48(sp) + let mut tmp = MaybeUninit::::uninit(); + 800194de: f02a sd a0,32(sp) + 800194e0: a009 j 800194e2 <_ZN4core3ptr4read17hbe38e0f78fffdc49E+0xc> + 800194e2: 1008 addi a0,sp,32 + 800194e4: e82a sd a0,16(sp) + 800194e6: e4aa sd a0,72(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 800194e8: a009 j 800194ea <_ZN4core3ptr4read17hbe38e0f78fffdc49E+0x14> + 800194ea: 65c2 ld a1,16(sp) + 800194ec: 6562 ld a0,24(sp) + 800194ee: 6108 ld a0,0(a0) + 800194f0: e188 sd a0,0(a1) + tmp.assume_init() + 800194f2: 7502 ld a0,32(sp) + 800194f4: e42a sd a0,8(sp) + 800194f6: fc2a sd a0,56(sp) + 800194f8: e0aa sd a0,64(sp) + 800194fa: a009 j 800194fc <_ZN4core3ptr4read17hbe38e0f78fffdc49E+0x26> +} + 800194fc: 6522 ld a0,8(sp) + 800194fe: 6161 addi sp,sp,80 + 80019500: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hca9a7d22776635f1E: + +0000000080019502 <_ZN4core3ptr4read17hca9a7d22776635f1E>: +pub const unsafe fn read(src: *const T) -> T { + 80019502: 7139 addi sp,sp,-64 + 80019504: e42a sd a0,8(sp) + 80019506: ec2a sd a0,24(sp) + 80019508: 7502 ld a0,32(sp) + let mut tmp = MaybeUninit::::uninit(); + 8001950a: e82a sd a0,16(sp) + 8001950c: a009 j 8001950e <_ZN4core3ptr4read17hca9a7d22776635f1E+0xc> + 8001950e: 0808 addi a0,sp,16 + 80019510: fc2a sd a0,56(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 80019512: a009 j 80019514 <_ZN4core3ptr4read17hca9a7d22776635f1E+0x12> + 80019514: 6522 ld a0,8(sp) + 80019516: 6108 ld a0,0(a0) + 80019518: e02a sd a0,0(sp) + 8001951a: e82a sd a0,16(sp) + 8001951c: f42a sd a0,40(sp) + 8001951e: f82a sd a0,48(sp) + tmp.assume_init() + 80019520: a009 j 80019522 <_ZN4core3ptr4read17hca9a7d22776635f1E+0x20> +} + 80019522: 6502 ld a0,0(sp) + 80019524: 6121 addi sp,sp,64 + 80019526: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hcc58f40f4c4c7a01E: + +0000000080019528 <_ZN4core3ptr4read17hcc58f40f4c4c7a01E>: +pub const unsafe fn read(src: *const T) -> T { + 80019528: 7159 addi sp,sp,-112 + 8001952a: ec2a sd a0,24(sp) + 8001952c: f82a sd a0,48(sp) + 8001952e: 75e2 ld a1,56(sp) + 80019530: 6506 ld a0,64(sp) + let mut tmp = MaybeUninit::::uninit(); + 80019532: f02e sd a1,32(sp) + 80019534: f42a sd a0,40(sp) + 80019536: a009 j 80019538 <_ZN4core3ptr4read17hcc58f40f4c4c7a01E+0x10> + 80019538: 1008 addi a0,sp,32 + 8001953a: e82a sd a0,16(sp) + 8001953c: f4aa sd a0,104(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 8001953e: a009 j 80019540 <_ZN4core3ptr4read17hcc58f40f4c4c7a01E+0x18> + 80019540: 65c2 ld a1,16(sp) + 80019542: 6562 ld a0,24(sp) + 80019544: 6510 ld a2,8(a0) + 80019546: e590 sd a2,8(a1) + 80019548: 6108 ld a0,0(a0) + 8001954a: e188 sd a0,0(a1) + tmp.assume_init() + 8001954c: 7582 ld a1,32(sp) + 8001954e: e02e sd a1,0(sp) + 80019550: 7522 ld a0,40(sp) + 80019552: e42a sd a0,8(sp) + 80019554: e4ae sd a1,72(sp) + 80019556: e8aa sd a0,80(sp) + 80019558: ecae sd a1,88(sp) + 8001955a: f0aa sd a0,96(sp) + 8001955c: a009 j 8001955e <_ZN4core3ptr4read17hcc58f40f4c4c7a01E+0x36> +} + 8001955e: 65a2 ld a1,8(sp) + 80019560: 6502 ld a0,0(sp) + 80019562: 6165 addi sp,sp,112 + 80019564: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hd0dbd64c70caff03E: + +0000000080019566 <_ZN4core3ptr4read17hd0dbd64c70caff03E>: +pub const unsafe fn read(src: *const T) -> T { + 80019566: 715d addi sp,sp,-80 + 80019568: ec2a sd a0,24(sp) + 8001956a: f42a sd a0,40(sp) + 8001956c: 7542 ld a0,48(sp) + let mut tmp = MaybeUninit::::uninit(); + 8001956e: f02a sd a0,32(sp) + 80019570: a009 j 80019572 <_ZN4core3ptr4read17hd0dbd64c70caff03E+0xc> + 80019572: 1008 addi a0,sp,32 + 80019574: e82a sd a0,16(sp) + 80019576: e4aa sd a0,72(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 80019578: a009 j 8001957a <_ZN4core3ptr4read17hd0dbd64c70caff03E+0x14> + 8001957a: 65c2 ld a1,16(sp) + 8001957c: 6562 ld a0,24(sp) + 8001957e: 6108 ld a0,0(a0) + 80019580: e188 sd a0,0(a1) + tmp.assume_init() + 80019582: 7502 ld a0,32(sp) + 80019584: e42a sd a0,8(sp) + 80019586: fc2a sd a0,56(sp) + 80019588: e0aa sd a0,64(sp) + 8001958a: a009 j 8001958c <_ZN4core3ptr4read17hd0dbd64c70caff03E+0x26> +} + 8001958c: 6522 ld a0,8(sp) + 8001958e: 6161 addi sp,sp,80 + 80019590: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hd38a26e0d5db892cE: + +0000000080019592 <_ZN4core3ptr4read17hd38a26e0d5db892cE>: +pub const unsafe fn read(src: *const T) -> T { + 80019592: 7111 addi sp,sp,-256 + 80019594: fd86 sd ra,248(sp) + 80019596: ec2e sd a1,24(sp) + 80019598: f02a sd a0,32(sp) + 8001959a: f52e sd a1,168(sp) + let mut tmp = MaybeUninit::::uninit(); + 8001959c: a009 j 8001959e <_ZN4core3ptr4read17hd38a26e0d5db892cE+0xc> + 8001959e: 1028 addi a0,sp,40 + 800195a0: e82a sd a0,16(sp) + 800195a2: f9aa sd a0,240(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 800195a4: a009 j 800195a6 <_ZN4core3ptr4read17hd38a26e0d5db892cE+0x14> + 800195a6: 65e2 ld a1,24(sp) + 800195a8: 6542 ld a0,16(sp) + 800195aa: 04000613 li a2,64 + 800195ae: e432 sd a2,8(sp) + 800195b0: 0000d097 auipc ra,0xd + 800195b4: ad2080e7 jalr -1326(ra) # 80026082 + 800195b8: 6622 ld a2,8(sp) + tmp.assume_init() + 800195ba: 7502 ld a0,32(sp) + 800195bc: 7322 ld t1,40(sp) + 800195be: f49a sd t1,104(sp) + 800195c0: 72c2 ld t0,48(sp) + 800195c2: f896 sd t0,112(sp) + 800195c4: 78e2 ld a7,56(sp) + 800195c6: fcc6 sd a7,120(sp) + 800195c8: 6806 ld a6,64(sp) + 800195ca: e142 sd a6,128(sp) + 800195cc: 67a6 ld a5,72(sp) + 800195ce: e53e sd a5,136(sp) + 800195d0: 6746 ld a4,80(sp) + 800195d2: e93a sd a4,144(sp) + 800195d4: 66e6 ld a3,88(sp) + 800195d6: ed36 sd a3,152(sp) + 800195d8: 7586 ld a1,96(sp) + 800195da: f12e sd a1,160(sp) + ManuallyDrop::into_inner(self.value) + 800195dc: f91a sd t1,176(sp) + 800195de: fd16 sd t0,184(sp) + 800195e0: e1c6 sd a7,192(sp) + 800195e2: e5c2 sd a6,200(sp) + 800195e4: e9be sd a5,208(sp) + 800195e6: edba sd a4,216(sp) + 800195e8: f1b6 sd a3,224(sp) + 800195ea: f5ae sd a1,232(sp) + 800195ec: 190c addi a1,sp,176 + 800195ee: 0000d097 auipc ra,0xd + 800195f2: a94080e7 jalr -1388(ra) # 80026082 + 800195f6: a009 j 800195f8 <_ZN4core3ptr4read17hd38a26e0d5db892cE+0x66> +} + 800195f8: 70ee ld ra,248(sp) + 800195fa: 6111 addi sp,sp,256 + 800195fc: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17he855cc26728788dfE: + +00000000800195fe <_ZN4core3ptr4read17he855cc26728788dfE>: +pub const unsafe fn read(src: *const T) -> T { + 800195fe: 7179 addi sp,sp,-48 + 80019600: e42a sd a0,8(sp) + 80019602: ec2a sd a0,24(sp) + } + 80019604: 02510503 lb a0,37(sp) + let mut tmp = MaybeUninit::::uninit(); + 80019608: 00a10ba3 sb a0,23(sp) + 8001960c: a009 j 8001960e <_ZN4core3ptr4read17he855cc26728788dfE+0x10> + 8001960e: 01710513 addi a0,sp,23 + 80019612: f42a sd a0,40(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 80019614: a009 j 80019616 <_ZN4core3ptr4read17he855cc26728788dfE+0x18> + 80019616: 6522 ld a0,8(sp) + 80019618: 00054503 lbu a0,0(a0) + 8001961c: e02a sd a0,0(sp) + 8001961e: 00a10ba3 sb a0,23(sp) + 80019622: 02a10323 sb a0,38(sp) + 80019626: 8905 andi a0,a0,1 + 80019628: 02a103a3 sb a0,39(sp) + tmp.assume_init() + 8001962c: a009 j 8001962e <_ZN4core3ptr4read17he855cc26728788dfE+0x30> +} + 8001962e: 6502 ld a0,0(sp) + 80019630: 8905 andi a0,a0,1 + 80019632: 6145 addi sp,sp,48 + 80019634: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hf667e6f53e42adf1E: + +0000000080019636 <_ZN4core3ptr4read17hf667e6f53e42adf1E>: +pub const unsafe fn read(src: *const T) -> T { + 80019636: 7159 addi sp,sp,-112 + 80019638: ec2a sd a0,24(sp) + 8001963a: f82a sd a0,48(sp) + 8001963c: 75e2 ld a1,56(sp) + 8001963e: 6506 ld a0,64(sp) + let mut tmp = MaybeUninit::::uninit(); + 80019640: f02e sd a1,32(sp) + 80019642: f42a sd a0,40(sp) + 80019644: a009 j 80019646 <_ZN4core3ptr4read17hf667e6f53e42adf1E+0x10> + 80019646: 1008 addi a0,sp,32 + 80019648: f4aa sd a0,104(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 8001964a: a009 j 8001964c <_ZN4core3ptr4read17hf667e6f53e42adf1E+0x16> + 8001964c: 65e2 ld a1,24(sp) + 8001964e: 6588 ld a0,8(a1) + 80019650: e42a sd a0,8(sp) + 80019652: f42a sd a0,40(sp) + 80019654: 618c ld a1,0(a1) + 80019656: e82e sd a1,16(sp) + 80019658: f02e sd a1,32(sp) + 8001965a: e4ae sd a1,72(sp) + 8001965c: e8aa sd a0,80(sp) + 8001965e: ecae sd a1,88(sp) + 80019660: f0aa sd a0,96(sp) + tmp.assume_init() + 80019662: a009 j 80019664 <_ZN4core3ptr4read17hf667e6f53e42adf1E+0x2e> +} + 80019664: 65a2 ld a1,8(sp) + 80019666: 6542 ld a0,16(sp) + 80019668: 6165 addi sp,sp,112 + 8001966a: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h0b5f65d949594758E: + +000000008001966c <_ZN4core3ptr5write17h0b5f65d949594758E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 8001966c: 1101 addi sp,sp,-32 + 8001966e: e42e sd a1,8(sp) + 80019670: e832 sd a2,16(sp) + 80019672: ec2a sd a0,24(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 80019674: e510 sd a2,8(a0) + 80019676: e10c sd a1,0(a0) +} + 80019678: 6105 addi sp,sp,32 + 8001967a: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h0fb1ba83ac2984c7E: + +000000008001967c <_ZN4core3ptr5write17h0fb1ba83ac2984c7E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 8001967c: 1141 addi sp,sp,-16 + 8001967e: 00b103a3 sb a1,7(sp) + 80019682: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 80019684: 00b50023 sb a1,0(a0) +} + 80019688: 0141 addi sp,sp,16 + 8001968a: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h10d6d8799e54bf75E: + +000000008001968c <_ZN4core3ptr5write17h10d6d8799e54bf75E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 8001968c: 1141 addi sp,sp,-16 + 8001968e: c22e sw a1,4(sp) + 80019690: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 80019692: c10c sw a1,0(a0) +} + 80019694: 0141 addi sp,sp,16 + 80019696: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h24d2ac6ea724fbc0E: + +0000000080019698 <_ZN4core3ptr5write17h24d2ac6ea724fbc0E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 80019698: 1141 addi sp,sp,-16 + 8001969a: e406 sd ra,8(sp) + 8001969c: e02a sd a0,0(sp) + 8001969e: 04000613 li a2,64 + copy_nonoverlapping(&src as *const T, dst, 1); + 800196a2: 0000d097 auipc ra,0xd + 800196a6: 9e0080e7 jalr -1568(ra) # 80026082 +} + 800196aa: 60a2 ld ra,8(sp) + 800196ac: 0141 addi sp,sp,16 + 800196ae: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h25ba6e811e5fd451E: + +00000000800196b0 <_ZN4core3ptr5write17h25ba6e811e5fd451E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 800196b0: 1141 addi sp,sp,-16 + 800196b2: 00b103a3 sb a1,7(sp) + 800196b6: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 800196b8: 00b50023 sb a1,0(a0) +} + 800196bc: 0141 addi sp,sp,16 + 800196be: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h4a1d74f50ec6a35fE: + +00000000800196c0 <_ZN4core3ptr5write17h4a1d74f50ec6a35fE>: +pub const unsafe fn write(dst: *mut T, src: T) { + 800196c0: 1141 addi sp,sp,-16 + 800196c2: e02e sd a1,0(sp) + 800196c4: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 800196c6: e10c sd a1,0(a0) +} + 800196c8: 0141 addi sp,sp,16 + 800196ca: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h60f767b6e6d7c45aE: + +00000000800196cc <_ZN4core3ptr5write17h60f767b6e6d7c45aE>: +pub const unsafe fn write(dst: *mut T, src: T) { + 800196cc: 1101 addi sp,sp,-32 + 800196ce: e42e sd a1,8(sp) + 800196d0: e832 sd a2,16(sp) + 800196d2: ec2a sd a0,24(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 800196d4: e510 sd a2,8(a0) + 800196d6: e10c sd a1,0(a0) +} + 800196d8: 6105 addi sp,sp,32 + 800196da: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h6d43807bf71c562eE: + +00000000800196dc <_ZN4core3ptr5write17h6d43807bf71c562eE>: +pub const unsafe fn write(dst: *mut T, src: T) { + 800196dc: 1141 addi sp,sp,-16 + 800196de: 00b11323 sh a1,6(sp) + 800196e2: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 800196e4: 00b51023 sh a1,0(a0) +} + 800196e8: 0141 addi sp,sp,16 + 800196ea: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h9fb8ab42ff75ed2cE: + +00000000800196ec <_ZN4core3ptr5write17h9fb8ab42ff75ed2cE>: +pub const unsafe fn write(dst: *mut T, src: T) { + 800196ec: 1141 addi sp,sp,-16 + 800196ee: e02e sd a1,0(sp) + 800196f0: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 800196f2: e10c sd a1,0(a0) +} + 800196f4: 0141 addi sp,sp,16 + 800196f6: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17hbb8dbff750359a8eE: + +00000000800196f8 <_ZN4core3ptr5write17hbb8dbff750359a8eE>: +pub const unsafe fn write(dst: *mut T, src: T) { + 800196f8: 1141 addi sp,sp,-16 + 800196fa: e02e sd a1,0(sp) + 800196fc: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 800196fe: e10c sd a1,0(a0) +} + 80019700: 0141 addi sp,sp,16 + 80019702: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17hf7c587ba45e12a81E: + +0000000080019704 <_ZN4core3ptr5write17hf7c587ba45e12a81E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 80019704: 1141 addi sp,sp,-16 + 80019706: e02e sd a1,0(sp) + 80019708: 85aa mv a1,a0 + 8001970a: 6502 ld a0,0(sp) + 8001970c: e42e sd a1,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 8001970e: 6910 ld a2,16(a0) + 80019710: e990 sd a2,16(a1) + 80019712: 6510 ld a2,8(a0) + 80019714: e590 sd a2,8(a1) + 80019716: 6108 ld a0,0(a0) + 80019718: e188 sd a0,0(a1) +} + 8001971a: 0141 addi sp,sp,16 + 8001971c: 8082 ret + +Disassembly of section .text._ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E: + +000000008001971e <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E>: + fn dup(&self, inode: &Inode) -> Inode { + 8001971e: 715d addi sp,sp,-80 + 80019720: e486 sd ra,72(sp) + 80019722: ec2e sd a1,24(sp) + 80019724: fc2a sd a0,56(sp) + 80019726: e0ae sd a1,64(sp) + let mut guard = self.meta.acquire(); + 80019728: ffff7097 auipc ra,0xffff7 + 8001972c: 75a080e7 jalr 1882(ra) # 80010e82 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E> + 80019730: f82a sd a0,48(sp) + 80019732: a009 j 80019734 <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E+0x16> + 80019734: 1808 addi a0,sp,48 + guard[inode.index].refs += 1; + 80019736: ffff8097 auipc ra,0xffff8 + 8001973a: 6c6080e7 jalr 1734(ra) # 80011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E> + 8001973e: e82a sd a0,16(sp) + 80019740: a009 j 80019742 <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E+0x24> + 80019742: 6562 ld a0,24(sp) + 80019744: 610c ld a1,0(a0) + 80019746: e42e sd a1,8(sp) + 80019748: 03100513 li a0,49 + 8001974c: 04b56863 bltu a0,a1,8001979c <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E+0x7e> + 80019750: a009 j 80019752 <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E+0x34> + 80019752: 6542 ld a0,16(sp) + 80019754: 65a2 ld a1,8(sp) + 80019756: 4661 li a2,24 + 80019758: 02c585b3 mul a1,a1,a2 + 8001975c: 952e add a0,a0,a1 + 8001975e: 610c ld a1,0(a0) + 80019760: 00158513 addi a0,a1,1 + 80019764: e02a sd a0,0(sp) + 80019766: 04b56763 bltu a0,a1,800197b4 <.LBB0_9> + 8001976a: a009 j 8001976c <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E+0x4e> + 8001976c: 6562 ld a0,24(sp) + 8001976e: 6582 ld a1,0(sp) + 80019770: 6642 ld a2,16(sp) + 80019772: 66a2 ld a3,8(sp) + 80019774: 4761 li a4,24 + 80019776: 02e686b3 mul a3,a3,a4 + 8001977a: 9636 add a2,a2,a3 + 8001977c: e20c sd a1,0(a2) + dev: inode.dev, + 8001977e: 650c ld a1,8(a0) + index: inode.index + 80019780: 6108 ld a0,0(a0) + Inode { + 80019782: f42e sd a1,40(sp) + 80019784: f02a sd a0,32(sp) + 80019786: 1808 addi a0,sp,48 + } + 80019788: fffed097 auipc ra,0xfffed + 8001978c: 7d2080e7 jalr 2002(ra) # 80006f5a <_ZN4core3ptr116drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$u5b$kernel..fs..inode..InodeMeta$u3b$$u20$50$u5d$$GT$$GT$17h4e8573cf3b362114E> + 80019790: a009 j 80019792 <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E+0x74> + 80019792: 7502 ld a0,32(sp) + 80019794: 75a2 ld a1,40(sp) + 80019796: 60a6 ld ra,72(sp) + 80019798: 6161 addi sp,sp,80 + 8001979a: 8082 ret + guard[inode.index].refs += 1; + 8001979c: 6522 ld a0,8(sp) + +000000008001979e <.LBB0_8>: + 8001979e: 00012617 auipc a2,0x12 + 800197a2: 31a60613 addi a2,a2,794 # 8002bab8 <.L__unnamed_1> + 800197a6: 03200593 li a1,50 + 800197aa: 0000a097 auipc ra,0xa + 800197ae: 9c6080e7 jalr -1594(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +00000000800197b4 <.LBB0_9>: + 800197b4: 00012517 auipc a0,0x12 + 800197b8: 31c50513 addi a0,a0,796 # 8002bad0 + +00000000800197bc <.LBB0_10>: + 800197bc: 00012617 auipc a2,0x12 + 800197c0: 2fc60613 addi a2,a2,764 # 8002bab8 <.L__unnamed_1> + 800197c4: 45f1 li a1,28 + 800197c6: 0000a097 auipc ra,0xa + 800197ca: 97e080e7 jalr -1666(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE: + +00000000800197d0 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE>: + fn put(&self, inode: &mut Inode) { + 800197d0: 7129 addi sp,sp,-320 + 800197d2: fe06 sd ra,312(sp) + 800197d4: e12e sd a1,128(sp) + 800197d6: e52a sd a0,136(sp) + 800197d8: e62a sd a0,264(sp) + 800197da: ea2e sd a1,272(sp) + let mut guard = self.meta.acquire(); + 800197dc: ffff7097 auipc ra,0xffff7 + 800197e0: 6a6080e7 jalr 1702(ra) # 80010e82 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E> + 800197e4: ed2a sd a0,152(sp) + 800197e6: a009 j 800197e8 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x18> + let i = inode.index; + 800197e8: 650a ld a0,128(sp) + 800197ea: 6108 ld a0,0(a0) + 800197ec: f8aa sd a0,112(sp) + 800197ee: ee2a sd a0,280(sp) + 800197f0: 0928 addi a0,sp,152 + let imeta = &mut guard[i]; + 800197f2: ffff8097 auipc ra,0xffff8 + 800197f6: 60a080e7 jalr 1546(ra) # 80011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E> + 800197fa: fcaa sd a0,120(sp) + 800197fc: a009 j 800197fe <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x2e> + 800197fe: 75c6 ld a1,112(sp) + 80019800: 03100513 li a0,49 + 80019804: 22b56d63 bltu a0,a1,80019a3e <.LBB1_46+0x3c> + 80019808: a009 j 8001980a <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x3a> + 8001980a: 7566 ld a0,120(sp) + 8001980c: 75c6 ld a1,112(sp) + 8001980e: 4661 li a2,24 + 80019810: 02c585b3 mul a1,a1,a2 + 80019814: 952e add a0,a0,a1 + 80019816: f4aa sd a0,104(sp) + 80019818: f22a sd a0,288(sp) + if imeta.refs == 1 { + 8001981a: 6108 ld a0,0(a0) + 8001981c: 4585 li a1,1 + 8001981e: 00b51963 bne a0,a1,80019830 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x60> + 80019822: a009 j 80019824 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x54> + 80019824: 7546 ld a0,112(sp) + 80019826: 03200593 li a1,50 + let mut idata = self.data[i].lock(); + 8001982a: 00b56b63 bltu a0,a1,80019840 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x70> + 8001982e: a499 j 80019a74 <.LBB1_49+0x16> + imeta.refs -= 1; + 80019830: 7526 ld a0,104(sp) + 80019832: 6108 ld a0,0(a0) + 80019834: fff50593 addi a1,a0,-1 + 80019838: f0ae sd a1,96(sp) + 8001983a: 20b56e63 bltu a0,a1,80019a56 <.LBB1_48> + 8001983e: a2dd j 80019a24 <.LBB1_46+0x22> + let mut idata = self.data[i].lock(); + 80019840: 652a ld a0,136(sp) + 80019842: 75c6 ld a1,112(sp) + 80019844: 059e slli a1,a1,0x7 + 80019846: 952e add a0,a0,a1 + 80019848: 4d050513 addi a0,a0,1232 + 8001984c: 00005097 auipc ra,0x5 + 80019850: 9b8080e7 jalr -1608(ra) # 8001e204 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE> + 80019854: f12a sd a0,160(sp) + 80019856: f52e sd a1,168(sp) + 80019858: a009 j 8001985a <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x8a> + 8001985a: 1108 addi a0,sp,160 + if !idata.valid || idata.dinode.nlink > 0 { + 8001985c: 00005097 auipc ra,0x5 + 80019860: c36080e7 jalr -970(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80019864: ecaa sd a0,88(sp) + 80019866: a02d j 80019890 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xc0> + 80019868: 4505 li a0,1 + 8001986a: 0aa10aa3 sb a0,181(sp) + 8001986e: a821 j 80019886 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xb6> + 80019870: 4501 li a0,0 + 80019872: 0aa10aa3 sb a0,181(sp) + 80019876: a801 j 80019886 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xb6> + 80019878: 1108 addi a0,sp,160 + 8001987a: 00005097 auipc ra,0x5 + 8001987e: c18080e7 jalr -1000(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80019882: e8aa sd a0,80(sp) + 80019884: a831 j 800198a0 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xd0> + 80019886: 0b514503 lbu a0,181(sp) + 8001988a: 8905 andi a0,a0,1 + 8001988c: e10d bnez a0,800198ae <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xde> + 8001988e: a03d j 800198bc <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xec> + 80019890: 6566 ld a0,88(sp) + 80019892: 04854503 lbu a0,72(a0) + 80019896: 8905 andi a0,a0,1 + 80019898: 4581 li a1,0 + 8001989a: fcb507e3 beq a0,a1,80019868 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x98> + 8001989e: bfe9 j 80019878 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xa8> + 800198a0: 6546 ld a0,80(sp) + 800198a2: 00e51583 lh a1,14(a0) + 800198a6: 4501 li a0,0 + 800198a8: fcb540e3 blt a0,a1,80019868 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x98> + 800198ac: b7d1 j 80019870 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xa0> + 800198ae: 1108 addi a0,sp,160 + idata.valid = false; + 800198b0: 00005097 auipc ra,0x5 + 800198b4: bf6080e7 jalr -1034(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 800198b8: e4aa sd a0,72(sp) + 800198ba: a039 j 800198c8 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0xf8> + drop(guard); + 800198bc: 656a ld a0,152(sp) + 800198be: 00004097 auipc ra,0x4 + 800198c2: 542080e7 jalr 1346(ra) # 8001de00 <_ZN4core3mem4drop17h2d4fb87a733eb04aE> + 800198c6: a835 j 80019902 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x132> + 800198c8: 65a6 ld a1,72(sp) + 800198ca: 4501 li a0,0 + idata.valid = false; + 800198cc: 04a58423 sb a0,72(a1) + drop(idata); + 800198d0: 750a ld a0,160(sp) + 800198d2: 75aa ld a1,168(sp) + 800198d4: 00004097 auipc ra,0x4 + 800198d8: 566080e7 jalr 1382(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 800198dc: a009 j 800198de <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x10e> + imeta.refs -= 1; + 800198de: 7526 ld a0,104(sp) + 800198e0: 6108 ld a0,0(a0) + 800198e2: fff50593 addi a1,a0,-1 + 800198e6: e0ae sd a1,64(sp) + 800198e8: 1ab56263 bltu a0,a1,80019a8c <.LBB1_51> + 800198ec: a009 j 800198ee <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x11e> + 800198ee: 6506 ld a0,64(sp) + 800198f0: 75a6 ld a1,104(sp) + 800198f2: e188 sd a0,0(a1) + drop(guard); + 800198f4: 656a ld a0,152(sp) + 800198f6: 00004097 auipc ra,0x4 + 800198fa: 50a080e7 jalr 1290(ra) # 8001de00 <_ZN4core3mem4drop17h2d4fb87a733eb04aE> + 800198fe: a009 j 80019900 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x130> + if !idata.valid || idata.dinode.nlink > 0 { + 80019900: aa25 j 80019a38 <.LBB1_46+0x36> + 80019902: 4501 li a0,0 + idata.dinode.itype = InodeType::Empty; + 80019904: 0aa11b23 sh a0,182(sp) + 80019908: 1108 addi a0,sp,160 + 8001990a: 00005097 auipc ra,0x5 + 8001990e: b9c080e7 jalr -1124(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80019912: fc2a sd a0,56(sp) + 80019914: a009 j 80019916 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x146> + 80019916: 75e2 ld a1,56(sp) + 80019918: 0b611503 lh a0,182(sp) + 8001991c: 00a59423 sh a0,8(a1) + 80019920: 1108 addi a0,sp,160 + idata.truncate(inode); + 80019922: 00005097 auipc ra,0x5 + 80019926: b84080e7 jalr -1148(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001992a: f82a sd a0,48(sp) + 8001992c: a009 j 8001992e <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x15e> + 8001992e: 658a ld a1,128(sp) + 80019930: 7542 ld a0,48(sp) + 80019932: 00001097 auipc ra,0x1 + 80019936: 1be080e7 jalr 446(ra) # 8001aaf0 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E> + 8001993a: a009 j 8001993c <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x16c> + 8001993c: 1108 addi a0,sp,160 + idata.valid = false; + 8001993e: 00005097 auipc ra,0x5 + 80019942: b68080e7 jalr -1176(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 80019946: f42a sd a0,40(sp) + 80019948: a009 j 8001994a <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x17a> + 8001994a: 75a2 ld a1,40(sp) + 8001994c: 4501 li a0,0 + 8001994e: 04a58423 sb a0,72(a1) + drop(idata); + 80019952: 750a ld a0,160(sp) + 80019954: 75aa ld a1,168(sp) + 80019956: 00004097 auipc ra,0x4 + 8001995a: 4e4080e7 jalr 1252(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001995e: a009 j 80019960 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x190> + let mut guard = self.meta.acquire(); + 80019960: 652a ld a0,136(sp) + 80019962: ffff7097 auipc ra,0xffff7 + 80019966: 520080e7 jalr 1312(ra) # 80010e82 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E> + 8001996a: fd2a sd a0,184(sp) + 8001996c: a009 j 8001996e <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x19e> + 8001996e: 1928 addi a0,sp,184 + guard[i].refs -= 1; + 80019970: ffff8097 auipc ra,0xffff8 + 80019974: 48c080e7 jalr 1164(ra) # 80011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E> + 80019978: f02a sd a0,32(sp) + 8001997a: a009 j 8001997c <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x1ac> + 8001997c: 75c6 ld a1,112(sp) + 8001997e: 03100513 li a0,49 + 80019982: 12b56463 bltu a0,a1,80019aaa <.LBB1_52+0x16> + 80019986: a009 j 80019988 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x1b8> + 80019988: 7502 ld a0,32(sp) + 8001998a: 75c6 ld a1,112(sp) + 8001998c: 4661 li a2,24 + 8001998e: 02c585b3 mul a1,a1,a2 + 80019992: 952e add a0,a0,a1 + 80019994: 6108 ld a0,0(a0) + 80019996: fff50593 addi a1,a0,-1 + 8001999a: ec2e sd a1,24(sp) + 8001999c: 12b56363 bltu a0,a1,80019ac2 <.LBB1_54> + 800199a0: a009 j 800199a2 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x1d2> + 800199a2: 6562 ld a0,24(sp) + 800199a4: 7582 ld a1,32(sp) + 800199a6: 7646 ld a2,112(sp) + 800199a8: 46e1 li a3,24 + 800199aa: 02d60633 mul a2,a2,a3 + 800199ae: 95b2 add a1,a1,a2 + 800199b0: e188 sd a0,0(a1) + 800199b2: 1928 addi a0,sp,184 + debug_assert_eq!(guard[i].refs, 0); + 800199b4: ffff8097 auipc ra,0xffff8 + 800199b8: 2ec080e7 jalr 748(ra) # 80011ca0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E> + 800199bc: e82a sd a0,16(sp) + 800199be: a009 j 800199c0 <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x1f0> + 800199c0: 75c6 ld a1,112(sp) + 800199c2: 03100513 li a0,49 + 800199c6: 10b56d63 bltu a0,a1,80019ae0 <.LBB1_55+0x16> + 800199ca: a009 j 800199cc <_ZN6kernel2fs5inode10InodeCache3put17h6f6d30d75181876bE+0x1fc> + 800199cc: 6542 ld a0,16(sp) + 800199ce: 75c6 ld a1,112(sp) + 800199d0: 4661 li a2,24 + 800199d2: 02c585b3 mul a1,a1,a2 + 800199d6: 952e add a0,a0,a1 + 800199d8: e02a sd a0,0(sp) + 800199da: e1aa sd a0,192(sp) + +00000000800199dc <.LBB1_45>: + 800199dc: 0000e597 auipc a1,0xe + 800199e0: e7c58593 addi a1,a1,-388 # 80027858 <.L__unnamed_6+0xc8> + 800199e4: e42e sd a1,8(sp) + 800199e6: e5ae sd a1,200(sp) + 800199e8: f62a sd a0,296(sp) + 800199ea: fa2e sd a1,304(sp) + 800199ec: 6108 ld a0,0(a0) + 800199ee: 4581 li a1,0 + 800199f0: 02b50363 beq a0,a1,80019a16 <.LBB1_46+0x14> + 800199f4: a009 j 800199f6 <.LBB1_45+0x1a> + 800199f6: 6622 ld a2,8(sp) + 800199f8: 6582 ld a1,0(sp) + 800199fa: 4501 li a0,0 + 800199fc: 0ca10ba3 sb a0,215(sp) + 80019a00: edaa sd a0,216(sp) + +0000000080019a02 <.LBB1_46>: + 80019a02: 00012717 auipc a4,0x12 + 80019a06: 1a670713 addi a4,a4,422 # 8002bba8 <.L__unnamed_3> + 80019a0a: 09b4 addi a3,sp,216 + 80019a0c: 00007097 auipc ra,0x7 + 80019a10: e66080e7 jalr -410(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 80019a14: 0000 unimp + drop(guard); + 80019a16: 756a ld a0,184(sp) + 80019a18: 00004097 auipc ra,0x4 + 80019a1c: 3e8080e7 jalr 1000(ra) # 8001de00 <_ZN4core3mem4drop17h2d4fb87a733eb04aE> + 80019a20: a009 j 80019a22 <.LBB1_46+0x20> + if !idata.valid || idata.dinode.nlink > 0 { + 80019a22: a819 j 80019a38 <.LBB1_46+0x36> + imeta.refs -= 1; + 80019a24: 7506 ld a0,96(sp) + 80019a26: 75a6 ld a1,104(sp) + 80019a28: e188 sd a0,0(a1) + drop(guard); + 80019a2a: 656a ld a0,152(sp) + 80019a2c: 00004097 auipc ra,0x4 + 80019a30: 3d4080e7 jalr 980(ra) # 8001de00 <_ZN4core3mem4drop17h2d4fb87a733eb04aE> + 80019a34: a009 j 80019a36 <.LBB1_46+0x34> + if imeta.refs == 1 { + 80019a36: a009 j 80019a38 <.LBB1_46+0x36> + } + 80019a38: 70f2 ld ra,312(sp) + 80019a3a: 6131 addi sp,sp,320 + 80019a3c: 8082 ret + let imeta = &mut guard[i]; + 80019a3e: 7546 ld a0,112(sp) + +0000000080019a40 <.LBB1_47>: + 80019a40: 00012617 auipc a2,0x12 + 80019a44: 0b060613 addi a2,a2,176 # 8002baf0 <.L__unnamed_4> + 80019a48: 03200593 li a1,50 + 80019a4c: 00009097 auipc ra,0x9 + 80019a50: 724080e7 jalr 1828(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080019a56 <.LBB1_48>: + imeta.refs -= 1; + 80019a56: 00012517 auipc a0,0x12 + 80019a5a: 0ca50513 addi a0,a0,202 # 8002bb20 + +0000000080019a5e <.LBB1_49>: + 80019a5e: 00012617 auipc a2,0x12 + 80019a62: 0aa60613 addi a2,a2,170 # 8002bb08 <.L__unnamed_5> + 80019a66: 02100593 li a1,33 + 80019a6a: 00009097 auipc ra,0x9 + 80019a6e: 6da080e7 jalr 1754(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80019a72: 0000 unimp + let mut idata = self.data[i].lock(); + 80019a74: 7546 ld a0,112(sp) + +0000000080019a76 <.LBB1_50>: + 80019a76: 00012617 auipc a2,0x12 + 80019a7a: 0d260613 addi a2,a2,210 # 8002bb48 <.L__unnamed_6> + 80019a7e: 03200593 li a1,50 + 80019a82: 00009097 auipc ra,0x9 + 80019a86: 6ee080e7 jalr 1774(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080019a8c <.LBB1_51>: + imeta.refs -= 1; + 80019a8c: 00012517 auipc a0,0x12 + 80019a90: 09450513 addi a0,a0,148 # 8002bb20 + +0000000080019a94 <.LBB1_52>: + 80019a94: 00012617 auipc a2,0x12 + 80019a98: 0cc60613 addi a2,a2,204 # 8002bb60 <.L__unnamed_7> + 80019a9c: 02100593 li a1,33 + 80019aa0: 00009097 auipc ra,0x9 + 80019aa4: 6a4080e7 jalr 1700(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80019aa8: 0000 unimp + guard[i].refs -= 1; + 80019aaa: 7546 ld a0,112(sp) + +0000000080019aac <.LBB1_53>: + 80019aac: 00012617 auipc a2,0x12 + 80019ab0: 0cc60613 addi a2,a2,204 # 8002bb78 <.L__unnamed_8> + 80019ab4: 03200593 li a1,50 + 80019ab8: 00009097 auipc ra,0x9 + 80019abc: 6b8080e7 jalr 1720(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080019ac2 <.LBB1_54>: + 80019ac2: 00012517 auipc a0,0x12 + 80019ac6: 05e50513 addi a0,a0,94 # 8002bb20 + +0000000080019aca <.LBB1_55>: + 80019aca: 00012617 auipc a2,0x12 + 80019ace: 0ae60613 addi a2,a2,174 # 8002bb78 <.L__unnamed_8> + 80019ad2: 02100593 li a1,33 + 80019ad6: 00009097 auipc ra,0x9 + 80019ada: 66e080e7 jalr 1646(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80019ade: 0000 unimp + debug_assert_eq!(guard[i].refs, 0); + 80019ae0: 7546 ld a0,112(sp) + +0000000080019ae2 <.LBB1_56>: + 80019ae2: 00012617 auipc a2,0x12 + 80019ae6: 0ae60613 addi a2,a2,174 # 8002bb90 <.L__unnamed_9> + 80019aea: 03200593 li a1,50 + 80019aee: 00009097 auipc ra,0x9 + 80019af2: 682080e7 jalr 1666(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E: + +0000000080019af8 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E>: + fn get(&self, dev: u32, inum: u32) -> Inode { + 80019af8: 714d addi sp,sp,-336 + 80019afa: e686 sd ra,328(sp) + 80019afc: fcaa sd a0,120(sp) + 80019afe: 86b2 mv a3,a2 + 80019b00: e136 sd a3,128(sp) + 80019b02: 86ae mv a3,a1 + 80019b04: e536 sd a3,136(sp) + 80019b06: ea2a sd a0,272(sp) + 80019b08: 10b12c23 sw a1,280(sp) + 80019b0c: 10c12e23 sw a2,284(sp) + let mut guard = self.meta.acquire(); + 80019b10: ffff7097 auipc ra,0xffff7 + 80019b14: 372080e7 jalr 882(ra) # 80010e82 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h702266ebf2d4d383E> + 80019b18: f12a sd a0,160(sp) + 80019b1a: a009 j 80019b1c <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x24> + 80019b1c: 4501 li a0,0 + let mut empty_i: Option = None; + 80019b1e: f52a sd a0,168(sp) + for i in 0..NINODE { + 80019b20: fd2a sd a0,184(sp) + 80019b22: 03200593 li a1,50 + 80019b26: e1ae sd a1,192(sp) + 80019b28: 00007097 auipc ra,0x7 + 80019b2c: ce8080e7 jalr -792(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80019b30: f4aa sd a0,104(sp) + 80019b32: f8ae sd a1,112(sp) + 80019b34: a009 j 80019b36 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x3e> + 80019b36: 7546 ld a0,112(sp) + 80019b38: 75a6 ld a1,104(sp) + 80019b3a: e5ae sd a1,200(sp) + 80019b3c: e9aa sd a0,208(sp) + 80019b3e: a009 j 80019b40 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x48> + 80019b40: 01a8 addi a0,sp,200 + 80019b42: 00007097 auipc ra,0x7 + 80019b46: c60080e7 jalr -928(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80019b4a: edaa sd a0,216(sp) + 80019b4c: f1ae sd a1,224(sp) + 80019b4e: a009 j 80019b50 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x58> + 80019b50: 656e ld a0,216(sp) + 80019b52: 4581 li a1,0 + 80019b54: 00b50463 beq a0,a1,80019b5c <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x64> + 80019b58: a009 j 80019b5a <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x62> + 80019b5a: a801 j 80019b6a <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x72> + Some(i) => i, + 80019b5c: 752a ld a0,168(sp) + 80019b5e: 4581 li a1,0 + 80019b60: 1ab50363 beq a0,a1,80019d06 <.LBB2_65> + 80019b64: a009 j 80019b66 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x6e> + 80019b66: aa7d j 80019d24 <.LBB2_66+0x16> + for i in 0..NINODE { + 80019b68: 0000 unimp + 80019b6a: 750e ld a0,224(sp) + 80019b6c: ecaa sd a0,88(sp) + 80019b6e: f22a sd a0,288(sp) + 80019b70: f62a sd a0,296(sp) + 80019b72: fa2a sd a0,304(sp) + 80019b74: 1108 addi a0,sp,160 + if guard[i].inum == inum && guard[i].refs > 0 && guard[i].dev == dev { + 80019b76: ffff8097 auipc ra,0xffff8 + 80019b7a: 12a080e7 jalr 298(ra) # 80011ca0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E> + 80019b7e: f0aa sd a0,96(sp) + 80019b80: a889 j 80019bd2 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xda> + 80019b82: 4505 li a0,1 + 80019b84: 0ea106a3 sb a0,237(sp) + 80019b88: a821 j 80019ba0 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xa8> + 80019b8a: 4501 li a0,0 + 80019b8c: 0ea106a3 sb a0,237(sp) + 80019b90: a801 j 80019ba0 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xa8> + 80019b92: 1108 addi a0,sp,160 + 80019b94: ffff8097 auipc ra,0xffff8 + 80019b98: 10c080e7 jalr 268(ra) # 80011ca0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E> + 80019b9c: e8aa sd a0,80(sp) + 80019b9e: a8ad j 80019c18 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x120> + 80019ba0: 0ed14503 lbu a0,237(sp) + 80019ba4: 8905 andi a0,a0,1 + 80019ba6: e959 bnez a0,80019c3c <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x144> + 80019ba8: a04d j 80019c4a <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x152> + 80019baa: 4505 li a0,1 + 80019bac: 0ea10723 sb a0,238(sp) + 80019bb0: a821 j 80019bc8 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xd0> + 80019bb2: 4501 li a0,0 + 80019bb4: 0ea10723 sb a0,238(sp) + 80019bb8: a801 j 80019bc8 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xd0> + 80019bba: 1108 addi a0,sp,160 + 80019bbc: ffff8097 auipc ra,0xffff8 + 80019bc0: 0e4080e7 jalr 228(ra) # 80011ca0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E> + 80019bc4: e4aa sd a0,72(sp) + 80019bc6: a805 j 80019bf6 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xfe> + 80019bc8: 0ee14503 lbu a0,238(sp) + 80019bcc: 8905 andi a0,a0,1 + 80019bce: f171 bnez a0,80019b92 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x9a> + 80019bd0: bf6d j 80019b8a <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x92> + 80019bd2: 65e6 ld a1,88(sp) + 80019bd4: 03100513 li a0,49 + 80019bd8: 24b56f63 bltu a0,a1,80019e36 <.LBB2_68+0x42> + 80019bdc: a009 j 80019bde <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xe6> + 80019bde: 658a ld a1,128(sp) + 80019be0: 7506 ld a0,96(sp) + 80019be2: 6666 ld a2,88(sp) + 80019be4: 46e1 li a3,24 + 80019be6: 02d60633 mul a2,a2,a3 + 80019bea: 9532 add a0,a0,a2 + 80019bec: 4908 lw a0,16(a0) + 80019bee: 2581 sext.w a1,a1 + 80019bf0: fcb505e3 beq a0,a1,80019bba <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xc2> + 80019bf4: bf7d j 80019bb2 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xba> + 80019bf6: 65e6 ld a1,88(sp) + 80019bf8: 03100513 li a0,49 + 80019bfc: 24b56963 bltu a0,a1,80019e4e <.LBB2_69+0x16> + 80019c00: a009 j 80019c02 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x10a> + 80019c02: 6526 ld a0,72(sp) + 80019c04: 65e6 ld a1,88(sp) + 80019c06: 4661 li a2,24 + 80019c08: 02c585b3 mul a1,a1,a2 + 80019c0c: 952e add a0,a0,a1 + 80019c0e: 6108 ld a0,0(a0) + 80019c10: 4581 li a1,0 + 80019c12: f8b51ce3 bne a0,a1,80019baa <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xb2> + 80019c16: bf71 j 80019bb2 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0xba> + 80019c18: 65e6 ld a1,88(sp) + 80019c1a: 03100513 li a0,49 + 80019c1e: 24b56463 bltu a0,a1,80019e66 <.LBB2_70+0x16> + 80019c22: a009 j 80019c24 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x12c> + 80019c24: 65aa ld a1,136(sp) + 80019c26: 6546 ld a0,80(sp) + 80019c28: 6666 ld a2,88(sp) + 80019c2a: 46e1 li a3,24 + 80019c2c: 02d60633 mul a2,a2,a3 + 80019c30: 9532 add a0,a0,a2 + 80019c32: 4508 lw a0,8(a0) + 80019c34: 2581 sext.w a1,a1 + 80019c36: f4b506e3 beq a0,a1,80019b82 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x8a> + 80019c3a: bf81 j 80019b8a <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x92> + 80019c3c: 1108 addi a0,sp,160 + guard[i].refs += 1; + 80019c3e: ffff8097 auipc ra,0xffff8 + 80019c42: 1be080e7 jalr 446(ra) # 80011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E> + 80019c46: e0aa sd a0,64(sp) + 80019c48: a801 j 80019c58 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x160> + 80019c4a: 1128 addi a0,sp,168 + if empty_i.is_none() && guard[i].refs == 0 { + 80019c4c: ffff6097 auipc ra,0xffff6 + 80019c50: c56080e7 jalr -938(ra) # 8000f8a2 <_ZN4core6option15Option$LT$T$GT$7is_none17hbfc07de6cbdc4f1cE> + 80019c54: fc2a sd a0,56(sp) + 80019c56: a89d j 80019ccc <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1d4> + 80019c58: 65e6 ld a1,88(sp) + 80019c5a: 03100513 li a0,49 + guard[i].refs += 1; + 80019c5e: 22b56063 bltu a0,a1,80019e7e <.LBB2_71+0x16> + 80019c62: a009 j 80019c64 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x16c> + 80019c64: 6506 ld a0,64(sp) + 80019c66: 65e6 ld a1,88(sp) + 80019c68: 4661 li a2,24 + 80019c6a: 02c585b3 mul a1,a1,a2 + 80019c6e: 952e add a0,a0,a1 + 80019c70: 610c ld a1,0(a0) + 80019c72: 00158513 addi a0,a1,1 + 80019c76: f82a sd a0,48(sp) + 80019c78: 20b56f63 bltu a0,a1,80019e96 <.LBB2_73> + 80019c7c: a009 j 80019c7e <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x186> + 80019c7e: 6566 ld a0,88(sp) + 80019c80: 658a ld a1,128(sp) + 80019c82: 662a ld a2,136(sp) + 80019c84: 76c2 ld a3,48(sp) + 80019c86: 6706 ld a4,64(sp) + 80019c88: 47e1 li a5,24 + 80019c8a: 02f507b3 mul a5,a0,a5 + 80019c8e: 973e add a4,a4,a5 + 80019c90: e314 sd a3,0(a4) + return Inode { + 80019c92: cd32 sw a2,152(sp) + 80019c94: cf2e sw a1,156(sp) + 80019c96: e92a sd a0,144(sp) + 80019c98: 1108 addi a0,sp,160 + } + 80019c9a: fffed097 auipc ra,0xfffed + 80019c9e: 2c0080e7 jalr 704(ra) # 80006f5a <_ZN4core3ptr116drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$u5b$kernel..fs..inode..InodeMeta$u3b$$u20$50$u5d$$GT$$GT$17h4e8573cf3b362114E> + 80019ca2: a269 j 80019e2c <.LBB2_68+0x38> + 80019ca4: 4505 li a0,1 + if empty_i.is_none() && guard[i].refs == 0 { + 80019ca6: 0ea107a3 sb a0,239(sp) + 80019caa: a821 j 80019cc2 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1ca> + 80019cac: 4501 li a0,0 + 80019cae: 0ea107a3 sb a0,239(sp) + 80019cb2: a801 j 80019cc2 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1ca> + 80019cb4: 1108 addi a0,sp,160 + 80019cb6: ffff8097 auipc ra,0xffff8 + 80019cba: fea080e7 jalr -22(ra) # 80011ca0 <_ZN90_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h2948b75da44fd3f4E> + 80019cbe: f42a sd a0,40(sp) + 80019cc0: a809 j 80019cd2 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1da> + 80019cc2: 0ef14503 lbu a0,239(sp) + 80019cc6: 8905 andi a0,a0,1 + 80019cc8: e515 bnez a0,80019cf4 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1fc> + 80019cca: a825 j 80019d02 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x20a> + 80019ccc: 7562 ld a0,56(sp) + 80019cce: f17d bnez a0,80019cb4 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1bc> + 80019cd0: bff1 j 80019cac <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1b4> + 80019cd2: 65e6 ld a1,88(sp) + 80019cd4: 03100513 li a0,49 + 80019cd8: 1cb56d63 bltu a0,a1,80019eb2 <.LBB2_74+0x14> + 80019cdc: a009 j 80019cde <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1e6> + 80019cde: 7522 ld a0,40(sp) + 80019ce0: 65e6 ld a1,88(sp) + 80019ce2: 4661 li a2,24 + 80019ce4: 02c585b3 mul a1,a1,a2 + 80019ce8: 952e add a0,a0,a1 + 80019cea: 6108 ld a0,0(a0) + 80019cec: 4581 li a1,0 + 80019cee: fab50be3 beq a0,a1,80019ca4 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1ac> + 80019cf2: bf6d j 80019cac <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x1b4> + empty_i = Some(i); + 80019cf4: 6566 ld a0,88(sp) + 80019cf6: fdaa sd a0,248(sp) + 80019cf8: 4585 li a1,1 + 80019cfa: f9ae sd a1,240(sp) + 80019cfc: f52e sd a1,168(sp) + 80019cfe: f92a sd a0,176(sp) + if empty_i.is_none() && guard[i].refs == 0 { + 80019d00: a011 j 80019d04 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x20c> + 80019d02: a009 j 80019d04 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x20c> + for i in 0..NINODE { + 80019d04: bd35 j 80019b40 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E+0x48> + +0000000080019d06 <.LBB2_65>: + None => panic!("inode: not enough"), + 80019d06: 00012517 auipc a0,0x12 + 80019d0a: fca50513 addi a0,a0,-54 # 8002bcd0 <.L__unnamed_10> + +0000000080019d0e <.LBB2_66>: + 80019d0e: 00012617 auipc a2,0x12 + 80019d12: fda60613 addi a2,a2,-38 # 8002bce8 <.L__unnamed_11> + 80019d16: 45c5 li a1,17 + 80019d18: 00009097 auipc ra,0x9 + 80019d1c: 42c080e7 jalr 1068(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80019d20: 0000 unimp + let empty_i = match empty_i { + 80019d22: 0000 unimp + Some(i) => i, + 80019d24: 754a ld a0,176(sp) + 80019d26: ec2a sd a0,24(sp) + 80019d28: fe2a sd a0,312(sp) + 80019d2a: e2aa sd a0,320(sp) + 80019d2c: 1108 addi a0,sp,160 + guard[empty_i].dev = dev; + 80019d2e: ffff8097 auipc ra,0xffff8 + 80019d32: 0ce080e7 jalr 206(ra) # 80011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E> + 80019d36: f02a sd a0,32(sp) + 80019d38: a009 j 80019d3a <.LBB2_66+0x2c> + 80019d3a: 65e2 ld a1,24(sp) + 80019d3c: 03100513 li a0,49 + 80019d40: 18b56563 bltu a0,a1,80019eca <.LBB2_75+0x16> + 80019d44: a009 j 80019d46 <.LBB2_66+0x38> + 80019d46: 652a ld a0,136(sp) + 80019d48: 7582 ld a1,32(sp) + 80019d4a: 6662 ld a2,24(sp) + 80019d4c: 46e1 li a3,24 + 80019d4e: 02d60633 mul a2,a2,a3 + 80019d52: 95b2 add a1,a1,a2 + 80019d54: c588 sw a0,8(a1) + 80019d56: 1108 addi a0,sp,160 + guard[empty_i].inum = inum; + 80019d58: ffff8097 auipc ra,0xffff8 + 80019d5c: 0a4080e7 jalr 164(ra) # 80011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E> + 80019d60: e82a sd a0,16(sp) + 80019d62: a009 j 80019d64 <.LBB2_66+0x56> + 80019d64: 65e2 ld a1,24(sp) + 80019d66: 03100513 li a0,49 + 80019d6a: 16b56c63 bltu a0,a1,80019ee2 <.LBB2_76+0x16> + 80019d6e: a009 j 80019d70 <.LBB2_66+0x62> + 80019d70: 650a ld a0,128(sp) + 80019d72: 65c2 ld a1,16(sp) + 80019d74: 6662 ld a2,24(sp) + 80019d76: 46e1 li a3,24 + 80019d78: 02d60633 mul a2,a2,a3 + 80019d7c: 95b2 add a1,a1,a2 + 80019d7e: c988 sw a0,16(a1) + 80019d80: 1108 addi a0,sp,160 + guard[empty_i].refs = 1; + 80019d82: ffff8097 auipc ra,0xffff8 + 80019d86: 07a080e7 jalr 122(ra) # 80011dfc <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h7113684d7590c345E> + 80019d8a: e42a sd a0,8(sp) + 80019d8c: a009 j 80019d8e <.LBB2_66+0x80> + 80019d8e: 65e2 ld a1,24(sp) + 80019d90: 03100513 li a0,49 + 80019d94: 16b56363 bltu a0,a1,80019efa <.LBB2_77+0x16> + 80019d98: a009 j 80019d9a <.LBB2_66+0x8c> + 80019d9a: 65e2 ld a1,24(sp) + 80019d9c: 6522 ld a0,8(sp) + 80019d9e: 4661 li a2,24 + 80019da0: 02c58633 mul a2,a1,a2 + 80019da4: 962a add a2,a2,a0 + 80019da6: 4505 li a0,1 + 80019da8: e208 sd a0,0(a2) + 80019daa: 03100513 li a0,49 + let idata = self.data[empty_i].lock(); + 80019dae: 16b56263 bltu a0,a1,80019f12 <.LBB2_78+0x16> + 80019db2: a009 j 80019db4 <.LBB2_66+0xa6> + 80019db4: 7566 ld a0,120(sp) + 80019db6: 65e2 ld a1,24(sp) + 80019db8: 059e slli a1,a1,0x7 + 80019dba: 952e add a0,a0,a1 + 80019dbc: 4d050513 addi a0,a0,1232 + 80019dc0: 00004097 auipc ra,0x4 + 80019dc4: 444080e7 jalr 1092(ra) # 8001e204 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE> + 80019dc8: e22a sd a0,256(sp) + 80019dca: e62e sd a1,264(sp) + 80019dcc: a009 j 80019dce <.LBB2_66+0xc0> + 80019dce: 0208 addi a0,sp,256 + assert!(idata.valid == false, "此时 idata 应当无效"); + 80019dd0: 00004097 auipc ra,0x4 + 80019dd4: 6c2080e7 jalr 1730(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 80019dd8: e02a sd a0,0(sp) + 80019dda: a009 j 80019ddc <.LBB2_66+0xce> + 80019ddc: 6502 ld a0,0(sp) + 80019dde: 04854503 lbu a0,72(a0) + 80019de2: 8905 andi a0,a0,1 + 80019de4: 4581 li a1,0 + 80019de6: 02b50163 beq a0,a1,80019e08 <.LBB2_68+0x14> + 80019dea: a009 j 80019dec <.LBB2_67> + +0000000080019dec <.LBB2_67>: + 80019dec: 00012517 auipc a0,0x12 + 80019df0: eac50513 addi a0,a0,-340 # 8002bc98 <.L__unnamed_12> + +0000000080019df4 <.LBB2_68>: + 80019df4: 00012617 auipc a2,0x12 + 80019df8: ec460613 addi a2,a2,-316 # 8002bcb8 <.L__unnamed_13> + 80019dfc: 45e5 li a1,25 + 80019dfe: 00009097 auipc ra,0x9 + 80019e02: 346080e7 jalr 838(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80019e06: 0000 unimp + Inode { + 80019e08: 6562 ld a0,24(sp) + 80019e0a: 658a ld a1,128(sp) + 80019e0c: 662a ld a2,136(sp) + 80019e0e: cd32 sw a2,152(sp) + 80019e10: cf2e sw a1,156(sp) + 80019e12: e92a sd a0,144(sp) + 80019e14: 0208 addi a0,sp,256 + } + 80019e16: fffed097 auipc ra,0xfffed + 80019e1a: 424080e7 jalr 1060(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 80019e1e: a009 j 80019e20 <.LBB2_68+0x2c> + 80019e20: 1108 addi a0,sp,160 + 80019e22: fffed097 auipc ra,0xfffed + 80019e26: 138080e7 jalr 312(ra) # 80006f5a <_ZN4core3ptr116drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$u5b$kernel..fs..inode..InodeMeta$u3b$$u20$50$u5d$$GT$$GT$17h4e8573cf3b362114E> + 80019e2a: a009 j 80019e2c <.LBB2_68+0x38> + 80019e2c: 654a ld a0,144(sp) + 80019e2e: 65ea ld a1,152(sp) + 80019e30: 60b6 ld ra,328(sp) + 80019e32: 6171 addi sp,sp,336 + 80019e34: 8082 ret + if guard[i].inum == inum && guard[i].refs > 0 && guard[i].dev == dev { + 80019e36: 6566 ld a0,88(sp) + +0000000080019e38 <.LBB2_69>: + 80019e38: 00012617 auipc a2,0x12 + 80019e3c: d8860613 addi a2,a2,-632 # 8002bbc0 <.L__unnamed_14> + 80019e40: 03200593 li a1,50 + 80019e44: 00009097 auipc ra,0x9 + 80019e48: 32c080e7 jalr 812(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80019e4c: 0000 unimp + 80019e4e: 6566 ld a0,88(sp) + +0000000080019e50 <.LBB2_70>: + 80019e50: 00012617 auipc a2,0x12 + 80019e54: d8860613 addi a2,a2,-632 # 8002bbd8 <.L__unnamed_15> + 80019e58: 03200593 li a1,50 + 80019e5c: 00009097 auipc ra,0x9 + 80019e60: 314080e7 jalr 788(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80019e64: 0000 unimp + 80019e66: 6566 ld a0,88(sp) + +0000000080019e68 <.LBB2_71>: + 80019e68: 00012617 auipc a2,0x12 + 80019e6c: d8860613 addi a2,a2,-632 # 8002bbf0 <.L__unnamed_16> + 80019e70: 03200593 li a1,50 + 80019e74: 00009097 auipc ra,0x9 + 80019e78: 2fc080e7 jalr 764(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80019e7c: 0000 unimp + guard[i].refs += 1; + 80019e7e: 6566 ld a0,88(sp) + +0000000080019e80 <.LBB2_72>: + 80019e80: 00012617 auipc a2,0x12 + 80019e84: d8860613 addi a2,a2,-632 # 8002bc08 <.L__unnamed_17> + 80019e88: 03200593 li a1,50 + 80019e8c: 00009097 auipc ra,0x9 + 80019e90: 2e4080e7 jalr 740(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080019e96 <.LBB2_73>: + 80019e96: 00012517 auipc a0,0x12 + 80019e9a: c3a50513 addi a0,a0,-966 # 8002bad0 + +0000000080019e9e <.LBB2_74>: + 80019e9e: 00012617 auipc a2,0x12 + 80019ea2: d6a60613 addi a2,a2,-662 # 8002bc08 <.L__unnamed_17> + 80019ea6: 45f1 li a1,28 + 80019ea8: 00009097 auipc ra,0x9 + 80019eac: 29c080e7 jalr 668(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80019eb0: 0000 unimp + if empty_i.is_none() && guard[i].refs == 0 { + 80019eb2: 6566 ld a0,88(sp) + +0000000080019eb4 <.LBB2_75>: + 80019eb4: 00012617 auipc a2,0x12 + 80019eb8: d6c60613 addi a2,a2,-660 # 8002bc20 <.L__unnamed_18> + 80019ebc: 03200593 li a1,50 + 80019ec0: 00009097 auipc ra,0x9 + 80019ec4: 2b0080e7 jalr 688(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80019ec8: 0000 unimp + guard[empty_i].dev = dev; + 80019eca: 6562 ld a0,24(sp) + +0000000080019ecc <.LBB2_76>: + 80019ecc: 00012617 auipc a2,0x12 + 80019ed0: d6c60613 addi a2,a2,-660 # 8002bc38 <.L__unnamed_19> + 80019ed4: 03200593 li a1,50 + 80019ed8: 00009097 auipc ra,0x9 + 80019edc: 298080e7 jalr 664(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80019ee0: 0000 unimp + guard[empty_i].inum = inum; + 80019ee2: 6562 ld a0,24(sp) + +0000000080019ee4 <.LBB2_77>: + 80019ee4: 00012617 auipc a2,0x12 + 80019ee8: d6c60613 addi a2,a2,-660 # 8002bc50 <.L__unnamed_20> + 80019eec: 03200593 li a1,50 + 80019ef0: 00009097 auipc ra,0x9 + 80019ef4: 280080e7 jalr 640(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80019ef8: 0000 unimp + guard[empty_i].refs = 1; + 80019efa: 6562 ld a0,24(sp) + +0000000080019efc <.LBB2_78>: + 80019efc: 00012617 auipc a2,0x12 + 80019f00: d6c60613 addi a2,a2,-660 # 8002bc68 <.L__unnamed_21> + 80019f04: 03200593 li a1,50 + 80019f08: 00009097 auipc ra,0x9 + 80019f0c: 268080e7 jalr 616(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80019f10: 0000 unimp + let idata = self.data[empty_i].lock(); + 80019f12: 6562 ld a0,24(sp) + +0000000080019f14 <.LBB2_79>: + 80019f14: 00012617 auipc a2,0x12 + 80019f18: d6c60613 addi a2,a2,-660 # 8002bc80 <.L__unnamed_22> + 80019f1c: 03200593 li a1,50 + 80019f20: 00009097 auipc ra,0x9 + 80019f24: 250080e7 jalr 592(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs5inode10InodeCache5namex17h346d00a9a4ac3352E: + +0000000080019f2a <_ZN6kernel2fs5inode10InodeCache5namex17h346d00a9a4ac3352E>: + fn namex( + 80019f2a: 7121 addi sp,sp,-448 + 80019f2c: ff06 sd ra,440(sp) + 80019f2e: e8ba sd a4,80(sp) + 80019f30: ecb6 sd a3,88(sp) + 80019f32: f0b2 sd a2,96(sp) + 80019f34: f4ae sd a1,104(sp) + 80019f36: f8aa sd a0,112(sp) + 80019f38: 853e mv a0,a5 + 80019f3a: fcaa sd a0,120(sp) + 80019f3c: f2ae sd a1,352(sp) + 80019f3e: f6b2 sd a2,360(sp) + 80019f40: fab6 sd a3,368(sp) + 80019f42: feba sd a4,376(sp) + 80019f44: 18f103a3 sb a5,391(sp) + 80019f48: 4501 li a0,0 + let mut inode: Inode; + 80019f4a: 14a10fa3 sb a0,351(sp) + if path[0] == b'/' { + 80019f4e: 2aa68763 beq a3,a0,8001a1fc <.LBB3_56+0x98> + 80019f52: a009 j 80019f54 <_ZN6kernel2fs5inode10InodeCache5namex17h346d00a9a4ac3352E+0x2a> + 80019f54: 7506 ld a0,96(sp) + 80019f56: 00054503 lbu a0,0(a0) + 80019f5a: 02f00593 li a1,47 + 80019f5e: 00b51f63 bne a0,a1,80019f7c <.LBB3_51> + 80019f62: a009 j 80019f64 <_ZN6kernel2fs5inode10InodeCache5namex17h346d00a9a4ac3352E+0x3a> + inode = self.get(ROOTDEV, ROOTINUM); + 80019f64: 7526 ld a0,104(sp) + 80019f66: 4605 li a2,1 + 80019f68: 85b2 mv a1,a2 + 80019f6a: 00000097 auipc ra,0x0 + 80019f6e: b8e080e7 jalr -1138(ra) # 80019af8 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E> + 80019f72: f32a sd a0,416(sp) + 80019f74: f72e sd a1,424(sp) + 80019f76: e92a sd a0,144(sp) + 80019f78: ed2e sd a1,152(sp) + 80019f7a: a819 j 80019f90 <.LBB3_51+0x14> + +0000000080019f7c <.LBB3_51>: + let p = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80019f7c: 0004c517 auipc a0,0x4c + 80019f80: 1c450513 addi a0,a0,452 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 80019f84: ffff8097 auipc ra,0xffff8 + 80019f88: 4d4080e7 jalr 1236(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 80019f8c: e4aa sd a0,72(sp) + 80019f8e: a809 j 80019fa0 <.LBB3_51+0x24> + 80019f90: 4505 li a0,1 + inode = self.get(ROOTDEV, ROOTINUM); + 80019f92: 14a10fa3 sb a0,351(sp) + 80019f96: 654a ld a0,144(sp) + 80019f98: e12a sd a0,128(sp) + 80019f9a: 656a ld a0,152(sp) + 80019f9c: e52a sd a0,136(sp) + if path[0] == b'/' { + 80019f9e: a0a5 j 8001a006 <.LBB3_53+0x3a> + let p = unsafe { CPU_MANAGER.myproc().unwrap() }; + 80019fa0: 6526 ld a0,72(sp) + +0000000080019fa2 <.LBB3_52>: + 80019fa2: 00012597 auipc a1,0x12 + 80019fa6: d7658593 addi a1,a1,-650 # 8002bd18 <.L__unnamed_23> + 80019faa: ffff5097 auipc ra,0xffff5 + 80019fae: 7e6080e7 jalr 2022(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 80019fb2: e0aa sd a0,64(sp) + 80019fb4: a009 j 80019fb6 <.LBB3_52+0x14> + 80019fb6: 6506 ld a0,64(sp) + 80019fb8: e72a sd a0,392(sp) + inode = self.dup(p.cwd.as_ref().unwrap()); + 80019fba: 3c850513 addi a0,a0,968 + 80019fbe: ffff5097 auipc ra,0xffff5 + 80019fc2: 3e6080e7 jalr 998(ra) # 8000f3a4 <_ZN4core6option15Option$LT$T$GT$6as_ref17h883d1380e87d3449E> + 80019fc6: fc2a sd a0,56(sp) + 80019fc8: a009 j 80019fca <.LBB3_52+0x28> + 80019fca: 7562 ld a0,56(sp) + +0000000080019fcc <.LBB3_53>: + 80019fcc: 00012597 auipc a1,0x12 + 80019fd0: d6458593 addi a1,a1,-668 # 8002bd30 <.L__unnamed_24> + 80019fd4: ffff5097 auipc ra,0xffff5 + 80019fd8: 6e4080e7 jalr 1764(ra) # 8000f6b8 <_ZN4core6option15Option$LT$T$GT$6unwrap17h8e9f6f5582436d22E> + 80019fdc: f82a sd a0,48(sp) + 80019fde: a009 j 80019fe0 <.LBB3_53+0x14> + 80019fe0: 75c2 ld a1,48(sp) + 80019fe2: 7526 ld a0,104(sp) + 80019fe4: fffff097 auipc ra,0xfffff + 80019fe8: 73a080e7 jalr 1850(ra) # 8001971e <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E> + 80019fec: eb2a sd a0,400(sp) + 80019fee: ef2e sd a1,408(sp) + 80019ff0: f12a sd a0,160(sp) + 80019ff2: f52e sd a1,168(sp) + 80019ff4: a009 j 80019ff6 <.LBB3_53+0x2a> + 80019ff6: 4505 li a0,1 + 80019ff8: 14a10fa3 sb a0,351(sp) + 80019ffc: 750a ld a0,160(sp) + 80019ffe: e12a sd a0,128(sp) + 8001a000: 752a ld a0,168(sp) + 8001a002: e52a sd a0,136(sp) + if path[0] == b'/' { + 8001a004: a009 j 8001a006 <.LBB3_53+0x3a> + 8001a006: 4501 li a0,0 + let mut cur: usize = 0; + 8001a008: f92a sd a0,176(sp) + loop { + 8001a00a: a009 j 8001a00c <.LBB3_53+0x40> + cur = skip_path(path, cur, name); + 8001a00c: 66c6 ld a3,80(sp) + 8001a00e: 65e6 ld a1,88(sp) + 8001a010: 7506 ld a0,96(sp) + 8001a012: 764a ld a2,176(sp) + 8001a014: 00000097 auipc ra,0x0 + 8001a018: 7fa080e7 jalr 2042(ra) # 8001a80e <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE> + 8001a01c: f42a sd a0,40(sp) + 8001a01e: a009 j 8001a020 <.LBB3_53+0x54> + 8001a020: 7522 ld a0,40(sp) + 8001a022: f92a sd a0,176(sp) + 8001a024: 4581 li a1,0 + if cur == 0 { break; } + 8001a026: 00b51763 bne a0,a1,8001a034 <.LBB3_53+0x68> + 8001a02a: a009 j 8001a02c <.LBB3_53+0x60> + if is_parent { + 8001a02c: 7566 ld a0,120(sp) + 8001a02e: 12051763 bnez a0,8001a15c <.LBB3_55> + 8001a032: a2a9 j 8001a17c <.LBB3_56+0x18> + 8001a034: 0108 addi a0,sp,128 + let mut data_guard = inode.lock(); + 8001a036: 00002097 auipc ra,0x2 + 8001a03a: c36080e7 jalr -970(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 8001a03e: fd2a sd a0,184(sp) + 8001a040: e1ae sd a1,192(sp) + 8001a042: a009 j 8001a044 <.LBB3_53+0x78> + 8001a044: 1928 addi a0,sp,184 + if data_guard.dinode.itype != InodeType::Directory { + 8001a046: 00004097 auipc ra,0x4 + 8001a04a: 44c080e7 jalr 1100(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001a04e: f02a sd a0,32(sp) + 8001a050: a009 j 8001a052 <.LBB3_53+0x86> + 8001a052: 7502 ld a0,32(sp) + 8001a054: 0521 addi a0,a0,8 + +000000008001a056 <.LBB3_54>: + 8001a056: 00012597 auipc a1,0x12 + 8001a05a: cf258593 addi a1,a1,-782 # 8002bd48 <.L__unnamed_25> + 8001a05e: fffff097 auipc ra,0xfffff + 8001a062: 188080e7 jalr 392(ra) # 800191e6 <_ZN4core3cmp9PartialEq2ne17ha4fd141ed85850e3E> + 8001a066: ec2a sd a0,24(sp) + 8001a068: a009 j 8001a06a <.LBB3_54+0x14> + 8001a06a: 6562 ld a0,24(sp) + 8001a06c: 4581 li a1,0 + 8001a06e: 00b50a63 beq a0,a1,8001a082 <.LBB3_54+0x2c> + 8001a072: a009 j 8001a074 <.LBB3_54+0x1e> + drop(data_guard); + 8001a074: 756a ld a0,184(sp) + 8001a076: 658e ld a1,192(sp) + 8001a078: 00004097 auipc ra,0x4 + 8001a07c: dc2080e7 jalr -574(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a080: a021 j 8001a088 <.LBB3_54+0x32> + if is_parent && path[cur] == 0 { + 8001a082: 7566 ld a0,120(sp) + 8001a084: ed11 bnez a0,8001a0a0 <.LBB3_54+0x4a> + 8001a086: a809 j 8001a098 <.LBB3_54+0x42> + 8001a088: 75c6 ld a1,112(sp) + 8001a08a: 4501 li a0,0 + return None + 8001a08c: e188 sd a0,0(a1) + 8001a08e: a23d j 8001a1bc <.LBB3_56+0x58> + 8001a090: 4505 li a0,1 + if is_parent && path[cur] == 0 { + 8001a092: 0ca107a3 sb a0,207(sp) + 8001a096: a819 j 8001a0ac <.LBB3_54+0x56> + 8001a098: 4501 li a0,0 + 8001a09a: 0ca107a3 sb a0,207(sp) + 8001a09e: a039 j 8001a0ac <.LBB3_54+0x56> + 8001a0a0: 65e6 ld a1,88(sp) + 8001a0a2: 754a ld a0,176(sp) + 8001a0a4: e82a sd a0,16(sp) + 8001a0a6: 00b56863 bltu a0,a1,8001a0b6 <.LBB3_54+0x60> + 8001a0aa: a2a5 j 8001a212 <.LBB3_57+0x14> + 8001a0ac: 0cf14503 lbu a0,207(sp) + 8001a0b0: 8905 andi a0,a0,1 + 8001a0b2: e919 bnez a0,8001a0c8 <.LBB3_54+0x72> + 8001a0b4: a00d j 8001a0d6 <.LBB3_54+0x80> + 8001a0b6: 7506 ld a0,96(sp) + 8001a0b8: 65c2 ld a1,16(sp) + 8001a0ba: 952e add a0,a0,a1 + 8001a0bc: 00054503 lbu a0,0(a0) + 8001a0c0: 4581 li a1,0 + 8001a0c2: fcb507e3 beq a0,a1,8001a090 <.LBB3_54+0x3a> + 8001a0c6: bfc9 j 8001a098 <.LBB3_54+0x42> + drop(data_guard); + 8001a0c8: 756a ld a0,184(sp) + 8001a0ca: 658e ld a1,192(sp) + 8001a0cc: 00004097 auipc ra,0x4 + 8001a0d0: d6e080e7 jalr -658(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a0d4: a801 j 8001a0e4 <.LBB3_54+0x8e> + 8001a0d6: 1928 addi a0,sp,184 + match data_guard.dir_lookup(name) { + 8001a0d8: 00004097 auipc ra,0x4 + 8001a0dc: 3ce080e7 jalr 974(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a0e0: e42a sd a0,8(sp) + 8001a0e2: a831 j 8001a0fe <.LBB3_54+0xa8> + 8001a0e4: 75c6 ld a1,112(sp) + 8001a0e6: 4501 li a0,0 + return Some(inode) + 8001a0e8: 14a10fa3 sb a0,351(sp) + 8001a0ec: 662a ld a2,136(sp) + 8001a0ee: edb2 sd a2,216(sp) + 8001a0f0: 650a ld a0,128(sp) + 8001a0f2: e9aa sd a0,208(sp) + 8001a0f4: e990 sd a2,16(a1) + 8001a0f6: e588 sd a0,8(a1) + 8001a0f8: 4505 li a0,1 + 8001a0fa: e188 sd a0,0(a1) + } + 8001a0fc: a0c1 j 8001a1bc <.LBB3_56+0x58> + match data_guard.dir_lookup(name) { + 8001a0fe: 6646 ld a2,80(sp) + 8001a100: 65a2 ld a1,8(sp) + 8001a102: 1188 addi a0,sp,224 + 8001a104: 46b9 li a3,14 + 8001a106: 00001097 auipc ra,0x1 + 8001a10a: 57c080e7 jalr 1404(ra) # 8001b682 <_ZN6kernel2fs5inode9InodeData10dir_lookup17h2ffc093ee3be0a35E> + 8001a10e: a009 j 8001a110 <.LBB3_54+0xba> + None => { + 8001a110: 750e ld a0,224(sp) + 8001a112: 4581 li a1,0 + 8001a114: 00b50f63 beq a0,a1,8001a132 <.LBB3_54+0xdc> + 8001a118: a009 j 8001a11a <.LBB3_54+0xc4> + Some(last_inode) => { + 8001a11a: 754e ld a0,240(sp) + 8001a11c: e22a sd a0,256(sp) + 8001a11e: 752e ld a0,232(sp) + 8001a120: fdaa sd a0,248(sp) + drop(data_guard); + 8001a122: 756a ld a0,184(sp) + 8001a124: 658e ld a1,192(sp) + 8001a126: 00004097 auipc ra,0x4 + 8001a12a: d14080e7 jalr -748(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a12e: a829 j 8001a148 <.LBB3_54+0xf2> + match data_guard.dir_lookup(name) { + 8001a130: 0000 unimp + drop(data_guard); + 8001a132: 756a ld a0,184(sp) + 8001a134: 658e ld a1,192(sp) + 8001a136: 00004097 auipc ra,0x4 + 8001a13a: d04080e7 jalr -764(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a13e: a009 j 8001a140 <.LBB3_54+0xea> + 8001a140: 75c6 ld a1,112(sp) + 8001a142: 4501 li a0,0 + return None + 8001a144: e188 sd a0,0(a1) + 8001a146: a89d j 8001a1bc <.LBB3_56+0x58> + inode = last_inode; + 8001a148: 6512 ld a0,256(sp) + 8001a14a: ea2a sd a0,272(sp) + 8001a14c: 756e ld a0,248(sp) + 8001a14e: e62a sd a0,264(sp) + 8001a150: 0108 addi a0,sp,128 + 8001a152: fffed097 auipc ra,0xfffed + 8001a156: f14080e7 jalr -236(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001a15a: a8ad j 8001a1d4 <.LBB3_56+0x70> + +000000008001a15c <.LBB3_55>: + println!("[Kernel] Warning: namex querying root inode's parent"); + 8001a15c: 00012597 auipc a1,0x12 + 8001a160: c4458593 addi a1,a1,-956 # 8002bda0 <.L__unnamed_26> + +000000008001a164 <.LBB3_56>: + 8001a164: 00012697 auipc a3,0x12 + 8001a168: c4c68693 addi a3,a3,-948 # 8002bdb0 <.L__unnamed_30> + 8001a16c: 0a28 addi a0,sp,280 + 8001a16e: 4605 li a2,1 + 8001a170: 4701 li a4,0 + 8001a172: fffeb097 auipc ra,0xfffeb + 8001a176: 418080e7 jalr 1048(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001a17a: a831 j 8001a196 <.LBB3_56+0x32> + 8001a17c: 75c6 ld a1,112(sp) + 8001a17e: 4501 li a0,0 + Some(inode) + 8001a180: 14a10fa3 sb a0,351(sp) + 8001a184: 662a ld a2,136(sp) + 8001a186: eab2 sd a2,336(sp) + 8001a188: 650a ld a0,128(sp) + 8001a18a: e6aa sd a0,328(sp) + 8001a18c: e990 sd a2,16(a1) + 8001a18e: e588 sd a0,8(a1) + 8001a190: 4505 li a0,1 + 8001a192: e188 sd a0,0(a1) + if is_parent { + 8001a194: a819 j 8001a1aa <.LBB3_56+0x46> + 8001a196: 0a28 addi a0,sp,280 + println!("[Kernel] Warning: namex querying root inode's parent"); + 8001a198: 00005097 auipc ra,0x5 + 8001a19c: a60080e7 jalr -1440(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001a1a0: a009 j 8001a1a2 <.LBB3_56+0x3e> + 8001a1a2: 75c6 ld a1,112(sp) + 8001a1a4: 4501 li a0,0 + None + 8001a1a6: e188 sd a0,0(a1) + if is_parent { + 8001a1a8: a009 j 8001a1aa <.LBB3_56+0x46> + } + 8001a1aa: 15f14503 lbu a0,351(sp) + 8001a1ae: 8905 andi a0,a0,1 + 8001a1b0: e915 bnez a0,8001a1e4 <.LBB3_56+0x80> + 8001a1b2: a009 j 8001a1b4 <.LBB3_56+0x50> + 8001a1b4: 4501 li a0,0 + 8001a1b6: 14a10fa3 sb a0,351(sp) + 8001a1ba: a811 j 8001a1ce <.LBB3_56+0x6a> + 8001a1bc: 15f14503 lbu a0,351(sp) + 8001a1c0: 8905 andi a0,a0,1 + 8001a1c2: e51d bnez a0,8001a1f0 <.LBB3_56+0x8c> + 8001a1c4: a009 j 8001a1c6 <.LBB3_56+0x62> + 8001a1c6: 4501 li a0,0 + 8001a1c8: 14a10fa3 sb a0,351(sp) + 8001a1cc: a009 j 8001a1ce <.LBB3_56+0x6a> + 8001a1ce: 70fa ld ra,440(sp) + 8001a1d0: 6139 addi sp,sp,448 + 8001a1d2: 8082 ret + 8001a1d4: 4505 li a0,1 + inode = last_inode; + 8001a1d6: 14a10fa3 sb a0,351(sp) + 8001a1da: 6532 ld a0,264(sp) + 8001a1dc: e12a sd a0,128(sp) + 8001a1de: 6552 ld a0,272(sp) + 8001a1e0: e52a sd a0,136(sp) + loop { + 8001a1e2: b52d j 8001a00c <.LBB3_53+0x40> + 8001a1e4: 0108 addi a0,sp,128 + } + 8001a1e6: fffed097 auipc ra,0xfffed + 8001a1ea: e80080e7 jalr -384(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001a1ee: b7d9 j 8001a1b4 <.LBB3_56+0x50> + 8001a1f0: 0108 addi a0,sp,128 + 8001a1f2: fffed097 auipc ra,0xfffed + 8001a1f6: e74080e7 jalr -396(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001a1fa: b7f1 j 8001a1c6 <.LBB3_56+0x62> + if path[0] == b'/' { + 8001a1fc: 65e6 ld a1,88(sp) + +000000008001a1fe <.LBB3_57>: + 8001a1fe: 00012617 auipc a2,0x12 + 8001a202: b0260613 addi a2,a2,-1278 # 8002bd00 <.L__unnamed_28> + 8001a206: 4501 li a0,0 + 8001a208: 00009097 auipc ra,0x9 + 8001a20c: f68080e7 jalr -152(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001a210: 0000 unimp + if is_parent && path[cur] == 0 { + 8001a212: 65e6 ld a1,88(sp) + 8001a214: 6542 ld a0,16(sp) + +000000008001a216 <.LBB3_58>: + 8001a216: 00012617 auipc a2,0x12 + 8001a21a: b3a60613 addi a2,a2,-1222 # 8002bd50 <.L__unnamed_29> + 8001a21e: 00009097 auipc ra,0x9 + 8001a222: f52080e7 jalr -174(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E: + +000000008001a228 <_ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E>: + pub fn namei(&self, path: &[u8]) -> Option { + 8001a228: 7179 addi sp,sp,-48 + 8001a22a: f406 sd ra,40(sp) + 8001a22c: e82e sd a1,16(sp) + 8001a22e: ec32 sd a2,24(sp) + 8001a230: f036 sd a3,32(sp) + 8001a232: 4781 li a5,0 + let mut name: [u8;DIRSIZ] = [0;DIRSIZ]; + 8001a234: e03e sd a5,0(sp) + 8001a236: c43e sw a5,8(sp) + 8001a238: 00f11623 sh a5,12(sp) + 8001a23c: 870a mv a4,sp + self.namex(path, &mut name, false) + 8001a23e: 00000097 auipc ra,0x0 + 8001a242: cec080e7 jalr -788(ra) # 80019f2a <_ZN6kernel2fs5inode10InodeCache5namex17h346d00a9a4ac3352E> + 8001a246: a009 j 8001a248 <_ZN6kernel2fs5inode10InodeCache5namei17hc269c6a9eecf1991E+0x20> + } + 8001a248: 70a2 ld ra,40(sp) + 8001a24a: 6145 addi sp,sp,48 + 8001a24c: 8082 ret + +Disassembly of section .text._ZN6kernel2fs5inode10InodeCache12namei_parent17h24bebf98ccd9b34eE: + +000000008001a24e <_ZN6kernel2fs5inode10InodeCache12namei_parent17h24bebf98ccd9b34eE>: + pub fn namei_parent(&self, path: &[u8], name: &mut [u8;DIRSIZ]) -> Option { + 8001a24e: 7179 addi sp,sp,-48 + 8001a250: f406 sd ra,40(sp) + 8001a252: e42e sd a1,8(sp) + 8001a254: e832 sd a2,16(sp) + 8001a256: ec36 sd a3,24(sp) + 8001a258: f03a sd a4,32(sp) + 8001a25a: 4785 li a5,1 + self.namex(path, name, true) + 8001a25c: 00000097 auipc ra,0x0 + 8001a260: cce080e7 jalr -818(ra) # 80019f2a <_ZN6kernel2fs5inode10InodeCache5namex17h346d00a9a4ac3352E> + 8001a264: a009 j 8001a266 <_ZN6kernel2fs5inode10InodeCache12namei_parent17h24bebf98ccd9b34eE+0x18> + } + 8001a266: 70a2 ld ra,40(sp) + 8001a268: 6145 addi sp,sp,48 + 8001a26a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs5inode10InodeCache6create17hf2583436fcb9d2ecE: + +000000008001a26c <_ZN6kernel2fs5inode10InodeCache6create17hf2583436fcb9d2ecE>: + pub fn create( + 8001a26c: c9010113 addi sp,sp,-880 + 8001a270: 36113423 sd ra,872(sp) + 8001a274: fe2e sd a1,312(sp) + 8001a276: e2aa sd a0,320(sp) + 8001a278: 8542 mv a0,a6 + 8001a27a: e6aa sd a0,328(sp) + 8001a27c: 853e mv a0,a5 + 8001a27e: eaaa sd a0,336(sp) + 8001a280: 14e11f23 sh a4,350(sp) + 8001a284: 28b13823 sd a1,656(sp) + 8001a288: 28c13c23 sd a2,664(sp) + 8001a28c: 2ad13023 sd a3,672(sp) + 8001a290: 2af11623 sh a5,684(sp) + 8001a294: 2b011723 sh a6,686(sp) + 8001a298: 4501 li a0,0 + let mut name: [u8; DIRSIZ] = [0; DIRSIZ]; + 8001a29a: 28a10723 sb a0,654(sp) + 8001a29e: 28a107a3 sb a0,655(sp) + 8001a2a2: 28a106a3 sb a0,653(sp) + 8001a2a6: f2aa sd a0,352(sp) + 8001a2a8: 16a12423 sw a0,360(sp) + 8001a2ac: 16a11623 sh a0,364(sp) + 8001a2b0: 0308 addi a0,sp,384 + 8001a2b2: 1298 addi a4,sp,352 + let dirinode = self.namei_parent(path, &mut name).unwrap(); + 8001a2b4: 00000097 auipc ra,0x0 + 8001a2b8: f9a080e7 jalr -102(ra) # 8001a24e <_ZN6kernel2fs5inode10InodeCache12namei_parent17h24bebf98ccd9b34eE> + 8001a2bc: a009 j 8001a2be <.LBB6_77> + +000000008001a2be <.LBB6_77>: + 8001a2be: 00012597 auipc a1,0x12 + 8001a2c2: af258593 addi a1,a1,-1294 # 8002bdb0 <.L__unnamed_30> + 8001a2c6: 0308 addi a0,sp,384 + 8001a2c8: ffff5097 auipc ra,0xffff5 + 8001a2cc: 34c080e7 jalr 844(ra) # 8000f614 <_ZN4core6option15Option$LT$T$GT$6unwrap17h5fcd4b8dbd5a2f47E> + 8001a2d0: 2ca13023 sd a0,704(sp) + 8001a2d4: 2cb13423 sd a1,712(sp) + 8001a2d8: faaa sd a0,368(sp) + 8001a2da: feae sd a1,376(sp) + 8001a2dc: a009 j 8001a2de <.LBB6_77+0x20> + 8001a2de: 4505 li a0,1 + let mut dirinode_guard = dirinode.lock(); + 8001a2e0: 28a107a3 sb a0,655(sp) + 8001a2e4: 1a88 addi a0,sp,368 + 8001a2e6: 00002097 auipc ra,0x2 + 8001a2ea: 986080e7 jalr -1658(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 8001a2ee: ef2a sd a0,408(sp) + 8001a2f0: f32e sd a1,416(sp) + 8001a2f2: a009 j 8001a2f4 <.LBB6_77+0x36> + 8001a2f4: 0b28 addi a0,sp,408 + match dirinode_guard.dir_lookup(&name) { + 8001a2f6: 00004097 auipc ra,0x4 + 8001a2fa: 1b0080e7 jalr 432(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a2fe: fa2a sd a0,304(sp) + 8001a300: a009 j 8001a302 <.LBB6_77+0x44> + 8001a302: 75d2 ld a1,304(sp) + 8001a304: 1328 addi a0,sp,424 + 8001a306: 1290 addi a2,sp,352 + 8001a308: 46b9 li a3,14 + 8001a30a: 00001097 auipc ra,0x1 + 8001a30e: 378080e7 jalr 888(ra) # 8001b682 <_ZN6kernel2fs5inode9InodeData10dir_lookup17h2ffc093ee3be0a35E> + 8001a312: a009 j 8001a314 <.LBB6_77+0x56> + Some(inode) => { + 8001a314: 753a ld a0,424(sp) + 8001a316: 4581 li a1,0 + 8001a318: 00b50463 beq a0,a1,8001a320 <.LBB6_77+0x62> + 8001a31c: a009 j 8001a31e <.LBB6_77+0x60> + 8001a31e: a809 j 8001a330 <.LBB6_77+0x72> + 8001a320: 0b28 addi a0,sp,408 + let dev = dirinode_guard.dev; + 8001a322: 00004097 auipc ra,0x4 + 8001a326: 170080e7 jalr 368(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001a32a: f62a sd a0,296(sp) + 8001a32c: a8e9 j 8001a406 <.LBB6_80+0x2c> + match dirinode_guard.dir_lookup(&name) { + 8001a32e: 0000 unimp + 8001a330: 4505 li a0,1 + Some(inode) => { + 8001a332: 28a10723 sb a0,654(sp) + 8001a336: 755a ld a0,432(sp) + 8001a338: e3aa sd a0,448(sp) + 8001a33a: 757a ld a0,440(sp) + 8001a33c: e7aa sd a0,456(sp) + 8001a33e: 4501 li a0,0 + drop(dirinode_guard); + 8001a340: 28a107a3 sb a0,655(sp) + 8001a344: 657a ld a0,408(sp) + 8001a346: 759a ld a1,416(sp) + 8001a348: 00004097 auipc ra,0x4 + 8001a34c: af2080e7 jalr -1294(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a350: a009 j 8001a352 <.LBB6_77+0x94> + 8001a352: 4505 li a0,1 + let inode_guard = inode.lock(); + 8001a354: 28a106a3 sb a0,653(sp) + 8001a358: 0388 addi a0,sp,448 + 8001a35a: 00002097 auipc ra,0x2 + 8001a35e: 912080e7 jalr -1774(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 8001a362: ebaa sd a0,464(sp) + 8001a364: efae sd a1,472(sp) + 8001a366: a009 j 8001a368 <.LBB6_77+0xaa> + 8001a368: 0b88 addi a0,sp,464 + match inode_guard.dinode.itype { + 8001a36a: 00004097 auipc ra,0x4 + 8001a36e: 128080e7 jalr 296(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001a372: f22a sd a0,288(sp) + 8001a374: a009 j 8001a376 <.LBB6_77+0xb8> + InodeType::Device | InodeType::File | InodeType::FIFO => { + 8001a376: 7512 ld a0,288(sp) + 8001a378: 00851503 lh a0,8(a0) + 8001a37c: 1579 addi a0,a0,-2 + 8001a37e: 65c1 lui a1,0x10 + 8001a380: 35fd addiw a1,a1,-1 + 8001a382: 8d6d and a0,a0,a1 + 8001a384: 458d li a1,3 + 8001a386: 00b56e63 bltu a0,a1,8001a3a2 <.LBB6_79> + 8001a38a: a009 j 8001a38c <.LBB6_77+0xce> + return Err("create: unmatched type.") + 8001a38c: 6596 ld a1,320(sp) + +000000008001a38e <.LBB6_78>: + 8001a38e: 00012517 auipc a0,0x12 + 8001a392: a3a50513 addi a0,a0,-1478 # 8002bdc8 <.L__unnamed_31> + 8001a396: e588 sd a0,8(a1) + 8001a398: 455d li a0,23 + 8001a39a: e988 sd a0,16(a1) + 8001a39c: 4505 li a0,1 + 8001a39e: e188 sd a0,0(a1) + 8001a3a0: a11d j 8001a7c6 <.LBB6_86+0xb8> + +000000008001a3a2 <.LBB6_79>: + if itype == InodeType::File { + 8001a3a2: 00012597 auipc a1,0x12 + 8001a3a6: a3e58593 addi a1,a1,-1474 # 8002bde0 <.L__unnamed_32> + 8001a3aa: 15e10513 addi a0,sp,350 + 8001a3ae: fffee097 auipc ra,0xfffee + 8001a3b2: 1ea080e7 jalr 490(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 8001a3b6: ee2a sd a0,280(sp) + 8001a3b8: a009 j 8001a3ba <.LBB6_79+0x18> + 8001a3ba: 6572 ld a0,280(sp) + 8001a3bc: 4581 li a1,0 + 8001a3be: 00b50d63 beq a0,a1,8001a3d8 <.LBB6_79+0x36> + 8001a3c2: a009 j 8001a3c4 <.LBB6_79+0x22> + 8001a3c4: 4501 li a0,0 + drop(inode_guard); + 8001a3c6: 28a106a3 sb a0,653(sp) + 8001a3ca: 655e ld a0,464(sp) + 8001a3cc: 65fe ld a1,472(sp) + 8001a3ce: 00004097 auipc ra,0x4 + 8001a3d2: a6c080e7 jalr -1428(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a3d6: a821 j 8001a3ee <.LBB6_80+0x14> + return Err("create: unmatched type."); + 8001a3d8: 6596 ld a1,320(sp) + +000000008001a3da <.LBB6_80>: + 8001a3da: 00012517 auipc a0,0x12 + 8001a3de: 9ee50513 addi a0,a0,-1554 # 8002bdc8 <.L__unnamed_31> + 8001a3e2: e588 sd a0,8(a1) + 8001a3e4: 455d li a0,23 + 8001a3e6: e988 sd a0,16(a1) + 8001a3e8: 4505 li a0,1 + 8001a3ea: e188 sd a0,0(a1) + 8001a3ec: aee9 j 8001a7c6 <.LBB6_86+0xb8> + 8001a3ee: 6596 ld a1,320(sp) + 8001a3f0: 4501 li a0,0 + return Ok(inode) + 8001a3f2: 28a10723 sb a0,654(sp) + 8001a3f6: 66be ld a3,456(sp) + 8001a3f8: f7b6 sd a3,488(sp) + 8001a3fa: 661e ld a2,448(sp) + 8001a3fc: f3b2 sd a2,480(sp) + 8001a3fe: e994 sd a3,16(a1) + 8001a400: e590 sd a2,8(a1) + 8001a402: e188 sd a0,0(a1) + }, + 8001a404: a6c9 j 8001a7c6 <.LBB6_86+0xb8> + let dev = dirinode_guard.dev; + 8001a406: 7532 ld a0,296(sp) + 8001a408: 00056503 lwu a0,0(a0) + 8001a40c: e62a sd a0,264(sp) + 8001a40e: 2ca12c23 sw a0,728(sp) + let inum = inode_alloc(dev, itype); + 8001a412: 15e11583 lh a1,350(sp) + 8001a416: fffeb097 auipc ra,0xfffeb + 8001a41a: cd8080e7 jalr -808(ra) # 800050ee <_ZN6kernel2fs6bitmap11inode_alloc17h289cf49ddd9fbbd3E> + 8001a41e: 85aa mv a1,a0 + 8001a420: ea2e sd a1,272(sp) + 8001a422: 2ca12e23 sw a0,732(sp) + 8001a426: a009 j 8001a428 <.LBB6_80+0x4e> + let inode = self.get(dev, inum); + 8001a428: 6652 ld a2,272(sp) + 8001a42a: 65b2 ld a1,264(sp) + 8001a42c: 7572 ld a0,312(sp) + 8001a42e: fffff097 auipc ra,0xfffff + 8001a432: 6ca080e7 jalr 1738(ra) # 80019af8 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E> + 8001a436: 2ea13023 sd a0,736(sp) + 8001a43a: 2eb13423 sd a1,744(sp) + 8001a43e: fbaa sd a0,496(sp) + 8001a440: ffae sd a1,504(sp) + 8001a442: a009 j 8001a444 <.LBB6_80+0x6a> + 8001a444: 1b88 addi a0,sp,496 + let mut inode_guard = inode.lock(); + 8001a446: 00002097 auipc ra,0x2 + 8001a44a: 826080e7 jalr -2010(ra) # 8001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE> + 8001a44e: 20a13023 sd a0,512(sp) + 8001a452: 20b13423 sd a1,520(sp) + 8001a456: a009 j 8001a458 <.LBB6_80+0x7e> + 8001a458: 0408 addi a0,sp,512 + inode_guard.dinode.major = major; + 8001a45a: 00004097 auipc ra,0x4 + 8001a45e: 04c080e7 jalr 76(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a462: e22a sd a0,256(sp) + 8001a464: a009 j 8001a466 <.LBB6_80+0x8c> + 8001a466: 6556 ld a0,336(sp) + 8001a468: 6592 ld a1,256(sp) + 8001a46a: 00a59523 sh a0,10(a1) + 8001a46e: 0408 addi a0,sp,512 + inode_guard.dinode.minor = minor; + 8001a470: 00004097 auipc ra,0x4 + 8001a474: 036080e7 jalr 54(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a478: fdaa sd a0,248(sp) + 8001a47a: a009 j 8001a47c <.LBB6_80+0xa2> + 8001a47c: 6536 ld a0,328(sp) + 8001a47e: 75ee ld a1,248(sp) + 8001a480: 00a59623 sh a0,12(a1) + 8001a484: 0408 addi a0,sp,512 + inode_guard.dinode.nlink = 1; + 8001a486: 00004097 auipc ra,0x4 + 8001a48a: 020080e7 jalr 32(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a48e: f9aa sd a0,240(sp) + 8001a490: a009 j 8001a492 <.LBB6_80+0xb8> + 8001a492: 75ce ld a1,240(sp) + 8001a494: 4505 li a0,1 + 8001a496: 00a59723 sh a0,14(a1) + 8001a49a: 0408 addi a0,sp,512 + inode_guard.update(); + 8001a49c: 00004097 auipc ra,0x4 + 8001a4a0: 00a080e7 jalr 10(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a4a4: f5aa sd a0,232(sp) + 8001a4a6: a009 j 8001a4a8 <.LBB6_80+0xce> + 8001a4a8: 752e ld a0,232(sp) + 8001a4aa: 00001097 auipc ra,0x1 + 8001a4ae: 856080e7 jalr -1962(ra) # 8001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE> + 8001a4b2: a009 j 8001a4b4 <.LBB6_80+0xda> + 8001a4b4: 0408 addi a0,sp,512 + debug_assert_eq!(inode_guard.dinode.itype, itype); + 8001a4b6: 00004097 auipc ra,0x4 + 8001a4ba: fdc080e7 jalr -36(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001a4be: f1aa sd a0,224(sp) + 8001a4c0: a009 j 8001a4c2 <.LBB6_80+0xe8> + 8001a4c2: 750e ld a0,224(sp) + 8001a4c4: 0521 addi a0,a0,8 + 8001a4c6: e5aa sd a0,200(sp) + 8001a4c8: 20a13823 sd a0,528(sp) + 8001a4cc: 15e10593 addi a1,sp,350 + 8001a4d0: e9ae sd a1,208(sp) + 8001a4d2: 20b13c23 sd a1,536(sp) + 8001a4d6: 2ea13c23 sd a0,760(sp) + 8001a4da: 30b13023 sd a1,768(sp) + 8001a4de: fffee097 auipc ra,0xfffee + 8001a4e2: 0ba080e7 jalr 186(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 8001a4e6: edaa sd a0,216(sp) + 8001a4e8: a009 j 8001a4ea <.LBB6_80+0x110> + 8001a4ea: 656e ld a0,216(sp) + 8001a4ec: e11d bnez a0,8001a512 <.LBB6_82> + 8001a4ee: a009 j 8001a4f0 <.LBB6_80+0x116> + 8001a4f0: 664e ld a2,208(sp) + 8001a4f2: 65ae ld a1,200(sp) + 8001a4f4: 4501 li a0,0 + 8001a4f6: 22a103a3 sb a0,551(sp) + 8001a4fa: 22a13423 sd a0,552(sp) + +000000008001a4fe <.LBB6_81>: + 8001a4fe: 00012717 auipc a4,0x12 + 8001a502: 8ea70713 addi a4,a4,-1814 # 8002bde8 <.L__unnamed_33> + 8001a506: 1434 addi a3,sp,552 + 8001a508: fffe8097 auipc ra,0xfffe8 + 8001a50c: 16c080e7 jalr 364(ra) # 80002674 <_ZN4core9panicking13assert_failed17hb31c8c2a34dfd8a3E> + ... + +000000008001a512 <.LBB6_82>: + if itype == InodeType::Directory { + 8001a512: 00012597 auipc a1,0x12 + 8001a516: 83658593 addi a1,a1,-1994 # 8002bd48 <.L__unnamed_25> + 8001a51a: 15e10513 addi a0,sp,350 + 8001a51e: fffee097 auipc ra,0xfffee + 8001a522: 07a080e7 jalr 122(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 8001a526: e1aa sd a0,192(sp) + 8001a528: a009 j 8001a52a <.LBB6_82+0x18> + 8001a52a: 650e ld a0,192(sp) + 8001a52c: 4581 li a1,0 + 8001a52e: 00b50a63 beq a0,a1,8001a542 <.LBB6_82+0x30> + 8001a532: a009 j 8001a534 <.LBB6_82+0x22> + 8001a534: 0408 addi a0,sp,512 + inode_guard.dinode.nlink += 1; + 8001a536: 00004097 auipc ra,0x4 + 8001a53a: f70080e7 jalr -144(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a53e: fd2a sd a0,184(sp) + 8001a540: a011 j 8001a544 <.LBB6_82+0x32> + if itype == InodeType::Directory { + 8001a542: a261 j 8001a6ca <.LBB6_84+0xa0> + inode_guard.dinode.nlink += 1; + 8001a544: 756a ld a0,184(sp) + 8001a546: 00e51503 lh a0,14(a0) + 8001a54a: 00150593 addi a1,a0,1 + 8001a54e: f92e sd a1,176(sp) + 8001a550: 03059513 slli a0,a1,0x30 + 8001a554: 9541 srai a0,a0,0x30 + 8001a556: 28b51e63 bne a0,a1,8001a7f2 <.LBB6_87> + 8001a55a: a009 j 8001a55c <.LBB6_82+0x4a> + 8001a55c: 754a ld a0,176(sp) + 8001a55e: 75ea ld a1,184(sp) + 8001a560: 00a59723 sh a0,14(a1) + 8001a564: 0408 addi a0,sp,512 + inode_guard.update(); + 8001a566: 00004097 auipc ra,0x4 + 8001a56a: f40080e7 jalr -192(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a56e: f52a sd a0,168(sp) + 8001a570: a009 j 8001a572 <.LBB6_82+0x60> + 8001a572: 752a ld a0,168(sp) + 8001a574: 00000097 auipc ra,0x0 + 8001a578: 78c080e7 jalr 1932(ra) # 8001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE> + 8001a57c: a009 j 8001a57e <.LBB6_82+0x6c> + 8001a57e: 0408 addi a0,sp,512 + inode_guard.dir_link(".".as_bytes(), inode.inum)?; + 8001a580: 00004097 auipc ra,0x4 + 8001a584: f26080e7 jalr -218(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a588: f12a sd a0,160(sp) + 8001a58a: a009 j 8001a58c <.LBB6_83> + +000000008001a58c <.LBB6_83>: + 8001a58c: 00012597 auipc a1,0x12 + 8001a590: 88c58593 addi a1,a1,-1908 # 8002be18 <.L__unnamed_34> + 8001a594: e92e sd a1,144(sp) + 8001a596: 32b13423 sd a1,808(sp) + 8001a59a: 4505 li a0,1 + 8001a59c: ed2a sd a0,152(sp) + 8001a59e: 32a13823 sd a0,816(sp) + unsafe { mem::transmute(self) } + 8001a5a2: 32b13c23 sd a1,824(sp) + 8001a5a6: 34a13023 sd a0,832(sp) + 8001a5aa: a009 j 8001a5ac <.LBB6_83+0x20> + 8001a5ac: 666a ld a2,152(sp) + 8001a5ae: 65ca ld a1,144(sp) + 8001a5b0: 750a ld a0,160(sp) + 8001a5b2: 1fc12683 lw a3,508(sp) + 8001a5b6: 00001097 auipc ra,0x1 + 8001a5ba: 2f6080e7 jalr 758(ra) # 8001b8ac <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE> + 8001a5be: e12a sd a0,128(sp) + 8001a5c0: e52e sd a1,136(sp) + 8001a5c2: a009 j 8001a5c4 <.LBB6_83+0x38> + 8001a5c4: 65aa ld a1,136(sp) + 8001a5c6: 650a ld a0,128(sp) + 8001a5c8: ffff3097 auipc ra,0xffff3 + 8001a5cc: 570080e7 jalr 1392(ra) # 8000db38 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb12176fc822fec8fE> + 8001a5d0: 24a13c23 sd a0,600(sp) + 8001a5d4: 26b13023 sd a1,608(sp) + 8001a5d8: a009 j 8001a5da <.LBB6_83+0x4e> + 8001a5da: 25813503 ld a0,600(sp) + 8001a5de: 00a035b3 snez a1,a0 + 8001a5e2: 4581 li a1,0 + 8001a5e4: 00b50463 beq a0,a1,8001a5ec <.LBB6_83+0x60> + 8001a5e8: a009 j 8001a5ea <.LBB6_83+0x5e> + 8001a5ea: a809 j 8001a5fc <.LBB6_83+0x70> + 8001a5ec: 0408 addi a0,sp,512 + inode_guard.dir_link("..".as_bytes(), dirinode_guard.inum)?; + 8001a5ee: 00004097 auipc ra,0x4 + 8001a5f2: eb8080e7 jalr -328(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a5f6: fcaa sd a0,120(sp) + 8001a5f8: a80d j 8001a62a <.LBB6_84> + inode_guard.dir_link(".".as_bytes(), inode.inum)?; + 8001a5fa: 0000 unimp + 8001a5fc: 25813503 ld a0,600(sp) + 8001a600: 26013583 ld a1,608(sp) + 8001a604: 30a13423 sd a0,776(sp) + 8001a608: 30b13823 sd a1,784(sp) + 8001a60c: ffff2097 auipc ra,0xffff2 + 8001a610: d7a080e7 jalr -646(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001a614: f4aa sd a0,104(sp) + 8001a616: f8ae sd a1,112(sp) + 8001a618: a009 j 8001a61a <.LBB6_83+0x8e> + 8001a61a: 7646 ld a2,112(sp) + 8001a61c: 75a6 ld a1,104(sp) + 8001a61e: 6516 ld a0,320(sp) + 8001a620: ffff3097 auipc ra,0xffff3 + 8001a624: 436080e7 jalr 1078(ra) # 8000da56 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17haeaec5be2c31cee9E> + 8001a628: a299 j 8001a76e <.LBB6_86+0x60> + +000000008001a62a <.LBB6_84>: + 8001a62a: 00011597 auipc a1,0x11 + 8001a62e: 7ef58593 addi a1,a1,2031 # 8002be19 <.L__unnamed_35> + 8001a632: ecae sd a1,88(sp) + 8001a634: 34b13423 sd a1,840(sp) + 8001a638: 4509 li a0,2 + 8001a63a: f0aa sd a0,96(sp) + 8001a63c: 34a13823 sd a0,848(sp) + 8001a640: 34b13c23 sd a1,856(sp) + 8001a644: 36a13023 sd a0,864(sp) + inode_guard.dir_link("..".as_bytes(), dirinode_guard.inum)?; + 8001a648: a009 j 8001a64a <.LBB6_84+0x20> + 8001a64a: 0b28 addi a0,sp,408 + 8001a64c: 00004097 auipc ra,0x4 + 8001a650: e46080e7 jalr -442(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001a654: e8aa sd a0,80(sp) + 8001a656: a009 j 8001a658 <.LBB6_84+0x2e> + 8001a658: 7606 ld a2,96(sp) + 8001a65a: 65e6 ld a1,88(sp) + 8001a65c: 7566 ld a0,120(sp) + 8001a65e: 66c6 ld a3,80(sp) + 8001a660: 42d4 lw a3,4(a3) + 8001a662: 00001097 auipc ra,0x1 + 8001a666: 24a080e7 jalr 586(ra) # 8001b8ac <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE> + 8001a66a: e0aa sd a0,64(sp) + 8001a66c: e4ae sd a1,72(sp) + 8001a66e: a009 j 8001a670 <.LBB6_84+0x46> + 8001a670: 65a6 ld a1,72(sp) + 8001a672: 6506 ld a0,64(sp) + 8001a674: ffff3097 auipc ra,0xffff3 + 8001a678: 4c4080e7 jalr 1220(ra) # 8000db38 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hb12176fc822fec8fE> + 8001a67c: 26a13423 sd a0,616(sp) + 8001a680: 26b13823 sd a1,624(sp) + 8001a684: a009 j 8001a686 <.LBB6_84+0x5c> + 8001a686: 26813503 ld a0,616(sp) + 8001a68a: 00a035b3 snez a1,a0 + 8001a68e: 4581 li a1,0 + 8001a690: 00b50463 beq a0,a1,8001a698 <.LBB6_84+0x6e> + 8001a694: a009 j 8001a696 <.LBB6_84+0x6c> + 8001a696: a019 j 8001a69c <.LBB6_84+0x72> + if itype == InodeType::Directory { + 8001a698: a80d j 8001a6ca <.LBB6_84+0xa0> + inode_guard.dir_link("..".as_bytes(), dirinode_guard.inum)?; + 8001a69a: 0000 unimp + 8001a69c: 26813503 ld a0,616(sp) + 8001a6a0: 27013583 ld a1,624(sp) + 8001a6a4: 30a13c23 sd a0,792(sp) + 8001a6a8: 32b13023 sd a1,800(sp) + 8001a6ac: ffff2097 auipc ra,0xffff2 + 8001a6b0: cda080e7 jalr -806(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001a6b4: f82a sd a0,48(sp) + 8001a6b6: fc2e sd a1,56(sp) + 8001a6b8: a009 j 8001a6ba <.LBB6_84+0x90> + 8001a6ba: 7662 ld a2,56(sp) + 8001a6bc: 75c2 ld a1,48(sp) + 8001a6be: 6516 ld a0,320(sp) + 8001a6c0: ffff3097 auipc ra,0xffff3 + 8001a6c4: 396080e7 jalr 918(ra) # 8000da56 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17haeaec5be2c31cee9E> + 8001a6c8: a05d j 8001a76e <.LBB6_86+0x60> + 8001a6ca: 0b28 addi a0,sp,408 + dirinode_guard + 8001a6cc: 00004097 auipc ra,0x4 + 8001a6d0: dda080e7 jalr -550(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001a6d4: f42a sd a0,40(sp) + 8001a6d6: a009 j 8001a6d8 <.LBB6_84+0xae> + 8001a6d8: 1288 addi a0,sp,352 + .dir_link(&name, inode_guard.inum) + 8001a6da: ec2a sd a0,24(sp) + 8001a6dc: 0408 addi a0,sp,512 + 8001a6de: 00004097 auipc ra,0x4 + 8001a6e2: db4080e7 jalr -588(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001a6e6: f02a sd a0,32(sp) + 8001a6e8: a009 j 8001a6ea <.LBB6_84+0xc0> + dirinode_guard + 8001a6ea: 65e2 ld a1,24(sp) + 8001a6ec: 7522 ld a0,40(sp) + 8001a6ee: 7602 ld a2,32(sp) + 8001a6f0: 4254 lw a3,4(a2) + 8001a6f2: 4639 li a2,14 + 8001a6f4: 00001097 auipc ra,0x1 + 8001a6f8: 1b8080e7 jalr 440(ra) # 8001b8ac <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE> + 8001a6fc: e42a sd a0,8(sp) + 8001a6fe: e82e sd a1,16(sp) + 8001a700: a009 j 8001a702 <.LBB6_84+0xd8> + 8001a702: 65c2 ld a1,16(sp) + 8001a704: 6522 ld a0,8(sp) + +000000008001a706 <.LBB6_85>: + 8001a706: 00011617 auipc a2,0x11 + 8001a70a: 71560613 addi a2,a2,1813 # 8002be1b <.L__unnamed_36> + +000000008001a70e <.LBB6_86>: + 8001a70e: 00011717 auipc a4,0x11 + 8001a712: 72a70713 addi a4,a4,1834 # 8002be38 <.L__unnamed_37> + 8001a716: 46e5 li a3,25 + 8001a718: ffff3097 auipc ra,0xffff3 + 8001a71c: ed4080e7 jalr -300(ra) # 8000d5ec <_ZN4core6result19Result$LT$T$C$E$GT$6expect17h7db20d4970bed50aE> + 8001a720: a009 j 8001a722 <.LBB6_86+0x14> + drop(inode_guard); + 8001a722: 20013503 ld a0,512(sp) + 8001a726: 20813583 ld a1,520(sp) + 8001a72a: 00003097 auipc ra,0x3 + 8001a72e: 710080e7 jalr 1808(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a732: a009 j 8001a734 <.LBB6_86+0x26> + 8001a734: 4501 li a0,0 + drop(dirinode_guard); + 8001a736: 28a107a3 sb a0,655(sp) + 8001a73a: 657a ld a0,408(sp) + 8001a73c: 759a ld a1,416(sp) + 8001a73e: 00003097 auipc ra,0x3 + 8001a742: 6fc080e7 jalr 1788(ra) # 8001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E> + 8001a746: a009 j 8001a748 <.LBB6_86+0x3a> + Ok(inode) + 8001a748: 6596 ld a1,320(sp) + 8001a74a: 767e ld a2,504(sp) + 8001a74c: 28c13023 sd a2,640(sp) + 8001a750: 755e ld a0,496(sp) + 8001a752: 26a13c23 sd a0,632(sp) + 8001a756: e990 sd a2,16(a1) + 8001a758: e588 sd a0,8(a1) + 8001a75a: 4501 li a0,0 + 8001a75c: e188 sd a0,0(a1) + } + 8001a75e: 28a107a3 sb a0,655(sp) + 8001a762: 1a88 addi a0,sp,368 + 8001a764: fffed097 auipc ra,0xfffed + 8001a768: 902080e7 jalr -1790(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001a76c: a091 j 8001a7b0 <.LBB6_86+0xa2> + 8001a76e: 0408 addi a0,sp,512 + 8001a770: fffed097 auipc ra,0xfffed + 8001a774: aca080e7 jalr -1334(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 8001a778: a009 j 8001a77a <.LBB6_86+0x6c> + 8001a77a: 1b88 addi a0,sp,496 + 8001a77c: fffed097 auipc ra,0xfffed + 8001a780: 8ea080e7 jalr -1814(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001a784: a095 j 8001a7e8 <.LBB6_86+0xda> + 8001a786: 4501 li a0,0 + }, + 8001a788: 28a106a3 sb a0,653(sp) + 8001a78c: 28e14503 lbu a0,654(sp) + 8001a790: 8905 andi a0,a0,1 + 8001a792: ed1d bnez a0,8001a7d0 <.LBB6_86+0xc2> + 8001a794: a009 j 8001a796 <.LBB6_86+0x88> + 8001a796: 4501 li a0,0 + 8001a798: 28a10723 sb a0,654(sp) + 8001a79c: a0b1 j 8001a7e8 <.LBB6_86+0xda> + 8001a79e: 4501 li a0,0 + } + 8001a7a0: 28a107a3 sb a0,655(sp) + 8001a7a4: 1a88 addi a0,sp,368 + 8001a7a6: fffed097 auipc ra,0xfffed + 8001a7aa: 8c0080e7 jalr -1856(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001a7ae: a009 j 8001a7b0 <.LBB6_86+0xa2> + 8001a7b0: 36813083 ld ra,872(sp) + 8001a7b4: 37010113 addi sp,sp,880 + 8001a7b8: 8082 ret + 8001a7ba: 0b88 addi a0,sp,464 + }, + 8001a7bc: fffed097 auipc ra,0xfffed + 8001a7c0: a7e080e7 jalr -1410(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 8001a7c4: b7c9 j 8001a786 <.LBB6_86+0x78> + 8001a7c6: 28d14503 lbu a0,653(sp) + 8001a7ca: 8905 andi a0,a0,1 + 8001a7cc: f57d bnez a0,8001a7ba <.LBB6_86+0xac> + 8001a7ce: bf65 j 8001a786 <.LBB6_86+0x78> + 8001a7d0: 0388 addi a0,sp,448 + 8001a7d2: fffed097 auipc ra,0xfffed + 8001a7d6: 894080e7 jalr -1900(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001a7da: bf75 j 8001a796 <.LBB6_86+0x88> + 8001a7dc: 0b28 addi a0,sp,408 + } + 8001a7de: fffed097 auipc ra,0xfffed + 8001a7e2: a5c080e7 jalr -1444(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 8001a7e6: bf65 j 8001a79e <.LBB6_86+0x90> + 8001a7e8: 28f14503 lbu a0,655(sp) + 8001a7ec: 8905 andi a0,a0,1 + 8001a7ee: f57d bnez a0,8001a7dc <.LBB6_86+0xce> + 8001a7f0: b77d j 8001a79e <.LBB6_86+0x90> + +000000008001a7f2 <.LBB6_87>: + inode_guard.dinode.nlink += 1; + 8001a7f2: 00011517 auipc a0,0x11 + 8001a7f6: 2de50513 addi a0,a0,734 # 8002bad0 + +000000008001a7fa <.LBB6_88>: + 8001a7fa: 00011617 auipc a2,0x11 + 8001a7fe: 60660613 addi a2,a2,1542 # 8002be00 <.L__unnamed_38> + 8001a802: 45f1 li a1,28 + 8001a804: 00009097 auipc ra,0x9 + 8001a808: 940080e7 jalr -1728(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE: + +000000008001a80e <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE>: +fn skip_path( + 8001a80e: 7155 addi sp,sp,-208 + 8001a810: e586 sd ra,200(sp) + 8001a812: f8b6 sd a3,112(sp) + 8001a814: fcae sd a1,120(sp) + 8001a816: e12a sd a0,128(sp) + 8001a818: e532 sd a2,136(sp) + 8001a81a: f12a sd a0,160(sp) + 8001a81c: f52e sd a1,168(sp) + 8001a81e: f936 sd a3,176(sp) + 8001a820: a009 j 8001a822 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x14> + while path[cur] == b'/' { + 8001a822: 75e6 ld a1,120(sp) + 8001a824: 652a ld a0,136(sp) + 8001a826: f4aa sd a0,104(sp) + 8001a828: 1ab57563 bgeu a0,a1,8001a9d2 <.LBB7_45+0xae> + 8001a82c: a009 j 8001a82e <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x20> + 8001a82e: 650a ld a0,128(sp) + 8001a830: 75a6 ld a1,104(sp) + 8001a832: 952e add a0,a0,a1 + 8001a834: 00054503 lbu a0,0(a0) + 8001a838: 02f00593 li a1,47 + 8001a83c: 00b50963 beq a0,a1,8001a84e <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x40> + 8001a840: a009 j 8001a842 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x34> + if path[cur] == 0 { + 8001a842: 75e6 ld a1,120(sp) + 8001a844: 652a ld a0,136(sp) + 8001a846: f0aa sd a0,96(sp) + 8001a848: 00b56d63 bltu a0,a1,8001a862 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x54> + 8001a84c: aa71 j 8001a9e8 <.LBB7_46+0x12> + cur += 1; + 8001a84e: 65aa ld a1,136(sp) + 8001a850: 00158513 addi a0,a1,1 + 8001a854: ecaa sd a0,88(sp) + 8001a856: 24b56b63 bltu a0,a1,8001aaac <.LBB7_58> + 8001a85a: a009 j 8001a85c <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x4e> + 8001a85c: 6566 ld a0,88(sp) + 8001a85e: e52a sd a0,136(sp) + while path[cur] == b'/' { + 8001a860: b7c9 j 8001a822 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x14> + if path[cur] == 0 { + 8001a862: 650a ld a0,128(sp) + 8001a864: 7586 ld a1,96(sp) + 8001a866: 952e add a0,a0,a1 + 8001a868: 00054503 lbu a0,0(a0) + 8001a86c: 4581 li a1,0 + 8001a86e: 00b51663 bne a0,a1,8001a87a <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x6c> + 8001a872: a009 j 8001a874 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x66> + 8001a874: 4501 li a0,0 + return 0 + 8001a876: e92a sd a0,144(sp) +} + 8001a878: aa89 j 8001a9ca <.LBB7_45+0xa6> + let start = cur; + 8001a87a: 652a ld a0,136(sp) + 8001a87c: e8aa sd a0,80(sp) + 8001a87e: fd2a sd a0,184(sp) + while path[cur] != b'/' && path[cur] != 0 { + 8001a880: a009 j 8001a882 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x74> + 8001a882: 75e6 ld a1,120(sp) + 8001a884: 652a ld a0,136(sp) + 8001a886: e4aa sd a0,72(sp) + 8001a888: 02b56663 bltu a0,a1,8001a8b4 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0xa6> + 8001a88c: aa8d j 8001a9fe <.LBB7_47+0x12> + 8001a88e: 4505 li a0,1 + 8001a890: 08a10fa3 sb a0,159(sp) + 8001a894: a819 j 8001a8aa <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x9c> + 8001a896: 4501 li a0,0 + 8001a898: 08a10fa3 sb a0,159(sp) + 8001a89c: a039 j 8001a8aa <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x9c> + 8001a89e: 75e6 ld a1,120(sp) + 8001a8a0: 652a ld a0,136(sp) + 8001a8a2: e0aa sd a0,64(sp) + 8001a8a4: 02b56263 bltu a0,a1,8001a8c8 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0xba> + 8001a8a8: a2b5 j 8001aa14 <.LBB7_48+0x12> + 8001a8aa: 09f14503 lbu a0,159(sp) + 8001a8ae: 8905 andi a0,a0,1 + 8001a8b0: ed0d bnez a0,8001a8ea <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0xdc> + 8001a8b2: a025 j 8001a8da <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0xcc> + 8001a8b4: 650a ld a0,128(sp) + 8001a8b6: 65a6 ld a1,72(sp) + 8001a8b8: 952e add a0,a0,a1 + 8001a8ba: 00054503 lbu a0,0(a0) + 8001a8be: 02f00593 li a1,47 + 8001a8c2: fcb50ae3 beq a0,a1,8001a896 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x88> + 8001a8c6: bfe1 j 8001a89e <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x90> + 8001a8c8: 650a ld a0,128(sp) + 8001a8ca: 6586 ld a1,64(sp) + 8001a8cc: 952e add a0,a0,a1 + 8001a8ce: 00054503 lbu a0,0(a0) + 8001a8d2: 4581 li a1,0 + 8001a8d4: fcb501e3 beq a0,a1,8001a896 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x88> + 8001a8d8: bf5d j 8001a88e <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x80> + let mut count = cur - start; + 8001a8da: 65c6 ld a1,80(sp) + 8001a8dc: 652a ld a0,136(sp) + 8001a8de: 40b505b3 sub a1,a0,a1 + 8001a8e2: fc2e sd a1,56(sp) + 8001a8e4: 16b56163 bltu a0,a1,8001aa46 <.LBB7_52> + 8001a8e8: a819 j 8001a8fe <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0xf0> + cur += 1; + 8001a8ea: 65aa ld a1,136(sp) + 8001a8ec: 00158513 addi a0,a1,1 + 8001a8f0: f82a sd a0,48(sp) + 8001a8f2: 12b56c63 bltu a0,a1,8001aa2a <.LBB7_50> + 8001a8f6: a009 j 8001a8f8 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0xea> + 8001a8f8: 7542 ld a0,48(sp) + 8001a8fa: e52a sd a0,136(sp) + while path[cur] != b'/' && path[cur] != 0 { + 8001a8fc: b759 j 8001a882 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x74> + let mut count = cur - start; + 8001a8fe: 7546 ld a0,112(sp) + 8001a900: 75e2 ld a1,56(sp) + 8001a902: e1ae sd a1,192(sp) + 8001a904: 45b9 li a1,14 + if count >= name.len() { + 8001a906: 00006097 auipc ra,0x6 + 8001a90a: b9c080e7 jalr -1124(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 8001a90e: f42a sd a0,40(sp) + 8001a910: a009 j 8001a912 <_ZN6kernel2fs5inode9skip_path17h45b5cf4cf2eb7faeE+0x104> + 8001a912: 7562 ld a0,56(sp) + 8001a914: 75a2 ld a1,40(sp) + 8001a916: 02b56163 bltu a0,a1,8001a938 <.LBB7_45+0x14> + 8001a91a: a009 j 8001a91c <.LBB7_44> + +000000008001a91c <.LBB7_44>: + debug_assert!(false); + 8001a91c: 00011517 auipc a0,0x11 + 8001a920: 5c450513 addi a0,a0,1476 # 8002bee0 <.L__unnamed_39> + +000000008001a924 <.LBB7_45>: + 8001a924: 00011617 auipc a2,0x11 + 8001a928: 5d460613 addi a2,a2,1492 # 8002bef8 <.L__unnamed_40> + 8001a92c: 45dd li a1,23 + 8001a92e: 00009097 auipc ra,0x9 + 8001a932: 816080e7 jalr -2026(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001a936: 0000 unimp + ptr::copy(path.as_ptr().offset(start as isize), name.as_mut_ptr(), count); + 8001a938: 75e6 ld a1,120(sp) + 8001a93a: 650a ld a0,128(sp) + 8001a93c: 00006097 auipc ra,0x6 + 8001a940: bc2080e7 jalr -1086(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 8001a944: f02a sd a0,32(sp) + 8001a946: a009 j 8001a948 <.LBB7_45+0x24> + 8001a948: 65c6 ld a1,80(sp) + 8001a94a: 7502 ld a0,32(sp) + 8001a94c: 00006097 auipc ra,0x6 + 8001a950: dbe080e7 jalr -578(ra) # 8002070a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE> + 8001a954: ec2a sd a0,24(sp) + 8001a956: a009 j 8001a958 <.LBB7_45+0x34> + 8001a958: 7546 ld a0,112(sp) + 8001a95a: 45b9 li a1,14 + 8001a95c: 00006097 auipc ra,0x6 + 8001a960: b00080e7 jalr -1280(ra) # 8002045c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h69a6648c691317bcE> + 8001a964: e82a sd a0,16(sp) + 8001a966: a009 j 8001a968 <.LBB7_45+0x44> + 8001a968: 7662 ld a2,56(sp) + 8001a96a: 65e2 ld a1,24(sp) + 8001a96c: 6542 ld a0,16(sp) + 8001a96e: 0000b097 auipc ra,0xb + 8001a972: 72a080e7 jalr 1834(ra) # 80026098 + 8001a976: a009 j 8001a978 <.LBB7_45+0x54> + 8001a978: 75e2 ld a1,56(sp) + 8001a97a: 4535 li a0,13 + name[count] = 0; + 8001a97c: 0eb56463 bltu a0,a1,8001aa64 <.LBB7_53+0x16> + 8001a980: a009 j 8001a982 <.LBB7_45+0x5e> + 8001a982: 7546 ld a0,112(sp) + 8001a984: 75e2 ld a1,56(sp) + 8001a986: 95aa add a1,a1,a0 + 8001a988: 4501 li a0,0 + 8001a98a: 00a58023 sb a0,0(a1) + while path[cur] == b'/' { + 8001a98e: a009 j 8001a990 <.LBB7_45+0x6c> + 8001a990: 75e6 ld a1,120(sp) + 8001a992: 652a ld a0,136(sp) + 8001a994: e42a sd a0,8(sp) + 8001a996: 0eb57263 bgeu a0,a1,8001aa7a <.LBB7_54+0x14> + 8001a99a: a009 j 8001a99c <.LBB7_45+0x78> + 8001a99c: 650a ld a0,128(sp) + 8001a99e: 65a2 ld a1,8(sp) + 8001a9a0: 952e add a0,a0,a1 + 8001a9a2: 00054503 lbu a0,0(a0) + 8001a9a6: 02f00593 li a1,47 + 8001a9aa: 00b50663 beq a0,a1,8001a9b6 <.LBB7_45+0x92> + 8001a9ae: a009 j 8001a9b0 <.LBB7_45+0x8c> + cur + 8001a9b0: 652a ld a0,136(sp) + 8001a9b2: e92a sd a0,144(sp) +} + 8001a9b4: a819 j 8001a9ca <.LBB7_45+0xa6> + cur += 1; + 8001a9b6: 65aa ld a1,136(sp) + 8001a9b8: 00158513 addi a0,a1,1 + 8001a9bc: e02a sd a0,0(sp) + 8001a9be: 0cb56963 bltu a0,a1,8001aa90 <.LBB7_56> + 8001a9c2: a009 j 8001a9c4 <.LBB7_45+0xa0> + 8001a9c4: 6502 ld a0,0(sp) + 8001a9c6: e52a sd a0,136(sp) + while path[cur] == b'/' { + 8001a9c8: b7e1 j 8001a990 <.LBB7_45+0x6c> +} + 8001a9ca: 654a ld a0,144(sp) + 8001a9cc: 60ae ld ra,200(sp) + 8001a9ce: 6169 addi sp,sp,208 + 8001a9d0: 8082 ret + while path[cur] == b'/' { + 8001a9d2: 75e6 ld a1,120(sp) + 8001a9d4: 7526 ld a0,104(sp) + +000000008001a9d6 <.LBB7_46>: + 8001a9d6: 00011617 auipc a2,0x11 + 8001a9da: 47a60613 addi a2,a2,1146 # 8002be50 <.L__unnamed_41> + 8001a9de: 00008097 auipc ra,0x8 + 8001a9e2: 792080e7 jalr 1938(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001a9e6: 0000 unimp + if path[cur] == 0 { + 8001a9e8: 75e6 ld a1,120(sp) + 8001a9ea: 7506 ld a0,96(sp) + +000000008001a9ec <.LBB7_47>: + 8001a9ec: 00011617 auipc a2,0x11 + 8001a9f0: 47c60613 addi a2,a2,1148 # 8002be68 <.L__unnamed_42> + 8001a9f4: 00008097 auipc ra,0x8 + 8001a9f8: 77c080e7 jalr 1916(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001a9fc: 0000 unimp + while path[cur] != b'/' && path[cur] != 0 { + 8001a9fe: 75e6 ld a1,120(sp) + 8001aa00: 6526 ld a0,72(sp) + +000000008001aa02 <.LBB7_48>: + 8001aa02: 00011617 auipc a2,0x11 + 8001aa06: 47e60613 addi a2,a2,1150 # 8002be80 <.L__unnamed_43> + 8001aa0a: 00008097 auipc ra,0x8 + 8001aa0e: 766080e7 jalr 1894(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001aa12: 0000 unimp + 8001aa14: 75e6 ld a1,120(sp) + 8001aa16: 6506 ld a0,64(sp) + +000000008001aa18 <.LBB7_49>: + 8001aa18: 00011617 auipc a2,0x11 + 8001aa1c: 48060613 addi a2,a2,1152 # 8002be98 <.L__unnamed_44> + 8001aa20: 00008097 auipc ra,0x8 + 8001aa24: 750080e7 jalr 1872(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008001aa2a <.LBB7_50>: + cur += 1; + 8001aa2a: 00011517 auipc a0,0x11 + 8001aa2e: 0a650513 addi a0,a0,166 # 8002bad0 + +000000008001aa32 <.LBB7_51>: + 8001aa32: 00011617 auipc a2,0x11 + 8001aa36: 47e60613 addi a2,a2,1150 # 8002beb0 <.L__unnamed_45> + 8001aa3a: 45f1 li a1,28 + 8001aa3c: 00008097 auipc ra,0x8 + 8001aa40: 708080e7 jalr 1800(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001aa46 <.LBB7_52>: + let mut count = cur - start; + 8001aa46: 00011517 auipc a0,0x11 + 8001aa4a: 0da50513 addi a0,a0,218 # 8002bb20 + +000000008001aa4e <.LBB7_53>: + 8001aa4e: 00011617 auipc a2,0x11 + 8001aa52: 47a60613 addi a2,a2,1146 # 8002bec8 <.L__unnamed_46> + 8001aa56: 02100593 li a1,33 + 8001aa5a: 00008097 auipc ra,0x8 + 8001aa5e: 6ea080e7 jalr 1770(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001aa62: 0000 unimp + name[count] = 0; + 8001aa64: 7562 ld a0,56(sp) + +000000008001aa66 <.LBB7_54>: + 8001aa66: 00011617 auipc a2,0x11 + 8001aa6a: 4aa60613 addi a2,a2,1194 # 8002bf10 <.L__unnamed_47> + 8001aa6e: 45b9 li a1,14 + 8001aa70: 00008097 auipc ra,0x8 + 8001aa74: 700080e7 jalr 1792(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001aa78: 0000 unimp + while path[cur] == b'/' { + 8001aa7a: 75e6 ld a1,120(sp) + 8001aa7c: 6522 ld a0,8(sp) + +000000008001aa7e <.LBB7_55>: + 8001aa7e: 00011617 auipc a2,0x11 + 8001aa82: 4aa60613 addi a2,a2,1194 # 8002bf28 <.L__unnamed_48> + 8001aa86: 00008097 auipc ra,0x8 + 8001aa8a: 6ea080e7 jalr 1770(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008001aa90 <.LBB7_56>: + cur += 1; + 8001aa90: 00011517 auipc a0,0x11 + 8001aa94: 04050513 addi a0,a0,64 # 8002bad0 + +000000008001aa98 <.LBB7_57>: + 8001aa98: 00011617 auipc a2,0x11 + 8001aa9c: 4a860613 addi a2,a2,1192 # 8002bf40 <.L__unnamed_49> + 8001aaa0: 45f1 li a1,28 + 8001aaa2: 00008097 auipc ra,0x8 + 8001aaa6: 6a2080e7 jalr 1698(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001aaac <.LBB7_58>: + cur += 1; + 8001aaac: 00011517 auipc a0,0x11 + 8001aab0: 02450513 addi a0,a0,36 # 8002bad0 + +000000008001aab4 <.LBB7_59>: + 8001aab4: 00011617 auipc a2,0x11 + 8001aab8: 4a460613 addi a2,a2,1188 # 8002bf58 <.L__unnamed_50> + 8001aabc: 45f1 li a1,28 + 8001aabe: 00008097 auipc ra,0x8 + 8001aac2: 686080e7 jalr 1670(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData4stat17h1253d1c76b7156e3E: + +000000008001aac8 <_ZN6kernel2fs5inode9InodeData4stat17h1253d1c76b7156e3E>: + pub fn stat(&self, stat: &mut Stat) { + 8001aac8: 1141 addi sp,sp,-16 + 8001aaca: e02a sd a0,0(sp) + 8001aacc: e42e sd a1,8(sp) + stat.dev = self.dev; + 8001aace: 4110 lw a2,0(a0) + 8001aad0: c190 sw a2,0(a1) + stat.inum = self.inum; + 8001aad2: 4150 lw a2,4(a0) + 8001aad4: c1d0 sw a2,4(a1) + stat.itype = self.dinode.itype; + 8001aad6: 00851603 lh a2,8(a0) + 8001aada: 00c59423 sh a2,8(a1) + stat.nlink = self.dinode.nlink; + 8001aade: 00e51603 lh a2,14(a0) + 8001aae2: 00c59523 sh a2,10(a1) + stat.size = self.dinode.size as usize; + 8001aae6: 01056503 lwu a0,16(a0) + 8001aaea: e988 sd a0,16(a1) + } + 8001aaec: 0141 addi sp,sp,16 + 8001aaee: 8082 ret + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E: + +000000008001aaf0 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E>: + pub fn truncate(&mut self, inode: &Inode) { + 8001aaf0: 7149 addi sp,sp,-368 + 8001aaf2: f686 sd ra,360(sp) + 8001aaf4: e4ae sd a1,72(sp) + 8001aaf6: e8aa sd a0,80(sp) + 8001aaf8: ee2a sd a0,280(sp) + 8001aafa: f22e sd a1,288(sp) + 8001aafc: 4501 li a0,0 + for i in 0..NDIRECT { + 8001aafe: f4aa sd a0,104(sp) + 8001ab00: 45b1 li a1,12 + 8001ab02: f8ae sd a1,112(sp) + 8001ab04: 00006097 auipc ra,0x6 + 8001ab08: d0c080e7 jalr -756(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8001ab0c: ecaa sd a0,88(sp) + 8001ab0e: f0ae sd a1,96(sp) + 8001ab10: a009 j 8001ab12 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x22> + 8001ab12: 7506 ld a0,96(sp) + 8001ab14: 65e6 ld a1,88(sp) + 8001ab16: fcae sd a1,120(sp) + 8001ab18: e12a sd a0,128(sp) + 8001ab1a: a009 j 8001ab1c <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x2c> + 8001ab1c: 18a8 addi a0,sp,120 + 8001ab1e: 00006097 auipc ra,0x6 + 8001ab22: c84080e7 jalr -892(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001ab26: e52a sd a0,136(sp) + 8001ab28: e92e sd a1,144(sp) + 8001ab2a: a009 j 8001ab2c <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x3c> + 8001ab2c: 652a ld a0,136(sp) + 8001ab2e: 4581 li a1,0 + 8001ab30: 00b50463 beq a0,a1,8001ab38 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x48> + 8001ab34: a009 j 8001ab36 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x46> + 8001ab36: a801 j 8001ab46 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x56> + if self.dinode.addrs[NDIRECT] > 0 { + 8001ab38: 6546 ld a0,80(sp) + 8001ab3a: 4168 lw a0,68(a0) + 8001ab3c: 4581 li a1,0 + 8001ab3e: 06b51863 bne a0,a1,8001abae <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0xbe> + 8001ab42: a061 j 8001abca <.LBB9_39+0x14> + for i in 0..NDIRECT { + 8001ab44: 0000 unimp + 8001ab46: 65ca ld a1,144(sp) + 8001ab48: e0ae sd a1,64(sp) + 8001ab4a: f62e sd a1,296(sp) + 8001ab4c: fa2e sd a1,304(sp) + 8001ab4e: fe2e sd a1,312(sp) + 8001ab50: 4531 li a0,12 + if self.dinode.addrs[i] > 0 { + 8001ab52: 16b56663 bltu a0,a1,8001acbe <.LBB9_39+0x108> + 8001ab56: a009 j 8001ab58 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x68> + 8001ab58: 6546 ld a0,80(sp) + 8001ab5a: 6586 ld a1,64(sp) + 8001ab5c: 058a slli a1,a1,0x2 + 8001ab5e: 952e add a0,a0,a1 + 8001ab60: 4948 lw a0,20(a0) + 8001ab62: 4581 li a1,0 + 8001ab64: 00b50c63 beq a0,a1,8001ab7c <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x8c> + 8001ab68: a009 j 8001ab6a <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x7a> + bfree(inode.dev, self.dinode.addrs[i]); + 8001ab6a: 6506 ld a0,64(sp) + 8001ab6c: 65a6 ld a1,72(sp) + 8001ab6e: 0085e583 lwu a1,8(a1) + 8001ab72: fc2e sd a1,56(sp) + 8001ab74: 45b5 li a1,13 + 8001ab76: 00b56463 bltu a0,a1,8001ab7e <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x8e> + 8001ab7a: aaa9 j 8001acd4 <.LBB9_40+0x14> + if self.dinode.addrs[i] > 0 { + 8001ab7c: a805 j 8001abac <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0xbc> + bfree(inode.dev, self.dinode.addrs[i]); + 8001ab7e: 7562 ld a0,56(sp) + 8001ab80: 65c6 ld a1,80(sp) + 8001ab82: 6606 ld a2,64(sp) + 8001ab84: 060a slli a2,a2,0x2 + 8001ab86: 95b2 add a1,a1,a2 + 8001ab88: 49cc lw a1,20(a1) + 8001ab8a: fffea097 auipc ra,0xfffea + 8001ab8e: 1bc080e7 jalr 444(ra) # 80004d46 <_ZN6kernel2fs6bitmap5bfree17h2d4cb92b39e2512aE> + 8001ab92: a009 j 8001ab94 <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0xa4> + 8001ab94: 6586 ld a1,64(sp) + 8001ab96: 4531 li a0,12 + self.dinode.addrs[i] = 0; + 8001ab98: 14b56963 bltu a0,a1,8001acea <.LBB9_41+0x14> + 8001ab9c: a009 j 8001ab9e <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0xae> + 8001ab9e: 6546 ld a0,80(sp) + 8001aba0: 6586 ld a1,64(sp) + 8001aba2: 058a slli a1,a1,0x2 + 8001aba4: 95aa add a1,a1,a0 + 8001aba6: 4501 li a0,0 + 8001aba8: c9c8 sw a0,20(a1) + if self.dinode.addrs[i] > 0 { + 8001abaa: a009 j 8001abac <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0xbc> + for i in 0..NDIRECT { + 8001abac: bf85 j 8001ab1c <_ZN6kernel2fs5inode9InodeData8truncate17h7f63e14f2a03d309E+0x2c> + let buf = BCACHE.bread(inode.dev, self.dinode.addrs[NDIRECT]); + 8001abae: 6526 ld a0,72(sp) + 8001abb0: 65c6 ld a1,80(sp) + 8001abb2: 41f4 lw a3,68(a1) + 8001abb4: 4510 lw a2,8(a0) + +000000008001abb6 <.LBB9_39>: + 8001abb6: 00015597 auipc a1,0x15 + 8001abba: 44a58593 addi a1,a1,1098 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8001abbe: 0928 addi a0,sp,152 + 8001abc0: fffe9097 auipc ra,0xfffe9 + 8001abc4: ad4080e7 jalr -1324(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 8001abc8: a011 j 8001abcc <.LBB9_39+0x16> + if self.dinode.addrs[NDIRECT] > 0 { + 8001abca: a8f9 j 8001aca8 <.LBB9_39+0xf2> + 8001abcc: 0928 addi a0,sp,152 + let buf_ptr = buf.raw_data() as *const BlockNo; + 8001abce: fffe9097 auipc ra,0xfffe9 + 8001abd2: c0c080e7 jalr -1012(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 8001abd6: f82a sd a0,48(sp) + 8001abd8: a009 j 8001abda <.LBB9_39+0x24> + 8001abda: 7542 ld a0,48(sp) + 8001abdc: 85aa mv a1,a0 + 8001abde: ec2e sd a1,24(sp) + 8001abe0: e2aa sd a0,320(sp) + 8001abe2: 4501 li a0,0 + for i in 0..NINDIRECT { + 8001abe4: e1aa sd a0,192(sp) + 8001abe6: 08000593 li a1,128 + 8001abea: e5ae sd a1,200(sp) + 8001abec: 00006097 auipc ra,0x6 + 8001abf0: c24080e7 jalr -988(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8001abf4: f02a sd a0,32(sp) + 8001abf6: f42e sd a1,40(sp) + 8001abf8: a009 j 8001abfa <.LBB9_39+0x44> + 8001abfa: 7522 ld a0,40(sp) + 8001abfc: 7582 ld a1,32(sp) + 8001abfe: e9ae sd a1,208(sp) + 8001ac00: edaa sd a0,216(sp) + 8001ac02: a009 j 8001ac04 <.LBB9_39+0x4e> + 8001ac04: 0988 addi a0,sp,208 + 8001ac06: 00006097 auipc ra,0x6 + 8001ac0a: b9c080e7 jalr -1124(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001ac0e: f1aa sd a0,224(sp) + 8001ac10: f5ae sd a1,232(sp) + 8001ac12: a009 j 8001ac14 <.LBB9_39+0x5e> + 8001ac14: 750e ld a0,224(sp) + 8001ac16: 4581 li a1,0 + 8001ac18: 00b50463 beq a0,a1,8001ac20 <.LBB9_39+0x6a> + 8001ac1c: a009 j 8001ac1e <.LBB9_39+0x68> + 8001ac1e: a015 j 8001ac42 <.LBB9_39+0x8c> + drop(buf); + 8001ac20: 756a ld a0,184(sp) + 8001ac22: ea2a sd a0,272(sp) + 8001ac24: 754a ld a0,176(sp) + 8001ac26: e62a sd a0,264(sp) + 8001ac28: 752a ld a0,168(sp) + 8001ac2a: e22a sd a0,256(sp) + 8001ac2c: 750a ld a0,160(sp) + 8001ac2e: fdaa sd a0,248(sp) + 8001ac30: 656a ld a0,152(sp) + 8001ac32: f9aa sd a0,240(sp) + 8001ac34: 1988 addi a0,sp,240 + 8001ac36: 00003097 auipc ra,0x3 + 8001ac3a: 2e8080e7 jalr 744(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 8001ac3e: a881 j 8001ac8e <.LBB9_39+0xd8> + for i in 0..NINDIRECT { + 8001ac40: 0000 unimp + 8001ac42: 6562 ld a0,24(sp) + 8001ac44: 75ae ld a1,232(sp) + 8001ac46: e6ae sd a1,328(sp) + 8001ac48: eaae sd a1,336(sp) + 8001ac4a: eeae sd a1,344(sp) + let bn = unsafe{ read(buf_ptr.offset(i as isize)) }; + 8001ac4c: fffea097 auipc ra,0xfffea + 8001ac50: c96080e7 jalr -874(ra) # 800048e2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h936ab5e813f51efdE> + 8001ac54: e82a sd a0,16(sp) + 8001ac56: a009 j 8001ac58 <.LBB9_39+0xa2> + 8001ac58: 6542 ld a0,16(sp) + 8001ac5a: fffff097 auipc ra,0xfffff + 8001ac5e: 842080e7 jalr -1982(ra) # 8001949c <_ZN4core3ptr4read17h97f5e0e151e0fdc4E> + 8001ac62: 85aa mv a1,a0 + 8001ac64: e42e sd a1,8(sp) + 8001ac66: 16a12223 sw a0,356(sp) + 8001ac6a: a009 j 8001ac6c <.LBB9_39+0xb6> + if bn > 0 { + 8001ac6c: 6522 ld a0,8(sp) + 8001ac6e: 2501 sext.w a0,a0 + 8001ac70: 4581 li a1,0 + 8001ac72: 00b50b63 beq a0,a1,8001ac88 <.LBB9_39+0xd2> + 8001ac76: a009 j 8001ac78 <.LBB9_39+0xc2> + bfree(inode.dev, bn); + 8001ac78: 65a2 ld a1,8(sp) + 8001ac7a: 6526 ld a0,72(sp) + 8001ac7c: 4508 lw a0,8(a0) + 8001ac7e: fffea097 auipc ra,0xfffea + 8001ac82: 0c8080e7 jalr 200(ra) # 80004d46 <_ZN6kernel2fs6bitmap5bfree17h2d4cb92b39e2512aE> + 8001ac86: a011 j 8001ac8a <.LBB9_39+0xd4> + if bn > 0 { + 8001ac88: a011 j 8001ac8c <.LBB9_39+0xd6> + 8001ac8a: a009 j 8001ac8c <.LBB9_39+0xd6> + for i in 0..NINDIRECT { + 8001ac8c: bfa5 j 8001ac04 <.LBB9_39+0x4e> + bfree(inode.dev, self.dinode.addrs[NDIRECT]); + 8001ac8e: 6526 ld a0,72(sp) + 8001ac90: 65c6 ld a1,80(sp) + 8001ac92: 41ec lw a1,68(a1) + 8001ac94: 4508 lw a0,8(a0) + 8001ac96: fffea097 auipc ra,0xfffea + 8001ac9a: 0b0080e7 jalr 176(ra) # 80004d46 <_ZN6kernel2fs6bitmap5bfree17h2d4cb92b39e2512aE> + 8001ac9e: a009 j 8001aca0 <.LBB9_39+0xea> + 8001aca0: 65c6 ld a1,80(sp) + 8001aca2: 4501 li a0,0 + self.dinode.addrs[NDIRECT] = 0; + 8001aca4: c1e8 sw a0,68(a1) + if self.dinode.addrs[NDIRECT] > 0 { + 8001aca6: a009 j 8001aca8 <.LBB9_39+0xf2> + 8001aca8: 6546 ld a0,80(sp) + 8001acaa: 4581 li a1,0 + self.dinode.size = 0; + 8001acac: c90c sw a1,16(a0) + self.update(); + 8001acae: 00000097 auipc ra,0x0 + 8001acb2: 052080e7 jalr 82(ra) # 8001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE> + 8001acb6: a009 j 8001acb8 <.LBB9_39+0x102> + } + 8001acb8: 70b6 ld ra,360(sp) + 8001acba: 6175 addi sp,sp,368 + 8001acbc: 8082 ret + if self.dinode.addrs[i] > 0 { + 8001acbe: 6506 ld a0,64(sp) + +000000008001acc0 <.LBB9_40>: + 8001acc0: 00011617 auipc a2,0x11 + 8001acc4: 2b060613 addi a2,a2,688 # 8002bf70 <.L__unnamed_51> + 8001acc8: 45b5 li a1,13 + 8001acca: 00008097 auipc ra,0x8 + 8001acce: 4a6080e7 jalr 1190(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001acd2: 0000 unimp + bfree(inode.dev, self.dinode.addrs[i]); + 8001acd4: 6506 ld a0,64(sp) + +000000008001acd6 <.LBB9_41>: + 8001acd6: 00011617 auipc a2,0x11 + 8001acda: 2b260613 addi a2,a2,690 # 8002bf88 <.L__unnamed_52> + 8001acde: 45b5 li a1,13 + 8001ace0: 00008097 auipc ra,0x8 + 8001ace4: 490080e7 jalr 1168(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001ace8: 0000 unimp + self.dinode.addrs[i] = 0; + 8001acea: 6506 ld a0,64(sp) + +000000008001acec <.LBB9_42>: + 8001acec: 00011617 auipc a2,0x11 + 8001acf0: 2b460613 addi a2,a2,692 # 8002bfa0 <.L__unnamed_53> + 8001acf4: 45b5 li a1,13 + 8001acf6: 00008097 auipc ra,0x8 + 8001acfa: 47a080e7 jalr 1146(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE: + +000000008001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE>: + pub fn update(&mut self) { + 8001ad00: 7115 addi sp,sp,-224 + 8001ad02: ed86 sd ra,216(sp) + 8001ad04: ec2a sd a0,24(sp) + 8001ad06: e1aa sd a0,192(sp) + self.dev, + 8001ad08: 00056583 lwu a1,0(a0) + unsafe { SUPER_BLOCK.locate_inode(self.inum)} + 8001ad0c: f02e sd a1,32(sp) + 8001ad0e: 414c lw a1,4(a0) + +000000008001ad10 <.LBB10_8>: + 8001ad10: 00049517 auipc a0,0x49 + 8001ad14: 39050513 addi a0,a0,912 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 8001ad18: fffed097 auipc ra,0xfffed + 8001ad1c: bee080e7 jalr -1042(ra) # 80007906 <_ZN6kernel2fs10superblock10SuperBlock12locate_inode17hc2dbfb20b9411e7cE> + 8001ad20: f42a sd a0,40(sp) + 8001ad22: a009 j 8001ad24 <.LBB10_8+0x14> + let mut buf = BCACHE.bread( + 8001ad24: 76a2 ld a3,40(sp) + 8001ad26: 7602 ld a2,32(sp) + +000000008001ad28 <.LBB10_9>: + 8001ad28: 00015597 auipc a1,0x15 + 8001ad2c: 2d858593 addi a1,a1,728 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8001ad30: 1808 addi a0,sp,48 + 8001ad32: fffe9097 auipc ra,0xfffe9 + 8001ad36: 962080e7 jalr -1694(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 8001ad3a: a009 j 8001ad3c <.LBB10_9+0x14> + let offset = locate_inode_offset(self.inum) as isize; + 8001ad3c: 6562 ld a0,24(sp) + 8001ad3e: 4148 lw a0,4(a0) + 8001ad40: 00001097 auipc ra,0x1 + 8001ad44: 126080e7 jalr 294(ra) # 8001be66 <_ZN6kernel2fs5inode19locate_inode_offset17h88c1ade407c59915E> + 8001ad48: e82a sd a0,16(sp) + 8001ad4a: a009 j 8001ad4c <.LBB10_9+0x24> + 8001ad4c: 6542 ld a0,16(sp) + 8001ad4e: e5aa sd a0,200(sp) + 8001ad50: 1808 addi a0,sp,48 + let dinode = unsafe{ (buf.raw_data_mut() as *mut DiskInode).offset(offset) }; + 8001ad52: fffe9097 auipc ra,0xfffe9 + 8001ad56: acc080e7 jalr -1332(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 8001ad5a: e42a sd a0,8(sp) + 8001ad5c: a009 j 8001ad5e <.LBB10_9+0x36> + 8001ad5e: 65c2 ld a1,16(sp) + 8001ad60: 6522 ld a0,8(sp) + 8001ad62: ffffe097 auipc ra,0xffffe + 8001ad66: 4a4080e7 jalr 1188(ra) # 80019206 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hf7573a6302c08e61E> + 8001ad6a: 85aa mv a1,a0 + 8001ad6c: e02e sd a1,0(sp) + 8001ad6e: e9aa sd a0,208(sp) + 8001ad70: a009 j 8001ad72 <.LBB10_9+0x4a> + unsafe{ write(dinode, self.dinode) }; + 8001ad72: 6502 ld a0,0(sp) + 8001ad74: 65e2 ld a1,24(sp) + 8001ad76: 0405e683 lwu a3,64(a1) + 8001ad7a: 0445e603 lwu a2,68(a1) + 8001ad7e: 1602 slli a2,a2,0x20 + 8001ad80: 8e55 or a2,a2,a3 + 8001ad82: e932 sd a2,144(sp) + 8001ad84: 0385e683 lwu a3,56(a1) + 8001ad88: 03c5e603 lwu a2,60(a1) + 8001ad8c: 1602 slli a2,a2,0x20 + 8001ad8e: 8e55 or a2,a2,a3 + 8001ad90: e532 sd a2,136(sp) + 8001ad92: 0305e683 lwu a3,48(a1) + 8001ad96: 0345e603 lwu a2,52(a1) + 8001ad9a: 1602 slli a2,a2,0x20 + 8001ad9c: 8e55 or a2,a2,a3 + 8001ad9e: e132 sd a2,128(sp) + 8001ada0: 0285e683 lwu a3,40(a1) + 8001ada4: 02c5e603 lwu a2,44(a1) + 8001ada8: 1602 slli a2,a2,0x20 + 8001adaa: 8e55 or a2,a2,a3 + 8001adac: fcb2 sd a2,120(sp) + 8001adae: 0205e683 lwu a3,32(a1) + 8001adb2: 0245e603 lwu a2,36(a1) + 8001adb6: 1602 slli a2,a2,0x20 + 8001adb8: 8e55 or a2,a2,a3 + 8001adba: f8b2 sd a2,112(sp) + 8001adbc: 0185e683 lwu a3,24(a1) + 8001adc0: 01c5e603 lwu a2,28(a1) + 8001adc4: 1602 slli a2,a2,0x20 + 8001adc6: 8e55 or a2,a2,a3 + 8001adc8: f4b2 sd a2,104(sp) + 8001adca: 0105e683 lwu a3,16(a1) + 8001adce: 0145e603 lwu a2,20(a1) + 8001add2: 1602 slli a2,a2,0x20 + 8001add4: 8e55 or a2,a2,a3 + 8001add6: f0b2 sd a2,96(sp) + 8001add8: 0085e603 lwu a2,8(a1) + 8001addc: 00c5e583 lwu a1,12(a1) + 8001ade0: 1582 slli a1,a1,0x20 + 8001ade2: 8dd1 or a1,a1,a2 + 8001ade4: ecae sd a1,88(sp) + 8001ade6: 08ac addi a1,sp,88 + 8001ade8: fffff097 auipc ra,0xfffff + 8001adec: 8b0080e7 jalr -1872(ra) # 80019698 <_ZN4core3ptr5write17h24d2ac6ea724fbc0E> + 8001adf0: a009 j 8001adf2 <.LBB10_9+0xca> + LOG.write(buf); + 8001adf2: 6546 ld a0,80(sp) + 8001adf4: fd2a sd a0,184(sp) + 8001adf6: 6526 ld a0,72(sp) + 8001adf8: f92a sd a0,176(sp) + 8001adfa: 6506 ld a0,64(sp) + 8001adfc: f52a sd a0,168(sp) + 8001adfe: 7562 ld a0,56(sp) + 8001ae00: f12a sd a0,160(sp) + 8001ae02: 7542 ld a0,48(sp) + 8001ae04: ed2a sd a0,152(sp) + +000000008001ae06 <.LBB10_10>: + 8001ae06: 00040517 auipc a0,0x40 + 8001ae0a: 6d250513 addi a0,a0,1746 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001ae0e: 092c addi a1,sp,152 + 8001ae10: fffee097 auipc ra,0xfffee + 8001ae14: 7bc080e7 jalr 1980(ra) # 800095cc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE> + 8001ae18: a009 j 8001ae1a <.LBB10_10+0x14> + } + 8001ae1a: 60ee ld ra,216(sp) + 8001ae1c: 612d addi sp,sp,224 + 8001ae1e: 8082 ret + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E: + +000000008001ae20 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E>: + pub fn bmap(&mut self, offset_bn: u32) -> Result { + 8001ae20: 7111 addi sp,sp,-256 + 8001ae22: fd86 sd ra,248(sp) + 8001ae24: ecae sd a1,88(sp) + 8001ae26: 85aa mv a1,a0 + 8001ae28: 6566 ld a0,88(sp) + 8001ae2a: f0ae sd a1,96(sp) + 8001ae2c: 0006059b sext.w a1,a2 + 8001ae30: e9aa sd a0,208(sp) + 8001ae32: cfb2 sw a2,220(sp) + 8001ae34: 4501 li a0,0 + let mut addr; + 8001ae36: 0ca107a3 sb a0,207(sp) + let offset_bn = offset_bn as usize; + 8001ae3a: 02061513 slli a0,a2,0x20 + 8001ae3e: 9101 srli a0,a0,0x20 + 8001ae40: f4aa sd a0,104(sp) + 8001ae42: f1aa sd a0,224(sp) + 8001ae44: 452d li a0,11 + if offset_bn < NDIRECT { + 8001ae46: 00b56863 bltu a0,a1,8001ae56 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x36> + 8001ae4a: a009 j 8001ae4c <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x2c> + 8001ae4c: 7526 ld a0,104(sp) + 8001ae4e: 45b5 li a1,13 + if self.dinode.addrs[offset_bn] == 0 { + 8001ae50: 00b56963 bltu a0,a1,8001ae62 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x42> + 8001ae54: a2e1 j 8001b01c <.LBB11_37+0x44> + 8001ae56: 7526 ld a0,104(sp) + 8001ae58: 08c00593 li a1,140 + if offset_bn < NINDIRECT + NDIRECT { + 8001ae5c: 06b56963 bltu a0,a1,8001aece <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0xae> + 8001ae60: a8b5 j 8001aedc <.LBB11_34> + if self.dinode.addrs[offset_bn] == 0 { + 8001ae62: 6566 ld a0,88(sp) + 8001ae64: 75a6 ld a1,104(sp) + 8001ae66: 058a slli a1,a1,0x2 + 8001ae68: 952e add a0,a0,a1 + 8001ae6a: 4948 lw a0,20(a0) + 8001ae6c: 4581 li a1,0 + 8001ae6e: 00b51b63 bne a0,a1,8001ae84 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x64> + 8001ae72: a009 j 8001ae74 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x54> + addr = balloc(self.dev); + 8001ae74: 6566 ld a0,88(sp) + 8001ae76: 4108 lw a0,0(a0) + 8001ae78: fffea097 auipc ra,0xfffea + 8001ae7c: fde080e7 jalr -34(ra) # 80004e56 <_ZN6kernel2fs6bitmap6balloc17hb1927bc98cc6e122E> + 8001ae80: e8aa sd a0,80(sp) + 8001ae82: a031 j 8001ae8e <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x6e> + 8001ae84: 7526 ld a0,104(sp) + 8001ae86: 45b5 li a1,13 + return Ok(self.dinode.addrs[offset_bn]) + 8001ae88: 02b56963 bltu a0,a1,8001aeba <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x9a> + 8001ae8c: a25d j 8001b032 <.LBB11_38+0x14> + addr = balloc(self.dev); + 8001ae8e: 75a6 ld a1,104(sp) + 8001ae90: 6546 ld a0,80(sp) + 8001ae92: daaa sw a0,116(sp) + self.dinode.addrs[offset_bn] = addr; + 8001ae94: 1502 slli a0,a0,0x20 + 8001ae96: 9101 srli a0,a0,0x20 + 8001ae98: e4aa sd a0,72(sp) + 8001ae9a: 4531 li a0,12 + 8001ae9c: 1ab56663 bltu a0,a1,8001b048 <.LBB11_39+0x14> + 8001aea0: a009 j 8001aea2 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E+0x82> + 8001aea2: 7586 ld a1,96(sp) + 8001aea4: 6526 ld a0,72(sp) + 8001aea6: 6666 ld a2,88(sp) + 8001aea8: 76a6 ld a3,104(sp) + 8001aeaa: 068a slli a3,a3,0x2 + 8001aeac: 9636 add a2,a2,a3 + 8001aeae: ca48 sw a0,20(a2) + return Ok(addr) + 8001aeb0: 5556 lw a0,116(sp) + 8001aeb2: c1c8 sw a0,4(a1) + 8001aeb4: 4501 li a0,0 + 8001aeb6: c188 sw a0,0(a1) + 8001aeb8: aa89 j 8001b00a <.LBB11_37+0x32> + return Ok(self.dinode.addrs[offset_bn]) + 8001aeba: 7586 ld a1,96(sp) + 8001aebc: 6566 ld a0,88(sp) + 8001aebe: 7626 ld a2,104(sp) + 8001aec0: 060a slli a2,a2,0x2 + 8001aec2: 9532 add a0,a0,a2 + 8001aec4: 4948 lw a0,20(a0) + 8001aec6: c1c8 sw a0,4(a1) + 8001aec8: 4501 li a0,0 + 8001aeca: c188 sw a0,0(a1) + 8001aecc: aa3d j 8001b00a <.LBB11_37+0x32> + let count = offset_bn - NDIRECT; + 8001aece: 7526 ld a0,104(sp) + 8001aed0: ff450593 addi a1,a0,-12 + 8001aed4: e0ae sd a1,64(sp) + 8001aed6: 18b56463 bltu a0,a1,8001b05e <.LBB11_41> + 8001aeda: a839 j 8001aef8 <.LBB11_35+0x14> + +000000008001aedc <.LBB11_34>: + panic!("inode bmap: out of range."); + 8001aedc: 00011517 auipc a0,0x11 + 8001aee0: 13c50513 addi a0,a0,316 # 8002c018 <.L__unnamed_54> + +000000008001aee4 <.LBB11_35>: + 8001aee4: 00011617 auipc a2,0x11 + 8001aee8: 15460613 addi a2,a2,340 # 8002c038 <.L__unnamed_55> + 8001aeec: 45e5 li a1,25 + 8001aeee: 00008097 auipc ra,0x8 + 8001aef2: 256080e7 jalr 598(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001aef6: 0000 unimp + let count = offset_bn - NDIRECT; + 8001aef8: 6566 ld a0,88(sp) + 8001aefa: 6586 ld a1,64(sp) + 8001aefc: f5ae sd a1,232(sp) + if self.dinode.addrs[NDIRECT] == 0 { + 8001aefe: 4168 lw a0,68(a0) + 8001af00: 4581 li a1,0 + 8001af02: 00b51b63 bne a0,a1,8001af18 <.LBB11_35+0x34> + 8001af06: a009 j 8001af08 <.LBB11_35+0x24> + addr = balloc(self.dev); + 8001af08: 6566 ld a0,88(sp) + 8001af0a: 4108 lw a0,0(a0) + 8001af0c: fffea097 auipc ra,0xfffea + 8001af10: f4a080e7 jalr -182(ra) # 80004e56 <_ZN6kernel2fs6bitmap6balloc17hb1927bc98cc6e122E> + 8001af14: fc2a sd a0,56(sp) + 8001af16: a029 j 8001af20 <.LBB11_35+0x3c> + addr = self.dinode.addrs[NDIRECT] + 8001af18: 6566 ld a0,88(sp) + 8001af1a: 4168 lw a0,68(a0) + 8001af1c: daaa sw a0,116(sp) + if self.dinode.addrs[NDIRECT] == 0 { + 8001af1e: a031 j 8001af2a <.LBB11_35+0x46> + addr = balloc(self.dev); + 8001af20: 7562 ld a0,56(sp) + 8001af22: 65e6 ld a1,88(sp) + 8001af24: daaa sw a0,116(sp) + self.dinode.addrs[NDIRECT] = addr; + 8001af26: c1e8 sw a0,68(a1) + if self.dinode.addrs[NDIRECT] == 0 { + 8001af28: a009 j 8001af2a <.LBB11_35+0x46> + let buf = BCACHE.bread(self.dev, addr); + 8001af2a: 6566 ld a0,88(sp) + 8001af2c: 4110 lw a2,0(a0) + 8001af2e: 4505 li a0,1 + 8001af30: 0ca107a3 sb a0,207(sp) + 8001af34: 56d6 lw a3,116(sp) + +000000008001af36 <.LBB11_36>: + 8001af36: 00015597 auipc a1,0x15 + 8001af3a: 0ca58593 addi a1,a1,202 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8001af3e: 18a8 addi a0,sp,120 + 8001af40: fffe8097 auipc ra,0xfffe8 + 8001af44: 754080e7 jalr 1876(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 8001af48: a009 j 8001af4a <.LBB11_36+0x14> + 8001af4a: 18a8 addi a0,sp,120 + let buf_data = buf.raw_data() as *mut u32; + 8001af4c: fffe9097 auipc ra,0xfffe9 + 8001af50: 88e080e7 jalr -1906(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 8001af54: f82a sd a0,48(sp) + 8001af56: a009 j 8001af58 <.LBB11_36+0x22> + 8001af58: 6586 ld a1,64(sp) + 8001af5a: 7542 ld a0,48(sp) + 8001af5c: 862a mv a2,a0 + 8001af5e: f032 sd a2,32(sp) + 8001af60: f9aa sd a0,240(sp) + addr = unsafe{ read(buf_data.offset(count as isize)) }; + 8001af62: fffee097 auipc ra,0xfffee + 8001af66: 1d4080e7 jalr 468(ra) # 80009136 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h9889ec684d0da599E> + 8001af6a: f42a sd a0,40(sp) + 8001af6c: a009 j 8001af6e <.LBB11_36+0x38> + 8001af6e: 7522 ld a0,40(sp) + 8001af70: ffffe097 auipc ra,0xffffe + 8001af74: 52c080e7 jalr 1324(ra) # 8001949c <_ZN4core3ptr4read17h97f5e0e151e0fdc4E> + 8001af78: ec2a sd a0,24(sp) + 8001af7a: a009 j 8001af7c <.LBB11_36+0x46> + 8001af7c: 6562 ld a0,24(sp) + 8001af7e: daaa sw a0,116(sp) + 8001af80: 2501 sext.w a0,a0 + 8001af82: 4581 li a1,0 + if addr == 0 { + 8001af84: 00b51b63 bne a0,a1,8001af9a <.LBB11_36+0x64> + 8001af88: a009 j 8001af8a <.LBB11_36+0x54> + addr = balloc(self.dev); + 8001af8a: 6566 ld a0,88(sp) + 8001af8c: 4108 lw a0,0(a0) + 8001af8e: fffea097 auipc ra,0xfffea + 8001af92: ec8080e7 jalr -312(ra) # 80004e56 <_ZN6kernel2fs6bitmap6balloc17hb1927bc98cc6e122E> + 8001af96: e82a sd a0,16(sp) + 8001af98: a011 j 8001af9c <.LBB11_36+0x66> + if addr == 0 { + 8001af9a: a891 j 8001afee <.LBB11_37+0x16> + addr = balloc(self.dev); + 8001af9c: 6586 ld a1,64(sp) + 8001af9e: 7502 ld a0,32(sp) + 8001afa0: 6642 ld a2,16(sp) + 8001afa2: dab2 sw a2,116(sp) + write(buf_data.offset(count as isize), addr); + 8001afa4: fffee097 auipc ra,0xfffee + 8001afa8: 192080e7 jalr 402(ra) # 80009136 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h9889ec684d0da599E> + 8001afac: e42a sd a0,8(sp) + 8001afae: a009 j 8001afb0 <.LBB11_36+0x7a> + 8001afb0: 6522 ld a0,8(sp) + 8001afb2: 55d6 lw a1,116(sp) + 8001afb4: ffffe097 auipc ra,0xffffe + 8001afb8: 6d8080e7 jalr 1752(ra) # 8001968c <_ZN4core3ptr5write17h10d6d8799e54bf75E> + 8001afbc: a009 j 8001afbe <.LBB11_36+0x88> + 8001afbe: 4501 li a0,0 + LOG.write(buf); + 8001afc0: 0ca107a3 sb a0,207(sp) + 8001afc4: 7566 ld a0,120(sp) + 8001afc6: f12a sd a0,160(sp) + 8001afc8: 650a ld a0,128(sp) + 8001afca: f52a sd a0,168(sp) + 8001afcc: 652a ld a0,136(sp) + 8001afce: f92a sd a0,176(sp) + 8001afd0: 654a ld a0,144(sp) + 8001afd2: fd2a sd a0,184(sp) + 8001afd4: 656a ld a0,152(sp) + 8001afd6: e1aa sd a0,192(sp) + +000000008001afd8 <.LBB11_37>: + 8001afd8: 00040517 auipc a0,0x40 + 8001afdc: 50050513 addi a0,a0,1280 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001afe0: 110c addi a1,sp,160 + 8001afe2: fffee097 auipc ra,0xfffee + 8001afe6: 5ea080e7 jalr 1514(ra) # 800095cc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE> + 8001afea: a009 j 8001afec <.LBB11_37+0x14> + if addr == 0 { + 8001afec: a009 j 8001afee <.LBB11_37+0x16> + return Ok(addr) + 8001afee: 7586 ld a1,96(sp) + 8001aff0: 5556 lw a0,116(sp) + 8001aff2: c1c8 sw a0,4(a1) + 8001aff4: 4501 li a0,0 + 8001aff6: c188 sw a0,0(a1) + } + 8001aff8: 0cf14503 lbu a0,207(sp) + 8001affc: 8905 andi a0,a0,1 + 8001affe: e909 bnez a0,8001b010 <.LBB11_37+0x38> + 8001b000: a009 j 8001b002 <.LBB11_37+0x2a> + 8001b002: 4501 li a0,0 + 8001b004: 0ca107a3 sb a0,207(sp) + 8001b008: a009 j 8001b00a <.LBB11_37+0x32> + } + 8001b00a: 70ee ld ra,248(sp) + 8001b00c: 6111 addi sp,sp,256 + 8001b00e: 8082 ret + 8001b010: 18a8 addi a0,sp,120 + } + 8001b012: fffec097 auipc ra,0xfffec + 8001b016: 000080e7 jalr ra # 80007012 <_ZN4core3ptr41drop_in_place$LT$kernel..fs..bio..Buf$GT$17hc35967244f3e9eb6E> + 8001b01a: b7e5 j 8001b002 <.LBB11_37+0x2a> + if self.dinode.addrs[offset_bn] == 0 { + 8001b01c: 7526 ld a0,104(sp) + +000000008001b01e <.LBB11_38>: + 8001b01e: 00011617 auipc a2,0x11 + 8001b022: f9a60613 addi a2,a2,-102 # 8002bfb8 <.L__unnamed_56> + 8001b026: 45b5 li a1,13 + 8001b028: 00008097 auipc ra,0x8 + 8001b02c: 148080e7 jalr 328(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001b030: 0000 unimp + return Ok(self.dinode.addrs[offset_bn]) + 8001b032: 7526 ld a0,104(sp) + +000000008001b034 <.LBB11_39>: + 8001b034: 00011617 auipc a2,0x11 + 8001b038: f9c60613 addi a2,a2,-100 # 8002bfd0 <.L__unnamed_57> + 8001b03c: 45b5 li a1,13 + 8001b03e: 00008097 auipc ra,0x8 + 8001b042: 132080e7 jalr 306(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001b046: 0000 unimp + self.dinode.addrs[offset_bn] = addr; + 8001b048: 7526 ld a0,104(sp) + +000000008001b04a <.LBB11_40>: + 8001b04a: 00011617 auipc a2,0x11 + 8001b04e: f9e60613 addi a2,a2,-98 # 8002bfe8 <.L__unnamed_58> + 8001b052: 45b5 li a1,13 + 8001b054: 00008097 auipc ra,0x8 + 8001b058: 11c080e7 jalr 284(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +000000008001b05e <.LBB11_41>: + let count = offset_bn - NDIRECT; + 8001b05e: 00011517 auipc a0,0x11 + 8001b062: ac250513 addi a0,a0,-1342 # 8002bb20 + +000000008001b066 <.LBB11_42>: + 8001b066: 00011617 auipc a2,0x11 + 8001b06a: f9a60613 addi a2,a2,-102 # 8002c000 <.L__unnamed_59> + 8001b06e: 02100593 li a1,33 + 8001b072: 00008097 auipc ra,0x8 + 8001b076: 0d2080e7 jalr 210(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E: + +000000008001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E>: + pub fn read( + 8001b07c: dc010113 addi sp,sp,-576 + 8001b080: 22113c23 sd ra,568(sp) + 8001b084: e13e sd a5,128(sp) + 8001b086: e93a sd a4,144(sp) + 8001b088: 8736 mv a4,a3 + 8001b08a: 86ae mv a3,a1 + 8001b08c: 658a ld a1,128(sp) + 8001b08e: e536 sd a3,136(sp) + 8001b090: 87aa mv a5,a0 + 8001b092: 654a ld a0,144(sp) + 8001b094: ed3e sd a5,152(sp) + 8001b096: 87ae mv a5,a1 + 8001b098: f13e sd a5,160(sp) + 8001b09a: 87aa mv a5,a0 + 8001b09c: f53e sd a5,168(sp) + 8001b09e: 87b2 mv a5,a2 + 8001b0a0: f93e sd a5,176(sp) + 8001b0a2: e5ba sd a4,200(sp) + 8001b0a4: efb6 sd a3,472(sp) + 8001b0a6: 1ec103a3 sb a2,487(sp) + 8001b0aa: 1ea12423 sw a0,488(sp) + 8001b0ae: 1eb12623 sw a1,492(sp) + let end = offset.checked_add(count).ok_or("Fail to add count.")?; + 8001b0b2: 00004097 auipc ra,0x4 + 8001b0b6: c84080e7 jalr -892(ra) # 8001ed36 <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E> + 8001b0ba: fd2a sd a0,184(sp) + 8001b0bc: e1ae sd a1,192(sp) + 8001b0be: a009 j 8001b0c0 <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E+0x44> + 8001b0c0: 660e ld a2,192(sp) + 8001b0c2: 75ea ld a1,184(sp) + +000000008001b0c4 <.LBB12_42>: + 8001b0c4: 00011697 auipc a3,0x11 + 8001b0c8: f8c68693 addi a3,a3,-116 # 8002c050 <.L__unnamed_60> + 8001b0cc: 11a8 addi a0,sp,232 + 8001b0ce: 4749 li a4,18 + 8001b0d0: ffff4097 auipc ra,0xffff4 + 8001b0d4: 156080e7 jalr 342(ra) # 8000f226 <_ZN4core6option15Option$LT$T$GT$5ok_or17hac03a53b0754fc14E> + 8001b0d8: a009 j 8001b0da <.LBB12_42+0x16> + 8001b0da: 0988 addi a0,sp,208 + 8001b0dc: 11ac addi a1,sp,232 + 8001b0de: ffff3097 auipc ra,0xffff3 + 8001b0e2: a08080e7 jalr -1528(ra) # 8000dae6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h3002ccf5391f70d3E> + 8001b0e6: a009 j 8001b0e8 <.LBB12_42+0x24> + 8001b0e8: 0d016503 lwu a0,208(sp) + 8001b0ec: 4581 li a1,0 + 8001b0ee: 00b50463 beq a0,a1,8001b0f6 <.LBB12_42+0x32> + 8001b0f2: a009 j 8001b0f4 <.LBB12_42+0x30> + 8001b0f4: a821 j 8001b10c <.LBB12_42+0x48> + 8001b0f6: 652a ld a0,136(sp) + 8001b0f8: 45de lw a1,212(sp) + 8001b0fa: 20b12023 sw a1,512(sp) + 8001b0fe: 20b12223 sw a1,516(sp) + if end > self.dinode.size { + 8001b102: 4908 lw a0,16(a0) + 8001b104: 02b56763 bltu a0,a1,8001b132 <.LBB12_42+0x6e> + 8001b108: a089 j 8001b14a <.LBB12_43+0x16> + let end = offset.checked_add(count).ok_or("Fail to add count.")?; + 8001b10a: 0000 unimp + 8001b10c: 656e ld a0,216(sp) + 8001b10e: 758e ld a1,224(sp) + 8001b110: fbaa sd a0,496(sp) + 8001b112: ffae sd a1,504(sp) + 8001b114: ffff1097 auipc ra,0xffff1 + 8001b118: 272080e7 jalr 626(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001b11c: f8aa sd a0,112(sp) + 8001b11e: fcae sd a1,120(sp) + 8001b120: a009 j 8001b122 <.LBB12_42+0x5e> + 8001b122: 7666 ld a2,120(sp) + 8001b124: 75c6 ld a1,112(sp) + 8001b126: 656a ld a0,152(sp) + 8001b128: ffff3097 auipc ra,0xffff3 + 8001b12c: 89e080e7 jalr -1890(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 8001b130: a411 j 8001b334 <.LBB12_45+0x5c> + return Err("inode read: end is more than diskinode's size.") + 8001b132: 65ea ld a1,152(sp) + +000000008001b134 <.LBB12_43>: + 8001b134: 00011517 auipc a0,0x11 + 8001b138: f2e50513 addi a0,a0,-210 # 8002c062 <.L__unnamed_61> + 8001b13c: e588 sd a0,8(a1) + 8001b13e: 02e00513 li a0,46 + 8001b142: e988 sd a0,16(a1) + 8001b144: 4505 li a0,1 + 8001b146: e188 sd a0,0(a1) + 8001b148: a2f5 j 8001b334 <.LBB12_45+0x5c> + 8001b14a: 752a ld a0,168(sp) + 8001b14c: 758a ld a1,160(sp) + 8001b14e: 4601 li a2,0 + let mut total: usize = 0; + 8001b150: e232 sd a2,256(sp) + let mut offset = offset as usize; + 8001b152: 02051613 slli a2,a0,0x20 + 8001b156: 9201 srli a2,a2,0x20 + 8001b158: e632 sd a2,264(sp) + let count = count as usize; + 8001b15a: 1582 slli a1,a1,0x20 + 8001b15c: 9181 srli a1,a1,0x20 + 8001b15e: f4ae sd a1,104(sp) + 8001b160: 20b13423 sd a1,520(sp) + let mut block_basic = offset / BSIZE; + 8001b164: 00a5559b srliw a1,a0,0xa + 8001b168: ea2e sd a1,272(sp) + let mut block_offset = offset % BSIZE; + 8001b16a: 3ff57513 andi a0,a0,1023 + 8001b16e: ee2a sd a0,280(sp) + while total < count as usize { + 8001b170: a009 j 8001b172 <.LBB12_43+0x3e> + 8001b172: 75a6 ld a1,104(sp) + 8001b174: 6512 ld a0,256(sp) + 8001b176: 00b56963 bltu a0,a1,8001b188 <.LBB12_43+0x54> + 8001b17a: a009 j 8001b17c <.LBB12_43+0x48> + Ok(total) + 8001b17c: 65ea ld a1,152(sp) + 8001b17e: 6512 ld a0,256(sp) + 8001b180: e588 sd a0,8(a1) + 8001b182: 4501 li a0,0 + 8001b184: e188 sd a0,0(a1) + } + 8001b186: a27d j 8001b334 <.LBB12_45+0x5c> + let surplus_len = count - total; + 8001b188: 7526 ld a0,104(sp) + 8001b18a: 6592 ld a1,256(sp) + 8001b18c: 40b505b3 sub a1,a0,a1 + 8001b190: f0ae sd a1,96(sp) + 8001b192: 1ab56663 bltu a0,a1,8001b33e <.LBB12_46> + 8001b196: a009 j 8001b198 <.LBB12_43+0x64> + 8001b198: 65aa ld a1,136(sp) + 8001b19a: 7506 ld a0,96(sp) + 8001b19c: 20a13823 sd a0,528(sp) + let block_no = self.bmap(block_basic as u32)?; + 8001b1a0: 6652 ld a2,272(sp) + 8001b1a2: 1a28 addi a0,sp,312 + 8001b1a4: 00000097 auipc ra,0x0 + 8001b1a8: c7c080e7 jalr -900(ra) # 8001ae20 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E> + 8001b1ac: a009 j 8001b1ae <.LBB12_43+0x7a> + 8001b1ae: 1208 addi a0,sp,288 + 8001b1b0: 1a2c addi a1,sp,312 + 8001b1b2: ffff3097 auipc ra,0xffff3 + 8001b1b6: 934080e7 jalr -1740(ra) # 8000dae6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h3002ccf5391f70d3E> + 8001b1ba: a009 j 8001b1bc <.LBB12_43+0x88> + 8001b1bc: 12016503 lwu a0,288(sp) + 8001b1c0: 4581 li a1,0 + 8001b1c2: 00b50463 beq a0,a1,8001b1ca <.LBB12_43+0x96> + 8001b1c6: a009 j 8001b1c8 <.LBB12_43+0x94> + 8001b1c8: a025 j 8001b1f0 <.LBB12_44+0x16> + 8001b1ca: 652a ld a0,136(sp) + 8001b1cc: 12412683 lw a3,292(sp) + 8001b1d0: 22d12423 sw a3,552(sp) + 8001b1d4: 22d12623 sw a3,556(sp) + let buf = BCACHE.bread(self.dev, block_no); + 8001b1d8: 4110 lw a2,0(a0) + +000000008001b1da <.LBB12_44>: + 8001b1da: 00015597 auipc a1,0x15 + 8001b1de: e2658593 addi a1,a1,-474 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8001b1e2: 0a88 addi a0,sp,336 + 8001b1e4: fffe8097 auipc ra,0xfffe8 + 8001b1e8: 4b0080e7 jalr 1200(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 8001b1ec: a03d j 8001b21a <.LBB12_44+0x40> + let block_no = self.bmap(block_basic as u32)?; + 8001b1ee: 0000 unimp + 8001b1f0: 7532 ld a0,296(sp) + 8001b1f2: 75d2 ld a1,304(sp) + 8001b1f4: 20a13c23 sd a0,536(sp) + 8001b1f8: 22b13023 sd a1,544(sp) + 8001b1fc: ffff1097 auipc ra,0xffff1 + 8001b200: 18a080e7 jalr 394(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001b204: e8aa sd a0,80(sp) + 8001b206: ecae sd a1,88(sp) + 8001b208: a009 j 8001b20a <.LBB12_44+0x30> + 8001b20a: 6666 ld a2,88(sp) + 8001b20c: 65c6 ld a1,80(sp) + 8001b20e: 656a ld a0,152(sp) + 8001b210: ffff2097 auipc ra,0xffff2 + 8001b214: 7b6080e7 jalr 1974(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 8001b218: aa31 j 8001b334 <.LBB12_45+0x5c> + let write_len = min(surplus_len, BSIZE - block_offset); + 8001b21a: 65f2 ld a1,280(sp) + 8001b21c: 40000513 li a0,1024 + 8001b220: 40b505b3 sub a1,a0,a1 + 8001b224: e4ae sd a1,72(sp) + 8001b226: 12b56b63 bltu a0,a1,8001b35c <.LBB12_48> + 8001b22a: a009 j 8001b22c <.LBB12_44+0x52> + 8001b22c: 65a6 ld a1,72(sp) + 8001b22e: 7506 ld a0,96(sp) + 8001b230: fffec097 auipc ra,0xfffec + 8001b234: 3f8080e7 jalr 1016(ra) # 80007628 <_ZN6kernel4misc3min17he96917d05b11cd47E> + 8001b238: 85aa mv a1,a0 + 8001b23a: e0ae sd a1,64(sp) + 8001b23c: 22a13823 sd a0,560(sp) + 8001b240: a009 j 8001b242 <.LBB12_44+0x68> + dst, + 8001b242: 652e ld a0,200(sp) + unsafe{ (buf.raw_data() as *mut u8).offset((offset % BSIZE) as isize) }, + 8001b244: f82a sd a0,48(sp) + 8001b246: 0a88 addi a0,sp,336 + 8001b248: fffe8097 auipc ra,0xfffe8 + 8001b24c: 592080e7 jalr 1426(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 8001b250: fc2a sd a0,56(sp) + 8001b252: a009 j 8001b254 <.LBB12_44+0x7a> + 8001b254: 7562 ld a0,56(sp) + 8001b256: 65b2 ld a1,264(sp) + 8001b258: 3ff5f593 andi a1,a1,1023 + 8001b25c: 00005097 auipc ra,0x5 + 8001b260: 3e0080e7 jalr 992(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 8001b264: f42a sd a0,40(sp) + 8001b266: a009 j 8001b268 <.LBB12_44+0x8e> + if copy_from_kernel( + 8001b268: 6686 ld a3,64(sp) + 8001b26a: 7622 ld a2,40(sp) + 8001b26c: 75c2 ld a1,48(sp) + 8001b26e: 754a ld a0,176(sp) + 8001b270: 00004097 auipc ra,0x4 + 8001b274: 87e080e7 jalr -1922(ra) # 8001eaee <_ZN6kernel6memory16copy_from_kernel17hf0969988b3a5fbc0E> + 8001b278: feaa sd a0,376(sp) + 8001b27a: e32e sd a1,384(sp) + 8001b27c: a009 j 8001b27e <.LBB12_44+0xa4> + 8001b27e: 1aa8 addi a0,sp,376 + 8001b280: ffff2097 auipc ra,0xffff2 + 8001b284: 3f8080e7 jalr 1016(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8001b288: f02a sd a0,32(sp) + 8001b28a: a009 j 8001b28c <.LBB12_44+0xb2> + 8001b28c: 7502 ld a0,32(sp) + 8001b28e: 4581 li a1,0 + 8001b290: 02b50363 beq a0,a1,8001b2b6 <.LBB12_44+0xdc> + 8001b294: a009 j 8001b296 <.LBB12_44+0xbc> + drop(buf); + 8001b296: 7556 ld a0,368(sp) + 8001b298: f72a sd a0,424(sp) + 8001b29a: 7536 ld a0,360(sp) + 8001b29c: f32a sd a0,416(sp) + 8001b29e: 7516 ld a0,352(sp) + 8001b2a0: ef2a sd a0,408(sp) + 8001b2a2: 6576 ld a0,344(sp) + 8001b2a4: eb2a sd a0,400(sp) + 8001b2a6: 6556 ld a0,336(sp) + 8001b2a8: e72a sd a0,392(sp) + 8001b2aa: 0328 addi a0,sp,392 + 8001b2ac: 00003097 auipc ra,0x3 + 8001b2b0: c72080e7 jalr -910(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 8001b2b4: a00d j 8001b2d6 <.LBB12_44+0xfc> + drop(buf); + 8001b2b6: 7556 ld a0,368(sp) + 8001b2b8: ebaa sd a0,464(sp) + 8001b2ba: 7536 ld a0,360(sp) + 8001b2bc: e7aa sd a0,456(sp) + 8001b2be: 7516 ld a0,352(sp) + 8001b2c0: e3aa sd a0,448(sp) + 8001b2c2: 6576 ld a0,344(sp) + 8001b2c4: ff2a sd a0,440(sp) + 8001b2c6: 6556 ld a0,336(sp) + 8001b2c8: fb2a sd a0,432(sp) + 8001b2ca: 1b08 addi a0,sp,432 + 8001b2cc: 00003097 auipc ra,0x3 + 8001b2d0: c52080e7 jalr -942(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 8001b2d4: a829 j 8001b2ee <.LBB12_45+0x16> + return Err("inode read: Fail to either copy out.") + 8001b2d6: 65ea ld a1,152(sp) + +000000008001b2d8 <.LBB12_45>: + 8001b2d8: 00011517 auipc a0,0x11 + 8001b2dc: de850513 addi a0,a0,-536 # 8002c0c0 <.L__unnamed_62> + 8001b2e0: e588 sd a0,8(a1) + 8001b2e2: 02400513 li a0,36 + 8001b2e6: e988 sd a0,16(a1) + 8001b2e8: 4505 li a0,1 + 8001b2ea: e188 sd a0,0(a1) + 8001b2ec: a0a1 j 8001b334 <.LBB12_45+0x5c> + total += write_len as usize; + 8001b2ee: 6506 ld a0,64(sp) + 8001b2f0: 6592 ld a1,256(sp) + 8001b2f2: 952e add a0,a0,a1 + 8001b2f4: ec2a sd a0,24(sp) + 8001b2f6: 08b56263 bltu a0,a1,8001b37a <.LBB12_50> + 8001b2fa: a009 j 8001b2fc <.LBB12_45+0x24> + 8001b2fc: 6506 ld a0,64(sp) + 8001b2fe: 65e2 ld a1,24(sp) + 8001b300: e22e sd a1,256(sp) + offset += write_len as usize; + 8001b302: 65b2 ld a1,264(sp) + 8001b304: 952e add a0,a0,a1 + 8001b306: e82a sd a0,16(sp) + 8001b308: 08b56763 bltu a0,a1,8001b396 <.LBB12_52> + 8001b30c: a009 j 8001b30e <.LBB12_45+0x36> + 8001b30e: 6506 ld a0,64(sp) + 8001b310: 65c2 ld a1,16(sp) + 8001b312: e62e sd a1,264(sp) + dst += write_len as usize; + 8001b314: 65ae ld a1,200(sp) + 8001b316: 952e add a0,a0,a1 + 8001b318: e42a sd a0,8(sp) + 8001b31a: 08b56c63 bltu a0,a1,8001b3b2 <.LBB12_54> + 8001b31e: a009 j 8001b320 <.LBB12_45+0x48> + 8001b320: 6522 ld a0,8(sp) + 8001b322: e5aa sd a0,200(sp) + block_basic = offset / BSIZE; + 8001b324: 6532 ld a0,264(sp) + 8001b326: 00a55593 srli a1,a0,0xa + 8001b32a: ea2e sd a1,272(sp) + block_offset = offset % BSIZE; + 8001b32c: 3ff57513 andi a0,a0,1023 + 8001b330: ee2a sd a0,280(sp) + while total < count as usize { + 8001b332: b581 j 8001b172 <.LBB12_43+0x3e> + } + 8001b334: 23813083 ld ra,568(sp) + 8001b338: 24010113 addi sp,sp,576 + 8001b33c: 8082 ret + +000000008001b33e <.LBB12_46>: + let surplus_len = count - total; + 8001b33e: 00010517 auipc a0,0x10 + 8001b342: 7e250513 addi a0,a0,2018 # 8002bb20 + +000000008001b346 <.LBB12_47>: + 8001b346: 00011617 auipc a2,0x11 + 8001b34a: d4a60613 addi a2,a2,-694 # 8002c090 <.L__unnamed_63> + 8001b34e: 02100593 li a1,33 + 8001b352: 00008097 auipc ra,0x8 + 8001b356: df2080e7 jalr -526(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b35c <.LBB12_48>: + let write_len = min(surplus_len, BSIZE - block_offset); + 8001b35c: 00010517 auipc a0,0x10 + 8001b360: 7c450513 addi a0,a0,1988 # 8002bb20 + +000000008001b364 <.LBB12_49>: + 8001b364: 00011617 auipc a2,0x11 + 8001b368: d4460613 addi a2,a2,-700 # 8002c0a8 <.L__unnamed_64> + 8001b36c: 02100593 li a1,33 + 8001b370: 00008097 auipc ra,0x8 + 8001b374: dd4080e7 jalr -556(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b37a <.LBB12_50>: + total += write_len as usize; + 8001b37a: 00010517 auipc a0,0x10 + 8001b37e: 75650513 addi a0,a0,1878 # 8002bad0 + +000000008001b382 <.LBB12_51>: + 8001b382: 00011617 auipc a2,0x11 + 8001b386: d6660613 addi a2,a2,-666 # 8002c0e8 <.L__unnamed_65> + 8001b38a: 45f1 li a1,28 + 8001b38c: 00008097 auipc ra,0x8 + 8001b390: db8080e7 jalr -584(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b396 <.LBB12_52>: + offset += write_len as usize; + 8001b396: 00010517 auipc a0,0x10 + 8001b39a: 73a50513 addi a0,a0,1850 # 8002bad0 + +000000008001b39e <.LBB12_53>: + 8001b39e: 00011617 auipc a2,0x11 + 8001b3a2: d6260613 addi a2,a2,-670 # 8002c100 <.L__unnamed_66> + 8001b3a6: 45f1 li a1,28 + 8001b3a8: 00008097 auipc ra,0x8 + 8001b3ac: d9c080e7 jalr -612(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b3b2 <.LBB12_54>: + dst += write_len as usize; + 8001b3b2: 00010517 auipc a0,0x10 + 8001b3b6: 71e50513 addi a0,a0,1822 # 8002bad0 + +000000008001b3ba <.LBB12_55>: + 8001b3ba: 00011617 auipc a2,0x11 + 8001b3be: d5e60613 addi a2,a2,-674 # 8002c118 <.L__unnamed_67> + 8001b3c2: 45f1 li a1,28 + 8001b3c4: 00008097 auipc ra,0x8 + 8001b3c8: d80080e7 jalr -640(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E: + +000000008001b3ce <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E>: + pub fn write( + 8001b3ce: 7161 addi sp,sp,-432 + 8001b3d0: f706 sd ra,424(sp) + 8001b3d2: f0ae sd a1,96(sp) + 8001b3d4: f4aa sd a0,104(sp) + 8001b3d6: 8532 mv a0,a2 + 8001b3d8: f8aa sd a0,112(sp) + 8001b3da: e136 sd a3,128(sp) + 8001b3dc: f2ae sd a1,352(sp) + 8001b3de: 16c107a3 sb a2,367(sp) + 8001b3e2: 16e12823 sw a4,368(sp) + 8001b3e6: 16f12a23 sw a5,372(sp) + let mut offset = offset as usize; + 8001b3ea: 02071513 slli a0,a4,0x20 + 8001b3ee: 9101 srli a0,a0,0x20 + 8001b3f0: e52a sd a0,136(sp) + let count = count as usize; + 8001b3f2: 02079513 slli a0,a5,0x20 + 8001b3f6: 9101 srli a0,a0,0x20 + 8001b3f8: fcaa sd a0,120(sp) + 8001b3fa: feaa sd a0,376(sp) + 8001b3fc: 4501 li a0,0 + let mut total = 0; + 8001b3fe: e92a sd a0,144(sp) + let mut block_basic = offset / BSIZE; + 8001b400: 00a7551b srliw a0,a4,0xa + 8001b404: ed2a sd a0,152(sp) + let mut block_offset = offset % BSIZE; + 8001b406: 3ff77513 andi a0,a4,1023 + 8001b40a: f12a sd a0,160(sp) + while total < count { + 8001b40c: a009 j 8001b40e <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x40> + 8001b40e: 75e6 ld a1,120(sp) + 8001b410: 654a ld a0,144(sp) + 8001b412: 00b56963 bltu a0,a1,8001b424 <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x56> + 8001b416: a009 j 8001b418 <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x4a> + if self.dinode.size < offset as u32 { + 8001b418: 7506 ld a0,96(sp) + 8001b41a: 4908 lw a0,16(a0) + 8001b41c: 45aa lw a1,136(sp) + 8001b41e: 1ab56663 bltu a0,a1,8001b5ca <.LBB13_38+0x16> + 8001b422: aa45 j 8001b5d2 <.LBB13_38+0x1e> + let surplus_len = count - total; + 8001b424: 7566 ld a0,120(sp) + 8001b426: 65ca ld a1,144(sp) + 8001b428: 40b505b3 sub a1,a0,a1 + 8001b42c: ecae sd a1,88(sp) + 8001b42e: 1cb56263 bltu a0,a1,8001b5f2 <.LBB13_39> + 8001b432: a009 j 8001b434 <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x66> + 8001b434: 7586 ld a1,96(sp) + 8001b436: 6566 ld a0,88(sp) + 8001b438: e32a sd a0,384(sp) + let block_no = self.bmap(block_basic as u32)?; + 8001b43a: 666a ld a2,152(sp) + 8001b43c: 0188 addi a0,sp,192 + 8001b43e: 00000097 auipc ra,0x0 + 8001b442: 9e2080e7 jalr -1566(ra) # 8001ae20 <_ZN6kernel2fs5inode9InodeData4bmap17hd73981f79cf26766E> + 8001b446: a009 j 8001b448 <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x7a> + 8001b448: 1128 addi a0,sp,168 + 8001b44a: 018c addi a1,sp,192 + 8001b44c: ffff2097 auipc ra,0xffff2 + 8001b450: 69a080e7 jalr 1690(ra) # 8000dae6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h3002ccf5391f70d3E> + 8001b454: a009 j 8001b456 <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x88> + 8001b456: 0a816503 lwu a0,168(sp) + 8001b45a: 4581 li a1,0 + 8001b45c: 00b50463 beq a0,a1,8001b464 <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x96> + 8001b460: a009 j 8001b462 <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x94> + 8001b462: a01d j 8001b488 <.LBB13_36+0x16> + 8001b464: 7506 ld a0,96(sp) + 8001b466: 56ba lw a3,172(sp) + 8001b468: 18d12c23 sw a3,408(sp) + 8001b46c: 18d12e23 sw a3,412(sp) + let mut buf = BCACHE.bread(self.dev, block_no); + 8001b470: 4110 lw a2,0(a0) + +000000008001b472 <.LBB13_36>: + 8001b472: 00015597 auipc a1,0x15 + 8001b476: b8e58593 addi a1,a1,-1138 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8001b47a: 09a8 addi a0,sp,216 + 8001b47c: fffe8097 auipc ra,0xfffe8 + 8001b480: 218080e7 jalr 536(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 8001b484: a02d j 8001b4ae <.LBB13_36+0x3c> + let block_no = self.bmap(block_basic as u32)?; + 8001b486: 0000 unimp + 8001b488: 754a ld a0,176(sp) + 8001b48a: 75ea ld a1,184(sp) + 8001b48c: e72a sd a0,392(sp) + 8001b48e: eb2e sd a1,400(sp) + 8001b490: ffff1097 auipc ra,0xffff1 + 8001b494: ef6080e7 jalr -266(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001b498: e4aa sd a0,72(sp) + 8001b49a: e8ae sd a1,80(sp) + 8001b49c: a009 j 8001b49e <.LBB13_36+0x2c> + 8001b49e: 6646 ld a2,80(sp) + 8001b4a0: 65a6 ld a1,72(sp) + 8001b4a2: 7526 ld a0,104(sp) + 8001b4a4: ffff2097 auipc ra,0xffff2 + 8001b4a8: 522080e7 jalr 1314(ra) # 8000d9c6 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h4dd43adfe00292f6E> + 8001b4ac: a281 j 8001b5ec <.LBB13_38+0x38> + let write_len = min(surplus_len, BSIZE - block_offset); + 8001b4ae: 758a ld a1,160(sp) + 8001b4b0: 40000513 li a0,1024 + 8001b4b4: 40b505b3 sub a1,a0,a1 + 8001b4b8: e0ae sd a1,64(sp) + 8001b4ba: 14b56b63 bltu a0,a1,8001b610 <.LBB13_41> + 8001b4be: a009 j 8001b4c0 <.LBB13_36+0x4e> + 8001b4c0: 6586 ld a1,64(sp) + 8001b4c2: 6566 ld a0,88(sp) + 8001b4c4: fffec097 auipc ra,0xfffec + 8001b4c8: 164080e7 jalr 356(ra) # 80007628 <_ZN6kernel4misc3min17he96917d05b11cd47E> + 8001b4cc: 85aa mv a1,a0 + 8001b4ce: fc2e sd a1,56(sp) + 8001b4d0: f32a sd a0,416(sp) + 8001b4d2: a009 j 8001b4d4 <.LBB13_36+0x62> + 8001b4d4: 09a8 addi a0,sp,216 + unsafe{ (buf.raw_data_mut() as *mut u8).offset((offset % BSIZE) as isize ) }, + 8001b4d6: fffe8097 auipc ra,0xfffe8 + 8001b4da: 348080e7 jalr 840(ra) # 8000381e <_ZN6kernel2fs3bio3Buf12raw_data_mut17hbae73c10d57c515dE> + 8001b4de: f82a sd a0,48(sp) + 8001b4e0: a009 j 8001b4e2 <.LBB13_36+0x70> + 8001b4e2: 7542 ld a0,48(sp) + 8001b4e4: 65aa ld a1,136(sp) + 8001b4e6: 3ff5f593 andi a1,a1,1023 + 8001b4ea: 00005097 auipc ra,0x5 + 8001b4ee: 152080e7 jalr 338(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 8001b4f2: f42a sd a0,40(sp) + 8001b4f4: a009 j 8001b4f6 <.LBB13_36+0x84> + src, + 8001b4f6: 76e2 ld a3,56(sp) + 8001b4f8: 75c6 ld a1,112(sp) + 8001b4fa: 7522 ld a0,40(sp) + 8001b4fc: 660a ld a2,128(sp) + if copy_to_kernel( + 8001b4fe: 00003097 auipc ra,0x3 + 8001b502: 540080e7 jalr 1344(ra) # 8001ea3e <_ZN6kernel6memory14copy_to_kernel17hd4730b664342d99cE> + 8001b506: e22a sd a0,256(sp) + 8001b508: e62e sd a1,264(sp) + 8001b50a: a009 j 8001b50c <.LBB13_36+0x9a> + 8001b50c: 0208 addi a0,sp,256 + 8001b50e: ffff2097 auipc ra,0xffff2 + 8001b512: 16a080e7 jalr 362(ra) # 8000d678 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17h304118d236359d80E> + 8001b516: f02a sd a0,32(sp) + 8001b518: a009 j 8001b51a <.LBB13_36+0xa8> + 8001b51a: 7502 ld a0,32(sp) + 8001b51c: 4581 li a1,0 + 8001b51e: 02b50363 beq a0,a1,8001b544 <.LBB13_36+0xd2> + 8001b522: a009 j 8001b524 <.LBB13_36+0xb2> + drop(buf); + 8001b524: 756e ld a0,248(sp) + 8001b526: fa2a sd a0,304(sp) + 8001b528: 754e ld a0,240(sp) + 8001b52a: f62a sd a0,296(sp) + 8001b52c: 752e ld a0,232(sp) + 8001b52e: f22a sd a0,288(sp) + 8001b530: 750e ld a0,224(sp) + 8001b532: ee2a sd a0,280(sp) + 8001b534: 656e ld a0,216(sp) + 8001b536: ea2a sd a0,272(sp) + 8001b538: 0a08 addi a0,sp,272 + 8001b53a: 00003097 auipc ra,0x3 + 8001b53e: 9e4080e7 jalr -1564(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 8001b542: a801 j 8001b552 <.LBB13_36+0xe0> + offset += write_len; + 8001b544: 7562 ld a0,56(sp) + 8001b546: 65aa ld a1,136(sp) + 8001b548: 952e add a0,a0,a1 + 8001b54a: ec2a sd a0,24(sp) + 8001b54c: 0eb56163 bltu a0,a1,8001b62e <.LBB13_43> + 8001b550: a829 j 8001b56a <.LBB13_37+0x16> + return Err("inode write: Fail to either copy in") + 8001b552: 75a6 ld a1,104(sp) + +000000008001b554 <.LBB13_37>: + 8001b554: 00011517 auipc a0,0x11 + 8001b558: c0c50513 addi a0,a0,-1012 # 8002c160 <.L__unnamed_68> + 8001b55c: e588 sd a0,8(a1) + 8001b55e: 02300513 li a0,35 + 8001b562: e988 sd a0,16(a1) + 8001b564: 4505 li a0,1 + 8001b566: e188 sd a0,0(a1) + 8001b568: a051 j 8001b5ec <.LBB13_38+0x38> + offset += write_len; + 8001b56a: 7562 ld a0,56(sp) + 8001b56c: 65e2 ld a1,24(sp) + 8001b56e: e52e sd a1,136(sp) + src += write_len; + 8001b570: 658a ld a1,128(sp) + 8001b572: 952e add a0,a0,a1 + 8001b574: e82a sd a0,16(sp) + 8001b576: 0cb56a63 bltu a0,a1,8001b64a <.LBB13_45> + 8001b57a: a009 j 8001b57c <.LBB13_37+0x28> + 8001b57c: 7562 ld a0,56(sp) + 8001b57e: 65c2 ld a1,16(sp) + 8001b580: e12e sd a1,128(sp) + total += write_len; + 8001b582: 65ca ld a1,144(sp) + 8001b584: 952e add a0,a0,a1 + 8001b586: e42a sd a0,8(sp) + 8001b588: 0cb56f63 bltu a0,a1,8001b666 <.LBB13_47> + 8001b58c: a009 j 8001b58e <.LBB13_37+0x3a> + 8001b58e: 6522 ld a0,8(sp) + 8001b590: e92a sd a0,144(sp) + block_basic = offset / BSIZE; + 8001b592: 652a ld a0,136(sp) + 8001b594: 00a55593 srli a1,a0,0xa + 8001b598: ed2e sd a1,152(sp) + block_offset = offset % BSIZE; + 8001b59a: 3ff57513 andi a0,a0,1023 + 8001b59e: f12a sd a0,160(sp) + LOG.write(buf); + 8001b5a0: 656e ld a0,216(sp) + 8001b5a2: fe2a sd a0,312(sp) + 8001b5a4: 750e ld a0,224(sp) + 8001b5a6: e2aa sd a0,320(sp) + 8001b5a8: 752e ld a0,232(sp) + 8001b5aa: e6aa sd a0,328(sp) + 8001b5ac: 754e ld a0,240(sp) + 8001b5ae: eaaa sd a0,336(sp) + 8001b5b0: 756e ld a0,248(sp) + 8001b5b2: eeaa sd a0,344(sp) + +000000008001b5b4 <.LBB13_38>: + 8001b5b4: 00040517 auipc a0,0x40 + 8001b5b8: f2450513 addi a0,a0,-220 # 8005b4d8 <_ZN6kernel2fs3log3LOG17h2c1d1dbdf3a7e402E> + 8001b5bc: 1a2c addi a1,sp,312 + 8001b5be: fffee097 auipc ra,0xfffee + 8001b5c2: 00e080e7 jalr 14(ra) # 800095cc <_ZN6kernel2fs3log78_$LT$impl$u20$kernel..lock..spinlock..Spinlock$LT$kernel..fs..log..Log$GT$$GT$5write17ha48e3edeecccac4fE> + 8001b5c6: a009 j 8001b5c8 <.LBB13_38+0x14> + while total < count { + 8001b5c8: b599 j 8001b40e <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E+0x40> + self.dinode.size = offset as u32; + 8001b5ca: 7586 ld a1,96(sp) + 8001b5cc: 652a ld a0,136(sp) + 8001b5ce: c988 sw a0,16(a1) + if self.dinode.size < offset as u32 { + 8001b5d0: a011 j 8001b5d4 <.LBB13_38+0x20> + 8001b5d2: a009 j 8001b5d4 <.LBB13_38+0x20> + self.update(); + 8001b5d4: 7506 ld a0,96(sp) + 8001b5d6: fffff097 auipc ra,0xfffff + 8001b5da: 72a080e7 jalr 1834(ra) # 8001ad00 <_ZN6kernel2fs5inode9InodeData6update17h81f49ab31d0ddfdcE> + 8001b5de: a009 j 8001b5e0 <.LBB13_38+0x2c> + Ok(total) + 8001b5e0: 75a6 ld a1,104(sp) + 8001b5e2: 654a ld a0,144(sp) + 8001b5e4: e588 sd a0,8(a1) + 8001b5e6: 4501 li a0,0 + 8001b5e8: e188 sd a0,0(a1) + } + 8001b5ea: a009 j 8001b5ec <.LBB13_38+0x38> + 8001b5ec: 70ba ld ra,424(sp) + 8001b5ee: 615d addi sp,sp,432 + 8001b5f0: 8082 ret + +000000008001b5f2 <.LBB13_39>: + let surplus_len = count - total; + 8001b5f2: 00010517 auipc a0,0x10 + 8001b5f6: 52e50513 addi a0,a0,1326 # 8002bb20 + +000000008001b5fa <.LBB13_40>: + 8001b5fa: 00011617 auipc a2,0x11 + 8001b5fe: b3660613 addi a2,a2,-1226 # 8002c130 <.L__unnamed_69> + 8001b602: 02100593 li a1,33 + 8001b606: 00008097 auipc ra,0x8 + 8001b60a: b3e080e7 jalr -1218(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b610 <.LBB13_41>: + let write_len = min(surplus_len, BSIZE - block_offset); + 8001b610: 00010517 auipc a0,0x10 + 8001b614: 51050513 addi a0,a0,1296 # 8002bb20 + +000000008001b618 <.LBB13_42>: + 8001b618: 00011617 auipc a2,0x11 + 8001b61c: b3060613 addi a2,a2,-1232 # 8002c148 <.L__unnamed_70> + 8001b620: 02100593 li a1,33 + 8001b624: 00008097 auipc ra,0x8 + 8001b628: b20080e7 jalr -1248(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b62e <.LBB13_43>: + offset += write_len; + 8001b62e: 00010517 auipc a0,0x10 + 8001b632: 4a250513 addi a0,a0,1186 # 8002bad0 + +000000008001b636 <.LBB13_44>: + 8001b636: 00011617 auipc a2,0x11 + 8001b63a: b5260613 addi a2,a2,-1198 # 8002c188 <.L__unnamed_71> + 8001b63e: 45f1 li a1,28 + 8001b640: 00008097 auipc ra,0x8 + 8001b644: b04080e7 jalr -1276(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b64a <.LBB13_45>: + src += write_len; + 8001b64a: 00010517 auipc a0,0x10 + 8001b64e: 48650513 addi a0,a0,1158 # 8002bad0 + +000000008001b652 <.LBB13_46>: + 8001b652: 00011617 auipc a2,0x11 + 8001b656: b4e60613 addi a2,a2,-1202 # 8002c1a0 <.L__unnamed_72> + 8001b65a: 45f1 li a1,28 + 8001b65c: 00008097 auipc ra,0x8 + 8001b660: ae8080e7 jalr -1304(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001b666 <.LBB13_47>: + total += write_len; + 8001b666: 00010517 auipc a0,0x10 + 8001b66a: 46a50513 addi a0,a0,1130 # 8002bad0 + +000000008001b66e <.LBB13_48>: + 8001b66e: 00011617 auipc a2,0x11 + 8001b672: b4a60613 addi a2,a2,-1206 # 8002c1b8 <.L__unnamed_73> + 8001b676: 45f1 li a1,28 + 8001b678: 00008097 auipc ra,0x8 + 8001b67c: acc080e7 jalr -1332(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData10dir_lookup17h2ffc093ee3be0a35E: + +000000008001b682 <_ZN6kernel2fs5inode9InodeData10dir_lookup17h2ffc093ee3be0a35E>: + pub fn dir_lookup(&mut self, name: &[u8]) -> Option { + 8001b682: 7165 addi sp,sp,-400 + 8001b684: e706 sd ra,392(sp) + 8001b686: f436 sd a3,40(sp) + 8001b688: f832 sd a2,48(sp) + 8001b68a: fc2e sd a1,56(sp) + 8001b68c: e0aa sd a0,64(sp) + 8001b68e: ea2e sd a1,272(sp) + 8001b690: ee32 sd a2,280(sp) + 8001b692: f236 sd a3,288(sp) + if self.dinode.itype != InodeType::Directory { + 8001b694: 00858513 addi a0,a1,8 + +000000008001b698 <.LBB14_37>: + 8001b698: 00010597 auipc a1,0x10 + 8001b69c: 6b058593 addi a1,a1,1712 # 8002bd48 <.L__unnamed_25> + 8001b6a0: ffffe097 auipc ra,0xffffe + 8001b6a4: b46080e7 jalr -1210(ra) # 800191e6 <_ZN4core3cmp9PartialEq2ne17ha4fd141ed85850e3E> + 8001b6a8: e4aa sd a0,72(sp) + 8001b6aa: a009 j 8001b6ac <.LBB14_37+0x14> + 8001b6ac: 6526 ld a0,72(sp) + 8001b6ae: 4581 li a1,0 + 8001b6b0: 02b50163 beq a0,a1,8001b6d2 <.LBB14_39+0x14> + 8001b6b4: a009 j 8001b6b6 <.LBB14_38> + +000000008001b6b6 <.LBB14_38>: + panic!("inode type is not directory"); + 8001b6b6: 00011517 auipc a0,0x11 + 8001b6ba: b1a50513 addi a0,a0,-1254 # 8002c1d0 <.L__unnamed_74> + +000000008001b6be <.LBB14_39>: + 8001b6be: 00011617 auipc a2,0x11 + 8001b6c2: b3260613 addi a2,a2,-1230 # 8002c1f0 <.L__unnamed_75> + 8001b6c6: 45ed li a1,27 + 8001b6c8: 00008097 auipc ra,0x8 + 8001b6cc: a7c080e7 jalr -1412(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001b6d0: 0000 unimp + 8001b6d2: 4541 li a0,16 + let de_size = size_of::(); + 8001b6d4: f62a sd a0,296(sp) + 8001b6d6: a009 j 8001b6d8 <.LBB14_39+0x1a> + let mut dir_entry = DirEntry::new(); + 8001b6d8: fffed097 auipc ra,0xfffed + 8001b6dc: d92080e7 jalr -622(ra) # 8000846a <_ZN6kernel2fs6dinode8DirEntry3new17h74e849d4398bb7e4E> + 8001b6e0: fa2a sd a0,304(sp) + 8001b6e2: fe2e sd a1,312(sp) + 8001b6e4: e8aa sd a0,80(sp) + 8001b6e6: ecae sd a1,88(sp) + 8001b6e8: a009 j 8001b6ea <.LBB14_39+0x2c> + 8001b6ea: 7562 ld a0,56(sp) + 8001b6ec: 088c addi a1,sp,80 + let dir_entry_ptr = &mut dir_entry as *mut _ as *mut u8; + 8001b6ee: f02e sd a1,32(sp) + 8001b6f0: e2ae sd a1,320(sp) + for offset in (0..self.dinode.size).step_by(de_size) { + 8001b6f2: 4910 lw a2,16(a0) + 8001b6f4: 4581 li a1,0 + 8001b6f6: c92e sw a1,144(sp) + 8001b6f8: cb32 sw a2,148(sp) + 8001b6fa: 18a8 addi a0,sp,120 + 8001b6fc: 46c1 li a3,16 + 8001b6fe: ffff1097 auipc ra,0xffff1 + 8001b702: c22080e7 jalr -990(ra) # 8000c320 <_ZN4core4iter6traits8iterator8Iterator7step_by17ha7dfda23787d2a26E> + 8001b706: a009 j 8001b708 <.LBB14_39+0x4a> + 8001b708: 1088 addi a0,sp,96 + 8001b70a: 18ac addi a1,sp,120 + 8001b70c: 00002097 auipc ra,0x2 + 8001b710: 63a080e7 jalr 1594(ra) # 8001dd46 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h09fa161dbb9bcdd3E> + 8001b714: a009 j 8001b716 <.LBB14_39+0x58> + 8001b716: 7546 ld a0,112(sp) + 8001b718: f52a sd a0,168(sp) + 8001b71a: 7526 ld a0,104(sp) + 8001b71c: f12a sd a0,160(sp) + 8001b71e: 7506 ld a0,96(sp) + 8001b720: ed2a sd a0,152(sp) + 8001b722: a009 j 8001b724 <.LBB14_39+0x66> + 8001b724: 0928 addi a0,sp,152 + 8001b726: 00002097 auipc ra,0x2 + 8001b72a: 4e2080e7 jalr 1250(ra) # 8001dc08 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E> + 8001b72e: d92a sw a0,176(sp) + 8001b730: db2e sw a1,180(sp) + 8001b732: a009 j 8001b734 <.LBB14_39+0x76> + 8001b734: 0b016503 lwu a0,176(sp) + 8001b738: 4581 li a1,0 + 8001b73a: 00b50463 beq a0,a1,8001b742 <.LBB14_39+0x84> + 8001b73e: a009 j 8001b740 <.LBB14_39+0x82> + 8001b740: a031 j 8001b74c <.LBB14_39+0x8e> + 8001b742: 6586 ld a1,64(sp) + 8001b744: 4501 li a0,0 + None + 8001b746: e188 sd a0,0(a1) + } + 8001b748: aa31 j 8001b864 <.LBB14_42+0x2e> + for offset in (0..self.dinode.size).step_by(de_size) { + 8001b74a: 0000 unimp + 8001b74c: 7682 ld a3,32(sp) + 8001b74e: 75e2 ld a1,56(sp) + 8001b750: 575a lw a4,180(sp) + 8001b752: 14e12623 sw a4,332(sp) + 8001b756: 14e12823 sw a4,336(sp) + 8001b75a: 14e12a23 sw a4,340(sp) + 8001b75e: 1928 addi a0,sp,184 + 8001b760: 4601 li a2,0 + 8001b762: 47c1 li a5,16 + self.read( + 8001b764: 00000097 auipc ra,0x0 + 8001b768: 918080e7 jalr -1768(ra) # 8001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E> + 8001b76c: a009 j 8001b76e <.LBB14_40> + +000000008001b76e <.LBB14_40>: + 8001b76e: 00011597 auipc a1,0x11 + 8001b772: a9a58593 addi a1,a1,-1382 # 8002c208 <.L__unnamed_76> + +000000008001b776 <.LBB14_41>: + 8001b776: 00011697 auipc a3,0x11 + 8001b77a: ab268693 addi a3,a3,-1358 # 8002c228 <.L__unnamed_77> + 8001b77e: 1928 addi a0,sp,184 + 8001b780: 4675 li a2,29 + 8001b782: ffff2097 auipc ra,0xffff2 + 8001b786: eae080e7 jalr -338(ra) # 8000d630 <_ZN4core6result19Result$LT$T$C$E$GT$6expect17he26db02725b9ae65E> + 8001b78a: a009 j 8001b78c <.LBB14_41+0x16> + if dir_entry.inum == 0 { + 8001b78c: 05015503 lhu a0,80(sp) + 8001b790: 4581 li a1,0 + 8001b792: f8b509e3 beq a0,a1,8001b724 <.LBB14_39+0x66> + 8001b796: a009 j 8001b798 <.LBB14_41+0x22> + 8001b798: 4501 li a0,0 + for i in 0..DIRSIZ { + 8001b79a: e9aa sd a0,208(sp) + 8001b79c: 45b9 li a1,14 + 8001b79e: edae sd a1,216(sp) + 8001b7a0: 00005097 auipc ra,0x5 + 8001b7a4: 070080e7 jalr 112(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8001b7a8: e82a sd a0,16(sp) + 8001b7aa: ec2e sd a1,24(sp) + 8001b7ac: a009 j 8001b7ae <.LBB14_41+0x38> + 8001b7ae: 6562 ld a0,24(sp) + 8001b7b0: 65c2 ld a1,16(sp) + 8001b7b2: f1ae sd a1,224(sp) + 8001b7b4: f5aa sd a0,232(sp) + 8001b7b6: a009 j 8001b7b8 <.LBB14_41+0x42> + 8001b7b8: 1188 addi a0,sp,224 + 8001b7ba: 00005097 auipc ra,0x5 + 8001b7be: fe8080e7 jalr -24(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001b7c2: f9aa sd a0,240(sp) + 8001b7c4: fdae sd a1,248(sp) + 8001b7c6: a009 j 8001b7c8 <.LBB14_41+0x52> + 8001b7c8: 754e ld a0,240(sp) + 8001b7ca: 4581 li a1,0 + 8001b7cc: 00b50463 beq a0,a1,8001b7d4 <.LBB14_41+0x5e> + 8001b7d0: a009 j 8001b7d2 <.LBB14_41+0x5c> + 8001b7d2: a019 j 8001b7d8 <.LBB14_41+0x62> + 8001b7d4: a079 j 8001b862 <.LBB14_42+0x2c> + 8001b7d6: 0000 unimp + 8001b7d8: 75ee ld a1,248(sp) + 8001b7da: e42e sd a1,8(sp) + 8001b7dc: eeae sd a1,344(sp) + 8001b7de: f2ae sd a1,352(sp) + 8001b7e0: f6ae sd a1,360(sp) + 8001b7e2: 4535 li a0,13 + if dir_entry.name[i] != name[i] { + 8001b7e4: 08b56363 bltu a0,a1,8001b86a <.LBB14_42+0x34> + 8001b7e8: a009 j 8001b7ea <.LBB14_41+0x74> + 8001b7ea: 6522 ld a0,8(sp) + 8001b7ec: 75a2 ld a1,40(sp) + 8001b7ee: 0890 addi a2,sp,80 + 8001b7f0: 962a add a2,a2,a0 + 8001b7f2: 00264603 lbu a2,2(a2) + 8001b7f6: e032 sd a2,0(sp) + 8001b7f8: 08b57463 bgeu a0,a1,8001b880 <.LBB14_43+0x14> + 8001b7fc: a009 j 8001b7fe <.LBB14_41+0x88> + 8001b7fe: 6502 ld a0,0(sp) + 8001b800: 75c2 ld a1,48(sp) + 8001b802: 6622 ld a2,8(sp) + 8001b804: 95b2 add a1,a1,a2 + 8001b806: 0005c583 lbu a1,0(a1) + 8001b80a: 00b50463 beq a0,a1,8001b812 <.LBB14_41+0x9c> + 8001b80e: a009 j 8001b810 <.LBB14_41+0x9a> + 8001b810: a889 j 8001b862 <.LBB14_42+0x2c> + 8001b812: 65a2 ld a1,8(sp) + 8001b814: 4535 li a0,13 + if dir_entry.name[i] == 0 { + 8001b816: 08b56063 bltu a0,a1,8001b896 <.LBB14_44+0x12> + 8001b81a: a009 j 8001b81c <.LBB14_41+0xa6> + 8001b81c: 65a2 ld a1,8(sp) + 8001b81e: 0888 addi a0,sp,80 + 8001b820: 952e add a0,a0,a1 + 8001b822: 00254503 lbu a0,2(a0) + 8001b826: 4581 li a1,0 + 8001b828: 02b51463 bne a0,a1,8001b850 <.LBB14_42+0x1a> + 8001b82c: a009 j 8001b82e <.LBB14_41+0xb8> + return Some(ICACHE.get(self.dev, dir_entry.inum as u32)) + 8001b82e: 7562 ld a0,56(sp) + 8001b830: 05015603 lhu a2,80(sp) + 8001b834: 410c lw a1,0(a0) + +000000008001b836 <.LBB14_42>: + 8001b836: 00040517 auipc a0,0x40 + 8001b83a: d4a50513 addi a0,a0,-694 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 8001b83e: ffffe097 auipc ra,0xffffe + 8001b842: 2ba080e7 jalr 698(ra) # 80019af8 <_ZN6kernel2fs5inode10InodeCache3get17h50a5b70dd332d913E> + 8001b846: faaa sd a0,368(sp) + 8001b848: feae sd a1,376(sp) + 8001b84a: e22a sd a0,256(sp) + 8001b84c: e62e sd a1,264(sp) + 8001b84e: a011 j 8001b852 <.LBB14_42+0x1c> + for i in 0..DIRSIZ { + 8001b850: b7a5 j 8001b7b8 <.LBB14_41+0x42> + return Some(ICACHE.get(self.dev, dir_entry.inum as u32)) + 8001b852: 6586 ld a1,64(sp) + 8001b854: 6532 ld a0,264(sp) + 8001b856: e988 sd a0,16(a1) + 8001b858: 6512 ld a0,256(sp) + 8001b85a: e588 sd a0,8(a1) + 8001b85c: 4505 li a0,1 + 8001b85e: e188 sd a0,0(a1) + } + 8001b860: a011 j 8001b864 <.LBB14_42+0x2e> + for offset in (0..self.dinode.size).step_by(de_size) { + 8001b862: b5c9 j 8001b724 <.LBB14_39+0x66> + } + 8001b864: 60ba ld ra,392(sp) + 8001b866: 6159 addi sp,sp,400 + 8001b868: 8082 ret + if dir_entry.name[i] != name[i] { + 8001b86a: 6522 ld a0,8(sp) + +000000008001b86c <.LBB14_43>: + 8001b86c: 00011617 auipc a2,0x11 + 8001b870: 9d460613 addi a2,a2,-1580 # 8002c240 <.L__unnamed_78> + 8001b874: 45b9 li a1,14 + 8001b876: 00008097 auipc ra,0x8 + 8001b87a: 8fa080e7 jalr -1798(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001b87e: 0000 unimp + 8001b880: 75a2 ld a1,40(sp) + 8001b882: 6522 ld a0,8(sp) + +000000008001b884 <.LBB14_44>: + 8001b884: 00011617 auipc a2,0x11 + 8001b888: 9d460613 addi a2,a2,-1580 # 8002c258 <.L__unnamed_79> + 8001b88c: 00008097 auipc ra,0x8 + 8001b890: 8e4080e7 jalr -1820(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001b894: 0000 unimp + if dir_entry.name[i] == 0 { + 8001b896: 6522 ld a0,8(sp) + +000000008001b898 <.LBB14_45>: + 8001b898: 00011617 auipc a2,0x11 + 8001b89c: 9d860613 addi a2,a2,-1576 # 8002c270 <.L__unnamed_80> + 8001b8a0: 45b9 li a1,14 + 8001b8a2: 00008097 auipc ra,0x8 + 8001b8a6: 8ce080e7 jalr -1842(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE: + +000000008001b8ac <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE>: + pub fn dir_link(&mut self, name: &[u8], inum: u32) -> Result<(), &'static str>{ + 8001b8ac: df010113 addi sp,sp,-528 + 8001b8b0: 20113423 sd ra,520(sp) + 8001b8b4: e136 sd a3,128(sp) + 8001b8b6: 86b2 mv a3,a2 + 8001b8b8: f8b6 sd a3,112(sp) + 8001b8ba: 862e mv a2,a1 + 8001b8bc: fcb2 sd a2,120(sp) + 8001b8be: 85aa mv a1,a0 + 8001b8c0: 650a ld a0,128(sp) + 8001b8c2: e52e sd a1,136(sp) + 8001b8c4: 872a mv a4,a0 + 8001b8c6: e93a sd a4,144(sp) + 8001b8c8: eb2e sd a1,400(sp) + 8001b8ca: ef32 sd a2,408(sp) + 8001b8cc: f336 sd a3,416(sp) + 8001b8ce: 1aa12623 sw a0,428(sp) + 8001b8d2: 1128 addi a0,sp,168 + if self.dir_lookup(name).is_some() { + 8001b8d4: 00000097 auipc ra,0x0 + 8001b8d8: dae080e7 jalr -594(ra) # 8001b682 <_ZN6kernel2fs5inode9InodeData10dir_lookup17h2ffc093ee3be0a35E> + 8001b8dc: a009 j 8001b8de <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE+0x32> + 8001b8de: 1128 addi a0,sp,168 + 8001b8e0: ffff4097 auipc ra,0xffff4 + 8001b8e4: 006080e7 jalr 6(ra) # 8000f8e6 <_ZN4core6option15Option$LT$T$GT$7is_some17h901b9974d3eea8b8E> + 8001b8e8: f4aa sd a0,104(sp) + 8001b8ea: a009 j 8001b8ec <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE+0x40> + 8001b8ec: 1128 addi a0,sp,168 + 8001b8ee: fffec097 auipc ra,0xfffec + 8001b8f2: 842080e7 jalr -1982(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8001b8f6: a009 j 8001b8f8 <_ZN6kernel2fs5inode9InodeData8dir_link17h13a19ea2d651643eE+0x4c> + 8001b8f8: 7526 ld a0,104(sp) + 8001b8fa: 4581 li a1,0 + 8001b8fc: 00b50c63 beq a0,a1,8001b914 <.LBB15_43+0x12> + 8001b900: a009 j 8001b902 <.LBB15_43> + +000000008001b902 <.LBB15_43>: + return Err("It's incorrect to find entry in disk") + 8001b902: 00011517 auipc a0,0x11 + 8001b906: 98650513 addi a0,a0,-1658 # 8002c288 <.L__unnamed_81> + 8001b90a: ed2a sd a0,152(sp) + 8001b90c: 02400513 li a0,36 + 8001b910: f12a sd a0,160(sp) + 8001b912: aae9 j 8001baec <.LBB15_43+0x1ea> + let mut dir_entry = DirEntry::new(); + 8001b914: fffed097 auipc ra,0xfffed + 8001b918: b56080e7 jalr -1194(ra) # 8000846a <_ZN6kernel2fs6dinode8DirEntry3new17h74e849d4398bb7e4E> + 8001b91c: fb2a sd a0,432(sp) + 8001b91e: ff2e sd a1,440(sp) + 8001b920: e1aa sd a0,192(sp) + 8001b922: e5ae sd a1,200(sp) + 8001b924: a009 j 8001b926 <.LBB15_43+0x24> + 8001b926: 652a ld a0,136(sp) + 8001b928: 4581 li a1,0 + let mut entry_offset = 0; + 8001b92a: cbae sw a1,212(sp) + for offset in (0..self.dinode.size).step_by(size_of::()) { + 8001b92c: 4908 lw a0,16(a0) + 8001b92e: 10b12423 sw a1,264(sp) + 8001b932: 10a12623 sw a0,268(sp) + 8001b936: a009 j 8001b938 <.LBB15_43+0x36> + 8001b938: 10c12603 lw a2,268(sp) + 8001b93c: 10812583 lw a1,264(sp) + 8001b940: 1988 addi a0,sp,240 + 8001b942: 46c1 li a3,16 + 8001b944: ffff1097 auipc ra,0xffff1 + 8001b948: 9dc080e7 jalr -1572(ra) # 8000c320 <_ZN4core4iter6traits8iterator8Iterator7step_by17ha7dfda23787d2a26E> + 8001b94c: a009 j 8001b94e <.LBB15_43+0x4c> + 8001b94e: 09a8 addi a0,sp,216 + 8001b950: 198c addi a1,sp,240 + 8001b952: 00002097 auipc ra,0x2 + 8001b956: 3f4080e7 jalr 1012(ra) # 8001dd46 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h09fa161dbb9bcdd3E> + 8001b95a: a009 j 8001b95c <.LBB15_43+0x5a> + 8001b95c: 752e ld a0,232(sp) + 8001b95e: f22a sd a0,288(sp) + 8001b960: 750e ld a0,224(sp) + 8001b962: ee2a sd a0,280(sp) + 8001b964: 656e ld a0,216(sp) + 8001b966: ea2a sd a0,272(sp) + 8001b968: a009 j 8001b96a <.LBB15_43+0x68> + 8001b96a: 0a08 addi a0,sp,272 + 8001b96c: 00002097 auipc ra,0x2 + 8001b970: 29c080e7 jalr 668(ra) # 8001dc08 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E> + 8001b974: 12a12423 sw a0,296(sp) + 8001b978: 12b12623 sw a1,300(sp) + 8001b97c: a009 j 8001b97e <.LBB15_43+0x7c> + 8001b97e: 12816503 lwu a0,296(sp) + 8001b982: 4581 li a1,0 + 8001b984: 00b50463 beq a0,a1,8001b98c <.LBB15_43+0x8a> + 8001b988: a009 j 8001b98a <.LBB15_43+0x88> + 8001b98a: a019 j 8001b990 <.LBB15_43+0x8e> + 8001b98c: a05d j 8001ba32 <.LBB15_43+0x130> + 8001b98e: 0000 unimp + 8001b990: 12c16503 lwu a0,300(sp) + 8001b994: ecaa sd a0,88(sp) + 8001b996: 1ca12623 sw a0,460(sp) + 8001b99a: 1ca12823 sw a0,464(sp) + 8001b99e: 1ca12a23 sw a0,468(sp) + 8001b9a2: 0188 addi a0,sp,192 + size_of::() as u32 + 8001b9a4: f0aa sd a0,96(sp) + 8001b9a6: a009 j 8001b9a8 <.LBB15_43+0xa6> + self.read( + 8001b9a8: 6766 ld a4,88(sp) + 8001b9aa: 7686 ld a3,96(sp) + 8001b9ac: 65aa ld a1,136(sp) + 8001b9ae: 02a8 addi a0,sp,328 + 8001b9b0: 4601 li a2,0 + 8001b9b2: 47c1 li a5,16 + 8001b9b4: fffff097 auipc ra,0xfffff + 8001b9b8: 6c8080e7 jalr 1736(ra) # 8001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E> + 8001b9bc: a009 j 8001b9be <.LBB15_43+0xbc> + 8001b9be: 1a08 addi a0,sp,304 + 8001b9c0: 02ac addi a1,sp,328 + 8001b9c2: ffff2097 auipc ra,0xffff2 + 8001b9c6: 0d2080e7 jalr 210(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 8001b9ca: a009 j 8001b9cc <.LBB15_43+0xca> + )?; + 8001b9cc: 7552 ld a0,304(sp) + 8001b9ce: 4581 li a1,0 + 8001b9d0: 00b50463 beq a0,a1,8001b9d8 <.LBB15_43+0xd6> + 8001b9d4: a009 j 8001b9d6 <.LBB15_43+0xd4> + 8001b9d6: a029 j 8001b9e0 <.LBB15_43+0xde> + self.read( + 8001b9d8: 7572 ld a0,312(sp) + 8001b9da: f7aa sd a0,488(sp) + entry_offset += size_of::() as u32; + 8001b9dc: a035 j 8001ba08 <.LBB15_43+0x106> + self.read( + 8001b9de: 0000 unimp + )?; + 8001b9e0: 7572 ld a0,312(sp) + 8001b9e2: 6596 ld a1,320(sp) + 8001b9e4: efaa sd a0,472(sp) + 8001b9e6: f3ae sd a1,480(sp) + 8001b9e8: ffff1097 auipc ra,0xffff1 + 8001b9ec: 99e080e7 jalr -1634(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001b9f0: e4aa sd a0,72(sp) + 8001b9f2: e8ae sd a1,80(sp) + 8001b9f4: a009 j 8001b9f6 <.LBB15_43+0xf4> + self.read( + 8001b9f6: 65c6 ld a1,80(sp) + 8001b9f8: 6526 ld a0,72(sp) + 8001b9fa: ffff2097 auipc ra,0xffff2 + 8001b9fe: 042080e7 jalr 66(ra) # 8000da3c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h9d11a50f8e490b2eE> + 8001ba02: ed2a sd a0,152(sp) + 8001ba04: f12e sd a1,160(sp) + 8001ba06: a0dd j 8001baec <.LBB15_43+0x1ea> + entry_offset += size_of::() as u32; + 8001ba08: 0d416503 lwu a0,212(sp) + 8001ba0c: 01050593 addi a1,a0,16 + 8001ba10: e0ae sd a1,64(sp) + 8001ba12: 02059513 slli a0,a1,0x20 + 8001ba16: 9101 srli a0,a0,0x20 + 8001ba18: 0eb51163 bne a0,a1,8001bafa <.LBB15_44> + 8001ba1c: a009 j 8001ba1e <.LBB15_43+0x11c> + 8001ba1e: 6506 ld a0,64(sp) + 8001ba20: cbaa sw a0,212(sp) + if dir_entry.inum == 0 { + 8001ba22: 0c015503 lhu a0,192(sp) + 8001ba26: 4581 li a1,0 + 8001ba28: 00b51463 bne a0,a1,8001ba30 <.LBB15_43+0x12e> + 8001ba2c: a009 j 8001ba2e <.LBB15_43+0x12c> + 8001ba2e: a011 j 8001ba32 <.LBB15_43+0x130> + for offset in (0..self.dinode.size).step_by(size_of::()) { + 8001ba30: bf2d j 8001b96a <.LBB15_43+0x68> + ptr::copy(name.as_ptr(), dir_entry.name.as_mut_ptr(), name.len()); + 8001ba32: 75c6 ld a1,112(sp) + 8001ba34: 7566 ld a0,120(sp) + 8001ba36: 00005097 auipc ra,0x5 + 8001ba3a: ac8080e7 jalr -1336(ra) # 800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E> + 8001ba3e: fc2a sd a0,56(sp) + 8001ba40: a009 j 8001ba42 <.LBB15_43+0x140> + 8001ba42: 0c210513 addi a0,sp,194 + 8001ba46: 45b9 li a1,14 + 8001ba48: 00005097 auipc ra,0x5 + 8001ba4c: a14080e7 jalr -1516(ra) # 8002045c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h69a6648c691317bcE> + 8001ba50: f82a sd a0,48(sp) + 8001ba52: a009 j 8001ba54 <.LBB15_43+0x152> + 8001ba54: 75c6 ld a1,112(sp) + 8001ba56: 7566 ld a0,120(sp) + 8001ba58: 00005097 auipc ra,0x5 + 8001ba5c: a4a080e7 jalr -1462(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 8001ba60: f42a sd a0,40(sp) + 8001ba62: a009 j 8001ba64 <.LBB15_43+0x162> + 8001ba64: 7622 ld a2,40(sp) + 8001ba66: 75e2 ld a1,56(sp) + 8001ba68: 7542 ld a0,48(sp) + 8001ba6a: 0000a097 auipc ra,0xa + 8001ba6e: 62e080e7 jalr 1582(ra) # 80026098 + 8001ba72: a009 j 8001ba74 <.LBB15_43+0x172> + dir_entry.inum = inum as u16; + 8001ba74: 654a ld a0,144(sp) + 8001ba76: 0ca11023 sh a0,192(sp) + 8001ba7a: 0188 addi a0,sp,192 + entry_offset, + 8001ba7c: ec2a sd a0,24(sp) + 8001ba7e: 0d416503 lwu a0,212(sp) + size_of::() as u32 + 8001ba82: f02a sd a0,32(sp) + 8001ba84: a009 j 8001ba86 <.LBB15_43+0x184> + self.write( + 8001ba86: 7702 ld a4,32(sp) + 8001ba88: 66e2 ld a3,24(sp) + 8001ba8a: 65aa ld a1,136(sp) + 8001ba8c: 1aa8 addi a0,sp,376 + 8001ba8e: 4601 li a2,0 + 8001ba90: 47c1 li a5,16 + 8001ba92: 00000097 auipc ra,0x0 + 8001ba96: 93c080e7 jalr -1732(ra) # 8001b3ce <_ZN6kernel2fs5inode9InodeData5write17h219447b865f1c381E> + 8001ba9a: a009 j 8001ba9c <.LBB15_43+0x19a> + 8001ba9c: 1288 addi a0,sp,352 + 8001ba9e: 1aac addi a1,sp,376 + 8001baa0: ffff2097 auipc ra,0xffff2 + 8001baa4: ff4080e7 jalr -12(ra) # 8000da94 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h0dd4a8728df8a7c8E> + 8001baa8: a009 j 8001baaa <.LBB15_43+0x1a8> + )?; + 8001baaa: 7516 ld a0,352(sp) + 8001baac: 4581 li a1,0 + 8001baae: 00b50463 beq a0,a1,8001bab6 <.LBB15_43+0x1b4> + 8001bab2: a009 j 8001bab4 <.LBB15_43+0x1b2> + 8001bab4: a801 j 8001bac4 <.LBB15_43+0x1c2> + self.write( + 8001bab6: 7536 ld a0,360(sp) + 8001bab8: 20a13023 sd a0,512(sp) + 8001babc: 4501 li a0,0 + Ok(()) + 8001babe: ed2a sd a0,152(sp) + } + 8001bac0: a035 j 8001baec <.LBB15_43+0x1ea> + self.write( + 8001bac2: 0000 unimp + )?; + 8001bac4: 7536 ld a0,360(sp) + 8001bac6: 75d6 ld a1,368(sp) + 8001bac8: fbaa sd a0,496(sp) + 8001baca: ffae sd a1,504(sp) + 8001bacc: ffff1097 auipc ra,0xffff1 + 8001bad0: 8ba080e7 jalr -1862(ra) # 8000c386 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h6f3e3843c20d184aE> + 8001bad4: e42a sd a0,8(sp) + 8001bad6: e82e sd a1,16(sp) + 8001bad8: a009 j 8001bada <.LBB15_43+0x1d8> + self.write( + 8001bada: 65c2 ld a1,16(sp) + 8001badc: 6522 ld a0,8(sp) + 8001bade: ffff2097 auipc ra,0xffff2 + 8001bae2: f5e080e7 jalr -162(ra) # 8000da3c <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h9d11a50f8e490b2eE> + 8001bae6: ed2a sd a0,152(sp) + 8001bae8: f12e sd a1,160(sp) + 8001baea: a009 j 8001baec <.LBB15_43+0x1ea> + } + 8001baec: 656a ld a0,152(sp) + 8001baee: 758a ld a1,160(sp) + 8001baf0: 20813083 ld ra,520(sp) + 8001baf4: 21010113 addi sp,sp,528 + 8001baf8: 8082 ret + +000000008001bafa <.LBB15_44>: + entry_offset += size_of::() as u32; + 8001bafa: 00010517 auipc a0,0x10 + 8001bafe: fd650513 addi a0,a0,-42 # 8002bad0 + +000000008001bb02 <.LBB15_45>: + 8001bb02: 00010617 auipc a2,0x10 + 8001bb06: 7ae60613 addi a2,a2,1966 # 8002c2b0 <.L__unnamed_82> + 8001bb0a: 45f1 li a1,28 + 8001bb0c: 00007097 auipc ra,0x7 + 8001bb10: 638080e7 jalr 1592(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E: + +000000008001bb16 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E>: + pub fn is_dir_empty(&mut self) -> bool { + 8001bb16: 7151 addi sp,sp,-240 + 8001bb18: f586 sd ra,232(sp) + 8001bb1a: f42a sd a0,40(sp) + 8001bb1c: fd2a sd a0,184(sp) + let mut dir_entry = DirEntry::new(); + 8001bb1e: fffed097 auipc ra,0xfffed + 8001bb22: 94c080e7 jalr -1716(ra) # 8000846a <_ZN6kernel2fs6dinode8DirEntry3new17h74e849d4398bb7e4E> + 8001bb26: e1aa sd a0,192(sp) + 8001bb28: e5ae sd a1,200(sp) + 8001bb2a: fc2a sd a0,56(sp) + 8001bb2c: e0ae sd a1,64(sp) + 8001bb2e: a009 j 8001bb30 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x1a> + let init_size = 2 * size_of::() as u32; + 8001bb30: a009 j 8001bb32 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x1c> + 8001bb32: 02000513 li a0,32 + 8001bb36: f02a sd a0,32(sp) + 8001bb38: 4501 li a0,0 + 8001bb3a: e565 bnez a0,8001bc22 <.LBB16_24> + 8001bb3c: a009 j 8001bb3e <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x28> + 8001bb3e: 7582 ld a1,32(sp) + 8001bb40: 7522 ld a0,40(sp) + 8001bb42: cbae sw a1,212(sp) + let final_size = self.dinode.size; + 8001bb44: 4908 lw a0,16(a0) + 8001bb46: cdaa sw a0,216(sp) + for offset in (init_size..final_size).step_by(size_of::()) { + 8001bb48: dcae sw a1,120(sp) + 8001bb4a: deaa sw a0,124(sp) + 8001bb4c: a009 j 8001bb4e <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x38> + 8001bb4e: 5676 lw a2,124(sp) + 8001bb50: 55e6 lw a1,120(sp) + 8001bb52: 1088 addi a0,sp,96 + 8001bb54: 46c1 li a3,16 + 8001bb56: ffff0097 auipc ra,0xffff0 + 8001bb5a: 7ca080e7 jalr 1994(ra) # 8000c320 <_ZN4core4iter6traits8iterator8Iterator7step_by17ha7dfda23787d2a26E> + 8001bb5e: a009 j 8001bb60 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x4a> + 8001bb60: 00a8 addi a0,sp,72 + 8001bb62: 108c addi a1,sp,96 + 8001bb64: 00002097 auipc ra,0x2 + 8001bb68: 1e2080e7 jalr 482(ra) # 8001dd46 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h09fa161dbb9bcdd3E> + 8001bb6c: a009 j 8001bb6e <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x58> + 8001bb6e: 6566 ld a0,88(sp) + 8001bb70: e92a sd a0,144(sp) + 8001bb72: 6546 ld a0,80(sp) + 8001bb74: e52a sd a0,136(sp) + 8001bb76: 6526 ld a0,72(sp) + 8001bb78: e12a sd a0,128(sp) + 8001bb7a: a009 j 8001bb7c <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x66> + 8001bb7c: 0108 addi a0,sp,128 + 8001bb7e: 00002097 auipc ra,0x2 + 8001bb82: 08a080e7 jalr 138(ra) # 8001dc08 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E> + 8001bb86: cd2a sw a0,152(sp) + 8001bb88: cf2e sw a1,156(sp) + 8001bb8a: a009 j 8001bb8c <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x76> + 8001bb8c: 09816503 lwu a0,152(sp) + 8001bb90: 4581 li a1,0 + 8001bb92: 00b50463 beq a0,a1,8001bb9a <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x84> + 8001bb96: a009 j 8001bb98 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x82> + 8001bb98: a031 j 8001bba4 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x8e> + 8001bb9a: 4501 li a0,0 + false + 8001bb9c: 02a10ba3 sb a0,55(sp) + } + 8001bba0: a8a5 j 8001bc18 <.LBB16_23+0x2c> + for offset in (init_size..final_size).step_by(size_of::()) { + 8001bba2: 0000 unimp + 8001bba4: 09c16503 lwu a0,156(sp) + 8001bba8: e82a sd a0,16(sp) + 8001bbaa: cfaa sw a0,220(sp) + 8001bbac: d1aa sw a0,224(sp) + 8001bbae: d3aa sw a0,228(sp) + 8001bbb0: 1828 addi a0,sp,56 + size_of::() as u32 + 8001bbb2: ec2a sd a0,24(sp) + 8001bbb4: a009 j 8001bbb6 <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0xa0> + if self.read( + 8001bbb6: 6742 ld a4,16(sp) + 8001bbb8: 66e2 ld a3,24(sp) + 8001bbba: 75a2 ld a1,40(sp) + 8001bbbc: 1108 addi a0,sp,160 + 8001bbbe: 4601 li a2,0 + 8001bbc0: 47c1 li a5,16 + 8001bbc2: fffff097 auipc ra,0xfffff + 8001bbc6: 4ba080e7 jalr 1210(ra) # 8001b07c <_ZN6kernel2fs5inode9InodeData4read17h2d02dc0e430e4837E> + 8001bbca: a009 j 8001bbcc <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0xb6> + 8001bbcc: 1108 addi a0,sp,160 + 8001bbce: ffff2097 auipc ra,0xffff2 + 8001bbd2: ac8080e7 jalr -1336(ra) # 8000d696 <_ZN4core6result19Result$LT$T$C$E$GT$6is_err17he593c7735b347060E> + 8001bbd6: e42a sd a0,8(sp) + 8001bbd8: a009 j 8001bbda <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0xc4> + 8001bbda: 6522 ld a0,8(sp) + 8001bbdc: 4581 li a1,0 + 8001bbde: 02b50263 beq a0,a1,8001bc02 <.LBB16_23+0x16> + 8001bbe2: a009 j 8001bbe4 <.LBB16_22> + +000000008001bbe4 <.LBB16_22>: + panic!("is_dir_empty(): Fail to read dir content"); + 8001bbe4: 00010517 auipc a0,0x10 + 8001bbe8: 71d50513 addi a0,a0,1821 # 8002c301 <.L__unnamed_83> + +000000008001bbec <.LBB16_23>: + 8001bbec: 00010617 auipc a2,0x10 + 8001bbf0: 74460613 addi a2,a2,1860 # 8002c330 <.L__unnamed_84> + 8001bbf4: 02800593 li a1,40 + 8001bbf8: 00007097 auipc ra,0x7 + 8001bbfc: 54c080e7 jalr 1356(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001bc00: 0000 unimp + if dir_entry.inum != 0 { + 8001bc02: 03815503 lhu a0,56(sp) + 8001bc06: 4581 li a1,0 + 8001bc08: 00b50763 beq a0,a1,8001bc16 <.LBB16_23+0x2a> + 8001bc0c: a009 j 8001bc0e <.LBB16_23+0x22> + 8001bc0e: 4505 li a0,1 + return true + 8001bc10: 02a10ba3 sb a0,55(sp) + } + 8001bc14: a011 j 8001bc18 <.LBB16_23+0x2c> + for offset in (init_size..final_size).step_by(size_of::()) { + 8001bc16: b79d j 8001bb7c <_ZN6kernel2fs5inode9InodeData12is_dir_empty17h5fc1239b2ba5dde8E+0x66> + } + 8001bc18: 03714503 lbu a0,55(sp) + 8001bc1c: 70ae ld ra,232(sp) + 8001bc1e: 616d addi sp,sp,240 + 8001bc20: 8082 ret + +000000008001bc22 <.LBB16_24>: + let init_size = 2 * size_of::() as u32; + 8001bc22: 00010517 auipc a0,0x10 + 8001bc26: 6be50513 addi a0,a0,1726 # 8002c2e0 + +000000008001bc2a <.LBB16_25>: + 8001bc2a: 00010617 auipc a2,0x10 + 8001bc2e: 69e60613 addi a2,a2,1694 # 8002c2c8 <.L__unnamed_85> + 8001bc32: 02100593 li a1,33 + 8001bc36: 00007097 auipc ra,0x7 + 8001bc3a: 50e080e7 jalr 1294(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN63_$LT$kernel..fs..inode..Inode$u20$as$u20$core..clone..Clone$GT$5clone17hdd0850fb54e2bc6cE: + +000000008001bc40 <_ZN63_$LT$kernel..fs..inode..Inode$u20$as$u20$core..clone..Clone$GT$5clone17hdd0850fb54e2bc6cE>: + fn clone(&self) -> Self { + 8001bc40: 7139 addi sp,sp,-64 + 8001bc42: fc06 sd ra,56(sp) + 8001bc44: 85aa mv a1,a0 + 8001bc46: ec2e sd a1,24(sp) + +000000008001bc48 <.LBB17_2>: + ICACHE.dup(self) + 8001bc48: 00040517 auipc a0,0x40 + 8001bc4c: 93850513 addi a0,a0,-1736 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 8001bc50: ffffe097 auipc ra,0xffffe + 8001bc54: ace080e7 jalr -1330(ra) # 8001971e <_ZN6kernel2fs5inode10InodeCache3dup17h6659572d8df32b14E> + 8001bc58: f02a sd a0,32(sp) + 8001bc5a: f42e sd a1,40(sp) + 8001bc5c: e42a sd a0,8(sp) + 8001bc5e: e82e sd a1,16(sp) + 8001bc60: a009 j 8001bc62 <.LBB17_2+0x1a> + } + 8001bc62: 6522 ld a0,8(sp) + 8001bc64: 65c2 ld a1,16(sp) + 8001bc66: 70e2 ld ra,56(sp) + 8001bc68: 6121 addi sp,sp,64 + 8001bc6a: 8082 ret + +Disassembly of section .text._ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE: + +000000008001bc6c <_ZN6kernel2fs5inode5Inode4lock17he70970c593f751adE>: + pub fn lock<'a>(&'a self) -> SleepLockGuard<'a, InodeData> { + 8001bc6c: 7129 addi sp,sp,-320 + 8001bc6e: fe06 sd ra,312(sp) + 8001bc70: f8aa sd a0,112(sp) + 8001bc72: ee2a sd a0,280(sp) + assert!(self.index < NINODE, "index must less than NINODE"); + 8001bc74: 6108 ld a0,0(a0) + 8001bc76: 03200593 li a1,50 + 8001bc7a: 02b56163 bltu a0,a1,8001bc9c <.LBB18_26+0x14> + 8001bc7e: a009 j 8001bc80 <.LBB18_25> + +000000008001bc80 <.LBB18_25>: + 8001bc80: 00010517 auipc a0,0x10 + 8001bc84: 6c850513 addi a0,a0,1736 # 8002c348 <.L__unnamed_86> + +000000008001bc88 <.LBB18_26>: + 8001bc88: 00010617 auipc a2,0x10 + 8001bc8c: 6e060613 addi a2,a2,1760 # 8002c368 <.L__unnamed_87> + 8001bc90: 45ed li a1,27 + 8001bc92: 00007097 auipc ra,0x7 + 8001bc96: 4b2080e7 jalr 1202(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001bc9a: 0000 unimp + let mut guard = ICACHE.data[self.index].lock(); + 8001bc9c: 7546 ld a0,112(sp) + 8001bc9e: 610c ld a1,0(a0) + 8001bca0: f4ae sd a1,104(sp) + 8001bca2: 03100513 li a0,49 + 8001bca6: 1ab56463 bltu a0,a1,8001be4e <.LBB18_32+0x22> + 8001bcaa: a009 j 8001bcac <.LBB18_26+0x24> + 8001bcac: 7526 ld a0,104(sp) + 8001bcae: 00751593 slli a1,a0,0x7 + +000000008001bcb2 <.LBB18_27>: + 8001bcb2: 00040517 auipc a0,0x40 + 8001bcb6: 8ce50513 addi a0,a0,-1842 # 8005b580 <_ZN6kernel2fs5inode6ICACHE17had1be8942ca79bf1E> + 8001bcba: 952e add a0,a0,a1 + 8001bcbc: 4d050513 addi a0,a0,1232 + 8001bcc0: 00002097 auipc ra,0x2 + 8001bcc4: 544080e7 jalr 1348(ra) # 8001e204 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE> + 8001bcc8: fcaa sd a0,120(sp) + 8001bcca: e12e sd a1,128(sp) + 8001bccc: a009 j 8001bcce <.LBB18_27+0x1c> + 8001bcce: 18a8 addi a0,sp,120 + if !guard.valid { + 8001bcd0: 00002097 auipc ra,0x2 + 8001bcd4: 7c2080e7 jalr 1986(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001bcd8: f0aa sd a0,96(sp) + 8001bcda: a009 j 8001bcdc <.LBB18_27+0x2a> + 8001bcdc: 7506 ld a0,96(sp) + 8001bcde: 04854503 lbu a0,72(a0) + 8001bce2: 8905 andi a0,a0,1 + 8001bce4: e10d bnez a0,8001bd06 <.LBB18_28+0x1a> + 8001bce6: a009 j 8001bce8 <.LBB18_27+0x36> + let blockno = unsafe{ SUPER_BLOCK.locate_inode(self.inum) }; + 8001bce8: 7546 ld a0,112(sp) + 8001bcea: 454c lw a1,12(a0) + +000000008001bcec <.LBB18_28>: + 8001bcec: 00048517 auipc a0,0x48 + 8001bcf0: 3b450513 addi a0,a0,948 # 800640a0 <_ZN6kernel2fs10superblock11SUPER_BLOCK17hc3889871ecbe2b54E> + 8001bcf4: fffec097 auipc ra,0xfffec + 8001bcf8: c12080e7 jalr -1006(ra) # 80007906 <_ZN6kernel2fs10superblock10SuperBlock12locate_inode17hc2dbfb20b9411e7cE> + 8001bcfc: 85aa mv a1,a0 + 8001bcfe: ecae sd a1,88(sp) + 8001bd00: 12a12223 sw a0,292(sp) + 8001bd04: a011 j 8001bd08 <.LBB18_28+0x1c> + if !guard.valid { + 8001bd06: aa3d j 8001be44 <.LBB18_32+0x18> + let buf = BCACHE.bread(self.dev, blockno); + 8001bd08: 66e6 ld a3,88(sp) + 8001bd0a: 7546 ld a0,112(sp) + 8001bd0c: 4510 lw a2,8(a0) + +000000008001bd0e <.LBB18_29>: + 8001bd0e: 00014597 auipc a1,0x14 + 8001bd12: 2f258593 addi a1,a1,754 # 80030000 <_ZN6kernel2fs3bio6BCACHE17h4811aac4f8d79dc4E> + 8001bd16: 0128 addi a0,sp,136 + 8001bd18: fffe8097 auipc ra,0xfffe8 + 8001bd1c: 97c080e7 jalr -1668(ra) # 80003694 <_ZN6kernel2fs3bio6Bcache5bread17h6ef915e4e896646bE> + 8001bd20: a009 j 8001bd22 <.LBB18_29+0x14> + let offset = locate_inode_offset(self.inum) as isize; + 8001bd22: 7546 ld a0,112(sp) + 8001bd24: 4548 lw a0,12(a0) + 8001bd26: 00000097 auipc ra,0x0 + 8001bd2a: 140080e7 jalr 320(ra) # 8001be66 <_ZN6kernel2fs5inode19locate_inode_offset17h88c1ade407c59915E> + 8001bd2e: e8aa sd a0,80(sp) + 8001bd30: a009 j 8001bd32 <.LBB18_29+0x24> + 8001bd32: 6546 ld a0,80(sp) + 8001bd34: f62a sd a0,296(sp) + 8001bd36: 0128 addi a0,sp,136 + let dinode = unsafe{ (buf.raw_data() as *const DiskInode).offset(offset) }; + 8001bd38: fffe8097 auipc ra,0xfffe8 + 8001bd3c: aa2080e7 jalr -1374(ra) # 800037da <_ZN6kernel2fs3bio3Buf8raw_data17h6a896fea03f7ee91E> + 8001bd40: e4aa sd a0,72(sp) + 8001bd42: a009 j 8001bd44 <.LBB18_29+0x36> + 8001bd44: 65c6 ld a1,80(sp) + 8001bd46: 6526 ld a0,72(sp) + 8001bd48: ffffd097 auipc ra,0xffffd + 8001bd4c: 4d4080e7 jalr 1236(ra) # 8001921c <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17hb9f56331d13383c1E> + 8001bd50: 85aa mv a1,a0 + 8001bd52: e0ae sd a1,64(sp) + 8001bd54: fa2a sd a0,304(sp) + 8001bd56: a009 j 8001bd58 <.LBB18_29+0x4a> + guard.dinode = unsafe{ core::ptr::read(dinode) }; + 8001bd58: 6586 ld a1,64(sp) + 8001bd5a: 1908 addi a0,sp,176 + 8001bd5c: ffffe097 auipc ra,0xffffe + 8001bd60: 836080e7 jalr -1994(ra) # 80019592 <_ZN4core3ptr4read17hd38a26e0d5db892cE> + 8001bd64: a009 j 8001bd66 <.LBB18_29+0x58> + 8001bd66: 18a8 addi a0,sp,120 + 8001bd68: 00002097 auipc ra,0x2 + 8001bd6c: 73e080e7 jalr 1854(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001bd70: fc2a sd a0,56(sp) + 8001bd72: a009 j 8001bd74 <.LBB18_29+0x66> + 8001bd74: 7562 ld a0,56(sp) + 8001bd76: 0521 addi a0,a0,8 + 8001bd78: 190c addi a1,sp,176 + 8001bd7a: 04000613 li a2,64 + 8001bd7e: 0000a097 auipc ra,0xa + 8001bd82: 304080e7 jalr 772(ra) # 80026082 + drop(buf); + 8001bd86: 652a ld a0,136(sp) + 8001bd88: f9aa sd a0,240(sp) + 8001bd8a: 654a ld a0,144(sp) + 8001bd8c: fdaa sd a0,248(sp) + 8001bd8e: 656a ld a0,152(sp) + 8001bd90: e22a sd a0,256(sp) + 8001bd92: 750a ld a0,160(sp) + 8001bd94: e62a sd a0,264(sp) + 8001bd96: 752a ld a0,168(sp) + 8001bd98: ea2a sd a0,272(sp) + 8001bd9a: 1988 addi a0,sp,240 + 8001bd9c: 00002097 auipc ra,0x2 + 8001bda0: 182080e7 jalr 386(ra) # 8001df1e <_ZN4core3mem4drop17hda1e19029436deb9E> + 8001bda4: a009 j 8001bda6 <.LBB18_29+0x98> + 8001bda6: 18a8 addi a0,sp,120 + guard.valid = true; + 8001bda8: 00002097 auipc ra,0x2 + 8001bdac: 6fe080e7 jalr 1790(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001bdb0: f82a sd a0,48(sp) + 8001bdb2: a009 j 8001bdb4 <.LBB18_29+0xa6> + 8001bdb4: 7546 ld a0,112(sp) + 8001bdb6: 7642 ld a2,48(sp) + 8001bdb8: 4585 li a1,1 + 8001bdba: 04b60423 sb a1,72(a2) + guard.dev = self.dev; + 8001bdbe: 00856503 lwu a0,8(a0) + 8001bdc2: f02a sd a0,32(sp) + 8001bdc4: 18a8 addi a0,sp,120 + 8001bdc6: 00002097 auipc ra,0x2 + 8001bdca: 6e0080e7 jalr 1760(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001bdce: f42a sd a0,40(sp) + 8001bdd0: a009 j 8001bdd2 <.LBB18_29+0xc4> + 8001bdd2: 7546 ld a0,112(sp) + 8001bdd4: 7582 ld a1,32(sp) + 8001bdd6: 7622 ld a2,40(sp) + 8001bdd8: c20c sw a1,0(a2) + guard.inum = self.inum; + 8001bdda: 00c56503 lwu a0,12(a0) + 8001bdde: e82a sd a0,16(sp) + 8001bde0: 18a8 addi a0,sp,120 + 8001bde2: 00002097 auipc ra,0x2 + 8001bde6: 6c4080e7 jalr 1732(ra) # 8001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E> + 8001bdea: ec2a sd a0,24(sp) + 8001bdec: a009 j 8001bdee <.LBB18_29+0xe0> + 8001bdee: 6542 ld a0,16(sp) + 8001bdf0: 65e2 ld a1,24(sp) + 8001bdf2: c1c8 sw a0,4(a1) + 8001bdf4: 18a8 addi a0,sp,120 + if guard.dinode.itype == InodeType::Empty { + 8001bdf6: 00002097 auipc ra,0x2 + 8001bdfa: 69c080e7 jalr 1692(ra) # 8001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E> + 8001bdfe: e42a sd a0,8(sp) + 8001be00: a009 j 8001be02 <.LBB18_29+0xf4> + 8001be02: 6522 ld a0,8(sp) + 8001be04: 0521 addi a0,a0,8 + +000000008001be06 <.LBB18_30>: + 8001be06: 00010597 auipc a1,0x10 + 8001be0a: 59258593 addi a1,a1,1426 # 8002c398 <.L__unnamed_88> + 8001be0e: fffec097 auipc ra,0xfffec + 8001be12: 78a080e7 jalr 1930(ra) # 80008598 <_ZN70_$LT$kernel..fs..dinode..InodeType$u20$as$u20$core..cmp..PartialEq$GT$2eq17h96b8b60db340aeeeE> + 8001be16: e02a sd a0,0(sp) + 8001be18: a009 j 8001be1a <.LBB18_30+0x14> + 8001be1a: 6502 ld a0,0(sp) + 8001be1c: 4581 li a1,0 + 8001be1e: 02b50263 beq a0,a1,8001be42 <.LBB18_32+0x16> + 8001be22: a009 j 8001be24 <.LBB18_31> + +000000008001be24 <.LBB18_31>: + panic!("inode lock: trying to lock an inode whose type is empty.") + 8001be24: 00010517 auipc a0,0x10 + 8001be28: 57650513 addi a0,a0,1398 # 8002c39a <.L__unnamed_89> + +000000008001be2c <.LBB18_32>: + 8001be2c: 00010617 auipc a2,0x10 + 8001be30: 5ac60613 addi a2,a2,1452 # 8002c3d8 <.L__unnamed_90> + 8001be34: 03800593 li a1,56 + 8001be38: 00007097 auipc ra,0x7 + 8001be3c: 30c080e7 jalr 780(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001be40: 0000 unimp + if !guard.valid { + 8001be42: a009 j 8001be44 <.LBB18_32+0x18> + } + 8001be44: 7566 ld a0,120(sp) + 8001be46: 658a ld a1,128(sp) + 8001be48: 70f2 ld ra,312(sp) + 8001be4a: 6131 addi sp,sp,320 + 8001be4c: 8082 ret + let mut guard = ICACHE.data[self.index].lock(); + 8001be4e: 7526 ld a0,104(sp) + +000000008001be50 <.LBB18_33>: + 8001be50: 00010617 auipc a2,0x10 + 8001be54: 53060613 addi a2,a2,1328 # 8002c380 <.L__unnamed_91> + 8001be58: 03200593 li a1,50 + 8001be5c: 00007097 auipc ra,0x7 + 8001be60: 314080e7 jalr 788(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel2fs5inode19locate_inode_offset17h88c1ade407c59915E: + +000000008001be66 <_ZN6kernel2fs5inode19locate_inode_offset17h88c1ade407c59915E>: + + +/// Given an inode number. +/// Calculate the offset index of this inode inside the block. +#[inline] +fn locate_inode_offset(inum: u32) -> usize { + 8001be66: 1141 addi sp,sp,-16 + 8001be68: c62a sw a0,12(sp) + inum as usize % IPB + 8001be6a: 893d andi a0,a0,15 +} + 8001be6c: 0141 addi sp,sp,16 + 8001be6e: 8082 ret + +Disassembly of section .text._ZN4core3ptr8metadata14from_raw_parts17hb35c9d87c96e1656E: + +000000008001be70 <_ZN4core3ptr8metadata14from_raw_parts17hb35c9d87c96e1656E>: +/// +/// [`slice::from_raw_parts`]: crate::slice::from_raw_parts +#[unstable(feature = "ptr_metadata", issue = "81513")] +#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")] +#[inline] +pub const fn from_raw_parts( + 8001be70: 7179 addi sp,sp,-48 + 8001be72: f02a sd a0,32(sp) + 8001be74: f42e sd a1,40(sp) + metadata: ::Metadata, +) -> *const T { + // SAFETY: Accessing the value from the `PtrRepr` union is safe since *const T + // and PtrComponents have the same memory layouts. Only std can make this + // guarantee. + unsafe { PtrRepr { components: PtrComponents { data_address, metadata } }.const_ptr } + 8001be76: e82a sd a0,16(sp) + 8001be78: ec2e sd a1,24(sp) + 8001be7a: e02a sd a0,0(sp) + 8001be7c: e42e sd a1,8(sp) +} + 8001be7e: 6145 addi sp,sp,48 + 8001be80: 8082 ret + +Disassembly of section .text._ZN4core3ptr8metadata14from_raw_parts17hd9330322b61d2f92E: + +000000008001be82 <_ZN4core3ptr8metadata14from_raw_parts17hd9330322b61d2f92E>: +pub const fn from_raw_parts( + 8001be82: 7179 addi sp,sp,-48 + 8001be84: f02a sd a0,32(sp) + 8001be86: f42e sd a1,40(sp) + unsafe { PtrRepr { components: PtrComponents { data_address, metadata } }.const_ptr } + 8001be88: e82a sd a0,16(sp) + 8001be8a: ec2e sd a1,24(sp) + 8001be8c: e02a sd a0,0(sp) + 8001be8e: e42e sd a1,8(sp) +} + 8001be90: 6145 addi sp,sp,48 + 8001be92: 8082 ret + +Disassembly of section .text._ZN4core3ptr8metadata8metadata17h8c3e19bdf44a2913E: + +000000008001be94 <_ZN4core3ptr8metadata8metadata17h8c3e19bdf44a2913E>: +pub const fn metadata(ptr: *const T) -> ::Metadata { + 8001be94: 7179 addi sp,sp,-48 + 8001be96: e42e sd a1,8(sp) + 8001be98: 85aa mv a1,a0 + 8001be9a: 6522 ld a0,8(sp) + 8001be9c: f02e sd a1,32(sp) + 8001be9e: f42a sd a0,40(sp) + unsafe { PtrRepr { const_ptr: ptr }.components.metadata } + 8001bea0: e82e sd a1,16(sp) + 8001bea2: ec2a sd a0,24(sp) +} + 8001bea4: 6145 addi sp,sp,48 + 8001bea6: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h3aa8018dbd05d49dE: + +000000008001bea8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h3aa8018dbd05d49dE>: + pub const fn is_null(self) -> bool { + 8001bea8: 1101 addi sp,sp,-32 + 8001beaa: ec06 sd ra,24(sp) + 8001beac: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 8001beae: e42a sd a0,8(sp) + 8001beb0: a009 j 8001beb2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h3aa8018dbd05d49dE+0xa> + 8001beb2: 6522 ld a0,8(sp) + 8001beb4: 4581 li a1,0 + 8001beb6: 00007097 auipc ra,0x7 + 8001beba: 054080e7 jalr 84(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 8001bebe: e02a sd a0,0(sp) + 8001bec0: a009 j 8001bec2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h3aa8018dbd05d49dE+0x1a> + } + 8001bec2: 6502 ld a0,0(sp) + 8001bec4: 60e2 ld ra,24(sp) + 8001bec6: 6105 addi sp,sp,32 + 8001bec8: 8082 ret + +Disassembly of section .text._ZN4core4char7methods15encode_utf8_raw17h793a073b272121f7E: + +000000008001beca <_ZN4core4char7methods15encode_utf8_raw17h793a073b272121f7E>: +/// Panics if the buffer is not large enough. +/// A buffer of length four is large enough to encode any `char`. +#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")] +#[doc(hidden)] +#[inline] +pub fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] { + 8001beca: 7121 addi sp,sp,-448 + 8001becc: ff06 sd ra,440(sp) + 8001bece: e132 sd a2,128(sp) + 8001bed0: e52e sd a1,136(sp) + 8001bed2: cb2a sw a0,148(sp) + 8001bed4: e2ae sd a1,320(sp) + 8001bed6: e6b2 sd a2,328(sp) + let len = len_utf8(code); + 8001bed8: 00000097 auipc ra,0x0 + 8001bedc: 280080e7 jalr 640(ra) # 8001c158 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE> + 8001bee0: ed2a sd a0,152(sp) + 8001bee2: a009 j 8001bee4 <_ZN4core4char7methods15encode_utf8_raw17h793a073b272121f7E+0x1a> + match (len, &mut dst[..]) { + 8001bee4: 658a ld a1,128(sp) + 8001bee6: 652a ld a0,136(sp) + 8001bee8: 666a ld a2,152(sp) + 8001beea: f4b2 sd a2,104(sp) + +000000008001beec <.LBB0_22>: + 8001beec: 00010617 auipc a2,0x10 + 8001bef0: 58460613 addi a2,a2,1412 # 8002c470 <.L__unnamed_1> + 8001bef4: ffff6097 auipc ra,0xffff6 + 8001bef8: fa8080e7 jalr -88(ra) # 80011e9c <_ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17h6397a28cd31ac6bcE> + 8001befc: f8aa sd a0,112(sp) + 8001befe: fcae sd a1,120(sp) + 8001bf00: a009 j 8001bf02 <.LBB0_22+0x16> + 8001bf02: 7526 ld a0,104(sp) + 8001bf04: 75e6 ld a1,120(sp) + 8001bf06: 7646 ld a2,112(sp) + 8001bf08: f12a sd a0,160(sp) + 8001bf0a: f532 sd a2,168(sp) + 8001bf0c: f92e sd a1,176(sp) + (1, [a, ..]) => { + 8001bf0e: 85aa mv a1,a0 + 8001bf10: f0ae sd a1,96(sp) + 8001bf12: 4585 li a1,1 + 8001bf14: 02b50263 beq a0,a1,8001bf38 <.LBB0_22+0x4c> + 8001bf18: a009 j 8001bf1a <.LBB0_22+0x2e> + 8001bf1a: 7506 ld a0,96(sp) + 8001bf1c: 4589 li a1,2 + 8001bf1e: 02b50a63 beq a0,a1,8001bf52 <.LBB0_22+0x66> + 8001bf22: a009 j 8001bf24 <.LBB0_22+0x38> + 8001bf24: 7506 ld a0,96(sp) + 8001bf26: 458d li a1,3 + 8001bf28: 02b50a63 beq a0,a1,8001bf5c <.LBB0_22+0x70> + 8001bf2c: a009 j 8001bf2e <.LBB0_22+0x42> + 8001bf2e: 7506 ld a0,96(sp) + 8001bf30: 4591 li a1,4 + 8001bf32: 02b50a63 beq a0,a1,8001bf66 <.LBB0_22+0x7a> + 8001bf36: a031 j 8001bf42 <.LBB0_22+0x56> + 8001bf38: 754a ld a0,176(sp) + 8001bf3a: 4581 li a1,0 + 8001bf3c: 02b51a63 bne a0,a1,8001bf70 <.LBB0_22+0x84> + 8001bf40: a009 j 8001bf42 <.LBB0_22+0x56> + } + _ => panic!( + "encode_utf8: need {} bytes to encode U+{:X}, but the buffer has {}", + len, + code, + dst.len(), + 8001bf42: 658a ld a1,128(sp) + 8001bf44: 652a ld a0,136(sp) + 8001bf46: 00004097 auipc ra,0x4 + 8001bf4a: 55c080e7 jalr 1372(ra) # 800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E> + 8001bf4e: fa2a sd a0,304(sp) + 8001bf50: a8c5 j 8001c040 <.LBB0_22+0x154> + (2, [a, b, ..]) => { + 8001bf52: 75ca ld a1,176(sp) + 8001bf54: 4505 li a0,1 + 8001bf56: 02b56463 bltu a0,a1,8001bf7e <.LBB0_22+0x92> + 8001bf5a: b7e5 j 8001bf42 <.LBB0_22+0x56> + (3, [a, b, c, ..]) => { + 8001bf5c: 75ca ld a1,176(sp) + 8001bf5e: 4509 li a0,2 + 8001bf60: 04b56463 bltu a0,a1,8001bfa8 <.LBB0_22+0xbc> + 8001bf64: bff9 j 8001bf42 <.LBB0_22+0x56> + (4, [a, b, c, d, ..]) => { + 8001bf66: 75ca ld a1,176(sp) + 8001bf68: 450d li a0,3 + 8001bf6a: 06b56f63 bltu a0,a1,8001bfe8 <.LBB0_22+0xfc> + 8001bf6e: bfd1 j 8001bf42 <.LBB0_22+0x56> + (1, [a, ..]) => { + 8001bf70: 75aa ld a1,168(sp) + 8001bf72: ef2e sd a1,408(sp) + *a = code as u8; + 8001bf74: 09410503 lb a0,148(sp) + 8001bf78: 00a58023 sb a0,0(a1) + match (len, &mut dst[..]) { + 8001bf7c: a29d j 8001c0e2 <.LBB0_27+0x14> + (2, [a, b, ..]) => { + 8001bf7e: 75aa ld a1,168(sp) + 8001bf80: e72e sd a1,392(sp) + 8001bf82: 00158513 addi a0,a1,1 + 8001bf86: eb2a sd a0,400(sp) + *a = (code >> 6 & 0x1F) as u8 | TAG_TWO_B; + 8001bf88: 455a lw a0,148(sp) + 8001bf8a: 8119 srli a0,a0,0x6 + 8001bf8c: 897d andi a0,a0,31 + 8001bf8e: 0c056513 ori a0,a0,192 + 8001bf92: 00a58023 sb a0,0(a1) + *b = (code & 0x3F) as u8 | TAG_CONT; + 8001bf96: 09414503 lbu a0,148(sp) + 8001bf9a: 03f57513 andi a0,a0,63 + 8001bf9e: 08056513 ori a0,a0,128 + 8001bfa2: 00a580a3 sb a0,1(a1) + match (len, &mut dst[..]) { + 8001bfa6: aa35 j 8001c0e2 <.LBB0_27+0x14> + (3, [a, b, c, ..]) => { + 8001bfa8: 75aa ld a1,168(sp) + 8001bfaa: faae sd a1,368(sp) + 8001bfac: 00158513 addi a0,a1,1 + 8001bfb0: feaa sd a0,376(sp) + 8001bfb2: 00258513 addi a0,a1,2 + 8001bfb6: e32a sd a0,384(sp) + *a = (code >> 12 & 0x0F) as u8 | TAG_THREE_B; + 8001bfb8: 455a lw a0,148(sp) + 8001bfba: 8131 srli a0,a0,0xc + 8001bfbc: 893d andi a0,a0,15 + 8001bfbe: 0e056513 ori a0,a0,224 + 8001bfc2: 00a58023 sb a0,0(a1) + *b = (code >> 6 & 0x3F) as u8 | TAG_CONT; + 8001bfc6: 455a lw a0,148(sp) + 8001bfc8: 8119 srli a0,a0,0x6 + 8001bfca: 03f57513 andi a0,a0,63 + 8001bfce: 08056513 ori a0,a0,128 + 8001bfd2: 00a580a3 sb a0,1(a1) + *c = (code & 0x3F) as u8 | TAG_CONT; + 8001bfd6: 09414503 lbu a0,148(sp) + 8001bfda: 03f57513 andi a0,a0,63 + 8001bfde: 08056513 ori a0,a0,128 + 8001bfe2: 00a58123 sb a0,2(a1) + match (len, &mut dst[..]) { + 8001bfe6: a8f5 j 8001c0e2 <.LBB0_27+0x14> + (4, [a, b, c, d, ..]) => { + 8001bfe8: 75aa ld a1,168(sp) + 8001bfea: ecae sd a1,88(sp) + 8001bfec: eaae sd a1,336(sp) + 8001bfee: 00158513 addi a0,a1,1 + 8001bff2: eeaa sd a0,344(sp) + 8001bff4: 00258513 addi a0,a1,2 + 8001bff8: f2aa sd a0,352(sp) + 8001bffa: 00358513 addi a0,a1,3 + 8001bffe: f6aa sd a0,360(sp) + *a = (code >> 18 & 0x07) as u8 | TAG_FOUR_B; + 8001c000: 455a lw a0,148(sp) + 8001c002: 8149 srli a0,a0,0x12 + 8001c004: 891d andi a0,a0,7 + 8001c006: 0f056513 ori a0,a0,240 + 8001c00a: 00a58023 sb a0,0(a1) + *b = (code >> 12 & 0x3F) as u8 | TAG_CONT; + 8001c00e: 455a lw a0,148(sp) + 8001c010: 8131 srli a0,a0,0xc + 8001c012: 03f57513 andi a0,a0,63 + 8001c016: 08056513 ori a0,a0,128 + 8001c01a: 00a580a3 sb a0,1(a1) + *c = (code >> 6 & 0x3F) as u8 | TAG_CONT; + 8001c01e: 455a lw a0,148(sp) + 8001c020: 8119 srli a0,a0,0x6 + 8001c022: 03f57513 andi a0,a0,63 + 8001c026: 08056513 ori a0,a0,128 + 8001c02a: 00a58123 sb a0,2(a1) + *d = (code & 0x3F) as u8 | TAG_CONT; + 8001c02e: 09414503 lbu a0,148(sp) + 8001c032: 03f57513 andi a0,a0,63 + 8001c036: 08056513 ori a0,a0,128 + 8001c03a: 00a581a3 sb a0,3(a1) + match (len, &mut dst[..]) { + 8001c03e: a055 j 8001c0e2 <.LBB0_27+0x14> + 8001c040: 0928 addi a0,sp,152 + _ => panic!( + 8001c042: ee2a sd a0,280(sp) + 8001c044: 0950 addi a2,sp,148 + 8001c046: fc32 sd a2,56(sp) + 8001c048: f232 sd a2,288(sp) + 8001c04a: 1a0c addi a1,sp,304 + 8001c04c: e0ae sd a1,64(sp) + 8001c04e: f62e sd a1,296(sp) + 8001c050: f32a sd a0,416(sp) + 8001c052: f732 sd a2,424(sp) + 8001c054: fb2e sd a1,432(sp) + +000000008001c056 <.LBB0_23>: + 8001c056: 0000a597 auipc a1,0xa + 8001c05a: 84a58593 addi a1,a1,-1974 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001c05e: 00004097 auipc ra,0x4 + 8001c062: 510080e7 jalr 1296(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001c066: e4aa sd a0,72(sp) + 8001c068: e8ae sd a1,80(sp) + 8001c06a: a009 j 8001c06c <.LBB0_23+0x16> + 8001c06c: 7562 ld a0,56(sp) + +000000008001c06e <.LBB0_24>: + 8001c06e: 00009597 auipc a1,0x9 + 8001c072: 18e58593 addi a1,a1,398 # 800251fc <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17hf71897f85e3edf35E> + 8001c076: 00007097 auipc ra,0x7 + 8001c07a: e5c080e7 jalr -420(ra) # 80022ed2 <_ZN4core3fmt10ArgumentV13new17ha67f1954b9155e6dE> + 8001c07e: f42a sd a0,40(sp) + 8001c080: f82e sd a1,48(sp) + 8001c082: a009 j 8001c084 <.LBB0_24+0x16> + 8001c084: 6506 ld a0,64(sp) + +000000008001c086 <.LBB0_25>: + 8001c086: 0000a597 auipc a1,0xa + 8001c08a: 81a58593 addi a1,a1,-2022 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001c08e: 00004097 auipc ra,0x4 + 8001c092: 4e0080e7 jalr 1248(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001c096: ec2a sd a0,24(sp) + 8001c098: f02e sd a1,32(sp) + 8001c09a: a009 j 8001c09c <.LBB0_25+0x16> + 8001c09c: 7502 ld a0,32(sp) + 8001c09e: 65e2 ld a1,24(sp) + 8001c0a0: 7642 ld a2,48(sp) + 8001c0a2: 76a2 ld a3,40(sp) + 8001c0a4: 6746 ld a4,80(sp) + 8001c0a6: 67a6 ld a5,72(sp) + 8001c0a8: f5be sd a5,232(sp) + 8001c0aa: f9ba sd a4,240(sp) + 8001c0ac: fdb6 sd a3,248(sp) + 8001c0ae: e232 sd a2,256(sp) + 8001c0b0: e62e sd a1,264(sp) + 8001c0b2: ea2a sd a0,272(sp) + +000000008001c0b4 <.LBB0_26>: + 8001c0b4: 00010597 auipc a1,0x10 + 8001c0b8: 42c58593 addi a1,a1,1068 # 8002c4e0 <.L__unnamed_2> + 8001c0bc: 1928 addi a0,sp,184 + 8001c0be: 11b4 addi a3,sp,232 + 8001c0c0: 470d li a4,3 + 8001c0c2: 863a mv a2,a4 + 8001c0c4: fffe9097 auipc ra,0xfffe9 + 8001c0c8: 4c6080e7 jalr 1222(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001c0cc: a009 j 8001c0ce <.LBB0_27> + +000000008001c0ce <.LBB0_27>: + 8001c0ce: 00010597 auipc a1,0x10 + 8001c0d2: 44258593 addi a1,a1,1090 # 8002c510 <.L__unnamed_3> + 8001c0d6: 1928 addi a0,sp,184 + 8001c0d8: 00007097 auipc ra,0x7 + 8001c0dc: 0d8080e7 jalr 216(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 8001c0e0: 0000 unimp + ), + }; + &mut dst[..len] + 8001c0e2: 658a ld a1,128(sp) + 8001c0e4: 652a ld a0,136(sp) + 8001c0e6: 666a ld a2,152(sp) + 8001c0e8: fe32 sd a2,312(sp) + +000000008001c0ea <.LBB0_28>: + 8001c0ea: 00010697 auipc a3,0x10 + 8001c0ee: 39e68693 addi a3,a3,926 # 8002c488 <.L__unnamed_4> + 8001c0f2: ffff6097 auipc ra,0xffff6 + 8001c0f6: dca080e7 jalr -566(ra) # 80011ebc <_ZN4core5slice5index77_$LT$impl$u20$core..ops..index..IndexMut$LT$I$GT$$u20$for$u20$$u5b$T$u5d$$GT$9index_mut17hb4c5f14cfefb7eb2E> + 8001c0fa: e42a sd a0,8(sp) + 8001c0fc: e82e sd a1,16(sp) + 8001c0fe: a009 j 8001c100 <.LBB0_28+0x16> +} + 8001c100: 65c2 ld a1,16(sp) + 8001c102: 6522 ld a0,8(sp) + 8001c104: 70fa ld ra,440(sp) + 8001c106: 6139 addi sp,sp,448 + 8001c108: 8082 ret + +Disassembly of section .text._ZN4core4char7methods22_$LT$impl$u20$char$GT$11encode_utf817h7239bcb774eea5aaE: + +000000008001c10a <_ZN4core4char7methods22_$LT$impl$u20$char$GT$11encode_utf817h7239bcb774eea5aaE>: + pub fn encode_utf8(self, dst: &mut [u8]) -> &mut str { + 8001c10a: 7139 addi sp,sp,-64 + 8001c10c: fc06 sd ra,56(sp) + 8001c10e: d22a sw a0,36(sp) + 8001c110: f42e sd a1,40(sp) + 8001c112: f832 sd a2,48(sp) + unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) } + 8001c114: 00000097 auipc ra,0x0 + 8001c118: db6080e7 jalr -586(ra) # 8001beca <_ZN4core4char7methods15encode_utf8_raw17h793a073b272121f7E> + 8001c11c: e82a sd a0,16(sp) + 8001c11e: ec2e sd a1,24(sp) + 8001c120: a009 j 8001c122 <_ZN4core4char7methods22_$LT$impl$u20$char$GT$11encode_utf817h7239bcb774eea5aaE+0x18> + 8001c122: 65e2 ld a1,24(sp) + 8001c124: 6542 ld a0,16(sp) + 8001c126: 00003097 auipc ra,0x3 + 8001c12a: 5b0080e7 jalr 1456(ra) # 8001f6d6 <_ZN4core3str8converts23from_utf8_unchecked_mut17h690302c73d561c56E> + 8001c12e: e02a sd a0,0(sp) + 8001c130: e42e sd a1,8(sp) + 8001c132: a009 j 8001c134 <_ZN4core4char7methods22_$LT$impl$u20$char$GT$11encode_utf817h7239bcb774eea5aaE+0x2a> + } + 8001c134: 65a2 ld a1,8(sp) + 8001c136: 6502 ld a0,0(sp) + 8001c138: 70e2 ld ra,56(sp) + 8001c13a: 6121 addi sp,sp,64 + 8001c13c: 8082 ret + +Disassembly of section .text._ZN4core4char7methods22_$LT$impl$u20$char$GT$8len_utf817h6b8693741ddbecceE: + +000000008001c13e <_ZN4core4char7methods22_$LT$impl$u20$char$GT$8len_utf817h6b8693741ddbecceE>: + pub const fn len_utf8(self) -> usize { + 8001c13e: 1101 addi sp,sp,-32 + 8001c140: ec06 sd ra,24(sp) + 8001c142: ca2a sw a0,20(sp) + len_utf8(self as u32) + 8001c144: 00000097 auipc ra,0x0 + 8001c148: 014080e7 jalr 20(ra) # 8001c158 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE> + 8001c14c: e42a sd a0,8(sp) + 8001c14e: a009 j 8001c150 <_ZN4core4char7methods22_$LT$impl$u20$char$GT$8len_utf817h6b8693741ddbecceE+0x12> + } + 8001c150: 6522 ld a0,8(sp) + 8001c152: 60e2 ld ra,24(sp) + 8001c154: 6105 addi sp,sp,32 + 8001c156: 8082 ret + +Disassembly of section .text._ZN4core4char7methods8len_utf817hc045ab91f009a8ffE: + +000000008001c158 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE>: +const fn len_utf8(code: u32) -> usize { + 8001c158: 1101 addi sp,sp,-32 + 8001c15a: 0005059b sext.w a1,a0 + 8001c15e: 862a mv a2,a0 + 8001c160: e432 sd a2,8(sp) + 8001c162: ce2a sw a0,28(sp) + 8001c164: 07f00513 li a0,127 + if code < MAX_ONE_B { + 8001c168: 00b56663 bltu a0,a1,8001c174 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x1c> + 8001c16c: a009 j 8001c16e <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x16> + 8001c16e: 4505 li a0,1 + 1 + 8001c170: e82a sd a0,16(sp) + if code < MAX_ONE_B { + 8001c172: a81d j 8001c1a8 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x50> + } else if code < MAX_TWO_B { + 8001c174: 6522 ld a0,8(sp) + 8001c176: 0005059b sext.w a1,a0 + 8001c17a: 7ff00513 li a0,2047 + 8001c17e: 00b56663 bltu a0,a1,8001c18a <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x32> + 8001c182: a009 j 8001c184 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x2c> + 8001c184: 4509 li a0,2 + 2 + 8001c186: e82a sd a0,16(sp) + } else if code < MAX_TWO_B { + 8001c188: a839 j 8001c1a6 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x4e> + } else if code < MAX_THREE_B { + 8001c18a: 6522 ld a0,8(sp) + 8001c18c: 0105551b srliw a0,a0,0x10 + 8001c190: 4581 li a1,0 + 8001c192: 00b51663 bne a0,a1,8001c19e <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x46> + 8001c196: a009 j 8001c198 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x40> + 8001c198: 450d li a0,3 + 3 + 8001c19a: e82a sd a0,16(sp) + } else if code < MAX_THREE_B { + 8001c19c: a021 j 8001c1a4 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x4c> + 8001c19e: 4511 li a0,4 + 4 + 8001c1a0: e82a sd a0,16(sp) + } else if code < MAX_THREE_B { + 8001c1a2: a009 j 8001c1a4 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x4c> + } else if code < MAX_TWO_B { + 8001c1a4: a009 j 8001c1a6 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x4e> + if code < MAX_ONE_B { + 8001c1a6: a009 j 8001c1a8 <_ZN4core4char7methods8len_utf817hc045ab91f009a8ffE+0x50> +} + 8001c1a8: 6542 ld a0,16(sp) + 8001c1aa: 6105 addi sp,sp,32 + 8001c1ac: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart9uart_init17h01daa242cfe569c9E: + +000000008001c1ae <_ZN6kernel6driver4uart9uart_init17h01daa242cfe569c9E>: +pub unsafe fn uart_init() { + 8001c1ae: 1101 addi sp,sp,-32 + let mut uart = UART.acquire(); + 8001c1b0: ec06 sd ra,24(sp) + +000000008001c1b2 <.LBB0_5>: + 8001c1b2: 00041517 auipc a0,0x41 + 8001c1b6: 19e50513 addi a0,a0,414 # 8005d350 <_ZN6kernel6driver4uart4UART17h0708b3e179d548ddE> + 8001c1ba: ffff5097 auipc ra,0xffff5 + 8001c1be: 868080e7 jalr -1944(ra) # 80010a22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E> + 8001c1c2: e82a sd a0,16(sp) + 8001c1c4: a009 j 8001c1c6 <.LBB0_5+0x14> + 8001c1c6: 0808 addi a0,sp,16 + uart.init(); + 8001c1c8: ffff6097 auipc ra,0xffff6 + 8001c1cc: c94080e7 jalr -876(ra) # 80011e5c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE> + 8001c1d0: e42a sd a0,8(sp) + 8001c1d2: a009 j 8001c1d4 <.LBB0_5+0x22> + 8001c1d4: 6522 ld a0,8(sp) + 8001c1d6: 00000097 auipc ra,0x0 + 8001c1da: 01c080e7 jalr 28(ra) # 8001c1f2 <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE> + 8001c1de: a009 j 8001c1e0 <.LBB0_5+0x2e> + drop(uart); + 8001c1e0: 6542 ld a0,16(sp) + 8001c1e2: 00002097 auipc ra,0x2 + 8001c1e6: cda080e7 jalr -806(ra) # 8001debc <_ZN4core3mem4drop17h96fc0e7c88170ba8E> + 8001c1ea: a009 j 8001c1ec <.LBB0_5+0x3a> +} + 8001c1ec: 60e2 ld ra,24(sp) + 8001c1ee: 6105 addi sp,sp,32 + 8001c1f0: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE: + +000000008001c1f2 <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE>: + pub fn init(&mut self) { + 8001c1f2: 1141 addi sp,sp,-16 + 8001c1f4: e406 sd ra,8(sp) + 8001c1f6: e02a sd a0,0(sp) + 8001c1f8: 10000537 lui a0,0x10000 + 8001c1fc: 2505 addiw a0,a0,1 + 8001c1fe: 4581 li a1,0 + write_reg(UART_BASE_ADDR + IER, 0x00); + 8001c200: 00000097 auipc ra,0x0 + 8001c204: 244080e7 jalr 580(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c208: a009 j 8001c20a <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE+0x18> + 8001c20a: 10000537 lui a0,0x10000 + 8001c20e: 250d addiw a0,a0,3 + 8001c210: 08000593 li a1,128 + write_reg(UART_BASE_ADDR + LCR, LCR_BAUD_LATCH as u8); + 8001c214: 00000097 auipc ra,0x0 + 8001c218: 230080e7 jalr 560(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c21c: a009 j 8001c21e <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE+0x2c> + 8001c21e: 10000537 lui a0,0x10000 + 8001c222: 458d li a1,3 + write_reg(UART_BASE_ADDR, 0x03); + 8001c224: 00000097 auipc ra,0x0 + 8001c228: 220080e7 jalr 544(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c22c: a009 j 8001c22e <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE+0x3c> + 8001c22e: 10000537 lui a0,0x10000 + 8001c232: 2505 addiw a0,a0,1 + 8001c234: 4581 li a1,0 + write_reg(UART_BASE_ADDR + 1, 0x00); + 8001c236: 00000097 auipc ra,0x0 + 8001c23a: 20e080e7 jalr 526(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c23e: a009 j 8001c240 <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE+0x4e> + 8001c240: 10000537 lui a0,0x10000 + 8001c244: 250d addiw a0,a0,3 + 8001c246: 458d li a1,3 + write_reg(UART_BASE_ADDR + LCR, LCR_EIGHT_BITS as u8); + 8001c248: 00000097 auipc ra,0x0 + 8001c24c: 1fc080e7 jalr 508(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c250: a009 j 8001c252 <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE+0x60> + 8001c252: 10000537 lui a0,0x10000 + 8001c256: 2509 addiw a0,a0,2 + 8001c258: 459d li a1,7 + write_reg(UART_BASE_ADDR + FCR, FCR_FIFO_ENABLE as u8 | FCR_FIFO_CLEAR as u8); + 8001c25a: 00000097 auipc ra,0x0 + 8001c25e: 1ea080e7 jalr 490(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c262: a009 j 8001c264 <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE+0x72> + 8001c264: 10000537 lui a0,0x10000 + 8001c268: 2505 addiw a0,a0,1 + 8001c26a: 458d li a1,3 + write_reg(UART_BASE_ADDR + IER, IER_TX_ENABLE as u8 | IER_RX_ENABLE as u8); + 8001c26c: 00000097 auipc ra,0x0 + 8001c270: 1d8080e7 jalr 472(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c274: a009 j 8001c276 <_ZN6kernel6driver4uart4Uart4init17h72a59b83aa9e24abE+0x84> + } + 8001c276: 60a2 ld ra,8(sp) + 8001c278: 0141 addi sp,sp,16 + 8001c27a: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E: + +000000008001c27c <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E>: + pub fn put(&mut self, c: u8) { + 8001c27c: 7139 addi sp,sp,-64 + 8001c27e: fc06 sd ra,56(sp) + 8001c280: 862e mv a2,a1 + 8001c282: ec32 sd a2,24(sp) + 8001c284: f02a sd a0,32(sp) + 8001c286: 02b107a3 sb a1,47(sp) + 8001c28a: 10000537 lui a0,0x10000 + let ptr = UART_BASE_ADDR as *mut u8; + 8001c28e: f82a sd a0,48(sp) + loop { + 8001c290: a009 j 8001c292 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x16> + 8001c292: 10000537 lui a0,0x10000 + 8001c296: 4595 li a1,5 + if unsafe{ ptr.add(5).read_volatile() } & (1 << 5) != 0 { + 8001c298: 00004097 auipc ra,0x4 + 8001c29c: 334080e7 jalr 820(ra) # 800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E> + 8001c2a0: e82a sd a0,16(sp) + 8001c2a2: a009 j 8001c2a4 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x28> + 8001c2a4: 6542 ld a0,16(sp) + 8001c2a6: fffed097 auipc ra,0xfffed + 8001c2aa: e18080e7 jalr -488(ra) # 800090be <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13read_volatile17h74b3a7ca48b9b2b5E> + 8001c2ae: e42a sd a0,8(sp) + 8001c2b0: a009 j 8001c2b2 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x36> + 8001c2b2: 6522 ld a0,8(sp) + 8001c2b4: 02057513 andi a0,a0,32 + 8001c2b8: 4581 li a1,0 + 8001c2ba: 00b50c63 beq a0,a1,8001c2d2 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x56> + 8001c2be: a009 j 8001c2c0 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x44> + 8001c2c0: 10000537 lui a0,0x10000 + 8001c2c4: 4581 li a1,0 + ptr.add(0).write_volatile(c); + 8001c2c6: 00004097 auipc ra,0x4 + 8001c2ca: 306080e7 jalr 774(ra) # 800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E> + 8001c2ce: e02a sd a0,0(sp) + 8001c2d0: a011 j 8001c2d4 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x58> + loop { + 8001c2d2: b7c1 j 8001c292 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x16> + ptr.add(0).write_volatile(c); + 8001c2d4: 65e2 ld a1,24(sp) + 8001c2d6: 6502 ld a0,0(sp) + 8001c2d8: fffed097 auipc ra,0xfffed + 8001c2dc: e00080e7 jalr -512(ra) # 800090d8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$14write_volatile17h3132c1bed6ef07b7E> + 8001c2e0: a009 j 8001c2e2 <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E+0x66> + } + 8001c2e2: 70e2 ld ra,56(sp) + 8001c2e4: 6121 addi sp,sp,64 + 8001c2e6: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E: + +000000008001c2e8 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E>: + fn transmit(&mut self) { + 8001c2e8: 711d addi sp,sp,-96 + 8001c2ea: ec86 sd ra,88(sp) + 8001c2ec: f42a sd a0,40(sp) + 8001c2ee: e0aa sd a0,64(sp) + 8001c2f0: a009 j 8001c2f2 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0xa> + while self.write_index != self.read_index && idle() { + 8001c2f2: 7522 ld a0,40(sp) + 8001c2f4: 00850593 addi a1,a0,8 # 10000008 <.Lline_table_start0+0xffc8ba3> + 8001c2f8: ffff4097 auipc ra,0xffff4 + 8001c2fc: cbe080e7 jalr -834(ra) # 8000ffb6 <_ZN79_$LT$core..num..wrapping..Wrapping$LT$T$GT$$u20$as$u20$core..cmp..PartialEq$GT$2ne17h2d3bd6a577efe0b1E> + 8001c300: f02a sd a0,32(sp) + 8001c302: a025 j 8001c32a <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x42> + 8001c304: 4505 li a0,1 + 8001c306: 02a10ba3 sb a0,55(sp) + 8001c30a: a819 j 8001c320 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x38> + 8001c30c: 4501 li a0,0 + 8001c30e: 02a10ba3 sb a0,55(sp) + 8001c312: a039 j 8001c320 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x38> + 8001c314: 00000097 auipc ra,0x0 + 8001c318: 164080e7 jalr 356(ra) # 8001c478 <_ZN6kernel6driver4uart4idle17h08982e96c6f33f38E> + 8001c31c: ec2a sd a0,24(sp) + 8001c31e: a809 j 8001c330 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x48> + 8001c320: 03714503 lbu a0,55(sp) + 8001c324: 8905 andi a0,a0,1 + 8001c326: e919 bnez a0,8001c33c <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x54> + 8001c328: a039 j 8001c336 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x4e> + 8001c32a: 7502 ld a0,32(sp) + 8001c32c: f565 bnez a0,8001c314 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x2c> + 8001c32e: bff9 j 8001c30c <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x24> + 8001c330: 6562 ld a0,24(sp) + 8001c332: f969 bnez a0,8001c304 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x1c> + 8001c334: bfe1 j 8001c30c <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x24> + } + 8001c336: 60e6 ld ra,88(sp) + 8001c338: 6125 addi sp,sp,96 + 8001c33a: 8082 ret + let read_index = self.read_index.0 % UART_BUF_SIZE; + 8001c33c: 7522 ld a0,40(sp) + 8001c33e: 6508 ld a0,8(a0) + 8001c340: 01f57593 andi a1,a0,31 + 8001c344: e82e sd a1,16(sp) + 8001c346: e4ae sd a1,72(sp) + 8001c348: 457d li a0,31 + let c = self.buf[read_index]; + 8001c34a: 04b56863 bltu a0,a1,8001c39a <.LBB3_15+0x24> + 8001c34e: a009 j 8001c350 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x68> + 8001c350: 7522 ld a0,40(sp) + 8001c352: 65c2 ld a1,16(sp) + 8001c354: 95aa add a1,a1,a0 + 8001c356: 0105c583 lbu a1,16(a1) + 8001c35a: e42e sd a1,8(sp) + 8001c35c: 04b10ba3 sb a1,87(sp) + self.read_index += Wrapping(1); + 8001c360: 0521 addi a0,a0,8 + 8001c362: 4585 li a1,1 + 8001c364: fc2e sd a1,56(sp) + 8001c366: fffeb097 auipc ra,0xfffeb + 8001c36a: 27a080e7 jalr 634(ra) # 800075e0 <_ZN90_$LT$core..num..wrapping..Wrapping$LT$usize$GT$$u20$as$u20$core..ops..arith..AddAssign$GT$10add_assign17hc731864567f3481aE> + 8001c36e: a009 j 8001c370 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0x88> + PROC_MANAGER.wake_up(&self.read_index as *const Wrapping<_> as usize); + 8001c370: 7522 ld a0,40(sp) + 8001c372: 00850593 addi a1,a0,8 + +000000008001c376 <.LBB3_15>: + 8001c376: 0003d517 auipc a0,0x3d + 8001c37a: 05a50513 addi a0,a0,90 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8001c37e: ffff2097 auipc ra,0xffff2 + 8001c382: e82080e7 jalr -382(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8001c386: a009 j 8001c388 <.LBB3_15+0x12> + write_reg(UART_BASE_ADDR + THR, c); + 8001c388: 65a2 ld a1,8(sp) + 8001c38a: 10000537 lui a0,0x10000 + 8001c38e: 00000097 auipc ra,0x0 + 8001c392: 0b6080e7 jalr 182(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c396: a009 j 8001c398 <.LBB3_15+0x22> + while self.write_index != self.read_index && idle() { + 8001c398: bfa9 j 8001c2f2 <_ZN6kernel6driver4uart4Uart8transmit17h1cf1c52f0e7bc086E+0xa> + let c = self.buf[read_index]; + 8001c39a: 6542 ld a0,16(sp) + +000000008001c39c <.LBB3_16>: + 8001c39c: 00010617 auipc a2,0x10 + 8001c3a0: 1a460613 addi a2,a2,420 # 8002c540 <.L__unnamed_1> + 8001c3a4: 02000593 li a1,32 + 8001c3a8: 00007097 auipc ra,0x7 + 8001c3ac: dc8080e7 jalr -568(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE: + +000000008001c3b2 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE>: + fn write_str(&mut self, out: &str) -> Result<(), Error> { + 8001c3b2: 7119 addi sp,sp,-128 + 8001c3b4: fc86 sd ra,120(sp) + 8001c3b6: e832 sd a2,16(sp) + 8001c3b8: 862e mv a2,a1 + 8001c3ba: 65c2 ld a1,16(sp) + 8001c3bc: ec32 sd a2,24(sp) + 8001c3be: 862a mv a2,a0 + 8001c3c0: 6562 ld a0,24(sp) + 8001c3c2: f032 sd a2,32(sp) + 8001c3c4: ecb2 sd a2,88(sp) + 8001c3c6: f0aa sd a0,96(sp) + 8001c3c8: f4ae sd a1,104(sp) + for c in out.bytes() { + 8001c3ca: ffffd097 auipc ra,0xffffd + 8001c3ce: d76080e7 jalr -650(ra) # 80019140 <_ZN4core3str21_$LT$impl$u20$str$GT$5bytes17h8801f19f835ac923E> + 8001c3d2: f42a sd a0,40(sp) + 8001c3d4: f82e sd a1,48(sp) + 8001c3d6: a009 j 8001c3d8 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x26> + 8001c3d8: 75c2 ld a1,48(sp) + 8001c3da: 7522 ld a0,40(sp) + 8001c3dc: 00003097 auipc ra,0x3 + 8001c3e0: 906080e7 jalr -1786(ra) # 8001ece2 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he31f6e5d3eec2be9E> + 8001c3e4: e02a sd a0,0(sp) + 8001c3e6: e42e sd a1,8(sp) + 8001c3e8: a009 j 8001c3ea <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x38> + 8001c3ea: 6522 ld a0,8(sp) + 8001c3ec: 6582 ld a1,0(sp) + 8001c3ee: e0ae sd a1,64(sp) + 8001c3f0: e4aa sd a0,72(sp) + 8001c3f2: a009 j 8001c3f4 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x42> + 8001c3f4: 0088 addi a0,sp,64 + 8001c3f6: ffff1097 auipc ra,0xffff1 + 8001c3fa: 064080e7 jalr 100(ra) # 8000d45a <_ZN81_$LT$core..str..iter..Bytes$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h47cb47c87defe3efE> + 8001c3fe: 04a10823 sb a0,80(sp) + 8001c402: 04b108a3 sb a1,81(sp) + 8001c406: a009 j 8001c408 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x56> + 8001c408: 05014503 lbu a0,80(sp) + 8001c40c: 8905 andi a0,a0,1 + 8001c40e: 4581 li a1,0 + 8001c410: 00b50463 beq a0,a1,8001c418 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x66> + 8001c414: a009 j 8001c416 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x64> + 8001c416: a801 j 8001c426 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x74> + 8001c418: 4501 li a0,0 + Ok(()) + 8001c41a: 02a10fa3 sb a0,63(sp) + } + 8001c41e: 70e6 ld ra,120(sp) + 8001c420: 6109 addi sp,sp,128 + 8001c422: 8082 ret + for c in out.bytes() { + 8001c424: 0000 unimp + 8001c426: 7502 ld a0,32(sp) + 8001c428: 05110583 lb a1,81(sp) + 8001c42c: 06b10aa3 sb a1,117(sp) + 8001c430: 06b10b23 sb a1,118(sp) + 8001c434: 06b10ba3 sb a1,119(sp) + self.put(c); + 8001c438: 00000097 auipc ra,0x0 + 8001c43c: e44080e7 jalr -444(ra) # 8001c27c <_ZN6kernel6driver4uart4Uart3put17h70c8696f08854618E> + 8001c440: a009 j 8001c442 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x90> + for c in out.bytes() { + 8001c442: bf4d j 8001c3f4 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE+0x42> + +Disassembly of section .text._ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E: + +000000008001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E>: + } + } + } +} + +fn write_reg(addr: usize, val: u8) { + 8001c444: 1101 addi sp,sp,-32 + 8001c446: ec06 sd ra,24(sp) + 8001c448: e42a sd a0,8(sp) + 8001c44a: 00b10ba3 sb a1,23(sp) + unsafe{ + ptr::write(addr as *mut u8, val); + 8001c44e: ffffd097 auipc ra,0xffffd + 8001c452: 22e080e7 jalr 558(ra) # 8001967c <_ZN4core3ptr5write17h0fb1ba83ac2984c7E> + 8001c456: a009 j 8001c458 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E+0x14> + } +} + 8001c458: 60e2 ld ra,24(sp) + 8001c45a: 6105 addi sp,sp,32 + 8001c45c: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart8read_reg17h6cf7d47ea5c47590E: + +000000008001c45e <_ZN6kernel6driver4uart8read_reg17h6cf7d47ea5c47590E>: + +fn read_reg(addr: usize) -> u8 { + 8001c45e: 1101 addi sp,sp,-32 + 8001c460: ec06 sd ra,24(sp) + 8001c462: e82a sd a0,16(sp) + unsafe { + ptr::read(addr as *const u8) + 8001c464: ffffd097 auipc ra,0xffffd + 8001c468: f8e080e7 jalr -114(ra) # 800193f2 <_ZN4core3ptr4read17h018161c0cd37b3fbE> + 8001c46c: e42a sd a0,8(sp) + 8001c46e: a009 j 8001c470 <_ZN6kernel6driver4uart8read_reg17h6cf7d47ea5c47590E+0x12> + } +} + 8001c470: 6522 ld a0,8(sp) + 8001c472: 60e2 ld ra,24(sp) + 8001c474: 6105 addi sp,sp,32 + 8001c476: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart4idle17h08982e96c6f33f38E: + +000000008001c478 <_ZN6kernel6driver4uart4idle17h08982e96c6f33f38E>: + +/// Read the LSR to see if it is able to transmit data. +fn idle() -> bool { + 8001c478: 1141 addi sp,sp,-16 + 8001c47a: e406 sd ra,8(sp) + 8001c47c: 10000537 lui a0,0x10000 + 8001c480: 2515 addiw a0,a0,5 + read_reg(UART_BASE_ADDR + LSR) & (1 << 5) > 0 + 8001c482: 00000097 auipc ra,0x0 + 8001c486: fdc080e7 jalr -36(ra) # 8001c45e <_ZN6kernel6driver4uart8read_reg17h6cf7d47ea5c47590E> + 8001c48a: e02a sd a0,0(sp) + 8001c48c: a009 j 8001c48e <_ZN6kernel6driver4uart4idle17h08982e96c6f33f38E+0x16> + 8001c48e: 6502 ld a0,0(sp) + 8001c490: 02057513 andi a0,a0,32 + 8001c494: 8115 srli a0,a0,0x5 +} + 8001c496: 60a2 ld ra,8(sp) + 8001c498: 0141 addi sp,sp,16 + 8001c49a: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4uart9putc_sync17h8ef1d9e0f2a8eae2E: + +000000008001c49c <_ZN6kernel6driver4uart9putc_sync17h8ef1d9e0f2a8eae2E>: + +/// Non-blocking write to uart device. +pub(super) fn putc_sync(c: u8) { + 8001c49c: 7179 addi sp,sp,-48 + 8001c49e: f406 sd ra,40(sp) + 8001c4a0: 85aa mv a1,a0 + 8001c4a2: ec2e sd a1,24(sp) + 8001c4a4: 02a103a3 sb a0,39(sp) + push_off(); + 8001c4a8: ffff6097 auipc ra,0xffff6 + 8001c4ac: 3b4080e7 jalr 948(ra) # 8001285c <_ZN6kernel7process3cpu8push_off17h0acd4baa93104745E> + 8001c4b0: a009 j 8001c4b2 <_ZN6kernel6driver4uart9putc_sync17h8ef1d9e0f2a8eae2E+0x16> + 8001c4b2: 4581 li a1,0 + if PANICKED.load(Ordering::Relaxed) { + 8001c4b4: 02b10323 sb a1,38(sp) + +000000008001c4b8 <.LBB8_11>: + 8001c4b8: 0004a517 auipc a0,0x4a + 8001c4bc: 0c850513 addi a0,a0,200 # 80066580 <_ZN6kernel6driver7console8PANICKED17hbdbbad2548440929E> + 8001c4c0: fffe8097 auipc ra,0xfffe8 + 8001c4c4: 246080e7 jalr 582(ra) # 80004706 <_ZN4core4sync6atomic10AtomicBool4load17h49a663f50dd66935E> + 8001c4c8: e82a sd a0,16(sp) + 8001c4ca: a009 j 8001c4cc <.LBB8_11+0x14> + 8001c4cc: 6542 ld a0,16(sp) + 8001c4ce: e119 bnez a0,8001c4d4 <.LBB8_11+0x1c> + 8001c4d0: a009 j 8001c4d2 <.LBB8_11+0x1a> + loop{} + } + while !idle() {} + 8001c4d2: a011 j 8001c4d6 <.LBB8_11+0x1e> + loop{} + 8001c4d4: a001 j 8001c4d4 <.LBB8_11+0x1c> + while !idle() {} + 8001c4d6: 00000097 auipc ra,0x0 + 8001c4da: fa2080e7 jalr -94(ra) # 8001c478 <_ZN6kernel6driver4uart4idle17h08982e96c6f33f38E> + 8001c4de: e42a sd a0,8(sp) + 8001c4e0: a009 j 8001c4e2 <.LBB8_11+0x2a> + 8001c4e2: 6522 ld a0,8(sp) + 8001c4e4: 4581 li a1,0 + 8001c4e6: 00b50b63 beq a0,a1,8001c4fc <.LBB8_11+0x44> + 8001c4ea: a009 j 8001c4ec <.LBB8_11+0x34> + write_reg(UART_BASE_ADDR + THR, c); + 8001c4ec: 65e2 ld a1,24(sp) + 8001c4ee: 10000537 lui a0,0x10000 + 8001c4f2: 00000097 auipc ra,0x0 + 8001c4f6: f52080e7 jalr -174(ra) # 8001c444 <_ZN6kernel6driver4uart9write_reg17h2ea1b62b21a10486E> + 8001c4fa: a011 j 8001c4fe <.LBB8_11+0x46> + while !idle() {} + 8001c4fc: bfe9 j 8001c4d6 <.LBB8_11+0x1e> + pop_off(); + 8001c4fe: ffff6097 auipc ra,0xffff6 + 8001c502: 3e2080e7 jalr 994(ra) # 800128e0 <_ZN6kernel7process3cpu7pop_off17hb8c7b834ab1c7c4cE> + 8001c506: a009 j 8001c508 <.LBB8_11+0x50> +} + 8001c508: 70a2 ld ra,40(sp) + 8001c50a: 6145 addi sp,sp,48 + 8001c50c: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE: + +000000008001c50e <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE>: + } + + #[stable(feature = "rust1", since = "1.0.0")] + impl Ord for $t { + #[inline] + fn cmp(&self, other: &$t) -> Ordering { + 8001c50e: 7179 addi sp,sp,-48 + 8001c510: e42e sd a1,8(sp) + 8001c512: e82a sd a0,16(sp) + 8001c514: f02a sd a0,32(sp) + 8001c516: f42e sd a1,40(sp) + // The order here is important to generate more optimal assembly. + // See for more info. + if *self < *other { Less } + 8001c518: 6108 ld a0,0(a0) + 8001c51a: 618c ld a1,0(a1) + 8001c51c: 00b57863 bgeu a0,a1,8001c52c <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x1e> + 8001c520: a009 j 8001c522 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x14> + 8001c522: 0ff00513 li a0,255 + 8001c526: 00a10fa3 sb a0,31(sp) + 8001c52a: a00d j 8001c54c <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x3e> + else if *self == *other { Equal } + 8001c52c: 65a2 ld a1,8(sp) + 8001c52e: 6542 ld a0,16(sp) + 8001c530: 6108 ld a0,0(a0) + 8001c532: 618c ld a1,0(a1) + 8001c534: 00b51763 bne a0,a1,8001c542 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x34> + 8001c538: a009 j 8001c53a <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x2c> + 8001c53a: 4501 li a0,0 + 8001c53c: 00a10fa3 sb a0,31(sp) + 8001c540: a029 j 8001c54a <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x3c> + 8001c542: 4505 li a0,1 + else { Greater } + 8001c544: 00a10fa3 sb a0,31(sp) + else if *self == *other { Equal } + 8001c548: a009 j 8001c54a <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x3c> + if *self < *other { Less } + 8001c54a: a009 j 8001c54c <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17h6e23c4cf8dccfdcdE+0x3e> + } + 8001c54c: 01f10503 lb a0,31(sp) + 8001c550: 6145 addi sp,sp,48 + 8001c552: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls55_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$u16$GT$2lt17h2ba0f37fe46e7bafE: + +000000008001c554 <_ZN4core3cmp5impls55_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$u16$GT$2lt17h2ba0f37fe46e7bafE>: + fn lt(&self, other: &$t) -> bool { (*self) < (*other) } + 8001c554: 1141 addi sp,sp,-16 + 8001c556: e02a sd a0,0(sp) + 8001c558: e42e sd a1,8(sp) + 8001c55a: 00055503 lhu a0,0(a0) # 10000000 <.Lline_table_start0+0xffc8b9b> + 8001c55e: 0005d583 lhu a1,0(a1) + 8001c562: 00b53533 sltu a0,a0,a1 + 8001c566: 0141 addi sp,sp,16 + 8001c568: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls55_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$u32$GT$2lt17h9cf9ff1045241cdfE: + +000000008001c56a <_ZN4core3cmp5impls55_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$u32$GT$2lt17h9cf9ff1045241cdfE>: + 8001c56a: 1141 addi sp,sp,-16 + 8001c56c: e02a sd a0,0(sp) + 8001c56e: e42e sd a1,8(sp) + 8001c570: 4108 lw a0,0(a0) + 8001c572: 418c lw a1,0(a1) + 8001c574: 00b53533 sltu a0,a0,a1 + 8001c578: 0141 addi sp,sp,16 + 8001c57a: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls56_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$usize$GT$2eq17hb88014a76b34c88fE: + +000000008001c57c <_ZN4core3cmp5impls56_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$usize$GT$2eq17hb88014a76b34c88fE>: + fn eq(&self, other: &$t) -> bool { (*self) == (*other) } + 8001c57c: 1141 addi sp,sp,-16 + 8001c57e: e02a sd a0,0(sp) + 8001c580: e42e sd a1,8(sp) + 8001c582: 6108 ld a0,0(a0) + 8001c584: 618c ld a1,0(a1) + 8001c586: 8d2d xor a0,a0,a1 + 8001c588: 00153513 seqz a0,a0 + 8001c58c: 0141 addi sp,sp,16 + 8001c58e: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls56_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$usize$GT$2ne17h958431dd9ff1337dE: + +000000008001c590 <_ZN4core3cmp5impls56_$LT$impl$u20$core..cmp..PartialEq$u20$for$u20$usize$GT$2ne17h958431dd9ff1337dE>: + fn ne(&self, other: &$t) -> bool { (*self) != (*other) } + 8001c590: 1141 addi sp,sp,-16 + 8001c592: e02a sd a0,0(sp) + 8001c594: e42e sd a1,8(sp) + 8001c596: 6108 ld a0,0(a0) + 8001c598: 618c ld a1,0(a1) + 8001c59a: 8d2d xor a0,a0,a1 + 8001c59c: 00a03533 snez a0,a0 + 8001c5a0: 0141 addi sp,sp,16 + 8001c5a2: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2le17hf6519ff85d133637E: + +000000008001c5a4 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2le17hf6519ff85d133637E>: + fn le(&self, other: &$t) -> bool { (*self) <= (*other) } + 8001c5a4: 1101 addi sp,sp,-32 + 8001c5a6: e42e sd a1,8(sp) + 8001c5a8: 85aa mv a1,a0 + 8001c5aa: 6522 ld a0,8(sp) + 8001c5ac: e82e sd a1,16(sp) + 8001c5ae: ec2a sd a0,24(sp) + 8001c5b0: 618c ld a1,0(a1) + 8001c5b2: 6108 ld a0,0(a0) + 8001c5b4: 00b53533 sltu a0,a0,a1 + 8001c5b8: 00154513 xori a0,a0,1 + 8001c5bc: 6105 addi sp,sp,32 + 8001c5be: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha09858e1dc8f460eE: + +000000008001c5c0 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha09858e1dc8f460eE>: + fn lt(&self, other: &$t) -> bool { (*self) < (*other) } + 8001c5c0: 1141 addi sp,sp,-16 + 8001c5c2: e02a sd a0,0(sp) + 8001c5c4: e42e sd a1,8(sp) + 8001c5c6: 6108 ld a0,0(a0) + 8001c5c8: 618c ld a1,0(a1) + 8001c5ca: 00b53533 sltu a0,a0,a1 + 8001c5ce: 0141 addi sp,sp,16 + 8001c5d0: 8082 ret + +Disassembly of section .text._ZN4core4iter8adapters3rev12Rev$LT$T$GT$3new17h2d10195152fc735dE: + +000000008001c5d2 <_ZN4core4iter8adapters3rev12Rev$LT$T$GT$3new17h2d10195152fc735dE>: +pub struct Rev { + iter: T, +} + +impl Rev { + pub(in crate::iter) fn new(iter: T) -> Rev { + 8001c5d2: 1101 addi sp,sp,-32 + 8001c5d4: e02e sd a1,0(sp) + 8001c5d6: 85aa mv a1,a0 + Rev { iter } + 8001c5d8: 6502 ld a0,0(sp) + 8001c5da: 6914 ld a3,16(a0) + 8001c5dc: ec36 sd a3,24(sp) + 8001c5de: 6510 ld a2,8(a0) + 8001c5e0: e832 sd a2,16(sp) + 8001c5e2: 6108 ld a0,0(a0) + 8001c5e4: e42a sd a0,8(sp) + 8001c5e6: e994 sd a3,16(a1) + 8001c5e8: e590 sd a2,8(a1) + 8001c5ea: e188 sd a0,0(a1) + } + 8001c5ec: 6105 addi sp,sp,32 + 8001c5ee: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h07513ad1b93938d8E: + +000000008001c5f0 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h07513ad1b93938d8E>: + fn into_iter(self) -> I { + 8001c5f0: 1141 addi sp,sp,-16 + 8001c5f2: e42e sd a1,8(sp) + 8001c5f4: 85aa mv a1,a0 + self + 8001c5f6: 6522 ld a0,8(sp) + 8001c5f8: 6910 ld a2,16(a0) + 8001c5fa: e990 sd a2,16(a1) + 8001c5fc: 6510 ld a2,8(a0) + 8001c5fe: e590 sd a2,8(a1) + 8001c600: 6108 ld a0,0(a0) + 8001c602: e188 sd a0,0(a1) + } + 8001c604: 0141 addi sp,sp,16 + 8001c606: 8082 ret + +Disassembly of section .text._ZN98_$LT$core..iter..adapters..rev..Rev$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hfb8b31ee37e3cf8fE: + +000000008001c608 <_ZN98_$LT$core..iter..adapters..rev..Rev$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hfb8b31ee37e3cf8fE>: + I: DoubleEndedIterator, +{ + type Item = ::Item; + + #[inline] + fn next(&mut self) -> Option<::Item> { + 8001c608: 1101 addi sp,sp,-32 + 8001c60a: ec06 sd ra,24(sp) + 8001c60c: e82a sd a0,16(sp) + self.iter.next_back() + 8001c60e: ffff0097 auipc ra,0xffff0 + 8001c612: c46080e7 jalr -954(ra) # 8000c254 <_ZN4core4iter5range125_$LT$impl$u20$core..iter..traits..double_ended..DoubleEndedIterator$u20$for$u20$core..ops..range..RangeInclusive$LT$A$GT$$GT$9next_back17h6e80df4b43a95866E> + 8001c616: e02a sd a0,0(sp) + 8001c618: e42e sd a1,8(sp) + 8001c61a: a009 j 8001c61c <_ZN98_$LT$core..iter..adapters..rev..Rev$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hfb8b31ee37e3cf8fE+0x14> + } + 8001c61c: 65a2 ld a1,8(sp) + 8001c61e: 6502 ld a0,0(sp) + 8001c620: 60e2 ld ra,24(sp) + 8001c622: 6105 addi sp,sp,32 + 8001c624: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17h2dc288bcc805675fE: + +000000008001c626 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17h2dc288bcc805675fE>: + /// + /// [zeroed]: mem::MaybeUninit::zeroed + #[inline] + #[doc(alias = "calloc")] + #[unstable(feature = "new_uninit", issue = "63291")] + pub fn new_zeroed() -> Box> { + 8001c626: 1141 addi sp,sp,-16 + Self::new_zeroed_in(Global) + 8001c628: e406 sd ra,8(sp) + 8001c62a: 00000097 auipc ra,0x0 + 8001c62e: 484080e7 jalr 1156(ra) # 8001caae <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17heb1bde8fe889e8ecE> + 8001c632: e02a sd a0,0(sp) + 8001c634: a009 j 8001c636 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17h2dc288bcc805675fE+0x10> + } + 8001c636: 6502 ld a0,0(sp) + 8001c638: 60a2 ld ra,8(sp) + 8001c63a: 0141 addi sp,sp,16 + 8001c63c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17ha7605ec5087df013E: + +000000008001c63e <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17ha7605ec5087df013E>: + pub fn new_zeroed() -> Box> { + 8001c63e: 1141 addi sp,sp,-16 + Self::new_zeroed_in(Global) + 8001c640: e406 sd ra,8(sp) + 8001c642: 00000097 auipc ra,0x0 + 8001c646: 3d0080e7 jalr 976(ra) # 8001ca12 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h916b48f2a809df2aE> + 8001c64a: e02a sd a0,0(sp) + 8001c64c: a009 j 8001c64e <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17ha7605ec5087df013E+0x10> + } + 8001c64e: 6502 ld a0,0(sp) + 8001c650: 60a2 ld ra,8(sp) + 8001c652: 0141 addi sp,sp,16 + 8001c654: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17hb9a4ac65c8961d16E: + +000000008001c656 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17hb9a4ac65c8961d16E>: + pub fn new_zeroed() -> Box> { + 8001c656: 1141 addi sp,sp,-16 + Self::new_zeroed_in(Global) + 8001c658: e406 sd ra,8(sp) + 8001c65a: 00000097 auipc ra,0x0 + 8001c65e: 31c080e7 jalr 796(ra) # 8001c976 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h2f03b5aa500af675E> + 8001c662: e02a sd a0,0(sp) + 8001c664: a009 j 8001c666 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17hb9a4ac65c8961d16E+0x10> + } + 8001c666: 6502 ld a0,0(sp) + 8001c668: 60a2 ld ra,8(sp) + 8001c66a: 0141 addi sp,sp,16 + 8001c66c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he11e171c2ca6c076E: + +000000008001c66e <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he11e171c2ca6c076E>: + pub fn new_zeroed() -> Box> { + 8001c66e: 1141 addi sp,sp,-16 + Self::new_zeroed_in(Global) + 8001c670: e406 sd ra,8(sp) + 8001c672: 00000097 auipc ra,0x0 + 8001c676: 352080e7 jalr 850(ra) # 8001c9c4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h875f12dc3dac5fbaE> + 8001c67a: e02a sd a0,0(sp) + 8001c67c: a009 j 8001c67e <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he11e171c2ca6c076E+0x10> + } + 8001c67e: 6502 ld a0,0(sp) + 8001c680: 60a2 ld ra,8(sp) + 8001c682: 0141 addi sp,sp,16 + 8001c684: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he41f9c30769fb517E: + +000000008001c686 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he41f9c30769fb517E>: + pub fn new_zeroed() -> Box> { + 8001c686: 1141 addi sp,sp,-16 + Self::new_zeroed_in(Global) + 8001c688: e406 sd ra,8(sp) + 8001c68a: 00000097 auipc ra,0x0 + 8001c68e: 3d6080e7 jalr 982(ra) # 8001ca60 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17hb74d8ce04ba2f3c1E> + 8001c692: e02a sd a0,0(sp) + 8001c694: a009 j 8001c696 <_ZN5alloc5boxed12Box$LT$T$GT$10new_zeroed17he41f9c30769fb517E+0x10> + } + 8001c696: 6502 ld a0,0(sp) + 8001c698: 60a2 ld ra,8(sp) + 8001c69a: 0141 addi sp,sp,16 + 8001c69c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h15afec5304658230E: + +000000008001c69e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h15afec5304658230E>: + /// + /// [memory layout]: self#memory-layout + /// [`Layout`]: crate::Layout + #[unstable(feature = "allocator_api", issue = "32838")] + #[inline] + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c69e: 7179 addi sp,sp,-48 + 8001c6a0: f406 sd ra,40(sp) + 8001c6a2: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c6a4: ffff0097 auipc ra,0xffff0 + 8001c6a8: da2080e7 jalr -606(ra) # 8000c446 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hb5a9e5725254bb89E> + 8001c6ac: e42a sd a0,8(sp) + 8001c6ae: a009 j 8001c6b0 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h15afec5304658230E+0x12> + 8001c6b0: 6522 ld a0,8(sp) + 8001c6b2: e82a sd a0,16(sp) + } + 8001c6b4: 70a2 ld ra,40(sp) + 8001c6b6: 6145 addi sp,sp,48 + 8001c6b8: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h187980a64cbbe532E: + +000000008001c6ba <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h187980a64cbbe532E>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c6ba: 7179 addi sp,sp,-48 + 8001c6bc: f406 sd ra,40(sp) + 8001c6be: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c6c0: ffff0097 auipc ra,0xffff0 + 8001c6c4: dae080e7 jalr -594(ra) # 8000c46e <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hffcbfd9b9a15cee1E> + 8001c6c8: e42a sd a0,8(sp) + 8001c6ca: a009 j 8001c6cc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h187980a64cbbe532E+0x12> + 8001c6cc: 6522 ld a0,8(sp) + 8001c6ce: e82a sd a0,16(sp) + } + 8001c6d0: 70a2 ld ra,40(sp) + 8001c6d2: 6145 addi sp,sp,48 + 8001c6d4: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h468e1ef7cafa8023E: + +000000008001c6d6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h468e1ef7cafa8023E>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c6d6: 7179 addi sp,sp,-48 + 8001c6d8: f406 sd ra,40(sp) + 8001c6da: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c6dc: ffff0097 auipc ra,0xffff0 + 8001c6e0: d7e080e7 jalr -642(ra) # 8000c45a <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17he1ff65b054541f9aE> + 8001c6e4: e42a sd a0,8(sp) + 8001c6e6: a009 j 8001c6e8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h468e1ef7cafa8023E+0x12> + 8001c6e8: 6522 ld a0,8(sp) + 8001c6ea: e82a sd a0,16(sp) + } + 8001c6ec: 70a2 ld ra,40(sp) + 8001c6ee: 6145 addi sp,sp,48 + 8001c6f0: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h49971518b172ecd3E: + +000000008001c6f2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h49971518b172ecd3E>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c6f2: 7179 addi sp,sp,-48 + 8001c6f4: f406 sd ra,40(sp) + 8001c6f6: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c6f8: ffff0097 auipc ra,0xffff0 + 8001c6fc: d6c080e7 jalr -660(ra) # 8000c464 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17he38725f417943878E> + 8001c700: e42a sd a0,8(sp) + 8001c702: a009 j 8001c704 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h49971518b172ecd3E+0x12> + 8001c704: 6522 ld a0,8(sp) + 8001c706: e82a sd a0,16(sp) + } + 8001c708: 70a2 ld ra,40(sp) + 8001c70a: 6145 addi sp,sp,48 + 8001c70c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h68eabecb8cd08a3aE: + +000000008001c70e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h68eabecb8cd08a3aE>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c70e: 7179 addi sp,sp,-48 + 8001c710: f406 sd ra,40(sp) + 8001c712: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c714: ffff0097 auipc ra,0xffff0 + 8001c718: d0a080e7 jalr -758(ra) # 8000c41e <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h21d50a45a5a242bbE> + 8001c71c: e42a sd a0,8(sp) + 8001c71e: a009 j 8001c720 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h68eabecb8cd08a3aE+0x12> + 8001c720: 6522 ld a0,8(sp) + 8001c722: e82a sd a0,16(sp) + } + 8001c724: 70a2 ld ra,40(sp) + 8001c726: 6145 addi sp,sp,48 + 8001c728: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h91226147761dfc23E: + +000000008001c72a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h91226147761dfc23E>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c72a: 7179 addi sp,sp,-48 + 8001c72c: f406 sd ra,40(sp) + 8001c72e: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c730: ffff0097 auipc ra,0xffff0 + 8001c734: d02080e7 jalr -766(ra) # 8000c432 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h802ec2c42c5b54adE> + 8001c738: e42a sd a0,8(sp) + 8001c73a: a009 j 8001c73c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h91226147761dfc23E+0x12> + 8001c73c: 6522 ld a0,8(sp) + 8001c73e: e82a sd a0,16(sp) + } + 8001c740: 70a2 ld ra,40(sp) + 8001c742: 6145 addi sp,sp,48 + 8001c744: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h9f1ea1f840330d88E: + +000000008001c746 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h9f1ea1f840330d88E>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c746: 7179 addi sp,sp,-48 + 8001c748: f406 sd ra,40(sp) + 8001c74a: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c74c: ffff0097 auipc ra,0xffff0 + 8001c750: cbe080e7 jalr -834(ra) # 8000c40a <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h0d12a57a76d0850fE> + 8001c754: e42a sd a0,8(sp) + 8001c756: a009 j 8001c758 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h9f1ea1f840330d88E+0x12> + 8001c758: 6522 ld a0,8(sp) + 8001c75a: e82a sd a0,16(sp) + } + 8001c75c: 70a2 ld ra,40(sp) + 8001c75e: 6145 addi sp,sp,48 + 8001c760: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17haf8eaf51394a2521E: + +000000008001c762 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17haf8eaf51394a2521E>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c762: 7179 addi sp,sp,-48 + 8001c764: f406 sd ra,40(sp) + 8001c766: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c768: ffff0097 auipc ra,0xffff0 + 8001c76c: ce8080e7 jalr -792(ra) # 8000c450 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17hcb5e8bc8059451d1E> + 8001c770: e42a sd a0,8(sp) + 8001c772: a009 j 8001c774 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17haf8eaf51394a2521E+0x12> + 8001c774: 6522 ld a0,8(sp) + 8001c776: e82a sd a0,16(sp) + } + 8001c778: 70a2 ld ra,40(sp) + 8001c77a: 6145 addi sp,sp,48 + 8001c77c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17hbb480293fc4c0d0bE: + +000000008001c77e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17hbb480293fc4c0d0bE>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c77e: 7179 addi sp,sp,-48 + 8001c780: f406 sd ra,40(sp) + 8001c782: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c784: ffff0097 auipc ra,0xffff0 + 8001c788: c90080e7 jalr -880(ra) # 8000c414 <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17h20d3eb97294874feE> + 8001c78c: e42a sd a0,8(sp) + 8001c78e: a009 j 8001c790 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17hbb480293fc4c0d0bE+0x12> + 8001c790: 6522 ld a0,8(sp) + 8001c792: e82a sd a0,16(sp) + } + 8001c794: 70a2 ld ra,40(sp) + 8001c796: 6145 addi sp,sp,48 + 8001c798: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17he38318e450c3c542E: + +000000008001c79a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17he38318e450c3c542E>: + pub unsafe fn from_raw_in(raw: *mut T, alloc: A) -> Self { + 8001c79a: 7179 addi sp,sp,-48 + 8001c79c: f406 sd ra,40(sp) + 8001c79e: ec2a sd a0,24(sp) + Box(unsafe { Unique::new_unchecked(raw) }, alloc) + 8001c7a0: ffff0097 auipc ra,0xffff0 + 8001c7a4: c9c080e7 jalr -868(ra) # 8000c43c <_ZN4core3ptr6unique15Unique$LT$T$GT$13new_unchecked17ha8b21015e9411210E> + 8001c7a8: e42a sd a0,8(sp) + 8001c7aa: a009 j 8001c7ac <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17he38318e450c3c542E+0x12> + 8001c7ac: 6522 ld a0,8(sp) + 8001c7ae: e82a sd a0,16(sp) + } + 8001c7b0: 70a2 ld ra,40(sp) + 8001c7b2: 6145 addi sp,sp,48 + 8001c7b4: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h48e22d69c2444c2aE: + +000000008001c7b6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h48e22d69c2444c2aE>: + issue = "none", + reason = "use `Box::leak(b).into()` or `Unique::from(Box::leak(b))` instead" + )] + #[inline] + #[doc(hidden)] + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c7b6: 7179 addi sp,sp,-48 + 8001c7b8: f406 sd ra,40(sp) + 8001c7ba: e82a sd a0,16(sp) + 8001c7bc: 0808 addi a0,sp,16 + // Box is recognized as a "unique pointer" by Stacked Borrows, but internally it is a + // raw pointer for the type system. Turning it directly into a raw pointer would not be + // recognized as "releasing" the unique pointer to permit aliased raw accesses, + // so all raw pointer methods have to go through `Box::leak`. Turning *that* to a raw pointer + // behaves correctly. + let alloc = unsafe { ptr::read(&b.1) }; + 8001c7be: ffffd097 auipc ra,0xffffd + 8001c7c2: d06080e7 jalr -762(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c7c6: a009 j 8001c7c8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h48e22d69c2444c2aE+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c7c8: 6542 ld a0,16(sp) + 8001c7ca: 00001097 auipc ra,0x1 + 8001c7ce: 84a080e7 jalr -1974(ra) # 8001d014 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h77f658a9b95a64a2E> + 8001c7d2: e42a sd a0,8(sp) + 8001c7d4: a009 j 8001c7d6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h48e22d69c2444c2aE+0x20> + 8001c7d6: 6522 ld a0,8(sp) + 8001c7d8: ffff0097 auipc ra,0xffff0 + 8001c7dc: dec080e7 jalr -532(ra) # 8000c5c4 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h45361f1294fceae9E> + 8001c7e0: e02a sd a0,0(sp) + 8001c7e2: a009 j 8001c7e4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h48e22d69c2444c2aE+0x2e> + 8001c7e4: 6502 ld a0,0(sp) + 8001c7e6: ec2a sd a0,24(sp) + } + 8001c7e8: 70a2 ld ra,40(sp) + 8001c7ea: 6145 addi sp,sp,48 + 8001c7ec: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h77bf5089d70199a1E: + +000000008001c7ee <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h77bf5089d70199a1E>: + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c7ee: 7179 addi sp,sp,-48 + 8001c7f0: f406 sd ra,40(sp) + 8001c7f2: e82a sd a0,16(sp) + 8001c7f4: 0808 addi a0,sp,16 + let alloc = unsafe { ptr::read(&b.1) }; + 8001c7f6: ffffd097 auipc ra,0xffffd + 8001c7fa: cce080e7 jalr -818(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c7fe: a009 j 8001c800 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h77bf5089d70199a1E+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c800: 6542 ld a0,16(sp) + 8001c802: 00001097 auipc ra,0x1 + 8001c806: 926080e7 jalr -1754(ra) # 8001d128 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17he4f1cfe07554e5a5E> + 8001c80a: e42a sd a0,8(sp) + 8001c80c: a009 j 8001c80e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h77bf5089d70199a1E+0x20> + 8001c80e: 6522 ld a0,8(sp) + 8001c810: ffff0097 auipc ra,0xffff0 + 8001c814: de6080e7 jalr -538(ra) # 8000c5f6 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hbd7fdd10f6dec294E> + 8001c818: e02a sd a0,0(sp) + 8001c81a: a009 j 8001c81c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h77bf5089d70199a1E+0x2e> + 8001c81c: 6502 ld a0,0(sp) + 8001c81e: ec2a sd a0,24(sp) + } + 8001c820: 70a2 ld ra,40(sp) + 8001c822: 6145 addi sp,sp,48 + 8001c824: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h80646c1775168f03E: + +000000008001c826 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h80646c1775168f03E>: + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c826: 7179 addi sp,sp,-48 + 8001c828: f406 sd ra,40(sp) + 8001c82a: e82a sd a0,16(sp) + 8001c82c: 0808 addi a0,sp,16 + let alloc = unsafe { ptr::read(&b.1) }; + 8001c82e: ffffd097 auipc ra,0xffffd + 8001c832: c96080e7 jalr -874(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c836: a009 j 8001c838 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h80646c1775168f03E+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c838: 6542 ld a0,16(sp) + 8001c83a: 00001097 auipc ra,0x1 + 8001c83e: 836080e7 jalr -1994(ra) # 8001d070 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h94cb03dd08e899b7E> + 8001c842: e42a sd a0,8(sp) + 8001c844: a009 j 8001c846 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h80646c1775168f03E+0x20> + 8001c846: 6522 ld a0,8(sp) + 8001c848: ffff0097 auipc ra,0xffff0 + 8001c84c: d90080e7 jalr -624(ra) # 8000c5d8 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h938709fab973920cE> + 8001c850: e02a sd a0,0(sp) + 8001c852: a009 j 8001c854 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h80646c1775168f03E+0x2e> + 8001c854: 6502 ld a0,0(sp) + 8001c856: ec2a sd a0,24(sp) + } + 8001c858: 70a2 ld ra,40(sp) + 8001c85a: 6145 addi sp,sp,48 + 8001c85c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h93f491d0366dd1a9E: + +000000008001c85e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h93f491d0366dd1a9E>: + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c85e: 7179 addi sp,sp,-48 + 8001c860: f406 sd ra,40(sp) + 8001c862: e82a sd a0,16(sp) + 8001c864: 0808 addi a0,sp,16 + let alloc = unsafe { ptr::read(&b.1) }; + 8001c866: ffffd097 auipc ra,0xffffd + 8001c86a: c5e080e7 jalr -930(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c86e: a009 j 8001c870 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h93f491d0366dd1a9E+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c870: 6542 ld a0,16(sp) + 8001c872: 00000097 auipc ra,0x0 + 8001c876: 746080e7 jalr 1862(ra) # 8001cfb8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h3b2c40161bf6c180E> + 8001c87a: e42a sd a0,8(sp) + 8001c87c: a009 j 8001c87e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h93f491d0366dd1a9E+0x20> + 8001c87e: 6522 ld a0,8(sp) + 8001c880: ffff0097 auipc ra,0xffff0 + 8001c884: d80080e7 jalr -640(ra) # 8000c600 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hd2fb1fd1ad0aa985E> + 8001c888: e02a sd a0,0(sp) + 8001c88a: a009 j 8001c88c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h93f491d0366dd1a9E+0x2e> + 8001c88c: 6502 ld a0,0(sp) + 8001c88e: ec2a sd a0,24(sp) + } + 8001c890: 70a2 ld ra,40(sp) + 8001c892: 6145 addi sp,sp,48 + 8001c894: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h9813befe69e55ae1E: + +000000008001c896 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h9813befe69e55ae1E>: + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c896: 7179 addi sp,sp,-48 + 8001c898: f406 sd ra,40(sp) + 8001c89a: e82a sd a0,16(sp) + 8001c89c: 0808 addi a0,sp,16 + let alloc = unsafe { ptr::read(&b.1) }; + 8001c89e: ffffd097 auipc ra,0xffffd + 8001c8a2: c26080e7 jalr -986(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c8a6: a009 j 8001c8a8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h9813befe69e55ae1E+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c8a8: 6542 ld a0,16(sp) + 8001c8aa: 00000097 auipc ra,0x0 + 8001c8ae: 73c080e7 jalr 1852(ra) # 8001cfe6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h4b4e76265837c5ceE> + 8001c8b2: e42a sd a0,8(sp) + 8001c8b4: a009 j 8001c8b6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h9813befe69e55ae1E+0x20> + 8001c8b6: 6522 ld a0,8(sp) + 8001c8b8: ffff0097 auipc ra,0xffff0 + 8001c8bc: d34080e7 jalr -716(ra) # 8000c5ec <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17haf9e918ffbbde4a1E> + 8001c8c0: e02a sd a0,0(sp) + 8001c8c2: a009 j 8001c8c4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h9813befe69e55ae1E+0x2e> + 8001c8c4: 6502 ld a0,0(sp) + 8001c8c6: ec2a sd a0,24(sp) + } + 8001c8c8: 70a2 ld ra,40(sp) + 8001c8ca: 6145 addi sp,sp,48 + 8001c8cc: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hb4dd27b4659222a3E: + +000000008001c8ce <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hb4dd27b4659222a3E>: + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c8ce: 7179 addi sp,sp,-48 + 8001c8d0: f406 sd ra,40(sp) + 8001c8d2: e82a sd a0,16(sp) + 8001c8d4: 0808 addi a0,sp,16 + let alloc = unsafe { ptr::read(&b.1) }; + 8001c8d6: ffffd097 auipc ra,0xffffd + 8001c8da: bee080e7 jalr -1042(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c8de: a009 j 8001c8e0 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hb4dd27b4659222a3E+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c8e0: 6542 ld a0,16(sp) + 8001c8e2: 00001097 auipc ra,0x1 + 8001c8e6: 818080e7 jalr -2024(ra) # 8001d0fa <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hcf7bcb368f276750E> + 8001c8ea: e42a sd a0,8(sp) + 8001c8ec: a009 j 8001c8ee <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hb4dd27b4659222a3E+0x20> + 8001c8ee: 6522 ld a0,8(sp) + 8001c8f0: ffff0097 auipc ra,0xffff0 + 8001c8f4: cde080e7 jalr -802(ra) # 8000c5ce <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h7ca19f4bf209b680E> + 8001c8f8: e02a sd a0,0(sp) + 8001c8fa: a009 j 8001c8fc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hb4dd27b4659222a3E+0x2e> + 8001c8fc: 6502 ld a0,0(sp) + 8001c8fe: ec2a sd a0,24(sp) + } + 8001c900: 70a2 ld ra,40(sp) + 8001c902: 6145 addi sp,sp,48 + 8001c904: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd08884b913096851E: + +000000008001c906 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd08884b913096851E>: + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c906: 7179 addi sp,sp,-48 + 8001c908: f406 sd ra,40(sp) + 8001c90a: e82a sd a0,16(sp) + 8001c90c: 0808 addi a0,sp,16 + let alloc = unsafe { ptr::read(&b.1) }; + 8001c90e: ffffd097 auipc ra,0xffffd + 8001c912: bb6080e7 jalr -1098(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c916: a009 j 8001c918 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd08884b913096851E+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c918: 6542 ld a0,16(sp) + 8001c91a: 00000097 auipc ra,0x0 + 8001c91e: 728080e7 jalr 1832(ra) # 8001d042 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h925dcada2cd56bb2E> + 8001c922: e42a sd a0,8(sp) + 8001c924: a009 j 8001c926 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd08884b913096851E+0x20> + 8001c926: 6522 ld a0,8(sp) + 8001c928: ffff0097 auipc ra,0xffff0 + 8001c92c: cba080e7 jalr -838(ra) # 8000c5e2 <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17h961fb5f3bbf04d92E> + 8001c930: e02a sd a0,0(sp) + 8001c932: a009 j 8001c934 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd08884b913096851E+0x2e> + 8001c934: 6502 ld a0,0(sp) + 8001c936: ec2a sd a0,24(sp) + } + 8001c938: 70a2 ld ra,40(sp) + 8001c93a: 6145 addi sp,sp,48 + 8001c93c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd4115af6111f1ecaE: + +000000008001c93e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd4115af6111f1ecaE>: + pub fn into_unique(b: Self) -> (Unique, A) { + 8001c93e: 7179 addi sp,sp,-48 + 8001c940: f406 sd ra,40(sp) + 8001c942: e82a sd a0,16(sp) + 8001c944: 0808 addi a0,sp,16 + let alloc = unsafe { ptr::read(&b.1) }; + 8001c946: ffffd097 auipc ra,0xffffd + 8001c94a: b7e080e7 jalr -1154(ra) # 800194c4 <_ZN4core3ptr4read17hb68b0b8aaefcfe70E> + 8001c94e: a009 j 8001c950 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd4115af6111f1ecaE+0x12> + (Unique::from(Box::leak(b)), alloc) + 8001c950: 6542 ld a0,16(sp) + 8001c952: 00000097 auipc ra,0x0 + 8001c956: 77a080e7 jalr 1914(ra) # 8001d0cc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hb50450963f97575cE> + 8001c95a: e42a sd a0,8(sp) + 8001c95c: a009 j 8001c95e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd4115af6111f1ecaE+0x20> + 8001c95e: 6522 ld a0,8(sp) + 8001c960: ffff0097 auipc ra,0xffff0 + 8001c964: caa080e7 jalr -854(ra) # 8000c60a <_ZN95_$LT$core..ptr..unique..Unique$LT$T$GT$$u20$as$u20$core..convert..From$LT$$RF$mut$u20$T$GT$$GT$4from17hdb52ac7756946cf1E> + 8001c968: e02a sd a0,0(sp) + 8001c96a: a009 j 8001c96c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd4115af6111f1ecaE+0x2e> + 8001c96c: 6502 ld a0,0(sp) + 8001c96e: ec2a sd a0,24(sp) + } + 8001c970: 70a2 ld ra,40(sp) + 8001c972: 6145 addi sp,sp,48 + 8001c974: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h2f03b5aa500af675E: + +000000008001c976 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h2f03b5aa500af675E>: + pub fn new_zeroed_in(alloc: A) -> Box, A> { + 8001c976: 7139 addi sp,sp,-64 + let layout = Layout::new::>(); + 8001c978: fc06 sd ra,56(sp) + 8001c97a: fffec097 auipc ra,0xfffec + 8001c97e: 464080e7 jalr 1124(ra) # 80008dde <_ZN4core5alloc6layout6Layout3new17h9329aa50601ba1ffE> + 8001c982: 862a mv a2,a0 + 8001c984: e032 sd a2,0(sp) + 8001c986: 862e mv a2,a1 + 8001c988: e432 sd a2,8(sp) + 8001c98a: f02a sd a0,32(sp) + 8001c98c: f42e sd a1,40(sp) + 8001c98e: a009 j 8001c990 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h2f03b5aa500af675E+0x1a> + match Box::try_new_zeroed_in(alloc) { + 8001c990: 00000097 auipc ra,0x0 + 8001c994: 2c4080e7 jalr 708(ra) # 8001cc54 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE> + 8001c998: e82a sd a0,16(sp) + 8001c99a: a009 j 8001c99c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h2f03b5aa500af675E+0x26> + Ok(m) => m, + 8001c99c: 6542 ld a0,16(sp) + 8001c99e: 00153593 seqz a1,a0 + 8001c9a2: 4581 li a1,0 + 8001c9a4: 00b51b63 bne a0,a1,8001c9ba <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h2f03b5aa500af675E+0x44> + 8001c9a8: a009 j 8001c9aa <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h2f03b5aa500af675E+0x34> + Err(_) => handle_alloc_error(layout), + 8001c9aa: 65a2 ld a1,8(sp) + 8001c9ac: 6502 ld a0,0(sp) + 8001c9ae: 00006097 auipc ra,0x6 + 8001c9b2: 590080e7 jalr 1424(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + 8001c9b6: 0000 unimp + match Box::try_new_zeroed_in(alloc) { + 8001c9b8: 0000 unimp + Ok(m) => m, + 8001c9ba: 6542 ld a0,16(sp) + 8001c9bc: f82a sd a0,48(sp) + } + 8001c9be: 70e2 ld ra,56(sp) + 8001c9c0: 6121 addi sp,sp,64 + 8001c9c2: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h875f12dc3dac5fbaE: + +000000008001c9c4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h875f12dc3dac5fbaE>: + pub fn new_zeroed_in(alloc: A) -> Box, A> { + 8001c9c4: 7139 addi sp,sp,-64 + let layout = Layout::new::>(); + 8001c9c6: fc06 sd ra,56(sp) + 8001c9c8: fffec097 auipc ra,0xfffec + 8001c9cc: 34e080e7 jalr 846(ra) # 80008d16 <_ZN4core5alloc6layout6Layout3new17h00440f750a953d15E> + 8001c9d0: 862a mv a2,a0 + 8001c9d2: e032 sd a2,0(sp) + 8001c9d4: 862e mv a2,a1 + 8001c9d6: e432 sd a2,8(sp) + 8001c9d8: f02a sd a0,32(sp) + 8001c9da: f42e sd a1,40(sp) + 8001c9dc: a009 j 8001c9de <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h875f12dc3dac5fbaE+0x1a> + match Box::try_new_zeroed_in(alloc) { + 8001c9de: 00000097 auipc ra,0x0 + 8001c9e2: 3ce080e7 jalr 974(ra) # 8001cdac <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E> + 8001c9e6: e82a sd a0,16(sp) + 8001c9e8: a009 j 8001c9ea <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h875f12dc3dac5fbaE+0x26> + Ok(m) => m, + 8001c9ea: 6542 ld a0,16(sp) + 8001c9ec: 00153593 seqz a1,a0 + 8001c9f0: 4581 li a1,0 + 8001c9f2: 00b51b63 bne a0,a1,8001ca08 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h875f12dc3dac5fbaE+0x44> + 8001c9f6: a009 j 8001c9f8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h875f12dc3dac5fbaE+0x34> + Err(_) => handle_alloc_error(layout), + 8001c9f8: 65a2 ld a1,8(sp) + 8001c9fa: 6502 ld a0,0(sp) + 8001c9fc: 00006097 auipc ra,0x6 + 8001ca00: 542080e7 jalr 1346(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + 8001ca04: 0000 unimp + match Box::try_new_zeroed_in(alloc) { + 8001ca06: 0000 unimp + Ok(m) => m, + 8001ca08: 6542 ld a0,16(sp) + 8001ca0a: f82a sd a0,48(sp) + } + 8001ca0c: 70e2 ld ra,56(sp) + 8001ca0e: 6121 addi sp,sp,64 + 8001ca10: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h916b48f2a809df2aE: + +000000008001ca12 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h916b48f2a809df2aE>: + pub fn new_zeroed_in(alloc: A) -> Box, A> { + 8001ca12: 7139 addi sp,sp,-64 + let layout = Layout::new::>(); + 8001ca14: fc06 sd ra,56(sp) + 8001ca16: fffec097 auipc ra,0xfffec + 8001ca1a: 396080e7 jalr 918(ra) # 80008dac <_ZN4core5alloc6layout6Layout3new17h728acb0ef5b915afE> + 8001ca1e: 862a mv a2,a0 + 8001ca20: e032 sd a2,0(sp) + 8001ca22: 862e mv a2,a1 + 8001ca24: e432 sd a2,8(sp) + 8001ca26: f02a sd a0,32(sp) + 8001ca28: f42e sd a1,40(sp) + 8001ca2a: a009 j 8001ca2c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h916b48f2a809df2aE+0x1a> + match Box::try_new_zeroed_in(alloc) { + 8001ca2c: 00000097 auipc ra,0x0 + 8001ca30: 17c080e7 jalr 380(ra) # 8001cba8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE> + 8001ca34: e82a sd a0,16(sp) + 8001ca36: a009 j 8001ca38 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h916b48f2a809df2aE+0x26> + Ok(m) => m, + 8001ca38: 6542 ld a0,16(sp) + 8001ca3a: 00153593 seqz a1,a0 + 8001ca3e: 4581 li a1,0 + 8001ca40: 00b51b63 bne a0,a1,8001ca56 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h916b48f2a809df2aE+0x44> + 8001ca44: a009 j 8001ca46 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17h916b48f2a809df2aE+0x34> + Err(_) => handle_alloc_error(layout), + 8001ca46: 65a2 ld a1,8(sp) + 8001ca48: 6502 ld a0,0(sp) + 8001ca4a: 00006097 auipc ra,0x6 + 8001ca4e: 4f4080e7 jalr 1268(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + 8001ca52: 0000 unimp + match Box::try_new_zeroed_in(alloc) { + 8001ca54: 0000 unimp + Ok(m) => m, + 8001ca56: 6542 ld a0,16(sp) + 8001ca58: f82a sd a0,48(sp) + } + 8001ca5a: 70e2 ld ra,56(sp) + 8001ca5c: 6121 addi sp,sp,64 + 8001ca5e: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17hb74d8ce04ba2f3c1E: + +000000008001ca60 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17hb74d8ce04ba2f3c1E>: + pub fn new_zeroed_in(alloc: A) -> Box, A> { + 8001ca60: 7139 addi sp,sp,-64 + let layout = Layout::new::>(); + 8001ca62: fc06 sd ra,56(sp) + 8001ca64: fffec097 auipc ra,0xfffec + 8001ca68: 3ac080e7 jalr 940(ra) # 80008e10 <_ZN4core5alloc6layout6Layout3new17hfb4102c77959cfa1E> + 8001ca6c: 862a mv a2,a0 + 8001ca6e: e032 sd a2,0(sp) + 8001ca70: 862e mv a2,a1 + 8001ca72: e432 sd a2,8(sp) + 8001ca74: f02a sd a0,32(sp) + 8001ca76: f42e sd a1,40(sp) + 8001ca78: a009 j 8001ca7a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17hb74d8ce04ba2f3c1E+0x1a> + match Box::try_new_zeroed_in(alloc) { + 8001ca7a: 00000097 auipc ra,0x0 + 8001ca7e: 286080e7 jalr 646(ra) # 8001cd00 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E> + 8001ca82: e82a sd a0,16(sp) + 8001ca84: a009 j 8001ca86 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17hb74d8ce04ba2f3c1E+0x26> + Ok(m) => m, + 8001ca86: 6542 ld a0,16(sp) + 8001ca88: 00153593 seqz a1,a0 + 8001ca8c: 4581 li a1,0 + 8001ca8e: 00b51b63 bne a0,a1,8001caa4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17hb74d8ce04ba2f3c1E+0x44> + 8001ca92: a009 j 8001ca94 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17hb74d8ce04ba2f3c1E+0x34> + Err(_) => handle_alloc_error(layout), + 8001ca94: 65a2 ld a1,8(sp) + 8001ca96: 6502 ld a0,0(sp) + 8001ca98: 00006097 auipc ra,0x6 + 8001ca9c: 4a6080e7 jalr 1190(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + 8001caa0: 0000 unimp + match Box::try_new_zeroed_in(alloc) { + 8001caa2: 0000 unimp + Ok(m) => m, + 8001caa4: 6542 ld a0,16(sp) + 8001caa6: f82a sd a0,48(sp) + } + 8001caa8: 70e2 ld ra,56(sp) + 8001caaa: 6121 addi sp,sp,64 + 8001caac: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17heb1bde8fe889e8ecE: + +000000008001caae <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17heb1bde8fe889e8ecE>: + pub fn new_zeroed_in(alloc: A) -> Box, A> { + 8001caae: 7139 addi sp,sp,-64 + let layout = Layout::new::>(); + 8001cab0: fc06 sd ra,56(sp) + 8001cab2: fffec097 auipc ra,0xfffec + 8001cab6: 296080e7 jalr 662(ra) # 80008d48 <_ZN4core5alloc6layout6Layout3new17h0cabd46b2af96281E> + 8001caba: 862a mv a2,a0 + 8001cabc: e032 sd a2,0(sp) + 8001cabe: 862e mv a2,a1 + 8001cac0: e432 sd a2,8(sp) + 8001cac2: f02a sd a0,32(sp) + 8001cac4: f42e sd a1,40(sp) + 8001cac6: a009 j 8001cac8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17heb1bde8fe889e8ecE+0x1a> + match Box::try_new_zeroed_in(alloc) { + 8001cac8: 00000097 auipc ra,0x0 + 8001cacc: 034080e7 jalr 52(ra) # 8001cafc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E> + 8001cad0: e82a sd a0,16(sp) + 8001cad2: a009 j 8001cad4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17heb1bde8fe889e8ecE+0x26> + Ok(m) => m, + 8001cad4: 6542 ld a0,16(sp) + 8001cad6: 00153593 seqz a1,a0 + 8001cada: 4581 li a1,0 + 8001cadc: 00b51b63 bne a0,a1,8001caf2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17heb1bde8fe889e8ecE+0x44> + 8001cae0: a009 j 8001cae2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_zeroed_in17heb1bde8fe889e8ecE+0x34> + Err(_) => handle_alloc_error(layout), + 8001cae2: 65a2 ld a1,8(sp) + 8001cae4: 6502 ld a0,0(sp) + 8001cae6: 00006097 auipc ra,0x6 + 8001caea: 458080e7 jalr 1112(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + 8001caee: 0000 unimp + match Box::try_new_zeroed_in(alloc) { + 8001caf0: 0000 unimp + Ok(m) => m, + 8001caf2: 6542 ld a0,16(sp) + 8001caf4: f82a sd a0,48(sp) + } + 8001caf6: 70e2 ld ra,56(sp) + 8001caf8: 6121 addi sp,sp,64 + 8001cafa: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E: + +000000008001cafc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E>: + pub fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> { + 8001cafc: 7175 addi sp,sp,-144 + let layout = Layout::new::>(); + 8001cafe: e506 sd ra,136(sp) + 8001cb00: fffec097 auipc ra,0xfffec + 8001cb04: 248080e7 jalr 584(ra) # 80008d48 <_ZN4core5alloc6layout6Layout3new17h0cabd46b2af96281E> + 8001cb08: 862a mv a2,a0 + 8001cb0a: f432 sd a2,40(sp) + 8001cb0c: 862e mv a2,a1 + 8001cb0e: f832 sd a2,48(sp) + 8001cb10: f0aa sd a0,96(sp) + 8001cb12: f4ae sd a1,104(sp) + 8001cb14: a009 j 8001cb16 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x1a> + let ptr = alloc.allocate_zeroed(layout)?.cast(); + 8001cb16: 7642 ld a2,48(sp) + 8001cb18: 75a2 ld a1,40(sp) + 8001cb1a: 1828 addi a0,sp,56 + 8001cb1c: ffff0097 auipc ra,0xffff0 + 8001cb20: 0c4080e7 jalr 196(ra) # 8000cbe0 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE> + 8001cb24: ec2a sd a0,24(sp) + 8001cb26: f02e sd a1,32(sp) + 8001cb28: a009 j 8001cb2a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x2e> + 8001cb2a: 7582 ld a1,32(sp) + 8001cb2c: 6562 ld a0,24(sp) + 8001cb2e: ffff1097 auipc ra,0xffff1 + 8001cb32: f7e080e7 jalr -130(ra) # 8000daac <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E> + 8001cb36: e4aa sd a0,72(sp) + 8001cb38: e8ae sd a1,80(sp) + 8001cb3a: a009 j 8001cb3c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x40> + 8001cb3c: 6526 ld a0,72(sp) + 8001cb3e: 00153593 seqz a1,a0 + 8001cb42: 4581 li a1,0 + 8001cb44: 00b51463 bne a0,a1,8001cb4c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x50> + 8001cb48: a009 j 8001cb4a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x4e> + 8001cb4a: a831 j 8001cb66 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x6a> + 8001cb4c: 6526 ld a0,72(sp) + 8001cb4e: 65c6 ld a1,80(sp) + 8001cb50: f8aa sd a0,112(sp) + 8001cb52: fcae sd a1,120(sp) + 8001cb54: ffff3097 auipc ra,0xffff3 + 8001cb58: 240080e7 jalr 576(ra) # 8000fd94 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h85615dabbcfe0ebdE> + 8001cb5c: 85aa mv a1,a0 + 8001cb5e: e82e sd a1,16(sp) + 8001cb60: e12a sd a0,128(sp) + 8001cb62: a831 j 8001cb7e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x82> + 8001cb64: 0000 unimp + 8001cb66: ffff1097 auipc ra,0xffff1 + 8001cb6a: 8ee080e7 jalr -1810(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8001cb6e: a009 j 8001cb70 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x74> + 8001cb70: ffff1097 auipc ra,0xffff1 + 8001cb74: f08080e7 jalr -248(ra) # 8000da78 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hc5c17464a72e6965E> + 8001cb78: e0aa sd a0,64(sp) + 8001cb7a: a009 j 8001cb7c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x80> + } + 8001cb7c: a015 j 8001cba0 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0xa4> + unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } + 8001cb7e: 6542 ld a0,16(sp) + 8001cb80: ffff3097 auipc ra,0xffff3 + 8001cb84: 2ae080e7 jalr 686(ra) # 8000fe2e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h4054fe6794409e65E> + 8001cb88: e42a sd a0,8(sp) + 8001cb8a: a009 j 8001cb8c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x90> + 8001cb8c: 6522 ld a0,8(sp) + 8001cb8e: 00000097 auipc ra,0x0 + 8001cb92: b10080e7 jalr -1264(ra) # 8001c69e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h15afec5304658230E> + 8001cb96: e02a sd a0,0(sp) + 8001cb98: a009 j 8001cb9a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0x9e> + 8001cb9a: 6502 ld a0,0(sp) + 8001cb9c: e0aa sd a0,64(sp) + } + 8001cb9e: a009 j 8001cba0 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h29f0c45ca59c2dc8E+0xa4> + 8001cba0: 6506 ld a0,64(sp) + 8001cba2: 60aa ld ra,136(sp) + 8001cba4: 6149 addi sp,sp,144 + 8001cba6: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE: + +000000008001cba8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE>: + pub fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> { + 8001cba8: 7175 addi sp,sp,-144 + let layout = Layout::new::>(); + 8001cbaa: e506 sd ra,136(sp) + 8001cbac: fffec097 auipc ra,0xfffec + 8001cbb0: 200080e7 jalr 512(ra) # 80008dac <_ZN4core5alloc6layout6Layout3new17h728acb0ef5b915afE> + 8001cbb4: 862a mv a2,a0 + 8001cbb6: f432 sd a2,40(sp) + 8001cbb8: 862e mv a2,a1 + 8001cbba: f832 sd a2,48(sp) + 8001cbbc: f0aa sd a0,96(sp) + 8001cbbe: f4ae sd a1,104(sp) + 8001cbc0: a009 j 8001cbc2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x1a> + let ptr = alloc.allocate_zeroed(layout)?.cast(); + 8001cbc2: 7642 ld a2,48(sp) + 8001cbc4: 75a2 ld a1,40(sp) + 8001cbc6: 1828 addi a0,sp,56 + 8001cbc8: ffff0097 auipc ra,0xffff0 + 8001cbcc: 018080e7 jalr 24(ra) # 8000cbe0 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE> + 8001cbd0: ec2a sd a0,24(sp) + 8001cbd2: f02e sd a1,32(sp) + 8001cbd4: a009 j 8001cbd6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x2e> + 8001cbd6: 7582 ld a1,32(sp) + 8001cbd8: 6562 ld a0,24(sp) + 8001cbda: ffff1097 auipc ra,0xffff1 + 8001cbde: ed2080e7 jalr -302(ra) # 8000daac <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E> + 8001cbe2: e4aa sd a0,72(sp) + 8001cbe4: e8ae sd a1,80(sp) + 8001cbe6: a009 j 8001cbe8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x40> + 8001cbe8: 6526 ld a0,72(sp) + 8001cbea: 00153593 seqz a1,a0 + 8001cbee: 4581 li a1,0 + 8001cbf0: 00b51463 bne a0,a1,8001cbf8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x50> + 8001cbf4: a009 j 8001cbf6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x4e> + 8001cbf6: a831 j 8001cc12 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x6a> + 8001cbf8: 6526 ld a0,72(sp) + 8001cbfa: 65c6 ld a1,80(sp) + 8001cbfc: f8aa sd a0,112(sp) + 8001cbfe: fcae sd a1,120(sp) + 8001cc00: ffff3097 auipc ra,0xffff3 + 8001cc04: 1e8080e7 jalr 488(ra) # 8000fde8 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17hf78234e23d9835f1E> + 8001cc08: 85aa mv a1,a0 + 8001cc0a: e82e sd a1,16(sp) + 8001cc0c: e12a sd a0,128(sp) + 8001cc0e: a831 j 8001cc2a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x82> + 8001cc10: 0000 unimp + 8001cc12: ffff1097 auipc ra,0xffff1 + 8001cc16: 842080e7 jalr -1982(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8001cc1a: a009 j 8001cc1c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x74> + 8001cc1c: ffff1097 auipc ra,0xffff1 + 8001cc20: e16080e7 jalr -490(ra) # 8000da32 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h849eab7baac337bbE> + 8001cc24: e0aa sd a0,64(sp) + 8001cc26: a009 j 8001cc28 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x80> + } + 8001cc28: a015 j 8001cc4c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0xa4> + unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } + 8001cc2a: 6542 ld a0,16(sp) + 8001cc2c: ffff3097 auipc ra,0xffff3 + 8001cc30: 244080e7 jalr 580(ra) # 8000fe70 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17habcb33ad0b4dc302E> + 8001cc34: e42a sd a0,8(sp) + 8001cc36: a009 j 8001cc38 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x90> + 8001cc38: 6522 ld a0,8(sp) + 8001cc3a: 00000097 auipc ra,0x0 + 8001cc3e: a80080e7 jalr -1408(ra) # 8001c6ba <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h187980a64cbbe532E> + 8001cc42: e02a sd a0,0(sp) + 8001cc44: a009 j 8001cc46 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0x9e> + 8001cc46: 6502 ld a0,0(sp) + 8001cc48: e0aa sd a0,64(sp) + } + 8001cc4a: a009 j 8001cc4c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h32b802f331a4867eE+0xa4> + 8001cc4c: 6506 ld a0,64(sp) + 8001cc4e: 60aa ld ra,136(sp) + 8001cc50: 6149 addi sp,sp,144 + 8001cc52: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE: + +000000008001cc54 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE>: + pub fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> { + 8001cc54: 7175 addi sp,sp,-144 + let layout = Layout::new::>(); + 8001cc56: e506 sd ra,136(sp) + 8001cc58: fffec097 auipc ra,0xfffec + 8001cc5c: 186080e7 jalr 390(ra) # 80008dde <_ZN4core5alloc6layout6Layout3new17h9329aa50601ba1ffE> + 8001cc60: 862a mv a2,a0 + 8001cc62: f432 sd a2,40(sp) + 8001cc64: 862e mv a2,a1 + 8001cc66: f832 sd a2,48(sp) + 8001cc68: f0aa sd a0,96(sp) + 8001cc6a: f4ae sd a1,104(sp) + 8001cc6c: a009 j 8001cc6e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x1a> + let ptr = alloc.allocate_zeroed(layout)?.cast(); + 8001cc6e: 7642 ld a2,48(sp) + 8001cc70: 75a2 ld a1,40(sp) + 8001cc72: 1828 addi a0,sp,56 + 8001cc74: ffff0097 auipc ra,0xffff0 + 8001cc78: f6c080e7 jalr -148(ra) # 8000cbe0 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE> + 8001cc7c: ec2a sd a0,24(sp) + 8001cc7e: f02e sd a1,32(sp) + 8001cc80: a009 j 8001cc82 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x2e> + 8001cc82: 7582 ld a1,32(sp) + 8001cc84: 6562 ld a0,24(sp) + 8001cc86: ffff1097 auipc ra,0xffff1 + 8001cc8a: e26080e7 jalr -474(ra) # 8000daac <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E> + 8001cc8e: e4aa sd a0,72(sp) + 8001cc90: e8ae sd a1,80(sp) + 8001cc92: a009 j 8001cc94 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x40> + 8001cc94: 6526 ld a0,72(sp) + 8001cc96: 00153593 seqz a1,a0 + 8001cc9a: 4581 li a1,0 + 8001cc9c: 00b51463 bne a0,a1,8001cca4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x50> + 8001cca0: a009 j 8001cca2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x4e> + 8001cca2: a831 j 8001ccbe <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x6a> + 8001cca4: 6526 ld a0,72(sp) + 8001cca6: 65c6 ld a1,80(sp) + 8001cca8: f8aa sd a0,112(sp) + 8001ccaa: fcae sd a1,120(sp) + 8001ccac: ffff3097 auipc ra,0xffff3 + 8001ccb0: 042080e7 jalr 66(ra) # 8000fcee <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h280b1a52f32358efE> + 8001ccb4: 85aa mv a1,a0 + 8001ccb6: e82e sd a1,16(sp) + 8001ccb8: e12a sd a0,128(sp) + 8001ccba: a831 j 8001ccd6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x82> + 8001ccbc: 0000 unimp + 8001ccbe: ffff0097 auipc ra,0xffff0 + 8001ccc2: 796080e7 jalr 1942(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8001ccc6: a009 j 8001ccc8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x74> + 8001ccc8: ffff1097 auipc ra,0xffff1 + 8001cccc: cf4080e7 jalr -780(ra) # 8000d9bc <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h2a54492b2826375dE> + 8001ccd0: e0aa sd a0,64(sp) + 8001ccd2: a009 j 8001ccd4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x80> + } + 8001ccd4: a015 j 8001ccf8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0xa4> + unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } + 8001ccd6: 6542 ld a0,16(sp) + 8001ccd8: ffff3097 auipc ra,0xffff3 + 8001ccdc: 166080e7 jalr 358(ra) # 8000fe3e <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17h593c20a0c1123d02E> + 8001cce0: e42a sd a0,8(sp) + 8001cce2: a009 j 8001cce4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x90> + 8001cce4: 6522 ld a0,8(sp) + 8001cce6: 00000097 auipc ra,0x0 + 8001ccea: 9f0080e7 jalr -1552(ra) # 8001c6d6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h468e1ef7cafa8023E> + 8001ccee: e02a sd a0,0(sp) + 8001ccf0: a009 j 8001ccf2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0x9e> + 8001ccf2: 6502 ld a0,0(sp) + 8001ccf4: e0aa sd a0,64(sp) + } + 8001ccf6: a009 j 8001ccf8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h90782e32d4ec13edE+0xa4> + 8001ccf8: 6506 ld a0,64(sp) + 8001ccfa: 60aa ld ra,136(sp) + 8001ccfc: 6149 addi sp,sp,144 + 8001ccfe: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E: + +000000008001cd00 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E>: + pub fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> { + 8001cd00: 7175 addi sp,sp,-144 + let layout = Layout::new::>(); + 8001cd02: e506 sd ra,136(sp) + 8001cd04: fffec097 auipc ra,0xfffec + 8001cd08: 10c080e7 jalr 268(ra) # 80008e10 <_ZN4core5alloc6layout6Layout3new17hfb4102c77959cfa1E> + 8001cd0c: 862a mv a2,a0 + 8001cd0e: f432 sd a2,40(sp) + 8001cd10: 862e mv a2,a1 + 8001cd12: f832 sd a2,48(sp) + 8001cd14: f0aa sd a0,96(sp) + 8001cd16: f4ae sd a1,104(sp) + 8001cd18: a009 j 8001cd1a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x1a> + let ptr = alloc.allocate_zeroed(layout)?.cast(); + 8001cd1a: 7642 ld a2,48(sp) + 8001cd1c: 75a2 ld a1,40(sp) + 8001cd1e: 1828 addi a0,sp,56 + 8001cd20: ffff0097 auipc ra,0xffff0 + 8001cd24: ec0080e7 jalr -320(ra) # 8000cbe0 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE> + 8001cd28: ec2a sd a0,24(sp) + 8001cd2a: f02e sd a1,32(sp) + 8001cd2c: a009 j 8001cd2e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x2e> + 8001cd2e: 7582 ld a1,32(sp) + 8001cd30: 6562 ld a0,24(sp) + 8001cd32: ffff1097 auipc ra,0xffff1 + 8001cd36: d7a080e7 jalr -646(ra) # 8000daac <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E> + 8001cd3a: e4aa sd a0,72(sp) + 8001cd3c: e8ae sd a1,80(sp) + 8001cd3e: a009 j 8001cd40 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x40> + 8001cd40: 6526 ld a0,72(sp) + 8001cd42: 00153593 seqz a1,a0 + 8001cd46: 4581 li a1,0 + 8001cd48: 00b51463 bne a0,a1,8001cd50 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x50> + 8001cd4c: a009 j 8001cd4e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x4e> + 8001cd4e: a831 j 8001cd6a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x6a> + 8001cd50: 6526 ld a0,72(sp) + 8001cd52: 65c6 ld a1,80(sp) + 8001cd54: f8aa sd a0,112(sp) + 8001cd56: fcae sd a1,120(sp) + 8001cd58: ffff3097 auipc ra,0xffff3 + 8001cd5c: fea080e7 jalr -22(ra) # 8000fd42 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h535f2787d46a2a35E> + 8001cd60: 85aa mv a1,a0 + 8001cd62: e82e sd a1,16(sp) + 8001cd64: e12a sd a0,128(sp) + 8001cd66: a831 j 8001cd82 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x82> + 8001cd68: 0000 unimp + 8001cd6a: ffff0097 auipc ra,0xffff0 + 8001cd6e: 6ea080e7 jalr 1770(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8001cd72: a009 j 8001cd74 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x74> + 8001cd74: ffff1097 auipc ra,0xffff1 + 8001cd78: d0e080e7 jalr -754(ra) # 8000da82 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hfad957fd5ededc3fE> + 8001cd7c: e0aa sd a0,64(sp) + 8001cd7e: a009 j 8001cd80 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x80> + } + 8001cd80: a015 j 8001cda4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0xa4> + unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } + 8001cd82: 6542 ld a0,16(sp) + 8001cd84: ffff3097 auipc ra,0xffff3 + 8001cd88: 104080e7 jalr 260(ra) # 8000fe88 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17hd337d3c0c1677ef4E> + 8001cd8c: e42a sd a0,8(sp) + 8001cd8e: a009 j 8001cd90 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x90> + 8001cd90: 6522 ld a0,8(sp) + 8001cd92: 00000097 auipc ra,0x0 + 8001cd96: 960080e7 jalr -1696(ra) # 8001c6f2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h49971518b172ecd3E> + 8001cd9a: e02a sd a0,0(sp) + 8001cd9c: a009 j 8001cd9e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0x9e> + 8001cd9e: 6502 ld a0,0(sp) + 8001cda0: e0aa sd a0,64(sp) + } + 8001cda2: a009 j 8001cda4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17h9571c749e8c8e6e8E+0xa4> + 8001cda4: 6506 ld a0,64(sp) + 8001cda6: 60aa ld ra,136(sp) + 8001cda8: 6149 addi sp,sp,144 + 8001cdaa: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E: + +000000008001cdac <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E>: + pub fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> { + 8001cdac: 7175 addi sp,sp,-144 + let layout = Layout::new::>(); + 8001cdae: e506 sd ra,136(sp) + 8001cdb0: fffec097 auipc ra,0xfffec + 8001cdb4: f66080e7 jalr -154(ra) # 80008d16 <_ZN4core5alloc6layout6Layout3new17h00440f750a953d15E> + 8001cdb8: 862a mv a2,a0 + 8001cdba: f432 sd a2,40(sp) + 8001cdbc: 862e mv a2,a1 + 8001cdbe: f832 sd a2,48(sp) + 8001cdc0: f0aa sd a0,96(sp) + 8001cdc2: f4ae sd a1,104(sp) + 8001cdc4: a009 j 8001cdc6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x1a> + let ptr = alloc.allocate_zeroed(layout)?.cast(); + 8001cdc6: 7642 ld a2,48(sp) + 8001cdc8: 75a2 ld a1,40(sp) + 8001cdca: 1828 addi a0,sp,56 + 8001cdcc: ffff0097 auipc ra,0xffff0 + 8001cdd0: e14080e7 jalr -492(ra) # 8000cbe0 <_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$15allocate_zeroed17h62d497141254e70dE> + 8001cdd4: ec2a sd a0,24(sp) + 8001cdd6: f02e sd a1,32(sp) + 8001cdd8: a009 j 8001cdda <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x2e> + 8001cdda: 7582 ld a1,32(sp) + 8001cddc: 6562 ld a0,24(sp) + 8001cdde: ffff1097 auipc ra,0xffff1 + 8001cde2: cce080e7 jalr -818(ra) # 8000daac <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17h1c9f3c35158f4b17E> + 8001cde6: e4aa sd a0,72(sp) + 8001cde8: e8ae sd a1,80(sp) + 8001cdea: a009 j 8001cdec <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x40> + 8001cdec: 6526 ld a0,72(sp) + 8001cdee: 00153593 seqz a1,a0 + 8001cdf2: 4581 li a1,0 + 8001cdf4: 00b51463 bne a0,a1,8001cdfc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x50> + 8001cdf8: a009 j 8001cdfa <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x4e> + 8001cdfa: a831 j 8001ce16 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x6a> + 8001cdfc: 6526 ld a0,72(sp) + 8001cdfe: 65c6 ld a1,80(sp) + 8001ce00: f8aa sd a0,112(sp) + 8001ce02: fcae sd a1,120(sp) + 8001ce04: ffff3097 auipc ra,0xffff3 + 8001ce08: f14080e7 jalr -236(ra) # 8000fd18 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$4cast17h4354690cb24a4e56E> + 8001ce0c: 85aa mv a1,a0 + 8001ce0e: e82e sd a1,16(sp) + 8001ce10: e12a sd a0,128(sp) + 8001ce12: a831 j 8001ce2e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x82> + 8001ce14: 0000 unimp + 8001ce16: ffff0097 auipc ra,0xffff0 + 8001ce1a: 63e080e7 jalr 1598(ra) # 8000d454 <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h37d2ccc52635f8a7E> + 8001ce1e: a009 j 8001ce20 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x74> + 8001ce20: ffff1097 auipc ra,0xffff1 + 8001ce24: c4e080e7 jalr -946(ra) # 8000da6e <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17hc42702708db6cea4E> + 8001ce28: e0aa sd a0,64(sp) + 8001ce2a: a009 j 8001ce2c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x80> + } + 8001ce2c: a015 j 8001ce50 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0xa4> + unsafe { Ok(Box::from_raw_in(ptr.as_ptr(), alloc)) } + 8001ce2e: 6542 ld a0,16(sp) + 8001ce30: ffff3097 auipc ra,0xffff3 + 8001ce34: 048080e7 jalr 72(ra) # 8000fe78 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$6as_ptr17haf282fdd0407a8a4E> + 8001ce38: e42a sd a0,8(sp) + 8001ce3a: a009 j 8001ce3c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x90> + 8001ce3c: 6522 ld a0,8(sp) + 8001ce3e: 00000097 auipc ra,0x0 + 8001ce42: 8ec080e7 jalr -1812(ra) # 8001c72a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h91226147761dfc23E> + 8001ce46: e02a sd a0,0(sp) + 8001ce48: a009 j 8001ce4a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0x9e> + 8001ce4a: 6502 ld a0,0(sp) + 8001ce4c: e0aa sd a0,64(sp) + } + 8001ce4e: a009 j 8001ce50 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$17try_new_zeroed_in17hea8ededefef3bf78E+0xa4> + 8001ce50: 6506 ld a0,64(sp) + 8001ce52: 60aa ld ra,136(sp) + 8001ce54: 6149 addi sp,sp,144 + 8001ce56: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h01d9da470f10fcdcE: + +000000008001ce58 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h01d9da470f10fcdcE>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001ce58: 7139 addi sp,sp,-64 + 8001ce5a: fc06 sd ra,56(sp) + 8001ce5c: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001ce5e: 00000097 auipc ra,0x0 + 8001ce62: 9c8080e7 jalr -1592(ra) # 8001c826 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h80646c1775168f03E> + 8001ce66: e82a sd a0,16(sp) + 8001ce68: a009 j 8001ce6a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h01d9da470f10fcdcE+0x12> + 8001ce6a: 6542 ld a0,16(sp) + 8001ce6c: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001ce6e: fffef097 auipc ra,0xfffef + 8001ce72: 6a2080e7 jalr 1698(ra) # 8000c510 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h9702a6a3d13a07b5E> + 8001ce76: e42a sd a0,8(sp) + 8001ce78: a009 j 8001ce7a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h01d9da470f10fcdcE+0x22> + 8001ce7a: 6522 ld a0,8(sp) + 8001ce7c: ec2a sd a0,24(sp) + } + 8001ce7e: 70e2 ld ra,56(sp) + 8001ce80: 6121 addi sp,sp,64 + 8001ce82: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h255317eb94c396a6E: + +000000008001ce84 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h255317eb94c396a6E>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001ce84: 7139 addi sp,sp,-64 + 8001ce86: fc06 sd ra,56(sp) + 8001ce88: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001ce8a: 00000097 auipc ra,0x0 + 8001ce8e: a7c080e7 jalr -1412(ra) # 8001c906 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd08884b913096851E> + 8001ce92: e82a sd a0,16(sp) + 8001ce94: a009 j 8001ce96 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h255317eb94c396a6E+0x12> + 8001ce96: 6542 ld a0,16(sp) + 8001ce98: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001ce9a: fffef097 auipc ra,0xfffef + 8001ce9e: 696080e7 jalr 1686(ra) # 8000c530 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb57b3bcaa3bdd3f9E> + 8001cea2: e42a sd a0,8(sp) + 8001cea4: a009 j 8001cea6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h255317eb94c396a6E+0x22> + 8001cea6: 6522 ld a0,8(sp) + 8001cea8: ec2a sd a0,24(sp) + } + 8001ceaa: 70e2 ld ra,56(sp) + 8001ceac: 6121 addi sp,sp,64 + 8001ceae: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3a774aee57a2b865E: + +000000008001ceb0 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3a774aee57a2b865E>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001ceb0: 7139 addi sp,sp,-64 + 8001ceb2: fc06 sd ra,56(sp) + 8001ceb4: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001ceb6: 00000097 auipc ra,0x0 + 8001ceba: 900080e7 jalr -1792(ra) # 8001c7b6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h48e22d69c2444c2aE> + 8001cebe: e82a sd a0,16(sp) + 8001cec0: a009 j 8001cec2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3a774aee57a2b865E+0x12> + 8001cec2: 6542 ld a0,16(sp) + 8001cec4: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001cec6: fffef097 auipc ra,0xfffef + 8001ceca: 62a080e7 jalr 1578(ra) # 8000c4f0 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h3d727d33388c5225E> + 8001cece: e42a sd a0,8(sp) + 8001ced0: a009 j 8001ced2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3a774aee57a2b865E+0x22> + 8001ced2: 6522 ld a0,8(sp) + 8001ced4: ec2a sd a0,24(sp) + } + 8001ced6: 70e2 ld ra,56(sp) + 8001ced8: 6121 addi sp,sp,64 + 8001ceda: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3e9247aef62521b2E: + +000000008001cedc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3e9247aef62521b2E>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001cedc: 7139 addi sp,sp,-64 + 8001cede: fc06 sd ra,56(sp) + 8001cee0: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001cee2: 00000097 auipc ra,0x0 + 8001cee6: 9b4080e7 jalr -1612(ra) # 8001c896 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h9813befe69e55ae1E> + 8001ceea: e82a sd a0,16(sp) + 8001ceec: a009 j 8001ceee <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3e9247aef62521b2E+0x12> + 8001ceee: 6542 ld a0,16(sp) + 8001cef0: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001cef2: fffef097 auipc ra,0xfffef + 8001cef6: 64e080e7 jalr 1614(ra) # 8000c540 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hd1144efb36e37b5fE> + 8001cefa: e42a sd a0,8(sp) + 8001cefc: a009 j 8001cefe <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3e9247aef62521b2E+0x22> + 8001cefe: 6522 ld a0,8(sp) + 8001cf00: ec2a sd a0,24(sp) + } + 8001cf02: 70e2 ld ra,56(sp) + 8001cf04: 6121 addi sp,sp,64 + 8001cf06: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3eebe938f1ba1056E: + +000000008001cf08 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3eebe938f1ba1056E>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001cf08: 7139 addi sp,sp,-64 + 8001cf0a: fc06 sd ra,56(sp) + 8001cf0c: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001cf0e: 00000097 auipc ra,0x0 + 8001cf12: 9c0080e7 jalr -1600(ra) # 8001c8ce <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hb4dd27b4659222a3E> + 8001cf16: e82a sd a0,16(sp) + 8001cf18: a009 j 8001cf1a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3eebe938f1ba1056E+0x12> + 8001cf1a: 6542 ld a0,16(sp) + 8001cf1c: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001cf1e: fffef097 auipc ra,0xfffef + 8001cf22: 60a080e7 jalr 1546(ra) # 8000c528 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb43ff2a43bd415faE> + 8001cf26: e42a sd a0,8(sp) + 8001cf28: a009 j 8001cf2a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3eebe938f1ba1056E+0x22> + 8001cf2a: 6522 ld a0,8(sp) + 8001cf2c: ec2a sd a0,24(sp) + } + 8001cf2e: 70e2 ld ra,56(sp) + 8001cf30: 6121 addi sp,sp,64 + 8001cf32: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h56417e202ce6f498E: + +000000008001cf34 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h56417e202ce6f498E>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001cf34: 7139 addi sp,sp,-64 + 8001cf36: fc06 sd ra,56(sp) + 8001cf38: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001cf3a: 00000097 auipc ra,0x0 + 8001cf3e: a04080e7 jalr -1532(ra) # 8001c93e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17hd4115af6111f1ecaE> + 8001cf42: e82a sd a0,16(sp) + 8001cf44: a009 j 8001cf46 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h56417e202ce6f498E+0x12> + 8001cf46: 6542 ld a0,16(sp) + 8001cf48: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001cf4a: fffef097 auipc ra,0xfffef + 8001cf4e: 5fe080e7 jalr 1534(ra) # 8000c548 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hf99ed61581dd6ee2E> + 8001cf52: e42a sd a0,8(sp) + 8001cf54: a009 j 8001cf56 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h56417e202ce6f498E+0x22> + 8001cf56: 6522 ld a0,8(sp) + 8001cf58: ec2a sd a0,24(sp) + } + 8001cf5a: 70e2 ld ra,56(sp) + 8001cf5c: 6121 addi sp,sp,64 + 8001cf5e: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h8cff8d68311da958E: + +000000008001cf60 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h8cff8d68311da958E>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001cf60: 7139 addi sp,sp,-64 + 8001cf62: fc06 sd ra,56(sp) + 8001cf64: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001cf66: 00000097 auipc ra,0x0 + 8001cf6a: 888080e7 jalr -1912(ra) # 8001c7ee <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h77bf5089d70199a1E> + 8001cf6e: e82a sd a0,16(sp) + 8001cf70: a009 j 8001cf72 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h8cff8d68311da958E+0x12> + 8001cf72: 6542 ld a0,16(sp) + 8001cf74: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001cf76: fffef097 auipc ra,0xfffef + 8001cf7a: 582080e7 jalr 1410(ra) # 8000c4f8 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h43259d2d16140eb2E> + 8001cf7e: e42a sd a0,8(sp) + 8001cf80: a009 j 8001cf82 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h8cff8d68311da958E+0x22> + 8001cf82: 6522 ld a0,8(sp) + 8001cf84: ec2a sd a0,24(sp) + } + 8001cf86: 70e2 ld ra,56(sp) + 8001cf88: 6121 addi sp,sp,64 + 8001cf8a: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17he0e1487eb5c18a3bE: + +000000008001cf8c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17he0e1487eb5c18a3bE>: + pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { + 8001cf8c: 7139 addi sp,sp,-64 + 8001cf8e: fc06 sd ra,56(sp) + 8001cf90: f02a sd a0,32(sp) + let (leaked, alloc) = Box::into_unique(b); + 8001cf92: 00000097 auipc ra,0x0 + 8001cf96: 8cc080e7 jalr -1844(ra) # 8001c85e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11into_unique17h93f491d0366dd1a9E> + 8001cf9a: e82a sd a0,16(sp) + 8001cf9c: a009 j 8001cf9e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17he0e1487eb5c18a3bE+0x12> + 8001cf9e: 6542 ld a0,16(sp) + 8001cfa0: f82a sd a0,48(sp) + (leaked.as_ptr(), alloc) + 8001cfa2: fffef097 auipc ra,0xfffef + 8001cfa6: 566080e7 jalr 1382(ra) # 8000c508 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h7e93959e8a601ed4E> + 8001cfaa: e42a sd a0,8(sp) + 8001cfac: a009 j 8001cfae <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17he0e1487eb5c18a3bE+0x22> + 8001cfae: 6522 ld a0,8(sp) + 8001cfb0: ec2a sd a0,24(sp) + } + 8001cfb2: 70e2 ld ra,56(sp) + 8001cfb4: 6121 addi sp,sp,64 + 8001cfb6: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h3b2c40161bf6c180E: + +000000008001cfb8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h3b2c40161bf6c180E>: + /// static_ref[0] = 4; + /// assert_eq!(*static_ref, [4, 2, 3]); + /// ``` + #[stable(feature = "box_leak", since = "1.26.0")] + #[inline] + pub fn leak<'a>(b: Self) -> &'a mut T + 8001cfb8: 7139 addi sp,sp,-64 + 8001cfba: fc06 sd ra,56(sp) + 8001cfbc: ec2a sd a0,24(sp) + 8001cfbe: f42a sd a0,40(sp) + ManuallyDrop { value } + 8001cfc0: f02a sd a0,32(sp) + where + A: 'a, + { + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001cfc2: e82a sd a0,16(sp) + 8001cfc4: a009 j 8001cfc6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h3b2c40161bf6c180E+0xe> + 8001cfc6: 0808 addi a0,sp,16 + 8001cfc8: e42a sd a0,8(sp) + 8001cfca: f82a sd a0,48(sp) + 8001cfcc: a009 j 8001cfce <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h3b2c40161bf6c180E+0x16> + 8001cfce: 6522 ld a0,8(sp) + 8001cfd0: 6108 ld a0,0(a0) + 8001cfd2: fffef097 auipc ra,0xfffef + 8001cfd6: 536080e7 jalr 1334(ra) # 8000c508 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h7e93959e8a601ed4E> + 8001cfda: e02a sd a0,0(sp) + 8001cfdc: a009 j 8001cfde <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h3b2c40161bf6c180E+0x26> + } + 8001cfde: 6502 ld a0,0(sp) + 8001cfe0: 70e2 ld ra,56(sp) + 8001cfe2: 6121 addi sp,sp,64 + 8001cfe4: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h4b4e76265837c5ceE: + +000000008001cfe6 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h4b4e76265837c5ceE>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001cfe6: 7139 addi sp,sp,-64 + 8001cfe8: fc06 sd ra,56(sp) + 8001cfea: ec2a sd a0,24(sp) + 8001cfec: f42a sd a0,40(sp) + 8001cfee: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001cff0: e82a sd a0,16(sp) + 8001cff2: a009 j 8001cff4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h4b4e76265837c5ceE+0xe> + 8001cff4: 0808 addi a0,sp,16 + 8001cff6: e42a sd a0,8(sp) + 8001cff8: f82a sd a0,48(sp) + 8001cffa: a009 j 8001cffc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h4b4e76265837c5ceE+0x16> + 8001cffc: 6522 ld a0,8(sp) + 8001cffe: 6108 ld a0,0(a0) + 8001d000: fffef097 auipc ra,0xfffef + 8001d004: 540080e7 jalr 1344(ra) # 8000c540 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hd1144efb36e37b5fE> + 8001d008: e02a sd a0,0(sp) + 8001d00a: a009 j 8001d00c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h4b4e76265837c5ceE+0x26> + } + 8001d00c: 6502 ld a0,0(sp) + 8001d00e: 70e2 ld ra,56(sp) + 8001d010: 6121 addi sp,sp,64 + 8001d012: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h77f658a9b95a64a2E: + +000000008001d014 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h77f658a9b95a64a2E>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001d014: 7139 addi sp,sp,-64 + 8001d016: fc06 sd ra,56(sp) + 8001d018: ec2a sd a0,24(sp) + 8001d01a: f42a sd a0,40(sp) + 8001d01c: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001d01e: e82a sd a0,16(sp) + 8001d020: a009 j 8001d022 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h77f658a9b95a64a2E+0xe> + 8001d022: 0808 addi a0,sp,16 + 8001d024: e42a sd a0,8(sp) + 8001d026: f82a sd a0,48(sp) + 8001d028: a009 j 8001d02a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h77f658a9b95a64a2E+0x16> + 8001d02a: 6522 ld a0,8(sp) + 8001d02c: 6108 ld a0,0(a0) + 8001d02e: fffef097 auipc ra,0xfffef + 8001d032: 4c2080e7 jalr 1218(ra) # 8000c4f0 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h3d727d33388c5225E> + 8001d036: e02a sd a0,0(sp) + 8001d038: a009 j 8001d03a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h77f658a9b95a64a2E+0x26> + } + 8001d03a: 6502 ld a0,0(sp) + 8001d03c: 70e2 ld ra,56(sp) + 8001d03e: 6121 addi sp,sp,64 + 8001d040: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h925dcada2cd56bb2E: + +000000008001d042 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h925dcada2cd56bb2E>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001d042: 7139 addi sp,sp,-64 + 8001d044: fc06 sd ra,56(sp) + 8001d046: ec2a sd a0,24(sp) + 8001d048: f42a sd a0,40(sp) + 8001d04a: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001d04c: e82a sd a0,16(sp) + 8001d04e: a009 j 8001d050 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h925dcada2cd56bb2E+0xe> + 8001d050: 0808 addi a0,sp,16 + 8001d052: e42a sd a0,8(sp) + 8001d054: f82a sd a0,48(sp) + 8001d056: a009 j 8001d058 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h925dcada2cd56bb2E+0x16> + 8001d058: 6522 ld a0,8(sp) + 8001d05a: 6108 ld a0,0(a0) + 8001d05c: fffef097 auipc ra,0xfffef + 8001d060: 4d4080e7 jalr 1236(ra) # 8000c530 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb57b3bcaa3bdd3f9E> + 8001d064: e02a sd a0,0(sp) + 8001d066: a009 j 8001d068 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h925dcada2cd56bb2E+0x26> + } + 8001d068: 6502 ld a0,0(sp) + 8001d06a: 70e2 ld ra,56(sp) + 8001d06c: 6121 addi sp,sp,64 + 8001d06e: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h94cb03dd08e899b7E: + +000000008001d070 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h94cb03dd08e899b7E>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001d070: 7139 addi sp,sp,-64 + 8001d072: fc06 sd ra,56(sp) + 8001d074: ec2a sd a0,24(sp) + 8001d076: f42a sd a0,40(sp) + 8001d078: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001d07a: e82a sd a0,16(sp) + 8001d07c: a009 j 8001d07e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h94cb03dd08e899b7E+0xe> + 8001d07e: 0808 addi a0,sp,16 + 8001d080: e42a sd a0,8(sp) + 8001d082: f82a sd a0,48(sp) + 8001d084: a009 j 8001d086 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h94cb03dd08e899b7E+0x16> + 8001d086: 6522 ld a0,8(sp) + 8001d088: 6108 ld a0,0(a0) + 8001d08a: fffef097 auipc ra,0xfffef + 8001d08e: 486080e7 jalr 1158(ra) # 8000c510 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h9702a6a3d13a07b5E> + 8001d092: e02a sd a0,0(sp) + 8001d094: a009 j 8001d096 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17h94cb03dd08e899b7E+0x26> + } + 8001d096: 6502 ld a0,0(sp) + 8001d098: 70e2 ld ra,56(sp) + 8001d09a: 6121 addi sp,sp,64 + 8001d09c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17ha0a7030531762e6fE: + +000000008001d09e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17ha0a7030531762e6fE>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001d09e: 7139 addi sp,sp,-64 + 8001d0a0: fc06 sd ra,56(sp) + 8001d0a2: ec2a sd a0,24(sp) + 8001d0a4: f42a sd a0,40(sp) + 8001d0a6: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001d0a8: e82a sd a0,16(sp) + 8001d0aa: a009 j 8001d0ac <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17ha0a7030531762e6fE+0xe> + 8001d0ac: 0808 addi a0,sp,16 + 8001d0ae: e42a sd a0,8(sp) + 8001d0b0: f82a sd a0,48(sp) + 8001d0b2: a009 j 8001d0b4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17ha0a7030531762e6fE+0x16> + 8001d0b4: 6522 ld a0,8(sp) + 8001d0b6: 6108 ld a0,0(a0) + 8001d0b8: fffef097 auipc ra,0xfffef + 8001d0bc: 448080e7 jalr 1096(ra) # 8000c500 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h54727a4650ef71dfE> + 8001d0c0: e02a sd a0,0(sp) + 8001d0c2: a009 j 8001d0c4 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17ha0a7030531762e6fE+0x26> + } + 8001d0c4: 6502 ld a0,0(sp) + 8001d0c6: 70e2 ld ra,56(sp) + 8001d0c8: 6121 addi sp,sp,64 + 8001d0ca: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hb50450963f97575cE: + +000000008001d0cc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hb50450963f97575cE>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001d0cc: 7139 addi sp,sp,-64 + 8001d0ce: fc06 sd ra,56(sp) + 8001d0d0: ec2a sd a0,24(sp) + 8001d0d2: f42a sd a0,40(sp) + 8001d0d4: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001d0d6: e82a sd a0,16(sp) + 8001d0d8: a009 j 8001d0da <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hb50450963f97575cE+0xe> + 8001d0da: 0808 addi a0,sp,16 + 8001d0dc: e42a sd a0,8(sp) + 8001d0de: f82a sd a0,48(sp) + 8001d0e0: a009 j 8001d0e2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hb50450963f97575cE+0x16> + 8001d0e2: 6522 ld a0,8(sp) + 8001d0e4: 6108 ld a0,0(a0) + 8001d0e6: fffef097 auipc ra,0xfffef + 8001d0ea: 462080e7 jalr 1122(ra) # 8000c548 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hf99ed61581dd6ee2E> + 8001d0ee: e02a sd a0,0(sp) + 8001d0f0: a009 j 8001d0f2 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hb50450963f97575cE+0x26> + } + 8001d0f2: 6502 ld a0,0(sp) + 8001d0f4: 70e2 ld ra,56(sp) + 8001d0f6: 6121 addi sp,sp,64 + 8001d0f8: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hcf7bcb368f276750E: + +000000008001d0fa <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hcf7bcb368f276750E>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001d0fa: 7139 addi sp,sp,-64 + 8001d0fc: fc06 sd ra,56(sp) + 8001d0fe: ec2a sd a0,24(sp) + 8001d100: f42a sd a0,40(sp) + 8001d102: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001d104: e82a sd a0,16(sp) + 8001d106: a009 j 8001d108 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hcf7bcb368f276750E+0xe> + 8001d108: 0808 addi a0,sp,16 + 8001d10a: e42a sd a0,8(sp) + 8001d10c: f82a sd a0,48(sp) + 8001d10e: a009 j 8001d110 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hcf7bcb368f276750E+0x16> + 8001d110: 6522 ld a0,8(sp) + 8001d112: 6108 ld a0,0(a0) + 8001d114: fffef097 auipc ra,0xfffef + 8001d118: 414080e7 jalr 1044(ra) # 8000c528 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17hb43ff2a43bd415faE> + 8001d11c: e02a sd a0,0(sp) + 8001d11e: a009 j 8001d120 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17hcf7bcb368f276750E+0x26> + } + 8001d120: 6502 ld a0,0(sp) + 8001d122: 70e2 ld ra,56(sp) + 8001d124: 6121 addi sp,sp,64 + 8001d126: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17he4f1cfe07554e5a5E: + +000000008001d128 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17he4f1cfe07554e5a5E>: + pub fn leak<'a>(b: Self) -> &'a mut T + 8001d128: 7139 addi sp,sp,-64 + 8001d12a: fc06 sd ra,56(sp) + 8001d12c: ec2a sd a0,24(sp) + 8001d12e: f42a sd a0,40(sp) + 8001d130: f02a sd a0,32(sp) + unsafe { &mut *mem::ManuallyDrop::new(b).0.as_ptr() } + 8001d132: e82a sd a0,16(sp) + 8001d134: a009 j 8001d136 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17he4f1cfe07554e5a5E+0xe> + 8001d136: 0808 addi a0,sp,16 + 8001d138: e42a sd a0,8(sp) + 8001d13a: f82a sd a0,48(sp) + 8001d13c: a009 j 8001d13e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17he4f1cfe07554e5a5E+0x16> + 8001d13e: 6522 ld a0,8(sp) + 8001d140: 6108 ld a0,0(a0) + 8001d142: fffef097 auipc ra,0xfffef + 8001d146: 3b6080e7 jalr 950(ra) # 8000c4f8 <_ZN4core3ptr6unique15Unique$LT$T$GT$6as_ptr17h43259d2d16140eb2E> + 8001d14a: e02a sd a0,0(sp) + 8001d14c: a009 j 8001d14e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$4leak17he4f1cfe07554e5a5E+0x26> + } + 8001d14e: 6502 ld a0,0(sp) + 8001d150: 70e2 ld ra,56(sp) + 8001d152: 6121 addi sp,sp,64 + 8001d154: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h11a22cb7d9ea1552E: + +000000008001d156 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h11a22cb7d9ea1552E>: + pub fn into_raw(b: Self) -> *mut T { + 8001d156: 1101 addi sp,sp,-32 + 8001d158: ec06 sd ra,24(sp) + 8001d15a: e82a sd a0,16(sp) + Self::into_raw_with_allocator(b).0 + 8001d15c: 00000097 auipc ra,0x0 + 8001d160: dac080e7 jalr -596(ra) # 8001cf08 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3eebe938f1ba1056E> + 8001d164: e42a sd a0,8(sp) + 8001d166: a009 j 8001d168 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h11a22cb7d9ea1552E+0x12> + 8001d168: 6522 ld a0,8(sp) + } + 8001d16a: e02a sd a0,0(sp) + 8001d16c: a009 j 8001d16e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h11a22cb7d9ea1552E+0x18> + 8001d16e: 6502 ld a0,0(sp) + 8001d170: 60e2 ld ra,24(sp) + 8001d172: 6105 addi sp,sp,32 + 8001d174: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h4b72114c3b8b546bE: + +000000008001d176 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h4b72114c3b8b546bE>: + pub fn into_raw(b: Self) -> *mut T { + 8001d176: 1101 addi sp,sp,-32 + 8001d178: ec06 sd ra,24(sp) + 8001d17a: e82a sd a0,16(sp) + Self::into_raw_with_allocator(b).0 + 8001d17c: 00000097 auipc ra,0x0 + 8001d180: d60080e7 jalr -672(ra) # 8001cedc <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3e9247aef62521b2E> + 8001d184: e42a sd a0,8(sp) + 8001d186: a009 j 8001d188 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h4b72114c3b8b546bE+0x12> + 8001d188: 6522 ld a0,8(sp) + } + 8001d18a: e02a sd a0,0(sp) + 8001d18c: a009 j 8001d18e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17h4b72114c3b8b546bE+0x18> + 8001d18e: 6502 ld a0,0(sp) + 8001d190: 60e2 ld ra,24(sp) + 8001d192: 6105 addi sp,sp,32 + 8001d194: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17hcc7ebe92239a3cf2E: + +000000008001d196 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17hcc7ebe92239a3cf2E>: + pub fn into_raw(b: Self) -> *mut T { + 8001d196: 1101 addi sp,sp,-32 + 8001d198: ec06 sd ra,24(sp) + 8001d19a: e82a sd a0,16(sp) + Self::into_raw_with_allocator(b).0 + 8001d19c: 00000097 auipc ra,0x0 + 8001d1a0: df0080e7 jalr -528(ra) # 8001cf8c <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17he0e1487eb5c18a3bE> + 8001d1a4: e42a sd a0,8(sp) + 8001d1a6: a009 j 8001d1a8 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17hcc7ebe92239a3cf2E+0x12> + 8001d1a8: 6522 ld a0,8(sp) + } + 8001d1aa: e02a sd a0,0(sp) + 8001d1ac: a009 j 8001d1ae <_ZN5alloc5boxed16Box$LT$T$C$A$GT$8into_raw17hcc7ebe92239a3cf2E+0x18> + 8001d1ae: 6502 ld a0,0(sp) + 8001d1b0: 60e2 ld ra,24(sp) + 8001d1b2: 6105 addi sp,sp,32 + 8001d1b4: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h22cceebd78df14b7E: + +000000008001d1b6 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h22cceebd78df14b7E>: + pub unsafe fn assume_init(self) -> Box { + 8001d1b6: 7179 addi sp,sp,-48 + 8001d1b8: f406 sd ra,40(sp) + 8001d1ba: e82a sd a0,16(sp) + let (raw, alloc) = Box::into_raw_with_allocator(self); + 8001d1bc: 00000097 auipc ra,0x0 + 8001d1c0: cf4080e7 jalr -780(ra) # 8001ceb0 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h3a774aee57a2b865E> + 8001d1c4: e42a sd a0,8(sp) + 8001d1c6: a009 j 8001d1c8 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h22cceebd78df14b7E+0x12> + 8001d1c8: 6522 ld a0,8(sp) + 8001d1ca: f02a sd a0,32(sp) + unsafe { Box::from_raw_in(raw as *mut T, alloc) } + 8001d1cc: fffff097 auipc ra,0xfffff + 8001d1d0: 542080e7 jalr 1346(ra) # 8001c70e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h68eabecb8cd08a3aE> + 8001d1d4: e02a sd a0,0(sp) + 8001d1d6: a009 j 8001d1d8 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h22cceebd78df14b7E+0x22> + } + 8001d1d8: 6502 ld a0,0(sp) + 8001d1da: 70a2 ld ra,40(sp) + 8001d1dc: 6145 addi sp,sp,48 + 8001d1de: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h2fe4f6739411edd0E: + +000000008001d1e0 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h2fe4f6739411edd0E>: + pub unsafe fn assume_init(self) -> Box { + 8001d1e0: 7179 addi sp,sp,-48 + 8001d1e2: f406 sd ra,40(sp) + 8001d1e4: e82a sd a0,16(sp) + let (raw, alloc) = Box::into_raw_with_allocator(self); + 8001d1e6: 00000097 auipc ra,0x0 + 8001d1ea: c72080e7 jalr -910(ra) # 8001ce58 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h01d9da470f10fcdcE> + 8001d1ee: e42a sd a0,8(sp) + 8001d1f0: a009 j 8001d1f2 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h2fe4f6739411edd0E+0x12> + 8001d1f2: 6522 ld a0,8(sp) + 8001d1f4: f02a sd a0,32(sp) + unsafe { Box::from_raw_in(raw as *mut T, alloc) } + 8001d1f6: fffff097 auipc ra,0xfffff + 8001d1fa: 5a4080e7 jalr 1444(ra) # 8001c79a <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17he38318e450c3c542E> + 8001d1fe: e02a sd a0,0(sp) + 8001d200: a009 j 8001d202 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h2fe4f6739411edd0E+0x22> + } + 8001d202: 6502 ld a0,0(sp) + 8001d204: 70a2 ld ra,40(sp) + 8001d206: 6145 addi sp,sp,48 + 8001d208: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h35c82a9a8f43ab52E: + +000000008001d20a <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h35c82a9a8f43ab52E>: + pub unsafe fn assume_init(self) -> Box { + 8001d20a: 7179 addi sp,sp,-48 + 8001d20c: f406 sd ra,40(sp) + 8001d20e: e82a sd a0,16(sp) + let (raw, alloc) = Box::into_raw_with_allocator(self); + 8001d210: 00000097 auipc ra,0x0 + 8001d214: d50080e7 jalr -688(ra) # 8001cf60 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h8cff8d68311da958E> + 8001d218: e42a sd a0,8(sp) + 8001d21a: a009 j 8001d21c <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h35c82a9a8f43ab52E+0x12> + 8001d21c: 6522 ld a0,8(sp) + 8001d21e: f02a sd a0,32(sp) + unsafe { Box::from_raw_in(raw as *mut T, alloc) } + 8001d220: fffff097 auipc ra,0xfffff + 8001d224: 55e080e7 jalr 1374(ra) # 8001c77e <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17hbb480293fc4c0d0bE> + 8001d228: e02a sd a0,0(sp) + 8001d22a: a009 j 8001d22c <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h35c82a9a8f43ab52E+0x22> + } + 8001d22c: 6502 ld a0,0(sp) + 8001d22e: 70a2 ld ra,40(sp) + 8001d230: 6145 addi sp,sp,48 + 8001d232: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h4ed953d8735ade7eE: + +000000008001d234 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h4ed953d8735ade7eE>: + pub unsafe fn assume_init(self) -> Box { + 8001d234: 7179 addi sp,sp,-48 + 8001d236: f406 sd ra,40(sp) + 8001d238: e82a sd a0,16(sp) + let (raw, alloc) = Box::into_raw_with_allocator(self); + 8001d23a: 00000097 auipc ra,0x0 + 8001d23e: c4a080e7 jalr -950(ra) # 8001ce84 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h255317eb94c396a6E> + 8001d242: e42a sd a0,8(sp) + 8001d244: a009 j 8001d246 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h4ed953d8735ade7eE+0x12> + 8001d246: 6522 ld a0,8(sp) + 8001d248: f02a sd a0,32(sp) + unsafe { Box::from_raw_in(raw as *mut T, alloc) } + 8001d24a: fffff097 auipc ra,0xfffff + 8001d24e: 4fc080e7 jalr 1276(ra) # 8001c746 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17h9f1ea1f840330d88E> + 8001d252: e02a sd a0,0(sp) + 8001d254: a009 j 8001d256 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17h4ed953d8735ade7eE+0x22> + } + 8001d256: 6502 ld a0,0(sp) + 8001d258: 70a2 ld ra,40(sp) + 8001d25a: 6145 addi sp,sp,48 + 8001d25c: 8082 ret + +Disassembly of section .text._ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17hef567e32e2b3ffa4E: + +000000008001d25e <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17hef567e32e2b3ffa4E>: + pub unsafe fn assume_init(self) -> Box { + 8001d25e: 7179 addi sp,sp,-48 + 8001d260: f406 sd ra,40(sp) + 8001d262: e82a sd a0,16(sp) + let (raw, alloc) = Box::into_raw_with_allocator(self); + 8001d264: 00000097 auipc ra,0x0 + 8001d268: cd0080e7 jalr -816(ra) # 8001cf34 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$23into_raw_with_allocator17h56417e202ce6f498E> + 8001d26c: e42a sd a0,8(sp) + 8001d26e: a009 j 8001d270 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17hef567e32e2b3ffa4E+0x12> + 8001d270: 6522 ld a0,8(sp) + 8001d272: f02a sd a0,32(sp) + unsafe { Box::from_raw_in(raw as *mut T, alloc) } + 8001d274: fffff097 auipc ra,0xfffff + 8001d278: 4ee080e7 jalr 1262(ra) # 8001c762 <_ZN5alloc5boxed16Box$LT$T$C$A$GT$11from_raw_in17haf8eaf51394a2521E> + 8001d27c: e02a sd a0,0(sp) + 8001d27e: a009 j 8001d280 <_ZN5alloc5boxed60Box$LT$core..mem..maybe_uninit..MaybeUninit$LT$T$GT$$C$A$GT$11assume_init17hef567e32e2b3ffa4E+0x22> + } + 8001d280: 6502 ld a0,0(sp) + 8001d282: 70a2 ld ra,40(sp) + 8001d284: 6145 addi sp,sp,48 + 8001d286: 8082 ret + +Disassembly of section .text._ZN4core3cmp3Ord3min17h470a5bbd78ca29f2E: + +000000008001d288 <_ZN4core3cmp3Ord3min17h470a5bbd78ca29f2E>: + fn min(self, other: Self) -> Self + 8001d288: 1101 addi sp,sp,-32 + 8001d28a: ec06 sd ra,24(sp) + 8001d28c: e42a sd a0,8(sp) + 8001d28e: e82e sd a1,16(sp) + min_by(self, other, Ord::cmp) + 8001d290: 00000097 auipc ra,0x0 + 8001d294: 030080e7 jalr 48(ra) # 8001d2c0 <_ZN4core3cmp6min_by17he5979745ae7a7f64E> + 8001d298: e02a sd a0,0(sp) + 8001d29a: a009 j 8001d29c <_ZN4core3cmp3Ord3min17h470a5bbd78ca29f2E+0x14> + } + 8001d29c: 6502 ld a0,0(sp) + 8001d29e: 60e2 ld ra,24(sp) + 8001d2a0: 6105 addi sp,sp,32 + 8001d2a2: 8082 ret + +Disassembly of section .text._ZN4core3cmp3min17hbc9e632873ab1838E: + +000000008001d2a4 <_ZN4core3cmp3min17hbc9e632873ab1838E>: +pub fn min(v1: T, v2: T) -> T { + 8001d2a4: 1101 addi sp,sp,-32 + 8001d2a6: ec06 sd ra,24(sp) + 8001d2a8: e42a sd a0,8(sp) + 8001d2aa: e82e sd a1,16(sp) + v1.min(v2) + 8001d2ac: 00000097 auipc ra,0x0 + 8001d2b0: fdc080e7 jalr -36(ra) # 8001d288 <_ZN4core3cmp3Ord3min17h470a5bbd78ca29f2E> + 8001d2b4: e02a sd a0,0(sp) + 8001d2b6: a009 j 8001d2b8 <_ZN4core3cmp3min17hbc9e632873ab1838E+0x14> +} + 8001d2b8: 6502 ld a0,0(sp) + 8001d2ba: 60e2 ld ra,24(sp) + 8001d2bc: 6105 addi sp,sp,32 + 8001d2be: 8082 ret + +Disassembly of section .text._ZN4core3cmp6min_by17he5979745ae7a7f64E: + +000000008001d2c0 <_ZN4core3cmp6min_by17he5979745ae7a7f64E>: +pub fn min_by Ordering>(v1: T, v2: T, compare: F) -> T { + 8001d2c0: 715d addi sp,sp,-80 + 8001d2c2: e486 sd ra,72(sp) + 8001d2c4: e42a sd a0,8(sp) + 8001d2c6: e82e sd a1,16(sp) + 8001d2c8: 4505 li a0,1 + match compare(&v1, &v2) { + 8001d2ca: 02a10fa3 sb a0,63(sp) + 8001d2ce: 02a10f23 sb a0,62(sp) + 8001d2d2: 0028 addi a0,sp,8 + 8001d2d4: f42a sd a0,40(sp) + 8001d2d6: 080c addi a1,sp,16 + 8001d2d8: f82e sd a1,48(sp) + 8001d2da: fffea097 auipc ra,0xfffea + 8001d2de: c64080e7 jalr -924(ra) # 80006f3e <_ZN4core3ops8function6FnOnce9call_once17h5aa9a10c33b479e6E> + 8001d2e2: 02a103a3 sb a0,39(sp) + 8001d2e6: a009 j 8001d2e8 <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x28> + Ordering::Less | Ordering::Equal => v1, + 8001d2e8: 02710503 lb a0,39(sp) + 8001d2ec: 0505 addi a0,a0,1 + 8001d2ee: 4589 li a1,2 + 8001d2f0: 00b56a63 bltu a0,a1,8001d304 <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x44> + 8001d2f4: a009 j 8001d2f6 <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x36> + 8001d2f6: 4501 li a0,0 + Ordering::Greater => v2, + 8001d2f8: 02a10f23 sb a0,62(sp) + 8001d2fc: 6542 ld a0,16(sp) + 8001d2fe: ec2a sd a0,24(sp) + match compare(&v1, &v2) { + 8001d300: a801 j 8001d310 <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x50> + 8001d302: 0000 unimp + 8001d304: 4501 li a0,0 + Ordering::Less | Ordering::Equal => v1, + 8001d306: 02a10fa3 sb a0,63(sp) + 8001d30a: 6522 ld a0,8(sp) + 8001d30c: ec2a sd a0,24(sp) + match compare(&v1, &v2) { + 8001d30e: a009 j 8001d310 <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x50> +} + 8001d310: 03e14503 lbu a0,62(sp) + 8001d314: 8905 andi a0,a0,1 + 8001d316: e919 bnez a0,8001d32c <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x6c> + 8001d318: a009 j 8001d31a <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x5a> + 8001d31a: 03f14503 lbu a0,63(sp) + 8001d31e: 8905 andi a0,a0,1 + 8001d320: e519 bnez a0,8001d32e <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x6e> + 8001d322: a009 j 8001d324 <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x64> + 8001d324: 6562 ld a0,24(sp) + 8001d326: 60a6 ld ra,72(sp) + 8001d328: 6161 addi sp,sp,80 + 8001d32a: 8082 ret + 8001d32c: b7fd j 8001d31a <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x5a> + 8001d32e: bfdd j 8001d324 <_ZN4core3cmp6min_by17he5979745ae7a7f64E+0x64> + +Disassembly of section .text._ZN4core4char7convert18from_u32_unchecked17hac286a657ee2c904E: + +000000008001d330 <_ZN4core4char7convert18from_u32_unchecked17hac286a657ee2c904E>: +/// +/// assert_eq!('❤', c); +/// ``` +#[inline] +#[stable(feature = "char_from_unchecked", since = "1.5.0")] +pub unsafe fn from_u32_unchecked(i: u32) -> char { + 8001d330: 1141 addi sp,sp,-16 + 8001d332: c42a sw a0,8(sp) + // SAFETY: the caller must guarantee that `i` is a valid char value. + if cfg!(debug_assertions) { char::from_u32(i).unwrap() } else { unsafe { transmute(i) } } + 8001d334: c62a sw a0,12(sp) + 8001d336: 1502 slli a0,a0,0x20 + 8001d338: 9101 srli a0,a0,0x20 + 8001d33a: e02a sd a0,0(sp) + 8001d33c: a009 j 8001d33e <_ZN4core4char7convert18from_u32_unchecked17hac286a657ee2c904E+0xe> +} + 8001d33e: 6502 ld a0,0(sp) + 8001d340: 0141 addi sp,sp,16 + 8001d342: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator8for_each4call17hfc6c60365ed1f66bE: + +000000008001d344 <_ZN4core4iter6traits8iterator8Iterator8for_each4call17hfc6c60365ed1f66bE>: + fn call(mut f: impl FnMut(T)) -> impl FnMut((), T) { + 8001d344: 1141 addi sp,sp,-16 + } + 8001d346: 0141 addi sp,sp,16 + 8001d348: 8082 ret + +Disassembly of section .text._ZN4core4iter6traits8iterator8Iterator8for_each4call28_$u7b$$u7b$closure$u7d$$u7d$17h486761cc57705d97E: + +000000008001d34a <_ZN4core4iter6traits8iterator8Iterator8for_each4call28_$u7b$$u7b$closure$u7d$$u7d$17h486761cc57705d97E>: + move |(), item| f(item) + 8001d34a: 7139 addi sp,sp,-64 + 8001d34c: fc06 sd ra,56(sp) + 8001d34e: ec2a sd a0,24(sp) + 8001d350: f42e sd a1,40(sp) + 8001d352: f832 sd a2,48(sp) + 8001d354: e42e sd a1,8(sp) + 8001d356: e832 sd a2,16(sp) + 8001d358: fffe8097 auipc ra,0xfffe8 + 8001d35c: 492080e7 jalr 1170(ra) # 800057ea <_ZN6kernel2fs3bio6Bcache5binit28_$u7b$$u7b$closure$u7d$$u7d$17h25f2c34d7a851755E> + 8001d360: a009 j 8001d362 <_ZN4core4iter6traits8iterator8Iterator8for_each4call28_$u7b$$u7b$closure$u7d$$u7d$17h486761cc57705d97E+0x18> + 8001d362: 70e2 ld ra,56(sp) + 8001d364: 6121 addi sp,sp,64 + 8001d366: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc9semaphore9semaphore14semaphore_down17hfc37af6ce552d8edE: + +000000008001d368 <_ZN6kernel3ipc9semaphore9semaphore14semaphore_down17hfc37af6ce552d8edE>: + Self{ + cnt: value, + sem_lock: Spinlock::new((), "sem_lock"), + } + } + pub fn semaphore_down(&mut self){ + 8001d368: 711d addi sp,sp,-96 + 8001d36a: ec86 sd ra,88(sp) + 8001d36c: e82a sd a0,16(sp) + 8001d36e: e4aa sd a0,72(sp) + +000000008001d370 <.LBB0_7>: + println!("semaphore down"); + 8001d370: 0000f597 auipc a1,0xf + 8001d374: 1f858593 addi a1,a1,504 # 8002c568 <.L__unnamed_1> + +000000008001d378 <.LBB0_8>: + 8001d378: 0000f697 auipc a3,0xf + 8001d37c: 20068693 addi a3,a3,512 # 8002c578 <.L__unnamed_20> + 8001d380: 0828 addi a0,sp,24 + 8001d382: 4605 li a2,1 + 8001d384: 4701 li a4,0 + 8001d386: fffe8097 auipc ra,0xfffe8 + 8001d38a: 204080e7 jalr 516(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d38e: a009 j 8001d390 <.LBB0_8+0x18> + 8001d390: 0828 addi a0,sp,24 + 8001d392: 00002097 auipc ra,0x2 + 8001d396: 866080e7 jalr -1946(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d39a: a009 j 8001d39c <.LBB0_8+0x24> + let guard = self.sem_lock.acquire(); + 8001d39c: 6542 ld a0,16(sp) + 8001d39e: ffff4097 auipc ra,0xffff4 + 8001d3a2: ca4080e7 jalr -860(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001d3a6: 85aa mv a1,a0 + 8001d3a8: e42e sd a1,8(sp) + 8001d3aa: e8aa sd a0,80(sp) + 8001d3ac: a009 j 8001d3ae <.LBB0_8+0x36> + self.cnt -= 1; + 8001d3ae: 6542 ld a0,16(sp) + 8001d3b0: 5108 lw a0,32(a0) + 8001d3b2: fff50593 addi a1,a0,-1 + 8001d3b6: e02e sd a1,0(sp) + 8001d3b8: 357d addiw a0,a0,-1 + 8001d3ba: 00b51f63 bne a0,a1,8001d3d8 <.LBB0_9> + 8001d3be: a009 j 8001d3c0 <.LBB0_8+0x48> + 8001d3c0: 6522 ld a0,8(sp) + 8001d3c2: 6582 ld a1,0(sp) + 8001d3c4: 6642 ld a2,16(sp) + 8001d3c6: d20c sw a1,32(a2) + drop(guard); + 8001d3c8: 00001097 auipc ra,0x1 + 8001d3cc: a20080e7 jalr -1504(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001d3d0: a009 j 8001d3d2 <.LBB0_8+0x5a> + } + 8001d3d2: 60e6 ld ra,88(sp) + 8001d3d4: 6125 addi sp,sp,96 + 8001d3d6: 8082 ret + +000000008001d3d8 <.LBB0_9>: + self.cnt -= 1; + 8001d3d8: 0000f517 auipc a0,0xf + 8001d3dc: 1d850513 addi a0,a0,472 # 8002c5b0 + +000000008001d3e0 <.LBB0_10>: + 8001d3e0: 0000f617 auipc a2,0xf + 8001d3e4: 1b060613 addi a2,a2,432 # 8002c590 <.L__unnamed_3> + 8001d3e8: 02100593 li a1,33 + 8001d3ec: 00006097 auipc ra,0x6 + 8001d3f0: d58080e7 jalr -680(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel3ipc9semaphore9semaphore12semaphore_up17h776c4e5603b34918E: + +000000008001d3f6 <_ZN6kernel3ipc9semaphore9semaphore12semaphore_up17h776c4e5603b34918E>: + pub fn semaphore_up(&mut self){ + 8001d3f6: 7179 addi sp,sp,-48 + 8001d3f8: f406 sd ra,40(sp) + 8001d3fa: e42a sd a0,8(sp) + 8001d3fc: ec2a sd a0,24(sp) + let guard = self.sem_lock.acquire(); + 8001d3fe: ffff4097 auipc ra,0xffff4 + 8001d402: c44080e7 jalr -956(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001d406: 85aa mv a1,a0 + 8001d408: e82e sd a1,16(sp) + 8001d40a: f02a sd a0,32(sp) + 8001d40c: a009 j 8001d40e <_ZN6kernel3ipc9semaphore9semaphore12semaphore_up17h776c4e5603b34918E+0x18> + self.cnt += 1; + 8001d40e: 6522 ld a0,8(sp) + 8001d410: 5108 lw a0,32(a0) + 8001d412: 00150593 addi a1,a0,1 + 8001d416: e02e sd a1,0(sp) + 8001d418: 2505 addiw a0,a0,1 + 8001d41a: 00b51f63 bne a0,a1,8001d438 <.LBB1_5> + 8001d41e: a009 j 8001d420 <_ZN6kernel3ipc9semaphore9semaphore12semaphore_up17h776c4e5603b34918E+0x2a> + 8001d420: 6542 ld a0,16(sp) + 8001d422: 6582 ld a1,0(sp) + 8001d424: 6622 ld a2,8(sp) + 8001d426: d20c sw a1,32(a2) + drop(guard); + 8001d428: 00001097 auipc ra,0x1 + 8001d42c: 9c0080e7 jalr -1600(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001d430: a009 j 8001d432 <_ZN6kernel3ipc9semaphore9semaphore12semaphore_up17h776c4e5603b34918E+0x3c> + } + 8001d432: 70a2 ld ra,40(sp) + 8001d434: 6145 addi sp,sp,48 + 8001d436: 8082 ret + +000000008001d438 <.LBB1_5>: + self.cnt += 1; + 8001d438: 0000f517 auipc a0,0xf + 8001d43c: 1b850513 addi a0,a0,440 # 8002c5f0 + +000000008001d440 <.LBB1_6>: + 8001d440: 0000f617 auipc a2,0xf + 8001d444: 19860613 addi a2,a2,408 # 8002c5d8 <.L__unnamed_4> + 8001d448: 45f1 li a1,28 + 8001d44a: 00006097 auipc ra,0x6 + 8001d44e: cfa080e7 jalr -774(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel3ipc9semaphore9semaphore9get_value17ha36354007f7a90a5E: + +000000008001d454 <_ZN6kernel3ipc9semaphore9semaphore9get_value17ha36354007f7a90a5E>: + + pub fn get_value(&self) -> i32{ + 8001d454: 1141 addi sp,sp,-16 + 8001d456: e42a sd a0,8(sp) + self.cnt + } + 8001d458: 5108 lw a0,32(a0) + 8001d45a: 0141 addi sp,sp,16 + 8001d45c: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc9semaphore5sem_t8sem_init17h922a2e9695ae8884E: + +000000008001d45e <_ZN6kernel3ipc9semaphore5sem_t8sem_init17h922a2e9695ae8884E>: + id: -1, + // sem_lock: Spinlock::new(0, "Nope"), + } + } + + pub fn sem_init(&mut self, cnt: i32) -> i32{ + 8001d45e: 7159 addi sp,sp,-112 + 8001d460: f486 sd ra,104(sp) + 8001d462: e82a sd a0,16(sp) + 8001d464: 862e mv a2,a1 + 8001d466: ec32 sd a2,24(sp) + 8001d468: e8aa sd a0,80(sp) + 8001d46a: ceae sw a1,92(sp) + +000000008001d46c <.LBB3_5>: + println!("sem_init in semaphore.rs"); + 8001d46c: 0000f597 auipc a1,0xf + 8001d470: 1bc58593 addi a1,a1,444 # 8002c628 <.L__unnamed_5> + +000000008001d474 <.LBB3_6>: + 8001d474: 0000f697 auipc a3,0xf + 8001d478: 10468693 addi a3,a3,260 # 8002c578 <.L__unnamed_20> + 8001d47c: 1008 addi a0,sp,32 + 8001d47e: 4605 li a2,1 + 8001d480: 4701 li a4,0 + 8001d482: fffe8097 auipc ra,0xfffe8 + 8001d486: 108080e7 jalr 264(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d48a: a009 j 8001d48c <.LBB3_6+0x18> + 8001d48c: 1008 addi a0,sp,32 + 8001d48e: 00001097 auipc ra,0x1 + 8001d492: 76a080e7 jalr 1898(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d496: a009 j 8001d498 <.LBB3_6+0x24> + let sem_guard = self.sem.sem_lock.acquire(); + 8001d498: 6542 ld a0,16(sp) + 8001d49a: ffff4097 auipc ra,0xffff4 + 8001d49e: ba8080e7 jalr -1112(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001d4a2: 85aa mv a1,a0 + 8001d4a4: e42e sd a1,8(sp) + 8001d4a6: f0aa sd a0,96(sp) + 8001d4a8: a009 j 8001d4aa <.LBB3_6+0x36> + self.sem.cnt = cnt; + 8001d4aa: 6522 ld a0,8(sp) + 8001d4ac: 65e2 ld a1,24(sp) + 8001d4ae: 6642 ld a2,16(sp) + 8001d4b0: d20c sw a1,32(a2) + drop(sem_guard); + 8001d4b2: 00001097 auipc ra,0x1 + 8001d4b6: 936080e7 jalr -1738(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001d4ba: a009 j 8001d4bc <.LBB3_6+0x48> + 8001d4bc: 4501 li a0,0 + 0 + } + 8001d4be: 70a6 ld ra,104(sp) + 8001d4c0: 6165 addi sp,sp,112 + 8001d4c2: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc9semaphore5sem_t8sem_down17h0b823d8c0372af65E: + +000000008001d4c4 <_ZN6kernel3ipc9semaphore5sem_t8sem_down17h0b823d8c0372af65E>: + + pub fn sem_down(&mut self){ + 8001d4c4: 7125 addi sp,sp,-416 + 8001d4c6: ef06 sd ra,408(sp) + 8001d4c8: fcaa sd a0,120(sp) + 8001d4ca: f6aa sd a0,360(sp) + 8001d4cc: a009 j 8001d4ce <_ZN6kernel3ipc9semaphore5sem_t8sem_down17h0b823d8c0372af65E+0xa> + while self.sem.get_value() <= 0{ + 8001d4ce: 7566 ld a0,120(sp) + 8001d4d0: 00000097 auipc ra,0x0 + 8001d4d4: f84080e7 jalr -124(ra) # 8001d454 <_ZN6kernel3ipc9semaphore9semaphore9get_value17ha36354007f7a90a5E> + 8001d4d8: 2501 sext.w a0,a0 + 8001d4da: f8aa sd a0,112(sp) + 8001d4dc: a009 j 8001d4de <_ZN6kernel3ipc9semaphore5sem_t8sem_down17h0b823d8c0372af65E+0x1a> + 8001d4de: 7546 ld a0,112(sp) + 8001d4e0: 4585 li a1,1 + 8001d4e2: 02b54363 blt a0,a1,8001d508 <.LBB4_20> + 8001d4e6: a009 j 8001d4e8 <.LBB4_18> + +000000008001d4e8 <.LBB4_18>: + my_proc.sleep( + &self.sem as *const _ as usize, + sem_guard + ); + } + println!("sem down"); + 8001d4e8: 0000f597 auipc a1,0xf + 8001d4ec: 1e058593 addi a1,a1,480 # 8002c6c8 <.L__unnamed_6> + +000000008001d4f0 <.LBB4_19>: + 8001d4f0: 0000f697 auipc a3,0xf + 8001d4f4: 08868693 addi a3,a3,136 # 8002c578 <.L__unnamed_20> + 8001d4f8: 1a28 addi a0,sp,312 + 8001d4fa: 4605 li a2,1 + 8001d4fc: 4701 li a4,0 + 8001d4fe: fffe8097 auipc ra,0xfffe8 + 8001d502: 08c080e7 jalr 140(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d506: a21d j 8001d62c <.LBB4_26+0x38> + +000000008001d508 <.LBB4_20>: + let my_proc = unsafe { CPU_MANAGER.myproc().unwrap() }; + 8001d508: 00049517 auipc a0,0x49 + 8001d50c: c3850513 addi a0,a0,-968 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001d510: ffff5097 auipc ra,0xffff5 + 8001d514: f48080e7 jalr -184(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001d518: f4aa sd a0,104(sp) + 8001d51a: a009 j 8001d51c <.LBB4_20+0x14> + 8001d51c: 7526 ld a0,104(sp) + +000000008001d51e <.LBB4_21>: + 8001d51e: 0000f597 auipc a1,0xf + 8001d522: 11a58593 addi a1,a1,282 # 8002c638 <.L__unnamed_7> + 8001d526: ffff2097 auipc ra,0xffff2 + 8001d52a: 26a080e7 jalr 618(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001d52e: f0aa sd a0,96(sp) + 8001d530: a009 j 8001d532 <.LBB4_21+0x14> + 8001d532: 7566 ld a0,120(sp) + 8001d534: 7586 ld a1,96(sp) + 8001d536: faae sd a1,368(sp) + let sem_guard = self.sem.sem_lock.acquire(); + 8001d538: ffff4097 auipc ra,0xffff4 + 8001d53c: b0a080e7 jalr -1270(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001d540: e12a sd a0,128(sp) + 8001d542: a009 j 8001d544 <.LBB4_21+0x26> + println!("ready to sleep {} {} {} {}", &self.id, &self.sem.cnt, &self.sem as *const _ as usize, &sem_guard as *const _ as usize); + 8001d544: 7566 ld a0,120(sp) + 8001d546: 02850593 addi a1,a0,40 + 8001d54a: ee2e sd a1,280(sp) + 8001d54c: 02050593 addi a1,a0,32 + 8001d550: f22e sd a1,288(sp) + 8001d552: f62a sd a0,296(sp) + 8001d554: 0108 addi a0,sp,128 + 8001d556: fa2a sd a0,304(sp) + 8001d558: 0a28 addi a0,sp,280 + 8001d55a: fdaa sd a0,248(sp) + 8001d55c: 1214 addi a3,sp,288 + 8001d55e: fc36 sd a3,56(sp) + 8001d560: e236 sd a3,256(sp) + 8001d562: 1230 addi a2,sp,296 + 8001d564: e0b2 sd a2,64(sp) + 8001d566: e632 sd a2,264(sp) + 8001d568: 1a0c addi a1,sp,304 + 8001d56a: e4ae sd a1,72(sp) + 8001d56c: ea2e sd a1,272(sp) + 8001d56e: feaa sd a0,376(sp) + 8001d570: e336 sd a3,384(sp) + 8001d572: e732 sd a2,392(sp) + 8001d574: eb2e sd a1,400(sp) + +000000008001d576 <.LBB4_22>: + 8001d576: 00002597 auipc a1,0x2 + 8001d57a: ecc58593 addi a1,a1,-308 # 8001f442 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h3baa88b0b8ed59b0E> + 8001d57e: 00002097 auipc ra,0x2 + 8001d582: f28080e7 jalr -216(ra) # 8001f4a6 <_ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E> + 8001d586: e8aa sd a0,80(sp) + 8001d588: ecae sd a1,88(sp) + 8001d58a: a009 j 8001d58c <.LBB4_22+0x16> + 8001d58c: 7562 ld a0,56(sp) + +000000008001d58e <.LBB4_23>: + 8001d58e: 00002597 auipc a1,0x2 + 8001d592: eb458593 addi a1,a1,-332 # 8001f442 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h3baa88b0b8ed59b0E> + 8001d596: 00002097 auipc ra,0x2 + 8001d59a: f10080e7 jalr -240(ra) # 8001f4a6 <_ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E> + 8001d59e: f42a sd a0,40(sp) + 8001d5a0: f82e sd a1,48(sp) + 8001d5a2: a009 j 8001d5a4 <.LBB4_23+0x16> + 8001d5a4: 6506 ld a0,64(sp) + +000000008001d5a6 <.LBB4_24>: + 8001d5a6: 00008597 auipc a1,0x8 + 8001d5aa: 2fa58593 addi a1,a1,762 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001d5ae: 00003097 auipc ra,0x3 + 8001d5b2: fc0080e7 jalr -64(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001d5b6: ec2a sd a0,24(sp) + 8001d5b8: f02e sd a1,32(sp) + 8001d5ba: a009 j 8001d5bc <.LBB4_24+0x16> + 8001d5bc: 6526 ld a0,72(sp) + +000000008001d5be <.LBB4_25>: + 8001d5be: 00008597 auipc a1,0x8 + 8001d5c2: 2e258593 addi a1,a1,738 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001d5c6: 00003097 auipc ra,0x3 + 8001d5ca: fa8080e7 jalr -88(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001d5ce: e42a sd a0,8(sp) + 8001d5d0: e82e sd a1,16(sp) + 8001d5d2: a009 j 8001d5d4 <.LBB4_25+0x16> + 8001d5d4: 6542 ld a0,16(sp) + 8001d5d6: 65a2 ld a1,8(sp) + 8001d5d8: 7602 ld a2,32(sp) + 8001d5da: 66e2 ld a3,24(sp) + 8001d5dc: 7742 ld a4,48(sp) + 8001d5de: 77a2 ld a5,40(sp) + 8001d5e0: 6866 ld a6,88(sp) + 8001d5e2: 68c6 ld a7,80(sp) + 8001d5e4: fd46 sd a7,184(sp) + 8001d5e6: e1c2 sd a6,192(sp) + 8001d5e8: e5be sd a5,200(sp) + 8001d5ea: e9ba sd a4,208(sp) + 8001d5ec: edb6 sd a3,216(sp) + 8001d5ee: f1b2 sd a2,224(sp) + 8001d5f0: f5ae sd a1,232(sp) + 8001d5f2: f9aa sd a0,240(sp) + +000000008001d5f4 <.LBB4_26>: + 8001d5f4: 0000f597 auipc a1,0xf + 8001d5f8: 07458593 addi a1,a1,116 # 8002c668 <.L__unnamed_8> + 8001d5fc: 0128 addi a0,sp,136 + 8001d5fe: 4615 li a2,5 + 8001d600: 1934 addi a3,sp,184 + 8001d602: 4711 li a4,4 + 8001d604: fffe8097 auipc ra,0xfffe8 + 8001d608: f86080e7 jalr -122(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d60c: a009 j 8001d60e <.LBB4_26+0x1a> + 8001d60e: 0128 addi a0,sp,136 + 8001d610: 00001097 auipc ra,0x1 + 8001d614: 5e8080e7 jalr 1512(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d618: a009 j 8001d61a <.LBB4_26+0x26> + sem_guard + 8001d61a: 75e6 ld a1,120(sp) + 8001d61c: 7506 ld a0,96(sp) + 8001d61e: 660a ld a2,128(sp) + my_proc.sleep( + 8001d620: ffff5097 auipc ra,0xffff5 + 8001d624: c2c080e7 jalr -980(ra) # 8001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E> + 8001d628: a009 j 8001d62a <.LBB4_26+0x36> + while self.sem.get_value() <= 0{ + 8001d62a: b555 j 8001d4ce <_ZN6kernel3ipc9semaphore5sem_t8sem_down17h0b823d8c0372af65E+0xa> + 8001d62c: 1a28 addi a0,sp,312 + println!("sem down"); + 8001d62e: 00001097 auipc ra,0x1 + 8001d632: 5ca080e7 jalr 1482(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d636: a009 j 8001d638 <.LBB4_26+0x44> + self.sem.semaphore_down(); + 8001d638: 7566 ld a0,120(sp) + 8001d63a: 00000097 auipc ra,0x0 + 8001d63e: d2e080e7 jalr -722(ra) # 8001d368 <_ZN6kernel3ipc9semaphore9semaphore14semaphore_down17hfc37af6ce552d8edE> + 8001d642: a009 j 8001d644 <.LBB4_26+0x50> + } + 8001d644: 60fa ld ra,408(sp) + 8001d646: 611d addi sp,sp,416 + 8001d648: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc9semaphore5sem_t6sem_up17hff2b195f2e6585ecE: + +000000008001d64a <_ZN6kernel3ipc9semaphore5sem_t6sem_up17hff2b195f2e6585ecE>: + + pub fn sem_up(&mut self){ + 8001d64a: 7165 addi sp,sp,-400 + 8001d64c: e706 sd ra,392(sp) + 8001d64e: f4aa sd a0,104(sp) + 8001d650: f2aa sd a0,352(sp) + +000000008001d652 <.LBB5_16>: + println!("sem up"); + 8001d652: 0000f597 auipc a1,0xf + 8001d656: 08e58593 addi a1,a1,142 # 8002c6e0 <.L__unnamed_9> + +000000008001d65a <.LBB5_17>: + 8001d65a: 0000f697 auipc a3,0xf + 8001d65e: f1e68693 addi a3,a3,-226 # 8002c578 <.L__unnamed_20> + 8001d662: 18a8 addi a0,sp,120 + 8001d664: 4605 li a2,1 + 8001d666: 4701 li a4,0 + 8001d668: fffe8097 auipc ra,0xfffe8 + 8001d66c: f22080e7 jalr -222(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d670: a009 j 8001d672 <.LBB5_17+0x18> + 8001d672: 18a8 addi a0,sp,120 + 8001d674: 00001097 auipc ra,0x1 + 8001d678: 584080e7 jalr 1412(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d67c: a009 j 8001d67e <.LBB5_17+0x24> + self.sem.semaphore_up(); + 8001d67e: 7526 ld a0,104(sp) + 8001d680: 00000097 auipc ra,0x0 + 8001d684: d76080e7 jalr -650(ra) # 8001d3f6 <_ZN6kernel3ipc9semaphore9semaphore12semaphore_up17h776c4e5603b34918E> + 8001d688: a009 j 8001d68a <.LBB5_17+0x30> + if self.sem.get_value() > 0{ + 8001d68a: 7526 ld a0,104(sp) + 8001d68c: 00000097 auipc ra,0x0 + 8001d690: dc8080e7 jalr -568(ra) # 8001d454 <_ZN6kernel3ipc9semaphore9semaphore9get_value17ha36354007f7a90a5E> + 8001d694: 2501 sext.w a0,a0 + 8001d696: f0aa sd a0,96(sp) + 8001d698: a009 j 8001d69a <.LBB5_17+0x40> + 8001d69a: 7506 ld a0,96(sp) + 8001d69c: 4585 li a1,1 + 8001d69e: 00b54a63 blt a0,a1,8001d6b2 <.LBB5_17+0x58> + 8001d6a2: a009 j 8001d6a4 <.LBB5_17+0x4a> + let sem_guard = self.sem.sem_lock.acquire(); + 8001d6a4: 7526 ld a0,104(sp) + 8001d6a6: ffff4097 auipc ra,0xffff4 + 8001d6aa: 99c080e7 jalr -1636(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001d6ae: f52a sd a0,168(sp) + 8001d6b0: a011 j 8001d6b4 <.LBB5_17+0x5a> + if self.sem.get_value() > 0{ + 8001d6b2: a8e5 j 8001d7aa <.LBB5_23+0x32> + unsafe { + PROC_MANAGER.wake_up(&self.sem as *const _ as usize); + 8001d6b4: 75a6 ld a1,104(sp) + +000000008001d6b6 <.LBB5_18>: + 8001d6b6: 0003c517 auipc a0,0x3c + 8001d6ba: d1a50513 addi a0,a0,-742 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8001d6be: ffff1097 auipc ra,0xffff1 + 8001d6c2: b42080e7 jalr -1214(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8001d6c6: a009 j 8001d6c8 <.LBB5_18+0x12> + } + println!("wake up in semaphore.rs {} {} {} {}", &self.id, &self.sem.cnt, &self.sem as *const _ as usize, &sem_guard as *const _ as usize); + 8001d6c8: 7526 ld a0,104(sp) + 8001d6ca: 02850593 addi a1,a0,40 + 8001d6ce: e2ae sd a1,320(sp) + 8001d6d0: 02050593 addi a1,a0,32 + 8001d6d4: e6ae sd a1,328(sp) + 8001d6d6: eaaa sd a0,336(sp) + 8001d6d8: 1128 addi a0,sp,168 + 8001d6da: eeaa sd a0,344(sp) + 8001d6dc: 0288 addi a0,sp,320 + 8001d6de: f22a sd a0,288(sp) + 8001d6e0: 02b4 addi a3,sp,328 + 8001d6e2: fc36 sd a3,56(sp) + 8001d6e4: f636 sd a3,296(sp) + 8001d6e6: 0a90 addi a2,sp,336 + 8001d6e8: e0b2 sd a2,64(sp) + 8001d6ea: fa32 sd a2,304(sp) + 8001d6ec: 0aac addi a1,sp,344 + 8001d6ee: e4ae sd a1,72(sp) + 8001d6f0: fe2e sd a1,312(sp) + 8001d6f2: f6aa sd a0,360(sp) + 8001d6f4: fab6 sd a3,368(sp) + 8001d6f6: feb2 sd a2,376(sp) + 8001d6f8: e32e sd a1,384(sp) + +000000008001d6fa <.LBB5_19>: + 8001d6fa: 00002597 auipc a1,0x2 + 8001d6fe: d4858593 addi a1,a1,-696 # 8001f442 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h3baa88b0b8ed59b0E> + 8001d702: 00002097 auipc ra,0x2 + 8001d706: da4080e7 jalr -604(ra) # 8001f4a6 <_ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E> + 8001d70a: e8aa sd a0,80(sp) + 8001d70c: ecae sd a1,88(sp) + 8001d70e: a009 j 8001d710 <.LBB5_19+0x16> + 8001d710: 7562 ld a0,56(sp) + +000000008001d712 <.LBB5_20>: + 8001d712: 00002597 auipc a1,0x2 + 8001d716: d3058593 addi a1,a1,-720 # 8001f442 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h3baa88b0b8ed59b0E> + 8001d71a: 00002097 auipc ra,0x2 + 8001d71e: d8c080e7 jalr -628(ra) # 8001f4a6 <_ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E> + 8001d722: f42a sd a0,40(sp) + 8001d724: f82e sd a1,48(sp) + 8001d726: a009 j 8001d728 <.LBB5_20+0x16> + 8001d728: 6506 ld a0,64(sp) + +000000008001d72a <.LBB5_21>: + 8001d72a: 00008597 auipc a1,0x8 + 8001d72e: 17658593 addi a1,a1,374 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001d732: 00003097 auipc ra,0x3 + 8001d736: e3c080e7 jalr -452(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001d73a: ec2a sd a0,24(sp) + 8001d73c: f02e sd a1,32(sp) + 8001d73e: a009 j 8001d740 <.LBB5_21+0x16> + 8001d740: 6526 ld a0,72(sp) + +000000008001d742 <.LBB5_22>: + 8001d742: 00008597 auipc a1,0x8 + 8001d746: 15e58593 addi a1,a1,350 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001d74a: 00003097 auipc ra,0x3 + 8001d74e: e24080e7 jalr -476(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001d752: e42a sd a0,8(sp) + 8001d754: e82e sd a1,16(sp) + 8001d756: a009 j 8001d758 <.LBB5_22+0x16> + 8001d758: 6542 ld a0,16(sp) + 8001d75a: 65a2 ld a1,8(sp) + 8001d75c: 7602 ld a2,32(sp) + 8001d75e: 66e2 ld a3,24(sp) + 8001d760: 7742 ld a4,48(sp) + 8001d762: 77a2 ld a5,40(sp) + 8001d764: 6866 ld a6,88(sp) + 8001d766: 68c6 ld a7,80(sp) + 8001d768: f1c6 sd a7,224(sp) + 8001d76a: f5c2 sd a6,232(sp) + 8001d76c: f9be sd a5,240(sp) + 8001d76e: fdba sd a4,248(sp) + 8001d770: e236 sd a3,256(sp) + 8001d772: e632 sd a2,264(sp) + 8001d774: ea2e sd a1,272(sp) + 8001d776: ee2a sd a0,280(sp) + +000000008001d778 <.LBB5_23>: + 8001d778: 0000f597 auipc a1,0xf + 8001d77c: f9058593 addi a1,a1,-112 # 8002c708 <.L__unnamed_10> + 8001d780: 1908 addi a0,sp,176 + 8001d782: 4615 li a2,5 + 8001d784: 1194 addi a3,sp,224 + 8001d786: 4711 li a4,4 + 8001d788: fffe8097 auipc ra,0xfffe8 + 8001d78c: e02080e7 jalr -510(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d790: a009 j 8001d792 <.LBB5_23+0x1a> + 8001d792: 1908 addi a0,sp,176 + 8001d794: 00001097 auipc ra,0x1 + 8001d798: 464080e7 jalr 1124(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d79c: a009 j 8001d79e <.LBB5_23+0x26> + 8001d79e: 1128 addi a0,sp,168 + // println!("SEM_MANAGER in sem_down {}",unsafe{&SEM_MANAGER.sems as *const _ as usize}); + } + 8001d7a0: fffea097 auipc ra,0xfffea + 8001d7a4: 9b6080e7 jalr -1610(ra) # 80007156 <_ZN4core3ptr74drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$LP$$RP$$GT$$GT$17he568be727488c8bbE> + 8001d7a8: a009 j 8001d7aa <.LBB5_23+0x32> + } + 8001d7aa: 60ba ld ra,392(sp) + 8001d7ac: 6159 addi sp,sp,400 + 8001d7ae: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc9semaphore8SemTable5alloc17he7093796e56d9652E: + +000000008001d7b0 <_ZN6kernel3ipc9semaphore8SemTable5alloc17he7093796e56d9652E>: + // Self{ + // sems: semsTmp, + // st_lock: Spinlock::new((), "st_lock") + // } + } + pub fn alloc(&mut self) -> i32{ + 8001d7b0: 712d addi sp,sp,-288 + 8001d7b2: ee06 sd ra,280(sp) + 8001d7b4: e4aa sd a0,72(sp) + 8001d7b6: f5aa sd a0,232(sp) + +000000008001d7b8 <.LBB6_21>: + println!("sem alloc"); + 8001d7b8: 0000f597 auipc a1,0xf + 8001d7bc: fb858593 addi a1,a1,-72 # 8002c770 <.L__unnamed_11> + +000000008001d7c0 <.LBB6_22>: + 8001d7c0: 0000f697 auipc a3,0xf + 8001d7c4: db868693 addi a3,a3,-584 # 8002c578 <.L__unnamed_20> + 8001d7c8: 08a8 addi a0,sp,88 + 8001d7ca: 4605 li a2,1 + 8001d7cc: 4701 li a4,0 + 8001d7ce: fffe8097 auipc ra,0xfffe8 + 8001d7d2: dbc080e7 jalr -580(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d7d6: a009 j 8001d7d8 <.LBB6_22+0x18> + 8001d7d8: 08a8 addi a0,sp,88 + 8001d7da: 00001097 auipc ra,0x1 + 8001d7de: 41e080e7 jalr 1054(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d7e2: a009 j 8001d7e4 <.LBB6_22+0x24> + 8001d7e4: 6526 ld a0,72(sp) + 8001d7e6: 6589 lui a1,0x2 + 8001d7e8: 8005859b addiw a1,a1,-2048 + let st_guard = self.st_lock.acquire(); + 8001d7ec: 952e add a0,a0,a1 + 8001d7ee: ffff4097 auipc ra,0xffff4 + 8001d7f2: 854080e7 jalr -1964(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001d7f6: 85aa mv a1,a0 + 8001d7f8: e0ae sd a1,64(sp) + 8001d7fa: f9aa sd a0,240(sp) + 8001d7fc: a009 j 8001d7fe <.LBB6_22+0x3e> + 8001d7fe: 6526 ld a0,72(sp) + 8001d800: 4581 li a1,0 + let mut resId = 0; + 8001d802: caae sw a1,84(sp) + 8001d804: 08000593 li a1,128 + for sem in self.sems.iter_mut(){ + 8001d808: 00001097 auipc ra,0x1 + 8001d80c: e64080e7 jalr -412(ra) # 8001e66c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hdf73a8173be099ebE> + 8001d810: f82a sd a0,48(sp) + 8001d812: fc2e sd a1,56(sp) + 8001d814: a009 j 8001d816 <.LBB6_22+0x56> + 8001d816: 75e2 ld a1,56(sp) + 8001d818: 7542 ld a0,48(sp) + 8001d81a: fffee097 auipc ra,0xfffee + 8001d81e: 0ba080e7 jalr 186(ra) # 8000b8d4 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17had1f1a546667c559E> + 8001d822: f02a sd a0,32(sp) + 8001d824: f42e sd a1,40(sp) + 8001d826: a009 j 8001d828 <.LBB6_22+0x68> + 8001d828: 7522 ld a0,40(sp) + 8001d82a: 7582 ld a1,32(sp) + 8001d82c: e52e sd a1,136(sp) + 8001d82e: e92a sd a0,144(sp) + 8001d830: a009 j 8001d832 <.LBB6_22+0x72> + 8001d832: 0128 addi a0,sp,136 + 8001d834: fffee097 auipc ra,0xfffee + 8001d838: 4f8080e7 jalr 1272(ra) # 8000bd2c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE> + 8001d83c: ed2a sd a0,152(sp) + 8001d83e: a009 j 8001d840 <.LBB6_22+0x80> + 8001d840: 656a ld a0,152(sp) + 8001d842: 00a035b3 snez a1,a0 + 8001d846: 4581 li a1,0 + 8001d848: 00b50463 beq a0,a1,8001d850 <.LBB6_22+0x90> + 8001d84c: a009 j 8001d84e <.LBB6_22+0x8e> + 8001d84e: a019 j 8001d854 <.LBB6_22+0x94> + 8001d850: a045 j 8001d8f0 <.LBB6_24+0x28> + 8001d852: 0000 unimp + 8001d854: 656a ld a0,152(sp) + 8001d856: ec2a sd a0,24(sp) + 8001d858: fdaa sd a0,248(sp) + 8001d85a: e22a sd a0,256(sp) + 8001d85c: e62a sd a0,264(sp) + if sem.used == false{ + 8001d85e: 02c54503 lbu a0,44(a0) + 8001d862: 8905 andi a0,a0,1 + 8001d864: e115 bnez a0,8001d888 <.LBB6_22+0xc8> + 8001d866: a009 j 8001d868 <.LBB6_22+0xa8> + 8001d868: 6662 ld a2,24(sp) + 8001d86a: 6526 ld a0,72(sp) + 8001d86c: 6589 lui a1,0x2 + 8001d86e: 8205859b addiw a1,a1,-2016 + sem.id = self.semID; + 8001d872: 952e add a0,a0,a1 + 8001d874: 410c lw a1,0(a0) + 8001d876: d60c sw a1,40(a2) + self.semID += 1; + 8001d878: 4108 lw a0,0(a0) + 8001d87a: 00150593 addi a1,a0,1 + 8001d87e: e82e sd a1,16(sp) + 8001d880: 2505 addiw a0,a0,1 + 8001d882: 08b51163 bne a0,a1,8001d904 <.LBB6_25> + 8001d886: a011 j 8001d88a <.LBB6_22+0xca> + for sem in self.sems.iter_mut(){ + 8001d888: b76d j 8001d832 <.LBB6_22+0x72> + 8001d88a: 65e2 ld a1,24(sp) + 8001d88c: 6542 ld a0,16(sp) + 8001d88e: 6626 ld a2,72(sp) + 8001d890: 6689 lui a3,0x2 + 8001d892: 8206869b addiw a3,a3,-2016 + self.semID += 1; + 8001d896: 9636 add a2,a2,a3 + 8001d898: c208 sw a0,0(a2) + resId = sem.id; + 8001d89a: 5588 lw a0,40(a1) + 8001d89c: caaa sw a0,84(sp) + 8001d89e: 4505 li a0,1 + sem.used = true; + 8001d8a0: 02a58623 sb a0,44(a1) # 202c <.Lline_table_start0+0x2d0> + 8001d8a4: 08c8 addi a0,sp,84 + + println!("alloc in semaphore.rs, find one unused {}", resId); + 8001d8a6: f1aa sd a0,224(sp) + 8001d8a8: ea2a sd a0,272(sp) + +000000008001d8aa <.LBB6_23>: + 8001d8aa: 00008597 auipc a1,0x8 + 8001d8ae: c5e58593 addi a1,a1,-930 # 80025508 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h1b385cecfac82c6bE> + 8001d8b2: 00002097 auipc ra,0x2 + 8001d8b6: c38080e7 jalr -968(ra) # 8001f4ea <_ZN4core3fmt10ArgumentV13new17h64cb168c9af0caf2E> + 8001d8ba: e02a sd a0,0(sp) + 8001d8bc: e42e sd a1,8(sp) + 8001d8be: a009 j 8001d8c0 <.LBB6_23+0x16> + 8001d8c0: 6522 ld a0,8(sp) + 8001d8c2: 6582 ld a1,0(sp) + 8001d8c4: e9ae sd a1,208(sp) + 8001d8c6: edaa sd a0,216(sp) + +000000008001d8c8 <.LBB6_24>: + 8001d8c8: 0000f597 auipc a1,0xf + 8001d8cc: ef858593 addi a1,a1,-264 # 8002c7c0 <.L__unnamed_12> + 8001d8d0: 1108 addi a0,sp,160 + 8001d8d2: 4609 li a2,2 + 8001d8d4: 0994 addi a3,sp,208 + 8001d8d6: 4705 li a4,1 + 8001d8d8: fffe8097 auipc ra,0xfffe8 + 8001d8dc: cb2080e7 jalr -846(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d8e0: a009 j 8001d8e2 <.LBB6_24+0x1a> + 8001d8e2: 1108 addi a0,sp,160 + 8001d8e4: 00001097 auipc ra,0x1 + 8001d8e8: 314080e7 jalr 788(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d8ec: a009 j 8001d8ee <.LBB6_24+0x26> + 8001d8ee: a009 j 8001d8f0 <.LBB6_24+0x28> + break; + } + } + drop(st_guard); + 8001d8f0: 6506 ld a0,64(sp) + 8001d8f2: 00000097 auipc ra,0x0 + 8001d8f6: 4f6080e7 jalr 1270(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001d8fa: a009 j 8001d8fc <.LBB6_24+0x34> + resId + } + 8001d8fc: 4556 lw a0,84(sp) + 8001d8fe: 60f2 ld ra,280(sp) + 8001d900: 6115 addi sp,sp,288 + 8001d902: 8082 ret + +000000008001d904 <.LBB6_25>: + self.semID += 1; + 8001d904: 0000f517 auipc a0,0xf + 8001d908: cec50513 addi a0,a0,-788 # 8002c5f0 + +000000008001d90c <.LBB6_26>: + 8001d90c: 0000f617 auipc a2,0xf + 8001d910: e7460613 addi a2,a2,-396 # 8002c780 <.L__unnamed_13> + 8001d914: 45f1 li a1,28 + 8001d916: 00006097 auipc ra,0x6 + 8001d91a: 82e080e7 jalr -2002(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel3ipc9semaphore8SemTable3get17h969ea55db514a2ceE: + +000000008001d920 <_ZN6kernel3ipc9semaphore8SemTable3get17h969ea55db514a2ceE>: + + pub fn get(&mut self, id: i32) -> i32{ + 8001d920: 712d addi sp,sp,-288 + 8001d922: ee06 sd ra,280(sp) + 8001d924: 862a mv a2,a0 + 8001d926: fc32 sd a2,56(sp) + 8001d928: 0005851b sext.w a0,a1 + 8001d92c: 86ae mv a3,a1 + 8001d92e: e0b6 sd a3,64(sp) + 8001d930: f5b2 sd a2,232(sp) + 8001d932: dbae sw a1,244(sp) + 8001d934: 55fd li a1,-1 + + if id == -1{ + 8001d936: 02b51363 bne a0,a1,8001d95c <.LBB7_21+0x18> + 8001d93a: a009 j 8001d93c <.LBB7_20> + +000000008001d93c <.LBB7_20>: + println!("sem alloc in semaphore.rs"); + 8001d93c: 0000f597 auipc a1,0xf + 8001d940: efc58593 addi a1,a1,-260 # 8002c838 <.L__unnamed_14> + +000000008001d944 <.LBB7_21>: + 8001d944: 0000f697 auipc a3,0xf + 8001d948: c3468693 addi a3,a3,-972 # 8002c578 <.L__unnamed_20> + 8001d94c: 0888 addi a0,sp,80 + 8001d94e: 4605 li a2,1 + 8001d950: 4701 li a4,0 + 8001d952: fffe8097 auipc ra,0xfffe8 + 8001d956: c38080e7 jalr -968(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001d95a: a839 j 8001d978 <.LBB7_21+0x34> + 8001d95c: 7562 ld a0,56(sp) + 8001d95e: 4585 li a1,1 + 8001d960: 1582 slli a1,a1,0x20 + 8001d962: 15fd addi a1,a1,-1 + self.alloc() + }else{ + let mut res = -1; + 8001d964: c32e sw a1,132(sp) + 8001d966: 08000593 li a1,128 + for sem in self.sems.iter_mut(){ + 8001d96a: 00001097 auipc ra,0x1 + 8001d96e: d02080e7 jalr -766(ra) # 8001e66c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hdf73a8173be099ebE> + 8001d972: f42a sd a0,40(sp) + 8001d974: f82e sd a1,48(sp) + 8001d976: a831 j 8001d992 <.LBB7_21+0x4e> + 8001d978: 0888 addi a0,sp,80 + println!("sem alloc in semaphore.rs"); + 8001d97a: 00001097 auipc ra,0x1 + 8001d97e: 27e080e7 jalr 638(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001d982: a009 j 8001d984 <.LBB7_21+0x40> + self.alloc() + 8001d984: 7562 ld a0,56(sp) + 8001d986: 00000097 auipc ra,0x0 + 8001d98a: e2a080e7 jalr -470(ra) # 8001d7b0 <_ZN6kernel3ipc9semaphore8SemTable5alloc17he7093796e56d9652E> + 8001d98e: c6aa sw a0,76(sp) + 8001d990: a075 j 8001da3c <.LBB7_23+0x2c> + for sem in self.sems.iter_mut(){ + 8001d992: 75c2 ld a1,48(sp) + 8001d994: 7522 ld a0,40(sp) + 8001d996: fffee097 auipc ra,0xfffee + 8001d99a: f3e080e7 jalr -194(ra) # 8000b8d4 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17had1f1a546667c559E> + 8001d99e: ec2a sd a0,24(sp) + 8001d9a0: f02e sd a1,32(sp) + 8001d9a2: a009 j 8001d9a4 <.LBB7_21+0x60> + 8001d9a4: 7502 ld a0,32(sp) + 8001d9a6: 65e2 ld a1,24(sp) + 8001d9a8: e52e sd a1,136(sp) + 8001d9aa: e92a sd a0,144(sp) + 8001d9ac: a009 j 8001d9ae <.LBB7_21+0x6a> + 8001d9ae: 0128 addi a0,sp,136 + 8001d9b0: fffee097 auipc ra,0xfffee + 8001d9b4: 37c080e7 jalr 892(ra) # 8000bd2c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE> + 8001d9b8: ed2a sd a0,152(sp) + 8001d9ba: a009 j 8001d9bc <.LBB7_21+0x78> + 8001d9bc: 656a ld a0,152(sp) + 8001d9be: 00a035b3 snez a1,a0 + 8001d9c2: 4581 li a1,0 + 8001d9c4: 00b50463 beq a0,a1,8001d9cc <.LBB7_21+0x88> + 8001d9c8: a009 j 8001d9ca <.LBB7_21+0x86> + 8001d9ca: a005 j 8001d9ea <.LBB7_22+0x18> + 8001d9cc: 0148 addi a0,sp,132 + if sem.id == id{ + res = id; + } + } + println!("sem get in semaphore.rs {}", res); + 8001d9ce: f1aa sd a0,224(sp) + 8001d9d0: ea2a sd a0,272(sp) + +000000008001d9d2 <.LBB7_22>: + 8001d9d2: 00008597 auipc a1,0x8 + 8001d9d6: b3658593 addi a1,a1,-1226 # 80025508 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h1b385cecfac82c6bE> + 8001d9da: 00002097 auipc ra,0x2 + 8001d9de: b10080e7 jalr -1264(ra) # 8001f4ea <_ZN4core3fmt10ArgumentV13new17h64cb168c9af0caf2E> + 8001d9e2: e42a sd a0,8(sp) + 8001d9e4: e82e sd a1,16(sp) + 8001d9e6: a00d j 8001da08 <.LBB7_22+0x36> + for sem in self.sems.iter_mut(){ + 8001d9e8: 0000 unimp + 8001d9ea: 6586 ld a1,64(sp) + 8001d9ec: 656a ld a0,152(sp) + 8001d9ee: fdaa sd a0,248(sp) + 8001d9f0: e22a sd a0,256(sp) + 8001d9f2: e62a sd a0,264(sp) + if sem.id == id{ + 8001d9f4: 5508 lw a0,40(a0) + 8001d9f6: 2581 sext.w a1,a1 + 8001d9f8: 00b51663 bne a0,a1,8001da04 <.LBB7_22+0x32> + 8001d9fc: a009 j 8001d9fe <.LBB7_22+0x2c> + res = id; + 8001d9fe: 6506 ld a0,64(sp) + 8001da00: c32a sw a0,132(sp) + if sem.id == id{ + 8001da02: a011 j 8001da06 <.LBB7_22+0x34> + 8001da04: a009 j 8001da06 <.LBB7_22+0x34> + for sem in self.sems.iter_mut(){ + 8001da06: b765 j 8001d9ae <.LBB7_21+0x6a> + println!("sem get in semaphore.rs {}", res); + 8001da08: 6542 ld a0,16(sp) + 8001da0a: 65a2 ld a1,8(sp) + 8001da0c: e9ae sd a1,208(sp) + 8001da0e: edaa sd a0,216(sp) + +000000008001da10 <.LBB7_23>: + 8001da10: 0000f597 auipc a1,0xf + 8001da14: de858593 addi a1,a1,-536 # 8002c7f8 <.L__unnamed_15> + 8001da18: 1108 addi a0,sp,160 + 8001da1a: 4609 li a2,2 + 8001da1c: 0994 addi a3,sp,208 + 8001da1e: 4705 li a4,1 + 8001da20: fffe8097 auipc ra,0xfffe8 + 8001da24: b6a080e7 jalr -1174(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001da28: a009 j 8001da2a <.LBB7_23+0x1a> + 8001da2a: 1108 addi a0,sp,160 + 8001da2c: 00001097 auipc ra,0x1 + 8001da30: 1cc080e7 jalr 460(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001da34: a009 j 8001da36 <.LBB7_23+0x26> + res + 8001da36: 451a lw a0,132(sp) + 8001da38: c6aa sw a0,76(sp) + if id == -1{ + 8001da3a: a009 j 8001da3c <.LBB7_23+0x2c> + } + } + 8001da3c: 4536 lw a0,76(sp) + 8001da3e: 60f2 ld ra,280(sp) + 8001da40: 6115 addi sp,sp,288 + 8001da42: 8082 ret + +Disassembly of section .text._ZN6kernel3ipc9semaphore8SemTable3put17hf81380ccacc98283E: + +000000008001da44 <_ZN6kernel3ipc9semaphore8SemTable3put17hf81380ccacc98283E>: + + pub fn put(&mut self, id: i32) -> i32{ + 8001da44: 7131 addi sp,sp,-192 + 8001da46: fd06 sd ra,184(sp) + 8001da48: f82a sd a0,48(sp) + 8001da4a: 862e mv a2,a1 + 8001da4c: fc32 sd a2,56(sp) + 8001da4e: e92a sd a0,144(sp) + 8001da50: cf2e sw a1,156(sp) + +000000008001da52 <.LBB8_14>: + println!("sem put"); + 8001da52: 0000f597 auipc a1,0xf + 8001da56: df658593 addi a1,a1,-522 # 8002c848 <.L__unnamed_16> + +000000008001da5a <.LBB8_15>: + 8001da5a: 0000f697 auipc a3,0xf + 8001da5e: b1e68693 addi a3,a3,-1250 # 8002c578 <.L__unnamed_20> + 8001da62: 00a8 addi a0,sp,72 + 8001da64: 4605 li a2,1 + 8001da66: 4701 li a4,0 + 8001da68: fffe8097 auipc ra,0xfffe8 + 8001da6c: b22080e7 jalr -1246(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001da70: a009 j 8001da72 <.LBB8_15+0x18> + 8001da72: 00a8 addi a0,sp,72 + 8001da74: 00001097 auipc ra,0x1 + 8001da78: 184080e7 jalr 388(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001da7c: a009 j 8001da7e <.LBB8_15+0x24> + 8001da7e: 7542 ld a0,48(sp) + 8001da80: 4585 li a1,1 + 8001da82: 1582 slli a1,a1,0x20 + 8001da84: 15fd addi a1,a1,-1 + let mut res = -1; + 8001da86: c2ae sw a1,68(sp) + 8001da88: 08000593 li a1,128 + for sem in self.sems.iter_mut(){ + 8001da8c: 00001097 auipc ra,0x1 + 8001da90: be0080e7 jalr -1056(ra) # 8001e66c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hdf73a8173be099ebE> + 8001da94: f02a sd a0,32(sp) + 8001da96: f42e sd a1,40(sp) + 8001da98: a009 j 8001da9a <.LBB8_15+0x40> + 8001da9a: 75a2 ld a1,40(sp) + 8001da9c: 7502 ld a0,32(sp) + 8001da9e: fffee097 auipc ra,0xfffee + 8001daa2: e36080e7 jalr -458(ra) # 8000b8d4 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17had1f1a546667c559E> + 8001daa6: e82a sd a0,16(sp) + 8001daa8: ec2e sd a1,24(sp) + 8001daaa: a009 j 8001daac <.LBB8_15+0x52> + 8001daac: 6562 ld a0,24(sp) + 8001daae: 65c2 ld a1,16(sp) + 8001dab0: fcae sd a1,120(sp) + 8001dab2: e12a sd a0,128(sp) + 8001dab4: a009 j 8001dab6 <.LBB8_15+0x5c> + 8001dab6: 18a8 addi a0,sp,120 + 8001dab8: fffee097 auipc ra,0xfffee + 8001dabc: 274080e7 jalr 628(ra) # 8000bd2c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE> + 8001dac0: e52a sd a0,136(sp) + 8001dac2: a009 j 8001dac4 <.LBB8_15+0x6a> + 8001dac4: 652a ld a0,136(sp) + 8001dac6: 00a035b3 snez a1,a0 + 8001daca: 4581 li a1,0 + 8001dacc: 00b50463 beq a0,a1,8001dad4 <.LBB8_15+0x7a> + 8001dad0: a009 j 8001dad2 <.LBB8_15+0x78> + 8001dad2: a031 j 8001dade <.LBB8_15+0x84> + sem.used = false; + res = 0; + } + } + res + } + 8001dad4: 4516 lw a0,68(sp) + 8001dad6: 70ea ld ra,184(sp) + 8001dad8: 6129 addi sp,sp,192 + 8001dada: 8082 ret + for sem in self.sems.iter_mut(){ + 8001dadc: 0000 unimp + 8001dade: 75e2 ld a1,56(sp) + 8001dae0: 652a ld a0,136(sp) + 8001dae2: e42a sd a0,8(sp) + 8001dae4: f12a sd a0,160(sp) + 8001dae6: f52a sd a0,168(sp) + 8001dae8: f92a sd a0,176(sp) + if sem.id == id{ + 8001daea: 5508 lw a0,40(a0) + 8001daec: 2581 sext.w a1,a1 + 8001daee: 00b51963 bne a0,a1,8001db00 <.LBB8_15+0xa6> + 8001daf2: a009 j 8001daf4 <.LBB8_15+0x9a> + 8001daf4: 65a2 ld a1,8(sp) + 8001daf6: 4501 li a0,0 + sem.used = false; + 8001daf8: 02a58623 sb a0,44(a1) + res = 0; + 8001dafc: c2aa sw a0,68(sp) + if sem.id == id{ + 8001dafe: a011 j 8001db02 <.LBB8_15+0xa8> + 8001db00: a009 j 8001db02 <.LBB8_15+0xa8> + for sem in self.sems.iter_mut(){ + 8001db02: bf55 j 8001dab6 <.LBB8_15+0x5c> + +Disassembly of section .text._ZN6kernel3ipc9semaphore8SemTable10getSemById17hc45b63cab7252ea2E: + +000000008001db04 <_ZN6kernel3ipc9semaphore8SemTable10getSemById17hc45b63cab7252ea2E>: + + pub fn getSemById(&mut self, id: i32) -> Option<&mut sem_t>{ + 8001db04: 716d addi sp,sp,-272 + 8001db06: e606 sd ra,264(sp) + 8001db08: fc2a sd a0,56(sp) + 8001db0a: c2ae sw a1,68(sp) + 8001db0c: f1aa sd a0,224(sp) + +000000008001db0e <.LBB9_17>: + println!("sem find"); + 8001db0e: 0000f597 auipc a1,0xf + 8001db12: d5a58593 addi a1,a1,-678 # 8002c868 <.L__unnamed_17> + +000000008001db16 <.LBB9_18>: + 8001db16: 0000f697 auipc a3,0xf + 8001db1a: a6268693 addi a3,a3,-1438 # 8002c578 <.L__unnamed_20> + 8001db1e: 0888 addi a0,sp,80 + 8001db20: 4605 li a2,1 + 8001db22: 4701 li a4,0 + 8001db24: fffe8097 auipc ra,0xfffe8 + 8001db28: a66080e7 jalr -1434(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001db2c: a009 j 8001db2e <.LBB9_18+0x18> + 8001db2e: 0888 addi a0,sp,80 + 8001db30: 00001097 auipc ra,0x1 + 8001db34: 0c8080e7 jalr 200(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001db38: a009 j 8001db3a <.LBB9_18+0x24> + // let mut semRes: &mut sem_t; + for sem in self.sems.iter_mut(){ + 8001db3a: 7562 ld a0,56(sp) + 8001db3c: 08000593 li a1,128 + 8001db40: 00001097 auipc ra,0x1 + 8001db44: b2c080e7 jalr -1236(ra) # 8001e66c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hdf73a8173be099ebE> + 8001db48: f42a sd a0,40(sp) + 8001db4a: f82e sd a1,48(sp) + 8001db4c: a009 j 8001db4e <.LBB9_18+0x38> + 8001db4e: 75c2 ld a1,48(sp) + 8001db50: 7522 ld a0,40(sp) + 8001db52: fffee097 auipc ra,0xfffee + 8001db56: d82080e7 jalr -638(ra) # 8000b8d4 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17had1f1a546667c559E> + 8001db5a: ec2a sd a0,24(sp) + 8001db5c: f02e sd a1,32(sp) + 8001db5e: a009 j 8001db60 <.LBB9_18+0x4a> + 8001db60: 7502 ld a0,32(sp) + 8001db62: 65e2 ld a1,24(sp) + 8001db64: e12e sd a1,128(sp) + 8001db66: e52a sd a0,136(sp) + 8001db68: a009 j 8001db6a <.LBB9_18+0x54> + 8001db6a: 0108 addi a0,sp,128 + 8001db6c: fffee097 auipc ra,0xfffee + 8001db70: 1c0080e7 jalr 448(ra) # 8000bd2c <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17he7c6aa33b7e64d1cE> + 8001db74: e92a sd a0,144(sp) + 8001db76: a009 j 8001db78 <.LBB9_18+0x62> + 8001db78: 654a ld a0,144(sp) + 8001db7a: 00a035b3 snez a1,a0 + 8001db7e: 4581 li a1,0 + 8001db80: 00b50463 beq a0,a1,8001db88 <.LBB9_18+0x72> + 8001db84: a009 j 8001db86 <.LBB9_18+0x70> + 8001db86: a029 j 8001db90 <.LBB9_18+0x7a> + 8001db88: 4501 li a0,0 + if sem.id == id{ + println!("sem find !!!!{}", id); + return Some(sem) + } + } + None + 8001db8a: e4aa sd a0,72(sp) + } + 8001db8c: a0ad j 8001dbf6 <.LBB9_20+0x2c> + for sem in self.sems.iter_mut(){ + 8001db8e: 0000 unimp + 8001db90: 654a ld a0,144(sp) + 8001db92: e82a sd a0,16(sp) + 8001db94: f5aa sd a0,232(sp) + 8001db96: f9aa sd a0,240(sp) + 8001db98: fdaa sd a0,248(sp) + if sem.id == id{ + 8001db9a: 5508 lw a0,40(a0) + 8001db9c: 4596 lw a1,68(sp) + 8001db9e: 02b51163 bne a0,a1,8001dbc0 <.LBB9_19+0x16> + 8001dba2: a009 j 8001dba4 <.LBB9_18+0x8e> + 8001dba4: 00c8 addi a0,sp,68 + println!("sem find !!!!{}", id); + 8001dba6: edaa sd a0,216(sp) + 8001dba8: e22a sd a0,256(sp) + +000000008001dbaa <.LBB9_19>: + 8001dbaa: 00008597 auipc a1,0x8 + 8001dbae: 95e58593 addi a1,a1,-1698 # 80025508 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h1b385cecfac82c6bE> + 8001dbb2: 00002097 auipc ra,0x2 + 8001dbb6: 938080e7 jalr -1736(ra) # 8001f4ea <_ZN4core3fmt10ArgumentV13new17h64cb168c9af0caf2E> + 8001dbba: e02a sd a0,0(sp) + 8001dbbc: e42e sd a1,8(sp) + 8001dbbe: a011 j 8001dbc2 <.LBB9_19+0x18> + for sem in self.sems.iter_mut(){ + 8001dbc0: b76d j 8001db6a <.LBB9_18+0x54> + println!("sem find !!!!{}", id); + 8001dbc2: 6522 ld a0,8(sp) + 8001dbc4: 6582 ld a1,0(sp) + 8001dbc6: e5ae sd a1,200(sp) + 8001dbc8: e9aa sd a0,208(sp) + +000000008001dbca <.LBB9_20>: + 8001dbca: 0000f597 auipc a1,0xf + 8001dbce: cbe58593 addi a1,a1,-834 # 8002c888 <.L__unnamed_18> + 8001dbd2: 0928 addi a0,sp,152 + 8001dbd4: 4609 li a2,2 + 8001dbd6: 01b4 addi a3,sp,200 + 8001dbd8: 4705 li a4,1 + 8001dbda: fffe8097 auipc ra,0xfffe8 + 8001dbde: 9b0080e7 jalr -1616(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001dbe2: a009 j 8001dbe4 <.LBB9_20+0x1a> + 8001dbe4: 0928 addi a0,sp,152 + 8001dbe6: 00001097 auipc ra,0x1 + 8001dbea: 012080e7 jalr 18(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001dbee: a009 j 8001dbf0 <.LBB9_20+0x26> + return Some(sem) + 8001dbf0: 6542 ld a0,16(sp) + 8001dbf2: e4aa sd a0,72(sp) + } + 8001dbf4: a009 j 8001dbf6 <.LBB9_20+0x2c> + 8001dbf6: 6526 ld a0,72(sp) + 8001dbf8: 60b2 ld ra,264(sp) + 8001dbfa: 6151 addi sp,sp,272 + 8001dbfc: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hc0b1197304dd53e6E: + +000000008001dbfe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hc0b1197304dd53e6E>: + pub const fn as_ptr(&self) -> *const T { + 8001dbfe: 1141 addi sp,sp,-16 + 8001dc00: e02a sd a0,0(sp) + 8001dc02: e42e sd a1,8(sp) + } + 8001dc04: 0141 addi sp,sp,16 + 8001dc06: 8082 ret + +Disassembly of section .text._ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E: + +000000008001dc08 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E>: + I: Iterator, +{ + type Item = I::Item; + + #[inline] + fn next(&mut self) -> Option { + 8001dc08: 1101 addi sp,sp,-32 + 8001dc0a: ec06 sd ra,24(sp) + 8001dc0c: e02a sd a0,0(sp) + 8001dc0e: e82a sd a0,16(sp) + if self.first_take { + 8001dc10: 01054503 lbu a0,16(a0) + 8001dc14: 8905 andi a0,a0,1 + 8001dc16: 4581 li a1,0 + 8001dc18: 00b50f63 beq a0,a1,8001dc36 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E+0x2e> + 8001dc1c: a009 j 8001dc1e <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E+0x16> + 8001dc1e: 6502 ld a0,0(sp) + 8001dc20: 4581 li a1,0 + self.first_take = false; + 8001dc22: 00b50823 sb a1,16(a0) + self.iter.next() + 8001dc26: 0521 addi a0,a0,8 + 8001dc28: fffee097 auipc ra,0xfffee + 8001dc2c: 5be080e7 jalr 1470(ra) # 8000c1e6 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17he2f0092c6efc86cdE> + 8001dc30: c42a sw a0,8(sp) + 8001dc32: c62e sw a1,12(sp) + 8001dc34: a821 j 8001dc4c <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E+0x44> + } else { + self.iter.nth(self.step) + 8001dc36: 6582 ld a1,0(sp) + 8001dc38: 00858513 addi a0,a1,8 + 8001dc3c: 618c ld a1,0(a1) + 8001dc3e: fffee097 auipc ra,0xfffee + 8001dc42: 442080e7 jalr 1090(ra) # 8000c080 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h3de1e189a1a61c83E> + 8001dc46: c42a sw a0,8(sp) + 8001dc48: c62e sw a1,12(sp) + 8001dc4a: a011 j 8001dc4e <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E+0x46> + if self.first_take { + 8001dc4c: a011 j 8001dc50 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E+0x48> + 8001dc4e: a009 j 8001dc50 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h04f2168711040ee1E+0x48> + } + } + 8001dc50: 4522 lw a0,8(sp) + 8001dc52: 45b2 lw a1,12(sp) + 8001dc54: 60e2 ld ra,24(sp) + 8001dc56: 6105 addi sp,sp,32 + 8001dc58: 8082 ret + +Disassembly of section .text._ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E: + +000000008001dc5a <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E>: + fn next(&mut self) -> Option { + 8001dc5a: 7179 addi sp,sp,-48 + 8001dc5c: f406 sd ra,40(sp) + 8001dc5e: e42a sd a0,8(sp) + 8001dc60: f02a sd a0,32(sp) + if self.first_take { + 8001dc62: 01854503 lbu a0,24(a0) + 8001dc66: 8905 andi a0,a0,1 + 8001dc68: 4581 li a1,0 + 8001dc6a: 00b50e63 beq a0,a1,8001dc86 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E+0x2c> + 8001dc6e: a009 j 8001dc70 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E+0x16> + 8001dc70: 6522 ld a0,8(sp) + 8001dc72: 4581 li a1,0 + self.first_take = false; + 8001dc74: 00b50c23 sb a1,24(a0) + self.iter.next() + 8001dc78: 00003097 auipc ra,0x3 + 8001dc7c: b2a080e7 jalr -1238(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001dc80: e82a sd a0,16(sp) + 8001dc82: ec2e sd a1,24(sp) + 8001dc84: a811 j 8001dc98 <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E+0x3e> + self.iter.nth(self.step) + 8001dc86: 6522 ld a0,8(sp) + 8001dc88: 690c ld a1,16(a0) + 8001dc8a: fffee097 auipc ra,0xfffee + 8001dc8e: 30a080e7 jalr 778(ra) # 8000bf94 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$3nth17h1068366d302d8741E> + 8001dc92: e82a sd a0,16(sp) + 8001dc94: ec2e sd a1,24(sp) + 8001dc96: a011 j 8001dc9a <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E+0x40> + if self.first_take { + 8001dc98: a011 j 8001dc9c <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E+0x42> + 8001dc9a: a009 j 8001dc9c <_ZN105_$LT$core..iter..adapters..step_by..StepBy$LT$I$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h75ab964dca744767E+0x42> + } + 8001dc9c: 6542 ld a0,16(sp) + 8001dc9e: 65e2 ld a1,24(sp) + 8001dca0: 70a2 ld ra,40(sp) + 8001dca2: 6145 addi sp,sp,48 + 8001dca4: 8082 ret + +Disassembly of section .text._ZN4core4iter8adapters7step_by15StepBy$LT$I$GT$3new17h4faa8304472101dfE: + +000000008001dca6 <_ZN4core4iter8adapters7step_by15StepBy$LT$I$GT$3new17h4faa8304472101dfE>: + pub(in crate::iter) fn new(iter: I, step: usize) -> StepBy { + 8001dca6: 7139 addi sp,sp,-64 + 8001dca8: e436 sd a3,8(sp) + 8001dcaa: e832 sd a2,16(sp) + 8001dcac: ec2e sd a1,24(sp) + 8001dcae: f02a sd a0,32(sp) + 8001dcb0: f42e sd a1,40(sp) + 8001dcb2: f832 sd a2,48(sp) + 8001dcb4: fc36 sd a3,56(sp) + 8001dcb6: 4501 li a0,0 + assert!(step != 0); + 8001dcb8: 02a69163 bne a3,a0,8001dcda <.LBB2_4+0x14> + 8001dcbc: a009 j 8001dcbe <.LBB2_3> + +000000008001dcbe <.LBB2_3>: + 8001dcbe: 0000f517 auipc a0,0xf + 8001dcc2: bea50513 addi a0,a0,-1046 # 8002c8a8 <.L__unnamed_1> + +000000008001dcc6 <.LBB2_4>: + 8001dcc6: 0000f617 auipc a2,0xf + 8001dcca: c8a60613 addi a2,a2,-886 # 8002c950 <.L__unnamed_2> + 8001dcce: 45ed li a1,27 + 8001dcd0: 00005097 auipc ra,0x5 + 8001dcd4: 474080e7 jalr 1140(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001dcd8: 0000 unimp + StepBy { iter, step: step - 1, first_take: true } + 8001dcda: 7582 ld a1,32(sp) + 8001dcdc: 6642 ld a2,16(sp) + 8001dcde: 66e2 ld a3,24(sp) + 8001dce0: 6522 ld a0,8(sp) + 8001dce2: 157d addi a0,a0,-1 + 8001dce4: e194 sd a3,0(a1) + 8001dce6: e590 sd a2,8(a1) + 8001dce8: e988 sd a0,16(a1) + 8001dcea: 4505 li a0,1 + 8001dcec: 00a58c23 sb a0,24(a1) + } + 8001dcf0: 6121 addi sp,sp,64 + 8001dcf2: 8082 ret + +Disassembly of section .text._ZN4core4iter8adapters7step_by15StepBy$LT$I$GT$3new17h6692f5ddcbcdc828E: + +000000008001dcf4 <_ZN4core4iter8adapters7step_by15StepBy$LT$I$GT$3new17h6692f5ddcbcdc828E>: + pub(in crate::iter) fn new(iter: I, step: usize) -> StepBy { + 8001dcf4: 7179 addi sp,sp,-48 + 8001dcf6: e036 sd a3,0(sp) + 8001dcf8: e42a sd a0,8(sp) + 8001dcfa: 8532 mv a0,a2 + 8001dcfc: e82a sd a0,16(sp) + 8001dcfe: 852e mv a0,a1 + 8001dd00: ec2a sd a0,24(sp) + 8001dd02: d02e sw a1,32(sp) + 8001dd04: d232 sw a2,36(sp) + 8001dd06: f436 sd a3,40(sp) + 8001dd08: 4501 li a0,0 + assert!(step != 0); + 8001dd0a: 02a69163 bne a3,a0,8001dd2c <.LBB3_4+0x14> + 8001dd0e: a009 j 8001dd10 <.LBB3_3> + +000000008001dd10 <.LBB3_3>: + 8001dd10: 0000f517 auipc a0,0xf + 8001dd14: b9850513 addi a0,a0,-1128 # 8002c8a8 <.L__unnamed_1> + +000000008001dd18 <.LBB3_4>: + 8001dd18: 0000f617 auipc a2,0xf + 8001dd1c: c3860613 addi a2,a2,-968 # 8002c950 <.L__unnamed_2> + 8001dd20: 45ed li a1,27 + 8001dd22: 00005097 auipc ra,0x5 + 8001dd26: 422080e7 jalr 1058(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001dd2a: 0000 unimp + StepBy { iter, step: step - 1, first_take: true } + 8001dd2c: 65a2 ld a1,8(sp) + 8001dd2e: 6642 ld a2,16(sp) + 8001dd30: 66e2 ld a3,24(sp) + 8001dd32: 6502 ld a0,0(sp) + 8001dd34: 157d addi a0,a0,-1 + 8001dd36: c594 sw a3,8(a1) + 8001dd38: c5d0 sw a2,12(a1) + 8001dd3a: e188 sd a0,0(a1) + 8001dd3c: 4505 li a0,1 + 8001dd3e: 00a58823 sb a0,16(a1) + } + 8001dd42: 6145 addi sp,sp,48 + 8001dd44: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h09fa161dbb9bcdd3E: + +000000008001dd46 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h09fa161dbb9bcdd3E>: + fn into_iter(self) -> I { + 8001dd46: 1141 addi sp,sp,-16 + 8001dd48: e42e sd a1,8(sp) + 8001dd4a: 85aa mv a1,a0 + self + 8001dd4c: 6522 ld a0,8(sp) + 8001dd4e: 6910 ld a2,16(a0) + 8001dd50: e990 sd a2,16(a1) + 8001dd52: 6510 ld a2,8(a0) + 8001dd54: e590 sd a2,8(a1) + 8001dd56: 6108 ld a0,0(a0) + 8001dd58: e188 sd a0,0(a1) + } + 8001dd5a: 0141 addi sp,sp,16 + 8001dd5c: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h119fa1ab69bc712dE: + +000000008001dd5e <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17h119fa1ab69bc712dE>: + fn into_iter(self) -> I { + 8001dd5e: 1141 addi sp,sp,-16 + 8001dd60: e42e sd a1,8(sp) + 8001dd62: 85aa mv a1,a0 + self + 8001dd64: 6522 ld a0,8(sp) + 8001dd66: 6d10 ld a2,24(a0) + 8001dd68: ed90 sd a2,24(a1) + 8001dd6a: 6910 ld a2,16(a0) + 8001dd6c: e990 sd a2,16(a1) + 8001dd6e: 6510 ld a2,8(a0) + 8001dd70: e590 sd a2,8(a1) + 8001dd72: 6108 ld a0,0(a0) + 8001dd74: e188 sd a0,0(a1) + } + 8001dd76: 0141 addi sp,sp,16 + 8001dd78: 8082 ret + +Disassembly of section .text._ZN4core3mem11size_of_val17hb8db3e1f6e8e8424E: + +000000008001dd7a <_ZN4core3mem11size_of_val17hb8db3e1f6e8e8424E>: +pub const fn size_of_val(val: &T) -> usize { + 8001dd7a: 1101 addi sp,sp,-32 + 8001dd7c: e82a sd a0,16(sp) + 8001dd7e: 4521 li a0,8 + unsafe { intrinsics::size_of_val(val) } + 8001dd80: e42a sd a0,8(sp) + 8001dd82: ec2a sd a0,24(sp) + 8001dd84: a009 j 8001dd86 <_ZN4core3mem11size_of_val17hb8db3e1f6e8e8424E+0xc> +} + 8001dd86: 6522 ld a0,8(sp) + 8001dd88: 6105 addi sp,sp,32 + 8001dd8a: 8082 ret + +Disassembly of section .text._ZN4core3mem11size_of_val17hcff6d035291fbe5fE: + +000000008001dd8c <_ZN4core3mem11size_of_val17hcff6d035291fbe5fE>: +pub const fn size_of_val(val: &T) -> usize { + 8001dd8c: 1101 addi sp,sp,-32 + 8001dd8e: e42a sd a0,8(sp) + 8001dd90: e82e sd a1,16(sp) + unsafe { intrinsics::size_of_val(val) } + 8001dd92: ec2e sd a1,24(sp) + 8001dd94: e02e sd a1,0(sp) + 8001dd96: a009 j 8001dd98 <_ZN4core3mem11size_of_val17hcff6d035291fbe5fE+0xc> +} + 8001dd98: 6502 ld a0,0(sp) + 8001dd9a: 6105 addi sp,sp,32 + 8001dd9c: 8082 ret + +Disassembly of section .text._ZN4core3mem15size_of_val_raw17h1bfec9c80578f181E: + +000000008001dd9e <_ZN4core3mem15size_of_val_raw17h1bfec9c80578f181E>: +pub const unsafe fn size_of_val_raw(val: *const T) -> usize { + 8001dd9e: 1101 addi sp,sp,-32 + 8001dda0: e82a sd a0,16(sp) + 8001dda2: 04800513 li a0,72 + unsafe { intrinsics::size_of_val(val) } + 8001dda6: e42a sd a0,8(sp) + 8001dda8: ec2a sd a0,24(sp) + 8001ddaa: a009 j 8001ddac <_ZN4core3mem15size_of_val_raw17h1bfec9c80578f181E+0xe> +} + 8001ddac: 6522 ld a0,8(sp) + 8001ddae: 6105 addi sp,sp,32 + 8001ddb0: 8082 ret + +Disassembly of section .text._ZN4core3mem16align_of_val_raw17hadcb67548ac99edfE: + +000000008001ddb2 <_ZN4core3mem16align_of_val_raw17hadcb67548ac99edfE>: +/// assert_eq!(4, unsafe { mem::align_of_val_raw(&5i32) }); +/// ``` +#[inline] +#[unstable(feature = "layout_for_ptr", issue = "69835")] +#[rustc_const_unstable(feature = "const_align_of_val_raw", issue = "46571")] +pub const unsafe fn align_of_val_raw(val: *const T) -> usize { + 8001ddb2: 1101 addi sp,sp,-32 + 8001ddb4: e82a sd a0,16(sp) + 8001ddb6: 4521 li a0,8 + // SAFETY: the caller must provide a valid raw pointer + unsafe { intrinsics::min_align_of_val(val) } + 8001ddb8: e42a sd a0,8(sp) + 8001ddba: ec2a sd a0,24(sp) + 8001ddbc: a009 j 8001ddbe <_ZN4core3mem16align_of_val_raw17hadcb67548ac99edfE+0xc> +} + 8001ddbe: 6522 ld a0,8(sp) + 8001ddc0: 6105 addi sp,sp,32 + 8001ddc2: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h0a31045cd6ca0c7bE: + +000000008001ddc4 <_ZN4core3mem4drop17h0a31045cd6ca0c7bE>: +/// +/// [`RefCell`]: crate::cell::RefCell +#[doc(alias = "delete")] +#[inline] +#[stable(feature = "rust1", since = "1.0.0")] +pub fn drop(_x: T) {} + 8001ddc4: 1141 addi sp,sp,-16 + 8001ddc6: 00a107a3 sb a0,15(sp) + 8001ddca: a009 j 8001ddcc <_ZN4core3mem4drop17h0a31045cd6ca0c7bE+0x8> + 8001ddcc: 0141 addi sp,sp,16 + 8001ddce: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h0acc999538dd9281E: + +000000008001ddd0 <_ZN4core3mem4drop17h0acc999538dd9281E>: + 8001ddd0: 1141 addi sp,sp,-16 + 8001ddd2: e406 sd ra,8(sp) + 8001ddd4: e02a sd a0,0(sp) + 8001ddd6: 850a mv a0,sp + 8001ddd8: fffe9097 auipc ra,0xfffe9 + 8001dddc: 332080e7 jalr 818(ra) # 8000710a <_ZN4core3ptr71drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$usize$GT$$GT$17h978f142a914ddf2eE> + 8001dde0: a009 j 8001dde2 <_ZN4core3mem4drop17h0acc999538dd9281E+0x12> + 8001dde2: 60a2 ld ra,8(sp) + 8001dde4: 0141 addi sp,sp,16 + 8001dde6: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h10f52240d03cf3b6E: + +000000008001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E>: + 8001dde8: 1141 addi sp,sp,-16 + 8001ddea: e406 sd ra,8(sp) + 8001ddec: e02a sd a0,0(sp) + 8001ddee: 850a mv a0,sp + 8001ddf0: fffe9097 auipc ra,0xfffe9 + 8001ddf4: 366080e7 jalr 870(ra) # 80007156 <_ZN4core3ptr74drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$LP$$RP$$GT$$GT$17he568be727488c8bbE> + 8001ddf8: a009 j 8001ddfa <_ZN4core3mem4drop17h10f52240d03cf3b6E+0x12> + 8001ddfa: 60a2 ld ra,8(sp) + 8001ddfc: 0141 addi sp,sp,16 + 8001ddfe: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h2d4fb87a733eb04aE: + +000000008001de00 <_ZN4core3mem4drop17h2d4fb87a733eb04aE>: + 8001de00: 1141 addi sp,sp,-16 + 8001de02: e406 sd ra,8(sp) + 8001de04: e02a sd a0,0(sp) + 8001de06: 850a mv a0,sp + 8001de08: fffe9097 auipc ra,0xfffe9 + 8001de0c: 152080e7 jalr 338(ra) # 80006f5a <_ZN4core3ptr116drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$$u5b$kernel..fs..inode..InodeMeta$u3b$$u20$50$u5d$$GT$$GT$17h4e8573cf3b362114E> + 8001de10: a009 j 8001de12 <_ZN4core3mem4drop17h2d4fb87a733eb04aE+0x12> + 8001de12: 60a2 ld ra,8(sp) + 8001de14: 0141 addi sp,sp,16 + 8001de16: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h2ed300707c7d4096E: + +000000008001de18 <_ZN4core3mem4drop17h2ed300707c7d4096E>: + 8001de18: 1141 addi sp,sp,-16 + 8001de1a: e406 sd ra,8(sp) + 8001de1c: e02a sd a0,0(sp) + 8001de1e: 850a mv a0,sp + 8001de20: fffe9097 auipc ra,0xfffe9 + 8001de24: 430080e7 jalr 1072(ra) # 80007250 <_ZN4core3ptr98drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..console..Console$GT$$GT$17hbea8b3b0221deadaE> + 8001de28: a009 j 8001de2a <_ZN4core3mem4drop17h2ed300707c7d4096E+0x12> + 8001de2a: 60a2 ld ra,8(sp) + 8001de2c: 0141 addi sp,sp,16 + 8001de2e: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h391b2d12871564bdE: + +000000008001de30 <_ZN4core3mem4drop17h391b2d12871564bdE>: + 8001de30: 1141 addi sp,sp,-16 + 8001de32: e42a sd a0,8(sp) + 8001de34: a009 j 8001de36 <_ZN4core3mem4drop17h391b2d12871564bdE+0x6> + 8001de36: 0141 addi sp,sp,16 + 8001de38: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h3f96085e4daee3c2E: + +000000008001de3a <_ZN4core3mem4drop17h3f96085e4daee3c2E>: + 8001de3a: 1101 addi sp,sp,-32 + 8001de3c: ec06 sd ra,24(sp) + 8001de3e: e42a sd a0,8(sp) + 8001de40: e82e sd a1,16(sp) + 8001de42: 0028 addi a0,sp,8 + 8001de44: fffe9097 auipc ra,0xfffe9 + 8001de48: 3f6080e7 jalr 1014(ra) # 8000723a <_ZN4core3ptr96drop_in_place$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..inode..InodeData$GT$$GT$17h00d5c02cf687ef41E> + 8001de4c: a009 j 8001de4e <_ZN4core3mem4drop17h3f96085e4daee3c2E+0x14> + 8001de4e: 60e2 ld ra,24(sp) + 8001de50: 6105 addi sp,sp,32 + 8001de52: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h40ca24bdf6be713fE: + +000000008001de54 <_ZN4core3mem4drop17h40ca24bdf6be713fE>: + 8001de54: 1141 addi sp,sp,-16 + 8001de56: e42a sd a0,8(sp) + 8001de58: a009 j 8001de5a <_ZN4core3mem4drop17h40ca24bdf6be713fE+0x6> + 8001de5a: 0141 addi sp,sp,16 + 8001de5c: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h4200387821e72e60E: + +000000008001de5e <_ZN4core3mem4drop17h4200387821e72e60E>: + 8001de5e: 1141 addi sp,sp,-16 + 8001de60: e406 sd ra,8(sp) + 8001de62: e02a sd a0,0(sp) + 8001de64: 850a mv a0,sp + 8001de66: fffe9097 auipc ra,0xfffe9 + 8001de6a: 28e080e7 jalr 654(ra) # 800070f4 <_ZN4core3ptr69drop_in_place$LT$alloc..sync..Weak$LT$kernel..fs..file..VFile$GT$$GT$17hfcb3bca0be736df8E> + 8001de6e: a009 j 8001de70 <_ZN4core3mem4drop17h4200387821e72e60E+0x12> + 8001de70: 60a2 ld ra,8(sp) + 8001de72: 0141 addi sp,sp,16 + 8001de74: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h66bc7e80d0a41b3aE: + +000000008001de76 <_ZN4core3mem4drop17h66bc7e80d0a41b3aE>: + 8001de76: 1141 addi sp,sp,-16 + 8001de78: e406 sd ra,8(sp) + 8001de7a: fffe9097 auipc ra,0xfffe9 + 8001de7e: 2b6080e7 jalr 694(ra) # 80007130 <_ZN4core3ptr73drop_in_place$LT$core..option..Option$LT$kernel..fs..inode..Inode$GT$$GT$17h6a7b3b84406d6cdfE> + 8001de82: a009 j 8001de84 <_ZN4core3mem4drop17h66bc7e80d0a41b3aE+0xe> + 8001de84: 60a2 ld ra,8(sp) + 8001de86: 0141 addi sp,sp,16 + 8001de88: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h82526bd482ef36a5E: + +000000008001de8a <_ZN4core3mem4drop17h82526bd482ef36a5E>: + 8001de8a: 1141 addi sp,sp,-16 + 8001de8c: e406 sd ra,8(sp) + 8001de8e: e02a sd a0,0(sp) + 8001de90: 850a mv a0,sp + 8001de92: fffe9097 auipc ra,0xfffe9 + 8001de96: 342080e7 jalr 834(ra) # 800071d4 <_ZN4core3ptr89drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..bio..BufLru$GT$$GT$17h9c86fb58887d325bE> + 8001de9a: a009 j 8001de9c <_ZN4core3mem4drop17h82526bd482ef36a5E+0x12> + 8001de9c: 60a2 ld ra,8(sp) + 8001de9e: 0141 addi sp,sp,16 + 8001dea0: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h8377f059e38e21aaE: + +000000008001dea2 <_ZN4core3mem4drop17h8377f059e38e21aaE>: + 8001dea2: 1101 addi sp,sp,-32 + 8001dea4: ec06 sd ra,24(sp) + 8001dea6: e42a sd a0,8(sp) + 8001dea8: e82e sd a1,16(sp) + 8001deaa: 0028 addi a0,sp,8 + 8001deac: fffe9097 auipc ra,0xfffe9 + 8001deb0: 12a080e7 jalr 298(ra) # 80006fd6 <_ZN4core3ptr120drop_in_place$LT$core..option..Option$LT$kernel..lock..sleeplock..SleepLockGuard$LT$kernel..fs..bio..BufData$GT$$GT$$GT$17hc3cb66b90ce8c8e9E> + 8001deb4: a009 j 8001deb6 <_ZN4core3mem4drop17h8377f059e38e21aaE+0x14> + 8001deb6: 60e2 ld ra,24(sp) + 8001deb8: 6105 addi sp,sp,32 + 8001deba: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17h96fc0e7c88170ba8E: + +000000008001debc <_ZN4core3mem4drop17h96fc0e7c88170ba8E>: + 8001debc: 1141 addi sp,sp,-16 + 8001debe: e406 sd ra,8(sp) + 8001dec0: e02a sd a0,0(sp) + 8001dec2: 850a mv a0,sp + 8001dec4: fffe9097 auipc ra,0xfffe9 + 8001dec8: 33c080e7 jalr 828(ra) # 80007200 <_ZN4core3ptr92drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..uart..Uart$GT$$GT$17h4785ee23048b5bddE> + 8001decc: a009 j 8001dece <_ZN4core3mem4drop17h96fc0e7c88170ba8E+0x12> + 8001dece: 60a2 ld ra,8(sp) + 8001ded0: 0141 addi sp,sp,16 + 8001ded2: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17ha184dbcd1a83d607E: + +000000008001ded4 <_ZN4core3mem4drop17ha184dbcd1a83d607E>: + 8001ded4: 1141 addi sp,sp,-16 + 8001ded6: e42a sd a0,8(sp) + 8001ded8: a009 j 8001deda <_ZN4core3mem4drop17ha184dbcd1a83d607E+0x6> + 8001deda: 0141 addi sp,sp,16 + 8001dedc: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17ha75bac042eb9b458E: + +000000008001dede <_ZN4core3mem4drop17ha75bac042eb9b458E>: + 8001dede: 1141 addi sp,sp,-16 + 8001dee0: e42a sd a0,8(sp) + 8001dee2: a009 j 8001dee4 <_ZN4core3mem4drop17ha75bac042eb9b458E+0x6> + 8001dee4: 0141 addi sp,sp,16 + 8001dee6: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17haa2d2dc72bd2e81bE: + +000000008001dee8 <_ZN4core3mem4drop17haa2d2dc72bd2e81bE>: + 8001dee8: 1141 addi sp,sp,-16 + 8001deea: e406 sd ra,8(sp) + 8001deec: e02a sd a0,0(sp) + 8001deee: 850a mv a0,sp + 8001def0: fffe9097 auipc ra,0xfffe9 + 8001def4: 2b8080e7 jalr 696(ra) # 800071a8 <_ZN4core3ptr86drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..fs..log..Log$GT$$GT$17h3ff4d5b7fa89905aE> + 8001def8: a009 j 8001defa <_ZN4core3mem4drop17haa2d2dc72bd2e81bE+0x12> + 8001defa: 60a2 ld ra,8(sp) + 8001defc: 0141 addi sp,sp,16 + 8001defe: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17hb93abdfe16b94be5E: + +000000008001df00 <_ZN4core3mem4drop17hb93abdfe16b94be5E>: + 8001df00: 7179 addi sp,sp,-48 + 8001df02: f406 sd ra,40(sp) + 8001df04: e82a sd a0,16(sp) + 8001df06: ec2e sd a1,24(sp) + 8001df08: e02a sd a0,0(sp) + 8001df0a: e42e sd a1,8(sp) + 8001df0c: 850a mv a0,sp + 8001df0e: fffe9097 auipc ra,0xfffe9 + 8001df12: 158080e7 jalr 344(ra) # 80007066 <_ZN4core3ptr45drop_in_place$LT$kernel..fs..inode..Inode$GT$17h8786fe1a2a287832E> + 8001df16: a009 j 8001df18 <_ZN4core3mem4drop17hb93abdfe16b94be5E+0x18> + 8001df18: 70a2 ld ra,40(sp) + 8001df1a: 6145 addi sp,sp,48 + 8001df1c: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17hda1e19029436deb9E: + +000000008001df1e <_ZN4core3mem4drop17hda1e19029436deb9E>: + 8001df1e: 1141 addi sp,sp,-16 + 8001df20: e406 sd ra,8(sp) + 8001df22: fffe9097 auipc ra,0xfffe9 + 8001df26: 0f0080e7 jalr 240(ra) # 80007012 <_ZN4core3ptr41drop_in_place$LT$kernel..fs..bio..Buf$GT$17hc35967244f3e9eb6E> + 8001df2a: a009 j 8001df2c <_ZN4core3mem4drop17hda1e19029436deb9E+0xe> + 8001df2c: 60a2 ld ra,8(sp) + 8001df2e: 0141 addi sp,sp,16 + 8001df30: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17he1c2696149894a05E: + +000000008001df32 <_ZN4core3mem4drop17he1c2696149894a05E>: + 8001df32: 1141 addi sp,sp,-16 + 8001df34: e42a sd a0,8(sp) + 8001df36: a009 j 8001df38 <_ZN4core3mem4drop17he1c2696149894a05E+0x6> + 8001df38: 0141 addi sp,sp,16 + 8001df3a: 8082 ret + +Disassembly of section .text._ZN4core3mem4drop17hf5d8d4b62719f1bfE: + +000000008001df3c <_ZN4core3mem4drop17hf5d8d4b62719f1bfE>: + 8001df3c: 1141 addi sp,sp,-16 + 8001df3e: e406 sd ra,8(sp) + 8001df40: e02a sd a0,0(sp) + 8001df42: 850a mv a0,sp + 8001df44: fffe9097 auipc ra,0xfffe9 + 8001df48: 322080e7 jalr 802(ra) # 80007266 <_ZN4core3ptr99drop_in_place$LT$kernel..lock..spinlock..SpinlockGuard$LT$kernel..driver..virtio_disk..Disk$GT$$GT$17h4fc01c278f0bfe6cE> + 8001df4c: a009 j 8001df4e <_ZN4core3mem4drop17hf5d8d4b62719f1bfE+0x12> + 8001df4e: 60a2 ld ra,8(sp) + 8001df50: 0141 addi sp,sp,16 + 8001df52: 8082 ret + +Disassembly of section .text._ZN4core3mem4take17h5215bf07db4a9cdbE: + +000000008001df54 <_ZN4core3mem4take17h5215bf07db4a9cdbE>: +pub fn take(dest: &mut T) -> T { + 8001df54: 7179 addi sp,sp,-48 + 8001df56: f406 sd ra,40(sp) + 8001df58: e82a sd a0,16(sp) + 8001df5a: f02a sd a0,32(sp) + replace(dest, T::default()) + 8001df5c: ffff2097 auipc ra,0xffff2 + 8001df60: c56080e7 jalr -938(ra) # 8000fbb2 <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h459b0dfcf4f19fffE> + 8001df64: ec2a sd a0,24(sp) + 8001df66: a009 j 8001df68 <_ZN4core3mem4take17h5215bf07db4a9cdbE+0x14> + 8001df68: 65e2 ld a1,24(sp) + 8001df6a: 6542 ld a0,16(sp) + 8001df6c: 00000097 auipc ra,0x0 + 8001df70: 200080e7 jalr 512(ra) # 8001e16c <_ZN4core3mem7replace17hca19b537819175cbE> + 8001df74: e42a sd a0,8(sp) + 8001df76: a009 j 8001df78 <_ZN4core3mem4take17h5215bf07db4a9cdbE+0x24> +} + 8001df78: 6522 ld a0,8(sp) + 8001df7a: 70a2 ld ra,40(sp) + 8001df7c: 6145 addi sp,sp,48 + 8001df7e: 8082 ret + +Disassembly of section .text._ZN4core3mem4take17h9920b9ae1a5c3368E: + +000000008001df80 <_ZN4core3mem4take17h9920b9ae1a5c3368E>: +pub fn take(dest: &mut T) -> T { + 8001df80: 7179 addi sp,sp,-48 + 8001df82: f406 sd ra,40(sp) + 8001df84: e82a sd a0,16(sp) + 8001df86: f02a sd a0,32(sp) + replace(dest, T::default()) + 8001df88: ffff2097 auipc ra,0xffff2 + 8001df8c: c40080e7 jalr -960(ra) # 8000fbc8 <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17hbc90300349db98aaE> + 8001df90: ec2a sd a0,24(sp) + 8001df92: a009 j 8001df94 <_ZN4core3mem4take17h9920b9ae1a5c3368E+0x14> + 8001df94: 65e2 ld a1,24(sp) + 8001df96: 6542 ld a0,16(sp) + 8001df98: 00000097 auipc ra,0x0 + 8001df9c: 23a080e7 jalr 570(ra) # 8001e1d2 <_ZN4core3mem7replace17hfd1d9a060b66fcb5E> + 8001dfa0: e42a sd a0,8(sp) + 8001dfa2: a009 j 8001dfa4 <_ZN4core3mem4take17h9920b9ae1a5c3368E+0x24> +} + 8001dfa4: 6522 ld a0,8(sp) + 8001dfa6: 70a2 ld ra,40(sp) + 8001dfa8: 6145 addi sp,sp,48 + 8001dfaa: 8082 ret + +Disassembly of section .text._ZN4core3mem4take17ha20fa5de2e41ca09E: + +000000008001dfac <_ZN4core3mem4take17ha20fa5de2e41ca09E>: +pub fn take(dest: &mut T) -> T { + 8001dfac: 7139 addi sp,sp,-64 + 8001dfae: fc06 sd ra,56(sp) + 8001dfb0: ec2a sd a0,24(sp) + 8001dfb2: f82a sd a0,48(sp) + replace(dest, T::default()) + 8001dfb4: ffff2097 auipc ra,0xffff2 + 8001dfb8: bf2080e7 jalr -1038(ra) # 8000fba6 <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h216c24bc3f109328E> + 8001dfbc: f02a sd a0,32(sp) + 8001dfbe: f42e sd a1,40(sp) + 8001dfc0: a009 j 8001dfc2 <_ZN4core3mem4take17ha20fa5de2e41ca09E+0x16> + 8001dfc2: 7622 ld a2,40(sp) + 8001dfc4: 7582 ld a1,32(sp) + 8001dfc6: 6562 ld a0,24(sp) + 8001dfc8: 00000097 auipc ra,0x0 + 8001dfcc: 0ee080e7 jalr 238(ra) # 8001e0b6 <_ZN4core3mem7replace17hb9aa9fb859d8f738E> + 8001dfd0: e42a sd a0,8(sp) + 8001dfd2: e82e sd a1,16(sp) + 8001dfd4: a009 j 8001dfd6 <_ZN4core3mem4take17ha20fa5de2e41ca09E+0x2a> +} + 8001dfd6: 65c2 ld a1,16(sp) + 8001dfd8: 6522 ld a0,8(sp) + 8001dfda: 70e2 ld ra,56(sp) + 8001dfdc: 6121 addi sp,sp,64 + 8001dfde: 8082 ret + +Disassembly of section .text._ZN4core3mem4take17ha8b178c6c6bab41fE: + +000000008001dfe0 <_ZN4core3mem4take17ha8b178c6c6bab41fE>: +pub fn take(dest: &mut T) -> T { + 8001dfe0: 7139 addi sp,sp,-64 + 8001dfe2: fc06 sd ra,56(sp) + 8001dfe4: ec2a sd a0,24(sp) + 8001dfe6: f82a sd a0,48(sp) + replace(dest, T::default()) + 8001dfe8: ffff2097 auipc ra,0xffff2 + 8001dfec: bd4080e7 jalr -1068(ra) # 8000fbbc <_ZN72_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..default..Default$GT$7default17h9e7fcea49a91f0edE> + 8001dff0: f02a sd a0,32(sp) + 8001dff2: f42e sd a1,40(sp) + 8001dff4: a009 j 8001dff6 <_ZN4core3mem4take17ha8b178c6c6bab41fE+0x16> + 8001dff6: 7622 ld a2,40(sp) + 8001dff8: 7582 ld a1,32(sp) + 8001dffa: 6562 ld a0,24(sp) + 8001dffc: 00000097 auipc ra,0x0 + 8001e000: 130080e7 jalr 304(ra) # 8001e12c <_ZN4core3mem7replace17hbfb2af9a98f5ad51E> + 8001e004: e42a sd a0,8(sp) + 8001e006: e82e sd a1,16(sp) + 8001e008: a009 j 8001e00a <_ZN4core3mem4take17ha8b178c6c6bab41fE+0x2a> +} + 8001e00a: 65c2 ld a1,16(sp) + 8001e00c: 6522 ld a0,8(sp) + 8001e00e: 70e2 ld ra,56(sp) + 8001e010: 6121 addi sp,sp,64 + 8001e012: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17h1967adb5d4092576E: + +000000008001e014 <_ZN4core3mem7replace17h1967adb5d4092576E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e014: 7179 addi sp,sp,-48 + 8001e016: f406 sd ra,40(sp) + 8001e018: e02a sd a0,0(sp) + 8001e01a: 862e mv a2,a1 + 8001e01c: e432 sd a2,8(sp) + 8001e01e: ec2a sd a0,24(sp) + 8001e020: 02b10323 sb a1,38(sp) + let result = ptr::read(dest); + 8001e024: ffffb097 auipc ra,0xffffb + 8001e028: 5da080e7 jalr 1498(ra) # 800195fe <_ZN4core3ptr4read17he855cc26728788dfE> + 8001e02c: 85aa mv a1,a0 + 8001e02e: e82e sd a1,16(sp) + 8001e030: 02a103a3 sb a0,39(sp) + 8001e034: a009 j 8001e036 <_ZN4core3mem7replace17h1967adb5d4092576E+0x22> + ptr::write(dest, src); + 8001e036: 65a2 ld a1,8(sp) + 8001e038: 6502 ld a0,0(sp) + 8001e03a: ffffb097 auipc ra,0xffffb + 8001e03e: 676080e7 jalr 1654(ra) # 800196b0 <_ZN4core3ptr5write17h25ba6e811e5fd451E> + 8001e042: a009 j 8001e044 <_ZN4core3mem7replace17h1967adb5d4092576E+0x30> +} + 8001e044: 6542 ld a0,16(sp) + 8001e046: 70a2 ld ra,40(sp) + 8001e048: 6145 addi sp,sp,48 + 8001e04a: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17h57a15db6942c9267E: + +000000008001e04c <_ZN4core3mem7replace17h57a15db6942c9267E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e04c: 7179 addi sp,sp,-48 + 8001e04e: f406 sd ra,40(sp) + 8001e050: e02a sd a0,0(sp) + 8001e052: 862e mv a2,a1 + 8001e054: e432 sd a2,8(sp) + 8001e056: ec2a sd a0,24(sp) + 8001e058: 02b11223 sh a1,36(sp) + let result = ptr::read(dest); + 8001e05c: ffffb097 auipc ra,0xffffb + 8001e060: 40c080e7 jalr 1036(ra) # 80019468 <_ZN4core3ptr4read17h49d73875721fb0a9E> + 8001e064: 85aa mv a1,a0 + 8001e066: e82e sd a1,16(sp) + 8001e068: 02a11323 sh a0,38(sp) + 8001e06c: a009 j 8001e06e <_ZN4core3mem7replace17h57a15db6942c9267E+0x22> + ptr::write(dest, src); + 8001e06e: 65a2 ld a1,8(sp) + 8001e070: 6502 ld a0,0(sp) + 8001e072: ffffb097 auipc ra,0xffffb + 8001e076: 66a080e7 jalr 1642(ra) # 800196dc <_ZN4core3ptr5write17h6d43807bf71c562eE> + 8001e07a: a009 j 8001e07c <_ZN4core3mem7replace17h57a15db6942c9267E+0x30> +} + 8001e07c: 6542 ld a0,16(sp) + 8001e07e: 70a2 ld ra,40(sp) + 8001e080: 6145 addi sp,sp,48 + 8001e082: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17ha3220c9fe59ec441E: + +000000008001e084 <_ZN4core3mem7replace17ha3220c9fe59ec441E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e084: 7139 addi sp,sp,-64 + 8001e086: fc06 sd ra,56(sp) + 8001e088: e42e sd a1,8(sp) + 8001e08a: e82a sd a0,16(sp) + 8001e08c: f02a sd a0,32(sp) + 8001e08e: f42e sd a1,40(sp) + let result = ptr::read(dest); + 8001e090: ffffb097 auipc ra,0xffffb + 8001e094: 472080e7 jalr 1138(ra) # 80019502 <_ZN4core3ptr4read17hca9a7d22776635f1E> + 8001e098: 85aa mv a1,a0 + 8001e09a: ec2e sd a1,24(sp) + 8001e09c: f82a sd a0,48(sp) + 8001e09e: a009 j 8001e0a0 <_ZN4core3mem7replace17ha3220c9fe59ec441E+0x1c> + ptr::write(dest, src); + 8001e0a0: 65a2 ld a1,8(sp) + 8001e0a2: 6542 ld a0,16(sp) + 8001e0a4: ffffb097 auipc ra,0xffffb + 8001e0a8: 61c080e7 jalr 1564(ra) # 800196c0 <_ZN4core3ptr5write17h4a1d74f50ec6a35fE> + 8001e0ac: a009 j 8001e0ae <_ZN4core3mem7replace17ha3220c9fe59ec441E+0x2a> +} + 8001e0ae: 6562 ld a0,24(sp) + 8001e0b0: 70e2 ld ra,56(sp) + 8001e0b2: 6121 addi sp,sp,64 + 8001e0b4: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17hb9aa9fb859d8f738E: + +000000008001e0b6 <_ZN4core3mem7replace17hb9aa9fb859d8f738E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e0b6: 711d addi sp,sp,-96 + 8001e0b8: ec86 sd ra,88(sp) + 8001e0ba: e432 sd a2,8(sp) + 8001e0bc: e82e sd a1,16(sp) + 8001e0be: ec2a sd a0,24(sp) + 8001e0c0: f82a sd a0,48(sp) + 8001e0c2: fc2e sd a1,56(sp) + 8001e0c4: e0b2 sd a2,64(sp) + let result = ptr::read(dest); + 8001e0c6: ffffb097 auipc ra,0xffffb + 8001e0ca: 462080e7 jalr 1122(ra) # 80019528 <_ZN4core3ptr4read17hcc58f40f4c4c7a01E> + 8001e0ce: 862a mv a2,a0 + 8001e0d0: f032 sd a2,32(sp) + 8001e0d2: 862e mv a2,a1 + 8001e0d4: f432 sd a2,40(sp) + 8001e0d6: e4aa sd a0,72(sp) + 8001e0d8: e8ae sd a1,80(sp) + 8001e0da: a009 j 8001e0dc <_ZN4core3mem7replace17hb9aa9fb859d8f738E+0x26> + ptr::write(dest, src); + 8001e0dc: 6622 ld a2,8(sp) + 8001e0de: 65c2 ld a1,16(sp) + 8001e0e0: 6562 ld a0,24(sp) + 8001e0e2: ffffb097 auipc ra,0xffffb + 8001e0e6: 5ea080e7 jalr 1514(ra) # 800196cc <_ZN4core3ptr5write17h60f767b6e6d7c45aE> + 8001e0ea: a009 j 8001e0ec <_ZN4core3mem7replace17hb9aa9fb859d8f738E+0x36> +} + 8001e0ec: 75a2 ld a1,40(sp) + 8001e0ee: 7502 ld a0,32(sp) + 8001e0f0: 60e6 ld ra,88(sp) + 8001e0f2: 6125 addi sp,sp,96 + 8001e0f4: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17hbc5a7f4d236ddb3dE: + +000000008001e0f6 <_ZN4core3mem7replace17hbc5a7f4d236ddb3dE>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e0f6: 7139 addi sp,sp,-64 + let result = ptr::read(dest); + 8001e0f8: fc06 sd ra,56(sp) +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e0fa: e432 sd a2,8(sp) + 8001e0fc: e82e sd a1,16(sp) + 8001e0fe: f82e sd a1,48(sp) + let result = ptr::read(dest); + 8001e100: ffffb097 auipc ra,0xffffb + 8001e104: 326080e7 jalr 806(ra) # 80019426 <_ZN4core3ptr4read17h260501ac2ae68563E> + 8001e108: a009 j 8001e10a <_ZN4core3mem7replace17hbc5a7f4d236ddb3dE+0x14> + ptr::write(dest, src); + 8001e10a: 6542 ld a0,16(sp) + 8001e10c: 65a2 ld a1,8(sp) + 8001e10e: 6990 ld a2,16(a1) + 8001e110: f432 sd a2,40(sp) + 8001e112: 6590 ld a2,8(a1) + 8001e114: f032 sd a2,32(sp) + 8001e116: 618c ld a1,0(a1) + 8001e118: ec2e sd a1,24(sp) + 8001e11a: 082c addi a1,sp,24 + 8001e11c: ffffb097 auipc ra,0xffffb + 8001e120: 5e8080e7 jalr 1512(ra) # 80019704 <_ZN4core3ptr5write17hf7c587ba45e12a81E> + 8001e124: a009 j 8001e126 <_ZN4core3mem7replace17hbc5a7f4d236ddb3dE+0x30> +} + 8001e126: 70e2 ld ra,56(sp) + 8001e128: 6121 addi sp,sp,64 + 8001e12a: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17hbfb2af9a98f5ad51E: + +000000008001e12c <_ZN4core3mem7replace17hbfb2af9a98f5ad51E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e12c: 711d addi sp,sp,-96 + 8001e12e: ec86 sd ra,88(sp) + 8001e130: e432 sd a2,8(sp) + 8001e132: e82e sd a1,16(sp) + 8001e134: ec2a sd a0,24(sp) + 8001e136: f82a sd a0,48(sp) + 8001e138: fc2e sd a1,56(sp) + 8001e13a: e0b2 sd a2,64(sp) + let result = ptr::read(dest); + 8001e13c: ffffb097 auipc ra,0xffffb + 8001e140: 4fa080e7 jalr 1274(ra) # 80019636 <_ZN4core3ptr4read17hf667e6f53e42adf1E> + 8001e144: 862a mv a2,a0 + 8001e146: f032 sd a2,32(sp) + 8001e148: 862e mv a2,a1 + 8001e14a: f432 sd a2,40(sp) + 8001e14c: e4aa sd a0,72(sp) + 8001e14e: e8ae sd a1,80(sp) + 8001e150: a009 j 8001e152 <_ZN4core3mem7replace17hbfb2af9a98f5ad51E+0x26> + ptr::write(dest, src); + 8001e152: 6622 ld a2,8(sp) + 8001e154: 65c2 ld a1,16(sp) + 8001e156: 6562 ld a0,24(sp) + 8001e158: ffffb097 auipc ra,0xffffb + 8001e15c: 514080e7 jalr 1300(ra) # 8001966c <_ZN4core3ptr5write17h0b5f65d949594758E> + 8001e160: a009 j 8001e162 <_ZN4core3mem7replace17hbfb2af9a98f5ad51E+0x36> +} + 8001e162: 75a2 ld a1,40(sp) + 8001e164: 7502 ld a0,32(sp) + 8001e166: 60e6 ld ra,88(sp) + 8001e168: 6125 addi sp,sp,96 + 8001e16a: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17hca19b537819175cbE: + +000000008001e16c <_ZN4core3mem7replace17hca19b537819175cbE>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e16c: 7139 addi sp,sp,-64 + 8001e16e: fc06 sd ra,56(sp) + 8001e170: e42e sd a1,8(sp) + 8001e172: e82a sd a0,16(sp) + 8001e174: f02a sd a0,32(sp) + 8001e176: f42e sd a1,40(sp) + let result = ptr::read(dest); + 8001e178: ffffb097 auipc ra,0xffffb + 8001e17c: 35e080e7 jalr 862(ra) # 800194d6 <_ZN4core3ptr4read17hbe38e0f78fffdc49E> + 8001e180: 85aa mv a1,a0 + 8001e182: ec2e sd a1,24(sp) + 8001e184: f82a sd a0,48(sp) + 8001e186: a009 j 8001e188 <_ZN4core3mem7replace17hca19b537819175cbE+0x1c> + ptr::write(dest, src); + 8001e188: 65a2 ld a1,8(sp) + 8001e18a: 6542 ld a0,16(sp) + 8001e18c: ffffb097 auipc ra,0xffffb + 8001e190: 560080e7 jalr 1376(ra) # 800196ec <_ZN4core3ptr5write17h9fb8ab42ff75ed2cE> + 8001e194: a009 j 8001e196 <_ZN4core3mem7replace17hca19b537819175cbE+0x2a> +} + 8001e196: 6562 ld a0,24(sp) + 8001e198: 70e2 ld ra,56(sp) + 8001e19a: 6121 addi sp,sp,64 + 8001e19c: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17hcd75ca48f5a8a8f5E: + +000000008001e19e <_ZN4core3mem7replace17hcd75ca48f5a8a8f5E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e19e: 7179 addi sp,sp,-48 + 8001e1a0: f406 sd ra,40(sp) + 8001e1a2: e02a sd a0,0(sp) + 8001e1a4: 862e mv a2,a1 + 8001e1a6: e432 sd a2,8(sp) + 8001e1a8: ec2a sd a0,24(sp) + 8001e1aa: d02e sw a1,32(sp) + let result = ptr::read(dest); + 8001e1ac: ffffb097 auipc ra,0xffffb + 8001e1b0: 2f0080e7 jalr 752(ra) # 8001949c <_ZN4core3ptr4read17h97f5e0e151e0fdc4E> + 8001e1b4: 85aa mv a1,a0 + 8001e1b6: e82e sd a1,16(sp) + 8001e1b8: d22a sw a0,36(sp) + 8001e1ba: a009 j 8001e1bc <_ZN4core3mem7replace17hcd75ca48f5a8a8f5E+0x1e> + ptr::write(dest, src); + 8001e1bc: 65a2 ld a1,8(sp) + 8001e1be: 6502 ld a0,0(sp) + 8001e1c0: ffffb097 auipc ra,0xffffb + 8001e1c4: 4cc080e7 jalr 1228(ra) # 8001968c <_ZN4core3ptr5write17h10d6d8799e54bf75E> + 8001e1c8: a009 j 8001e1ca <_ZN4core3mem7replace17hcd75ca48f5a8a8f5E+0x2c> +} + 8001e1ca: 6542 ld a0,16(sp) + 8001e1cc: 70a2 ld ra,40(sp) + 8001e1ce: 6145 addi sp,sp,48 + 8001e1d0: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17hfd1d9a060b66fcb5E: + +000000008001e1d2 <_ZN4core3mem7replace17hfd1d9a060b66fcb5E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 8001e1d2: 7139 addi sp,sp,-64 + 8001e1d4: fc06 sd ra,56(sp) + 8001e1d6: e42e sd a1,8(sp) + 8001e1d8: e82a sd a0,16(sp) + 8001e1da: f02a sd a0,32(sp) + 8001e1dc: f42e sd a1,40(sp) + let result = ptr::read(dest); + 8001e1de: ffffb097 auipc ra,0xffffb + 8001e1e2: 388080e7 jalr 904(ra) # 80019566 <_ZN4core3ptr4read17hd0dbd64c70caff03E> + 8001e1e6: 85aa mv a1,a0 + 8001e1e8: ec2e sd a1,24(sp) + 8001e1ea: f82a sd a0,48(sp) + 8001e1ec: a009 j 8001e1ee <_ZN4core3mem7replace17hfd1d9a060b66fcb5E+0x1c> + ptr::write(dest, src); + 8001e1ee: 65a2 ld a1,8(sp) + 8001e1f0: 6542 ld a0,16(sp) + 8001e1f2: ffffb097 auipc ra,0xffffb + 8001e1f6: 506080e7 jalr 1286(ra) # 800196f8 <_ZN4core3ptr5write17hbb8dbff750359a8eE> + 8001e1fa: a009 j 8001e1fc <_ZN4core3mem7replace17hfd1d9a060b66fcb5E+0x2a> +} + 8001e1fc: 6562 ld a0,24(sp) + 8001e1fe: 70e2 ld ra,56(sp) + 8001e200: 6121 addi sp,sp,64 + 8001e202: 8082 ret + +Disassembly of section .text._ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE: + +000000008001e204 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE>: + pub fn lock(&self) -> SleepLockGuard { + 8001e204: 711d addi sp,sp,-96 + 8001e206: ec86 sd ra,88(sp) + 8001e208: fc2a sd a0,56(sp) + let mut guard = self.lock.acquire(); + 8001e20a: ffff3097 auipc ra,0xffff3 + 8001e20e: e38080e7 jalr -456(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001e212: e8aa sd a0,80(sp) + 8001e214: a009 j 8001e216 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE+0x12> + while self.locked.get() { + 8001e216: 7562 ld a0,56(sp) + 8001e218: 03050513 addi a0,a0,48 + 8001e21c: fffe7097 auipc ra,0xfffe7 + 8001e220: 034080e7 jalr 52(ra) # 80005250 <_ZN4core4cell13Cell$LT$T$GT$3get17ha10dd437ebde1b39E> + 8001e224: f82a sd a0,48(sp) + 8001e226: a009 j 8001e228 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE+0x24> + 8001e228: 7542 ld a0,48(sp) + 8001e22a: e919 bnez a0,8001e240 <.LBB0_13> + 8001e22c: a009 j 8001e22e <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE+0x2a> + self.locked.set(true); + 8001e22e: 7562 ld a0,56(sp) + 8001e230: 03050513 addi a0,a0,48 + 8001e234: 4585 li a1,1 + 8001e236: fffe7097 auipc ra,0xfffe7 + 8001e23a: 070080e7 jalr 112(ra) # 800052a6 <_ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E> + 8001e23e: a08d j 8001e2a0 <.LBB0_14+0x4a> + +000000008001e240 <.LBB0_13>: + CPU_MANAGER.myproc().unwrap().sleep(self.locked.as_ptr() as usize, guard); + 8001e240: 00048517 auipc a0,0x48 + 8001e244: f0050513 addi a0,a0,-256 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001e248: ffff4097 auipc ra,0xffff4 + 8001e24c: 210080e7 jalr 528(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001e250: f42a sd a0,40(sp) + 8001e252: a009 j 8001e254 <.LBB0_13+0x14> + 8001e254: 7522 ld a0,40(sp) + +000000008001e256 <.LBB0_14>: + 8001e256: 0000e597 auipc a1,0xe + 8001e25a: 72a58593 addi a1,a1,1834 # 8002c980 <.L__unnamed_1> + 8001e25e: ffff1097 auipc ra,0xffff1 + 8001e262: 532080e7 jalr 1330(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001e266: f02a sd a0,32(sp) + 8001e268: a009 j 8001e26a <.LBB0_14+0x14> + 8001e26a: 7562 ld a0,56(sp) + 8001e26c: 03050513 addi a0,a0,48 + 8001e270: fffe7097 auipc ra,0xfffe7 + 8001e274: 08e080e7 jalr 142(ra) # 800052fe <_ZN4core4cell13Cell$LT$T$GT$6as_ptr17h2323c3e07ac4531cE> + 8001e278: ec2a sd a0,24(sp) + 8001e27a: a009 j 8001e27c <.LBB0_14+0x26> + 8001e27c: 65e2 ld a1,24(sp) + 8001e27e: 7502 ld a0,32(sp) + 8001e280: 6646 ld a2,80(sp) + 8001e282: ffff4097 auipc ra,0xffff4 + 8001e286: fca080e7 jalr -54(ra) # 8001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E> + 8001e28a: a009 j 8001e28c <.LBB0_14+0x36> + guard = self.lock.acquire(); + 8001e28c: 7562 ld a0,56(sp) + 8001e28e: ffff3097 auipc ra,0xffff3 + 8001e292: db4080e7 jalr -588(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001e296: e82a sd a0,16(sp) + 8001e298: a009 j 8001e29a <.LBB0_14+0x44> + 8001e29a: 6542 ld a0,16(sp) + 8001e29c: e8aa sd a0,80(sp) + while self.locked.get() { + 8001e29e: bfa5 j 8001e216 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h5e4056570307628eE+0x12> + drop(guard); + 8001e2a0: 6546 ld a0,80(sp) + 8001e2a2: 00000097 auipc ra,0x0 + 8001e2a6: b46080e7 jalr -1210(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001e2aa: a009 j 8001e2ac <.LBB0_14+0x56> + lock: &self, + 8001e2ac: 7562 ld a0,56(sp) + data: unsafe { &mut *self.data.get() } + 8001e2ae: e02a sd a0,0(sp) + 8001e2b0: 03450513 addi a0,a0,52 + 8001e2b4: fffe7097 auipc ra,0xfffe7 + 8001e2b8: 0cc080e7 jalr 204(ra) # 80005380 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h0c090ec98b6b5023E> + 8001e2bc: e42a sd a0,8(sp) + 8001e2be: a009 j 8001e2c0 <.LBB0_14+0x6a> + SleepLockGuard { + 8001e2c0: 65a2 ld a1,8(sp) + 8001e2c2: 6502 ld a0,0(sp) + 8001e2c4: e0aa sd a0,64(sp) + 8001e2c6: e4ae sd a1,72(sp) + } + 8001e2c8: 60e6 ld ra,88(sp) + 8001e2ca: 6125 addi sp,sp,96 + 8001e2cc: 8082 ret + +Disassembly of section .text._ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE: + +000000008001e2ce <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE>: + pub fn lock(&self) -> SleepLockGuard { + 8001e2ce: 711d addi sp,sp,-96 + 8001e2d0: ec86 sd ra,88(sp) + 8001e2d2: fc2a sd a0,56(sp) + let mut guard = self.lock.acquire(); + 8001e2d4: ffff3097 auipc ra,0xffff3 + 8001e2d8: d6e080e7 jalr -658(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001e2dc: e8aa sd a0,80(sp) + 8001e2de: a009 j 8001e2e0 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE+0x12> + while self.locked.get() { + 8001e2e0: 7562 ld a0,56(sp) + 8001e2e2: 03050513 addi a0,a0,48 + 8001e2e6: fffe7097 auipc ra,0xfffe7 + 8001e2ea: f6a080e7 jalr -150(ra) # 80005250 <_ZN4core4cell13Cell$LT$T$GT$3get17ha10dd437ebde1b39E> + 8001e2ee: f82a sd a0,48(sp) + 8001e2f0: a009 j 8001e2f2 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE+0x24> + 8001e2f2: 7542 ld a0,48(sp) + 8001e2f4: e919 bnez a0,8001e30a <.LBB1_13> + 8001e2f6: a009 j 8001e2f8 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE+0x2a> + self.locked.set(true); + 8001e2f8: 7562 ld a0,56(sp) + 8001e2fa: 03050513 addi a0,a0,48 + 8001e2fe: 4585 li a1,1 + 8001e300: fffe7097 auipc ra,0xfffe7 + 8001e304: fa6080e7 jalr -90(ra) # 800052a6 <_ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E> + 8001e308: a08d j 8001e36a <.LBB1_14+0x4a> + +000000008001e30a <.LBB1_13>: + CPU_MANAGER.myproc().unwrap().sleep(self.locked.as_ptr() as usize, guard); + 8001e30a: 00048517 auipc a0,0x48 + 8001e30e: e3650513 addi a0,a0,-458 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001e312: ffff4097 auipc ra,0xffff4 + 8001e316: 146080e7 jalr 326(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001e31a: f42a sd a0,40(sp) + 8001e31c: a009 j 8001e31e <.LBB1_13+0x14> + 8001e31e: 7522 ld a0,40(sp) + +000000008001e320 <.LBB1_14>: + 8001e320: 0000e597 auipc a1,0xe + 8001e324: 66058593 addi a1,a1,1632 # 8002c980 <.L__unnamed_1> + 8001e328: ffff1097 auipc ra,0xffff1 + 8001e32c: 468080e7 jalr 1128(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001e330: f02a sd a0,32(sp) + 8001e332: a009 j 8001e334 <.LBB1_14+0x14> + 8001e334: 7562 ld a0,56(sp) + 8001e336: 03050513 addi a0,a0,48 + 8001e33a: fffe7097 auipc ra,0xfffe7 + 8001e33e: fc4080e7 jalr -60(ra) # 800052fe <_ZN4core4cell13Cell$LT$T$GT$6as_ptr17h2323c3e07ac4531cE> + 8001e342: ec2a sd a0,24(sp) + 8001e344: a009 j 8001e346 <.LBB1_14+0x26> + 8001e346: 65e2 ld a1,24(sp) + 8001e348: 7502 ld a0,32(sp) + 8001e34a: 6646 ld a2,80(sp) + 8001e34c: ffff4097 auipc ra,0xffff4 + 8001e350: f00080e7 jalr -256(ra) # 8001224c <_ZN6kernel7process7process11task_struct5sleep17ha9b590d99d4c9f94E> + 8001e354: a009 j 8001e356 <.LBB1_14+0x36> + guard = self.lock.acquire(); + 8001e356: 7562 ld a0,56(sp) + 8001e358: ffff3097 auipc ra,0xffff3 + 8001e35c: cea080e7 jalr -790(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001e360: e82a sd a0,16(sp) + 8001e362: a009 j 8001e364 <.LBB1_14+0x44> + 8001e364: 6542 ld a0,16(sp) + 8001e366: e8aa sd a0,80(sp) + while self.locked.get() { + 8001e368: bfa5 j 8001e2e0 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$4lock17h852a891f9af492ecE+0x12> + drop(guard); + 8001e36a: 6546 ld a0,80(sp) + 8001e36c: 00000097 auipc ra,0x0 + 8001e370: a7c080e7 jalr -1412(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001e374: a009 j 8001e376 <.LBB1_14+0x56> + lock: &self, + 8001e376: 7562 ld a0,56(sp) + data: unsafe { &mut *self.data.get() } + 8001e378: e02a sd a0,0(sp) + 8001e37a: 03850513 addi a0,a0,56 + 8001e37e: fffe7097 auipc ra,0xfffe7 + 8001e382: 03a080e7 jalr 58(ra) # 800053b8 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hb24b2b56dfaab8d4E> + 8001e386: e42a sd a0,8(sp) + 8001e388: a009 j 8001e38a <.LBB1_14+0x6a> + SleepLockGuard { + 8001e38a: 65a2 ld a1,8(sp) + 8001e38c: 6502 ld a0,0(sp) + 8001e38e: e0aa sd a0,64(sp) + 8001e390: e4ae sd a1,72(sp) + } + 8001e392: 60e6 ld ra,88(sp) + 8001e394: 6125 addi sp,sp,96 + 8001e396: 8082 ret + +Disassembly of section .text._ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h4136b26b6a44129dE: + +000000008001e398 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h4136b26b6a44129dE>: + pub fn unlock(&self) { + 8001e398: 7179 addi sp,sp,-48 + 8001e39a: f406 sd ra,40(sp) + 8001e39c: e42a sd a0,8(sp) + 8001e39e: ec2a sd a0,24(sp) + let guard = self.lock.acquire(); + 8001e3a0: ffff3097 auipc ra,0xffff3 + 8001e3a4: ca2080e7 jalr -862(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001e3a8: 85aa mv a1,a0 + 8001e3aa: e82e sd a1,16(sp) + 8001e3ac: f02a sd a0,32(sp) + 8001e3ae: a009 j 8001e3b0 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h4136b26b6a44129dE+0x18> + self.locked.set(false); + 8001e3b0: 6522 ld a0,8(sp) + 8001e3b2: 03050513 addi a0,a0,48 + 8001e3b6: 4581 li a1,0 + 8001e3b8: fffe7097 auipc ra,0xfffe7 + 8001e3bc: eee080e7 jalr -274(ra) # 800052a6 <_ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E> + 8001e3c0: a009 j 8001e3c2 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h4136b26b6a44129dE+0x2a> + self.wake_up(); + 8001e3c2: 6522 ld a0,8(sp) + 8001e3c4: 00000097 auipc ra,0x0 + 8001e3c8: 064080e7 jalr 100(ra) # 8001e428 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17h37728224df905678E> + 8001e3cc: a009 j 8001e3ce <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h4136b26b6a44129dE+0x36> + drop(guard); + 8001e3ce: 6542 ld a0,16(sp) + 8001e3d0: 00000097 auipc ra,0x0 + 8001e3d4: a18080e7 jalr -1512(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001e3d8: a009 j 8001e3da <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h4136b26b6a44129dE+0x42> + } + 8001e3da: 70a2 ld ra,40(sp) + 8001e3dc: 6145 addi sp,sp,48 + 8001e3de: 8082 ret + +Disassembly of section .text._ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h5d72a4d2b4e61b31E: + +000000008001e3e0 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h5d72a4d2b4e61b31E>: + pub fn unlock(&self) { + 8001e3e0: 7179 addi sp,sp,-48 + 8001e3e2: f406 sd ra,40(sp) + 8001e3e4: e42a sd a0,8(sp) + 8001e3e6: ec2a sd a0,24(sp) + let guard = self.lock.acquire(); + 8001e3e8: ffff3097 auipc ra,0xffff3 + 8001e3ec: c5a080e7 jalr -934(ra) # 80011042 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h9e4ec996505257d2E> + 8001e3f0: 85aa mv a1,a0 + 8001e3f2: e82e sd a1,16(sp) + 8001e3f4: f02a sd a0,32(sp) + 8001e3f6: a009 j 8001e3f8 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h5d72a4d2b4e61b31E+0x18> + self.locked.set(false); + 8001e3f8: 6522 ld a0,8(sp) + 8001e3fa: 03050513 addi a0,a0,48 + 8001e3fe: 4581 li a1,0 + 8001e400: fffe7097 auipc ra,0xfffe7 + 8001e404: ea6080e7 jalr -346(ra) # 800052a6 <_ZN4core4cell13Cell$LT$T$GT$3set17h60fabb73b23781c0E> + 8001e408: a009 j 8001e40a <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h5d72a4d2b4e61b31E+0x2a> + self.wake_up(); + 8001e40a: 6522 ld a0,8(sp) + 8001e40c: 00000097 auipc ra,0x0 + 8001e410: 04c080e7 jalr 76(ra) # 8001e458 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17hd47f70df8bbd0f23E> + 8001e414: a009 j 8001e416 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h5d72a4d2b4e61b31E+0x36> + drop(guard); + 8001e416: 6542 ld a0,16(sp) + 8001e418: 00000097 auipc ra,0x0 + 8001e41c: 9d0080e7 jalr -1584(ra) # 8001dde8 <_ZN4core3mem4drop17h10f52240d03cf3b6E> + 8001e420: a009 j 8001e422 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$6unlock17h5d72a4d2b4e61b31E+0x42> + } + 8001e422: 70a2 ld ra,40(sp) + 8001e424: 6145 addi sp,sp,48 + 8001e426: 8082 ret + +Disassembly of section .text._ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17h37728224df905678E: + +000000008001e428 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17h37728224df905678E>: + fn wake_up(&self) { + 8001e428: 1101 addi sp,sp,-32 + 8001e42a: ec06 sd ra,24(sp) + 8001e42c: e82a sd a0,16(sp) + PROC_MANAGER.wake_up(self.locked.as_ptr() as usize); + 8001e42e: 03050513 addi a0,a0,48 + 8001e432: fffe7097 auipc ra,0xfffe7 + 8001e436: ecc080e7 jalr -308(ra) # 800052fe <_ZN4core4cell13Cell$LT$T$GT$6as_ptr17h2323c3e07ac4531cE> + 8001e43a: e42a sd a0,8(sp) + 8001e43c: a009 j 8001e43e <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17h37728224df905678E+0x16> + 8001e43e: 65a2 ld a1,8(sp) + +000000008001e440 <.LBB4_3>: + 8001e440: 0003b517 auipc a0,0x3b + 8001e444: f9050513 addi a0,a0,-112 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8001e448: ffff0097 auipc ra,0xffff0 + 8001e44c: db8080e7 jalr -584(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8001e450: a009 j 8001e452 <.LBB4_3+0x12> + } + 8001e452: 60e2 ld ra,24(sp) + 8001e454: 6105 addi sp,sp,32 + 8001e456: 8082 ret + +Disassembly of section .text._ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17hd47f70df8bbd0f23E: + +000000008001e458 <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17hd47f70df8bbd0f23E>: + fn wake_up(&self) { + 8001e458: 1101 addi sp,sp,-32 + 8001e45a: ec06 sd ra,24(sp) + 8001e45c: e82a sd a0,16(sp) + PROC_MANAGER.wake_up(self.locked.as_ptr() as usize); + 8001e45e: 03050513 addi a0,a0,48 + 8001e462: fffe7097 auipc ra,0xfffe7 + 8001e466: e9c080e7 jalr -356(ra) # 800052fe <_ZN4core4cell13Cell$LT$T$GT$6as_ptr17h2323c3e07ac4531cE> + 8001e46a: e42a sd a0,8(sp) + 8001e46c: a009 j 8001e46e <_ZN6kernel4lock9sleeplock18SleepLock$LT$T$GT$7wake_up17hd47f70df8bbd0f23E+0x16> + 8001e46e: 65a2 ld a1,8(sp) + +000000008001e470 <.LBB5_3>: + 8001e470: 0003b517 auipc a0,0x3b + 8001e474: f6050513 addi a0,a0,-160 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8001e478: ffff0097 auipc ra,0xffff0 + 8001e47c: d88080e7 jalr -632(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8001e480: a009 j 8001e482 <.LBB5_3+0x12> + } + 8001e482: 60e2 ld ra,24(sp) + 8001e484: 6105 addi sp,sp,32 + 8001e486: 8082 ret + +Disassembly of section .text._ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17he0c0fee5a6939b40E: + +000000008001e488 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17he0c0fee5a6939b40E>: + fn deref(&self) -> &T { + 8001e488: 1141 addi sp,sp,-16 + 8001e48a: e42a sd a0,8(sp) + &*self.data + 8001e48c: 6508 ld a0,8(a0) + } + 8001e48e: 0141 addi sp,sp,16 + 8001e490: 8082 ret + +Disassembly of section .text._ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E: + +000000008001e492 <_ZN92_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hfc7812d7ca7ab1e1E>: + fn deref(&self) -> &T { + 8001e492: 1141 addi sp,sp,-16 + 8001e494: e42a sd a0,8(sp) + &*self.data + 8001e496: 6508 ld a0,8(a0) + } + 8001e498: 0141 addi sp,sp,16 + 8001e49a: 8082 ret + +Disassembly of section .text._ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h29ddb6c86f63b2e9E: + +000000008001e49c <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17h29ddb6c86f63b2e9E>: + fn deref_mut(&mut self) -> &mut T { + 8001e49c: 1141 addi sp,sp,-16 + 8001e49e: e42a sd a0,8(sp) + &mut *self.data + 8001e4a0: 6508 ld a0,8(a0) + } + 8001e4a2: 0141 addi sp,sp,16 + 8001e4a4: 8082 ret + +Disassembly of section .text._ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E: + +000000008001e4a6 <_ZN95_$LT$kernel..lock..sleeplock..SleepLockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hc2f7575c00bf7e95E>: + fn deref_mut(&mut self) -> &mut T { + 8001e4a6: 1141 addi sp,sp,-16 + 8001e4a8: e42a sd a0,8(sp) + &mut *self.data + 8001e4aa: 6508 ld a0,8(a0) + } + 8001e4ac: 0141 addi sp,sp,16 + 8001e4ae: 8082 ret + +Disassembly of section .text._ZN6kernel7process8fork_ret17hc655e7da156c9445E: + +000000008001e4b0 <_ZN6kernel7process8fork_ret17hc655e7da156c9445E>: + +/// A fork child's very first scheduling by scheduler() +/// will switch to forkret. +/// +/// Need to be handled carefully, because CPU use ra to jump here +unsafe fn fork_ret() -> ! { + 8001e4b0: 7111 addi sp,sp,-256 + 8001e4b2: fd86 sd ra,248(sp) + 8001e4b4: 6509 lui a0,0x2 + 8001e4b6: 0c85059b addiw a1,a0,200 + +000000008001e4ba <.LBB0_16>: + 8001e4ba: 0003b517 auipc a0,0x3b + 8001e4be: f1650513 addi a0,a0,-234 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 8001e4c2: 952e add a0,a0,a1 + static mut FIRST: bool = true; + + // Still holding p->lock from scheduler + PROC_MANAGER.tasks_lock.release(); + 8001e4c4: ffff3097 auipc ra,0xffff3 + 8001e4c8: 21c080e7 jalr 540(ra) # 800116e0 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7release17hfda5e7f2f4cdedb7E> + 8001e4cc: a009 j 8001e4ce <.LBB0_17> + +000000008001e4ce <.LBB0_17>: + + if FIRST { + 8001e4ce: 00045517 auipc a0,0x45 + 8001e4d2: b3250513 addi a0,a0,-1230 # 80063000 <_ZN6kernel7process8fork_ret5FIRST17h9d39a034a1560a70E> + 8001e4d6: 00054503 lbu a0,0(a0) + 8001e4da: 8905 andi a0,a0,1 + 8001e4dc: 4581 li a1,0 + 8001e4de: 02b50063 beq a0,a1,8001e4fe <.LBB0_18+0x1a> + 8001e4e2: a009 j 8001e4e4 <.LBB0_18> + +000000008001e4e4 <.LBB0_18>: + // File system initialization + FIRST = false; + 8001e4e4: 00045597 auipc a1,0x45 + 8001e4e8: b1c58593 addi a1,a1,-1252 # 80063000 <_ZN6kernel7process8fork_ret5FIRST17h9d39a034a1560a70E> + 8001e4ec: 4501 li a0,0 + 8001e4ee: 00a58023 sb a0,0(a1) + 8001e4f2: 4505 li a0,1 + init(ROOTDEV); + 8001e4f4: fffee097 auipc ra,0xfffee + 8001e4f8: 14a080e7 jalr 330(ra) # 8000c63e <_ZN6kernel2fs4init17h0544bbe6b6556f7eE> + 8001e4fc: a011 j 8001e500 <.LBB0_18+0x1c> + if FIRST { + 8001e4fe: a011 j 8001e502 <.LBB0_19> + 8001e500: a009 j 8001e502 <.LBB0_19> + +000000008001e502 <.LBB0_19>: + } + // println!("user trap return"); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + 8001e502: 00048517 auipc a0,0x48 + 8001e506: c3e50513 addi a0,a0,-962 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001e50a: ffff4097 auipc ra,0xffff4 + 8001e50e: f4e080e7 jalr -178(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001e512: e8aa sd a0,80(sp) + 8001e514: a009 j 8001e516 <.LBB0_19+0x14> + 8001e516: 6546 ld a0,80(sp) + +000000008001e518 <.LBB0_20>: + 8001e518: 0000e597 auipc a1,0xe + 8001e51c: 4c858593 addi a1,a1,1224 # 8002c9e0 <.L__unnamed_1> + 8001e520: ffff1097 auipc ra,0xffff1 + 8001e524: 270080e7 jalr 624(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001e528: e4aa sd a0,72(sp) + 8001e52a: a009 j 8001e52c <.LBB0_20+0x14> + 8001e52c: 6526 ld a0,72(sp) + 8001e52e: e9aa sd a0,208(sp) + let tf = unsafe { &mut *task.trapframe } ; + 8001e530: 7108 ld a0,32(a0) + 8001e532: e0aa sd a0,64(sp) + 8001e534: edaa sd a0,216(sp) + if tf.a7 == 40 { + 8001e536: 7548 ld a0,168(a0) + 8001e538: 02800593 li a1,40 + 8001e53c: 02b51e63 bne a0,a1,8001e578 <.LBB0_21+0x16> + 8001e540: a009 j 8001e542 <.LBB0_20+0x2a> + println!("In fork_ret, pid {} epc {} sp {}", task.pid, tf.epc, tf.sp); + 8001e542: 6586 ld a1,64(sp) + 8001e544: 6526 ld a0,72(sp) + 8001e546: 3f050513 addi a0,a0,1008 + 8001e54a: 01858613 addi a2,a1,24 + 8001e54e: f032 sd a2,32(sp) + 8001e550: 03058593 addi a1,a1,48 + 8001e554: f42e sd a1,40(sp) + 8001e556: fd2a sd a0,184(sp) + 8001e558: e1b2 sd a2,192(sp) + 8001e55a: e5ae sd a1,200(sp) + 8001e55c: f1aa sd a0,224(sp) + 8001e55e: f5b2 sd a2,232(sp) + 8001e560: f9ae sd a1,240(sp) + +000000008001e562 <.LBB0_21>: + 8001e562: 00007597 auipc a1,0x7 + 8001e566: 33e58593 addi a1,a1,830 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001e56a: 00002097 auipc ra,0x2 + 8001e56e: 004080e7 jalr 4(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001e572: f82a sd a0,48(sp) + 8001e574: fc2e sd a1,56(sp) + 8001e576: a011 j 8001e57a <.LBB0_21+0x18> + if tf.a7 == 40 { + 8001e578: a88d j 8001e5ea <.LBB0_24+0x28> + println!("In fork_ret, pid {} epc {} sp {}", task.pid, tf.epc, tf.sp); + 8001e57a: 7502 ld a0,32(sp) + +000000008001e57c <.LBB0_22>: + 8001e57c: 00007597 auipc a1,0x7 + 8001e580: 32458593 addi a1,a1,804 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001e584: 00002097 auipc ra,0x2 + 8001e588: fea080e7 jalr -22(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001e58c: e82a sd a0,16(sp) + 8001e58e: ec2e sd a1,24(sp) + 8001e590: a009 j 8001e592 <.LBB0_22+0x16> + 8001e592: 7522 ld a0,40(sp) + +000000008001e594 <.LBB0_23>: + 8001e594: 00007597 auipc a1,0x7 + 8001e598: 30c58593 addi a1,a1,780 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001e59c: 00002097 auipc ra,0x2 + 8001e5a0: fd2080e7 jalr -46(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001e5a4: e02a sd a0,0(sp) + 8001e5a6: e42e sd a1,8(sp) + 8001e5a8: a009 j 8001e5aa <.LBB0_23+0x16> + 8001e5aa: 6522 ld a0,8(sp) + 8001e5ac: 6582 ld a1,0(sp) + 8001e5ae: 6662 ld a2,24(sp) + 8001e5b0: 66c2 ld a3,16(sp) + 8001e5b2: 7762 ld a4,56(sp) + 8001e5b4: 77c2 ld a5,48(sp) + 8001e5b6: e53e sd a5,136(sp) + 8001e5b8: e93a sd a4,144(sp) + 8001e5ba: ed36 sd a3,152(sp) + 8001e5bc: f132 sd a2,160(sp) + 8001e5be: f52e sd a1,168(sp) + 8001e5c0: f92a sd a0,176(sp) + +000000008001e5c2 <.LBB0_24>: + 8001e5c2: 0000e597 auipc a1,0xe + 8001e5c6: 44e58593 addi a1,a1,1102 # 8002ca10 <.L__unnamed_2> + 8001e5ca: 08a8 addi a0,sp,88 + 8001e5cc: 4611 li a2,4 + 8001e5ce: 0134 addi a3,sp,136 + 8001e5d0: 470d li a4,3 + 8001e5d2: fffe7097 auipc ra,0xfffe7 + 8001e5d6: fb8080e7 jalr -72(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001e5da: a009 j 8001e5dc <.LBB0_24+0x1a> + 8001e5dc: 08a8 addi a0,sp,88 + 8001e5de: 00000097 auipc ra,0x0 + 8001e5e2: 61a080e7 jalr 1562(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001e5e6: a009 j 8001e5e8 <.LBB0_24+0x26> + if tf.a7 == 40 { + 8001e5e8: a009 j 8001e5ea <.LBB0_24+0x28> + } + user_trap_ret(); + 8001e5ea: fffe8097 auipc ra,0xfffe8 + 8001e5ee: 08c080e7 jalr 140(ra) # 80006676 + ... + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h3a39754d1b9c54a7E: + +000000008001e5f4 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h3a39754d1b9c54a7E>: + pub const unsafe fn add(self, count: usize) -> Self + 8001e5f4: 1101 addi sp,sp,-32 + 8001e5f6: ec06 sd ra,24(sp) + 8001e5f8: e42a sd a0,8(sp) + 8001e5fa: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 8001e5fc: 00000097 auipc ra,0x0 + 8001e600: 014080e7 jalr 20(ra) # 8001e610 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17he4f714b54e872ab3E> + 8001e604: e02a sd a0,0(sp) + 8001e606: a009 j 8001e608 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h3a39754d1b9c54a7E+0x14> + } + 8001e608: 6502 ld a0,0(sp) + 8001e60a: 60e2 ld ra,24(sp) + 8001e60c: 6105 addi sp,sp,32 + 8001e60e: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17he4f714b54e872ab3E: + +000000008001e610 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17he4f714b54e872ab3E>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 8001e610: 1101 addi sp,sp,-32 + 8001e612: e42a sd a0,8(sp) + 8001e614: e82e sd a1,16(sp) + 8001e616: 03000613 li a2,48 + unsafe { intrinsics::offset(self, count) as *mut T } + 8001e61a: 02c585b3 mul a1,a1,a2 + 8001e61e: 952e add a0,a0,a1 + 8001e620: e02a sd a0,0(sp) + 8001e622: ec2a sd a0,24(sp) + 8001e624: a009 j 8001e626 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17he4f714b54e872ab3E+0x16> + } + 8001e626: 6502 ld a0,0(sp) + 8001e628: 6105 addi sp,sp,32 + 8001e62a: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h1d4bdf7317c60b96E: + +000000008001e62c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h1d4bdf7317c60b96E>: + pub const fn is_null(self) -> bool { + 8001e62c: 1101 addi sp,sp,-32 + 8001e62e: ec06 sd ra,24(sp) + 8001e630: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 8001e632: e42a sd a0,8(sp) + 8001e634: a009 j 8001e636 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h1d4bdf7317c60b96E+0xa> + 8001e636: 6522 ld a0,8(sp) + 8001e638: 4581 li a1,0 + 8001e63a: 00005097 auipc ra,0x5 + 8001e63e: 8d0080e7 jalr -1840(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 8001e642: e02a sd a0,0(sp) + 8001e644: a009 j 8001e646 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h1d4bdf7317c60b96E+0x1a> + } + 8001e646: 6502 ld a0,0(sp) + 8001e648: 60e2 ld ra,24(sp) + 8001e64a: 6105 addi sp,sp,32 + 8001e64c: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17hb34fa5c829e1d9f2E: + +000000008001e64e <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17hb34fa5c829e1d9f2E>: + pub const fn as_mut_ptr(&mut self) -> *mut T { + 8001e64e: 1141 addi sp,sp,-16 + 8001e650: e02a sd a0,0(sp) + 8001e652: e42e sd a1,8(sp) + } + 8001e654: 0141 addi sp,sp,16 + 8001e656: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h5af32af5d380fccdE: + +000000008001e658 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h5af32af5d380fccdE>: + pub const fn len(&self) -> usize { + 8001e658: 7179 addi sp,sp,-48 + 8001e65a: e42e sd a1,8(sp) + 8001e65c: 85aa mv a1,a0 + 8001e65e: 6522 ld a0,8(sp) + 8001e660: f02e sd a1,32(sp) + 8001e662: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 8001e664: e82e sd a1,16(sp) + 8001e666: ec2a sd a0,24(sp) + } + 8001e668: 6145 addi sp,sp,48 + 8001e66a: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hdf73a8173be099ebE: + +000000008001e66c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hdf73a8173be099ebE>: + pub fn iter_mut(&mut self) -> IterMut<'_, T> { + 8001e66c: 7179 addi sp,sp,-48 + 8001e66e: f406 sd ra,40(sp) + 8001e670: ec2a sd a0,24(sp) + 8001e672: f02e sd a1,32(sp) + IterMut::new(self) + 8001e674: fffed097 auipc ra,0xfffed + 8001e678: fe8080e7 jalr -24(ra) # 8000b65c <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h41c69a0e1f2809d6E> + 8001e67c: e42a sd a0,8(sp) + 8001e67e: e82e sd a1,16(sp) + 8001e680: a009 j 8001e682 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17hdf73a8173be099ebE+0x16> + } + 8001e682: 65c2 ld a1,16(sp) + 8001e684: 6522 ld a0,8(sp) + 8001e686: 70a2 ld ra,40(sp) + 8001e688: 6145 addi sp,sp,48 + 8001e68a: 8082 ret + +Disassembly of section .text._ZN4core5clone5impls62_$LT$impl$u20$core..clone..Clone$u20$for$u20$$BP$mut$u20$T$GT$5clone17h768b01e7342b2128E: + +000000008001e68c <_ZN4core5clone5impls62_$LT$impl$u20$core..clone..Clone$u20$for$u20$$BP$mut$u20$T$GT$5clone17h768b01e7342b2128E>: + } + + #[stable(feature = "rust1", since = "1.0.0")] + impl Clone for *mut T { + #[inline] + fn clone(&self) -> Self { + 8001e68c: 1141 addi sp,sp,-16 + 8001e68e: e42a sd a0,8(sp) + *self + 8001e690: 6108 ld a0,0(a0) + } + 8001e692: 0141 addi sp,sp,16 + 8001e694: 8082 ret + +Disassembly of section .text._ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$i16$GT$5clone17h91da98197f473cc1E: + +000000008001e696 <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$i16$GT$5clone17h91da98197f473cc1E>: + fn clone(&self) -> Self { + 8001e696: 1141 addi sp,sp,-16 + 8001e698: e42a sd a0,8(sp) + } + 8001e69a: 00051503 lh a0,0(a0) + 8001e69e: 0141 addi sp,sp,16 + 8001e6a0: 8082 ret + +Disassembly of section .text._ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u16$GT$5clone17h7947cab6b7dc7abbE: + +000000008001e6a2 <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u16$GT$5clone17h7947cab6b7dc7abbE>: + fn clone(&self) -> Self { + 8001e6a2: 1141 addi sp,sp,-16 + 8001e6a4: e42a sd a0,8(sp) + } + 8001e6a6: 00051503 lh a0,0(a0) + 8001e6aa: 0141 addi sp,sp,16 + 8001e6ac: 8082 ret + +Disassembly of section .text._ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u32$GT$5clone17ha1019ce9fdc4d620E: + +000000008001e6ae <_ZN4core5clone5impls52_$LT$impl$u20$core..clone..Clone$u20$for$u20$u32$GT$5clone17ha1019ce9fdc4d620E>: + fn clone(&self) -> Self { + 8001e6ae: 1141 addi sp,sp,-16 + 8001e6b0: e42a sd a0,8(sp) + } + 8001e6b2: 4108 lw a0,0(a0) + 8001e6b4: 0141 addi sp,sp,16 + 8001e6b6: 8082 ret + +Disassembly of section .text._ZN4core5clone5impls53_$LT$impl$u20$core..clone..Clone$u20$for$u20$bool$GT$5clone17hd6e1e19c635da345E: + +000000008001e6b8 <_ZN4core5clone5impls53_$LT$impl$u20$core..clone..Clone$u20$for$u20$bool$GT$5clone17hd6e1e19c635da345E>: + fn clone(&self) -> Self { + 8001e6b8: 1141 addi sp,sp,-16 + 8001e6ba: e42a sd a0,8(sp) + *self + 8001e6bc: 00054503 lbu a0,0(a0) + } + 8001e6c0: 0141 addi sp,sp,16 + 8001e6c2: 8082 ret + +Disassembly of section .text._ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E: + +000000008001e6c4 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h35e6cace0a4ed712E>: + fn clone(&self) -> Self { + 8001e6c4: 1141 addi sp,sp,-16 + 8001e6c6: e42a sd a0,8(sp) + *self + 8001e6c8: 6108 ld a0,0(a0) + } + 8001e6ca: 0141 addi sp,sp,16 + 8001e6cc: 8082 ret + +Disassembly of section .text._ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE: + +000000008001e6ce <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE>: +pub use page_table_entry::*; +pub use kernel_map::*; + +use crate::arch::riscv::qemu::layout::PGSIZE; + +pub fn page_round_up(addr: usize) -> usize{ + 8001e6ce: 1101 addi sp,sp,-32 + 8001e6d0: 85aa mv a1,a0 + 8001e6d2: ec2e sd a1,24(sp) + 8001e6d4: 6505 lui a0,0x1 + (addr + PGSIZE - 1) & !(PGSIZE - 1) + 8001e6d6: 952e add a0,a0,a1 + 8001e6d8: e82a sd a0,16(sp) + 8001e6da: 00b56f63 bltu a0,a1,8001e6f8 <.LBB0_5> + 8001e6de: a009 j 8001e6e0 <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE+0x12> + 8001e6e0: 6542 ld a0,16(sp) + 8001e6e2: fff50593 addi a1,a0,-1 # fff <.Lline_table_start0+0x13f> + 8001e6e6: e42e sd a1,8(sp) + 8001e6e8: 02b56663 bltu a0,a1,8001e714 <.LBB0_7> + 8001e6ec: a009 j 8001e6ee <_ZN6kernel6memory7mapping13page_round_up17h53b8f5a3d9b0c04fE+0x20> + 8001e6ee: 6522 ld a0,8(sp) + 8001e6f0: 75fd lui a1,0xfffff + 8001e6f2: 8d6d and a0,a0,a1 +} + 8001e6f4: 6105 addi sp,sp,32 + 8001e6f6: 8082 ret + +000000008001e6f8 <.LBB0_5>: + (addr + PGSIZE - 1) & !(PGSIZE - 1) + 8001e6f8: 0000e517 auipc a0,0xe + 8001e6fc: 39850513 addi a0,a0,920 # 8002ca90 + +000000008001e700 <.LBB0_6>: + 8001e700: 0000e617 auipc a2,0xe + 8001e704: 37060613 addi a2,a2,880 # 8002ca70 <.L__unnamed_1> + 8001e708: 45f1 li a1,28 + 8001e70a: 00005097 auipc ra,0x5 + 8001e70e: a3a080e7 jalr -1478(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001e714 <.LBB0_7>: + 8001e714: 0000e517 auipc a0,0xe + 8001e718: 3bc50513 addi a0,a0,956 # 8002cad0 + +000000008001e71c <.LBB0_8>: + 8001e71c: 0000e617 auipc a2,0xe + 8001e720: 39460613 addi a2,a2,916 # 8002cab0 <.L__unnamed_2> + 8001e724: 02100593 li a1,33 + 8001e728: 00005097 auipc ra,0x5 + 8001e72c: a1c080e7 jalr -1508(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel4arch5riscv8register3sie4read17h0ba5d34b74a7fc92E: + +000000008001e732 <_ZN6kernel4arch5riscv8register3sie4read17h0ba5d34b74a7fc92E>: + STIE = 1 << 5, // timer + SSIE = 1 << 1, // software +} + +#[inline] +pub unsafe fn read() -> usize { + 8001e732: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, sie":"=r"(ret):::"volatile"); + 8001e734: 10402573 csrr a0,sie + 8001e738: e42a sd a0,8(sp) + ret +} + 8001e73a: 0141 addi sp,sp,16 + 8001e73c: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register3sie5write17h4451b4d1e5667981E: + +000000008001e73e <_ZN6kernel4arch5riscv8register3sie5write17h4451b4d1e5667981E>: + +#[inline] +pub unsafe fn write(x:usize) { + 8001e73e: 1141 addi sp,sp,-16 + 8001e740: e42a sd a0,8(sp) + llvm_asm!("csrw sie, $0"::"r"(x)::"volatile"); + 8001e742: 10451073 csrw sie,a0 +} + 8001e746: 0141 addi sp,sp,16 + 8001e748: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register3sie7intr_on17ha44057f13b8cbd2fE: + +000000008001e74a <_ZN6kernel4arch5riscv8register3sie7intr_on17ha44057f13b8cbd2fE>: + +/// enable all software interrupts +/// still need to set SIE bit in sstatus +pub unsafe fn intr_on() { + 8001e74a: 1141 addi sp,sp,-16 + let mut sie = read(); + 8001e74c: e406 sd ra,8(sp) + 8001e74e: 00000097 auipc ra,0x0 + 8001e752: fe4080e7 jalr -28(ra) # 8001e732 <_ZN6kernel4arch5riscv8register3sie4read17h0ba5d34b74a7fc92E> + 8001e756: e02a sd a0,0(sp) + 8001e758: a009 j 8001e75a <_ZN6kernel4arch5riscv8register3sie7intr_on17ha44057f13b8cbd2fE+0x10> + sie |= SIE::SSIE as usize | SIE::STIE as usize | SIE::SEIE as usize; + 8001e75a: 6502 ld a0,0(sp) + 8001e75c: 22256513 ori a0,a0,546 + 8001e760: e02a sd a0,0(sp) + write(sie); + 8001e762: 00000097 auipc ra,0x0 + 8001e766: fdc080e7 jalr -36(ra) # 8001e73e <_ZN6kernel4arch5riscv8register3sie5write17h4451b4d1e5667981E> + 8001e76a: a009 j 8001e76c <_ZN6kernel4arch5riscv8register3sie7intr_on17ha44057f13b8cbd2fE+0x22> + 8001e76c: 60a2 ld ra,8(sp) + 8001e76e: 0141 addi sp,sp,16 + 8001e770: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register3sip4read17h3bdc92cfb299a0b6E: + +000000008001e772 <_ZN6kernel4arch5riscv8register3sip4read17h3bdc92cfb299a0b6E>: +// Supervisor Interrupt Pending + +const SSIP: usize = 1 << 1; + +#[inline] +pub unsafe fn read() -> usize { + 8001e772: 1141 addi sp,sp,-16 + let sip: usize; + llvm_asm!("csrr $0, sip":"=r"(sip):::"volatile"); + 8001e774: 14402573 csrr a0,sip + 8001e778: e42a sd a0,8(sp) + sip +} + 8001e77a: 0141 addi sp,sp,16 + 8001e77c: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register3sip5write17hc1eecfa799475477E: + +000000008001e77e <_ZN6kernel4arch5riscv8register3sip5write17hc1eecfa799475477E>: + +#[inline] +pub unsafe fn write(sip: usize){ + 8001e77e: 1141 addi sp,sp,-16 + 8001e780: e42a sd a0,8(sp) + llvm_asm!("csrw sip, $0"::"r"(sip)::"volatile"); + 8001e782: 14451073 csrw sip,a0 +} + 8001e786: 0141 addi sp,sp,16 + 8001e788: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register3sip10clear_ssip17h3546c4610df6574fE: + +000000008001e78a <_ZN6kernel4arch5riscv8register3sip10clear_ssip17h3546c4610df6574fE>: + +pub fn clear_ssip() { + 8001e78a: 1141 addi sp,sp,-16 + unsafe { + write(read() & !SSIP); + 8001e78c: e406 sd ra,8(sp) + 8001e78e: 00000097 auipc ra,0x0 + 8001e792: fe4080e7 jalr -28(ra) # 8001e772 <_ZN6kernel4arch5riscv8register3sip4read17h3bdc92cfb299a0b6E> + 8001e796: e02a sd a0,0(sp) + 8001e798: a009 j 8001e79a <_ZN6kernel4arch5riscv8register3sip10clear_ssip17h3546c4610df6574fE+0x10> + 8001e79a: 6502 ld a0,0(sp) + 8001e79c: 9975 andi a0,a0,-3 + 8001e79e: 00000097 auipc ra,0x0 + 8001e7a2: fe0080e7 jalr -32(ra) # 8001e77e <_ZN6kernel4arch5riscv8register3sip5write17hc1eecfa799475477E> + 8001e7a6: a009 j 8001e7a8 <_ZN6kernel4arch5riscv8register3sip10clear_ssip17h3546c4610df6574fE+0x1e> + } + 8001e7a8: 60a2 ld ra,8(sp) + 8001e7aa: 0141 addi sp,sp,16 + 8001e7ac: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4plic12PLIC_SENABLE17h7b6da31aa84dc734E: + +000000008001e7ae <_ZN6kernel6driver4plic12PLIC_SENABLE17h7b6da31aa84dc734E>: + +fn PLIC_MENABLE(hart_id: usize) -> usize { + PLIC_BASE + 0x2000 + hart_id * 0x100 +} + +fn PLIC_SENABLE(hart_id: usize) -> usize { + 8001e7ae: 1101 addi sp,sp,-32 + 8001e7b0: 85aa mv a1,a0 + 8001e7b2: ec2e sd a1,24(sp) + 8001e7b4: 4505 li a0,1 + 8001e7b6: 1562 slli a0,a0,0x38 + 8001e7b8: 157d addi a0,a0,-1 + PLIC_BASE + 0x2080 + hart_id * 0x100 + 8001e7ba: 8d6d and a0,a0,a1 + 8001e7bc: 00859613 slli a2,a1,0x8 + 8001e7c0: e832 sd a2,16(sp) + 8001e7c2: 02b51063 bne a0,a1,8001e7e2 <.LBB0_5> + 8001e7c6: a009 j 8001e7c8 <_ZN6kernel6driver4plic12PLIC_SENABLE17h7b6da31aa84dc734E+0x1a> + 8001e7c8: 65c2 ld a1,16(sp) + 8001e7ca: 0c002537 lui a0,0xc002 + 8001e7ce: 0805051b addiw a0,a0,128 + 8001e7d2: 952e add a0,a0,a1 + 8001e7d4: e42a sd a0,8(sp) + 8001e7d6: 02b56563 bltu a0,a1,8001e800 <.LBB0_7> + 8001e7da: a009 j 8001e7dc <_ZN6kernel6driver4plic12PLIC_SENABLE17h7b6da31aa84dc734E+0x2e> +} + 8001e7dc: 6522 ld a0,8(sp) + 8001e7de: 6105 addi sp,sp,32 + 8001e7e0: 8082 ret + +000000008001e7e2 <.LBB0_5>: + PLIC_BASE + 0x2080 + hart_id * 0x100 + 8001e7e2: 0000e517 auipc a0,0xe + 8001e7e6: 33e50513 addi a0,a0,830 # 8002cb20 + +000000008001e7ea <.LBB0_6>: + 8001e7ea: 0000e617 auipc a2,0xe + 8001e7ee: 31e60613 addi a2,a2,798 # 8002cb08 <.L__unnamed_1> + 8001e7f2: 02100593 li a1,33 + 8001e7f6: 00005097 auipc ra,0x5 + 8001e7fa: 94e080e7 jalr -1714(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001e800 <.LBB0_7>: + 8001e800: 0000e517 auipc a0,0xe + 8001e804: 36050513 addi a0,a0,864 # 8002cb60 + +000000008001e808 <.LBB0_8>: + 8001e808: 0000e617 auipc a2,0xe + 8001e80c: 34060613 addi a2,a2,832 # 8002cb48 <.L__unnamed_2> + 8001e810: 45f1 li a1,28 + 8001e812: 00005097 auipc ra,0x5 + 8001e816: 932080e7 jalr -1742(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver4plic14PLIC_SPRIORITY17h6633467d20099d1cE: + +000000008001e81c <_ZN6kernel6driver4plic14PLIC_SPRIORITY17h6633467d20099d1cE>: + +fn PLIC_MPRIORITY(hart_id: usize) -> usize { + PLIC_BASE + 0x200000 + hart_id * 0x2000 +} + +fn PLIC_SPRIORITY(hart_id: usize) -> usize { + 8001e81c: 1101 addi sp,sp,-32 + 8001e81e: 85aa mv a1,a0 + 8001e820: ec2e sd a1,24(sp) + 8001e822: 4505 li a0,1 + 8001e824: 154e slli a0,a0,0x33 + 8001e826: 157d addi a0,a0,-1 + PLIC_BASE + 0x201000 + hart_id * 0x2000 + 8001e828: 8d6d and a0,a0,a1 + 8001e82a: 00d59613 slli a2,a1,0xd + 8001e82e: e832 sd a2,16(sp) + 8001e830: 00b51e63 bne a0,a1,8001e84c <.LBB1_5> + 8001e834: a009 j 8001e836 <_ZN6kernel6driver4plic14PLIC_SPRIORITY17h6633467d20099d1cE+0x1a> + 8001e836: 65c2 ld a1,16(sp) + 8001e838: 0c201537 lui a0,0xc201 + 8001e83c: 952e add a0,a0,a1 + 8001e83e: e42a sd a0,8(sp) + 8001e840: 02b56563 bltu a0,a1,8001e86a <.LBB1_7> + 8001e844: a009 j 8001e846 <_ZN6kernel6driver4plic14PLIC_SPRIORITY17h6633467d20099d1cE+0x2a> +} + 8001e846: 6522 ld a0,8(sp) + 8001e848: 6105 addi sp,sp,32 + 8001e84a: 8082 ret + +000000008001e84c <.LBB1_5>: + PLIC_BASE + 0x201000 + hart_id * 0x2000 + 8001e84c: 0000e517 auipc a0,0xe + 8001e850: 2d450513 addi a0,a0,724 # 8002cb20 + +000000008001e854 <.LBB1_6>: + 8001e854: 0000e617 auipc a2,0xe + 8001e858: 32c60613 addi a2,a2,812 # 8002cb80 <.L__unnamed_3> + 8001e85c: 02100593 li a1,33 + 8001e860: 00005097 auipc ra,0x5 + 8001e864: 8e4080e7 jalr -1820(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001e86a <.LBB1_7>: + 8001e86a: 0000e517 auipc a0,0xe + 8001e86e: 2f650513 addi a0,a0,758 # 8002cb60 + +000000008001e872 <.LBB1_8>: + 8001e872: 0000e617 auipc a2,0xe + 8001e876: 32660613 addi a2,a2,806 # 8002cb98 <.L__unnamed_4> + 8001e87a: 45f1 li a1,28 + 8001e87c: 00005097 auipc ra,0x5 + 8001e880: 8c8080e7 jalr -1848(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver4plic11PLIC_SCLAIM17h917e90647b3a6232E: + +000000008001e886 <_ZN6kernel6driver4plic11PLIC_SCLAIM17h917e90647b3a6232E>: + +fn PLIC_MCLAIM(hart_id: usize) -> usize { + PLIC_BASE + 0x200004 + hart_id * 0x2000 +} + +fn PLIC_SCLAIM(hart_id: usize) -> usize { + 8001e886: 1101 addi sp,sp,-32 + 8001e888: 85aa mv a1,a0 + 8001e88a: ec2e sd a1,24(sp) + 8001e88c: 4505 li a0,1 + 8001e88e: 154e slli a0,a0,0x33 + 8001e890: 157d addi a0,a0,-1 + PLIC_BASE + 0x201004 + hart_id * 0x2000 + 8001e892: 8d6d and a0,a0,a1 + 8001e894: 00d59613 slli a2,a1,0xd + 8001e898: e832 sd a2,16(sp) + 8001e89a: 00b51f63 bne a0,a1,8001e8b8 <.LBB2_5> + 8001e89e: a009 j 8001e8a0 <_ZN6kernel6driver4plic11PLIC_SCLAIM17h917e90647b3a6232E+0x1a> + 8001e8a0: 65c2 ld a1,16(sp) + 8001e8a2: 0c201537 lui a0,0xc201 + 8001e8a6: 2511 addiw a0,a0,4 + 8001e8a8: 952e add a0,a0,a1 + 8001e8aa: e42a sd a0,8(sp) + 8001e8ac: 02b56563 bltu a0,a1,8001e8d6 <.LBB2_7> + 8001e8b0: a009 j 8001e8b2 <_ZN6kernel6driver4plic11PLIC_SCLAIM17h917e90647b3a6232E+0x2c> +} + 8001e8b2: 6522 ld a0,8(sp) + 8001e8b4: 6105 addi sp,sp,32 + 8001e8b6: 8082 ret + +000000008001e8b8 <.LBB2_5>: + PLIC_BASE + 0x201004 + hart_id * 0x2000 + 8001e8b8: 0000e517 auipc a0,0xe + 8001e8bc: 26850513 addi a0,a0,616 # 8002cb20 + +000000008001e8c0 <.LBB2_6>: + 8001e8c0: 0000e617 auipc a2,0xe + 8001e8c4: 2f060613 addi a2,a2,752 # 8002cbb0 <.L__unnamed_5> + 8001e8c8: 02100593 li a1,33 + 8001e8cc: 00005097 auipc ra,0x5 + 8001e8d0: 878080e7 jalr -1928(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008001e8d6 <.LBB2_7>: + 8001e8d6: 0000e517 auipc a0,0xe + 8001e8da: 28a50513 addi a0,a0,650 # 8002cb60 + +000000008001e8de <.LBB2_8>: + 8001e8de: 0000e617 auipc a2,0xe + 8001e8e2: 2ea60613 addi a2,a2,746 # 8002cbc8 <.L__unnamed_6> + 8001e8e6: 45f1 li a1,28 + 8001e8e8: 00005097 auipc ra,0x5 + 8001e8ec: 85c080e7 jalr -1956(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver4plic9plic_init17he281b1081f5a24ddE: + +000000008001e8f2 <_ZN6kernel6driver4plic9plic_init17he281b1081f5a24ddE>: + +pub fn plic_init() { + 8001e8f2: 1141 addi sp,sp,-16 + 8001e8f4: e406 sd ra,8(sp) + 8001e8f6: 0c000537 lui a0,0xc000 + 8001e8fa: 0285051b addiw a0,a0,40 + 8001e8fe: 4585 li a1,1 + // set desired IRQ priorities non-zero (otherwise disable) + write(PLIC_BASE + (UART0_IRQ * 4) as usize, 1); + 8001e900: 00000097 auipc ra,0x0 + 8001e904: 10c080e7 jalr 268(ra) # 8001ea0c <_ZN6kernel6driver4plic5write17h05d815ac827a7212E> + 8001e908: a009 j 8001e90a <_ZN6kernel6driver4plic9plic_init17he281b1081f5a24ddE+0x18> + 8001e90a: 0c000537 lui a0,0xc000 + 8001e90e: 2511 addiw a0,a0,4 + 8001e910: 4585 li a1,1 + write(PLIC_BASE + (VIRTIO0_IRQ * 4) as usize, 1); + 8001e912: 00000097 auipc ra,0x0 + 8001e916: 0fa080e7 jalr 250(ra) # 8001ea0c <_ZN6kernel6driver4plic5write17h05d815ac827a7212E> + 8001e91a: a009 j 8001e91c <_ZN6kernel6driver4plic9plic_init17he281b1081f5a24ddE+0x2a> +} + 8001e91c: 60a2 ld ra,8(sp) + 8001e91e: 0141 addi sp,sp,16 + 8001e920: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E: + +000000008001e922 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E>: + +pub fn plic_init_hart() { + 8001e922: 7179 addi sp,sp,-48 + let hart_id = unsafe{ cpuid() }; + 8001e924: f406 sd ra,40(sp) + 8001e926: ffff4097 auipc ra,0xffff4 + 8001e92a: aca080e7 jalr -1334(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 8001e92e: 85aa mv a1,a0 + 8001e930: ec2e sd a1,24(sp) + 8001e932: f02a sd a0,32(sp) + 8001e934: a009 j 8001e936 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E+0x14> + + // Set UART's enable bit for this hart's S-mode. + write(PLIC_SENABLE(hart_id), (1 << UART0_IRQ) | (1 << VIRTIO0_IRQ)); + 8001e936: 6562 ld a0,24(sp) + 8001e938: 00000097 auipc ra,0x0 + 8001e93c: e76080e7 jalr -394(ra) # 8001e7ae <_ZN6kernel6driver4plic12PLIC_SENABLE17h7b6da31aa84dc734E> + 8001e940: e82a sd a0,16(sp) + 8001e942: a009 j 8001e944 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E+0x22> + 8001e944: 6542 ld a0,16(sp) + 8001e946: 40200593 li a1,1026 + 8001e94a: 00000097 auipc ra,0x0 + 8001e94e: 0c2080e7 jalr 194(ra) # 8001ea0c <_ZN6kernel6driver4plic5write17h05d815ac827a7212E> + 8001e952: a009 j 8001e954 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E+0x32> + + // Set this hart's S-mode pirority threshold to 0. + write(PLIC_SPRIORITY(hart_id), 0); + 8001e954: 6562 ld a0,24(sp) + 8001e956: 00000097 auipc ra,0x0 + 8001e95a: ec6080e7 jalr -314(ra) # 8001e81c <_ZN6kernel6driver4plic14PLIC_SPRIORITY17h6633467d20099d1cE> + 8001e95e: e42a sd a0,8(sp) + 8001e960: a009 j 8001e962 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E+0x40> + 8001e962: 6522 ld a0,8(sp) + 8001e964: 4581 li a1,0 + 8001e966: 00000097 auipc ra,0x0 + 8001e96a: 0a6080e7 jalr 166(ra) # 8001ea0c <_ZN6kernel6driver4plic5write17h05d815ac827a7212E> + 8001e96e: a009 j 8001e970 <_ZN6kernel6driver4plic14plic_init_hart17he37af6da421066b1E+0x4e> +} + 8001e970: 70a2 ld ra,40(sp) + 8001e972: 6145 addi sp,sp,48 + 8001e974: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E: + +000000008001e976 <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E>: + +/// Ask the PLIC what interrupt we should serve. +pub fn plic_claim() -> Option { + 8001e976: 7139 addi sp,sp,-64 + let hart_id = unsafe { + cpuid() + 8001e978: fc06 sd ra,56(sp) + 8001e97a: ffff4097 auipc ra,0xffff4 + 8001e97e: a76080e7 jalr -1418(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 8001e982: 85aa mv a1,a0 + 8001e984: ec2e sd a1,24(sp) + 8001e986: f42a sd a0,40(sp) + 8001e988: a009 j 8001e98a <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E+0x14> + }; + let interrupt = read(PLIC_SCLAIM(hart_id)); + 8001e98a: 6562 ld a0,24(sp) + 8001e98c: 00000097 auipc ra,0x0 + 8001e990: efa080e7 jalr -262(ra) # 8001e886 <_ZN6kernel6driver4plic11PLIC_SCLAIM17h917e90647b3a6232E> + 8001e994: e82a sd a0,16(sp) + 8001e996: a009 j 8001e998 <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E+0x22> + 8001e998: 6542 ld a0,16(sp) + 8001e99a: 00000097 auipc ra,0x0 + 8001e99e: 08a080e7 jalr 138(ra) # 8001ea24 <_ZN6kernel6driver4plic4read17h33375bd18868bbd4E> + 8001e9a2: 85aa mv a1,a0 + 8001e9a4: e42e sd a1,8(sp) + 8001e9a6: da2a sw a0,52(sp) + 8001e9a8: a009 j 8001e9aa <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E+0x34> + if interrupt == 0 { + 8001e9aa: 6522 ld a0,8(sp) + 8001e9ac: 2501 sext.w a0,a0 + 8001e9ae: 4581 li a1,0 + 8001e9b0: 00b51663 bne a0,a1,8001e9bc <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E+0x46> + 8001e9b4: a009 j 8001e9b6 <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E+0x40> + 8001e9b6: 4501 li a0,0 + None + 8001e9b8: d02a sw a0,32(sp) + if interrupt == 0 { + 8001e9ba: a031 j 8001e9c6 <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E+0x50> + } else { + Some(interrupt) + 8001e9bc: 6522 ld a0,8(sp) + 8001e9be: d22a sw a0,36(sp) + 8001e9c0: 4505 li a0,1 + 8001e9c2: d02a sw a0,32(sp) + if interrupt == 0 { + 8001e9c4: a009 j 8001e9c6 <_ZN6kernel6driver4plic10plic_claim17h6764dad227b44c96E+0x50> + } +} + 8001e9c6: 5502 lw a0,32(sp) + 8001e9c8: 5592 lw a1,36(sp) + 8001e9ca: 70e2 ld ra,56(sp) + 8001e9cc: 6121 addi sp,sp,64 + 8001e9ce: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4plic13plic_complete17hc3a23eee8594fbc3E: + +000000008001e9d0 <_ZN6kernel6driver4plic13plic_complete17hc3a23eee8594fbc3E>: + +/// Tell the PLIC we've served the IRQ +pub fn plic_complete(interrupt: u32) { + 8001e9d0: 7179 addi sp,sp,-48 + 8001e9d2: f406 sd ra,40(sp) + 8001e9d4: 85aa mv a1,a0 + 8001e9d6: e42e sd a1,8(sp) + 8001e9d8: ce2a sw a0,28(sp) + let hart_id = unsafe { + cpuid() + 8001e9da: ffff4097 auipc ra,0xffff4 + 8001e9de: a16080e7 jalr -1514(ra) # 800123f0 <_ZN6kernel7process3cpu5cpuid17h605093a6a9a60164E> + 8001e9e2: 85aa mv a1,a0 + 8001e9e4: e82e sd a1,16(sp) + 8001e9e6: f02a sd a0,32(sp) + 8001e9e8: a009 j 8001e9ea <_ZN6kernel6driver4plic13plic_complete17hc3a23eee8594fbc3E+0x1a> + }; + write(PLIC_SCLAIM(hart_id), interrupt); + 8001e9ea: 6542 ld a0,16(sp) + 8001e9ec: 00000097 auipc ra,0x0 + 8001e9f0: e9a080e7 jalr -358(ra) # 8001e886 <_ZN6kernel6driver4plic11PLIC_SCLAIM17h917e90647b3a6232E> + 8001e9f4: e02a sd a0,0(sp) + 8001e9f6: a009 j 8001e9f8 <_ZN6kernel6driver4plic13plic_complete17hc3a23eee8594fbc3E+0x28> + 8001e9f8: 65a2 ld a1,8(sp) + 8001e9fa: 6502 ld a0,0(sp) + 8001e9fc: 00000097 auipc ra,0x0 + 8001ea00: 010080e7 jalr 16(ra) # 8001ea0c <_ZN6kernel6driver4plic5write17h05d815ac827a7212E> + 8001ea04: a009 j 8001ea06 <_ZN6kernel6driver4plic13plic_complete17hc3a23eee8594fbc3E+0x36> +} + 8001ea06: 70a2 ld ra,40(sp) + 8001ea08: 6145 addi sp,sp,48 + 8001ea0a: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4plic5write17h05d815ac827a7212E: + +000000008001ea0c <_ZN6kernel6driver4plic5write17h05d815ac827a7212E>: + + +fn write(addr: usize, val: u32) { + 8001ea0c: 1101 addi sp,sp,-32 + 8001ea0e: ec06 sd ra,24(sp) + 8001ea10: e42a sd a0,8(sp) + 8001ea12: ca2e sw a1,20(sp) + unsafe { + ptr::write(addr as *mut u32, val); + 8001ea14: ffffb097 auipc ra,0xffffb + 8001ea18: c78080e7 jalr -904(ra) # 8001968c <_ZN4core3ptr5write17h10d6d8799e54bf75E> + 8001ea1c: a009 j 8001ea1e <_ZN6kernel6driver4plic5write17h05d815ac827a7212E+0x12> + } +} + 8001ea1e: 60e2 ld ra,24(sp) + 8001ea20: 6105 addi sp,sp,32 + 8001ea22: 8082 ret + +Disassembly of section .text._ZN6kernel6driver4plic4read17h33375bd18868bbd4E: + +000000008001ea24 <_ZN6kernel6driver4plic4read17h33375bd18868bbd4E>: + +fn read(addr: usize) -> u32 { + 8001ea24: 1101 addi sp,sp,-32 + 8001ea26: ec06 sd ra,24(sp) + 8001ea28: e82a sd a0,16(sp) + unsafe { + ptr::read(addr as *const u32) + 8001ea2a: ffffb097 auipc ra,0xffffb + 8001ea2e: a72080e7 jalr -1422(ra) # 8001949c <_ZN4core3ptr4read17h97f5e0e151e0fdc4E> + 8001ea32: e42a sd a0,8(sp) + 8001ea34: a009 j 8001ea36 <_ZN6kernel6driver4plic4read17h33375bd18868bbd4E+0x12> + } + 8001ea36: 6522 ld a0,8(sp) + 8001ea38: 60e2 ld ra,24(sp) + 8001ea3a: 6105 addi sp,sp,32 + 8001ea3c: 8082 ret + +Disassembly of section .text._ZN6kernel6memory14copy_to_kernel17hd4730b664342d99cE: + +000000008001ea3e <_ZN6kernel6memory14copy_to_kernel17hd4730b664342d99cE>: + +/// Copy from either a user address, or kernel address, +/// depending on is_user. +/// Returns Result<(), &'static str> +/// 从用户或者内核地址拷贝到内核中 +pub fn copy_to_kernel( + 8001ea3e: 7175 addi sp,sp,-144 + 8001ea40: e506 sd ra,136(sp) + 8001ea42: f036 sd a3,32(sp) + 8001ea44: f432 sd a2,40(sp) + 8001ea46: f82a sd a0,48(sp) + 8001ea48: 872e mv a4,a1 + 8001ea4a: fc3a sd a4,56(sp) + 8001ea4c: ecaa sd a0,88(sp) + 8001ea4e: 06b103a3 sb a1,103(sp) + 8001ea52: f4b2 sd a2,104(sp) + 8001ea54: f8b6 sd a3,112(sp) + +000000008001ea56 <.LBB0_9>: + is_user: bool, + src: usize, + len: usize +) -> Result<(), &'static str>{ + unsafe { + let my_proc = CPU_MANAGER.myproc().unwrap(); + 8001ea56: 00047517 auipc a0,0x47 + 8001ea5a: 6ea50513 addi a0,a0,1770 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001ea5e: ffff4097 auipc ra,0xffff4 + 8001ea62: 9fa080e7 jalr -1542(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001ea66: e0aa sd a0,64(sp) + 8001ea68: a009 j 8001ea6a <.LBB0_9+0x14> + 8001ea6a: 6506 ld a0,64(sp) + +000000008001ea6c <.LBB0_10>: + 8001ea6c: 0000e597 auipc a1,0xe + 8001ea70: 18c58593 addi a1,a1,396 # 8002cbf8 <.L__unnamed_1> + 8001ea74: ffff1097 auipc ra,0xffff1 + 8001ea78: d1c080e7 jalr -740(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001ea7c: 85aa mv a1,a0 + 8001ea7e: ec2e sd a1,24(sp) + 8001ea80: fcaa sd a0,120(sp) + 8001ea82: a009 j 8001ea84 <.LBB0_10+0x18> + 8001ea84: 7562 ld a0,56(sp) + 8001ea86: 4581 li a1,0 + + if is_user { + 8001ea88: 00b50b63 beq a0,a1,8001ea9e <.LBB0_10+0x32> + 8001ea8c: a009 j 8001ea8e <.LBB0_10+0x22> + let page_table = my_proc.pagetable.as_mut().unwrap(); + 8001ea8e: 6562 ld a0,24(sp) + 8001ea90: 6d08 ld a0,24(a0) + 8001ea92: fffef097 auipc ra,0xfffef + 8001ea96: a18080e7 jalr -1512(ra) # 8000d4aa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E> + 8001ea9a: e82a sd a0,16(sp) + 8001ea9c: a809 j 8001eaae <.LBB0_10+0x42> + dst, + src, + len + ) + } else { + ptr::copy( + 8001ea9e: 7602 ld a2,32(sp) + 8001eaa0: 75a2 ld a1,40(sp) + 8001eaa2: 7542 ld a0,48(sp) + 8001eaa4: 00007097 auipc ra,0x7 + 8001eaa8: 5f4080e7 jalr 1524(ra) # 80026098 + 8001eaac: a80d j 8001eade <.LBB0_11+0x2e> + let page_table = my_proc.pagetable.as_mut().unwrap(); + 8001eaae: 6542 ld a0,16(sp) + +000000008001eab0 <.LBB0_11>: + 8001eab0: 0000e597 auipc a1,0xe + 8001eab4: 16058593 addi a1,a1,352 # 8002cc10 <.L__unnamed_2> + 8001eab8: ffff1097 auipc ra,0xffff1 + 8001eabc: a50080e7 jalr -1456(ra) # 8000f508 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E> + 8001eac0: 85aa mv a1,a0 + 8001eac2: e42e sd a1,8(sp) + 8001eac4: e12a sd a0,128(sp) + 8001eac6: a009 j 8001eac8 <.LBB0_11+0x18> + page_table.copy_in( + 8001eac8: 7682 ld a3,32(sp) + 8001eaca: 7622 ld a2,40(sp) + 8001eacc: 75c2 ld a1,48(sp) + 8001eace: 6522 ld a0,8(sp) + 8001ead0: ffffa097 auipc ra,0xffffa + 8001ead4: 0de080e7 jalr 222(ra) # 80018bae <_ZN6kernel6memory7mapping10page_table9PageTable7copy_in17h459a5354b5a5ab11E> + 8001ead8: e4aa sd a0,72(sp) + 8001eada: e8ae sd a1,80(sp) + 8001eadc: a021 j 8001eae4 <.LBB0_11+0x34> + 8001eade: 4501 li a0,0 + src as *const u8, + dst as *mut u8, + len + ); + Ok(()) + 8001eae0: e4aa sd a0,72(sp) + if is_user { + 8001eae2: a009 j 8001eae4 <.LBB0_11+0x34> + } + } +} + 8001eae4: 6526 ld a0,72(sp) + 8001eae6: 65c6 ld a1,80(sp) + 8001eae8: 60aa ld ra,136(sp) + 8001eaea: 6149 addi sp,sp,144 + 8001eaec: 8082 ret + +Disassembly of section .text._ZN6kernel6memory16copy_from_kernel17hf0969988b3a5fbc0E: + +000000008001eaee <_ZN6kernel6memory16copy_from_kernel17hf0969988b3a5fbc0E>: + +/// Copy to either a user address, or kernel address, +/// depending on usr_dst. +/// Returns 0 on success, -1 on error. +/// 如果is_user是true的话,表明dst是用户的虚拟地址,否则是内核的虚拟地址 +pub fn copy_from_kernel( + 8001eaee: 7171 addi sp,sp,-176 + 8001eaf0: f506 sd ra,168(sp) + 8001eaf2: f436 sd a3,40(sp) + 8001eaf4: f832 sd a2,48(sp) + 8001eaf6: fc2e sd a1,56(sp) + 8001eaf8: 872a mv a4,a0 + 8001eafa: e0ba sd a4,64(sp) + 8001eafc: 06a10fa3 sb a0,127(sp) + 8001eb00: e12e sd a1,128(sp) + 8001eb02: e532 sd a2,136(sp) + 8001eb04: e936 sd a3,144(sp) + +000000008001eb06 <.LBB1_12>: + dst: usize, + src: *const u8, + len: usize +) -> Result<(), &'static str> { + unsafe{ + let p = CPU_MANAGER.myproc().unwrap(); + 8001eb06: 00047517 auipc a0,0x47 + 8001eb0a: 63a50513 addi a0,a0,1594 # 80066140 <_ZN6kernel7process3cpu11CPU_MANAGER17h1e19e3b88580bd28E> + 8001eb0e: ffff4097 auipc ra,0xffff4 + 8001eb12: 94a080e7 jalr -1718(ra) # 80012458 <_ZN6kernel7process3cpu10CPUManager6myproc17h9323f32341306f38E> + 8001eb16: e4aa sd a0,72(sp) + 8001eb18: a009 j 8001eb1a <.LBB1_12+0x14> + 8001eb1a: 6526 ld a0,72(sp) + +000000008001eb1c <.LBB1_13>: + 8001eb1c: 0000e597 auipc a1,0xe + 8001eb20: 10c58593 addi a1,a1,268 # 8002cc28 <.L__unnamed_3> + 8001eb24: ffff1097 auipc ra,0xffff1 + 8001eb28: c6c080e7 jalr -916(ra) # 8000f790 <_ZN4core6option15Option$LT$T$GT$6unwrap17hd8170f40e175e401E> + 8001eb2c: 85aa mv a1,a0 + 8001eb2e: f02e sd a1,32(sp) + 8001eb30: ed2a sd a0,152(sp) + 8001eb32: a009 j 8001eb34 <.LBB1_13+0x18> + 8001eb34: 6506 ld a0,64(sp) + 8001eb36: 4581 li a1,0 + if is_user { + 8001eb38: 00b50b63 beq a0,a1,8001eb4e <.LBB1_13+0x32> + 8001eb3c: a009 j 8001eb3e <.LBB1_13+0x22> + let page_table = p.pagetable.as_mut().unwrap(); + 8001eb3e: 7502 ld a0,32(sp) + 8001eb40: 6d08 ld a0,24(a0) + 8001eb42: fffef097 auipc ra,0xfffef + 8001eb46: 968080e7 jalr -1688(ra) # 8000d4aa <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17hfc3d5eeea9dab8e4E> + 8001eb4a: ec2a sd a0,24(sp) + 8001eb4c: a809 j 8001eb5e <.LBB1_13+0x42> + dst, + src, + len + ) + } else { + let mut buf = vec![0u8;len]; + 8001eb4e: 7622 ld a2,40(sp) + 8001eb50: 1088 addi a0,sp,96 + 8001eb52: 4581 li a1,0 + 8001eb54: ffff9097 auipc ra,0xffff9 + 8001eb58: f6e080e7 jalr -146(ra) # 80017ac2 <_ZN5alloc3vec9from_elem17h254506728307fd13E> + 8001eb5c: a80d j 8001eb8e <.LBB1_14+0x2e> + let page_table = p.pagetable.as_mut().unwrap(); + 8001eb5e: 6562 ld a0,24(sp) + +000000008001eb60 <.LBB1_14>: + 8001eb60: 0000e597 auipc a1,0xe + 8001eb64: 0e058593 addi a1,a1,224 # 8002cc40 <.L__unnamed_4> + 8001eb68: ffff1097 auipc ra,0xffff1 + 8001eb6c: 9a0080e7 jalr -1632(ra) # 8000f508 <_ZN4core6option15Option$LT$T$GT$6unwrap17h2b22556a60663957E> + 8001eb70: 85aa mv a1,a0 + 8001eb72: e82e sd a1,16(sp) + 8001eb74: f12a sd a0,160(sp) + 8001eb76: a009 j 8001eb78 <.LBB1_14+0x18> + page_table + 8001eb78: 76a2 ld a3,40(sp) + 8001eb7a: 7642 ld a2,48(sp) + 8001eb7c: 75e2 ld a1,56(sp) + 8001eb7e: 6542 ld a0,16(sp) + 8001eb80: ffffa097 auipc ra,0xffffa + 8001eb84: dfe080e7 jalr -514(ra) # 8001897e <_ZN6kernel6memory7mapping10page_table9PageTable8copy_out17h55d0f27ee3680817E> + 8001eb88: e8aa sd a0,80(sp) + 8001eb8a: ecae sd a1,88(sp) + 8001eb8c: a081 j 8001ebcc <.LBB1_14+0x6c> + 8001eb8e: 1088 addi a0,sp,96 + ptr::copy(src as *const u8, buf.as_mut_ptr(), len); + 8001eb90: ffff9097 auipc ra,0xffff9 + 8001eb94: d3a080e7 jalr -710(ra) # 800178ca <_ZN5alloc3vec16Vec$LT$T$C$A$GT$10as_mut_ptr17h2d512420264161fdE> + 8001eb98: e42a sd a0,8(sp) + 8001eb9a: a009 j 8001eb9c <.LBB1_14+0x3c> + 8001eb9c: 7622 ld a2,40(sp) + 8001eb9e: 75c2 ld a1,48(sp) + 8001eba0: 6522 ld a0,8(sp) + 8001eba2: 00007097 auipc ra,0x7 + 8001eba6: 4f6080e7 jalr 1270(ra) # 80026098 + 8001ebaa: a009 j 8001ebac <.LBB1_14+0x4c> + ptr::copy( + 8001ebac: 7622 ld a2,40(sp) + 8001ebae: 75c2 ld a1,48(sp) + 8001ebb0: 7562 ld a0,56(sp) + 8001ebb2: 00007097 auipc ra,0x7 + 8001ebb6: 4e6080e7 jalr 1254(ra) # 80026098 + 8001ebba: a009 j 8001ebbc <.LBB1_14+0x5c> + 8001ebbc: 4501 li a0,0 + src as *const u8, + dst as *mut u8, + len + ); + Ok(()) + 8001ebbe: e8aa sd a0,80(sp) + 8001ebc0: 1088 addi a0,sp,96 + } + 8001ebc2: fffe8097 auipc ra,0xfffe8 + 8001ebc6: 4ba080e7 jalr 1210(ra) # 8000707c <_ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17hc049a0af331ff31cE> + 8001ebca: a009 j 8001ebcc <.LBB1_14+0x6c> + } + + 8001ebcc: 6546 ld a0,80(sp) + 8001ebce: 65e6 ld a1,88(sp) + 8001ebd0: 70aa ld ra,168(sp) + 8001ebd2: 614d addi sp,sp,176 + 8001ebd4: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h188cc5d34f3b14d9E: + +000000008001ebd6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h188cc5d34f3b14d9E>: + pub const fn is_null(self) -> bool { + 8001ebd6: 1101 addi sp,sp,-32 + 8001ebd8: ec06 sd ra,24(sp) + 8001ebda: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 8001ebdc: e42a sd a0,8(sp) + 8001ebde: a009 j 8001ebe0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h188cc5d34f3b14d9E+0xa> + 8001ebe0: 6522 ld a0,8(sp) + 8001ebe2: 4581 li a1,0 + 8001ebe4: 00004097 auipc ra,0x4 + 8001ebe8: 326080e7 jalr 806(ra) # 80022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE> + 8001ebec: e02a sd a0,0(sp) + 8001ebee: a009 j 8001ebf0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h188cc5d34f3b14d9E+0x1a> + } + 8001ebf0: 6502 ld a0,0(sp) + 8001ebf2: 60e2 ld ra,24(sp) + 8001ebf4: 6105 addi sp,sp,32 + 8001ebf6: 8082 ret + +Disassembly of section .text._ZN6kernel6printf6_print17hbf6f661b066aad08E: + +000000008001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E>: + +use crate::driver::uart::UART; +use crate::lock::spinlock::Spinlock; +use crate::shutdown::*; + +pub fn _print(args: fmt::Arguments) { + 8001ebf8: 711d addi sp,sp,-96 + 8001ebfa: ec86 sd ra,88(sp) + 8001ebfc: ec2a sd a0,24(sp) + +000000008001ebfe <.LBB0_6>: + use fmt::Write; + let mut uart = UART.acquire(); + 8001ebfe: 0003e517 auipc a0,0x3e + 8001ec02: 75250513 addi a0,a0,1874 # 8005d350 <_ZN6kernel6driver4uart4UART17h0708b3e179d548ddE> + 8001ec06: ffff2097 auipc ra,0xffff2 + 8001ec0a: e1c080e7 jalr -484(ra) # 80010a22 <_ZN6kernel4lock8spinlock17Spinlock$LT$T$GT$7acquire17h007ac3682185ef97E> + 8001ec0e: f02a sd a0,32(sp) + 8001ec10: a009 j 8001ec12 <.LBB0_6+0x14> + 8001ec12: 1008 addi a0,sp,32 + uart.write_fmt(args).unwrap(); + 8001ec14: ffff3097 auipc ra,0xffff3 + 8001ec18: 248080e7 jalr 584(ra) # 80011e5c <_ZN93_$LT$kernel..lock..spinlock..SpinlockGuard$LT$T$GT$$u20$as$u20$core..ops..deref..DerefMut$GT$9deref_mut17hce69ac52326dbcadE> + 8001ec1c: e82a sd a0,16(sp) + 8001ec1e: a009 j 8001ec20 <.LBB0_6+0x22> + 8001ec20: 6542 ld a0,16(sp) + 8001ec22: 65e2 ld a1,24(sp) + 8001ec24: 7590 ld a2,40(a1) + 8001ec26: e8b2 sd a2,80(sp) + 8001ec28: 7190 ld a2,32(a1) + 8001ec2a: e4b2 sd a2,72(sp) + 8001ec2c: 6d90 ld a2,24(a1) + 8001ec2e: e0b2 sd a2,64(sp) + 8001ec30: 6990 ld a2,16(a1) + 8001ec32: fc32 sd a2,56(sp) + 8001ec34: 6590 ld a2,8(a1) + 8001ec36: f832 sd a2,48(sp) + 8001ec38: 618c ld a1,0(a1) + 8001ec3a: f42e sd a1,40(sp) + 8001ec3c: 102c addi a1,sp,40 + 8001ec3e: 00001097 auipc ra,0x1 + 8001ec42: 9ba080e7 jalr -1606(ra) # 8001f5f8 <_ZN4core3fmt5Write9write_fmt17h7425e676f17f7351E> + 8001ec46: e42a sd a0,8(sp) + 8001ec48: a009 j 8001ec4a <.LBB0_6+0x4c> + 8001ec4a: 6522 ld a0,8(sp) + +000000008001ec4c <.LBB0_7>: + 8001ec4c: 0000e597 auipc a1,0xe + 8001ec50: 01c58593 addi a1,a1,28 # 8002cc68 <.L__unnamed_1> + 8001ec54: fffef097 auipc ra,0xfffef + 8001ec58: ae4080e7 jalr -1308(ra) # 8000d738 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h0d39573adfd86ec0E> + 8001ec5c: a009 j 8001ec5e <.LBB0_7+0x12> + drop(uart); + 8001ec5e: 7502 ld a0,32(sp) + 8001ec60: fffff097 auipc ra,0xfffff + 8001ec64: 25c080e7 jalr 604(ra) # 8001debc <_ZN4core3mem4drop17h96fc0e7c88170ba8E> + 8001ec68: a009 j 8001ec6a <.LBB0_7+0x1e> +} + 8001ec6a: 60e6 ld ra,88(sp) + 8001ec6c: 6125 addi sp,sp,96 + 8001ec6e: 8082 ret + +Disassembly of section .text.rust_begin_unwind: + +000000008001ec70 : + $crate::printf::_print(format_args!(concat!($fmt, "\n") $(,$($arg)+)?)); + } +} + +#[panic_handler] +fn panic(info: &PanicInfo<'_>) -> ! { + 8001ec70: 7159 addi sp,sp,-112 + 8001ec72: f486 sd ra,104(sp) + 8001ec74: e82a sd a0,16(sp) + 8001ec76: 0808 addi a0,sp,16 + println!("\x1b[1;31mpanic: '{}'\x1b[0m", info); + 8001ec78: ecaa sd a0,88(sp) + 8001ec7a: f0aa sd a0,96(sp) + +000000008001ec7c <.LBB1_5>: + 8001ec7c: fffef597 auipc a1,0xfffef + 8001ec80: 8b458593 addi a1,a1,-1868 # 8000d530 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h0a4be43e8f3bcf0dE> + 8001ec84: 00001097 auipc ra,0x1 + 8001ec88: 8ee080e7 jalr -1810(ra) # 8001f572 <_ZN4core3fmt10ArgumentV13new17hff1fcd65a46300b2E> + 8001ec8c: e02a sd a0,0(sp) + 8001ec8e: e42e sd a1,8(sp) + 8001ec90: a009 j 8001ec92 <.LBB1_5+0x16> + 8001ec92: 6522 ld a0,8(sp) + 8001ec94: 6582 ld a1,0(sp) + 8001ec96: e4ae sd a1,72(sp) + 8001ec98: e8aa sd a0,80(sp) + +000000008001ec9a <.LBB1_6>: + 8001ec9a: 0000e597 auipc a1,0xe + 8001ec9e: ffe58593 addi a1,a1,-2 # 8002cc98 <.L__unnamed_2> + 8001eca2: 0828 addi a0,sp,24 + 8001eca4: 4609 li a2,2 + 8001eca6: 00b4 addi a3,sp,72 + 8001eca8: 4705 li a4,1 + 8001ecaa: fffe7097 auipc ra,0xfffe7 + 8001ecae: 8e0080e7 jalr -1824(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001ecb2: a009 j 8001ecb4 <.LBB1_6+0x1a> + 8001ecb4: 0828 addi a0,sp,24 + 8001ecb6: 00000097 auipc ra,0x0 + 8001ecba: f42080e7 jalr -190(ra) # 8001ebf8 <_ZN6kernel6printf6_print17hbf6f661b066aad08E> + 8001ecbe: a009 j 8001ecc0 <.LBB1_6+0x26> + shutdown(); + 8001ecc0: fffe6097 auipc ra,0xfffe6 + 8001ecc4: 7f2080e7 jalr 2034(ra) # 800054b2 <_ZN6kernel8shutdown8shutdown17hf11bb5dd05ff266dE> + 8001ecc8: a009 j 8001ecca <.LBB1_6+0x30> + loop {} + 8001ecca: a001 j 8001ecca <.LBB1_6+0x30> + +Disassembly of section .text._ZN6kernel4arch5riscv8register7mideleg5write17hf36c8c211297ea03E: + +000000008001eccc <_ZN6kernel4arch5riscv8register7mideleg5write17hf36c8c211297ea03E>: + llvm_asm!("csrr $0, mideleg":"=r"(ret):::"volatile"); + ret +} + +#[inline] +pub unsafe fn write(mideleg: usize) { + 8001eccc: 1141 addi sp,sp,-16 + 8001ecce: e42a sd a0,8(sp) + llvm_asm!("csrw mideleg, $0"::"r"(mideleg)::"volatile"); + 8001ecd0: 30351073 csrw mideleg,a0 + 8001ecd4: 0141 addi sp,sp,16 + 8001ecd6: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hdbffcc8df8ebe27dE: + +000000008001ecd8 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hdbffcc8df8ebe27dE>: + fn into_iter(self) -> I { + 8001ecd8: 1141 addi sp,sp,-16 + 8001ecda: e02a sd a0,0(sp) + 8001ecdc: e42e sd a1,8(sp) + } + 8001ecde: 0141 addi sp,sp,16 + 8001ece0: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he31f6e5d3eec2be9E: + +000000008001ece2 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he31f6e5d3eec2be9E>: + fn into_iter(self) -> I { + 8001ece2: 1141 addi sp,sp,-16 + 8001ece4: e02a sd a0,0(sp) + 8001ece6: e42e sd a1,8(sp) + } + 8001ece8: 0141 addi sp,sp,16 + 8001ecea: 8082 ret + +Disassembly of section .text._ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next28_$u7b$$u7b$closure$u7d$$u7d$17ha7c7da80d3c0bdbeE: + +000000008001ecec <_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next28_$u7b$$u7b$closure$u7d$$u7d$17ha7c7da80d3c0bdbeE>: + next_code_point(&mut self.iter).map(|ch| { + 8001ecec: 1101 addi sp,sp,-32 + 8001ecee: ec06 sd ra,24(sp) + 8001ecf0: ca2a sw a0,20(sp) + unsafe { char::from_u32_unchecked(ch) } + 8001ecf2: ffffe097 auipc ra,0xffffe + 8001ecf6: 63e080e7 jalr 1598(ra) # 8001d330 <_ZN4core4char7convert18from_u32_unchecked17hac286a657ee2c904E> + 8001ecfa: 1502 slli a0,a0,0x20 + 8001ecfc: 9101 srli a0,a0,0x20 + 8001ecfe: e42a sd a0,8(sp) + 8001ed00: a009 j 8001ed02 <_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next28_$u7b$$u7b$closure$u7d$$u7d$17ha7c7da80d3c0bdbeE+0x16> + }) + 8001ed02: 6522 ld a0,8(sp) + 8001ed04: 60e2 ld ra,24(sp) + 8001ed06: 6105 addi sp,sp,32 + 8001ed08: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7medeleg5write17h087038b3215eaf8cE: + +000000008001ed0a <_ZN6kernel4arch5riscv8register7medeleg5write17h087038b3215eaf8cE>: + llvm_asm!("csrr $0, medeleg":"=r"(ret):::"volatile"); + ret +} + +#[inline] +pub unsafe fn write(medeleg: usize){ + 8001ed0a: 1141 addi sp,sp,-16 + 8001ed0c: e42a sd a0,8(sp) + llvm_asm!("csrw medeleg, $0"::"r"(medeleg)::"volatile"); + 8001ed0e: 30251073 csrw medeleg,a0 + 8001ed12: 0141 addi sp,sp,16 + 8001ed14: 8082 ret + +Disassembly of section .text._ZN4core3num21_$LT$impl$u20$u16$GT$13unchecked_add17hfa49a7085d490705E: + +000000008001ed16 <_ZN4core3num21_$LT$impl$u20$u16$GT$13unchecked_add17hfa49a7085d490705E>: + issue = "none", + )] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] + #[inline] + pub unsafe fn unchecked_add(self, rhs: Self) -> Self { + 8001ed16: 1141 addi sp,sp,-16 + 8001ed18: 00a11523 sh a0,10(sp) + 8001ed1c: 00b11623 sh a1,12(sp) + // SAFETY: the caller must uphold the safety contract for + // `unchecked_add`. + unsafe { intrinsics::unchecked_add(self, rhs) } + 8001ed20: 952e add a0,a0,a1 + 8001ed22: 00a11723 sh a0,14(sp) + 8001ed26: 65c1 lui a1,0x10 + 8001ed28: 35fd addiw a1,a1,-1 + 8001ed2a: 8d6d and a0,a0,a1 + 8001ed2c: e02a sd a0,0(sp) + 8001ed2e: a009 j 8001ed30 <_ZN4core3num21_$LT$impl$u20$u16$GT$13unchecked_add17hfa49a7085d490705E+0x1a> + } + 8001ed30: 6502 ld a0,0(sp) + 8001ed32: 0141 addi sp,sp,16 + 8001ed34: 8082 ret + +Disassembly of section .text._ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E: + +000000008001ed36 <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E>: + pub const fn checked_add(self, rhs: Self) -> Option { + 8001ed36: 7139 addi sp,sp,-64 + 8001ed38: fc06 sd ra,56(sp) + 8001ed3a: d42a sw a0,40(sp) + 8001ed3c: d62e sw a1,44(sp) + let (a, b) = self.overflowing_add(rhs); + 8001ed3e: 00000097 auipc ra,0x0 + 8001ed42: 05e080e7 jalr 94(ra) # 8001ed9c <_ZN4core3num21_$LT$impl$u20$u32$GT$15overflowing_add17h6c31d0dcc95be001E> + 8001ed46: e82a sd a0,16(sp) + 8001ed48: ec2e sd a1,24(sp) + 8001ed4a: a009 j 8001ed4c <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E+0x16> + 8001ed4c: 6562 ld a0,24(sp) + 8001ed4e: 65c2 ld a1,16(sp) + 8001ed50: d82e sw a1,48(sp) + 8001ed52: 8905 andi a0,a0,1 + 8001ed54: e42a sd a0,8(sp) + 8001ed56: 02a10b23 sb a0,54(sp) + if unlikely!(b) {None} else {Some(a)} + 8001ed5a: 02a10ba3 sb a0,55(sp) + 8001ed5e: a009 j 8001ed60 <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E+0x2a> + 8001ed60: 6522 ld a0,8(sp) + 8001ed62: 4581 li a1,0 + 8001ed64: 00b50663 beq a0,a1,8001ed70 <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E+0x3a> + 8001ed68: a009 j 8001ed6a <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E+0x34> + 8001ed6a: 4501 li a0,0 + 8001ed6c: d02a sw a0,32(sp) + 8001ed6e: a031 j 8001ed7a <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E+0x44> + 8001ed70: 6542 ld a0,16(sp) + 8001ed72: d22a sw a0,36(sp) + 8001ed74: 4505 li a0,1 + 8001ed76: d02a sw a0,32(sp) + 8001ed78: a009 j 8001ed7a <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E+0x44> + } + 8001ed7a: 5502 lw a0,32(sp) + 8001ed7c: 5592 lw a1,36(sp) + 8001ed7e: 70e2 ld ra,56(sp) + 8001ed80: 6121 addi sp,sp,64 + 8001ed82: 8082 ret + +Disassembly of section .text._ZN4core3num21_$LT$impl$u20$u32$GT$13unchecked_add17hceb6a8c852a4dc08E: + +000000008001ed84 <_ZN4core3num21_$LT$impl$u20$u32$GT$13unchecked_add17hceb6a8c852a4dc08E>: + pub unsafe fn unchecked_add(self, rhs: Self) -> Self { + 8001ed84: 1101 addi sp,sp,-32 + 8001ed86: ca2a sw a0,20(sp) + 8001ed88: cc2e sw a1,24(sp) + unsafe { intrinsics::unchecked_add(self, rhs) } + 8001ed8a: 952e add a0,a0,a1 + 8001ed8c: ce2a sw a0,28(sp) + 8001ed8e: 1502 slli a0,a0,0x20 + 8001ed90: 9101 srli a0,a0,0x20 + 8001ed92: e42a sd a0,8(sp) + 8001ed94: a009 j 8001ed96 <_ZN4core3num21_$LT$impl$u20$u32$GT$13unchecked_add17hceb6a8c852a4dc08E+0x12> + } + 8001ed96: 6522 ld a0,8(sp) + 8001ed98: 6105 addi sp,sp,32 + 8001ed9a: 8082 ret + +Disassembly of section .text._ZN4core3num21_$LT$impl$u20$u32$GT$15overflowing_add17h6c31d0dcc95be001E: + +000000008001ed9c <_ZN4core3num21_$LT$impl$u20$u32$GT$15overflowing_add17h6c31d0dcc95be001E>: + #[stable(feature = "wrapping", since = "1.7.0")] + #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] + #[must_use = "this returns the result of the operation, \ + without modifying the original"] + #[inline] + pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) { + 8001ed9c: 7179 addi sp,sp,-48 + 8001ed9e: 862e mv a2,a1 + 8001eda0: 86aa mv a3,a0 + 8001eda2: 02061513 slli a0,a2,0x20 + 8001eda6: 02055593 srli a1,a0,0x20 + 8001edaa: 02069513 slli a0,a3,0x20 + 8001edae: 9101 srli a0,a0,0x20 + 8001edb0: cc36 sw a3,24(sp) + 8001edb2: ce32 sw a2,28(sp) + let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT); + 8001edb4: 95aa add a1,a1,a0 + 8001edb6: 02059513 slli a0,a1,0x20 + 8001edba: 9101 srli a0,a0,0x20 + 8001edbc: e02a sd a0,0(sp) + 8001edbe: 8d2d xor a0,a0,a1 + 8001edc0: 00a03533 snez a0,a0 + 8001edc4: e42a sd a0,8(sp) + 8001edc6: d02e sw a1,32(sp) + 8001edc8: 02a10223 sb a0,36(sp) + 8001edcc: a009 j 8001edce <_ZN4core3num21_$LT$impl$u20$u32$GT$15overflowing_add17h6c31d0dcc95be001E+0x32> + 8001edce: 65a2 ld a1,8(sp) + 8001edd0: 6502 ld a0,0(sp) + 8001edd2: d42a sw a0,40(sp) + 8001edd4: 02b107a3 sb a1,47(sp) + (a as Self, b) + 8001edd8: c82a sw a0,16(sp) + 8001edda: 00b10a23 sb a1,20(sp) + } + 8001edde: 6145 addi sp,sp,48 + 8001ede0: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17hc42f1db1f03657afE: + +000000008001ede2 <_ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17hc42f1db1f03657afE>: + pub const fn count_ones(self) -> u32 { + 8001ede2: 1101 addi sp,sp,-32 + 8001ede4: e82a sd a0,16(sp) + intrinsics::ctpop(self as $ActualT) as u32 + 8001ede6: 00155593 srli a1,a0,0x1 + 8001edea: 05555637 lui a2,0x5555 + 8001edee: 5556061b addiw a2,a2,1365 + 8001edf2: 0632 slli a2,a2,0xc + 8001edf4: 55560613 addi a2,a2,1365 # 5555555 <.Lline_table_start0+0x551e0f0> + 8001edf8: 0632 slli a2,a2,0xc + 8001edfa: 55560613 addi a2,a2,1365 + 8001edfe: 0632 slli a2,a2,0xc + 8001ee00: 55560613 addi a2,a2,1365 + 8001ee04: 8df1 and a1,a1,a2 + 8001ee06: 40b505b3 sub a1,a0,a1 + 8001ee0a: 03333537 lui a0,0x3333 + 8001ee0e: 3335051b addiw a0,a0,819 + 8001ee12: 0532 slli a0,a0,0xc + 8001ee14: 33350513 addi a0,a0,819 # 3333333 <.Lline_table_start0+0x32fbece> + 8001ee18: 0532 slli a0,a0,0xc + 8001ee1a: 33350513 addi a0,a0,819 + 8001ee1e: 0532 slli a0,a0,0xc + 8001ee20: 33350613 addi a2,a0,819 + 8001ee24: 00c5f533 and a0,a1,a2 + 8001ee28: 8189 srli a1,a1,0x2 + 8001ee2a: 8df1 and a1,a1,a2 + 8001ee2c: 952e add a0,a0,a1 + 8001ee2e: 00455593 srli a1,a0,0x4 + 8001ee32: 952e add a0,a0,a1 + 8001ee34: 00f0f5b7 lui a1,0xf0f + 8001ee38: 0f15859b addiw a1,a1,241 + 8001ee3c: 05b2 slli a1,a1,0xc + 8001ee3e: f0f58593 addi a1,a1,-241 # f0ef0f <.Lline_table_start0+0xed7aaa> + 8001ee42: 05b2 slli a1,a1,0xc + 8001ee44: 0f158593 addi a1,a1,241 + 8001ee48: 05b2 slli a1,a1,0xc + 8001ee4a: f0f58593 addi a1,a1,-241 + 8001ee4e: 8d6d and a0,a0,a1 + 8001ee50: 010105b7 lui a1,0x1010 + 8001ee54: 1015859b addiw a1,a1,257 + 8001ee58: 05c2 slli a1,a1,0x10 + 8001ee5a: 10158593 addi a1,a1,257 # 1010101 <.Lline_table_start0+0xfd8c9c> + 8001ee5e: 05c2 slli a1,a1,0x10 + 8001ee60: 10158593 addi a1,a1,257 + 8001ee64: 02b50533 mul a0,a0,a1 + 8001ee68: 9161 srli a0,a0,0x38 + 8001ee6a: e42a sd a0,8(sp) + 8001ee6c: ec2a sd a0,24(sp) + 8001ee6e: a009 j 8001ee70 <_ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17hc42f1db1f03657afE+0x8e> + } + 8001ee70: 6522 ld a0,8(sp) + 8001ee72: 6105 addi sp,sp,32 + 8001ee74: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E: + +000000008001ee76 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E>: + pub const fn checked_add(self, rhs: Self) -> Option { + 8001ee76: 715d addi sp,sp,-80 + 8001ee78: e486 sd ra,72(sp) + 8001ee7a: f42a sd a0,40(sp) + 8001ee7c: f82e sd a1,48(sp) + let (a, b) = self.overflowing_add(rhs); + 8001ee7e: 00000097 auipc ra,0x0 + 8001ee82: 184080e7 jalr 388(ra) # 8001f002 <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_add17h5e362dda9fd64aadE> + 8001ee86: e42a sd a0,8(sp) + 8001ee88: e82e sd a1,16(sp) + 8001ee8a: a009 j 8001ee8c <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E+0x16> + 8001ee8c: 6542 ld a0,16(sp) + 8001ee8e: 65a2 ld a1,8(sp) + 8001ee90: fc2e sd a1,56(sp) + 8001ee92: 8905 andi a0,a0,1 + 8001ee94: e02a sd a0,0(sp) + 8001ee96: 04a10323 sb a0,70(sp) + if unlikely!(b) {None} else {Some(a)} + 8001ee9a: 04a103a3 sb a0,71(sp) + 8001ee9e: a009 j 8001eea0 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E+0x2a> + 8001eea0: 6502 ld a0,0(sp) + 8001eea2: 4581 li a1,0 + 8001eea4: 00b50663 beq a0,a1,8001eeb0 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E+0x3a> + 8001eea8: a009 j 8001eeaa <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E+0x34> + 8001eeaa: 4501 li a0,0 + 8001eeac: ec2a sd a0,24(sp) + 8001eeae: a031 j 8001eeba <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E+0x44> + 8001eeb0: 6522 ld a0,8(sp) + 8001eeb2: f02a sd a0,32(sp) + 8001eeb4: 4505 li a0,1 + 8001eeb6: ec2a sd a0,24(sp) + 8001eeb8: a009 j 8001eeba <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E+0x44> + } + 8001eeba: 6562 ld a0,24(sp) + 8001eebc: 7582 ld a1,32(sp) + 8001eebe: 60a6 ld ra,72(sp) + 8001eec0: 6161 addi sp,sp,80 + 8001eec2: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE: + +000000008001eec4 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE>: + pub const fn checked_mul(self, rhs: Self) -> Option { + 8001eec4: 715d addi sp,sp,-80 + 8001eec6: e486 sd ra,72(sp) + 8001eec8: f42a sd a0,40(sp) + 8001eeca: f82e sd a1,48(sp) + let (a, b) = self.overflowing_mul(rhs); + 8001eecc: 00000097 auipc ra,0x0 + 8001eed0: 162080e7 jalr 354(ra) # 8001f02e <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_mul17h8807e257a981f0caE> + 8001eed4: e42a sd a0,8(sp) + 8001eed6: e82e sd a1,16(sp) + 8001eed8: a009 j 8001eeda <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE+0x16> + 8001eeda: 6542 ld a0,16(sp) + 8001eedc: 65a2 ld a1,8(sp) + 8001eede: fc2e sd a1,56(sp) + 8001eee0: 8905 andi a0,a0,1 + 8001eee2: e02a sd a0,0(sp) + 8001eee4: 04a10323 sb a0,70(sp) + if unlikely!(b) {None} else {Some(a)} + 8001eee8: 04a103a3 sb a0,71(sp) + 8001eeec: a009 j 8001eeee <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE+0x2a> + 8001eeee: 6502 ld a0,0(sp) + 8001eef0: 4581 li a1,0 + 8001eef2: 00b50663 beq a0,a1,8001eefe <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE+0x3a> + 8001eef6: a009 j 8001eef8 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE+0x34> + 8001eef8: 4501 li a0,0 + 8001eefa: ec2a sd a0,24(sp) + 8001eefc: a031 j 8001ef08 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE+0x44> + 8001eefe: 6522 ld a0,8(sp) + 8001ef00: f02a sd a0,32(sp) + 8001ef02: 4505 li a0,1 + 8001ef04: ec2a sd a0,24(sp) + 8001ef06: a009 j 8001ef08 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE+0x44> + } + 8001ef08: 6562 ld a0,24(sp) + 8001ef0a: 7582 ld a1,32(sp) + 8001ef0c: 60a6 ld ra,72(sp) + 8001ef0e: 6161 addi sp,sp,80 + 8001ef10: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E: + +000000008001ef12 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E>: + pub const fn checked_sub(self, rhs: Self) -> Option { + 8001ef12: 715d addi sp,sp,-80 + 8001ef14: e486 sd ra,72(sp) + 8001ef16: f42a sd a0,40(sp) + 8001ef18: f82e sd a1,48(sp) + let (a, b) = self.overflowing_sub(rhs); + 8001ef1a: 00000097 auipc ra,0x0 + 8001ef1e: 14a080e7 jalr 330(ra) # 8001f064 <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_sub17h1247a6e463c80816E> + 8001ef22: e42a sd a0,8(sp) + 8001ef24: e82e sd a1,16(sp) + 8001ef26: a009 j 8001ef28 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E+0x16> + 8001ef28: 6542 ld a0,16(sp) + 8001ef2a: 65a2 ld a1,8(sp) + 8001ef2c: fc2e sd a1,56(sp) + 8001ef2e: 8905 andi a0,a0,1 + 8001ef30: e02a sd a0,0(sp) + 8001ef32: 04a10323 sb a0,70(sp) + if unlikely!(b) {None} else {Some(a)} + 8001ef36: 04a103a3 sb a0,71(sp) + 8001ef3a: a009 j 8001ef3c <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E+0x2a> + 8001ef3c: 6502 ld a0,0(sp) + 8001ef3e: 4581 li a1,0 + 8001ef40: 00b50663 beq a0,a1,8001ef4c <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E+0x3a> + 8001ef44: a009 j 8001ef46 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E+0x34> + 8001ef46: 4501 li a0,0 + 8001ef48: ec2a sd a0,24(sp) + 8001ef4a: a031 j 8001ef56 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E+0x44> + 8001ef4c: 6522 ld a0,8(sp) + 8001ef4e: f02a sd a0,32(sp) + 8001ef50: 4505 li a0,1 + 8001ef52: ec2a sd a0,24(sp) + 8001ef54: a009 j 8001ef56 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_sub17h4d6a04d1a942bf32E+0x44> + } + 8001ef56: 6562 ld a0,24(sp) + 8001ef58: 7582 ld a1,32(sp) + 8001ef5a: 60a6 ld ra,72(sp) + 8001ef5c: 6161 addi sp,sp,80 + 8001ef5e: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_add17he0ea74277f4c06b1E: + +000000008001ef60 <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_add17he0ea74277f4c06b1E>: + pub const fn wrapping_add(self, rhs: Self) -> Self { + 8001ef60: 1141 addi sp,sp,-16 + 8001ef62: e02a sd a0,0(sp) + 8001ef64: e42e sd a1,8(sp) + intrinsics::wrapping_add(self, rhs) + 8001ef66: 952e add a0,a0,a1 + } + 8001ef68: 0141 addi sp,sp,16 + 8001ef6a: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_sub17h8f077bf007d122c9E: + +000000008001ef6c <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_sub17h8f077bf007d122c9E>: + pub const fn wrapping_sub(self, rhs: Self) -> Self { + 8001ef6c: 1141 addi sp,sp,-16 + 8001ef6e: e02a sd a0,0(sp) + 8001ef70: e42e sd a1,8(sp) + intrinsics::wrapping_sub(self, rhs) + 8001ef72: 8d0d sub a0,a0,a1 + } + 8001ef74: 0141 addi sp,sp,16 + 8001ef76: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$13from_le_bytes17h3bceb23301b73de9E: + +000000008001ef78 <_ZN4core3num23_$LT$impl$u20$usize$GT$13from_le_bytes17h3bceb23301b73de9E>: + /// } + /// ``` + #[stable(feature = "int_to_from_bytes", since = "1.32.0")] + #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] + #[inline] + pub const fn from_le_bytes(bytes: [u8; mem::size_of::()]) -> Self { + 8001ef78: 7179 addi sp,sp,-48 + 8001ef7a: f406 sd ra,40(sp) + 8001ef7c: ec2a sd a0,24(sp) + 8001ef7e: e82a sd a0,16(sp) + Self::from_le(Self::from_ne_bytes(bytes)) + 8001ef80: f02a sd a0,32(sp) + 8001ef82: 00000097 auipc ra,0x0 + 8001ef86: 022080e7 jalr 34(ra) # 8001efa4 <_ZN4core3num23_$LT$impl$u20$usize$GT$13from_ne_bytes17h8c178ff675f3bacaE> + 8001ef8a: e42a sd a0,8(sp) + 8001ef8c: a009 j 8001ef8e <_ZN4core3num23_$LT$impl$u20$usize$GT$13from_le_bytes17h3bceb23301b73de9E+0x16> + 8001ef8e: 6522 ld a0,8(sp) + 8001ef90: 00000097 auipc ra,0x0 + 8001ef94: 102080e7 jalr 258(ra) # 8001f092 <_ZN4core3num23_$LT$impl$u20$usize$GT$7from_le17h7016b8b5387c67e4E> + 8001ef98: e02a sd a0,0(sp) + 8001ef9a: a009 j 8001ef9c <_ZN4core3num23_$LT$impl$u20$usize$GT$13from_le_bytes17h3bceb23301b73de9E+0x24> + } + 8001ef9c: 6502 ld a0,0(sp) + 8001ef9e: 70a2 ld ra,40(sp) + 8001efa0: 6145 addi sp,sp,48 + 8001efa2: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$13from_ne_bytes17h8c178ff675f3bacaE: + +000000008001efa4 <_ZN4core3num23_$LT$impl$u20$usize$GT$13from_ne_bytes17h8c178ff675f3bacaE>: + #[rustc_const_stable(feature = "const_int_conversion", since = "1.44.0")] + // SAFETY: const sound because integers are plain old datatypes so we can always + // transmute to them + #[rustc_allow_const_fn_unstable(const_fn_transmute)] + #[inline] + pub const fn from_ne_bytes(bytes: [u8; mem::size_of::()]) -> Self { + 8001efa4: 7179 addi sp,sp,-48 + 8001efa6: ec2a sd a0,24(sp) + 8001efa8: e82a sd a0,16(sp) + // SAFETY: integers are plain old datatypes so we can always transmute to them + unsafe { mem::transmute(bytes) } + 8001efaa: f02a sd a0,32(sp) + 8001efac: f42a sd a0,40(sp) + 8001efae: e42a sd a0,8(sp) + 8001efb0: a009 j 8001efb2 <_ZN4core3num23_$LT$impl$u20$usize$GT$13from_ne_bytes17h8c178ff675f3bacaE+0xe> + } + 8001efb2: 6522 ld a0,8(sp) + 8001efb4: 6145 addi sp,sp,48 + 8001efb6: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hd96bc3f11f940f51E: + +000000008001efb8 <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hd96bc3f11f940f51E>: + pub unsafe fn unchecked_add(self, rhs: Self) -> Self { + 8001efb8: 1101 addi sp,sp,-32 + 8001efba: e42a sd a0,8(sp) + 8001efbc: e82e sd a1,16(sp) + unsafe { intrinsics::unchecked_add(self, rhs) } + 8001efbe: 952e add a0,a0,a1 + 8001efc0: e02a sd a0,0(sp) + 8001efc2: ec2a sd a0,24(sp) + 8001efc4: a009 j 8001efc6 <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hd96bc3f11f940f51E+0xe> + } + 8001efc6: 6502 ld a0,0(sp) + 8001efc8: 6105 addi sp,sp,32 + 8001efca: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_sub17hed0c10f690d6ddf4E: + +000000008001efcc <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_sub17hed0c10f690d6ddf4E>: + pub unsafe fn unchecked_sub(self, rhs: Self) -> Self { + 8001efcc: 1101 addi sp,sp,-32 + 8001efce: e42a sd a0,8(sp) + 8001efd0: e82e sd a1,16(sp) + unsafe { intrinsics::unchecked_sub(self, rhs) } + 8001efd2: 8d0d sub a0,a0,a1 + 8001efd4: e02a sd a0,0(sp) + 8001efd6: ec2a sd a0,24(sp) + 8001efd8: a009 j 8001efda <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_sub17hed0c10f690d6ddf4E+0xe> + } + 8001efda: 6502 ld a0,0(sp) + 8001efdc: 6105 addi sp,sp,32 + 8001efde: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h1415e23f4938ba42E: + +000000008001efe0 <_ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h1415e23f4938ba42E>: + pub const fn is_power_of_two(self) -> bool { + 8001efe0: 1101 addi sp,sp,-32 + 8001efe2: ec06 sd ra,24(sp) + 8001efe4: e82a sd a0,16(sp) + self.count_ones() == 1 + 8001efe6: 00000097 auipc ra,0x0 + 8001efea: dfc080e7 jalr -516(ra) # 8001ede2 <_ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17hc42f1db1f03657afE> + 8001efee: e42a sd a0,8(sp) + 8001eff0: a009 j 8001eff2 <_ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h1415e23f4938ba42E+0x12> + 8001eff2: 6522 ld a0,8(sp) + 8001eff4: 2501 sext.w a0,a0 + 8001eff6: 157d addi a0,a0,-1 + 8001eff8: 00153513 seqz a0,a0 + } + 8001effc: 60e2 ld ra,24(sp) + 8001effe: 6105 addi sp,sp,32 + 8001f000: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_add17h5e362dda9fd64aadE: + +000000008001f002 <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_add17h5e362dda9fd64aadE>: + pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) { + 8001f002: 715d addi sp,sp,-80 + 8001f004: f02a sd a0,32(sp) + 8001f006: f42e sd a1,40(sp) + let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT); + 8001f008: 95aa add a1,a1,a0 + 8001f00a: e02e sd a1,0(sp) + 8001f00c: 00a5b533 sltu a0,a1,a0 + 8001f010: e42a sd a0,8(sp) + 8001f012: f82e sd a1,48(sp) + 8001f014: 02a10c23 sb a0,56(sp) + 8001f018: a009 j 8001f01a <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_add17h5e362dda9fd64aadE+0x18> + 8001f01a: 65a2 ld a1,8(sp) + 8001f01c: 6502 ld a0,0(sp) + 8001f01e: e0aa sd a0,64(sp) + 8001f020: 04b107a3 sb a1,79(sp) + (a as Self, b) + 8001f024: e82a sd a0,16(sp) + 8001f026: 00b10c23 sb a1,24(sp) + } + 8001f02a: 6161 addi sp,sp,80 + 8001f02c: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_mul17h8807e257a981f0caE: + +000000008001f02e <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_mul17h8807e257a981f0caE>: + pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) { + 8001f02e: 715d addi sp,sp,-80 + 8001f030: 862e mv a2,a1 + 8001f032: 85aa mv a1,a0 + 8001f034: f02e sd a1,32(sp) + 8001f036: f432 sd a2,40(sp) + let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT); + 8001f038: 02c5b533 mulhu a0,a1,a2 + 8001f03c: 00a03533 snez a0,a0 + 8001f040: e02a sd a0,0(sp) + 8001f042: 02c585b3 mul a1,a1,a2 + 8001f046: e42e sd a1,8(sp) + 8001f048: f82e sd a1,48(sp) + 8001f04a: 02a10c23 sb a0,56(sp) + 8001f04e: a009 j 8001f050 <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_mul17h8807e257a981f0caE+0x22> + 8001f050: 6582 ld a1,0(sp) + 8001f052: 6522 ld a0,8(sp) + 8001f054: e0aa sd a0,64(sp) + 8001f056: 04b107a3 sb a1,79(sp) + (a as Self, b) + 8001f05a: e82a sd a0,16(sp) + 8001f05c: 00b10c23 sb a1,24(sp) + } + 8001f060: 6161 addi sp,sp,80 + 8001f062: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_sub17h1247a6e463c80816E: + +000000008001f064 <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_sub17h1247a6e463c80816E>: + pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) { + 8001f064: 715d addi sp,sp,-80 + 8001f066: f02a sd a0,32(sp) + 8001f068: f42e sd a1,40(sp) + let (a, b) = intrinsics::sub_with_overflow(self as $ActualT, rhs as $ActualT); + 8001f06a: 40b505b3 sub a1,a0,a1 + 8001f06e: e02e sd a1,0(sp) + 8001f070: 00b53533 sltu a0,a0,a1 + 8001f074: e42a sd a0,8(sp) + 8001f076: f82e sd a1,48(sp) + 8001f078: 02a10c23 sb a0,56(sp) + 8001f07c: a009 j 8001f07e <_ZN4core3num23_$LT$impl$u20$usize$GT$15overflowing_sub17h1247a6e463c80816E+0x1a> + 8001f07e: 65a2 ld a1,8(sp) + 8001f080: 6502 ld a0,0(sp) + 8001f082: e0aa sd a0,64(sp) + 8001f084: 04b107a3 sb a1,79(sp) + (a as Self, b) + 8001f088: e82a sd a0,16(sp) + 8001f08a: 00b10c23 sb a1,24(sp) + } + 8001f08e: 6161 addi sp,sp,80 + 8001f090: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$7from_le17h7016b8b5387c67e4E: + +000000008001f092 <_ZN4core3num23_$LT$impl$u20$usize$GT$7from_le17h7016b8b5387c67e4E>: + pub const fn from_le(x: Self) -> Self { + 8001f092: 1141 addi sp,sp,-16 + 8001f094: e42a sd a0,8(sp) + } + 8001f096: 0141 addi sp,sp,16 + 8001f098: 8082 ret + +Disassembly of section .text._ZN47_$LT$u16$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h3535906832610659E: + +000000008001f09a <_ZN47_$LT$u16$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h3535906832610659E>: + unsafe fn forward_unchecked(start: Self, n: usize) -> Self { + 8001f09a: 1101 addi sp,sp,-32 + 8001f09c: ec06 sd ra,24(sp) + 8001f09e: 00a11723 sh a0,14(sp) + 8001f0a2: e82e sd a1,16(sp) + unsafe { start.unchecked_add(n as Self) } + 8001f0a4: 00000097 auipc ra,0x0 + 8001f0a8: c72080e7 jalr -910(ra) # 8001ed16 <_ZN4core3num21_$LT$impl$u20$u16$GT$13unchecked_add17hfa49a7085d490705E> + 8001f0ac: e02a sd a0,0(sp) + 8001f0ae: a009 j 8001f0b0 <_ZN47_$LT$u16$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h3535906832610659E+0x16> + } + 8001f0b0: 6502 ld a0,0(sp) + 8001f0b2: 60e2 ld ra,24(sp) + 8001f0b4: 6105 addi sp,sp,32 + 8001f0b6: 8082 ret + +Disassembly of section .text._ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E: + +000000008001f0b8 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E>: + fn forward_checked(start: Self, n: usize) -> Option { + 8001f0b8: 7139 addi sp,sp,-64 + 8001f0ba: fc06 sd ra,56(sp) + 8001f0bc: e02e sd a1,0(sp) + 8001f0be: 85aa mv a1,a0 + 8001f0c0: 6502 ld a0,0(sp) + 8001f0c2: 862e mv a2,a1 + 8001f0c4: e432 sd a2,8(sp) + 8001f0c6: d22e sw a1,36(sp) + 8001f0c8: f42a sd a0,40(sp) + match Self::try_from(n) { + 8001f0ca: 00000097 auipc ra,0x0 + 8001f0ce: 1e6080e7 jalr 486(ra) # 8001f2b0 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE> + 8001f0d2: cc2a sw a0,24(sp) + 8001f0d4: ce2e sw a1,28(sp) + 8001f0d6: a009 j 8001f0d8 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E+0x20> + Ok(n) => start.checked_add(n), + 8001f0d8: 01816503 lwu a0,24(sp) + 8001f0dc: 4581 li a1,0 + 8001f0de: 00b50763 beq a0,a1,8001f0ec <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E+0x34> + 8001f0e2: a009 j 8001f0e4 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E+0x2c> + 8001f0e4: 4501 li a0,0 + Err(_) => None, // if n is out of range, `unsigned_start + n` is too + 8001f0e6: c82a sw a0,16(sp) + match Self::try_from(n) { + 8001f0e8: a829 j 8001f102 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E+0x4a> + 8001f0ea: 0000 unimp + Ok(n) => start.checked_add(n), + 8001f0ec: 6522 ld a0,8(sp) + 8001f0ee: 45f2 lw a1,28(sp) + 8001f0f0: da2e sw a1,52(sp) + 8001f0f2: 00000097 auipc ra,0x0 + 8001f0f6: c44080e7 jalr -956(ra) # 8001ed36 <_ZN4core3num21_$LT$impl$u20$u32$GT$11checked_add17h28c8b802ca50f266E> + 8001f0fa: c82a sw a0,16(sp) + 8001f0fc: ca2e sw a1,20(sp) + 8001f0fe: a009 j 8001f100 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E+0x48> + match Self::try_from(n) { + 8001f100: a009 j 8001f102 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h56207e7d47bfb4e6E+0x4a> + } + 8001f102: 4542 lw a0,16(sp) + 8001f104: 45d2 lw a1,20(sp) + 8001f106: 70e2 ld ra,56(sp) + 8001f108: 6121 addi sp,sp,64 + 8001f10a: 8082 ret + +Disassembly of section .text._ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17hd82fe8ce42e2d29dE: + +000000008001f10c <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17hd82fe8ce42e2d29dE>: + unsafe fn forward_unchecked(start: Self, n: usize) -> Self { + 8001f10c: 1101 addi sp,sp,-32 + 8001f10e: ec06 sd ra,24(sp) + 8001f110: c62a sw a0,12(sp) + 8001f112: e82e sd a1,16(sp) + unsafe { start.unchecked_add(n as Self) } + 8001f114: 00000097 auipc ra,0x0 + 8001f118: c70080e7 jalr -912(ra) # 8001ed84 <_ZN4core3num21_$LT$impl$u20$u32$GT$13unchecked_add17hceb6a8c852a4dc08E> + 8001f11c: e02a sd a0,0(sp) + 8001f11e: a009 j 8001f120 <_ZN47_$LT$u32$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17hd82fe8ce42e2d29dE+0x14> + } + 8001f120: 6502 ld a0,0(sp) + 8001f122: 60e2 ld ra,24(sp) + 8001f124: 6105 addi sp,sp,32 + 8001f126: 8082 ret + +Disassembly of section .text._ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h89a22c0b5326f750E: + +000000008001f128 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h89a22c0b5326f750E>: + fn forward_checked(start: Self, n: usize) -> Option { + 8001f128: 715d addi sp,sp,-80 + 8001f12a: e486 sd ra,72(sp) + 8001f12c: ec2e sd a1,24(sp) + 8001f12e: 85aa mv a1,a0 + 8001f130: 6562 ld a0,24(sp) + 8001f132: f02e sd a1,32(sp) + 8001f134: f82e sd a1,48(sp) + 8001f136: fc2a sd a0,56(sp) + match Self::try_from(n) { + 8001f138: fffed097 auipc ra,0xfffed + 8001f13c: 27a080e7 jalr 634(ra) # 8000c3b2 <_ZN53_$LT$T$u20$as$u20$core..convert..TryFrom$LT$U$GT$$GT$8try_from17heab1f3c6250d8edbE> + 8001f140: f42a sd a0,40(sp) + 8001f142: a009 j 8001f144 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h89a22c0b5326f750E+0x1c> + Ok(n) => start.checked_add(n), + 8001f144: 7502 ld a0,32(sp) + 8001f146: 75a2 ld a1,40(sp) + 8001f148: e0ae sd a1,64(sp) + 8001f14a: 00000097 auipc ra,0x0 + 8001f14e: d2c080e7 jalr -724(ra) # 8001ee76 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_add17he2495d381876d258E> + 8001f152: e42a sd a0,8(sp) + 8001f154: e82e sd a1,16(sp) + 8001f156: a009 j 8001f158 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$15forward_checked17h89a22c0b5326f750E+0x30> + } + 8001f158: 65c2 ld a1,16(sp) + 8001f15a: 6522 ld a0,8(sp) + 8001f15c: 60a6 ld ra,72(sp) + 8001f15e: 6161 addi sp,sp,80 + 8001f160: 8082 ret + +Disassembly of section .text._ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h4b00136ef7a8c813E: + +000000008001f162 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h4b00136ef7a8c813E>: + unsafe fn forward_unchecked(start: Self, n: usize) -> Self { + 8001f162: 1101 addi sp,sp,-32 + 8001f164: ec06 sd ra,24(sp) + 8001f166: e42a sd a0,8(sp) + 8001f168: e82e sd a1,16(sp) + unsafe { start.unchecked_add(n as Self) } + 8001f16a: 00000097 auipc ra,0x0 + 8001f16e: e4e080e7 jalr -434(ra) # 8001efb8 <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hd96bc3f11f940f51E> + 8001f172: e02a sd a0,0(sp) + 8001f174: a009 j 8001f176 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h4b00136ef7a8c813E+0x14> + } + 8001f176: 6502 ld a0,0(sp) + 8001f178: 60e2 ld ra,24(sp) + 8001f17a: 6105 addi sp,sp,32 + 8001f17c: 8082 ret + +Disassembly of section .text._ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$18backward_unchecked17h149195b805b2849bE: + +000000008001f17e <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$18backward_unchecked17h149195b805b2849bE>: + unsafe fn backward_unchecked(start: Self, n: usize) -> Self { + 8001f17e: 1101 addi sp,sp,-32 + 8001f180: ec06 sd ra,24(sp) + 8001f182: e42a sd a0,8(sp) + 8001f184: e82e sd a1,16(sp) + unsafe { start.unchecked_sub(n as Self) } + 8001f186: 00000097 auipc ra,0x0 + 8001f18a: e46080e7 jalr -442(ra) # 8001efcc <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_sub17hed0c10f690d6ddf4E> + 8001f18e: e02a sd a0,0(sp) + 8001f190: a009 j 8001f192 <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$18backward_unchecked17h149195b805b2849bE+0x14> + } + 8001f192: 6502 ld a0,0(sp) + 8001f194: 60e2 ld ra,24(sp) + 8001f196: 6105 addi sp,sp,32 + 8001f198: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE: + +000000008001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE>: + /// User Interrupt Enable + UIE = 1 << 0 +} + +#[inline] +pub unsafe fn read() -> usize { + 8001f19a: 1141 addi sp,sp,-16 + let sstatus: usize; + llvm_asm!("csrr $0, sstatus":"=r"(sstatus):::"volatile"); + 8001f19c: 10002573 csrr a0,sstatus + 8001f1a0: e42a sd a0,8(sp) + sstatus +} + 8001f1a2: 0141 addi sp,sp,16 + 8001f1a4: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus5write17h2e3a8152fe4defdaE: + +000000008001f1a6 <_ZN6kernel4arch5riscv8register7sstatus5write17h2e3a8152fe4defdaE>: + +#[inline] +pub unsafe fn write(sstatus: usize) { + 8001f1a6: 1141 addi sp,sp,-16 + 8001f1a8: e42a sd a0,8(sp) + llvm_asm!("csrw sstatus, $0"::"r"(sstatus)::"volatile"); + 8001f1aa: 10051073 csrw sstatus,a0 +} + 8001f1ae: 0141 addi sp,sp,16 + 8001f1b0: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus18is_from_supervisor17h09ba8119c534748eE: + +000000008001f1b2 <_ZN6kernel4arch5riscv8register7sstatus18is_from_supervisor17h09ba8119c534748eE>: + +#[inline] +pub unsafe fn is_from_supervisor() -> bool { + 8001f1b2: 1141 addi sp,sp,-16 + (read() & SSTATUS::SPP as usize) != 0 + 8001f1b4: e406 sd ra,8(sp) + 8001f1b6: 00000097 auipc ra,0x0 + 8001f1ba: fe4080e7 jalr -28(ra) # 8001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE> + 8001f1be: e02a sd a0,0(sp) + 8001f1c0: a009 j 8001f1c2 <_ZN6kernel4arch5riscv8register7sstatus18is_from_supervisor17h09ba8119c534748eE+0x10> + 8001f1c2: 6502 ld a0,0(sp) + 8001f1c4: 10057513 andi a0,a0,256 + 8001f1c8: 8121 srli a0,a0,0x8 +} + 8001f1ca: 60a2 ld ra,8(sp) + 8001f1cc: 0141 addi sp,sp,16 + 8001f1ce: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus12is_from_user17hfa7a30a57661c561E: + +000000008001f1d0 <_ZN6kernel4arch5riscv8register7sstatus12is_from_user17hfa7a30a57661c561E>: + +#[inline] +pub unsafe fn is_from_user() -> bool { + 8001f1d0: 1141 addi sp,sp,-16 + (read() & SSTATUS::SPP as usize) == 0 + 8001f1d2: e406 sd ra,8(sp) + 8001f1d4: 00000097 auipc ra,0x0 + 8001f1d8: fc6080e7 jalr -58(ra) # 8001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE> + 8001f1dc: e02a sd a0,0(sp) + 8001f1de: a009 j 8001f1e0 <_ZN6kernel4arch5riscv8register7sstatus12is_from_user17hfa7a30a57661c561E+0x10> + 8001f1e0: 6502 ld a0,0(sp) + 8001f1e2: 10057513 andi a0,a0,256 + 8001f1e6: 00153513 seqz a0,a0 +} + 8001f1ea: 60a2 ld ra,8(sp) + 8001f1ec: 0141 addi sp,sp,16 + 8001f1ee: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E: + +000000008001f1f0 <_ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E>: + +/// enable device interrupts +#[inline] +pub unsafe fn intr_on() { + 8001f1f0: 1141 addi sp,sp,-16 + write(read() | SSTATUS::SIE as usize); + 8001f1f2: e406 sd ra,8(sp) + 8001f1f4: 00000097 auipc ra,0x0 + 8001f1f8: fa6080e7 jalr -90(ra) # 8001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE> + 8001f1fc: e02a sd a0,0(sp) + 8001f1fe: a009 j 8001f200 <_ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E+0x10> + 8001f200: 6502 ld a0,0(sp) + 8001f202: 00256513 ori a0,a0,2 + 8001f206: 00000097 auipc ra,0x0 + 8001f20a: fa0080e7 jalr -96(ra) # 8001f1a6 <_ZN6kernel4arch5riscv8register7sstatus5write17h2e3a8152fe4defdaE> + 8001f20e: a009 j 8001f210 <_ZN6kernel4arch5riscv8register7sstatus7intr_on17h10d927cfe74faba7E+0x20> +} + 8001f210: 60a2 ld ra,8(sp) + 8001f212: 0141 addi sp,sp,16 + 8001f214: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus8intr_off17hed3f5b43b53e6556E: + +000000008001f216 <_ZN6kernel4arch5riscv8register7sstatus8intr_off17hed3f5b43b53e6556E>: + +/// disable device interrupts +#[inline] +pub unsafe fn intr_off() { + 8001f216: 1141 addi sp,sp,-16 + write(read() & !(SSTATUS::SIE as usize)); + 8001f218: e406 sd ra,8(sp) + 8001f21a: 00000097 auipc ra,0x0 + 8001f21e: f80080e7 jalr -128(ra) # 8001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE> + 8001f222: e02a sd a0,0(sp) + 8001f224: a009 j 8001f226 <_ZN6kernel4arch5riscv8register7sstatus8intr_off17hed3f5b43b53e6556E+0x10> + 8001f226: 6502 ld a0,0(sp) + 8001f228: 9975 andi a0,a0,-3 + 8001f22a: 00000097 auipc ra,0x0 + 8001f22e: f7c080e7 jalr -132(ra) # 8001f1a6 <_ZN6kernel4arch5riscv8register7sstatus5write17h2e3a8152fe4defdaE> + 8001f232: a009 j 8001f234 <_ZN6kernel4arch5riscv8register7sstatus8intr_off17hed3f5b43b53e6556E+0x1e> +} + 8001f234: 60a2 ld ra,8(sp) + 8001f236: 0141 addi sp,sp,16 + 8001f238: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus8intr_get17h3e12e0f19cb31fd5E: + +000000008001f23a <_ZN6kernel4arch5riscv8register7sstatus8intr_get17h3e12e0f19cb31fd5E>: + + +/// are device interrupts enabled? +#[inline] +pub unsafe fn intr_get() -> bool { + 8001f23a: 1101 addi sp,sp,-32 + let x = read(); + 8001f23c: ec06 sd ra,24(sp) + 8001f23e: 00000097 auipc ra,0x0 + 8001f242: f5c080e7 jalr -164(ra) # 8001f19a <_ZN6kernel4arch5riscv8register7sstatus4read17h1df585a8263fd2acE> + 8001f246: 85aa mv a1,a0 + 8001f248: e42e sd a1,8(sp) + 8001f24a: e82a sd a0,16(sp) + 8001f24c: a009 j 8001f24e <_ZN6kernel4arch5riscv8register7sstatus8intr_get17h3e12e0f19cb31fd5E+0x14> + return (x & SSTATUS::SIE as usize) != 0; + 8001f24e: 6522 ld a0,8(sp) + 8001f250: 8909 andi a0,a0,2 + 8001f252: 8105 srli a0,a0,0x1 +} + 8001f254: 60e2 ld ra,24(sp) + 8001f256: 6105 addi sp,sp,32 + 8001f258: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus9clear_spp17h6421d1a1ec9c8eccE: + +000000008001f25a <_ZN6kernel4arch5riscv8register7sstatus9clear_spp17h6421d1a1ec9c8eccE>: + +/// clear SPP to 0 +#[inline] +pub fn clear_spp(sstatus: usize) -> usize { + 8001f25a: 1141 addi sp,sp,-16 + 8001f25c: e42a sd a0,8(sp) + sstatus & !(SSTATUS::SPP as usize) + 8001f25e: eff57513 andi a0,a0,-257 +} + 8001f262: 0141 addi sp,sp,16 + 8001f264: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register7sstatus12user_intr_on17h1304f970b07c3896E: + +000000008001f266 <_ZN6kernel4arch5riscv8register7sstatus12user_intr_on17h1304f970b07c3896E>: + +/// enable interrupts in user mode +#[inline] +pub fn user_intr_on(sstatus: usize) -> usize { + 8001f266: 1141 addi sp,sp,-16 + 8001f268: e42a sd a0,8(sp) + sstatus | (SSTATUS::SPIE as usize) + 8001f26a: 02056513 ori a0,a0,32 +} + 8001f26e: 0141 addi sp,sp,16 + 8001f270: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register8mscratch5write17h9d6c8373498c8305E: + +000000008001f272 <_ZN6kernel4arch5riscv8register8mscratch5write17h9d6c8373498c8305E>: +#[inline] +pub unsafe fn write(x:usize){ + 8001f272: 1141 addi sp,sp,-16 + 8001f274: e42a sd a0,8(sp) + llvm_asm!("csrw mscratch, $0"::"r"(x)::"volatile"); + 8001f276: 34051073 csrw mscratch,a0 + 8001f27a: 0141 addi sp,sp,16 + 8001f27c: 8082 ret + +Disassembly of section .text._ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u16$GT$8try_from17h9165284bf6d163adE: + +000000008001f27e <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u16$GT$8try_from17h9165284bf6d163adE>: + + /// Try to create the target number type from a source + /// number type. This returns an error if the source value + /// is outside of the range of the target type. + #[inline] + fn try_from(u: $source) -> Result { + 8001f27e: 1101 addi sp,sp,-32 + 8001f280: e42a sd a0,8(sp) + 8001f282: ec2a sd a0,24(sp) + if u > (Self::MAX as $source) { + 8001f284: 8141 srli a0,a0,0x10 + 8001f286: 4581 li a1,0 + 8001f288: 00b50763 beq a0,a1,8001f296 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u16$GT$8try_from17h9165284bf6d163adE+0x18> + 8001f28c: a009 j 8001f28e <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u16$GT$8try_from17h9165284bf6d163adE+0x10> + 8001f28e: 4505 li a0,1 + Err(TryFromIntError(())) + 8001f290: 00a11823 sh a0,16(sp) + if u > (Self::MAX as $source) { + 8001f294: a801 j 8001f2a4 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u16$GT$8try_from17h9165284bf6d163adE+0x26> + } else { + Ok(u as Self) + 8001f296: 6522 ld a0,8(sp) + 8001f298: 00a11923 sh a0,18(sp) + 8001f29c: 4501 li a0,0 + 8001f29e: 00a11823 sh a0,16(sp) + if u > (Self::MAX as $source) { + 8001f2a2: a009 j 8001f2a4 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u16$GT$8try_from17h9165284bf6d163adE+0x26> + } + } + 8001f2a4: 01011503 lh a0,16(sp) + 8001f2a8: 01211583 lh a1,18(sp) + 8001f2ac: 6105 addi sp,sp,32 + 8001f2ae: 8082 ret + +Disassembly of section .text._ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE: + +000000008001f2b0 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE>: + fn try_from(u: $source) -> Result { + 8001f2b0: 1101 addi sp,sp,-32 + 8001f2b2: e42a sd a0,8(sp) + 8001f2b4: ec2a sd a0,24(sp) + if u > (Self::MAX as $source) { + 8001f2b6: 9101 srli a0,a0,0x20 + 8001f2b8: 4581 li a1,0 + 8001f2ba: 00b50663 beq a0,a1,8001f2c6 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE+0x16> + 8001f2be: a009 j 8001f2c0 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE+0x10> + 8001f2c0: 4505 li a0,1 + Err(TryFromIntError(())) + 8001f2c2: c82a sw a0,16(sp) + if u > (Self::MAX as $source) { + 8001f2c4: a031 j 8001f2d0 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE+0x20> + Ok(u as Self) + 8001f2c6: 6522 ld a0,8(sp) + 8001f2c8: ca2a sw a0,20(sp) + 8001f2ca: 4501 li a0,0 + 8001f2cc: c82a sw a0,16(sp) + if u > (Self::MAX as $source) { + 8001f2ce: a009 j 8001f2d0 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE+0x20> + } + 8001f2d0: 4542 lw a0,16(sp) + 8001f2d2: 45d2 lw a1,20(sp) + 8001f2d4: 6105 addi sp,sp,32 + 8001f2d6: 8082 ret + +Disassembly of section .text._ZN5alloc6string6String3new17h806e7bcacb841554E: + +000000008001f2d8 <_ZN5alloc6string6String3new17h806e7bcacb841554E>: + /// let s = String::new(); + /// ``` + #[inline] + #[rustc_const_stable(feature = "const_string_new", since = "1.39.0")] + #[stable(feature = "rust1", since = "1.0.0")] + pub const fn new() -> String { + 8001f2d8: 7179 addi sp,sp,-48 + String { vec: Vec::new() } + 8001f2da: f406 sd ra,40(sp) + 8001f2dc: e42a sd a0,8(sp) + 8001f2de: 0808 addi a0,sp,16 + 8001f2e0: ffff8097 auipc ra,0xffff8 + 8001f2e4: 5d2080e7 jalr 1490(ra) # 800178b2 <_ZN5alloc3vec12Vec$LT$T$GT$3new17hfad72d6537ee9e7bE> + 8001f2e8: a009 j 8001f2ea <_ZN5alloc6string6String3new17h806e7bcacb841554E+0x12> + 8001f2ea: 65a2 ld a1,8(sp) + 8001f2ec: 7502 ld a0,32(sp) + 8001f2ee: e988 sd a0,16(a1) + 8001f2f0: 6562 ld a0,24(sp) + 8001f2f2: e588 sd a0,8(a1) + 8001f2f4: 6542 ld a0,16(sp) + 8001f2f6: e188 sd a0,0(a1) + } + 8001f2f8: 70a2 ld ra,40(sp) + 8001f2fa: 6145 addi sp,sp,48 + 8001f2fc: 8082 ret + +Disassembly of section .text._ZN5alloc6string6String4push17h2b5e883a1c1e3781E: + +000000008001f2fe <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E>: + /// + /// assert_eq!("abc123", s); + /// ``` + #[inline] + #[stable(feature = "rust1", since = "1.0.0")] + pub fn push(&mut self, ch: char) { + 8001f2fe: 7175 addi sp,sp,-144 + 8001f300: e506 sd ra,136(sp) + 8001f302: f82e sd a1,48(sp) + 8001f304: 85aa mv a1,a0 + 8001f306: 7542 ld a0,48(sp) + 8001f308: fc2e sd a1,56(sp) + 8001f30a: 862a mv a2,a0 + 8001f30c: e0b2 sd a2,64(sp) + 8001f30e: ecae sd a1,88(sp) + 8001f310: d2aa sw a0,100(sp) + match ch.len_utf8() { + 8001f312: ffffd097 auipc ra,0xffffd + 8001f316: e2c080e7 jalr -468(ra) # 8001c13e <_ZN4core4char7methods22_$LT$impl$u20$char$GT$8len_utf817h6b8693741ddbecceE> + 8001f31a: e4aa sd a0,72(sp) + 8001f31c: a009 j 8001f31e <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x20> + 8001f31e: 6526 ld a0,72(sp) + 8001f320: 4585 li a1,1 + 1 => self.vec.push(ch as u8), + 8001f322: 02b50163 beq a0,a1,8001f344 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x46> + 8001f326: a009 j 8001f328 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x2a> + _ => self.vec.extend_from_slice(ch.encode_utf8(&mut [0; 4]).as_bytes()), + 8001f328: 6506 ld a0,64(sp) + 8001f32a: 75e2 ld a1,56(sp) + 8001f32c: ec2e sd a1,24(sp) + 8001f32e: 4581 li a1,0 + 8001f330: caae sw a1,84(sp) + 8001f332: 08cc addi a1,sp,84 + 8001f334: 4611 li a2,4 + 8001f336: ffffd097 auipc ra,0xffffd + 8001f33a: dd4080e7 jalr -556(ra) # 8001c10a <_ZN4core4char7methods22_$LT$impl$u20$char$GT$11encode_utf817h7239bcb774eea5aaE> + 8001f33e: f02a sd a0,32(sp) + 8001f340: f42e sd a1,40(sp) + 8001f342: a809 j 8001f354 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x56> + 1 => self.vec.push(ch as u8), + 8001f344: 6586 ld a1,64(sp) + 8001f346: 7562 ld a0,56(sp) + 8001f348: ffff8097 auipc ra,0xffff8 + 8001f34c: 6ac080e7 jalr 1708(ra) # 800179f4 <_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h5c7a5a6a9c3b7171E> + 8001f350: a009 j 8001f352 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x54> + match ch.len_utf8() { + 8001f352: a01d j 8001f378 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x7a> + 8001f354: 7522 ld a0,40(sp) + 8001f356: 7582 ld a1,32(sp) + 8001f358: f4ae sd a1,104(sp) + 8001f35a: f8aa sd a0,112(sp) + 8001f35c: fcae sd a1,120(sp) + 8001f35e: e12a sd a0,128(sp) + _ => self.vec.extend_from_slice(ch.encode_utf8(&mut [0; 4]).as_bytes()), + 8001f360: e42e sd a1,8(sp) + 8001f362: e82a sd a0,16(sp) + 8001f364: a009 j 8001f366 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x68> + 8001f366: 6642 ld a2,16(sp) + 8001f368: 65a2 ld a1,8(sp) + 8001f36a: 6562 ld a0,24(sp) + 8001f36c: ffff8097 auipc ra,0xffff8 + 8001f370: 642080e7 jalr 1602(ra) # 800179ae <_ZN5alloc3vec16Vec$LT$T$C$A$GT$17extend_from_slice17hce4d1786c1c715b0E> + 8001f374: a009 j 8001f376 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x78> + match ch.len_utf8() { + 8001f376: a009 j 8001f378 <_ZN5alloc6string6String4push17h2b5e883a1c1e3781E+0x7a> + } + } + 8001f378: 60aa ld ra,136(sp) + 8001f37a: 6149 addi sp,sp,144 + 8001f37c: 8082 ret + +Disassembly of section .text._ZN65_$LT$alloc..string..String$u20$as$u20$core..ops..deref..Deref$GT$5deref17hb3510aeed9e3d071E: + +000000008001f37e <_ZN65_$LT$alloc..string..String$u20$as$u20$core..ops..deref..Deref$GT$5deref17hb3510aeed9e3d071E>: +#[stable(feature = "rust1", since = "1.0.0")] +impl ops::Deref for String { + type Target = str; + + #[inline] + fn deref(&self) -> &str { + 8001f37e: 7179 addi sp,sp,-48 + 8001f380: f406 sd ra,40(sp) + 8001f382: f02a sd a0,32(sp) + unsafe { str::from_utf8_unchecked(&self.vec) } + 8001f384: ffff8097 auipc ra,0xffff8 + 8001f388: 758080e7 jalr 1880(ra) # 80017adc <_ZN72_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17h57bbbed72157e211E> + 8001f38c: e82a sd a0,16(sp) + 8001f38e: ec2e sd a1,24(sp) + 8001f390: a009 j 8001f392 <_ZN65_$LT$alloc..string..String$u20$as$u20$core..ops..deref..Deref$GT$5deref17hb3510aeed9e3d071E+0x14> + 8001f392: 65e2 ld a1,24(sp) + 8001f394: 6542 ld a0,16(sp) + 8001f396: 00000097 auipc ra,0x0 + 8001f39a: 328080e7 jalr 808(ra) # 8001f6be <_ZN4core3str8converts19from_utf8_unchecked17hb3b621a5f279bc07E> + 8001f39e: e02a sd a0,0(sp) + 8001f3a0: e42e sd a1,8(sp) + 8001f3a2: a009 j 8001f3a4 <_ZN65_$LT$alloc..string..String$u20$as$u20$core..ops..deref..Deref$GT$5deref17hb3510aeed9e3d071E+0x26> + } + 8001f3a4: 65a2 ld a1,8(sp) + 8001f3a6: 6502 ld a0,0(sp) + 8001f3a8: 70a2 ld ra,40(sp) + 8001f3aa: 6145 addi sp,sp,48 + 8001f3ac: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E: + +000000008001f3ae <_ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E>: +// `> isize::MAX` bytes will surely fail. On 32-bit and 16-bit we need to add +// an extra guard for this in case we're running on a platform which can use +// all 4GB in user-space, e.g., PAE or x32. + +#[inline] +fn alloc_guard(alloc_size: usize) -> Result<(), TryReserveError> { + 8001f3ae: 1101 addi sp,sp,-32 + 8001f3b0: e02a sd a0,0(sp) + 8001f3b2: ec2e sd a1,24(sp) + 8001f3b4: 4505 li a0,1 + if usize::BITS < 64 && alloc_size > isize::MAX as usize { + 8001f3b6: e919 bnez a0,8001f3cc <_ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E+0x1e> + 8001f3b8: a009 j 8001f3ba <_ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E+0xc> + 8001f3ba: 6582 ld a1,0(sp) + 8001f3bc: 4501 li a0,0 + Err(CapacityOverflow) + 8001f3be: e82a sd a0,16(sp) + 8001f3c0: 6622 ld a2,8(sp) + 8001f3c2: e590 sd a2,8(a1) + 8001f3c4: e988 sd a0,16(a1) + 8001f3c6: 4505 li a0,1 + 8001f3c8: e188 sd a0,0(a1) + if usize::BITS < 64 && alloc_size > isize::MAX as usize { + 8001f3ca: a029 j 8001f3d4 <_ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E+0x26> + 8001f3cc: 6582 ld a1,0(sp) + 8001f3ce: 4501 li a0,0 + } else { + Ok(()) + 8001f3d0: e188 sd a0,0(a1) + if usize::BITS < 64 && alloc_size > isize::MAX as usize { + 8001f3d2: a009 j 8001f3d4 <_ZN5alloc7raw_vec11alloc_guard17hfed185ef1a23ae81E+0x26> + } +} + 8001f3d4: 6105 addi sp,sp,32 + 8001f3d6: 8082 ret + +Disassembly of section .text._ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E: + +000000008001f3d8 <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E>: +fn handle_reserve(result: Result<(), TryReserveError>) { + 8001f3d8: 1101 addi sp,sp,-32 + 8001f3da: e42a sd a0,8(sp) + Err(CapacityOverflow) => capacity_overflow(), + 8001f3dc: 6108 ld a0,0(a0) + 8001f3de: 4581 li a1,0 + 8001f3e0: 00b50463 beq a0,a1,8001f3e8 <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E+0x10> + 8001f3e4: a009 j 8001f3e6 <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E+0xe> + 8001f3e6: a019 j 8001f3ec <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E+0x14> +} + 8001f3e8: 6105 addi sp,sp,32 + 8001f3ea: 8082 ret + Err(CapacityOverflow) => capacity_overflow(), + 8001f3ec: 6522 ld a0,8(sp) + 8001f3ee: 6908 ld a0,16(a0) + 8001f3f0: 00a035b3 snez a1,a0 + 8001f3f4: 4581 li a1,0 + 8001f3f6: 00b50563 beq a0,a1,8001f400 <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E+0x28> + 8001f3fa: a009 j 8001f3fc <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E+0x24> + 8001f3fc: a039 j 8001f40a <_ZN5alloc7raw_vec14handle_reserve17h9818f7956a53f3d6E+0x32> + match result { + 8001f3fe: 0000 unimp + Err(CapacityOverflow) => capacity_overflow(), + 8001f400: 00004097 auipc ra,0x4 + 8001f404: b5a080e7 jalr -1190(ra) # 80022f5a <_ZN5alloc7raw_vec17capacity_overflow17hae1c560931d103e4E> + 8001f408: 0000 unimp + Err(AllocError { layout, .. }) => handle_alloc_error(layout), + 8001f40a: 65a2 ld a1,8(sp) + 8001f40c: 6588 ld a0,8(a1) + 8001f40e: 698c ld a1,16(a1) + 8001f410: e82a sd a0,16(sp) + 8001f412: ec2e sd a1,24(sp) + 8001f414: 00004097 auipc ra,0x4 + 8001f418: b2a080e7 jalr -1238(ra) # 80022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE> + ... + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h8e05789f6aa15028E: + +000000008001f41e <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h8e05789f6aa15028E>: + 8001f41e: 1101 addi sp,sp,-32 + 8001f420: ec06 sd ra,24(sp) + 8001f422: 862e mv a2,a1 + 8001f424: 85aa mv a1,a0 + 8001f426: e42e sd a1,8(sp) + 8001f428: e832 sd a2,16(sp) + 8001f42a: 6188 ld a0,0(a1) + 8001f42c: 658c ld a1,8(a1) + 8001f42e: 00005097 auipc ra,0x5 + 8001f432: cd0080e7 jalr -816(ra) # 800240fe <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE> + 8001f436: e02a sd a0,0(sp) + 8001f438: a009 j 8001f43a <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h8e05789f6aa15028E+0x1c> + 8001f43a: 6502 ld a0,0(sp) + 8001f43c: 60e2 ld ra,24(sp) + 8001f43e: 6105 addi sp,sp,32 + 8001f440: 8082 ret + +Disassembly of section .text._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h3baa88b0b8ed59b0E: + +000000008001f442 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h3baa88b0b8ed59b0E>: + 8001f442: 1101 addi sp,sp,-32 + 8001f444: ec06 sd ra,24(sp) + 8001f446: e42a sd a0,8(sp) + 8001f448: e82e sd a1,16(sp) + 8001f44a: 6108 ld a0,0(a0) + 8001f44c: 00006097 auipc ra,0x6 + 8001f450: 0bc080e7 jalr 188(ra) # 80025508 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h1b385cecfac82c6bE> + 8001f454: e02a sd a0,0(sp) + 8001f456: a009 j 8001f458 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h3baa88b0b8ed59b0E+0x16> + 8001f458: 6502 ld a0,0(sp) + 8001f45a: 60e2 ld ra,24(sp) + 8001f45c: 6105 addi sp,sp,32 + 8001f45e: 8082 ret + +Disassembly of section .text._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E: + +000000008001f460 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E>: + 8001f460: 1101 addi sp,sp,-32 + 8001f462: ec06 sd ra,24(sp) + 8001f464: 862e mv a2,a1 + 8001f466: 85aa mv a1,a0 + 8001f468: e42e sd a1,8(sp) + 8001f46a: e832 sd a2,16(sp) + 8001f46c: 6188 ld a0,0(a1) + 8001f46e: 658c ld a1,8(a1) + 8001f470: 00005097 auipc ra,0x5 + 8001f474: 0de080e7 jalr 222(ra) # 8002454e <_ZN42_$LT$str$u20$as$u20$core..fmt..Display$GT$3fmt17h0539661bd0865efeE> + 8001f478: e02a sd a0,0(sp) + 8001f47a: a009 j 8001f47c <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hcf8aee9e483a0eb6E+0x1c> + 8001f47c: 6502 ld a0,0(sp) + 8001f47e: 60e2 ld ra,24(sp) + 8001f480: 6105 addi sp,sp,32 + 8001f482: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE: + +000000008001f484 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f484: 715d addi sp,sp,-80 + 8001f486: e82a sd a0,16(sp) + 8001f488: f82a sd a0,48(sp) + 8001f48a: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f48c: e0ae sd a1,64(sp) + 8001f48e: ec2e sd a1,24(sp) + 8001f490: a009 j 8001f492 <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE+0xe> + 8001f492: 6542 ld a0,16(sp) + 8001f494: e4aa sd a0,72(sp) + 8001f496: e42a sd a0,8(sp) + 8001f498: a009 j 8001f49a <_ZN4core3fmt10ArgumentV13new17h4a2663b66f30befbE+0x16> + 8001f49a: 65e2 ld a1,24(sp) + 8001f49c: 6522 ld a0,8(sp) + 8001f49e: f02a sd a0,32(sp) + 8001f4a0: f42e sd a1,40(sp) + } + 8001f4a2: 6161 addi sp,sp,80 + 8001f4a4: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E: + +000000008001f4a6 <_ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f4a6: 715d addi sp,sp,-80 + 8001f4a8: e82a sd a0,16(sp) + 8001f4aa: f82a sd a0,48(sp) + 8001f4ac: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f4ae: e0ae sd a1,64(sp) + 8001f4b0: ec2e sd a1,24(sp) + 8001f4b2: a009 j 8001f4b4 <_ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E+0xe> + 8001f4b4: 6542 ld a0,16(sp) + 8001f4b6: e4aa sd a0,72(sp) + 8001f4b8: e42a sd a0,8(sp) + 8001f4ba: a009 j 8001f4bc <_ZN4core3fmt10ArgumentV13new17h4cc7035953f043f8E+0x16> + 8001f4bc: 65e2 ld a1,24(sp) + 8001f4be: 6522 ld a0,8(sp) + 8001f4c0: f02a sd a0,32(sp) + 8001f4c2: f42e sd a1,40(sp) + } + 8001f4c4: 6161 addi sp,sp,80 + 8001f4c6: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E: + +000000008001f4c8 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f4c8: 715d addi sp,sp,-80 + 8001f4ca: e82a sd a0,16(sp) + 8001f4cc: f82a sd a0,48(sp) + 8001f4ce: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f4d0: e0ae sd a1,64(sp) + 8001f4d2: ec2e sd a1,24(sp) + 8001f4d4: a009 j 8001f4d6 <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E+0xe> + 8001f4d6: 6542 ld a0,16(sp) + 8001f4d8: e4aa sd a0,72(sp) + 8001f4da: e42a sd a0,8(sp) + 8001f4dc: a009 j 8001f4de <_ZN4core3fmt10ArgumentV13new17h56f4edf050dced00E+0x16> + 8001f4de: 65e2 ld a1,24(sp) + 8001f4e0: 6522 ld a0,8(sp) + 8001f4e2: f02a sd a0,32(sp) + 8001f4e4: f42e sd a1,40(sp) + } + 8001f4e6: 6161 addi sp,sp,80 + 8001f4e8: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17h64cb168c9af0caf2E: + +000000008001f4ea <_ZN4core3fmt10ArgumentV13new17h64cb168c9af0caf2E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f4ea: 715d addi sp,sp,-80 + 8001f4ec: e82a sd a0,16(sp) + 8001f4ee: f82a sd a0,48(sp) + 8001f4f0: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f4f2: e0ae sd a1,64(sp) + 8001f4f4: ec2e sd a1,24(sp) + 8001f4f6: a009 j 8001f4f8 <_ZN4core3fmt10ArgumentV13new17h64cb168c9af0caf2E+0xe> + 8001f4f8: 6542 ld a0,16(sp) + 8001f4fa: e4aa sd a0,72(sp) + 8001f4fc: e42a sd a0,8(sp) + 8001f4fe: a009 j 8001f500 <_ZN4core3fmt10ArgumentV13new17h64cb168c9af0caf2E+0x16> + 8001f500: 65e2 ld a1,24(sp) + 8001f502: 6522 ld a0,8(sp) + 8001f504: f02a sd a0,32(sp) + 8001f506: f42e sd a1,40(sp) + } + 8001f508: 6161 addi sp,sp,80 + 8001f50a: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17h8dd13dffa5e435d0E: + +000000008001f50c <_ZN4core3fmt10ArgumentV13new17h8dd13dffa5e435d0E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f50c: 715d addi sp,sp,-80 + 8001f50e: e82a sd a0,16(sp) + 8001f510: f82a sd a0,48(sp) + 8001f512: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f514: e0ae sd a1,64(sp) + 8001f516: ec2e sd a1,24(sp) + 8001f518: a009 j 8001f51a <_ZN4core3fmt10ArgumentV13new17h8dd13dffa5e435d0E+0xe> + 8001f51a: 6542 ld a0,16(sp) + 8001f51c: e4aa sd a0,72(sp) + 8001f51e: e42a sd a0,8(sp) + 8001f520: a009 j 8001f522 <_ZN4core3fmt10ArgumentV13new17h8dd13dffa5e435d0E+0x16> + 8001f522: 65e2 ld a1,24(sp) + 8001f524: 6522 ld a0,8(sp) + 8001f526: f02a sd a0,32(sp) + 8001f528: f42e sd a1,40(sp) + } + 8001f52a: 6161 addi sp,sp,80 + 8001f52c: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17hc1ed914d10380b65E: + +000000008001f52e <_ZN4core3fmt10ArgumentV13new17hc1ed914d10380b65E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f52e: 715d addi sp,sp,-80 + 8001f530: e82a sd a0,16(sp) + 8001f532: f82a sd a0,48(sp) + 8001f534: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f536: e0ae sd a1,64(sp) + 8001f538: ec2e sd a1,24(sp) + 8001f53a: a009 j 8001f53c <_ZN4core3fmt10ArgumentV13new17hc1ed914d10380b65E+0xe> + 8001f53c: 6542 ld a0,16(sp) + 8001f53e: e4aa sd a0,72(sp) + 8001f540: e42a sd a0,8(sp) + 8001f542: a009 j 8001f544 <_ZN4core3fmt10ArgumentV13new17hc1ed914d10380b65E+0x16> + 8001f544: 65e2 ld a1,24(sp) + 8001f546: 6522 ld a0,8(sp) + 8001f548: f02a sd a0,32(sp) + 8001f54a: f42e sd a1,40(sp) + } + 8001f54c: 6161 addi sp,sp,80 + 8001f54e: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17hd8cc9af5365c80feE: + +000000008001f550 <_ZN4core3fmt10ArgumentV13new17hd8cc9af5365c80feE>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f550: 715d addi sp,sp,-80 + 8001f552: e82a sd a0,16(sp) + 8001f554: f82a sd a0,48(sp) + 8001f556: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f558: e0ae sd a1,64(sp) + 8001f55a: ec2e sd a1,24(sp) + 8001f55c: a009 j 8001f55e <_ZN4core3fmt10ArgumentV13new17hd8cc9af5365c80feE+0xe> + 8001f55e: 6542 ld a0,16(sp) + 8001f560: e4aa sd a0,72(sp) + 8001f562: e42a sd a0,8(sp) + 8001f564: a009 j 8001f566 <_ZN4core3fmt10ArgumentV13new17hd8cc9af5365c80feE+0x16> + 8001f566: 65e2 ld a1,24(sp) + 8001f568: 6522 ld a0,8(sp) + 8001f56a: f02a sd a0,32(sp) + 8001f56c: f42e sd a1,40(sp) + } + 8001f56e: 6161 addi sp,sp,80 + 8001f570: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17hff1fcd65a46300b2E: + +000000008001f572 <_ZN4core3fmt10ArgumentV13new17hff1fcd65a46300b2E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8001f572: 715d addi sp,sp,-80 + 8001f574: e82a sd a0,16(sp) + 8001f576: f82a sd a0,48(sp) + 8001f578: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 8001f57a: e0ae sd a1,64(sp) + 8001f57c: ec2e sd a1,24(sp) + 8001f57e: a009 j 8001f580 <_ZN4core3fmt10ArgumentV13new17hff1fcd65a46300b2E+0xe> + 8001f580: 6542 ld a0,16(sp) + 8001f582: e4aa sd a0,72(sp) + 8001f584: e42a sd a0,8(sp) + 8001f586: a009 j 8001f588 <_ZN4core3fmt10ArgumentV13new17hff1fcd65a46300b2E+0x16> + 8001f588: 65e2 ld a1,24(sp) + 8001f58a: 6522 ld a0,8(sp) + 8001f58c: f02a sd a0,32(sp) + 8001f58e: f42e sd a1,40(sp) + } + 8001f590: 6161 addi sp,sp,80 + 8001f592: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register4satp4read17h0624a35f6368d5a6E: + +000000008001f594 <_ZN6kernel4arch5riscv8register4satp4read17h0624a35f6368d5a6E>: +pub const SATP_SV39:usize = 8 << 60; + +// supervisor address translation and protection; +// holds the address of the page table. +#[inline] +pub unsafe fn read() -> usize { + 8001f594: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("csrr $0, satp":"=r"(ret):::"volatile"); + 8001f596: 18002573 csrr a0,satp + 8001f59a: e42a sd a0,8(sp) + ret +} + 8001f59c: 0141 addi sp,sp,16 + 8001f59e: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register4satp5write17h136481b47a553b1cE: + +000000008001f5a0 <_ZN6kernel4arch5riscv8register4satp5write17h136481b47a553b1cE>: + +pub unsafe fn write(x: usize){ + 8001f5a0: 1141 addi sp,sp,-16 + 8001f5a2: e42a sd a0,8(sp) + // println!("write satp"); + llvm_asm!("csrw satp, $0"::"r"(x)::"volatile"); + 8001f5a4: 18051073 csrw satp,a0 + 8001f5a8: 0141 addi sp,sp,16 + 8001f5aa: 8082 ret + +Disassembly of section .text._ZN6kernel2fs4stat4Stat3new17h349e191f39203f6dE: + +000000008001f5ac <_ZN6kernel2fs4stat4Stat3new17h349e191f39203f6dE>: + pub nlink: i16, // Number of links to link + pub size: usize, // Size of file bytes +} + +impl Stat { + pub const fn new() -> Self { + 8001f5ac: 85aa mv a1,a0 + 8001f5ae: 4501 li a0,0 + Self { + 8001f5b0: e188 sd a0,0(a1) + 8001f5b2: c588 sw a0,8(a1) + 8001f5b4: e988 sd a0,16(a1) + inum: 0, + itype: InodeType::Empty, + nlink: 0, + size: 0 + } + } + 8001f5b6: 8082 ret + +Disassembly of section .text._ZN4core3fmt5Write10write_char17hd77becfa0a78745aE: + +000000008001f5b8 <_ZN4core3fmt5Write10write_char17hd77becfa0a78745aE>: + fn write_char(&mut self, c: char) -> Result { + 8001f5b8: 715d addi sp,sp,-80 + 8001f5ba: e486 sd ra,72(sp) + 8001f5bc: e82e sd a1,16(sp) + 8001f5be: 85aa mv a1,a0 + 8001f5c0: 6542 ld a0,16(sp) + 8001f5c2: ec2e sd a1,24(sp) + 8001f5c4: fc2e sd a1,56(sp) + 8001f5c6: c2aa sw a0,68(sp) + 8001f5c8: 4581 li a1,0 + self.write_str(c.encode_utf8(&mut [0; 4])) + 8001f5ca: da2e sw a1,52(sp) + 8001f5cc: 184c addi a1,sp,52 + 8001f5ce: 4611 li a2,4 + 8001f5d0: ffffd097 auipc ra,0xffffd + 8001f5d4: b3a080e7 jalr -1222(ra) # 8001c10a <_ZN4core4char7methods22_$LT$impl$u20$char$GT$11encode_utf817h7239bcb774eea5aaE> + 8001f5d8: f02a sd a0,32(sp) + 8001f5da: f42e sd a1,40(sp) + 8001f5dc: a009 j 8001f5de <_ZN4core3fmt5Write10write_char17hd77becfa0a78745aE+0x26> + 8001f5de: 7622 ld a2,40(sp) + 8001f5e0: 7582 ld a1,32(sp) + 8001f5e2: 6562 ld a0,24(sp) + 8001f5e4: ffffd097 auipc ra,0xffffd + 8001f5e8: dce080e7 jalr -562(ra) # 8001c3b2 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE> + 8001f5ec: e42a sd a0,8(sp) + 8001f5ee: a009 j 8001f5f0 <_ZN4core3fmt5Write10write_char17hd77becfa0a78745aE+0x38> + } + 8001f5f0: 6522 ld a0,8(sp) + 8001f5f2: 60a6 ld ra,72(sp) + 8001f5f4: 6161 addi sp,sp,80 + 8001f5f6: 8082 ret + +Disassembly of section .text._ZN4core3fmt5Write9write_fmt17h7425e676f17f7351E: + +000000008001f5f8 <_ZN4core3fmt5Write9write_fmt17h7425e676f17f7351E>: + fn write_fmt(mut self: &mut Self, args: Arguments<'_>) -> Result { + 8001f5f8: 715d addi sp,sp,-80 + 8001f5fa: e486 sd ra,72(sp) + 8001f5fc: e82a sd a0,16(sp) + write(&mut self, args) + 8001f5fe: 6188 ld a0,0(a1) + 8001f600: ec2a sd a0,24(sp) + 8001f602: 6588 ld a0,8(a1) + 8001f604: f02a sd a0,32(sp) + 8001f606: 6988 ld a0,16(a1) + 8001f608: f42a sd a0,40(sp) + 8001f60a: 6d88 ld a0,24(a1) + 8001f60c: f82a sd a0,48(sp) + 8001f60e: 7188 ld a0,32(a1) + 8001f610: fc2a sd a0,56(sp) + 8001f612: 7588 ld a0,40(a1) + 8001f614: e0aa sd a0,64(sp) + +000000008001f616 <.LBB1_2>: + 8001f616: 0000d597 auipc a1,0xd + 8001f61a: 6a258593 addi a1,a1,1698 # 8002ccb8 <.L__unnamed_1> + 8001f61e: 0808 addi a0,sp,16 + 8001f620: 0830 addi a2,sp,24 + 8001f622: 00004097 auipc ra,0x4 + 8001f626: 384080e7 jalr 900(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 8001f62a: e42a sd a0,8(sp) + 8001f62c: a009 j 8001f62e <.LBB1_2+0x18> + } + 8001f62e: 6522 ld a0,8(sp) + 8001f630: 60a6 ld ra,72(sp) + 8001f632: 6161 addi sp,sp,80 + 8001f634: 8082 ret + +Disassembly of section .text._ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h1e2dcf27a34235edE: + +000000008001f636 <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h1e2dcf27a34235edE>: + fn write_char(&mut self, c: char) -> Result { + 8001f636: 1101 addi sp,sp,-32 + 8001f638: ec06 sd ra,24(sp) + 8001f63a: e42a sd a0,8(sp) + 8001f63c: ca2e sw a1,20(sp) + (**self).write_char(c) + 8001f63e: 6108 ld a0,0(a0) + 8001f640: 00000097 auipc ra,0x0 + 8001f644: f78080e7 jalr -136(ra) # 8001f5b8 <_ZN4core3fmt5Write10write_char17hd77becfa0a78745aE> + 8001f648: e02a sd a0,0(sp) + 8001f64a: a009 j 8001f64c <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h1e2dcf27a34235edE+0x16> + } + 8001f64c: 6502 ld a0,0(sp) + 8001f64e: 60e2 ld ra,24(sp) + 8001f650: 6105 addi sp,sp,32 + 8001f652: 8082 ret + +Disassembly of section .text._ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_fmt17hc6623925455b9c1eE: + +000000008001f654 <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_fmt17hc6623925455b9c1eE>: + fn write_fmt(&mut self, args: Arguments<'_>) -> Result { + 8001f654: 715d addi sp,sp,-80 + 8001f656: e486 sd ra,72(sp) + 8001f658: e0aa sd a0,64(sp) + (**self).write_fmt(args) + 8001f65a: 6108 ld a0,0(a0) + 8001f65c: 7590 ld a2,40(a1) + 8001f65e: fc32 sd a2,56(sp) + 8001f660: 7190 ld a2,32(a1) + 8001f662: f832 sd a2,48(sp) + 8001f664: 6d90 ld a2,24(a1) + 8001f666: f432 sd a2,40(sp) + 8001f668: 6990 ld a2,16(a1) + 8001f66a: f032 sd a2,32(sp) + 8001f66c: 6590 ld a2,8(a1) + 8001f66e: ec32 sd a2,24(sp) + 8001f670: 618c ld a1,0(a1) + 8001f672: e82e sd a1,16(sp) + 8001f674: 080c addi a1,sp,16 + 8001f676: 00000097 auipc ra,0x0 + 8001f67a: f82080e7 jalr -126(ra) # 8001f5f8 <_ZN4core3fmt5Write9write_fmt17h7425e676f17f7351E> + 8001f67e: e42a sd a0,8(sp) + 8001f680: a009 j 8001f682 <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_fmt17hc6623925455b9c1eE+0x2e> + } + 8001f682: 6522 ld a0,8(sp) + 8001f684: 60a6 ld ra,72(sp) + 8001f686: 6161 addi sp,sp,80 + 8001f688: 8082 ret + +Disassembly of section .text._ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17h41f150747a15ec7fE: + +000000008001f68a <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17h41f150747a15ec7fE>: + fn write_str(&mut self, s: &str) -> Result { + 8001f68a: 7179 addi sp,sp,-48 + 8001f68c: f406 sd ra,40(sp) + 8001f68e: e82a sd a0,16(sp) + 8001f690: ec2e sd a1,24(sp) + 8001f692: f032 sd a2,32(sp) + (**self).write_str(s) + 8001f694: 6108 ld a0,0(a0) + 8001f696: ffffd097 auipc ra,0xffffd + 8001f69a: d1c080e7 jalr -740(ra) # 8001c3b2 <_ZN63_$LT$kernel..driver..uart..Uart$u20$as$u20$core..fmt..Write$GT$9write_str17ha964a515ad10903aE> + 8001f69e: e42a sd a0,8(sp) + 8001f6a0: a009 j 8001f6a2 <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17h41f150747a15ec7fE+0x18> + } + 8001f6a2: 6522 ld a0,8(sp) + 8001f6a4: 70a2 ld ra,40(sp) + 8001f6a6: 6145 addi sp,sp,48 + 8001f6a8: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register2tp4read17h418649f5c8f5b927E: + +000000008001f6aa <_ZN6kernel4arch5riscv8register2tp4read17h418649f5c8f5b927E>: +// read and write tp, the thread pointer, which holds +// this core's hartid (core number), the index into cpus[]. +#[inline] +pub unsafe fn read() -> usize { + 8001f6aa: 1141 addi sp,sp,-16 + let ret:usize; + llvm_asm!("mv $0, tp":"=r"(ret):::"volatile"); + 8001f6ac: 8512 mv a0,tp + 8001f6ae: e42a sd a0,8(sp) + ret +} + 8001f6b0: 0141 addi sp,sp,16 + 8001f6b2: 8082 ret + +Disassembly of section .text._ZN6kernel4arch5riscv8register2tp5write17hac520d82928ad2ddE: + +000000008001f6b4 <_ZN6kernel4arch5riscv8register2tp5write17hac520d82928ad2ddE>: + +#[inline] +pub unsafe fn write(x:usize){ + 8001f6b4: 1141 addi sp,sp,-16 + 8001f6b6: e42a sd a0,8(sp) + llvm_asm!("mv tp, $0"::"r"(x)::"volatile"); + 8001f6b8: 822a mv tp,a0 + 8001f6ba: 0141 addi sp,sp,16 + 8001f6bc: 8082 ret + +Disassembly of section .text._ZN4core3str8converts19from_utf8_unchecked17hb3b621a5f279bc07E: + +000000008001f6be <_ZN4core3str8converts19from_utf8_unchecked17hb3b621a5f279bc07E>: +/// ``` +#[inline] +#[stable(feature = "rust1", since = "1.0.0")] +#[rustc_const_unstable(feature = "const_str_from_utf8_unchecked", issue = "75196")] +#[rustc_allow_const_fn_unstable(const_fn_transmute)] +pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str { + 8001f6be: 7179 addi sp,sp,-48 + 8001f6c0: e82a sd a0,16(sp) + 8001f6c2: ec2e sd a1,24(sp) + // SAFETY: the caller must guarantee that the bytes `v` are valid UTF-8. + // Also relies on `&str` and `&[u8]` having the same layout. + unsafe { mem::transmute(v) } + 8001f6c4: f02a sd a0,32(sp) + 8001f6c6: f42e sd a1,40(sp) + 8001f6c8: e02a sd a0,0(sp) + 8001f6ca: e42e sd a1,8(sp) + 8001f6cc: a009 j 8001f6ce <_ZN4core3str8converts19from_utf8_unchecked17hb3b621a5f279bc07E+0x10> +} + 8001f6ce: 65a2 ld a1,8(sp) + 8001f6d0: 6502 ld a0,0(sp) + 8001f6d2: 6145 addi sp,sp,48 + 8001f6d4: 8082 ret + +Disassembly of section .text._ZN4core3str8converts23from_utf8_unchecked_mut17h690302c73d561c56E: + +000000008001f6d6 <_ZN4core3str8converts23from_utf8_unchecked_mut17h690302c73d561c56E>: +/// +/// assert_eq!("💖", heart); +/// ``` +#[inline] +#[stable(feature = "str_mut_extras", since = "1.20.0")] +pub unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str { + 8001f6d6: 1141 addi sp,sp,-16 + 8001f6d8: e02a sd a0,0(sp) + 8001f6da: e42e sd a1,8(sp) + // SAFETY: the caller must guarantee that the bytes `v` + // are valid UTF-8, thus the cast to `*mut str` is safe. + // Also, the pointer dereference is safe because that pointer + // comes from a reference which is guaranteed to be valid for writes. + unsafe { &mut *(v as *mut [u8] as *mut str) } +} + 8001f6dc: 0141 addi sp,sp,16 + 8001f6de: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E: + +000000008001f6e0 <_ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E>: + pub fn pad_to_align(&self) -> Layout { + 8001f6e0: 7159 addi sp,sp,-112 + 8001f6e2: f486 sd ra,104(sp) + 8001f6e4: e0aa sd a0,64(sp) + 8001f6e6: e8aa sd a0,80(sp) + let pad = self.padding_needed_for(self.align()); + 8001f6e8: 00000097 auipc ra,0x0 + 8001f6ec: 17e080e7 jalr 382(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8001f6f0: e4aa sd a0,72(sp) + 8001f6f2: a009 j 8001f6f4 <_ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E+0x14> + 8001f6f4: 65a6 ld a1,72(sp) + 8001f6f6: 6506 ld a0,64(sp) + 8001f6f8: 00000097 auipc ra,0x0 + 8001f6fc: 0ce080e7 jalr 206(ra) # 8001f7c6 <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E> + 8001f700: 85aa mv a1,a0 + 8001f702: fc2e sd a1,56(sp) + 8001f704: ecaa sd a0,88(sp) + 8001f706: a009 j 8001f708 <_ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E+0x28> + let new_size = self.size() + pad; + 8001f708: 6506 ld a0,64(sp) + 8001f70a: 00000097 auipc ra,0x0 + 8001f70e: 152080e7 jalr 338(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8001f712: f82a sd a0,48(sp) + 8001f714: a009 j 8001f716 <_ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E+0x36> + 8001f716: 6506 ld a0,64(sp) + 8001f718: 75c2 ld a1,48(sp) + 8001f71a: 7662 ld a2,56(sp) + 8001f71c: 95b2 add a1,a1,a2 + 8001f71e: f02e sd a1,32(sp) + 8001f720: f0ae sd a1,96(sp) + Layout::from_size_align(new_size, self.align()).unwrap() + 8001f722: 00000097 auipc ra,0x0 + 8001f726: 144080e7 jalr 324(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8001f72a: f42a sd a0,40(sp) + 8001f72c: a009 j 8001f72e <_ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E+0x4e> + 8001f72e: 75a2 ld a1,40(sp) + 8001f730: 7502 ld a0,32(sp) + 8001f732: 00000097 auipc ra,0x0 + 8001f736: 032080e7 jalr 50(ra) # 8001f764 <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE> + 8001f73a: e82a sd a0,16(sp) + 8001f73c: ec2e sd a1,24(sp) + 8001f73e: a009 j 8001f740 <_ZN4core5alloc6layout6Layout12pad_to_align17hf134c92d73cc7687E+0x60> + 8001f740: 65e2 ld a1,24(sp) + 8001f742: 6542 ld a0,16(sp) + +000000008001f744 <.LBB0_7>: + 8001f744: 0000d617 auipc a2,0xd + 8001f748: 62460613 addi a2,a2,1572 # 8002cd68 <.L__unnamed_1> + 8001f74c: fffee097 auipc ra,0xfffee + 8001f750: f68080e7 jalr -152(ra) # 8000d6b4 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h01f79eb8d5b769f4E> + 8001f754: e02a sd a0,0(sp) + 8001f756: e42e sd a1,8(sp) + 8001f758: a009 j 8001f75a <.LBB0_7+0x16> + } + 8001f75a: 65a2 ld a1,8(sp) + 8001f75c: 6502 ld a0,0(sp) + 8001f75e: 70a6 ld ra,104(sp) + 8001f760: 6165 addi sp,sp,112 + 8001f762: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE: + +000000008001f764 <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE>: + pub const fn from_size_align(size: usize, align: usize) -> Result { + 8001f764: 715d addi sp,sp,-80 + 8001f766: e486 sd ra,72(sp) + 8001f768: e82e sd a1,16(sp) + 8001f76a: 85aa mv a1,a0 + 8001f76c: 6542 ld a0,16(sp) + 8001f76e: ec2e sd a1,24(sp) + 8001f770: fc2e sd a1,56(sp) + 8001f772: e0aa sd a0,64(sp) + if !align.is_power_of_two() { + 8001f774: 00000097 auipc ra,0x0 + 8001f778: 86c080e7 jalr -1940(ra) # 8001efe0 <_ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h1415e23f4938ba42E> + 8001f77c: f02a sd a0,32(sp) + 8001f77e: a009 j 8001f780 <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x1c> + 8001f780: 7502 ld a0,32(sp) + 8001f782: e509 bnez a0,8001f78c <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x28> + 8001f784: a009 j 8001f786 <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x22> + 8001f786: 4501 li a0,0 + return Err(LayoutError { private: () }); + 8001f788: f82a sd a0,48(sp) + 8001f78a: a80d j 8001f7bc <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x58> + 8001f78c: 65e2 ld a1,24(sp) + 8001f78e: 6642 ld a2,16(sp) + 8001f790: 4501 li a0,0 + if size > usize::MAX - (align - 1) { + 8001f792: 8d11 sub a0,a0,a2 + 8001f794: 00b57663 bgeu a0,a1,8001f7a0 <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x3c> + 8001f798: a009 j 8001f79a <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x36> + 8001f79a: 4501 li a0,0 + return Err(LayoutError { private: () }); + 8001f79c: f82a sd a0,48(sp) + 8001f79e: a839 j 8001f7bc <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x58> + unsafe { Ok(Layout::from_size_align_unchecked(size, align)) } + 8001f7a0: 65c2 ld a1,16(sp) + 8001f7a2: 6562 ld a0,24(sp) + 8001f7a4: 00000097 auipc ra,0x0 + 8001f7a8: 08e080e7 jalr 142(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8001f7ac: e02a sd a0,0(sp) + 8001f7ae: e42e sd a1,8(sp) + 8001f7b0: a009 j 8001f7b2 <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x4e> + 8001f7b2: 6522 ld a0,8(sp) + 8001f7b4: 6582 ld a1,0(sp) + 8001f7b6: f42e sd a1,40(sp) + 8001f7b8: f82a sd a0,48(sp) + } + 8001f7ba: a009 j 8001f7bc <_ZN4core5alloc6layout6Layout15from_size_align17h679d1a608f332f1fE+0x58> + 8001f7bc: 7522 ld a0,40(sp) + 8001f7be: 75c2 ld a1,48(sp) + 8001f7c0: 60a6 ld ra,72(sp) + 8001f7c2: 6161 addi sp,sp,80 + 8001f7c4: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E: + +000000008001f7c6 <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E>: + pub const fn padding_needed_for(&self, align: usize) -> usize { + 8001f7c6: 711d addi sp,sp,-96 + 8001f7c8: ec86 sd ra,88(sp) + 8001f7ca: f42e sd a1,40(sp) + 8001f7cc: fc2a sd a0,56(sp) + 8001f7ce: e0ae sd a1,64(sp) + let len = self.size(); + 8001f7d0: 00000097 auipc ra,0x0 + 8001f7d4: 08c080e7 jalr 140(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8001f7d8: 85aa mv a1,a0 + 8001f7da: f82e sd a1,48(sp) + 8001f7dc: e4aa sd a0,72(sp) + 8001f7de: a009 j 8001f7e0 <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E+0x1a> + let len_rounded_up = len.wrapping_add(align).wrapping_sub(1) & !align.wrapping_sub(1); + 8001f7e0: 75a2 ld a1,40(sp) + 8001f7e2: 7542 ld a0,48(sp) + 8001f7e4: fffff097 auipc ra,0xfffff + 8001f7e8: 77c080e7 jalr 1916(ra) # 8001ef60 <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_add17he0ea74277f4c06b1E> + 8001f7ec: f02a sd a0,32(sp) + 8001f7ee: a009 j 8001f7f0 <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E+0x2a> + 8001f7f0: 7502 ld a0,32(sp) + 8001f7f2: 4585 li a1,1 + 8001f7f4: fffff097 auipc ra,0xfffff + 8001f7f8: 778080e7 jalr 1912(ra) # 8001ef6c <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_sub17h8f077bf007d122c9E> + 8001f7fc: ec2a sd a0,24(sp) + 8001f7fe: a009 j 8001f800 <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E+0x3a> + 8001f800: 7522 ld a0,40(sp) + 8001f802: 4585 li a1,1 + 8001f804: fffff097 auipc ra,0xfffff + 8001f808: 768080e7 jalr 1896(ra) # 8001ef6c <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_sub17h8f077bf007d122c9E> + 8001f80c: e82a sd a0,16(sp) + 8001f80e: a009 j 8001f810 <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E+0x4a> + 8001f810: 75c2 ld a1,48(sp) + 8001f812: 6562 ld a0,24(sp) + 8001f814: 6642 ld a2,16(sp) + 8001f816: fff64613 not a2,a2 + 8001f81a: 8d71 and a0,a0,a2 + 8001f81c: e8aa sd a0,80(sp) + len_rounded_up.wrapping_sub(len) + 8001f81e: fffff097 auipc ra,0xfffff + 8001f822: 74e080e7 jalr 1870(ra) # 8001ef6c <_ZN4core3num23_$LT$impl$u20$usize$GT$12wrapping_sub17h8f077bf007d122c9E> + 8001f826: e42a sd a0,8(sp) + 8001f828: a009 j 8001f82a <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E+0x64> + } + 8001f82a: 6522 ld a0,8(sp) + 8001f82c: 60e6 ld ra,88(sp) + 8001f82e: 6125 addi sp,sp,96 + 8001f830: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E: + +000000008001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E>: + pub const unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Self { + 8001f832: 7139 addi sp,sp,-64 + 8001f834: fc06 sd ra,56(sp) + 8001f836: e02e sd a1,0(sp) + 8001f838: 85aa mv a1,a0 + 8001f83a: 6502 ld a0,0(sp) + 8001f83c: e42e sd a1,8(sp) + 8001f83e: f42e sd a1,40(sp) + 8001f840: f82a sd a0,48(sp) + Layout { size_: size, align_: unsafe { NonZeroUsize::new_unchecked(align) } } + 8001f842: ffffa097 auipc ra,0xffffa + 8001f846: 9f0080e7 jalr -1552(ra) # 80019232 <_ZN4core3num7nonzero12NonZeroUsize13new_unchecked17h04f2481c8bf8ee85E> + 8001f84a: e82a sd a0,16(sp) + 8001f84c: a009 j 8001f84e <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E+0x1c> + 8001f84e: 65c2 ld a1,16(sp) + 8001f850: 6522 ld a0,8(sp) + 8001f852: ec2a sd a0,24(sp) + 8001f854: f02e sd a1,32(sp) + } + 8001f856: 70e2 ld ra,56(sp) + 8001f858: 6121 addi sp,sp,64 + 8001f85a: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE: + +000000008001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE>: + pub const fn size(&self) -> usize { + 8001f85c: 1141 addi sp,sp,-16 + 8001f85e: e42a sd a0,8(sp) + self.size_ + 8001f860: 6108 ld a0,0(a0) + } + 8001f862: 0141 addi sp,sp,16 + 8001f864: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE: + +000000008001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE>: + pub const fn align(&self) -> usize { + 8001f866: 1101 addi sp,sp,-32 + 8001f868: ec06 sd ra,24(sp) + 8001f86a: e82a sd a0,16(sp) + self.align_.get() + 8001f86c: 6508 ld a0,8(a0) + 8001f86e: ffffa097 auipc ra,0xffffa + 8001f872: 9ce080e7 jalr -1586(ra) # 8001923c <_ZN4core3num7nonzero12NonZeroUsize3get17h9c9882678da2bc98E> + 8001f876: e42a sd a0,8(sp) + 8001f878: a009 j 8001f87a <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE+0x14> + } + 8001f87a: 6522 ld a0,8(sp) + 8001f87c: 60e2 ld ra,24(sp) + 8001f87e: 6105 addi sp,sp,32 + 8001f880: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE: + +000000008001f882 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE>: + pub fn repeat(&self, n: usize) -> Result<(Self, usize), LayoutError> { + 8001f882: 7115 addi sp,sp,-224 + 8001f884: ed86 sd ra,216(sp) + 8001f886: ecb2 sd a2,88(sp) + 8001f888: f0ae sd a1,96(sp) + 8001f88a: 85aa mv a1,a0 + 8001f88c: 7506 ld a0,96(sp) + 8001f88e: f4ae sd a1,104(sp) + 8001f890: f52a sd a0,168(sp) + 8001f892: f932 sd a2,176(sp) + let padded_size = self.size() + self.padding_needed_for(self.align()); + 8001f894: 00000097 auipc ra,0x0 + 8001f898: fc8080e7 jalr -56(ra) # 8001f85c <_ZN4core5alloc6layout6Layout4size17h7f60c0168860a2ffE> + 8001f89c: f8aa sd a0,112(sp) + 8001f89e: a009 j 8001f8a0 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x1e> + 8001f8a0: 7506 ld a0,96(sp) + 8001f8a2: 00000097 auipc ra,0x0 + 8001f8a6: fc4080e7 jalr -60(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8001f8aa: e8aa sd a0,80(sp) + 8001f8ac: a009 j 8001f8ae <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x2c> + 8001f8ae: 65c6 ld a1,80(sp) + 8001f8b0: 7506 ld a0,96(sp) + 8001f8b2: 00000097 auipc ra,0x0 + 8001f8b6: f14080e7 jalr -236(ra) # 8001f7c6 <_ZN4core5alloc6layout6Layout18padding_needed_for17h6f762d98d6b3cc59E> + 8001f8ba: e4aa sd a0,72(sp) + 8001f8bc: a009 j 8001f8be <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x3c> + 8001f8be: 65e6 ld a1,88(sp) + 8001f8c0: 7546 ld a0,112(sp) + 8001f8c2: 6626 ld a2,72(sp) + 8001f8c4: 9532 add a0,a0,a2 + 8001f8c6: f82a sd a0,48(sp) + 8001f8c8: e1aa sd a0,192(sp) + let alloc_size = padded_size.checked_mul(n).ok_or(LayoutError { private: () })?; + 8001f8ca: fffff097 auipc ra,0xfffff + 8001f8ce: 5fa080e7 jalr 1530(ra) # 8001eec4 <_ZN4core3num23_$LT$impl$u20$usize$GT$11checked_mul17h38933f87a0e6dbeaE> + 8001f8d2: fc2a sd a0,56(sp) + 8001f8d4: e0ae sd a1,64(sp) + 8001f8d6: a009 j 8001f8d8 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x56> + 8001f8d8: 6586 ld a1,64(sp) + 8001f8da: 7562 ld a0,56(sp) + 8001f8dc: ffff0097 auipc ra,0xffff0 + 8001f8e0: 872080e7 jalr -1934(ra) # 8000f14e <_ZN4core6option15Option$LT$T$GT$5ok_or17h630e1a004ee31f6cE> + 8001f8e4: f02a sd a0,32(sp) + 8001f8e6: f42e sd a1,40(sp) + 8001f8e8: a009 j 8001f8ea <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x68> + 8001f8ea: 75a2 ld a1,40(sp) + 8001f8ec: 7502 ld a0,32(sp) + 8001f8ee: fffee097 auipc ra,0xfffee + 8001f8f2: 266080e7 jalr 614(ra) # 8000db54 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$11into_result17hd9845beb6e8da5c7E> + 8001f8f6: fcaa sd a0,120(sp) + 8001f8f8: e12e sd a1,128(sp) + 8001f8fa: a009 j 8001f8fc <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x7a> + 8001f8fc: 7566 ld a0,120(sp) + 8001f8fe: 4581 li a1,0 + 8001f900: 00b50463 beq a0,a1,8001f908 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x86> + 8001f904: a009 j 8001f906 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x84> + 8001f906: a829 j 8001f920 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0x9e> + 8001f908: 7506 ld a0,96(sp) + 8001f90a: 658a ld a1,128(sp) + 8001f90c: e82e sd a1,16(sp) + 8001f90e: e5ae sd a1,200(sp) + 8001f910: e9ae sd a1,208(sp) + unsafe { Ok((Layout::from_size_align_unchecked(alloc_size, self.align()), padded_size)) } + 8001f912: 00000097 auipc ra,0x0 + 8001f916: f54080e7 jalr -172(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8001f91a: ec2a sd a0,24(sp) + 8001f91c: a831 j 8001f938 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0xb6> + let alloc_size = padded_size.checked_mul(n).ok_or(LayoutError { private: () })?; + 8001f91e: 0000 unimp + 8001f920: fffe9097 auipc ra,0xfffe9 + 8001f924: 5be080e7 jalr 1470(ra) # 80008ede <_ZN50_$LT$T$u20$as$u20$core..convert..From$LT$T$GT$$GT$4from17h2a9aee2c044310b7E> + 8001f928: a009 j 8001f92a <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0xa8> + 8001f92a: 7526 ld a0,104(sp) + 8001f92c: fffee097 auipc ra,0xfffee + 8001f930: 0fa080e7 jalr 250(ra) # 8000da26 <_ZN73_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try..Try$GT$10from_error17h826a3a4a12863e91E> + 8001f934: a009 j 8001f936 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0xb4> + } + 8001f936: a02d j 8001f960 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0xde> + unsafe { Ok((Layout::from_size_align_unchecked(alloc_size, self.align()), padded_size)) } + 8001f938: 65e2 ld a1,24(sp) + 8001f93a: 6542 ld a0,16(sp) + 8001f93c: 00000097 auipc ra,0x0 + 8001f940: ef6080e7 jalr -266(ra) # 8001f832 <_ZN4core5alloc6layout6Layout25from_size_align_unchecked17h7d187b5349095d20E> + 8001f944: e02a sd a0,0(sp) + 8001f946: e42e sd a1,8(sp) + 8001f948: a009 j 8001f94a <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0xc8> + 8001f94a: 6502 ld a0,0(sp) + 8001f94c: 75a6 ld a1,104(sp) + 8001f94e: 6622 ld a2,8(sp) + 8001f950: 76c2 ld a3,48(sp) + 8001f952: e92a sd a0,144(sp) + 8001f954: ed32 sd a2,152(sp) + 8001f956: f136 sd a3,160(sp) + 8001f958: e994 sd a3,16(a1) + 8001f95a: e590 sd a2,8(a1) + 8001f95c: e188 sd a0,0(a1) + } + 8001f95e: a009 j 8001f960 <_ZN4core5alloc6layout6Layout6repeat17he5367bbab955aefbE+0xde> + 8001f960: 60ee ld ra,216(sp) + 8001f962: 612d addi sp,sp,224 + 8001f964: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout8dangling17h635528e7b5a013bbE: + +000000008001f966 <_ZN4core5alloc6layout6Layout8dangling17h635528e7b5a013bbE>: + pub const fn dangling(&self) -> NonNull { + 8001f966: 1101 addi sp,sp,-32 + 8001f968: ec06 sd ra,24(sp) + 8001f96a: e82a sd a0,16(sp) + unsafe { NonNull::new_unchecked(self.align() as *mut u8) } + 8001f96c: 00000097 auipc ra,0x0 + 8001f970: efa080e7 jalr -262(ra) # 8001f866 <_ZN4core5alloc6layout6Layout5align17h05712eb17caed6beE> + 8001f974: e42a sd a0,8(sp) + 8001f976: a009 j 8001f978 <_ZN4core5alloc6layout6Layout8dangling17h635528e7b5a013bbE+0x12> + 8001f978: 6522 ld a0,8(sp) + 8001f97a: ffff0097 auipc ra,0xffff0 + 8001f97e: 2b6080e7 jalr 694(ra) # 8000fc30 <_ZN4core3ptr8non_null16NonNull$LT$T$GT$13new_unchecked17h5ed8fa4a56812246E> + 8001f982: e02a sd a0,0(sp) + 8001f984: a009 j 8001f986 <_ZN4core5alloc6layout6Layout8dangling17h635528e7b5a013bbE+0x20> + } + 8001f986: 6502 ld a0,0(sp) + 8001f988: 60e2 ld ra,24(sp) + 8001f98a: 6105 addi sp,sp,32 + 8001f98c: 8082 ret + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4Disk4init17h491380cac5f59b4bE: + +000000008001f98e <_ZN6kernel6driver11virtio_disk4Disk4init17h491380cac5f59b4bE>: + pub unsafe fn init(&mut self) { + 8001f98e: dc010113 addi sp,sp,-576 + 8001f992: 22113c23 sd ra,568(sp) + 8001f996: e52a sd a0,136(sp) + 8001f998: f7aa sd a0,488(sp) + 8001f99a: 6585 lui a1,0x1 + 8001f99c: 35fd addiw a1,a1,-1 + debug_assert_eq!((&self.desc as *const _ as usize) % PGSIZE, 0); + 8001f99e: 8d6d and a0,a0,a1 + 8001f9a0: f92a sd a0,176(sp) + 8001f9a2: 1910 addi a2,sp,176 + 8001f9a4: e932 sd a2,144(sp) + 8001f9a6: f132 sd a2,160(sp) + +000000008001f9a8 <.LBB0_47>: + 8001f9a8: 00008597 auipc a1,0x8 + 8001f9ac: eb058593 addi a1,a1,-336 # 80027858 <.L__unnamed_6+0xc8> + 8001f9b0: ed2e sd a1,152(sp) + 8001f9b2: f52e sd a1,168(sp) + 8001f9b4: fbb2 sd a2,496(sp) + 8001f9b6: ffae sd a1,504(sp) + 8001f9b8: 4581 li a1,0 + 8001f9ba: 02b50363 beq a0,a1,8001f9e0 <.LBB0_48+0x14> + 8001f9be: a009 j 8001f9c0 <.LBB0_47+0x18> + 8001f9c0: 666a ld a2,152(sp) + 8001f9c2: 65ca ld a1,144(sp) + 8001f9c4: 4501 li a0,0 + 8001f9c6: 0aa10fa3 sb a0,191(sp) + 8001f9ca: e1aa sd a0,192(sp) + +000000008001f9cc <.LBB0_48>: + 8001f9cc: 0000d717 auipc a4,0xd + 8001f9d0: 3dc70713 addi a4,a4,988 # 8002cda8 <.L__unnamed_2> + 8001f9d4: 0194 addi a3,sp,192 + 8001f9d6: 00001097 auipc ra,0x1 + 8001f9da: e9c080e7 jalr -356(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 8001f9de: 0000 unimp + 8001f9e0: 652a ld a0,136(sp) + 8001f9e2: 6585 lui a1,0x1 + debug_assert_eq!((&self.used as *const _ as usize) % PGSIZE, 0); + 8001f9e4: 952e add a0,a0,a1 + 8001f9e6: 35fd addiw a1,a1,-1 + 8001f9e8: 8d6d and a0,a0,a1 + 8001f9ea: e22a sd a0,256(sp) + 8001f9ec: 0210 addi a2,sp,256 + 8001f9ee: fcb2 sd a2,120(sp) + 8001f9f0: f9b2 sd a2,240(sp) + +000000008001f9f2 <.LBB0_49>: + 8001f9f2: 00008597 auipc a1,0x8 + 8001f9f6: e6658593 addi a1,a1,-410 # 80027858 <.L__unnamed_6+0xc8> + 8001f9fa: e12e sd a1,128(sp) + 8001f9fc: fdae sd a1,248(sp) + 8001f9fe: 20c13023 sd a2,512(sp) + 8001fa02: 20b13423 sd a1,520(sp) + 8001fa06: 4581 li a1,0 + 8001fa08: 02b50363 beq a0,a1,8001fa2e <.LBB0_50+0x14> + 8001fa0c: a009 j 8001fa0e <.LBB0_49+0x1c> + 8001fa0e: 660a ld a2,128(sp) + 8001fa10: 75e6 ld a1,120(sp) + 8001fa12: 4501 li a0,0 + 8001fa14: 10a107a3 sb a0,271(sp) + 8001fa18: ea2a sd a0,272(sp) + +000000008001fa1a <.LBB0_50>: + 8001fa1a: 0000d717 auipc a4,0xd + 8001fa1e: 3a670713 addi a4,a4,934 # 8002cdc0 <.L__unnamed_3> + 8001fa22: 0a14 addi a3,sp,272 + 8001fa24: 00001097 auipc ra,0x1 + 8001fa28: e4e080e7 jalr -434(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 8001fa2c: 0000 unimp + 8001fa2e: 652a ld a0,136(sp) + 8001fa30: 6589 lui a1,0x2 + debug_assert_eq!((&self.free as *const _ as usize) % PGSIZE, 0); + 8001fa32: 952e add a0,a0,a1 + 8001fa34: 6585 lui a1,0x1 + 8001fa36: 35fd addiw a1,a1,-1 + 8001fa38: 8d6d and a0,a0,a1 + 8001fa3a: eaaa sd a0,336(sp) + 8001fa3c: 0a90 addi a2,sp,336 + 8001fa3e: f4b2 sd a2,104(sp) + 8001fa40: e2b2 sd a2,320(sp) + +000000008001fa42 <.LBB0_51>: + 8001fa42: 00008597 auipc a1,0x8 + 8001fa46: e1658593 addi a1,a1,-490 # 80027858 <.L__unnamed_6+0xc8> + 8001fa4a: f8ae sd a1,112(sp) + 8001fa4c: e6ae sd a1,328(sp) + 8001fa4e: 20c13823 sd a2,528(sp) + 8001fa52: 20b13c23 sd a1,536(sp) + 8001fa56: 4581 li a1,0 + 8001fa58: 02b50363 beq a0,a1,8001fa7e <.LBB0_52+0x14> + 8001fa5c: a009 j 8001fa5e <.LBB0_51+0x1c> + 8001fa5e: 7646 ld a2,112(sp) + 8001fa60: 75a6 ld a1,104(sp) + 8001fa62: 4501 li a0,0 + 8001fa64: 14a10fa3 sb a0,351(sp) + 8001fa68: f2aa sd a0,352(sp) + +000000008001fa6a <.LBB0_52>: + 8001fa6a: 0000d717 auipc a4,0xd + 8001fa6e: 36e70713 addi a4,a4,878 # 8002cdd8 <.L__unnamed_4> + 8001fa72: 1294 addi a3,sp,352 + 8001fa74: 00001097 auipc ra,0x1 + 8001fa78: dfe080e7 jalr -514(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 8001fa7c: 0000 unimp + 8001fa7e: 4501 li a0,0 + if read(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 + 8001fa80: 00001097 auipc ra,0x1 + 8001fa84: 924080e7 jalr -1756(ra) # 800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E> + 8001fa88: f0aa sd a0,96(sp) + 8001fa8a: a8ad j 8001fb04 <.LBB0_52+0x9a> + 8001fa8c: 4505 li a0,1 + 8001fa8e: 18a10aa3 sb a0,405(sp) + 8001fa92: a821 j 8001faaa <.LBB0_52+0x40> + 8001fa94: 4501 li a0,0 + 8001fa96: 18a10aa3 sb a0,405(sp) + 8001fa9a: a801 j 8001faaa <.LBB0_52+0x40> + 8001fa9c: 4531 li a0,12 + || read(VIRTIO_MMIO_VENDOR_ID) != 0x554d4551 + 8001fa9e: 00001097 auipc ra,0x1 + 8001faa2: 906080e7 jalr -1786(ra) # 800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E> + 8001faa6: ecaa sd a0,88(sp) + 8001faa8: a059 j 8001fb2e <.LBB0_52+0xc4> + if read(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 + 8001faaa: 19514503 lbu a0,405(sp) + 8001faae: 8905 andi a0,a0,1 + 8001fab0: e941 bnez a0,8001fb40 <.LBB0_53> + 8001fab2: a06d j 8001fb5c <.LBB0_54+0x14> + 8001fab4: 4505 li a0,1 + 8001fab6: 18a10b23 sb a0,406(sp) + 8001faba: a821 j 8001fad2 <.LBB0_52+0x68> + 8001fabc: 4501 li a0,0 + 8001fabe: 18a10b23 sb a0,406(sp) + 8001fac2: a801 j 8001fad2 <.LBB0_52+0x68> + 8001fac4: 4521 li a0,8 + || read(VIRTIO_MMIO_DEVICE_ID) != 2 + 8001fac6: 00001097 auipc ra,0x1 + 8001faca: 8de080e7 jalr -1826(ra) # 800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E> + 8001face: e8aa sd a0,80(sp) + 8001fad0: a889 j 8001fb22 <.LBB0_52+0xb8> + if read(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 + 8001fad2: 19614503 lbu a0,406(sp) + 8001fad6: 8905 andi a0,a0,1 + 8001fad8: f955 bnez a0,8001fa8c <.LBB0_52+0x22> + 8001fada: b7c9 j 8001fa9c <.LBB0_52+0x32> + 8001fadc: 4505 li a0,1 + 8001fade: 18a10ba3 sb a0,407(sp) + 8001fae2: a821 j 8001fafa <.LBB0_52+0x90> + 8001fae4: 4501 li a0,0 + 8001fae6: 18a10ba3 sb a0,407(sp) + 8001faea: a801 j 8001fafa <.LBB0_52+0x90> + 8001faec: 4511 li a0,4 + || read(VIRTIO_MMIO_VERSION) != 1 + 8001faee: 00001097 auipc ra,0x1 + 8001faf2: 8b6080e7 jalr -1866(ra) # 800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E> + 8001faf6: e4aa sd a0,72(sp) + 8001faf8: a839 j 8001fb16 <.LBB0_52+0xac> + if read(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 + 8001fafa: 19714503 lbu a0,407(sp) + 8001fafe: 8905 andi a0,a0,1 + 8001fb00: f955 bnez a0,8001fab4 <.LBB0_52+0x4a> + 8001fb02: b7c9 j 8001fac4 <.LBB0_52+0x5a> + 8001fb04: 7506 ld a0,96(sp) + 8001fb06: 2501 sext.w a0,a0 + 8001fb08: 747275b7 lui a1,0x74727 + 8001fb0c: 9765859b addiw a1,a1,-1674 + 8001fb10: fcb50ee3 beq a0,a1,8001faec <.LBB0_52+0x82> + 8001fb14: b7e1 j 8001fadc <.LBB0_52+0x72> + 8001fb16: 6526 ld a0,72(sp) + 8001fb18: 2501 sext.w a0,a0 + 8001fb1a: 4585 li a1,1 + 8001fb1c: fcb504e3 beq a0,a1,8001fae4 <.LBB0_52+0x7a> + 8001fb20: bf75 j 8001fadc <.LBB0_52+0x72> + 8001fb22: 6546 ld a0,80(sp) + 8001fb24: 2501 sext.w a0,a0 + 8001fb26: 4589 li a1,2 + 8001fb28: f8b50ae3 beq a0,a1,8001fabc <.LBB0_52+0x52> + 8001fb2c: b761 j 8001fab4 <.LBB0_52+0x4a> + 8001fb2e: 6566 ld a0,88(sp) + 8001fb30: 2501 sext.w a0,a0 + 8001fb32: 554d45b7 lui a1,0x554d4 + 8001fb36: 5515859b addiw a1,a1,1361 + 8001fb3a: f4b50de3 beq a0,a1,8001fa94 <.LBB0_52+0x2a> + 8001fb3e: b7b9 j 8001fa8c <.LBB0_52+0x22> + +000000008001fb40 <.LBB0_53>: + panic!("could not find virtio disk"); + 8001fb40: 0000d517 auipc a0,0xd + 8001fb44: 2b050513 addi a0,a0,688 # 8002cdf0 <.L__unnamed_5> + +000000008001fb48 <.LBB0_54>: + 8001fb48: 0000d617 auipc a2,0xd + 8001fb4c: 2c860613 addi a2,a2,712 # 8002ce10 <.L__unnamed_6> + 8001fb50: 45e9 li a1,26 + 8001fb52: 00003097 auipc ra,0x3 + 8001fb56: 5f2080e7 jalr 1522(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001fb5a: 0000 unimp + 8001fb5c: 4585 li a1,1 + status |= VIRTIO_CONFIG_S_ACKNOWLEDGE; + 8001fb5e: 18b12c23 sw a1,408(sp) + 8001fb62: 07000513 li a0,112 + write(VIRTIO_MMIO_STATUS, status); + 8001fb66: 00001097 auipc ra,0x1 + 8001fb6a: 898080e7 jalr -1896(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fb6e: a009 j 8001fb70 <.LBB0_54+0x28> + status |= VIRTIO_CONFIG_S_DRIVER; + 8001fb70: 19812503 lw a0,408(sp) + 8001fb74: 00256593 ori a1,a0,2 + 8001fb78: 18b12c23 sw a1,408(sp) + 8001fb7c: 07000513 li a0,112 + write(VIRTIO_MMIO_STATUS, status); + 8001fb80: 00001097 auipc ra,0x1 + 8001fb84: 87e080e7 jalr -1922(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fb88: a009 j 8001fb8a <.LBB0_54+0x42> + 8001fb8a: 4541 li a0,16 + let mut features: u32 = read(VIRTIO_MMIO_DEVICE_FEATURES); + 8001fb8c: 00001097 auipc ra,0x1 + 8001fb90: 818080e7 jalr -2024(ra) # 800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E> + 8001fb94: 18a12e23 sw a0,412(sp) + 8001fb98: a009 j 8001fb9a <.LBB0_54+0x52> + features &= !(1u32 << VIRTIO_BLK_F_RO); + 8001fb9a: 19c12503 lw a0,412(sp) + 8001fb9e: c7ffe5b7 lui a1,0xc7ffe + 8001fba2: 75f5859b addiw a1,a1,1887 + features &= !(1u32 << VIRTIO_RING_F_INDIRECT_DESC); + 8001fba6: 8de9 and a1,a1,a0 + 8001fba8: 18b12e23 sw a1,412(sp) + 8001fbac: 02000513 li a0,32 + write(VIRTIO_MMIO_DRIVER_FEATURES, features); + 8001fbb0: 00001097 auipc ra,0x1 + 8001fbb4: 84e080e7 jalr -1970(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fbb8: a009 j 8001fbba <.LBB0_54+0x72> + status |= VIRTIO_CONFIG_S_FEATURES_OK; + 8001fbba: 19812503 lw a0,408(sp) + 8001fbbe: 00856593 ori a1,a0,8 + 8001fbc2: 18b12c23 sw a1,408(sp) + 8001fbc6: 07000513 li a0,112 + write(VIRTIO_MMIO_STATUS, status); + 8001fbca: 00001097 auipc ra,0x1 + 8001fbce: 834080e7 jalr -1996(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fbd2: a009 j 8001fbd4 <.LBB0_54+0x8c> + status |= VIRTIO_CONFIG_S_DRIVER_OK; + 8001fbd4: 19812503 lw a0,408(sp) + 8001fbd8: 00456593 ori a1,a0,4 + 8001fbdc: 18b12c23 sw a1,408(sp) + 8001fbe0: 07000513 li a0,112 + write(VIRTIO_MMIO_STATUS, status); + 8001fbe4: 00001097 auipc ra,0x1 + 8001fbe8: 81a080e7 jalr -2022(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fbec: a009 j 8001fbee <.LBB0_54+0xa6> + 8001fbee: 02800513 li a0,40 + 8001fbf2: 6585 lui a1,0x1 + write(VIRTIO_MMIO_GUEST_PAGE_SIZE, PGSIZE as u32); + 8001fbf4: 00001097 auipc ra,0x1 + 8001fbf8: 80a080e7 jalr -2038(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fbfc: a009 j 8001fbfe <.LBB0_54+0xb6> + 8001fbfe: 03000513 li a0,48 + 8001fc02: 4581 li a1,0 + write(VIRTIO_MMIO_QUEUE_SEL, 0); + 8001fc04: 00000097 auipc ra,0x0 + 8001fc08: 7fa080e7 jalr 2042(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fc0c: a009 j 8001fc0e <.LBB0_54+0xc6> + 8001fc0e: 03400513 li a0,52 + let max = read(VIRTIO_MMIO_QUEUE_NUM_MAX); + 8001fc12: 00000097 auipc ra,0x0 + 8001fc16: 792080e7 jalr 1938(ra) # 800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E> + 8001fc1a: 85aa mv a1,a0 + 8001fc1c: e0ae sd a1,64(sp) + 8001fc1e: 22a12223 sw a0,548(sp) + 8001fc22: a009 j 8001fc24 <.LBB0_54+0xdc> + if max == 0 { + 8001fc24: 6506 ld a0,64(sp) + 8001fc26: 2501 sext.w a0,a0 + 8001fc28: 4581 li a1,0 + 8001fc2a: 02b51163 bne a0,a1,8001fc4c <.LBB0_56+0x14> + 8001fc2e: a009 j 8001fc30 <.LBB0_55> + +000000008001fc30 <.LBB0_55>: + panic!("virtio disk has no queue 0"); + 8001fc30: 0000d517 auipc a0,0xd + 8001fc34: 26050513 addi a0,a0,608 # 8002ce90 <.L__unnamed_7> + +000000008001fc38 <.LBB0_56>: + 8001fc38: 0000d617 auipc a2,0xd + 8001fc3c: 27860613 addi a2,a2,632 # 8002ceb0 <.L__unnamed_8> + 8001fc40: 45e9 li a1,26 + 8001fc42: 00003097 auipc ra,0x3 + 8001fc46: 502080e7 jalr 1282(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001fc4a: 0000 unimp + if max < NUM as u32 { + 8001fc4c: 6506 ld a0,64(sp) + 8001fc4e: 0005059b sext.w a1,a0 + 8001fc52: 451d li a0,7 + 8001fc54: 02b56563 bltu a0,a1,8001fc7e <.LBB0_58+0x16> + 8001fc58: a009 j 8001fc5a <.LBB0_57> + +000000008001fc5a <.LBB0_57>: + panic!("virtio disk max queue short than NUM={}", NUM); + 8001fc5a: 00008517 auipc a0,0x8 + 8001fc5e: bb650513 addi a0,a0,-1098 # 80027810 <.L__unnamed_6+0x80> + 8001fc62: f3aa sd a0,480(sp) + 8001fc64: 22a13423 sd a0,552(sp) + +000000008001fc68 <.LBB0_58>: + 8001fc68: 00006597 auipc a1,0x6 + 8001fc6c: c3858593 addi a1,a1,-968 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8001fc70: 00001097 auipc ra,0x1 + 8001fc74: 8fe080e7 jalr -1794(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 8001fc78: f82a sd a0,48(sp) + 8001fc7a: fc2e sd a1,56(sp) + 8001fc7c: a809 j 8001fc8e <.LBB0_58+0x26> + 8001fc7e: 03800513 li a0,56 + 8001fc82: 45a1 li a1,8 + write(VIRTIO_MMIO_QUEUE_NUM, NUM as u32); + 8001fc84: 00000097 auipc ra,0x0 + 8001fc88: 77a080e7 jalr 1914(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fc8c: a825 j 8001fcc4 <.LBB0_60+0x14> + panic!("virtio disk max queue short than NUM={}", NUM); + 8001fc8e: 7562 ld a0,56(sp) + 8001fc90: 75c2 ld a1,48(sp) + 8001fc92: ebae sd a1,464(sp) + 8001fc94: efaa sd a0,472(sp) + +000000008001fc96 <.LBB0_59>: + 8001fc96: 0000d597 auipc a1,0xd + 8001fc9a: 1ba58593 addi a1,a1,442 # 8002ce50 <.L__unnamed_10> + 8001fc9e: 1308 addi a0,sp,416 + 8001fca0: 0b94 addi a3,sp,464 + 8001fca2: 4705 li a4,1 + 8001fca4: 863a mv a2,a4 + 8001fca6: fffe6097 auipc ra,0xfffe6 + 8001fcaa: 8e4080e7 jalr -1820(ra) # 8000558a <_ZN4core3fmt9Arguments6new_v117h5e97dda43951bb1cE> + 8001fcae: a009 j 8001fcb0 <.LBB0_60> + +000000008001fcb0 <.LBB0_60>: + 8001fcb0: 0000d597 auipc a1,0xd + 8001fcb4: 1b058593 addi a1,a1,432 # 8002ce60 <.L__unnamed_11> + 8001fcb8: 1308 addi a0,sp,416 + 8001fcba: 00003097 auipc ra,0x3 + 8001fcbe: 4f6080e7 jalr 1270(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 8001fcc2: 0000 unimp + let pfn: usize = (self as *const Disk as usize) >> PGSHIFT; + 8001fcc4: 652a ld a0,136(sp) + 8001fcc6: 8131 srli a0,a0,0xc + 8001fcc8: f42a sd a0,40(sp) + 8001fcca: a009 j 8001fccc <.LBB0_60+0x1c> + 8001fccc: 7522 ld a0,40(sp) + 8001fcce: 22a13823 sd a0,560(sp) + write(VIRTIO_MMIO_QUEUE_PFN, u32::try_from(pfn).unwrap()); + 8001fcd2: fffff097 auipc ra,0xfffff + 8001fcd6: 5de080e7 jalr 1502(ra) # 8001f2b0 <_ZN4core7convert3num18ptr_try_from_impls69_$LT$impl$u20$core..convert..TryFrom$LT$usize$GT$$u20$for$u20$u32$GT$8try_from17hf11680289e05cb5fE> + 8001fcda: ec2a sd a0,24(sp) + 8001fcdc: f02e sd a1,32(sp) + 8001fcde: a009 j 8001fce0 <.LBB0_60+0x30> + 8001fce0: 7582 ld a1,32(sp) + 8001fce2: 6562 ld a0,24(sp) + +000000008001fce4 <.LBB0_61>: + 8001fce4: 0000d617 auipc a2,0xd + 8001fce8: 19460613 addi a2,a2,404 # 8002ce78 <.L__unnamed_12> + 8001fcec: fffee097 auipc ra,0xfffee + 8001fcf0: a0c080e7 jalr -1524(ra) # 8000d6f8 <_ZN4core6result19Result$LT$T$C$E$GT$6unwrap17h07a2a3bbe53a0b92E> + 8001fcf4: e82a sd a0,16(sp) + 8001fcf6: a009 j 8001fcf8 <.LBB0_61+0x14> + 8001fcf8: 65c2 ld a1,16(sp) + 8001fcfa: 04000513 li a0,64 + 8001fcfe: 00000097 auipc ra,0x0 + 8001fd02: 700080e7 jalr 1792(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 8001fd06: a009 j 8001fd08 <.LBB0_61+0x24> + 8001fd08: 652a ld a0,136(sp) + 8001fd0a: 6589 lui a1,0x2 + self.free.iter_mut().for_each(|f| *f = true); + 8001fd0c: 952e add a0,a0,a1 + 8001fd0e: 45a1 li a1,8 + 8001fd10: 00000097 auipc ra,0x0 + 8001fd14: 7f8080e7 jalr 2040(ra) # 80020508 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h847ff5bce17a319bE> + 8001fd18: e02a sd a0,0(sp) + 8001fd1a: e42e sd a1,8(sp) + 8001fd1c: a009 j 8001fd1e <.LBB0_61+0x3a> + 8001fd1e: 65a2 ld a1,8(sp) + 8001fd20: 6502 ld a0,0(sp) + 8001fd22: fffec097 auipc ra,0xfffec + 8001fd26: 0c0080e7 jalr 192(ra) # 8000bde2 <_ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$8for_each17hd302585b5e4cac20E> + 8001fd2a: a009 j 8001fd2c <.LBB0_61+0x48> + } + 8001fd2c: 23813083 ld ra,568(sp) + 8001fd30: 24010113 addi sp,sp,576 + 8001fd34: 8082 ret + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E: + +000000008001fd36 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E>: + fn alloc3_desc(&mut self, idx: &mut [usize; 3]) -> bool { + 8001fd36: 716d addi sp,sp,-272 + 8001fd38: e606 sd ra,264(sp) + 8001fd3a: f82e sd a1,48(sp) + 8001fd3c: 85aa mv a1,a0 + 8001fd3e: 7542 ld a0,48(sp) + 8001fd40: fc2e sd a1,56(sp) + 8001fd42: e1ae sd a1,192(sp) + 8001fd44: e5aa sd a0,200(sp) + 8001fd46: 458d li a1,3 + for i in 0..idx.len() { + 8001fd48: 00000097 auipc ra,0x0 + 8001fd4c: 76e080e7 jalr 1902(ra) # 800204b6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hc17413639ca00bf8E> + 8001fd50: e0aa sd a0,64(sp) + 8001fd52: a009 j 8001fd54 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x1e> + 8001fd54: 6586 ld a1,64(sp) + 8001fd56: 4501 li a0,0 + 8001fd58: e8aa sd a0,80(sp) + 8001fd5a: ecae sd a1,88(sp) + 8001fd5c: 00001097 auipc ra,0x1 + 8001fd60: ab4080e7 jalr -1356(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8001fd64: f02a sd a0,32(sp) + 8001fd66: f42e sd a1,40(sp) + 8001fd68: a009 j 8001fd6a <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x34> + 8001fd6a: 7522 ld a0,40(sp) + 8001fd6c: 7582 ld a1,32(sp) + 8001fd6e: f0ae sd a1,96(sp) + 8001fd70: f4aa sd a0,104(sp) + 8001fd72: a009 j 8001fd74 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x3e> + 8001fd74: 1088 addi a0,sp,96 + 8001fd76: 00001097 auipc ra,0x1 + 8001fd7a: a2c080e7 jalr -1492(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001fd7e: f8aa sd a0,112(sp) + 8001fd80: fcae sd a1,120(sp) + 8001fd82: a009 j 8001fd84 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x4e> + 8001fd84: 7546 ld a0,112(sp) + 8001fd86: 4581 li a1,0 + 8001fd88: 00b50463 beq a0,a1,8001fd90 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x5a> + 8001fd8c: a009 j 8001fd8e <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x58> + 8001fd8e: a031 j 8001fd9a <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x64> + 8001fd90: 4505 li a0,1 + true + 8001fd92: 04a107a3 sb a0,79(sp) + } + 8001fd96: a05d j 8001fe3c <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x106> + for i in 0..idx.len() { + 8001fd98: 0000 unimp + 8001fd9a: 7562 ld a0,56(sp) + 8001fd9c: 75e6 ld a1,120(sp) + 8001fd9e: ec2e sd a1,24(sp) + 8001fda0: e9ae sd a1,208(sp) + 8001fda2: edae sd a1,216(sp) + 8001fda4: f1ae sd a1,224(sp) + match self.alloc_desc() { + 8001fda6: 00000097 auipc ra,0x0 + 8001fdaa: 0b6080e7 jalr 182(ra) # 8001fe5c <_ZN6kernel6driver11virtio_disk4Disk10alloc_desc17h3772a128eda7246cE> + 8001fdae: e12a sd a0,128(sp) + 8001fdb0: e52e sd a1,136(sp) + 8001fdb2: a009 j 8001fdb4 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x7e> + Some(ix) => idx[i] = ix, + 8001fdb4: 650a ld a0,128(sp) + 8001fdb6: 4581 li a1,0 + 8001fdb8: 00b50463 beq a0,a1,8001fdc0 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x8a> + 8001fdbc: a009 j 8001fdbe <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x88> + 8001fdbe: a829 j 8001fdd8 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xa2> + 8001fdc0: 65e2 ld a1,24(sp) + 8001fdc2: 4501 li a0,0 + for j in 0..i { + 8001fdc4: e92a sd a0,144(sp) + 8001fdc6: ed2e sd a1,152(sp) + 8001fdc8: 00001097 auipc ra,0x1 + 8001fdcc: a48080e7 jalr -1464(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8001fdd0: e42a sd a0,8(sp) + 8001fdd2: e82e sd a1,16(sp) + 8001fdd4: a00d j 8001fdf6 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xc0> + match self.alloc_desc() { + 8001fdd6: 0000 unimp + Some(ix) => idx[i] = ix, + 8001fdd8: 65e2 ld a1,24(sp) + 8001fdda: 652a ld a0,136(sp) + 8001fddc: e02a sd a0,0(sp) + 8001fdde: f5aa sd a0,232(sp) + 8001fde0: 4509 li a0,2 + 8001fde2: 06b56263 bltu a0,a1,8001fe46 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x110> + 8001fde6: a009 j 8001fde8 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xb2> + 8001fde8: 6502 ld a0,0(sp) + 8001fdea: 75c2 ld a1,48(sp) + 8001fdec: 6662 ld a2,24(sp) + 8001fdee: 060e slli a2,a2,0x3 + 8001fdf0: 95b2 add a1,a1,a2 + 8001fdf2: e188 sd a0,0(a1) + for i in 0..idx.len() { + 8001fdf4: b741 j 8001fd74 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x3e> + for j in 0..i { + 8001fdf6: 6542 ld a0,16(sp) + 8001fdf8: 65a2 ld a1,8(sp) + 8001fdfa: f12e sd a1,160(sp) + 8001fdfc: f52a sd a0,168(sp) + 8001fdfe: a009 j 8001fe00 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xca> + 8001fe00: 1108 addi a0,sp,160 + 8001fe02: 00001097 auipc ra,0x1 + 8001fe06: 9a0080e7 jalr -1632(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001fe0a: f92a sd a0,176(sp) + 8001fe0c: fd2e sd a1,184(sp) + 8001fe0e: a009 j 8001fe10 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xda> + 8001fe10: 754a ld a0,176(sp) + 8001fe12: 4581 li a1,0 + 8001fe14: 00b50463 beq a0,a1,8001fe1c <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xe6> + 8001fe18: a009 j 8001fe1a <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xe4> + 8001fe1a: a031 j 8001fe26 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xf0> + 8001fe1c: 4501 li a0,0 + return false; + 8001fe1e: 04a107a3 sb a0,79(sp) + } + 8001fe22: a829 j 8001fe3c <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x106> + for j in 0..i { + 8001fe24: 0000 unimp + 8001fe26: 7562 ld a0,56(sp) + 8001fe28: 75ea ld a1,184(sp) + 8001fe2a: f9ae sd a1,240(sp) + 8001fe2c: fdae sd a1,248(sp) + 8001fe2e: e22e sd a1,256(sp) + self.free_desc(j); + 8001fe30: 00000097 auipc ra,0x0 + 8001fe34: 14e080e7 jalr 334(ra) # 8001ff7e <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E> + 8001fe38: a009 j 8001fe3a <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0x104> + for j in 0..i { + 8001fe3a: b7d9 j 8001fe00 <_ZN6kernel6driver11virtio_disk4Disk11alloc3_desc17h72dc3c5e71ae6e49E+0xca> + } + 8001fe3c: 04f14503 lbu a0,79(sp) + 8001fe40: 60b2 ld ra,264(sp) + 8001fe42: 6151 addi sp,sp,272 + 8001fe44: 8082 ret + Some(ix) => idx[i] = ix, + 8001fe46: 6562 ld a0,24(sp) + +000000008001fe48 <.LBB1_25>: + 8001fe48: 0000d617 auipc a2,0xd + 8001fe4c: 08060613 addi a2,a2,128 # 8002cec8 <.L__unnamed_13> + 8001fe50: 458d li a1,3 + 8001fe52: 00003097 auipc ra,0x3 + 8001fe56: 31e080e7 jalr 798(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4Disk10alloc_desc17h3772a128eda7246cE: + +000000008001fe5c <_ZN6kernel6driver11virtio_disk4Disk10alloc_desc17h3772a128eda7246cE>: + fn alloc_desc(&mut self) -> Option { + 8001fe5c: 7111 addi sp,sp,-256 + 8001fe5e: fd86 sd ra,248(sp) + 8001fe60: f82a sd a0,48(sp) + 8001fe62: e5aa sd a0,200(sp) + 8001fe64: 6589 lui a1,0x2 + debug_assert_eq!(self.free.len(), NUM); + 8001fe66: 952e add a0,a0,a1 + 8001fe68: 45a1 li a1,8 + 8001fe6a: 00000097 auipc ra,0x0 + 8001fe6e: 610080e7 jalr 1552(ra) # 8002047a <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h040db97216f8ec10E> + 8001fe72: ecaa sd a0,88(sp) + 8001fe74: a009 j 8001fe76 <_ZN6kernel6driver11virtio_disk4Disk10alloc_desc17h3772a128eda7246cE+0x1a> + 8001fe76: 08ac addi a1,sp,88 + 8001fe78: f02e sd a1,32(sp) + 8001fe7a: e4ae sd a1,72(sp) + +000000008001fe7c <.LBB2_18>: + 8001fe7c: 00008517 auipc a0,0x8 + 8001fe80: 99450513 addi a0,a0,-1644 # 80027810 <.L__unnamed_6+0x80> + 8001fe84: f42a sd a0,40(sp) + 8001fe86: e8aa sd a0,80(sp) + 8001fe88: e9ae sd a1,208(sp) + 8001fe8a: edaa sd a0,216(sp) + 8001fe8c: 6566 ld a0,88(sp) + 8001fe8e: 45a1 li a1,8 + 8001fe90: 02b50363 beq a0,a1,8001feb6 <.LBB2_19+0x14> + 8001fe94: a009 j 8001fe96 <.LBB2_18+0x1a> + 8001fe96: 7622 ld a2,40(sp) + 8001fe98: 7582 ld a1,32(sp) + 8001fe9a: 4501 li a0,0 + 8001fe9c: 06a103a3 sb a0,103(sp) + 8001fea0: f4aa sd a0,104(sp) + +000000008001fea2 <.LBB2_19>: + 8001fea2: 0000d717 auipc a4,0xd + 8001fea6: 03e70713 addi a4,a4,62 # 8002cee0 <.L__unnamed_14> + 8001feaa: 10b4 addi a3,sp,104 + 8001feac: 00001097 auipc ra,0x1 + 8001feb0: 9c6080e7 jalr -1594(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 8001feb4: 0000 unimp + 8001feb6: 4501 li a0,0 + for i in 0..NUM { + 8001feb8: ed2a sd a0,152(sp) + 8001feba: 45a1 li a1,8 + 8001febc: f12e sd a1,160(sp) + 8001febe: 00001097 auipc ra,0x1 + 8001fec2: 952080e7 jalr -1710(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 8001fec6: e82a sd a0,16(sp) + 8001fec8: ec2e sd a1,24(sp) + 8001feca: a009 j 8001fecc <.LBB2_19+0x2a> + 8001fecc: 6562 ld a0,24(sp) + 8001fece: 65c2 ld a1,16(sp) + 8001fed0: f52e sd a1,168(sp) + 8001fed2: f92a sd a0,176(sp) + 8001fed4: a009 j 8001fed6 <.LBB2_19+0x34> + 8001fed6: 1128 addi a0,sp,168 + 8001fed8: 00001097 auipc ra,0x1 + 8001fedc: 8ca080e7 jalr -1846(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8001fee0: fd2a sd a0,184(sp) + 8001fee2: e1ae sd a1,192(sp) + 8001fee4: a009 j 8001fee6 <.LBB2_19+0x44> + 8001fee6: 756a ld a0,184(sp) + 8001fee8: 4581 li a1,0 + 8001feea: 00b50463 beq a0,a1,8001fef2 <.LBB2_19+0x50> + 8001feee: a009 j 8001fef0 <.LBB2_19+0x4e> + 8001fef0: a029 j 8001fefa <.LBB2_19+0x58> + 8001fef2: 4501 li a0,0 + None + 8001fef4: fc2a sd a0,56(sp) + } + 8001fef6: a889 j 8001ff48 <.LBB2_19+0xa6> + for i in 0..NUM { + 8001fef8: 0000 unimp + 8001fefa: 658e ld a1,192(sp) + 8001fefc: e42e sd a1,8(sp) + 8001fefe: f1ae sd a1,224(sp) + 8001ff00: f5ae sd a1,232(sp) + 8001ff02: f9ae sd a1,240(sp) + 8001ff04: 451d li a0,7 + if self.free[i] { + 8001ff06: 04b56663 bltu a0,a1,8001ff52 <.LBB2_19+0xb0> + 8001ff0a: a009 j 8001ff0c <.LBB2_19+0x6a> + 8001ff0c: 7542 ld a0,48(sp) + 8001ff0e: 65a2 ld a1,8(sp) + 8001ff10: 952e add a0,a0,a1 + 8001ff12: 6589 lui a1,0x2 + 8001ff14: 952e add a0,a0,a1 + 8001ff16: 00054503 lbu a0,0(a0) + 8001ff1a: 8905 andi a0,a0,1 + 8001ff1c: 4581 li a1,0 + 8001ff1e: 00b50863 beq a0,a1,8001ff2e <.LBB2_19+0x8c> + 8001ff22: a009 j 8001ff24 <.LBB2_19+0x82> + 8001ff24: 6522 ld a0,8(sp) + 8001ff26: 45a1 li a1,8 + self.free[i] = false; + 8001ff28: 00b56463 bltu a0,a1,8001ff30 <.LBB2_19+0x8e> + 8001ff2c: a835 j 8001ff68 <.LBB2_20+0x14> + for i in 0..NUM { + 8001ff2e: b765 j 8001fed6 <.LBB2_19+0x34> + self.free[i] = false; + 8001ff30: 6522 ld a0,8(sp) + 8001ff32: 75c2 ld a1,48(sp) + 8001ff34: 95aa add a1,a1,a0 + 8001ff36: 6609 lui a2,0x2 + 8001ff38: 962e add a2,a2,a1 + 8001ff3a: 4581 li a1,0 + 8001ff3c: 00b60023 sb a1,0(a2) # 2000 <.Lline_table_start0+0x2a4> + return Some(i) + 8001ff40: e0aa sd a0,64(sp) + 8001ff42: 4505 li a0,1 + 8001ff44: fc2a sd a0,56(sp) + } + 8001ff46: a009 j 8001ff48 <.LBB2_19+0xa6> + 8001ff48: 7562 ld a0,56(sp) + 8001ff4a: 6586 ld a1,64(sp) + 8001ff4c: 70ee ld ra,248(sp) + 8001ff4e: 6111 addi sp,sp,256 + 8001ff50: 8082 ret + if self.free[i] { + 8001ff52: 6522 ld a0,8(sp) + +000000008001ff54 <.LBB2_20>: + 8001ff54: 0000d617 auipc a2,0xd + 8001ff58: fa460613 addi a2,a2,-92 # 8002cef8 <.L__unnamed_15> + 8001ff5c: 45a1 li a1,8 + 8001ff5e: 00003097 auipc ra,0x3 + 8001ff62: 212080e7 jalr 530(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8001ff66: 0000 unimp + self.free[i] = false; + 8001ff68: 6522 ld a0,8(sp) + +000000008001ff6a <.LBB2_21>: + 8001ff6a: 0000d617 auipc a2,0xd + 8001ff6e: fa660613 addi a2,a2,-90 # 8002cf10 <.L__unnamed_16> + 8001ff72: 45a1 li a1,8 + 8001ff74: 00003097 auipc ra,0x3 + 8001ff78: 1fc080e7 jalr 508(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E: + +000000008001ff7e <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E>: + fn free_desc(&mut self, i: usize) { + 8001ff7e: 7179 addi sp,sp,-48 + 8001ff80: f406 sd ra,40(sp) + 8001ff82: e02e sd a1,0(sp) + 8001ff84: e42a sd a0,8(sp) + 8001ff86: ec2a sd a0,24(sp) + 8001ff88: f02e sd a1,32(sp) + 8001ff8a: 4521 li a0,8 + if i >= NUM || self.free[i] { + 8001ff8c: 00a5eb63 bltu a1,a0,8001ffa2 <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E+0x24> + 8001ff90: a009 j 8001ff92 <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E+0x14> + 8001ff92: 4505 li a0,1 + 8001ff94: 00a10ba3 sb a0,23(sp) + 8001ff98: a811 j 8001ffac <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E+0x2e> + 8001ff9a: 4501 li a0,0 + 8001ff9c: 00a10ba3 sb a0,23(sp) + 8001ffa0: a031 j 8001ffac <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E+0x2e> + 8001ffa2: 6502 ld a0,0(sp) + 8001ffa4: 45a1 li a1,8 + 8001ffa6: 00b56863 bltu a0,a1,8001ffb6 <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E+0x38> + 8001ffaa: a0f1 j 80020076 <.LBB3_22+0x18> + 8001ffac: 01714503 lbu a0,23(sp) + 8001ffb0: 8905 andi a0,a0,1 + 8001ffb2: ed01 bnez a0,8001ffca <.LBB3_20> + 8001ffb4: a80d j 8001ffe6 <.LBB3_21+0x14> + 8001ffb6: 6522 ld a0,8(sp) + 8001ffb8: 6582 ld a1,0(sp) + 8001ffba: 952e add a0,a0,a1 + 8001ffbc: 6589 lui a1,0x2 + 8001ffbe: 952e add a0,a0,a1 + 8001ffc0: 00054503 lbu a0,0(a0) + 8001ffc4: 8905 andi a0,a0,1 + 8001ffc6: f571 bnez a0,8001ff92 <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E+0x14> + 8001ffc8: bfc9 j 8001ff9a <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E+0x1c> + +000000008001ffca <.LBB3_20>: + panic!("desc index not correct"); + 8001ffca: 0000d517 auipc a0,0xd + 8001ffce: f7650513 addi a0,a0,-138 # 8002cf40 <.L__unnamed_17> + +000000008001ffd2 <.LBB3_21>: + 8001ffd2: 0000d617 auipc a2,0xd + 8001ffd6: f8660613 addi a2,a2,-122 # 8002cf58 <.L__unnamed_18> + 8001ffda: 45d9 li a1,22 + 8001ffdc: 00003097 auipc ra,0x3 + 8001ffe0: 168080e7 jalr 360(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8001ffe4: 0000 unimp + 8001ffe6: 6582 ld a1,0(sp) + 8001ffe8: 451d li a0,7 + self.desc[i].addr = 0; + 8001ffea: 0ab56163 bltu a0,a1,8002008c <.LBB3_23+0x14> + 8001ffee: a009 j 8001fff0 <.LBB3_21+0x1e> + 8001fff0: 6582 ld a1,0(sp) + 8001fff2: 6522 ld a0,8(sp) + 8001fff4: 00459613 slli a2,a1,0x4 + 8001fff8: 962a add a2,a2,a0 + 8001fffa: 4501 li a0,0 + 8001fffc: e208 sd a0,0(a2) + 8001fffe: 451d li a0,7 + self.desc[i].len = 0; + 80020000: 0ab56163 bltu a0,a1,800200a2 <.LBB3_24+0x14> + 80020004: a009 j 80020006 <.LBB3_21+0x34> + 80020006: 6582 ld a1,0(sp) + 80020008: 6522 ld a0,8(sp) + 8002000a: 00459613 slli a2,a1,0x4 + 8002000e: 962a add a2,a2,a0 + 80020010: 4501 li a0,0 + 80020012: c608 sw a0,8(a2) + 80020014: 451d li a0,7 + self.desc[i].flags = 0; + 80020016: 0ab56163 bltu a0,a1,800200b8 <.LBB3_25+0x14> + 8002001a: a009 j 8002001c <.LBB3_21+0x4a> + 8002001c: 6582 ld a1,0(sp) + 8002001e: 6522 ld a0,8(sp) + 80020020: 00459613 slli a2,a1,0x4 + 80020024: 962a add a2,a2,a0 + 80020026: 4501 li a0,0 + 80020028: 00a61623 sh a0,12(a2) + 8002002c: 451d li a0,7 + self.desc[i].next = 0; + 8002002e: 0ab56063 bltu a0,a1,800200ce <.LBB3_26+0x14> + 80020032: a009 j 80020034 <.LBB3_21+0x62> + 80020034: 6582 ld a1,0(sp) + 80020036: 6522 ld a0,8(sp) + 80020038: 00459613 slli a2,a1,0x4 + 8002003c: 962a add a2,a2,a0 + 8002003e: 4501 li a0,0 + 80020040: 00a61723 sh a0,14(a2) + 80020044: 451d li a0,7 + self.free[i] = true; + 80020046: 08b56f63 bltu a0,a1,800200e4 <.LBB3_27+0x14> + 8002004a: a009 j 8002004c <.LBB3_21+0x7a> + 8002004c: 6502 ld a0,0(sp) + 8002004e: 65a2 ld a1,8(sp) + 80020050: 6609 lui a2,0x2 + 80020052: 95b2 add a1,a1,a2 + 80020054: 00a58633 add a2,a1,a0 + 80020058: 4505 li a0,1 + 8002005a: 00a60023 sb a0,0(a2) # 2000 <.Lline_table_start0+0x2a4> + +000000008002005e <.LBB3_22>: + PROC_MANAGER.wake_up(&self.free[0] as *const bool as usize); + 8002005e: 00039517 auipc a0,0x39 + 80020062: 37250513 addi a0,a0,882 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 80020066: fffee097 auipc ra,0xfffee + 8002006a: 19a080e7 jalr 410(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 8002006e: a009 j 80020070 <.LBB3_22+0x12> + } + 80020070: 70a2 ld ra,40(sp) + 80020072: 6145 addi sp,sp,48 + 80020074: 8082 ret + if i >= NUM || self.free[i] { + 80020076: 6502 ld a0,0(sp) + +0000000080020078 <.LBB3_23>: + 80020078: 0000d617 auipc a2,0xd + 8002007c: eb060613 addi a2,a2,-336 # 8002cf28 <.L__unnamed_19> + 80020080: 45a1 li a1,8 + 80020082: 00003097 auipc ra,0x3 + 80020086: 0ee080e7 jalr 238(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8002008a: 0000 unimp + self.desc[i].addr = 0; + 8002008c: 6502 ld a0,0(sp) + +000000008002008e <.LBB3_24>: + 8002008e: 0000d617 auipc a2,0xd + 80020092: ee260613 addi a2,a2,-286 # 8002cf70 <.L__unnamed_20> + 80020096: 45a1 li a1,8 + 80020098: 00003097 auipc ra,0x3 + 8002009c: 0d8080e7 jalr 216(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 800200a0: 0000 unimp + self.desc[i].len = 0; + 800200a2: 6502 ld a0,0(sp) + +00000000800200a4 <.LBB3_25>: + 800200a4: 0000d617 auipc a2,0xd + 800200a8: ee460613 addi a2,a2,-284 # 8002cf88 <.L__unnamed_21> + 800200ac: 45a1 li a1,8 + 800200ae: 00003097 auipc ra,0x3 + 800200b2: 0c2080e7 jalr 194(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 800200b6: 0000 unimp + self.desc[i].flags = 0; + 800200b8: 6502 ld a0,0(sp) + +00000000800200ba <.LBB3_26>: + 800200ba: 0000d617 auipc a2,0xd + 800200be: ee660613 addi a2,a2,-282 # 8002cfa0 <.L__unnamed_22> + 800200c2: 45a1 li a1,8 + 800200c4: 00003097 auipc ra,0x3 + 800200c8: 0ac080e7 jalr 172(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 800200cc: 0000 unimp + self.desc[i].next = 0; + 800200ce: 6502 ld a0,0(sp) + +00000000800200d0 <.LBB3_27>: + 800200d0: 0000d617 auipc a2,0xd + 800200d4: ee860613 addi a2,a2,-280 # 8002cfb8 <.L__unnamed_23> + 800200d8: 45a1 li a1,8 + 800200da: 00003097 auipc ra,0x3 + 800200de: 096080e7 jalr 150(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 800200e2: 0000 unimp + self.free[i] = true; + 800200e4: 6502 ld a0,0(sp) + +00000000800200e6 <.LBB3_28>: + 800200e6: 0000d617 auipc a2,0xd + 800200ea: eea60613 addi a2,a2,-278 # 8002cfd0 <.L__unnamed_24> + 800200ee: 45a1 li a1,8 + 800200f0: 00003097 auipc ra,0x3 + 800200f4: 080080e7 jalr 128(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E: + +00000000800200fa <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E>: + fn free_chain(&mut self, mut i: usize) { + 800200fa: 715d addi sp,sp,-80 + 800200fc: e486 sd ra,72(sp) + 800200fe: f42a sd a0,40(sp) + 80020100: f82e sd a1,48(sp) + 80020102: fc2a sd a0,56(sp) + 80020104: a009 j 80020106 <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0xc> + let flag = self.desc[i].flags; + 80020106: 75c2 ld a1,48(sp) + 80020108: f02e sd a1,32(sp) + 8002010a: 451d li a0,7 + 8002010c: 04b56d63 bltu a0,a1,80020166 <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0x6c> + 80020110: a009 j 80020112 <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0x18> + 80020112: 7522 ld a0,40(sp) + 80020114: 7582 ld a1,32(sp) + 80020116: 0592 slli a1,a1,0x4 + 80020118: 952e add a0,a0,a1 + 8002011a: 00c55503 lhu a0,12(a0) + 8002011e: e82a sd a0,16(sp) + 80020120: 04a11223 sh a0,68(sp) + let next = self.desc[i].next; + 80020124: 75c2 ld a1,48(sp) + 80020126: ec2e sd a1,24(sp) + 80020128: 451d li a0,7 + 8002012a: 04b56963 bltu a0,a1,8002017c <.LBB4_9+0x14> + 8002012e: a009 j 80020130 <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0x36> + 80020130: 7522 ld a0,40(sp) + 80020132: 65e2 ld a1,24(sp) + 80020134: 0592 slli a1,a1,0x4 + 80020136: 95aa add a1,a1,a0 + 80020138: 00e5d583 lhu a1,14(a1) # 200e <.Lline_table_start0+0x2b2> + 8002013c: e42e sd a1,8(sp) + 8002013e: 04b11323 sh a1,70(sp) + self.free_desc(i); + 80020142: 75c2 ld a1,48(sp) + 80020144: 00000097 auipc ra,0x0 + 80020148: e3a080e7 jalr -454(ra) # 8001ff7e <_ZN6kernel6driver11virtio_disk4Disk9free_desc17h82d1b4d3b146e1f5E> + 8002014c: a009 j 8002014e <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0x54> + if (flag & VRING_DESC_F_NEXT) != 0 { + 8002014e: 6542 ld a0,16(sp) + 80020150: 8905 andi a0,a0,1 + 80020152: 4581 li a1,0 + 80020154: 00b50663 beq a0,a1,80020160 <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0x66> + 80020158: a009 j 8002015a <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0x60> + i = next as usize; + 8002015a: 6522 ld a0,8(sp) + 8002015c: f82a sd a0,48(sp) + loop { + 8002015e: b765 j 80020106 <_ZN6kernel6driver11virtio_disk4Disk10free_chain17h88621e1c7ba36f26E+0xc> + } + 80020160: 60a6 ld ra,72(sp) + 80020162: 6161 addi sp,sp,80 + 80020164: 8082 ret + let flag = self.desc[i].flags; + 80020166: 7502 ld a0,32(sp) + +0000000080020168 <.LBB4_9>: + 80020168: 0000d617 auipc a2,0xd + 8002016c: e8060613 addi a2,a2,-384 # 8002cfe8 <.L__unnamed_25> + 80020170: 45a1 li a1,8 + 80020172: 00003097 auipc ra,0x3 + 80020176: ffe080e7 jalr -2(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8002017a: 0000 unimp + let next = self.desc[i].next; + 8002017c: 6562 ld a0,24(sp) + +000000008002017e <.LBB4_10>: + 8002017e: 0000d617 auipc a2,0xd + 80020182: e8260613 addi a2,a2,-382 # 8002d000 <.L__unnamed_26> + 80020186: 45a1 li a1,8 + 80020188: 00003097 auipc ra,0x3 + 8002018c: fe8080e7 jalr -24(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E: + +0000000080020192 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E>: + pub fn intr(&mut self) { + 80020192: 7159 addi sp,sp,-112 + 80020194: f486 sd ra,104(sp) + 80020196: f82a sd a0,48(sp) + 80020198: e4aa sd a0,72(sp) + 8002019a: 06000513 li a0,96 + let intr_stat = read(VIRTIO_MMIO_INTERRUPT_STATUS); + 8002019e: 00000097 auipc ra,0x0 + 800201a2: 206080e7 jalr 518(ra) # 800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E> + 800201a6: 85aa mv a1,a0 + 800201a8: fc2e sd a1,56(sp) + 800201aa: caaa sw a0,84(sp) + 800201ac: a009 j 800201ae <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x1c> + write(VIRTIO_MMIO_INTERRUPT_ACK, intr_stat & 0x3); + 800201ae: 7562 ld a0,56(sp) + 800201b0: 00357593 andi a1,a0,3 + 800201b4: 06400513 li a0,100 + 800201b8: 00000097 auipc ra,0x0 + 800201bc: 246080e7 jalr 582(ra) # 800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE> + 800201c0: a009 j 800201c2 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x30> + 800201c2: 4511 li a0,4 + fence(Ordering::SeqCst); + 800201c4: 04a10323 sb a0,70(sp) + 800201c8: fffe4097 auipc ra,0xfffe4 + 800201cc: 680080e7 jalr 1664(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 800201d0: a009 j 800201d2 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x40> + 800201d2: 75c2 ld a1,48(sp) + 800201d4: 6509 lui a0,0x2 + 800201d6: 2521 addiw a0,a0,8 + while self.used_idx != self.used.idx { + 800201d8: 952e add a0,a0,a1 + 800201da: 00055503 lhu a0,0(a0) # 2000 <.Lline_table_start0+0x2a4> + 800201de: 6605 lui a2,0x1 + 800201e0: 2609 addiw a2,a2,2 + 800201e2: 95b2 add a1,a1,a2 + 800201e4: 0005d583 lhu a1,0(a1) + 800201e8: 00b51663 bne a0,a1,800201f4 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x62> + 800201ec: a009 j 800201ee <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x5c> + } + 800201ee: 70a6 ld ra,104(sp) + 800201f0: 6165 addi sp,sp,112 + 800201f2: 8082 ret + 800201f4: 4511 li a0,4 + fence(Ordering::SeqCst); + 800201f6: 04a103a3 sb a0,71(sp) + 800201fa: fffe4097 auipc ra,0xfffe4 + 800201fe: 64e080e7 jalr 1614(ra) # 80004848 <_ZN4core4sync6atomic5fence17hd2f91624c9f09ce8E> + 80020202: a009 j 80020204 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x72> + 80020204: 7542 ld a0,48(sp) + 80020206: 6589 lui a1,0x2 + 80020208: 25a1 addiw a1,a1,8 + let id = self.used.ring[self.used_idx as usize % NUM].id as usize; + 8002020a: 952e add a0,a0,a1 + 8002020c: 00055503 lhu a0,0(a0) + 80020210: 00757593 andi a1,a0,7 + 80020214: f42e sd a1,40(sp) + 80020216: 451d li a0,7 + 80020218: 10b56c63 bltu a0,a1,80020330 <.LBB5_26+0x40> + 8002021c: a009 j 8002021e <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x8c> + 8002021e: 7542 ld a0,48(sp) + 80020220: 75a2 ld a1,40(sp) + 80020222: 058e slli a1,a1,0x3 + 80020224: 952e add a0,a0,a1 + 80020226: 6585 lui a1,0x1 + 80020228: 2591 addiw a1,a1,4 + 8002022a: 952e add a0,a0,a1 + 8002022c: 00056583 lwu a1,0(a0) + 80020230: f02e sd a1,32(sp) + 80020232: ecae sd a1,88(sp) + 80020234: 451d li a0,7 + if self.info[id].status != 0 { + 80020236: 10b56863 bltu a0,a1,80020346 <.LBB5_27+0x14> + 8002023a: a009 j 8002023c <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0xaa> + 8002023c: 7542 ld a0,48(sp) + 8002023e: 7582 ld a1,32(sp) + 80020240: 4661 li a2,24 + 80020242: 02c585b3 mul a1,a1,a2 + 80020246: 952e add a0,a0,a1 + 80020248: 6589 lui a1,0x2 + 8002024a: 0205859b addiw a1,a1,32 + 8002024e: 952e add a0,a0,a1 + 80020250: 00054503 lbu a0,0(a0) + 80020254: 4581 li a1,0 + 80020256: 02b50163 beq a0,a1,80020278 <.LBB5_23+0x14> + 8002025a: a009 j 8002025c <.LBB5_22> + +000000008002025c <.LBB5_22>: + panic!("interrupt status"); + 8002025c: 00006517 auipc a0,0x6 + 80020260: 44450513 addi a0,a0,1092 # 800266a0 <.L__unnamed_35+0x68> + +0000000080020264 <.LBB5_23>: + 80020264: 0000d617 auipc a2,0xd + 80020268: de460613 addi a2,a2,-540 # 8002d048 <.L__unnamed_28> + 8002026c: 45c1 li a1,16 + 8002026e: 00003097 auipc ra,0x3 + 80020272: ed6080e7 jalr -298(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80020276: 0000 unimp + 80020278: 7582 ld a1,32(sp) + 8002027a: 451d li a0,7 + let buf_raw_data = self.info[id].buf_channel.clone() + 8002027c: 0eb56063 bltu a0,a1,8002035c <.LBB5_28+0x14> + 80020280: a009 j 80020282 <.LBB5_23+0x1e> + 80020282: 7542 ld a0,48(sp) + 80020284: 7582 ld a1,32(sp) + 80020286: 4661 li a2,24 + 80020288: 02c585b3 mul a1,a1,a2 + 8002028c: 952e add a0,a0,a1 + 8002028e: 6589 lui a1,0x2 + 80020290: 25c1 addiw a1,a1,16 + 80020292: 952e add a0,a0,a1 + 80020294: ffff0097 auipc ra,0xffff0 + 80020298: 884080e7 jalr -1916(ra) # 8000fb18 <_ZN68_$LT$core..option..Option$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17he939c90bc3d2b0caE> + 8002029c: e82a sd a0,16(sp) + 8002029e: ec2e sd a1,24(sp) + 800202a0: a009 j 800202a2 <.LBB5_23+0x3e> + 800202a2: 65e2 ld a1,24(sp) + 800202a4: 6542 ld a0,16(sp) + +00000000800202a6 <.LBB5_24>: + 800202a6: 0000d617 auipc a2,0xd + 800202aa: dd260613 addi a2,a2,-558 # 8002d078 <.L__unnamed_29> + +00000000800202ae <.LBB5_25>: + 800202ae: 0000d717 auipc a4,0xd + 800202b2: e1270713 addi a4,a4,-494 # 8002d0c0 <.L__unnamed_30> + 800202b6: 04300693 li a3,67 + 800202ba: fffef097 auipc ra,0xfffef + 800202be: 176080e7 jalr 374(ra) # 8000f430 <_ZN4core6option15Option$LT$T$GT$6expect17h263816fde9da1c25E> + 800202c2: 85aa mv a1,a0 + 800202c4: e42e sd a1,8(sp) + 800202c6: f0aa sd a0,96(sp) + 800202c8: a009 j 800202ca <.LBB5_25+0x1c> + 800202ca: 7582 ld a1,32(sp) + 800202cc: 451d li a0,7 + self.info[id].disk = false; + 800202ce: 0ab56263 bltu a0,a1,80020372 <.LBB5_29+0x14> + 800202d2: a009 j 800202d4 <.LBB5_25+0x26> + 800202d4: 65a2 ld a1,8(sp) + 800202d6: 7542 ld a0,48(sp) + 800202d8: 7602 ld a2,32(sp) + 800202da: 46e1 li a3,24 + 800202dc: 02d60633 mul a2,a2,a3 + 800202e0: 9532 add a0,a0,a2 + 800202e2: 6609 lui a2,0x2 + 800202e4: 0216061b addiw a2,a2,33 + 800202e8: 962a add a2,a2,a0 + 800202ea: 4501 li a0,0 + 800202ec: 00a60023 sb a0,0(a2) # 2000 <.Lline_table_start0+0x2a4> + +00000000800202f0 <.LBB5_26>: + unsafe { PROC_MANAGER.wake_up(buf_raw_data); } + 800202f0: 00039517 auipc a0,0x39 + 800202f4: 0e050513 addi a0,a0,224 # 800593d0 <_ZN6kernel7process7manager12PROC_MANAGER17hc2dc11bacd50c0bcE> + 800202f8: fffee097 auipc ra,0xfffee + 800202fc: f08080e7 jalr -248(ra) # 8000e200 <_ZN6kernel7process7manager11ProcManager7wake_up17ha46b4d15ac07187bE> + 80020300: a009 j 80020302 <.LBB5_26+0x12> + 80020302: 7542 ld a0,48(sp) + 80020304: 6589 lui a1,0x2 + 80020306: 25a1 addiw a1,a1,8 + self.used_idx += 1; + 80020308: 952e add a0,a0,a1 + 8002030a: 00055503 lhu a0,0(a0) + 8002030e: 00150593 addi a1,a0,1 + 80020312: e02e sd a1,0(sp) + 80020314: 6541 lui a0,0x10 + 80020316: 357d addiw a0,a0,-1 + 80020318: 8d6d and a0,a0,a1 + 8002031a: 06b51763 bne a0,a1,80020388 <.LBB5_31> + 8002031e: a009 j 80020320 <.LBB5_26+0x30> + 80020320: 6502 ld a0,0(sp) + 80020322: 75c2 ld a1,48(sp) + 80020324: 6609 lui a2,0x2 + 80020326: 2621 addiw a2,a2,8 + 80020328: 95b2 add a1,a1,a2 + 8002032a: 00a59023 sh a0,0(a1) # 2000 <.Lline_table_start0+0x2a4> + while self.used_idx != self.used.idx { + 8002032e: b555 j 800201d2 <_ZN6kernel6driver11virtio_disk4Disk4intr17h780fdb71fd330281E+0x40> + let id = self.used.ring[self.used_idx as usize % NUM].id as usize; + 80020330: 7522 ld a0,40(sp) + +0000000080020332 <.LBB5_27>: + 80020332: 0000d617 auipc a2,0xd + 80020336: ce660613 addi a2,a2,-794 # 8002d018 <.L__unnamed_31> + 8002033a: 45a1 li a1,8 + 8002033c: 00003097 auipc ra,0x3 + 80020340: e34080e7 jalr -460(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80020344: 0000 unimp + if self.info[id].status != 0 { + 80020346: 7502 ld a0,32(sp) + +0000000080020348 <.LBB5_28>: + 80020348: 0000d617 auipc a2,0xd + 8002034c: ce860613 addi a2,a2,-792 # 8002d030 <.L__unnamed_32> + 80020350: 45a1 li a1,8 + 80020352: 00003097 auipc ra,0x3 + 80020356: e1e080e7 jalr -482(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 8002035a: 0000 unimp + let buf_raw_data = self.info[id].buf_channel.clone() + 8002035c: 7502 ld a0,32(sp) + +000000008002035e <.LBB5_29>: + 8002035e: 0000d617 auipc a2,0xd + 80020362: d0260613 addi a2,a2,-766 # 8002d060 <.L__unnamed_33> + 80020366: 45a1 li a1,8 + 80020368: 00003097 auipc ra,0x3 + 8002036c: e08080e7 jalr -504(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + 80020370: 0000 unimp + self.info[id].disk = false; + 80020372: 7502 ld a0,32(sp) + +0000000080020374 <.LBB5_30>: + 80020374: 0000d617 auipc a2,0xd + 80020378: d6460613 addi a2,a2,-668 # 8002d0d8 <.L__unnamed_34> + 8002037c: 45a1 li a1,8 + 8002037e: 00003097 auipc ra,0x3 + 80020382: df2080e7 jalr -526(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080020388 <.LBB5_31>: + self.used_idx += 1; + 80020388: 0000d517 auipc a0,0xd + 8002038c: d8850513 addi a0,a0,-632 # 8002d110 + +0000000080020390 <.LBB5_32>: + 80020390: 0000d617 auipc a2,0xd + 80020394: d6060613 addi a2,a2,-672 # 8002d0f0 <.L__unnamed_35> + 80020398: 45f1 li a1,28 + 8002039a: 00003097 auipc ra,0x3 + 8002039e: daa080e7 jalr -598(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E: + +00000000800203a4 <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E>: +// this many virtio descriptors +// must be a power of 2 +const NUM: usize = 8; + +#[inline] +unsafe fn read(offset: usize) -> u32 { + 800203a4: 7139 addi sp,sp,-64 + 800203a6: fc06 sd ra,56(sp) + 800203a8: ec2a sd a0,24(sp) + 800203aa: f42a sd a0,40(sp) + 800203ac: 10001537 lui a0,0x10001 + let src = (Into::::into(VIRTIO0) + offset) as *const u32; + 800203b0: fffec097 auipc ra,0xfffec + 800203b4: fe8080e7 jalr -24(ra) # 8000c398 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E> + 800203b8: f02a sd a0,32(sp) + 800203ba: a009 j 800203bc <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E+0x18> + 800203bc: 7582 ld a1,32(sp) + 800203be: 6562 ld a0,24(sp) + 800203c0: 952e add a0,a0,a1 + 800203c2: e82a sd a0,16(sp) + 800203c4: 00b56f63 bltu a0,a1,800203e2 <.LBB6_5> + 800203c8: a009 j 800203ca <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E+0x26> + 800203ca: 6542 ld a0,16(sp) + 800203cc: f82a sd a0,48(sp) + ptr::read_volatile(src) + 800203ce: ffff9097 auipc ra,0xffff9 + 800203d2: f46080e7 jalr -186(ra) # 80019314 <_ZN4core3ptr13read_volatile17h0ae297fe3f24e4caE> + 800203d6: e42a sd a0,8(sp) + 800203d8: a009 j 800203da <_ZN6kernel6driver11virtio_disk4read17h68d9cc1e57aa6089E+0x36> +} + 800203da: 6522 ld a0,8(sp) + 800203dc: 70e2 ld ra,56(sp) + 800203de: 6121 addi sp,sp,64 + 800203e0: 8082 ret + +00000000800203e2 <.LBB6_5>: + let src = (Into::::into(VIRTIO0) + offset) as *const u32; + 800203e2: 0000d517 auipc a0,0xd + 800203e6: d2e50513 addi a0,a0,-722 # 8002d110 + +00000000800203ea <.LBB6_6>: + 800203ea: 0000d617 auipc a2,0xd + 800203ee: d4660613 addi a2,a2,-698 # 8002d130 <.L__unnamed_36> + 800203f2: 45f1 li a1,28 + 800203f4: 00003097 auipc ra,0x3 + 800203f8: d50080e7 jalr -688(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE: + +00000000800203fe <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE>: + +#[inline] +unsafe fn write(offset: usize, data: u32) { + 800203fe: 7139 addi sp,sp,-64 + 80020400: fc06 sd ra,56(sp) + 80020402: e42a sd a0,8(sp) + 80020404: 862e mv a2,a1 + 80020406: e832 sd a2,16(sp) + 80020408: f02a sd a0,32(sp) + 8002040a: d62e sw a1,44(sp) + 8002040c: 10001537 lui a0,0x10001 + let dst = (Into::::into(VIRTIO0) + offset) as *mut u32; + 80020410: fffec097 auipc ra,0xfffec + 80020414: f88080e7 jalr -120(ra) # 8000c398 <_ZN50_$LT$T$u20$as$u20$core..convert..Into$LT$U$GT$$GT$4into17hbecc82c6a2b59487E> + 80020418: ec2a sd a0,24(sp) + 8002041a: a009 j 8002041c <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE+0x1e> + 8002041c: 65e2 ld a1,24(sp) + 8002041e: 6522 ld a0,8(sp) + 80020420: 952e add a0,a0,a1 + 80020422: e02a sd a0,0(sp) + 80020424: 00b56e63 bltu a0,a1,80020440 <.LBB7_5> + 80020428: a009 j 8002042a <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE+0x2c> + 8002042a: 65c2 ld a1,16(sp) + 8002042c: 6502 ld a0,0(sp) + 8002042e: f82a sd a0,48(sp) + ptr::write_volatile(dst, data); + 80020430: ffff9097 auipc ra,0xffff9 + 80020434: f20080e7 jalr -224(ra) # 80019350 <_ZN4core3ptr14write_volatile17h1c498a4c32cde7d4E> + 80020438: a009 j 8002043a <_ZN6kernel6driver11virtio_disk5write17hf82e2458568dd21bE+0x3c> +} + 8002043a: 70e2 ld ra,56(sp) + 8002043c: 6121 addi sp,sp,64 + 8002043e: 8082 ret + +0000000080020440 <.LBB7_5>: + let dst = (Into::::into(VIRTIO0) + offset) as *mut u32; + 80020440: 0000d517 auipc a0,0xd + 80020444: cd050513 addi a0,a0,-816 # 8002d110 + +0000000080020448 <.LBB7_6>: + 80020448: 0000d617 auipc a2,0xd + 8002044c: d0060613 addi a2,a2,-768 # 8002d148 <.L__unnamed_37> + 80020450: 45f1 li a1,28 + 80020452: 00003097 auipc ra,0x3 + 80020456: cf2080e7 jalr -782(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h69a6648c691317bcE: + +000000008002045c <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h69a6648c691317bcE>: + pub const fn as_mut_ptr(&mut self) -> *mut T { + 8002045c: 1141 addi sp,sp,-16 + 8002045e: e02a sd a0,0(sp) + 80020460: e42e sd a1,8(sp) + } + 80020462: 0141 addi sp,sp,16 + 80020464: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h752c0d8417c49952E: + +0000000080020466 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h752c0d8417c49952E>: + pub const fn as_mut_ptr(&mut self) -> *mut T { + 80020466: 1141 addi sp,sp,-16 + 80020468: e02a sd a0,0(sp) + 8002046a: e42e sd a1,8(sp) + } + 8002046c: 0141 addi sp,sp,16 + 8002046e: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17he2d11453020d912aE: + +0000000080020470 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$10as_mut_ptr17he2d11453020d912aE>: + pub const fn as_mut_ptr(&mut self) -> *mut T { + 80020470: 1141 addi sp,sp,-16 + 80020472: e02a sd a0,0(sp) + 80020474: e42e sd a1,8(sp) + } + 80020476: 0141 addi sp,sp,16 + 80020478: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h040db97216f8ec10E: + +000000008002047a <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17h040db97216f8ec10E>: + pub const fn len(&self) -> usize { + 8002047a: 7179 addi sp,sp,-48 + 8002047c: e42e sd a1,8(sp) + 8002047e: 85aa mv a1,a0 + 80020480: 6522 ld a0,8(sp) + 80020482: f02e sd a1,32(sp) + 80020484: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 80020486: e82e sd a1,16(sp) + 80020488: ec2a sd a0,24(sp) + } + 8002048a: 6145 addi sp,sp,48 + 8002048c: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17ha6c4bb93a093d49eE: + +000000008002048e <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17ha6c4bb93a093d49eE>: + pub const fn len(&self) -> usize { + 8002048e: 7179 addi sp,sp,-48 + 80020490: e42e sd a1,8(sp) + 80020492: 85aa mv a1,a0 + 80020494: 6522 ld a0,8(sp) + 80020496: f02e sd a1,32(sp) + 80020498: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 8002049a: e82e sd a1,16(sp) + 8002049c: ec2a sd a0,24(sp) + } + 8002049e: 6145 addi sp,sp,48 + 800204a0: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E: + +00000000800204a2 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hb06ce83b043493f3E>: + pub const fn len(&self) -> usize { + 800204a2: 7179 addi sp,sp,-48 + 800204a4: e42e sd a1,8(sp) + 800204a6: 85aa mv a1,a0 + 800204a8: 6522 ld a0,8(sp) + 800204aa: f02e sd a1,32(sp) + 800204ac: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 800204ae: e82e sd a1,16(sp) + 800204b0: ec2a sd a0,24(sp) + } + 800204b2: 6145 addi sp,sp,48 + 800204b4: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hc17413639ca00bf8E: + +00000000800204b6 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$3len17hc17413639ca00bf8E>: + pub const fn len(&self) -> usize { + 800204b6: 7179 addi sp,sp,-48 + 800204b8: e42e sd a1,8(sp) + 800204ba: 85aa mv a1,a0 + 800204bc: 6522 ld a0,8(sp) + 800204be: f02e sd a1,32(sp) + 800204c0: f42a sd a0,40(sp) + unsafe { crate::ptr::PtrRepr { const_ptr: self }.components.metadata } + 800204c2: e82e sd a1,16(sp) + 800204c4: ec2a sd a0,24(sp) + } + 800204c6: 6145 addi sp,sp,48 + 800204c8: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17h8f308ca2182773f1E: + +00000000800204ca <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17h8f308ca2182773f1E>: + pub fn iter(&self) -> Iter<'_, T> { + 800204ca: 7179 addi sp,sp,-48 + 800204cc: f406 sd ra,40(sp) + 800204ce: ec2a sd a0,24(sp) + 800204d0: f02e sd a1,32(sp) + Iter::new(self) + 800204d2: fffeb097 auipc ra,0xfffeb + 800204d6: f5a080e7 jalr -166(ra) # 8000b42c <_ZN4core5slice4iter13Iter$LT$T$GT$3new17h7dcd9c98bf37806bE> + 800204da: e42a sd a0,8(sp) + 800204dc: e82e sd a1,16(sp) + 800204de: a009 j 800204e0 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$4iter17h8f308ca2182773f1E+0x16> + } + 800204e0: 65c2 ld a1,16(sp) + 800204e2: 6522 ld a0,8(sp) + 800204e4: 70a2 ld ra,40(sp) + 800204e6: 6145 addi sp,sp,48 + 800204e8: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17h1ea05a5f45312d57E: + +00000000800204ea <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17h1ea05a5f45312d57E>: + pub const fn as_ptr(&self) -> *const T { + 800204ea: 1141 addi sp,sp,-16 + 800204ec: e02a sd a0,0(sp) + 800204ee: e42e sd a1,8(sp) + } + 800204f0: 0141 addi sp,sp,16 + 800204f2: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hc3575ad36de0bb27E: + +00000000800204f4 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hc3575ad36de0bb27E>: + pub const fn as_ptr(&self) -> *const T { + 800204f4: 1141 addi sp,sp,-16 + 800204f6: e02a sd a0,0(sp) + 800204f8: e42e sd a1,8(sp) + } + 800204fa: 0141 addi sp,sp,16 + 800204fc: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E: + +00000000800204fe <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$6as_ptr17hf7620495824cfb20E>: + pub const fn as_ptr(&self) -> *const T { + 800204fe: 1141 addi sp,sp,-16 + 80020500: e02a sd a0,0(sp) + 80020502: e42e sd a1,8(sp) + } + 80020504: 0141 addi sp,sp,16 + 80020506: 8082 ret + +Disassembly of section .text._ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h847ff5bce17a319bE: + +0000000080020508 <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h847ff5bce17a319bE>: + pub fn iter_mut(&mut self) -> IterMut<'_, T> { + 80020508: 7179 addi sp,sp,-48 + 8002050a: f406 sd ra,40(sp) + 8002050c: ec2a sd a0,24(sp) + 8002050e: f02e sd a1,32(sp) + IterMut::new(self) + 80020510: fffeb097 auipc ra,0xfffeb + 80020514: 280080e7 jalr 640(ra) # 8000b790 <_ZN4core5slice4iter16IterMut$LT$T$GT$3new17h8130085cf5731c78E> + 80020518: e42a sd a0,8(sp) + 8002051a: e82e sd a1,16(sp) + 8002051c: a009 j 8002051e <_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8iter_mut17h847ff5bce17a319bE+0x16> + } + 8002051e: 65c2 ld a1,16(sp) + 80020520: 6522 ld a0,8(sp) + 80020522: 70a2 ld ra,40(sp) + 80020524: 6145 addi sp,sp,48 + 80020526: 8082 ret + +Disassembly of section .text.__rust_alloc: + +0000000080020528 <__rust_alloc>: + 80020528: fffed317 auipc t1,0xfffed + 8002052c: e1e30067 jr -482(t1) # 8000d346 <__rg_alloc> + +Disassembly of section .text.__rust_dealloc: + +0000000080020530 <__rust_dealloc>: + 80020530: fffed317 auipc t1,0xfffed + 80020534: e4c30067 jr -436(t1) # 8000d37c <__rg_dealloc> + +Disassembly of section .text.__rust_realloc: + +0000000080020538 <__rust_realloc>: + 80020538: fffed317 auipc t1,0xfffed + 8002053c: e8830067 jr -376(t1) # 8000d3c0 <__rg_realloc> + +Disassembly of section .text.__rust_alloc_zeroed: + +0000000080020540 <__rust_alloc_zeroed>: + 80020540: fffed317 auipc t1,0xfffed + 80020544: ece30067 jr -306(t1) # 8000d40e <__rg_alloc_zeroed> + +Disassembly of section .text.__rust_alloc_error_handler: + +0000000080020548 <__rust_alloc_error_handler>: + 80020548: 00003317 auipc t1,0x3 + 8002054c: a0430067 jr -1532(t1) # 80022f4c <__rg_oom> + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hd6815da901cfddf7E: + +0000000080020550 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hd6815da901cfddf7E>: + fn fmt(&self, f: &mut Formatter<'_>) -> Result { $tr::fmt(&**self, f) } + 80020550: 1101 addi sp,sp,-32 + 80020552: ec06 sd ra,24(sp) + 80020554: e42a sd a0,8(sp) + 80020556: e82e sd a1,16(sp) + 80020558: 6108 ld a0,0(a0) + 8002055a: 00000097 auipc ra,0x0 + 8002055e: 37a080e7 jalr 890(ra) # 800208d4 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E> + 80020562: e02a sd a0,0(sp) + 80020564: a009 j 80020566 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hd6815da901cfddf7E+0x16> + 80020566: 6502 ld a0,0(sp) + 80020568: 60e2 ld ra,24(sp) + 8002056a: 6105 addi sp,sp,32 + 8002056c: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17hafe633af74a29011E: + +000000008002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 8002056e: 715d addi sp,sp,-80 + 80020570: e82a sd a0,16(sp) + 80020572: f82a sd a0,48(sp) + 80020574: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 80020576: e0ae sd a1,64(sp) + 80020578: ec2e sd a1,24(sp) + 8002057a: a009 j 8002057c <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E+0xe> + 8002057c: 6542 ld a0,16(sp) + 8002057e: e4aa sd a0,72(sp) + 80020580: e42a sd a0,8(sp) + 80020582: a009 j 80020584 <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E+0x16> + 80020584: 65e2 ld a1,24(sp) + 80020586: 6522 ld a0,8(sp) + 80020588: f02a sd a0,32(sp) + 8002058a: f42e sd a1,40(sp) + } + 8002058c: 6161 addi sp,sp,80 + 8002058e: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17hc2eeb6f5565b6dd2E: + +0000000080020590 <_ZN4core3fmt10ArgumentV13new17hc2eeb6f5565b6dd2E>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 80020590: 715d addi sp,sp,-80 + 80020592: e82a sd a0,16(sp) + 80020594: f82a sd a0,48(sp) + 80020596: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 80020598: e0ae sd a1,64(sp) + 8002059a: ec2e sd a1,24(sp) + 8002059c: a009 j 8002059e <_ZN4core3fmt10ArgumentV13new17hc2eeb6f5565b6dd2E+0xe> + 8002059e: 6542 ld a0,16(sp) + 800205a0: e4aa sd a0,72(sp) + 800205a2: e42a sd a0,8(sp) + 800205a4: a009 j 800205a6 <_ZN4core3fmt10ArgumentV13new17hc2eeb6f5565b6dd2E+0x16> + 800205a6: 65e2 ld a1,24(sp) + 800205a8: 6522 ld a0,8(sp) + 800205aa: f02a sd a0,32(sp) + 800205ac: f42e sd a1,40(sp) + } + 800205ae: 6161 addi sp,sp,80 + 800205b0: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h568dab4191b83956E: + +00000000800205b2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h568dab4191b83956E>: + pub const fn guaranteed_eq(self, other: *mut T) -> bool + 800205b2: 1101 addi sp,sp,-32 + 800205b4: e42a sd a0,8(sp) + 800205b6: e82e sd a1,16(sp) + intrinsics::ptr_guaranteed_eq(self as *const _, other as *const _) + 800205b8: 8d2d xor a0,a0,a1 + 800205ba: 00153513 seqz a0,a0 + 800205be: e02a sd a0,0(sp) + 800205c0: 00a10fa3 sb a0,31(sp) + 800205c4: a009 j 800205c6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h568dab4191b83956E+0x14> + } + 800205c6: 6502 ld a0,0(sp) + 800205c8: 6105 addi sp,sp,32 + 800205ca: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E: + +00000000800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E>: + pub const unsafe fn add(self, count: usize) -> Self + 800205cc: 1101 addi sp,sp,-32 + 800205ce: ec06 sd ra,24(sp) + 800205d0: e42a sd a0,8(sp) + 800205d2: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 800205d4: 00000097 auipc ra,0x0 + 800205d8: 068080e7 jalr 104(ra) # 8002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E> + 800205dc: e02a sd a0,0(sp) + 800205de: a009 j 800205e0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E+0x14> + } + 800205e0: 6502 ld a0,0(sp) + 800205e2: 60e2 ld ra,24(sp) + 800205e4: 6105 addi sp,sp,32 + 800205e6: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$4cast17h7b791e143f90db99E: + +00000000800205e8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$4cast17h7b791e143f90db99E>: + pub const fn cast(self) -> *mut U { + 800205e8: 1141 addi sp,sp,-16 + 800205ea: e42a sd a0,8(sp) + } + 800205ec: 0141 addi sp,sp,16 + 800205ee: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h8b37e8181b720bd0E: + +00000000800205f0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h8b37e8181b720bd0E>: + pub const unsafe fn write(self, val: T) + 800205f0: 1101 addi sp,sp,-32 + 800205f2: ec06 sd ra,24(sp) + 800205f4: e02a sd a0,0(sp) + 800205f6: e42e sd a1,8(sp) + 800205f8: e832 sd a2,16(sp) + unsafe { write(self, val) } + 800205fa: 00002097 auipc ra,0x2 + 800205fe: 116080e7 jalr 278(ra) # 80022710 <_ZN4core3ptr5write17h05084118c665240bE> + 80020602: a009 j 80020604 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h8b37e8181b720bd0E+0x14> + } + 80020604: 60e2 ld ra,24(sp) + 80020606: 6105 addi sp,sp,32 + 80020608: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E: + +000000008002060a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E>: + pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> { + 8002060a: 7179 addi sp,sp,-48 + 8002060c: f406 sd ra,40(sp) + 8002060e: e42a sd a0,8(sp) + 80020610: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&mut *self) } } + 80020612: 00000097 auipc ra,0x0 + 80020616: 03e080e7 jalr 62(ra) # 80020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E> + 8002061a: e82a sd a0,16(sp) + 8002061c: a009 j 8002061e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E+0x14> + 8002061e: 6542 ld a0,16(sp) + 80020620: 4581 li a1,0 + 80020622: 00b50663 beq a0,a1,8002062e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E+0x24> + 80020626: a009 j 80020628 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E+0x1e> + 80020628: 4501 li a0,0 + 8002062a: ec2a sd a0,24(sp) + 8002062c: a021 j 80020634 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E+0x2a> + 8002062e: 6522 ld a0,8(sp) + 80020630: ec2a sd a0,24(sp) + 80020632: a009 j 80020634 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E+0x2a> + } + 80020634: 6562 ld a0,24(sp) + 80020636: 70a2 ld ra,40(sp) + 80020638: 6145 addi sp,sp,48 + 8002063a: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E: + +000000008002063c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 8002063c: 1101 addi sp,sp,-32 + 8002063e: e42a sd a0,8(sp) + 80020640: e82e sd a1,16(sp) + unsafe { intrinsics::offset(self, count) as *mut T } + 80020642: 952e add a0,a0,a1 + 80020644: e02a sd a0,0(sp) + 80020646: ec2a sd a0,24(sp) + 80020648: a009 j 8002064a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17hb5f7a0f346747657E+0xe> + } + 8002064a: 6502 ld a0,0(sp) + 8002064c: 6105 addi sp,sp,32 + 8002064e: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E: + +0000000080020650 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E>: + pub const fn is_null(self) -> bool { + 80020650: 1101 addi sp,sp,-32 + 80020652: ec06 sd ra,24(sp) + 80020654: e42a sd a0,8(sp) + 80020656: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 80020658: a009 j 8002065a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E+0xa> + 8002065a: 6522 ld a0,8(sp) + 8002065c: 4581 li a1,0 + 8002065e: 00000097 auipc ra,0x0 + 80020662: f54080e7 jalr -172(ra) # 800205b2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h568dab4191b83956E> + 80020666: e02a sd a0,0(sp) + 80020668: a009 j 8002066a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hba478e65ea6353f9E+0x1a> + } + 8002066a: 6502 ld a0,0(sp) + 8002066c: 60e2 ld ra,24(sp) + 8002066e: 6105 addi sp,sp,32 + 80020670: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h80398cc0098c8b0fE: + +0000000080020672 <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h80398cc0098c8b0fE>: + /// assert_eq!(slice.as_mut_ptr(), 0 as *mut i8); + /// ``` + #[inline] + #[unstable(feature = "slice_ptr_get", issue = "74265")] + #[rustc_const_unstable(feature = "slice_ptr_get", issue = "74265")] + pub const fn as_mut_ptr(self) -> *mut T { + 80020672: 1141 addi sp,sp,-16 + 80020674: e02a sd a0,0(sp) + 80020676: e42e sd a1,8(sp) + self as *mut T + } + 80020678: 0141 addi sp,sp,16 + 8002067a: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h1fb5de3e2413636cE: + +000000008002067c <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h1fb5de3e2413636cE>: + /// assert_eq!(x.get_unchecked_mut(1), x.as_mut_ptr().add(1)); + /// } + /// ``` + #[unstable(feature = "slice_ptr_get", issue = "74265")] + #[inline] + pub unsafe fn get_unchecked_mut(self, index: I) -> *mut I::Output + 8002067c: 7179 addi sp,sp,-48 + 8002067e: f406 sd ra,40(sp) + 80020680: e032 sd a2,0(sp) + 80020682: 862e mv a2,a1 + 80020684: 85aa mv a1,a0 + 80020686: 6502 ld a0,0(sp) + 80020688: e82e sd a1,16(sp) + 8002068a: ec32 sd a2,24(sp) + 8002068c: f02a sd a0,32(sp) + where + I: SliceIndex<[T]>, + { + // SAFETY: the caller ensures that `self` is dereferencable and `index` in-bounds. + unsafe { index.get_unchecked_mut(self) } + 8002068e: 00002097 auipc ra,0x2 + 80020692: 66e080e7 jalr 1646(ra) # 80022cfc <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17hc32ec1251c36865fE> + 80020696: e42a sd a0,8(sp) + 80020698: a009 j 8002069a <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h1fb5de3e2413636cE+0x1e> + } + 8002069a: 6522 ld a0,8(sp) + 8002069c: 70a2 ld ra,40(sp) + 8002069e: 6145 addi sp,sp,48 + 800206a0: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17hae95a39236f9ef3eE: + +00000000800206a2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17hae95a39236f9ef3eE>: + pub const fn guaranteed_eq(self, other: *const T) -> bool + 800206a2: 1101 addi sp,sp,-32 + 800206a4: e42a sd a0,8(sp) + 800206a6: e82e sd a1,16(sp) + intrinsics::ptr_guaranteed_eq(self, other) + 800206a8: 8d2d xor a0,a0,a1 + 800206aa: 00153513 seqz a0,a0 + 800206ae: e02a sd a0,0(sp) + 800206b0: 00a10fa3 sb a0,31(sp) + 800206b4: a009 j 800206b6 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17hae95a39236f9ef3eE+0x14> + } + 800206b6: 6502 ld a0,0(sp) + 800206b8: 6105 addi sp,sp,32 + 800206ba: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17h3ef2f165a29b2365E: + +00000000800206bc <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17h3ef2f165a29b2365E>: + pub const unsafe fn add(self, count: usize) -> Self + 800206bc: 1101 addi sp,sp,-32 + 800206be: ec06 sd ra,24(sp) + 800206c0: e42a sd a0,8(sp) + 800206c2: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 800206c4: 00000097 auipc ra,0x0 + 800206c8: 046080e7 jalr 70(ra) # 8002070a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE> + 800206cc: e02a sd a0,0(sp) + 800206ce: a009 j 800206d0 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17h3ef2f165a29b2365E+0x14> + } + 800206d0: 6502 ld a0,0(sp) + 800206d2: 60e2 ld ra,24(sp) + 800206d4: 6105 addi sp,sp,32 + 800206d6: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E: + +00000000800206d8 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E>: + pub unsafe fn as_ref<'a>(self) -> Option<&'a T> { + 800206d8: 7179 addi sp,sp,-48 + 800206da: f406 sd ra,40(sp) + 800206dc: e42a sd a0,8(sp) + 800206de: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&*self) } } + 800206e0: 00000097 auipc ra,0x0 + 800206e4: 03e080e7 jalr 62(ra) # 8002071e <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h309eb733b6984dd5E> + 800206e8: e82a sd a0,16(sp) + 800206ea: a009 j 800206ec <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E+0x14> + 800206ec: 6542 ld a0,16(sp) + 800206ee: 4581 li a1,0 + 800206f0: 00b50663 beq a0,a1,800206fc <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E+0x24> + 800206f4: a009 j 800206f6 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E+0x1e> + 800206f6: 4501 li a0,0 + 800206f8: ec2a sd a0,24(sp) + 800206fa: a021 j 80020702 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E+0x2a> + 800206fc: 6522 ld a0,8(sp) + 800206fe: ec2a sd a0,24(sp) + 80020700: a009 j 80020702 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E+0x2a> + } + 80020702: 6562 ld a0,24(sp) + 80020704: 70a2 ld ra,40(sp) + 80020706: 6145 addi sp,sp,48 + 80020708: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE: + +000000008002070a <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE>: + pub const unsafe fn offset(self, count: isize) -> *const T + 8002070a: 1101 addi sp,sp,-32 + 8002070c: e42a sd a0,8(sp) + 8002070e: e82e sd a1,16(sp) + unsafe { intrinsics::offset(self, count) } + 80020710: 952e add a0,a0,a1 + 80020712: e02a sd a0,0(sp) + 80020714: ec2a sd a0,24(sp) + 80020716: a009 j 80020718 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6offset17h7d562998c5c34b1bE+0xe> + } + 80020718: 6502 ld a0,0(sp) + 8002071a: 6105 addi sp,sp,32 + 8002071c: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h309eb733b6984dd5E: + +000000008002071e <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h309eb733b6984dd5E>: + pub const fn is_null(self) -> bool { + 8002071e: 1101 addi sp,sp,-32 + 80020720: ec06 sd ra,24(sp) + 80020722: e42a sd a0,8(sp) + 80020724: e82a sd a0,16(sp) + (self as *const u8).guaranteed_eq(null()) + 80020726: a009 j 80020728 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h309eb733b6984dd5E+0xa> + 80020728: 6522 ld a0,8(sp) + 8002072a: 4581 li a1,0 + 8002072c: 00000097 auipc ra,0x0 + 80020730: f76080e7 jalr -138(ra) # 800206a2 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17hae95a39236f9ef3eE> + 80020734: e02a sd a0,0(sp) + 80020736: a009 j 80020738 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$7is_null17h309eb733b6984dd5E+0x1a> + } + 80020738: 6502 ld a0,0(sp) + 8002073a: 60e2 ld ra,24(sp) + 8002073c: 6105 addi sp,sp,32 + 8002073e: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$13get_unchecked17h149838d98ef59845E: + +0000000080020740 <_ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$13get_unchecked17h149838d98ef59845E>: + /// assert_eq!(x.get_unchecked(1), x.as_ptr().add(1)); + /// } + /// ``` + #[unstable(feature = "slice_ptr_get", issue = "74265")] + #[inline] + pub unsafe fn get_unchecked(self, index: I) -> *const I::Output + 80020740: 7179 addi sp,sp,-48 + 80020742: f406 sd ra,40(sp) + 80020744: e032 sd a2,0(sp) + 80020746: 862e mv a2,a1 + 80020748: 85aa mv a1,a0 + 8002074a: 6502 ld a0,0(sp) + 8002074c: e82e sd a1,16(sp) + 8002074e: ec32 sd a2,24(sp) + 80020750: f02a sd a0,32(sp) + where + I: SliceIndex<[T]>, + { + // SAFETY: the caller ensures that `self` is dereferencable and `index` in-bounds. + unsafe { index.get_unchecked(self) } + 80020752: 00002097 auipc ra,0x2 + 80020756: 532080e7 jalr 1330(ra) # 80022c84 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$13get_unchecked17hb36b3c40d6b3daa6E> + 8002075a: e42a sd a0,8(sp) + 8002075c: a009 j 8002075e <_ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$13get_unchecked17h149838d98ef59845E+0x1e> + } + 8002075e: 6522 ld a0,8(sp) + 80020760: 70a2 ld ra,40(sp) + 80020762: 6145 addi sp,sp,48 + 80020764: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$6as_ptr17hcf3eefd405b9d730E: + +0000000080020766 <_ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$6as_ptr17hcf3eefd405b9d730E>: + pub const fn as_ptr(self) -> *const T { + 80020766: 1141 addi sp,sp,-16 + 80020768: e02a sd a0,0(sp) + 8002076a: e42e sd a1,8(sp) + } + 8002076c: 0141 addi sp,sp,16 + 8002076e: 8082 ret + +Disassembly of section .text._ZN4core3mem7replace17h718d2b5d4e2666b3E: + +0000000080020770 <_ZN4core3mem7replace17h718d2b5d4e2666b3E>: +pub const fn replace(dest: &mut T, src: T) -> T { + 80020770: 7139 addi sp,sp,-64 + 80020772: fc06 sd ra,56(sp) + 80020774: e42e sd a1,8(sp) + 80020776: e82a sd a0,16(sp) + 80020778: f02a sd a0,32(sp) + 8002077a: f42e sd a1,40(sp) + let result = ptr::read(dest); + 8002077c: 00002097 auipc ra,0x2 + 80020780: f6e080e7 jalr -146(ra) # 800226ea <_ZN4core3ptr4read17hc3975c6c06864098E> + 80020784: 85aa mv a1,a0 + 80020786: ec2e sd a1,24(sp) + 80020788: f82a sd a0,48(sp) + 8002078a: a009 j 8002078c <_ZN4core3mem7replace17h718d2b5d4e2666b3E+0x1c> + ptr::write(dest, src); + 8002078c: 65a2 ld a1,8(sp) + 8002078e: 6542 ld a0,16(sp) + 80020790: 00002097 auipc ra,0x2 + 80020794: f90080e7 jalr -112(ra) # 80022720 <_ZN4core3ptr5write17h087ddd4d9bf79c51E> + 80020798: a009 j 8002079a <_ZN4core3mem7replace17h718d2b5d4e2666b3E+0x2a> +} + 8002079a: 6562 ld a0,24(sp) + 8002079c: 70e2 ld ra,56(sp) + 8002079e: 6121 addi sp,sp,64 + 800207a0: 8082 ret + +Disassembly of section .text._ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE: + +00000000800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE>: + fn next(&mut self) -> Option { + 800207a2: 715d addi sp,sp,-80 + 800207a4: e486 sd ra,72(sp) + 800207a6: ec2a sd a0,24(sp) + 800207a8: fc2a sd a0,56(sp) + if self.start < self.end { + 800207aa: 00850593 addi a1,a0,8 + 800207ae: 00000097 auipc ra,0x0 + 800207b2: 0b2080e7 jalr 178(ra) # 80020860 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha284226f6d671daaE> + 800207b6: f02a sd a0,32(sp) + 800207b8: a009 j 800207ba <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x18> + 800207ba: 7502 ld a0,32(sp) + 800207bc: 4581 li a1,0 + 800207be: 00b50a63 beq a0,a1,800207d2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x30> + 800207c2: a009 j 800207c4 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x22> + let n = unsafe { Step::forward_unchecked(self.start.clone(), 1) }; + 800207c4: 6562 ld a0,24(sp) + 800207c6: 00002097 auipc ra,0x2 + 800207ca: 490080e7 jalr 1168(ra) # 80022c56 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h2bd08456cf1cb28dE> + 800207ce: e82a sd a0,16(sp) + 800207d0: a021 j 800207d8 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x36> + 800207d2: 4501 li a0,0 + None + 800207d4: f42a sd a0,40(sp) + if self.start < self.end { + 800207d6: a805 j 80020806 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x64> + let n = unsafe { Step::forward_unchecked(self.start.clone(), 1) }; + 800207d8: 6542 ld a0,16(sp) + 800207da: 4585 li a1,1 + 800207dc: 00002097 auipc ra,0x2 + 800207e0: 23e080e7 jalr 574(ra) # 80022a1a <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h8a22fb325f3ddf5bE> + 800207e4: 85aa mv a1,a0 + 800207e6: e42e sd a1,8(sp) + 800207e8: e0aa sd a0,64(sp) + 800207ea: a009 j 800207ec <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x4a> + Some(mem::replace(&mut self.start, n)) + 800207ec: 65a2 ld a1,8(sp) + 800207ee: 6562 ld a0,24(sp) + 800207f0: 00000097 auipc ra,0x0 + 800207f4: f80080e7 jalr -128(ra) # 80020770 <_ZN4core3mem7replace17h718d2b5d4e2666b3E> + 800207f8: e02a sd a0,0(sp) + 800207fa: a009 j 800207fc <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x5a> + 800207fc: 6502 ld a0,0(sp) + 800207fe: f82a sd a0,48(sp) + 80020800: 4505 li a0,1 + 80020802: f42a sd a0,40(sp) + if self.start < self.end { + 80020804: a009 j 80020806 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE+0x64> + } + 80020806: 7522 ld a0,40(sp) + 80020808: 75c2 ld a1,48(sp) + 8002080a: 60a6 ld ra,72(sp) + 8002080c: 6161 addi sp,sp,80 + 8002080e: 8082 ret + +Disassembly of section .text._ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE: + +0000000080020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE>: + fn into_iter(self) -> I { + 80020810: 1141 addi sp,sp,-16 + 80020812: e02a sd a0,0(sp) + 80020814: e42e sd a1,8(sp) + } + 80020816: 0141 addi sp,sp,16 + 80020818: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E: + +000000008002081a <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E>: + fn cmp(&self, other: &$t) -> Ordering { + 8002081a: 7179 addi sp,sp,-48 + 8002081c: e42e sd a1,8(sp) + 8002081e: e82a sd a0,16(sp) + 80020820: f02a sd a0,32(sp) + 80020822: f42e sd a1,40(sp) + if *self < *other { Less } + 80020824: 6108 ld a0,0(a0) + 80020826: 618c ld a1,0(a1) + 80020828: 00b57863 bgeu a0,a1,80020838 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x1e> + 8002082c: a009 j 8002082e <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x14> + 8002082e: 0ff00513 li a0,255 + 80020832: 00a10fa3 sb a0,31(sp) + 80020836: a00d j 80020858 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x3e> + else if *self == *other { Equal } + 80020838: 65a2 ld a1,8(sp) + 8002083a: 6542 ld a0,16(sp) + 8002083c: 6108 ld a0,0(a0) + 8002083e: 618c ld a1,0(a1) + 80020840: 00b51763 bne a0,a1,8002084e <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x34> + 80020844: a009 j 80020846 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x2c> + 80020846: 4501 li a0,0 + 80020848: 00a10fa3 sb a0,31(sp) + 8002084c: a029 j 80020856 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x3c> + 8002084e: 4505 li a0,1 + else { Greater } + 80020850: 00a10fa3 sb a0,31(sp) + else if *self == *other { Equal } + 80020854: a009 j 80020856 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x3c> + if *self < *other { Less } + 80020856: a009 j 80020858 <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E+0x3e> + } + 80020858: 01f10503 lb a0,31(sp) + 8002085c: 6145 addi sp,sp,48 + 8002085e: 8082 ret + +Disassembly of section .text._ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha284226f6d671daaE: + +0000000080020860 <_ZN4core3cmp5impls57_$LT$impl$u20$core..cmp..PartialOrd$u20$for$u20$usize$GT$2lt17ha284226f6d671daaE>: + fn lt(&self, other: &$t) -> bool { (*self) < (*other) } + 80020860: 1141 addi sp,sp,-16 + 80020862: e02a sd a0,0(sp) + 80020864: e42e sd a1,8(sp) + 80020866: 6108 ld a0,0(a0) + 80020868: 618c ld a1,0(a1) + 8002086a: 00b53533 sltu a0,a0,a1 + 8002086e: 0141 addi sp,sp,16 + 80020870: 8082 ret + +Disassembly of section .text._ZN4core9panicking13assert_failed17h4e6d74c9d534b647E: + +0000000080020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E>: +pub fn assert_failed( + 80020872: 715d addi sp,sp,-80 + 80020874: 883a mv a6,a4 + 80020876: e42e sd a1,8(sp) + 80020878: e832 sd a2,16(sp) + 8002087a: 04a107a3 sb a0,79(sp) + assert_failed_inner(kind, &left, &right, args) + 8002087e: 628c ld a1,0(a3) + 80020880: ec2e sd a1,24(sp) + 80020882: 668c ld a1,8(a3) + 80020884: f02e sd a1,32(sp) + 80020886: 6a8c ld a1,16(a3) + 80020888: f42e sd a1,40(sp) + 8002088a: 6e8c ld a1,24(a3) + 8002088c: f82e sd a1,48(sp) + 8002088e: 728c ld a1,32(a3) + 80020890: fc2e sd a1,56(sp) + 80020892: 768c ld a1,40(a3) + 80020894: e0ae sd a1,64(sp) + +0000000080020896 <.LBB0_1>: + 80020896: 0000d717 auipc a4,0xd + 8002089a: 8ca70713 addi a4,a4,-1846 # 8002d160 <.L__unnamed_1> + 8002089e: 002c addi a1,sp,8 + 800208a0: 0814 addi a3,sp,16 + 800208a2: 083c addi a5,sp,24 + 800208a4: 863a mv a2,a4 + 800208a6: 00003097 auipc ra,0x3 + 800208aa: 932080e7 jalr -1742(ra) # 800231d8 <_ZN4core9panicking19assert_failed_inner17h4615d2e87cda8e50E> + ... + +Disassembly of section .text._ZN4core3ops8function6FnOnce9call_once17h199d3571a582934bE: + +00000000800208b0 <_ZN4core3ops8function6FnOnce9call_once17h199d3571a582934bE>: + 800208b0: 7179 addi sp,sp,-48 + 800208b2: f406 sd ra,40(sp) + 800208b4: e82a sd a0,16(sp) + 800208b6: ec2e sd a1,24(sp) + 800208b8: 00000097 auipc ra,0x0 + 800208bc: f62080e7 jalr -158(ra) # 8002081a <_ZN4core3cmp5impls50_$LT$impl$u20$core..cmp..Ord$u20$for$u20$usize$GT$3cmp17hbe490bb523b08a07E> + 800208c0: e42a sd a0,8(sp) + 800208c2: a009 j 800208c4 <_ZN4core3ops8function6FnOnce9call_once17h199d3571a582934bE+0x14> + 800208c4: 6522 ld a0,8(sp) + 800208c6: 70a2 ld ra,40(sp) + 800208c8: 6145 addi sp,sp,48 + 800208ca: 8082 ret + +Disassembly of section .text._ZN4core3ptr30drop_in_place$LT$$RF$usize$GT$17h4738edf12535783bE: + +00000000800208cc <_ZN4core3ptr30drop_in_place$LT$$RF$usize$GT$17h4738edf12535783bE>: +pub unsafe fn drop_in_place(to_drop: *mut T) { + 800208cc: 1141 addi sp,sp,-16 + 800208ce: e42a sd a0,8(sp) + 800208d0: 0141 addi sp,sp,16 + 800208d2: 8082 ret + +Disassembly of section .text._ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E: + +00000000800208d4 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E>: +macro_rules! debug { + ($($T:ident)*) => {$( + #[stable(feature = "rust1", since = "1.0.0")] + impl fmt::Debug for $T { + #[inline] + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + 800208d4: 7139 addi sp,sp,-64 + 800208d6: fc06 sd ra,56(sp) + 800208d8: e42e sd a1,8(sp) + 800208da: 85aa mv a1,a0 + 800208dc: 6522 ld a0,8(sp) + 800208de: e82e sd a1,16(sp) + 800208e0: f42e sd a1,40(sp) + 800208e2: f82a sd a0,48(sp) + if f.debug_lower_hex() { + 800208e4: 00003097 auipc ra,0x3 + 800208e8: 7c8080e7 jalr 1992(ra) # 800240ac <_ZN4core3fmt9Formatter15debug_lower_hex17h7c86defbf028d215E> + 800208ec: ec2a sd a0,24(sp) + 800208ee: a009 j 800208f0 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x1c> + 800208f0: 6562 ld a0,24(sp) + 800208f2: 4581 li a1,0 + 800208f4: 00b50c63 beq a0,a1,8002090c <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x38> + 800208f8: a009 j 800208fa <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x26> + fmt::LowerHex::fmt(self, f) + 800208fa: 65a2 ld a1,8(sp) + 800208fc: 6542 ld a0,16(sp) + 800208fe: 00005097 auipc ra,0x5 + 80020902: 984080e7 jalr -1660(ra) # 80025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E> + 80020906: 02a103a3 sb a0,39(sp) + 8002090a: a801 j 8002091a <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x46> + } else if f.debug_upper_hex() { + 8002090c: 6522 ld a0,8(sp) + 8002090e: 00003097 auipc ra,0x3 + 80020912: 7a8080e7 jalr 1960(ra) # 800240b6 <_ZN4core3fmt9Formatter15debug_upper_hex17hdf276d50be1e3931E> + 80020916: e02a sd a0,0(sp) + 80020918: a011 j 8002091c <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x48> + if f.debug_lower_hex() { + 8002091a: a81d j 80020950 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x7c> + 8002091c: 6502 ld a0,0(sp) + 8002091e: 4581 li a1,0 + } else if f.debug_upper_hex() { + 80020920: 00b50c63 beq a0,a1,80020938 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x64> + 80020924: a009 j 80020926 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x52> + fmt::UpperHex::fmt(self, f) + 80020926: 65a2 ld a1,8(sp) + 80020928: 6542 ld a0,16(sp) + 8002092a: 00005097 auipc ra,0x5 + 8002092e: 9d2080e7 jalr -1582(ra) # 800252fc <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i64$GT$3fmt17h66734376af0f4671E> + 80020932: 02a103a3 sb a0,39(sp) + 80020936: a811 j 8002094a <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x76> + } else { + fmt::Display::fmt(self, f) + 80020938: 65a2 ld a1,8(sp) + 8002093a: 6542 ld a0,16(sp) + 8002093c: 00005097 auipc ra,0x5 + 80020940: f64080e7 jalr -156(ra) # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80020944: 02a103a3 sb a0,39(sp) + 80020948: a011 j 8002094c <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x78> + } else if f.debug_upper_hex() { + 8002094a: a011 j 8002094e <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x7a> + 8002094c: a009 j 8002094e <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x7a> + if f.debug_lower_hex() { + 8002094e: a009 j 80020950 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h145a0e5da1339a00E+0x7c> + } + } + 80020950: 02714503 lbu a0,39(sp) + 80020954: 70e2 ld ra,56(sp) + 80020956: 6121 addi sp,sp,64 + 80020958: 8082 ret + +Disassembly of section .text._ZN9allocator11BuddySystem4init17h0838f8d4c4026c43E: + +000000008002095a <_ZN9allocator11BuddySystem4init17h0838f8d4c4026c43E>: + + /// Init the buddy system allocator at [start, end). + /// `leaf_size` and `max_alignment` must be a power of 2. + /// `max_alignment` is the biggest alignment of a [`alloc::alloc::Layout`] the user can request. + /// SAFETY: It should only be called once and before any subsequent call to this buddy system. + pub unsafe fn init(&mut self, start: usize, end: usize, leaf_size: usize, max_alignment: usize) + 8002095a: d1010113 addi sp,sp,-752 + 8002095e: 2e113423 sd ra,744(sp) + 80020962: eeba sd a4,344(sp) + 80020964: f2b6 sd a3,352(sp) + 80020966: f6b2 sd a2,360(sp) + 80020968: faae sd a1,368(sp) + 8002096a: feaa sd a0,376(sp) + 8002096c: 20a13023 sd a0,512(sp) + 80020970: 20b13423 sd a1,520(sp) + 80020974: 20c13823 sd a2,528(sp) + 80020978: 20d13c23 sd a3,536(sp) + 8002097c: 22e13023 sd a4,544(sp) + -> Result<(), &'static str> + { + if self.initialized { + 80020980: 03854503 lbu a0,56(a0) + 80020984: 8905 andi a0,a0,1 + 80020986: 4581 li a1,0 + 80020988: 00b50b63 beq a0,a1,8002099e <.LBB1_78+0x10> + 8002098c: a009 j 8002098e <.LBB1_78> + +000000008002098e <.LBB1_78>: + return Err("init twice"); + 8002098e: 0000c517 auipc a0,0xc + 80020992: 7f250513 addi a0,a0,2034 # 8002d180 <.L__unnamed_1> + 80020996: e32a sd a0,384(sp) + 80020998: 4529 li a0,10 + 8002099a: e72a sd a0,392(sp) +//! Thread-unsafe, panic-free buddy system allocator. + 8002099c: a139 j 80020daa <.LBB1_81+0x20> + } + + if end - start < leaf_size { + 8002099e: 7536 ld a0,360(sp) + 800209a0: 75d6 ld a1,368(sp) + 800209a2: 40b505b3 sub a1,a0,a1 + 800209a6: eaae sd a1,336(sp) + 800209a8: 40b56863 bltu a0,a1,80020db8 <.LBB1_82> + 800209ac: a009 j 800209ae <.LBB1_78+0x20> + 800209ae: 6556 ld a0,336(sp) + 800209b0: 7596 ld a1,352(sp) + 800209b2: 00b57b63 bgeu a0,a1,800209c8 <.LBB1_79+0x10> + 800209b6: a009 j 800209b8 <.LBB1_79> + +00000000800209b8 <.LBB1_79>: + return Err("range too small"); + 800209b8: 0000d517 auipc a0,0xd + 800209bc: 83950513 addi a0,a0,-1991 # 8002d1f1 <.L__unnamed_2> + 800209c0: e32a sd a0,384(sp) + 800209c2: 453d li a0,15 + 800209c4: e72a sd a0,392(sp) +//! Thread-unsafe, panic-free buddy system allocator. + 800209c6: a6d5 j 80020daa <.LBB1_81+0x20> + } + + if !leaf_size.is_power_of_two() || !max_alignment.is_power_of_two() { + 800209c8: 7516 ld a0,352(sp) + 800209ca: 00002097 auipc ra,0x2 + 800209ce: ec8080e7 jalr -312(ra) # 80022892 <_ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h4d07b92e227ceed8E> + 800209d2: e6aa sd a0,328(sp) + 800209d4: a02d j 800209fe <.LBB1_79+0x46> + 800209d6: 4505 li a0,1 + 800209d8: 18a10ba3 sb a0,407(sp) + 800209dc: a821 j 800209f4 <.LBB1_79+0x3c> + 800209de: 4501 li a0,0 + 800209e0: 18a10ba3 sb a0,407(sp) + 800209e4: a801 j 800209f4 <.LBB1_79+0x3c> + 800209e6: 6576 ld a0,344(sp) + 800209e8: 00002097 auipc ra,0x2 + 800209ec: eaa080e7 jalr -342(ra) # 80022892 <_ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h4d07b92e227ceed8E> + 800209f0: e2aa sd a0,320(sp) + 800209f2: a819 j 80020a08 <.LBB1_79+0x50> + 800209f4: 19714503 lbu a0,407(sp) + 800209f8: 8905 andi a0,a0,1 + 800209fa: ed01 bnez a0,80020a12 <.LBB1_80> + 800209fc: a025 j 80020a24 <.LBB1_80+0x12> + 800209fe: 6536 ld a0,328(sp) + 80020a00: 4581 li a1,0 + 80020a02: fcb50ae3 beq a0,a1,800209d6 <.LBB1_79+0x1e> + 80020a06: b7c5 j 800209e6 <.LBB1_79+0x2e> + 80020a08: 6516 ld a0,320(sp) + 80020a0a: 4581 li a1,0 + 80020a0c: fcb505e3 beq a0,a1,800209d6 <.LBB1_79+0x1e> + 80020a10: b7f9 j 800209de <.LBB1_79+0x26> + +0000000080020a12 <.LBB1_80>: + return Err("leaf size or max_alignment not 2^n"); + 80020a12: 0000c517 auipc a0,0xc + 80020a16: 7ee50513 addi a0,a0,2030 # 8002d200 <.L__unnamed_3> + 80020a1a: e32a sd a0,384(sp) + 80020a1c: 02200513 li a0,34 + 80020a20: e72a sd a0,392(sp) +//! Thread-unsafe, panic-free buddy system allocator. + 80020a22: a661 j 80020daa <.LBB1_81+0x20> + } + self.leaf_size = leaf_size; + 80020a24: 65f6 ld a1,344(sp) + 80020a26: 7516 ld a0,352(sp) + 80020a28: 7676 ld a2,376(sp) + 80020a2a: ee08 sd a0,24(a2) + self.max_alignment = max_alignment; + 80020a2c: f20c sd a1,32(a2) + + // make sure start and end are both leaf aligned + // and record the heap memory range: [self.base, self.end) + let mut cur: usize = round_up(start, cmp::max(leaf_size, max_alignment)); + 80020a2e: 00002097 auipc ra,0x2 + 80020a32: 37a080e7 jalr 890(ra) # 80022da8 <_ZN4core3cmp3max17h3dc8da765fcdebd4E> + 80020a36: fe2a sd a0,312(sp) + 80020a38: a009 j 80020a3a <.LBB1_80+0x28> + 80020a3a: 75f2 ld a1,312(sp) + 80020a3c: 7556 ld a0,368(sp) + 80020a3e: 00001097 auipc ra,0x1 + 80020a42: 726080e7 jalr 1830(ra) # 80022164 <_ZN9allocator8round_up17h09c23390ccb46398E> + 80020a46: ef2a sd a0,408(sp) + 80020a48: a009 j 80020a4a <.LBB1_80+0x38> + self.base = cur; + 80020a4a: 65f6 ld a1,344(sp) + 80020a4c: 7516 ld a0,352(sp) + 80020a4e: 76f6 ld a3,376(sp) + 80020a50: 667a ld a2,408(sp) + 80020a52: e290 sd a2,0(a3) + self.actual_end = round_down(end, cmp::max(leaf_size, max_alignment)); + 80020a54: 00002097 auipc ra,0x2 + 80020a58: 354080e7 jalr 852(ra) # 80022da8 <_ZN4core3cmp3max17h3dc8da765fcdebd4E> + 80020a5c: fa2a sd a0,304(sp) + 80020a5e: a009 j 80020a60 <.LBB1_80+0x4e> + 80020a60: 75d2 ld a1,304(sp) + 80020a62: 7536 ld a0,360(sp) + 80020a64: 00001097 auipc ra,0x1 + 80020a68: 7c2080e7 jalr 1986(ra) # 80022226 <_ZN9allocator10round_down17h97bc9e681a0cc273E> + 80020a6c: f62a sd a0,296(sp) + 80020a6e: a009 j 80020a70 <.LBB1_80+0x5e> + 80020a70: 7532 ld a0,296(sp) + 80020a72: 75f6 ld a1,376(sp) + 80020a74: e588 sd a0,8(a1) + + // compute the max pow of 2 smaller than size of [self.base, self.actual_end) + self.nsizes = log2((self.actual_end-cur)/leaf_size) + 1; + 80020a76: 65fa ld a1,408(sp) + 80020a78: 40b505b3 sub a1,a0,a1 + 80020a7c: f22e sd a1,288(sp) + 80020a7e: 34b56c63 bltu a0,a1,80020dd6 <.LBB1_84> + 80020a82: a009 j 80020a84 <.LBB1_80+0x72> + 80020a84: 7516 ld a0,352(sp) + 80020a86: 4581 li a1,0 + 80020a88: 36b50663 beq a0,a1,80020df4 <.LBB1_86> + 80020a8c: a009 j 80020a8e <.LBB1_80+0x7c> + 80020a8e: 7512 ld a0,288(sp) + 80020a90: 7596 ld a1,352(sp) + 80020a92: 02b55533 divu a0,a0,a1 + 80020a96: 00001097 auipc ra,0x1 + 80020a9a: 7fc080e7 jalr 2044(ra) # 80022292 <_ZN9allocator4log217h8cd213ee718a0479E> + 80020a9e: ee2a sd a0,280(sp) + 80020aa0: a009 j 80020aa2 <.LBB1_80+0x90> + 80020aa2: 65f2 ld a1,280(sp) + 80020aa4: 00158513 addi a0,a1,1 + 80020aa8: ea2a sd a0,272(sp) + 80020aaa: 36b56363 bltu a0,a1,80020e10 <.LBB1_88> + 80020aae: a009 j 80020ab0 <.LBB1_80+0x9e> + 80020ab0: 7576 ld a0,376(sp) + 80020ab2: 65d2 ld a1,272(sp) + 80020ab4: e90c sd a1,16(a0) + if self.actual_end - cur > self.blk_size(self.max_size()) { + 80020ab6: 6508 ld a0,8(a0) + 80020ab8: 65fa ld a1,408(sp) + 80020aba: 40b505b3 sub a1,a0,a1 + 80020abe: e62e sd a1,264(sp) + 80020ac0: 36b56663 bltu a0,a1,80020e2c <.LBB1_90> + 80020ac4: a009 j 80020ac6 <.LBB1_80+0xb4> + 80020ac6: 7576 ld a0,376(sp) + 80020ac8: 00001097 auipc ra,0x1 + 80020acc: 0f6080e7 jalr 246(ra) # 80021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E> + 80020ad0: e22a sd a0,256(sp) + 80020ad2: a009 j 80020ad4 <.LBB1_80+0xc2> + 80020ad4: 6592 ld a1,256(sp) + 80020ad6: 7576 ld a0,376(sp) + 80020ad8: 00001097 auipc ra,0x1 + 80020adc: 3bc080e7 jalr 956(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80020ae0: fdaa sd a0,248(sp) + 80020ae2: a009 j 80020ae4 <.LBB1_80+0xd2> + 80020ae4: 756e ld a0,248(sp) + 80020ae6: 65b2 ld a1,264(sp) + 80020ae8: 00b57b63 bgeu a0,a1,80020afe <.LBB1_80+0xec> + 80020aec: a009 j 80020aee <.LBB1_80+0xdc> + self.nsizes += 1; + 80020aee: 7576 ld a0,376(sp) + 80020af0: 690c ld a1,16(a0) + 80020af2: 00158513 addi a0,a1,1 + 80020af6: f9aa sd a0,240(sp) + 80020af8: 34b56963 bltu a0,a1,80020e4a <.LBB1_92> + 80020afc: a011 j 80020b00 <.LBB1_80+0xee> + if self.actual_end - cur > self.blk_size(self.max_size()) { + 80020afe: a029 j 80020b08 <.LBB1_80+0xf6> + self.nsizes += 1; + 80020b00: 754e ld a0,240(sp) + 80020b02: 75f6 ld a1,376(sp) + 80020b04: e988 sd a0,16(a1) + if self.actual_end - cur > self.blk_size(self.max_size()) { + 80020b06: a009 j 80020b08 <.LBB1_80+0xf6> + } + + // alloc buddy infos + // SAFETY: init all of the BuddyInfo + let info_slice_ptr = init_slice_empty(&mut cur, self.nsizes); + 80020b08: 7576 ld a0,376(sp) + 80020b0a: 690c ld a1,16(a0) + 80020b0c: 0b28 addi a0,sp,408 + 80020b0e: 00002097 auipc ra,0x2 + 80020b12: 0a0080e7 jalr 160(ra) # 80022bae <_ZN9allocator16init_slice_empty17h570498bae7ef4c88E> + 80020b16: 862a mv a2,a0 + 80020b18: f1b2 sd a2,224(sp) + 80020b1a: 862e mv a2,a1 + 80020b1c: f5b2 sd a2,232(sp) + 80020b1e: 22a13423 sd a0,552(sp) + 80020b22: 22b13823 sd a1,560(sp) + 80020b26: a009 j 80020b28 <.LBB1_80+0x116> + self.infos.as_mut_ptr().write(info_slice_ptr); + 80020b28: 7576 ld a0,376(sp) + 80020b2a: 02850513 addi a0,a0,40 + 80020b2e: edaa sd a0,216(sp) + 80020b30: 2ca13823 sd a0,720(sp) + 80020b34: a009 j 80020b36 <.LBB1_80+0x124> + 80020b36: 762e ld a2,232(sp) + 80020b38: 758e ld a1,224(sp) + 80020b3a: 656e ld a0,216(sp) + 80020b3c: 00002097 auipc ra,0x2 + 80020b40: f1e080e7 jalr -226(ra) # 80022a5a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h69211318640bf224E> + 80020b44: a009 j 80020b46 <.LBB1_80+0x134> + + // init free list and alloc space for alloc field + for i in 0..self.nsizes { + 80020b46: 7576 ld a0,376(sp) + 80020b48: 690c ld a1,16(a0) + 80020b4a: 4501 li a0,0 + 80020b4c: f32a sd a0,416(sp) + 80020b4e: f72e sd a1,424(sp) + 80020b50: 00000097 auipc ra,0x0 + 80020b54: cc0080e7 jalr -832(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80020b58: e5aa sd a0,200(sp) + 80020b5a: e9ae sd a1,208(sp) + 80020b5c: a009 j 80020b5e <.LBB1_80+0x14c> + 80020b5e: 654e ld a0,208(sp) + 80020b60: 65ae ld a1,200(sp) + 80020b62: fb2e sd a1,432(sp) + 80020b64: ff2a sd a0,440(sp) + 80020b66: a009 j 80020b68 <.LBB1_80+0x156> + 80020b68: 1b08 addi a0,sp,432 + 80020b6a: 00000097 auipc ra,0x0 + 80020b6e: c38080e7 jalr -968(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80020b72: e3aa sd a0,448(sp) + 80020b74: e7ae sd a1,456(sp) + 80020b76: a009 j 80020b78 <.LBB1_80+0x166> + 80020b78: 651e ld a0,448(sp) + 80020b7a: 4581 li a1,0 + 80020b7c: 00b50463 beq a0,a1,80020b84 <.LBB1_80+0x172> + 80020b80: a009 j 80020b82 <.LBB1_80+0x170> + 80020b82: a831 j 80020b9e <.LBB1_80+0x18c> + info.alloc.as_mut_ptr().write(alloc_slice_ptr); + } + + // alloc space for split field + // blocks of size 0 no need to split + for i in 1..self.nsizes { + 80020b84: 7576 ld a0,376(sp) + 80020b86: 690c ld a1,16(a0) + 80020b88: 4505 li a0,1 + 80020b8a: ebaa sd a0,464(sp) + 80020b8c: efae sd a1,472(sp) + 80020b8e: 00000097 auipc ra,0x0 + 80020b92: c82080e7 jalr -894(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80020b96: fd2a sd a0,184(sp) + 80020b98: e1ae sd a1,192(sp) + 80020b9a: a879 j 80020c38 <.LBB1_80+0x226> + for i in 0..self.nsizes { + 80020b9c: 0000 unimp + 80020b9e: 7576 ld a0,376(sp) + 80020ba0: 65be ld a1,456(sp) + 80020ba2: f52e sd a1,168(sp) + 80020ba4: 22b13c23 sd a1,568(sp) + 80020ba8: 24b13023 sd a1,576(sp) + 80020bac: 24b13423 sd a1,584(sp) + let nblk = self.n_blk(i); + 80020bb0: 00001097 auipc ra,0x1 + 80020bb4: 044080e7 jalr 68(ra) # 80021bf4 <_ZN9allocator11BuddySystem5n_blk17hdff1460b10f7c769E> + 80020bb8: 85aa mv a1,a0 + 80020bba: f92e sd a1,176(sp) + 80020bbc: 24a13823 sd a0,592(sp) + 80020bc0: a009 j 80020bc2 <.LBB1_80+0x1b0> + let info = self.get_info_mut(i); + 80020bc2: 75aa ld a1,168(sp) + 80020bc4: 7576 ld a0,376(sp) + 80020bc6: 00001097 auipc ra,0x1 + 80020bca: fa0080e7 jalr -96(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80020bce: 85aa mv a1,a0 + 80020bd0: f12e sd a1,160(sp) + 80020bd2: 24a13c23 sd a0,600(sp) + 80020bd6: a009 j 80020bd8 <.LBB1_80+0x1c6> + info.free.init(); + 80020bd8: 750a ld a0,160(sp) + 80020bda: 00002097 auipc ra,0x2 + 80020bde: 8b8080e7 jalr -1864(ra) # 80022492 <_ZN9allocator4list4List4init17ha2ca564ea80bf5d5E> + 80020be2: a009 j 80020be4 <.LBB1_80+0x1d2> + let alloc_size = round_up(nblk, 8)/8; + 80020be4: 754a ld a0,176(sp) + 80020be6: 45a1 li a1,8 + 80020be8: 00001097 auipc ra,0x1 + 80020bec: 57c080e7 jalr 1404(ra) # 80022164 <_ZN9allocator8round_up17h09c23390ccb46398E> + 80020bf0: ed2a sd a0,152(sp) + 80020bf2: a009 j 80020bf4 <.LBB1_80+0x1e2> + 80020bf4: 656a ld a0,152(sp) + 80020bf6: 00355593 srli a1,a0,0x3 + 80020bfa: 26b13023 sd a1,608(sp) + 80020bfe: 0b28 addi a0,sp,408 + let alloc_slice_ptr = init_slice_empty(&mut cur, alloc_size); + 80020c00: 00002097 auipc ra,0x2 + 80020c04: f14080e7 jalr -236(ra) # 80022b14 <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E> + 80020c08: 862a mv a2,a0 + 80020c0a: e532 sd a2,136(sp) + 80020c0c: 862e mv a2,a1 + 80020c0e: e932 sd a2,144(sp) + 80020c10: 26a13423 sd a0,616(sp) + 80020c14: 26b13823 sd a1,624(sp) + 80020c18: a009 j 80020c1a <.LBB1_80+0x208> + info.alloc.as_mut_ptr().write(alloc_slice_ptr); + 80020c1a: 750a ld a0,160(sp) + 80020c1c: 0541 addi a0,a0,16 + 80020c1e: e12a sd a0,128(sp) + 80020c20: 2ca13c23 sd a0,728(sp) + 80020c24: a009 j 80020c26 <.LBB1_80+0x214> + 80020c26: 664a ld a2,144(sp) + 80020c28: 65aa ld a1,136(sp) + 80020c2a: 650a ld a0,128(sp) + 80020c2c: 00000097 auipc ra,0x0 + 80020c30: 9c4080e7 jalr -1596(ra) # 800205f0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h8b37e8181b720bd0E> + 80020c34: a009 j 80020c36 <.LBB1_80+0x224> + for i in 0..self.nsizes { + 80020c36: bf0d j 80020b68 <.LBB1_80+0x156> + for i in 1..self.nsizes { + 80020c38: 650e ld a0,192(sp) + 80020c3a: 75ea ld a1,184(sp) + 80020c3c: f3ae sd a1,480(sp) + 80020c3e: f7aa sd a0,488(sp) + 80020c40: a009 j 80020c42 <.LBB1_80+0x230> + 80020c42: 1388 addi a0,sp,480 + 80020c44: 00000097 auipc ra,0x0 + 80020c48: b5e080e7 jalr -1186(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 80020c4c: fbaa sd a0,496(sp) + 80020c4e: ffae sd a1,504(sp) + 80020c50: a009 j 80020c52 <.LBB1_80+0x240> + 80020c52: 755e ld a0,496(sp) + 80020c54: 4581 li a1,0 + 80020c56: 00b50463 beq a0,a1,80020c5e <.LBB1_80+0x24c> + 80020c5a: a009 j 80020c5c <.LBB1_80+0x24a> + 80020c5c: a811 j 80020c70 <.LBB1_80+0x25e> + let split_slice_ptr = init_slice_empty(&mut cur, split_size); + info.split.as_mut_ptr().write(split_slice_ptr); + } + + // cur address may not be aligned now + cur = round_up(cur, leaf_size); + 80020c5e: 7596 ld a1,352(sp) + 80020c60: 657a ld a0,408(sp) + 80020c62: 00001097 auipc ra,0x1 + 80020c66: 502080e7 jalr 1282(ra) # 80022164 <_ZN9allocator8round_up17h09c23390ccb46398E> + 80020c6a: fcaa sd a0,120(sp) + 80020c6c: a851 j 80020d00 <.LBB1_80+0x2ee> + for i in 1..self.nsizes { + 80020c6e: 0000 unimp + 80020c70: 7576 ld a0,376(sp) + 80020c72: 75fe ld a1,504(sp) + 80020c74: f4ae sd a1,104(sp) + 80020c76: 26b13c23 sd a1,632(sp) + 80020c7a: 28b13023 sd a1,640(sp) + 80020c7e: 28b13423 sd a1,648(sp) + let nblk = self.n_blk(i); + 80020c82: 00001097 auipc ra,0x1 + 80020c86: f72080e7 jalr -142(ra) # 80021bf4 <_ZN9allocator11BuddySystem5n_blk17hdff1460b10f7c769E> + 80020c8a: 85aa mv a1,a0 + 80020c8c: f8ae sd a1,112(sp) + 80020c8e: 28a13823 sd a0,656(sp) + 80020c92: a009 j 80020c94 <.LBB1_80+0x282> + let info = self.get_info_mut(i); + 80020c94: 75a6 ld a1,104(sp) + 80020c96: 7576 ld a0,376(sp) + 80020c98: 00001097 auipc ra,0x1 + 80020c9c: ece080e7 jalr -306(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80020ca0: 85aa mv a1,a0 + 80020ca2: f0ae sd a1,96(sp) + 80020ca4: 28a13c23 sd a0,664(sp) + 80020ca8: a009 j 80020caa <.LBB1_80+0x298> + let split_size = round_up(nblk, 8)/8; + 80020caa: 7546 ld a0,112(sp) + 80020cac: 45a1 li a1,8 + 80020cae: 00001097 auipc ra,0x1 + 80020cb2: 4b6080e7 jalr 1206(ra) # 80022164 <_ZN9allocator8round_up17h09c23390ccb46398E> + 80020cb6: ecaa sd a0,88(sp) + 80020cb8: a009 j 80020cba <.LBB1_80+0x2a8> + 80020cba: 6566 ld a0,88(sp) + 80020cbc: 00355593 srli a1,a0,0x3 + 80020cc0: 2ab13023 sd a1,672(sp) + 80020cc4: 0b28 addi a0,sp,408 + let split_slice_ptr = init_slice_empty(&mut cur, split_size); + 80020cc6: 00002097 auipc ra,0x2 + 80020cca: e4e080e7 jalr -434(ra) # 80022b14 <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E> + 80020cce: 862a mv a2,a0 + 80020cd0: e4b2 sd a2,72(sp) + 80020cd2: 862e mv a2,a1 + 80020cd4: e8b2 sd a2,80(sp) + 80020cd6: 2aa13423 sd a0,680(sp) + 80020cda: 2ab13823 sd a1,688(sp) + 80020cde: a009 j 80020ce0 <.LBB1_80+0x2ce> + info.split.as_mut_ptr().write(split_slice_ptr); + 80020ce0: 7506 ld a0,96(sp) + 80020ce2: 02050513 addi a0,a0,32 + 80020ce6: e0aa sd a0,64(sp) + 80020ce8: 2ea13023 sd a0,736(sp) + 80020cec: a009 j 80020cee <.LBB1_80+0x2dc> + 80020cee: 6646 ld a2,80(sp) + 80020cf0: 65a6 ld a1,72(sp) + 80020cf2: 6506 ld a0,64(sp) + 80020cf4: 00000097 auipc ra,0x0 + 80020cf8: 8fc080e7 jalr -1796(ra) # 800205f0 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h8b37e8181b720bd0E> + 80020cfc: a009 j 80020cfe <.LBB1_80+0x2ec> + for i in 1..self.nsizes { + 80020cfe: b791 j 80020c42 <.LBB1_80+0x230> + cur = round_up(cur, leaf_size); + 80020d00: 75e6 ld a1,120(sp) + 80020d02: 7576 ld a0,376(sp) + 80020d04: ef2e sd a1,408(sp) + + // meta data lies between [base, cur) + let meta = self.mark_meta(cur); + 80020d06: 00001097 auipc ra,0x1 + 80020d0a: 8f4080e7 jalr -1804(ra) # 800215fa <_ZN9allocator11BuddySystem9mark_meta17h01c7ae17553a6764E> + 80020d0e: 85aa mv a1,a0 + 80020d10: fc2e sd a1,56(sp) + 80020d12: 2aa13c23 sd a0,696(sp) + 80020d16: a009 j 80020d18 <.LBB1_80+0x306> + + // unavailable data lies between [self.actual_end, 2^(self.nsizes-1)) + // due to the memory size of buddy system is a power of 2 + let unavail = self.mark_unavail(); + 80020d18: 7576 ld a0,376(sp) + 80020d1a: 00001097 auipc ra,0x1 + 80020d1e: 934080e7 jalr -1740(ra) # 8002164e <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E> + 80020d22: 85aa mv a1,a0 + 80020d24: f82e sd a1,48(sp) + 80020d26: 2ca13023 sd a0,704(sp) + 80020d2a: a009 j 80020d2c <.LBB1_80+0x31a> + + // init free regions + let free = self.init_free(cur); + 80020d2c: 7576 ld a0,376(sp) + 80020d2e: 65fa ld a1,408(sp) + 80020d30: 00001097 auipc ra,0x1 + 80020d34: bd0080e7 jalr -1072(ra) # 80021900 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E> + 80020d38: 85aa mv a1,a0 + 80020d3a: f42e sd a1,40(sp) + 80020d3c: 2ca13423 sd a0,712(sp) + 80020d40: a009 j 80020d42 <.LBB1_80+0x330> + + // check total memory + if free != self.blk_size(self.max_size()) - meta - unavail { + 80020d42: 7576 ld a0,376(sp) + 80020d44: 00001097 auipc ra,0x1 + 80020d48: e7a080e7 jalr -390(ra) # 80021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E> + 80020d4c: f02a sd a0,32(sp) + 80020d4e: a009 j 80020d50 <.LBB1_80+0x33e> + 80020d50: 7582 ld a1,32(sp) + 80020d52: 7576 ld a0,376(sp) + 80020d54: 00001097 auipc ra,0x1 + 80020d58: 140080e7 jalr 320(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80020d5c: ec2a sd a0,24(sp) + 80020d5e: a009 j 80020d60 <.LBB1_80+0x34e> + 80020d60: 6562 ld a0,24(sp) + 80020d62: 75e2 ld a1,56(sp) + 80020d64: 40b505b3 sub a1,a0,a1 + 80020d68: e82e sd a1,16(sp) + 80020d6a: 0eb56e63 bltu a0,a1,80020e66 <.LBB1_94> + 80020d6e: a009 j 80020d70 <.LBB1_80+0x35e> + 80020d70: 6542 ld a0,16(sp) + 80020d72: 75c2 ld a1,48(sp) + 80020d74: 40b505b3 sub a1,a0,a1 + 80020d78: e42e sd a1,8(sp) + 80020d7a: 10b56563 bltu a0,a1,80020e84 <.LBB1_96> + 80020d7e: a009 j 80020d80 <.LBB1_80+0x36e> + 80020d80: 7522 ld a0,40(sp) + 80020d82: 65a2 ld a1,8(sp) + 80020d84: 00b50c63 beq a0,a1,80020d9c <.LBB1_81+0x12> + 80020d88: a009 j 80020d8a <.LBB1_81> + +0000000080020d8a <.LBB1_81>: + return Err("allocator bug: tot != meta + free + unavail"); + 80020d8a: 0000c517 auipc a0,0xc + 80020d8e: 55e50513 addi a0,a0,1374 # 8002d2e8 <.L__unnamed_4> + 80020d92: e32a sd a0,384(sp) + 80020d94: 02b00513 li a0,43 + 80020d98: e72a sd a0,392(sp) +//! Thread-unsafe, panic-free buddy system allocator. + 80020d9a: a801 j 80020daa <.LBB1_81+0x20> + 80020d9c: 75f6 ld a1,376(sp) + 80020d9e: 4505 li a0,1 + } + + self.initialized = true; + 80020da0: 02a58c23 sb a0,56(a1) + 80020da4: 4501 li a0,0 + Ok(()) + 80020da6: e32a sd a0,384(sp) + } + 80020da8: a009 j 80020daa <.LBB1_81+0x20> + 80020daa: 651a ld a0,384(sp) + 80020dac: 65ba ld a1,392(sp) + 80020dae: 2e813083 ld ra,744(sp) + 80020db2: 2f010113 addi sp,sp,752 + 80020db6: 8082 ret + +0000000080020db8 <.LBB1_82>: + if end - start < leaf_size { + 80020db8: 0000c517 auipc a0,0xc + 80020dbc: 41850513 addi a0,a0,1048 # 8002d1d0 + +0000000080020dc0 <.LBB1_83>: + 80020dc0: 0000c617 auipc a2,0xc + 80020dc4: 3f860613 addi a2,a2,1016 # 8002d1b8 <.L__unnamed_5> + 80020dc8: 02100593 li a1,33 + 80020dcc: 00002097 auipc ra,0x2 + 80020dd0: 378080e7 jalr 888(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080020dd6 <.LBB1_84>: + self.nsizes = log2((self.actual_end-cur)/leaf_size) + 1; + 80020dd6: 0000c517 auipc a0,0xc + 80020dda: 3fa50513 addi a0,a0,1018 # 8002d1d0 + +0000000080020dde <.LBB1_85>: + 80020dde: 0000c617 auipc a2,0xc + 80020de2: 44a60613 addi a2,a2,1098 # 8002d228 <.L__unnamed_6> + 80020de6: 02100593 li a1,33 + 80020dea: 00002097 auipc ra,0x2 + 80020dee: 35a080e7 jalr 858(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080020df4 <.LBB1_86>: + 80020df4: 0000c517 auipc a0,0xc + 80020df8: 44c50513 addi a0,a0,1100 # 8002d240 + +0000000080020dfc <.LBB1_87>: + 80020dfc: 0000c617 auipc a2,0xc + 80020e00: 42c60613 addi a2,a2,1068 # 8002d228 <.L__unnamed_6> + 80020e04: 45e5 li a1,25 + 80020e06: 00002097 auipc ra,0x2 + 80020e0a: 33e080e7 jalr 830(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080020e10 <.LBB1_88>: + 80020e10: 0000c517 auipc a0,0xc + 80020e14: 47050513 addi a0,a0,1136 # 8002d280 + +0000000080020e18 <.LBB1_89>: + 80020e18: 0000c617 auipc a2,0xc + 80020e1c: 44860613 addi a2,a2,1096 # 8002d260 <.L__unnamed_7> + 80020e20: 45f1 li a1,28 + 80020e22: 00002097 auipc ra,0x2 + 80020e26: 322080e7 jalr 802(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080020e2c <.LBB1_90>: + if self.actual_end - cur > self.blk_size(self.max_size()) { + 80020e2c: 0000c517 auipc a0,0xc + 80020e30: 3a450513 addi a0,a0,932 # 8002d1d0 + +0000000080020e34 <.LBB1_91>: + 80020e34: 0000c617 auipc a2,0xc + 80020e38: 46c60613 addi a2,a2,1132 # 8002d2a0 <.L__unnamed_8> + 80020e3c: 02100593 li a1,33 + 80020e40: 00002097 auipc ra,0x2 + 80020e44: 304080e7 jalr 772(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080020e4a <.LBB1_92>: + self.nsizes += 1; + 80020e4a: 0000c517 auipc a0,0xc + 80020e4e: 43650513 addi a0,a0,1078 # 8002d280 + +0000000080020e52 <.LBB1_93>: + 80020e52: 0000c617 auipc a2,0xc + 80020e56: 46660613 addi a2,a2,1126 # 8002d2b8 <.L__unnamed_9> + 80020e5a: 45f1 li a1,28 + 80020e5c: 00002097 auipc ra,0x2 + 80020e60: 2e8080e7 jalr 744(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080020e66 <.LBB1_94>: + if free != self.blk_size(self.max_size()) - meta - unavail { + 80020e66: 0000c517 auipc a0,0xc + 80020e6a: 36a50513 addi a0,a0,874 # 8002d1d0 + +0000000080020e6e <.LBB1_95>: + 80020e6e: 0000c617 auipc a2,0xc + 80020e72: 46260613 addi a2,a2,1122 # 8002d2d0 <.L__unnamed_10> + 80020e76: 02100593 li a1,33 + 80020e7a: 00002097 auipc ra,0x2 + 80020e7e: 2ca080e7 jalr 714(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080020e84 <.LBB1_96>: + 80020e84: 0000c517 auipc a0,0xc + 80020e88: 34c50513 addi a0,a0,844 # 8002d1d0 + +0000000080020e8c <.LBB1_97>: + 80020e8c: 0000c617 auipc a2,0xc + 80020e90: 44460613 addi a2,a2,1092 # 8002d2d0 <.L__unnamed_10> + 80020e94: 02100593 li a1,33 + 80020e98: 00002097 auipc ra,0x2 + 80020e9c: 2ac080e7 jalr 684(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E: + +0000000080020ea2 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E>: + pub fn meta_info(&self) -> (bool, usize, usize, usize) { + (self.initialized, self.base, self.actual_end, self.nsizes) + } + + /// Allocate a block of memory satisifying the layout. + pub fn alloc(&mut self, layout: Layout) -> *mut u8 { + 80020ea2: 7149 addi sp,sp,-368 + 80020ea4: f686 sd ra,360(sp) + 80020ea6: e1aa sd a0,192(sp) + 80020ea8: e9ae sd a1,208(sp) + 80020eaa: edb2 sd a2,216(sp) + 80020eac: e62a sd a0,264(sp) + 80020eae: 0988 addi a0,sp,208 + if layout.size() == 0 { + 80020eb0: 00001097 auipc ra,0x1 + 80020eb4: 5b4080e7 jalr 1460(ra) # 80022464 <_ZN4core5alloc6layout6Layout4size17h7a38fec576bdd6a2E> + 80020eb8: e5aa sd a0,200(sp) + 80020eba: a009 j 80020ebc <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x1a> + 80020ebc: 652e ld a0,200(sp) + 80020ebe: 4581 li a1,0 + 80020ec0: 00b51663 bne a0,a1,80020ecc <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x2a> + 80020ec4: a009 j 80020ec6 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x24> + 80020ec6: 4501 li a0,0 + return ptr::null_mut(); + 80020ec8: f1aa sd a0,224(sp) + 80020eca: ac81 j 8002111a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x278> + 80020ecc: 0988 addi a0,sp,208 + } + + // only guarantee the alignment not bigger than max_alignment + if layout.align() > self.max_alignment { + 80020ece: 00001097 auipc ra,0x1 + 80020ed2: 5a0080e7 jalr 1440(ra) # 8002246e <_ZN4core5alloc6layout6Layout5align17habc8d2502287bfe5E> + 80020ed6: fd2a sd a0,184(sp) + 80020ed8: a009 j 80020eda <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x38> + 80020eda: 75ea ld a1,184(sp) + 80020edc: 650e ld a0,192(sp) + 80020ede: 7108 ld a0,32(a0) + 80020ee0: 00b57663 bgeu a0,a1,80020eec <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x4a> + 80020ee4: a009 j 80020ee6 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x44> + 80020ee6: 4501 li a0,0 + return ptr::null_mut(); + 80020ee8: f1aa sd a0,224(sp) + 80020eea: ac05 j 8002111a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x278> + 80020eec: 0988 addi a0,sp,208 + // note: the size of a value is always a multiple of its alignment + // now we only have to consider the size + // because base and actual_end are already align to max_alignment + + // find the smallest block can contain the size + let smalli = if layout.size() <= self.leaf_size { + 80020eee: 00001097 auipc ra,0x1 + 80020ef2: 576080e7 jalr 1398(ra) # 80022464 <_ZN4core5alloc6layout6Layout4size17h7a38fec576bdd6a2E> + 80020ef6: f92a sd a0,176(sp) + 80020ef8: a009 j 80020efa <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x58> + 80020efa: 75ca ld a1,176(sp) + 80020efc: 650e ld a0,192(sp) + 80020efe: 6d08 ld a0,24(a0) + 80020f00: 00b56663 bltu a0,a1,80020f0c <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x6a> + 80020f04: a009 j 80020f06 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x64> + 80020f06: 4501 li a0,0 + 0 + 80020f08: f5aa sd a0,232(sp) + let smalli = if layout.size() <= self.leaf_size { + 80020f0a: a0a9 j 80020f54 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xb2> + 80020f0c: 0988 addi a0,sp,208 + } else { + (layout.size().next_power_of_two() / self.leaf_size).trailing_zeros() as usize + 80020f0e: 00001097 auipc ra,0x1 + 80020f12: 556080e7 jalr 1366(ra) # 80022464 <_ZN4core5alloc6layout6Layout4size17h7a38fec576bdd6a2E> + 80020f16: f52a sd a0,168(sp) + 80020f18: a009 j 80020f1a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x78> + 80020f1a: 752a ld a0,168(sp) + 80020f1c: 00002097 auipc ra,0x2 + 80020f20: 998080e7 jalr -1640(ra) # 800228b4 <_ZN4core3num23_$LT$impl$u20$usize$GT$17next_power_of_two17h8eeaf87577f4331fE> + 80020f24: f12a sd a0,160(sp) + 80020f26: a009 j 80020f28 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x86> + 80020f28: 650e ld a0,192(sp) + 80020f2a: 6d08 ld a0,24(a0) + 80020f2c: ed2a sd a0,152(sp) + 80020f2e: 4581 li a1,0 + 80020f30: 1eb50963 beq a0,a1,80021122 <.LBB3_59> + 80020f34: a009 j 80020f36 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x94> + 80020f36: 750a ld a0,160(sp) + 80020f38: 65ea ld a1,152(sp) + 80020f3a: 02b55533 divu a0,a0,a1 + 80020f3e: 00002097 auipc ra,0x2 + 80020f42: 8b6080e7 jalr -1866(ra) # 800227f4 <_ZN4core3num23_$LT$impl$u20$usize$GT$14trailing_zeros17h26e4a056cb05b6fbE> + 80020f46: e92a sd a0,144(sp) + 80020f48: a009 j 80020f4a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xa8> + 80020f4a: 654a ld a0,144(sp) + 80020f4c: 1502 slli a0,a0,0x20 + 80020f4e: 9101 srli a0,a0,0x20 + 80020f50: f5aa sd a0,232(sp) + let smalli = if layout.size() <= self.leaf_size { + 80020f52: a009 j 80020f54 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xb2> + }; + let mut sizei = smalli; + 80020f54: 752e ld a0,232(sp) + 80020f56: f9aa sd a0,240(sp) + while sizei < self.nsizes { + 80020f58: a009 j 80020f5a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xb8> + 80020f5a: 658e ld a1,192(sp) + 80020f5c: 754e ld a0,240(sp) + 80020f5e: 698c ld a1,16(a1) + 80020f60: 00b56463 bltu a0,a1,80020f68 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xc6> + 80020f64: a009 j 80020f66 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xc4> + 80020f66: a83d j 80020fa4 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x102> + let info = unsafe { self.get_info_mut(sizei) }; + 80020f68: 650e ld a0,192(sp) + 80020f6a: 75ce ld a1,240(sp) + 80020f6c: 00001097 auipc ra,0x1 + 80020f70: bfa080e7 jalr -1030(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80020f74: e52a sd a0,136(sp) + 80020f76: a009 j 80020f78 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xd6> + 80020f78: 652a ld a0,136(sp) + 80020f7a: ea2a sd a0,272(sp) + if !info.free.is_empty() { + 80020f7c: 00001097 auipc ra,0x1 + 80020f80: 604080e7 jalr 1540(ra) # 80022580 <_ZN9allocator4list4List8is_empty17h2b5a11437d86acd9E> + 80020f84: e12a sd a0,128(sp) + 80020f86: a009 j 80020f88 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xe6> + 80020f88: 650a ld a0,128(sp) + 80020f8a: e119 bnez a0,80020f90 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xee> + 80020f8c: a009 j 80020f8e <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xec> +//! Thread-unsafe, panic-free buddy system allocator. + 80020f8e: a819 j 80020fa4 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x102> + break; + } + sizei += 1; + 80020f90: 75ce ld a1,240(sp) + 80020f92: 00158513 addi a0,a1,1 + 80020f96: fcaa sd a0,120(sp) + 80020f98: 1ab56363 bltu a0,a1,8002113e <.LBB3_61> + 80020f9c: a009 j 80020f9e <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xfc> + 80020f9e: 7566 ld a0,120(sp) + 80020fa0: f9aa sd a0,240(sp) + while sizei < self.nsizes { + 80020fa2: bf65 j 80020f5a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0xb8> + } + if sizei >= self.nsizes { + 80020fa4: 658e ld a1,192(sp) + 80020fa6: 754e ld a0,240(sp) + 80020fa8: 698c ld a1,16(a1) + 80020faa: 00b56663 bltu a0,a1,80020fb6 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x114> + 80020fae: a009 j 80020fb0 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x10e> + 80020fb0: 4501 li a0,0 + // no free memory + return ptr::null_mut() + 80020fb2: f1aa sd a0,224(sp) + 80020fb4: a29d j 8002111a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x278> + } + + // pop a block at self.infos[sizei] + let info = unsafe { self.get_info_mut(sizei) }; + 80020fb6: 650e ld a0,192(sp) + 80020fb8: 75ce ld a1,240(sp) + 80020fba: 00001097 auipc ra,0x1 + 80020fbe: bac080e7 jalr -1108(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80020fc2: f8aa sd a0,112(sp) + 80020fc4: a009 j 80020fc6 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x124> + 80020fc6: 7546 ld a0,112(sp) + 80020fc8: ee2a sd a0,280(sp) + let raw_addr = match unsafe { info.free.pop() } { + 80020fca: 00001097 auipc ra,0x1 + 80020fce: 530080e7 jalr 1328(ra) # 800224fa <_ZN9allocator4list4List3pop17h8165b98152b25881E> + 80020fd2: fdaa sd a0,248(sp) + 80020fd4: e22e sd a1,256(sp) + 80020fd6: a009 j 80020fd8 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x136> + Some(raw_addr) => raw_addr, + 80020fd8: 756e ld a0,248(sp) + 80020fda: 4581 li a1,0 + 80020fdc: 00b50463 beq a0,a1,80020fe4 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x142> + 80020fe0: a009 j 80020fe2 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x140> + 80020fe2: a029 j 80020fec <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x14a> + 80020fe4: 4501 li a0,0 + None => return ptr::null_mut(), + 80020fe6: f1aa sd a0,224(sp) + 80020fe8: aa0d j 8002111a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x278> + let raw_addr = match unsafe { info.free.pop() } { + 80020fea: 0000 unimp + Some(raw_addr) => raw_addr, + 80020fec: 650e ld a0,192(sp) + 80020fee: 6612 ld a2,256(sp) + 80020ff0: f0b2 sd a2,96(sp) + 80020ff2: f232 sd a2,288(sp) + 80020ff4: f632 sd a2,296(sp) + }; + let bi = self.blk_index(sizei, raw_addr); + 80020ff6: 75ce ld a1,240(sp) + 80020ff8: 00001097 auipc ra,0x1 + 80020ffc: c7c080e7 jalr -900(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 80021000: 85aa mv a1,a0 + 80021002: f4ae sd a1,104(sp) + 80021004: fa2a sd a0,304(sp) + 80021006: a009 j 80021008 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x166> + unsafe { self.get_info_mut(sizei).alloc_set(bi, true); } + 80021008: 650e ld a0,192(sp) + 8002100a: 75ce ld a1,240(sp) + 8002100c: 00001097 auipc ra,0x1 + 80021010: b5a080e7 jalr -1190(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80021014: ecaa sd a0,88(sp) + 80021016: a009 j 80021018 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x176> + 80021018: 75a6 ld a1,104(sp) + 8002101a: 6566 ld a0,88(sp) + 8002101c: 4605 li a2,1 + 8002101e: 00001097 auipc ra,0x1 + 80021022: 04a080e7 jalr 74(ra) # 80022068 <_ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E> + 80021026: a009 j 80021028 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x186> + + // split the block until it reach smallest block size + while sizei > smalli { + 80021028: a009 j 8002102a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x188> + 8002102a: 75ce ld a1,240(sp) + 8002102c: 752e ld a0,232(sp) + 8002102e: 00b56663 bltu a0,a1,8002103a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x198> + 80021032: a009 j 80021034 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x192> + unsafe { info1.free.push(buddy_addr); } + + sizei -= 1; + } + + raw_addr as *mut u8 + 80021034: 7506 ld a0,96(sp) + 80021036: f1aa sd a0,224(sp) + } + 80021038: a0cd j 8002111a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x278> + let bi = self.blk_index(sizei, raw_addr); + 8002103a: 7606 ld a2,96(sp) + 8002103c: 650e ld a0,192(sp) + 8002103e: 75ce ld a1,240(sp) + 80021040: 00001097 auipc ra,0x1 + 80021044: c34080e7 jalr -972(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 80021048: 85aa mv a1,a0 + 8002104a: e8ae sd a1,80(sp) + 8002104c: fe2a sd a0,312(sp) + 8002104e: a009 j 80021050 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x1ae> + let info = unsafe { self.get_info_mut(sizei) }; + 80021050: 650e ld a0,192(sp) + 80021052: 75ce ld a1,240(sp) + 80021054: 00001097 auipc ra,0x1 + 80021058: b12080e7 jalr -1262(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 8002105c: e4aa sd a0,72(sp) + 8002105e: a009 j 80021060 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x1be> + 80021060: 65c6 ld a1,80(sp) + 80021062: 6526 ld a0,72(sp) + 80021064: e2aa sd a0,320(sp) + 80021066: 4605 li a2,1 + info.split_set(bi, true); + 80021068: 00001097 auipc ra,0x1 + 8002106c: 044080e7 jalr 68(ra) # 800220ac <_ZN9allocator9BuddyInfo9split_set17hd9896ad2ca355490E> + 80021070: a009 j 80021072 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x1d0> + let bs1 = self.blk_size(sizei-1); + 80021072: 754e ld a0,240(sp) + 80021074: fff50593 addi a1,a0,-1 + 80021078: e0ae sd a1,64(sp) + 8002107a: 0eb56063 bltu a0,a1,8002115a <.LBB3_63> + 8002107e: a009 j 80021080 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x1de> + 80021080: 6586 ld a1,64(sp) + 80021082: 650e ld a0,192(sp) + 80021084: 00001097 auipc ra,0x1 + 80021088: e10080e7 jalr -496(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 8002108c: 85aa mv a1,a0 + 8002108e: fc2e sd a1,56(sp) + 80021090: e6aa sd a0,328(sp) + 80021092: a009 j 80021094 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x1f2> + let bi1 = self.blk_index(sizei-1, raw_addr); + 80021094: 754e ld a0,240(sp) + 80021096: fff50593 addi a1,a0,-1 + 8002109a: f82e sd a1,48(sp) + 8002109c: 0cb56e63 bltu a0,a1,80021178 <.LBB3_65> + 800210a0: a009 j 800210a2 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x200> + 800210a2: 7606 ld a2,96(sp) + 800210a4: 75c2 ld a1,48(sp) + 800210a6: 650e ld a0,192(sp) + 800210a8: 00001097 auipc ra,0x1 + 800210ac: bcc080e7 jalr -1076(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 800210b0: 85aa mv a1,a0 + 800210b2: f42e sd a1,40(sp) + 800210b4: eaaa sd a0,336(sp) + 800210b6: a009 j 800210b8 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x216> + let info1 = unsafe { self.get_info_mut(sizei-1) }; + 800210b8: 754e ld a0,240(sp) + 800210ba: fff50593 addi a1,a0,-1 + 800210be: f02e sd a1,32(sp) + 800210c0: 0cb56b63 bltu a0,a1,80021196 <.LBB3_67> + 800210c4: a009 j 800210c6 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x224> + 800210c6: 7582 ld a1,32(sp) + 800210c8: 650e ld a0,192(sp) + 800210ca: 00001097 auipc ra,0x1 + 800210ce: a9c080e7 jalr -1380(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 800210d2: ec2a sd a0,24(sp) + 800210d4: a009 j 800210d6 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x234> + 800210d6: 75a2 ld a1,40(sp) + 800210d8: 6562 ld a0,24(sp) + 800210da: eeaa sd a0,344(sp) + 800210dc: 4605 li a2,1 + info1.alloc_set(bi1, true); + 800210de: 00001097 auipc ra,0x1 + 800210e2: f8a080e7 jalr -118(ra) # 80022068 <_ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E> + 800210e6: a009 j 800210e8 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x246> + let buddy_addr = raw_addr + bs1; + 800210e8: 7586 ld a1,96(sp) + 800210ea: 7562 ld a0,56(sp) + 800210ec: 952e add a0,a0,a1 + 800210ee: e82a sd a0,16(sp) + 800210f0: 0cb56263 bltu a0,a1,800211b4 <.LBB3_69> + 800210f4: a009 j 800210f6 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x254> + 800210f6: 65c2 ld a1,16(sp) + 800210f8: 6562 ld a0,24(sp) + 800210fa: f2ae sd a1,352(sp) + unsafe { info1.free.push(buddy_addr); } + 800210fc: 00001097 auipc ra,0x1 + 80021100: 3a2080e7 jalr 930(ra) # 8002249e <_ZN9allocator4list4List4push17h00016bee64ea1dbdE> + 80021104: a009 j 80021106 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x264> + sizei -= 1; + 80021106: 754e ld a0,240(sp) + 80021108: fff50593 addi a1,a0,-1 + 8002110c: e42e sd a1,8(sp) + 8002110e: 0cb56163 bltu a0,a1,800211d0 <.LBB3_71> + 80021112: a009 j 80021114 <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x272> + 80021114: 6522 ld a0,8(sp) + 80021116: f9aa sd a0,240(sp) + while sizei > smalli { + 80021118: bf09 j 8002102a <_ZN9allocator11BuddySystem5alloc17hf1948e3b488fba43E+0x188> + } + 8002111a: 750e ld a0,224(sp) + 8002111c: 70b6 ld ra,360(sp) + 8002111e: 6175 addi sp,sp,368 + 80021120: 8082 ret + +0000000080021122 <.LBB3_59>: + (layout.size().next_power_of_two() / self.leaf_size).trailing_zeros() as usize + 80021122: 0000c517 auipc a0,0xc + 80021126: 11e50513 addi a0,a0,286 # 8002d240 + +000000008002112a <.LBB3_60>: + 8002112a: 0000c617 auipc a2,0xc + 8002112e: 1ee60613 addi a2,a2,494 # 8002d318 <.L__unnamed_11> + 80021132: 45e5 li a1,25 + 80021134: 00002097 auipc ra,0x2 + 80021138: 010080e7 jalr 16(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008002113e <.LBB3_61>: + sizei += 1; + 8002113e: 0000c517 auipc a0,0xc + 80021142: 14250513 addi a0,a0,322 # 8002d280 + +0000000080021146 <.LBB3_62>: + 80021146: 0000c617 auipc a2,0xc + 8002114a: 1ea60613 addi a2,a2,490 # 8002d330 <.L__unnamed_12> + 8002114e: 45f1 li a1,28 + 80021150: 00002097 auipc ra,0x2 + 80021154: ff4080e7 jalr -12(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +000000008002115a <.LBB3_63>: + let bs1 = self.blk_size(sizei-1); + 8002115a: 0000c517 auipc a0,0xc + 8002115e: 07650513 addi a0,a0,118 # 8002d1d0 + +0000000080021162 <.LBB3_64>: + 80021162: 0000c617 auipc a2,0xc + 80021166: 1e660613 addi a2,a2,486 # 8002d348 <.L__unnamed_13> + 8002116a: 02100593 li a1,33 + 8002116e: 00002097 auipc ra,0x2 + 80021172: fd6080e7 jalr -42(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021178 <.LBB3_65>: + let bi1 = self.blk_index(sizei-1, raw_addr); + 80021178: 0000c517 auipc a0,0xc + 8002117c: 05850513 addi a0,a0,88 # 8002d1d0 + +0000000080021180 <.LBB3_66>: + 80021180: 0000c617 auipc a2,0xc + 80021184: 1e060613 addi a2,a2,480 # 8002d360 <.L__unnamed_14> + 80021188: 02100593 li a1,33 + 8002118c: 00002097 auipc ra,0x2 + 80021190: fb8080e7 jalr -72(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021196 <.LBB3_67>: + let info1 = unsafe { self.get_info_mut(sizei-1) }; + 80021196: 0000c517 auipc a0,0xc + 8002119a: 03a50513 addi a0,a0,58 # 8002d1d0 + +000000008002119e <.LBB3_68>: + 8002119e: 0000c617 auipc a2,0xc + 800211a2: 1da60613 addi a2,a2,474 # 8002d378 <.L__unnamed_15> + 800211a6: 02100593 li a1,33 + 800211aa: 00002097 auipc ra,0x2 + 800211ae: f9a080e7 jalr -102(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800211b4 <.LBB3_69>: + let buddy_addr = raw_addr + bs1; + 800211b4: 0000c517 auipc a0,0xc + 800211b8: 0cc50513 addi a0,a0,204 # 8002d280 + +00000000800211bc <.LBB3_70>: + 800211bc: 0000c617 auipc a2,0xc + 800211c0: 1d460613 addi a2,a2,468 # 8002d390 <.L__unnamed_16> + 800211c4: 45f1 li a1,28 + 800211c6: 00002097 auipc ra,0x2 + 800211ca: f7e080e7 jalr -130(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800211d0 <.LBB3_71>: + sizei -= 1; + 800211d0: 0000c517 auipc a0,0xc + 800211d4: 00050513 mv a0,a0 + +00000000800211d8 <.LBB3_72>: + 800211d8: 0000c617 auipc a2,0xc + 800211dc: 1d060613 addi a2,a2,464 # 8002d3a8 <.L__unnamed_17> + 800211e0: 02100593 li a1,33 + 800211e4: 00002097 auipc ra,0x2 + 800211e8: f60080e7 jalr -160(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE: + +00000000800211ee <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE>: + + /// Deallocate the memory. + /// SAFETY: The raw ptr passed-in should be the one handed out previously. + pub fn dealloc(&mut self, ptr: *mut u8, layout: Layout) { + 800211ee: dc010113 addi sp,sp,-576 + 800211f2: 22113c23 sd ra,568(sp) + 800211f6: f9aa sd a0,240(sp) + 800211f8: fdb2 sd a2,248(sp) + 800211fa: e236 sd a3,256(sp) + 800211fc: e3aa sd a0,448(sp) + 800211fe: e7ae sd a1,456(sp) + // check ptr in range [self.base, self.actual_end) + let mut raw_addr = ptr as usize; + 80021200: e62e sd a1,264(sp) + #[cfg(debug_assertions)] + if raw_addr < self.base || raw_addr >= self.actual_end { + 80021202: 6108 ld a0,0(a0) + 80021204: 00a5fb63 bgeu a1,a0,8002121a <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE+0x2c> + 80021208: a009 j 8002120a <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE+0x1c> + 8002120a: 4505 li a0,1 + 8002120c: 10a10ba3 sb a0,279(sp) + 80021210: a819 j 80021226 <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE+0x38> + 80021212: 4501 li a0,0 + 80021214: 10a10ba3 sb a0,279(sp) + 80021218: a039 j 80021226 <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE+0x38> + 8002121a: 75ce ld a1,240(sp) + 8002121c: 6532 ld a0,264(sp) + 8002121e: 658c ld a1,8(a1) + 80021220: feb575e3 bgeu a0,a1,8002120a <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE+0x1c> + 80021224: b7fd j 80021212 <_ZN9allocator11BuddySystem7dealloc17hfe9c60ecf0af29ebE+0x24> + 80021226: 11714503 lbu a0,279(sp) + 8002122a: 8905 andi a0,a0,1 + 8002122c: 4581 li a1,0 + 8002122e: 02b50263 beq a0,a1,80021252 <.LBB4_68+0x16> + 80021232: a009 j 80021234 <.LBB4_67> + +0000000080021234 <.LBB4_67>: + panic!("allocator: dealloc ptr out of range"); + 80021234: 0000c517 auipc a0,0xc + 80021238: 18c50513 addi a0,a0,396 # 8002d3c0 <.L__unnamed_18> + +000000008002123c <.LBB4_68>: + 8002123c: 0000c617 auipc a2,0xc + 80021240: 1ac60613 addi a2,a2,428 # 8002d3e8 <.L__unnamed_19> + 80021244: 02300593 li a1,35 + 80021248: 00002097 auipc ra,0x2 + 8002124c: efc080e7 jalr -260(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80021250: 0000 unimp + } + + // find the size of block pointed by ptr + // and check with the layout + let mut sizei = self.nsizes; + 80021252: 754e ld a0,240(sp) + 80021254: 690c ld a1,16(a0) + 80021256: ee2e sd a1,280(sp) + for i in 0..self.max_size() { + 80021258: 00001097 auipc ra,0x1 + 8002125c: 966080e7 jalr -1690(ra) # 80021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E> + 80021260: f5aa sd a0,232(sp) + 80021262: a009 j 80021264 <.LBB4_68+0x28> + 80021264: 75ae ld a1,232(sp) + 80021266: 4501 li a0,0 + 80021268: f22a sd a0,288(sp) + 8002126a: f62e sd a1,296(sp) + 8002126c: fffff097 auipc ra,0xfffff + 80021270: 5a4080e7 jalr 1444(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80021274: edaa sd a0,216(sp) + 80021276: f1ae sd a1,224(sp) + 80021278: a009 j 8002127a <.LBB4_68+0x3e> + 8002127a: 750e ld a0,224(sp) + 8002127c: 65ee ld a1,216(sp) + 8002127e: fa2e sd a1,304(sp) + 80021280: fe2a sd a0,312(sp) + 80021282: a009 j 80021284 <.LBB4_68+0x48> + 80021284: 1a08 addi a0,sp,304 + 80021286: fffff097 auipc ra,0xfffff + 8002128a: 51c080e7 jalr 1308(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8002128e: e2aa sd a0,320(sp) + 80021290: e6ae sd a1,328(sp) + 80021292: a009 j 80021294 <.LBB4_68+0x58> + 80021294: 6516 ld a0,320(sp) + 80021296: 4581 li a1,0 + 80021298: 00b50463 beq a0,a1,800212a0 <.LBB4_68+0x64> + 8002129c: a009 j 8002129e <.LBB4_68+0x62> + 8002129e: a019 j 800212a4 <.LBB4_68+0x68> +//! Thread-unsafe, panic-free buddy system allocator. + 800212a0: a88d j 80021312 <.LBB4_68+0xd6> + for i in 0..self.max_size() { + 800212a2: 0000 unimp + 800212a4: 65b6 ld a1,328(sp) + 800212a6: e5ae sd a1,200(sp) + 800212a8: ebae sd a1,464(sp) + 800212aa: efae sd a1,472(sp) + 800212ac: f3ae sd a1,480(sp) + let bi = self.blk_index(i+1, raw_addr); + 800212ae: 00158513 addi a0,a1,1 + 800212b2: e9aa sd a0,208(sp) + 800212b4: 2ab56c63 bltu a0,a1,8002156c <.LBB4_76> + 800212b8: a009 j 800212ba <.LBB4_68+0x7e> + 800212ba: 65ce ld a1,208(sp) + 800212bc: 754e ld a0,240(sp) + 800212be: 6632 ld a2,264(sp) + 800212c0: 00001097 auipc ra,0x1 + 800212c4: 9b4080e7 jalr -1612(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 800212c8: 85aa mv a1,a0 + 800212ca: e1ae sd a1,192(sp) + 800212cc: f7aa sd a0,488(sp) + 800212ce: a009 j 800212d0 <.LBB4_68+0x94> + let info = unsafe { self.get_info_mut(i+1) }; + 800212d0: 65ae ld a1,200(sp) + 800212d2: 00158513 addi a0,a1,1 + 800212d6: fd2a sd a0,184(sp) + 800212d8: 2ab56863 bltu a0,a1,80021588 <.LBB4_78> + 800212dc: a009 j 800212de <.LBB4_68+0xa2> + 800212de: 75ea ld a1,184(sp) + 800212e0: 754e ld a0,240(sp) + 800212e2: 00001097 auipc ra,0x1 + 800212e6: 884080e7 jalr -1916(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 800212ea: f92a sd a0,176(sp) + 800212ec: a009 j 800212ee <.LBB4_68+0xb2> + 800212ee: 658e ld a1,192(sp) + 800212f0: 754a ld a0,176(sp) + 800212f2: fbaa sd a0,496(sp) + if info.is_split_set(bi) { + 800212f4: 00001097 auipc ra,0x1 + 800212f8: e36080e7 jalr -458(ra) # 8002212a <_ZN9allocator9BuddyInfo12is_split_set17hd9054b929d273b40E> + 800212fc: f52a sd a0,168(sp) + 800212fe: a009 j 80021300 <.LBB4_68+0xc4> + 80021300: 752a ld a0,168(sp) + 80021302: 4581 li a1,0 + 80021304: 00b50663 beq a0,a1,80021310 <.LBB4_68+0xd4> + 80021308: a009 j 8002130a <.LBB4_68+0xce> + sizei = i; + 8002130a: 652e ld a0,200(sp) + 8002130c: ee2a sd a0,280(sp) +//! Thread-unsafe, panic-free buddy system allocator. + 8002130e: a011 j 80021312 <.LBB4_68+0xd6> + for i in 0..self.max_size() { + 80021310: bf95 j 80021284 <.LBB4_68+0x48> + break; + } + } + #[cfg(debug_assertions)] + if sizei == self.nsizes { + 80021312: 75ce ld a1,240(sp) + 80021314: 6572 ld a0,280(sp) + 80021316: 698c ld a1,16(a1) + 80021318: 02b51263 bne a0,a1,8002133c <.LBB4_70+0x16> + 8002131c: a009 j 8002131e <.LBB4_69> + +000000008002131e <.LBB4_69>: + panic!("allocator: dealloc cannot recycle ptr"); + 8002131e: 0000c517 auipc a0,0xc + 80021322: 11250513 addi a0,a0,274 # 8002d430 <.L__unnamed_20> + +0000000080021326 <.LBB4_70>: + 80021326: 0000c617 auipc a2,0xc + 8002132a: 13260613 addi a2,a2,306 # 8002d458 <.L__unnamed_21> + 8002132e: 02500593 li a1,37 + 80021332: 00002097 auipc ra,0x2 + 80021336: e12080e7 jalr -494(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8002133a: 0000 unimp + 8002133c: 19a8 addi a0,sp,248 + } + + // check layout + #[cfg(debug_assertions)] + if layout.size() > self.blk_size(sizei) { + 8002133e: 00001097 auipc ra,0x1 + 80021342: 126080e7 jalr 294(ra) # 80022464 <_ZN4core5alloc6layout6Layout4size17h7a38fec576bdd6a2E> + 80021346: f12a sd a0,160(sp) + 80021348: a009 j 8002134a <.LBB4_70+0x24> + 8002134a: 754e ld a0,240(sp) + 8002134c: 65f2 ld a1,280(sp) + 8002134e: 00001097 auipc ra,0x1 + 80021352: b46080e7 jalr -1210(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80021356: ed2a sd a0,152(sp) + 80021358: a009 j 8002135a <.LBB4_70+0x34> + 8002135a: 656a ld a0,152(sp) + 8002135c: 758a ld a1,160(sp) + 8002135e: 00b57b63 bgeu a0,a1,80021374 <.LBB4_70+0x4e> + 80021362: a009 j 80021364 <.LBB4_70+0x3e> + panic!("allocator: layout {:?} > blk size {}", layout, self.blk_size(sizei)); + 80021364: 754e ld a0,240(sp) + 80021366: 65f2 ld a1,280(sp) + 80021368: 00001097 auipc ra,0x1 + 8002136c: b2c080e7 jalr -1236(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80021370: fb2a sd a0,432(sp) + 80021372: a011 j 80021376 <.LBB4_70+0x50> + } + + // free and coalesce + while sizei < self.max_size() { + 80021374: a8bd j 800213f2 <.LBB4_74+0x14> + 80021376: 19a8 addi a0,sp,248 + panic!("allocator: layout {:?} > blk size {}", layout, self.blk_size(sizei)); + 80021378: f32a sd a0,416(sp) + 8002137a: 1b0c addi a1,sp,432 + 8002137c: e12e sd a1,128(sp) + 8002137e: f72e sd a1,424(sp) + 80021380: ffaa sd a0,504(sp) + 80021382: 20b13023 sd a1,512(sp) + +0000000080021386 <.LBB4_71>: + 80021386: 00005597 auipc a1,0x5 + 8002138a: bb458593 addi a1,a1,-1100 # 80025f3a <_ZN64_$LT$core..alloc..layout..Layout$u20$as$u20$core..fmt..Debug$GT$3fmt17h791c624323e1e5daE> + 8002138e: fffff097 auipc ra,0xfffff + 80021392: 202080e7 jalr 514(ra) # 80020590 <_ZN4core3fmt10ArgumentV13new17hc2eeb6f5565b6dd2E> + 80021396: e52a sd a0,136(sp) + 80021398: e92e sd a1,144(sp) + 8002139a: a009 j 8002139c <.LBB4_71+0x16> + 8002139c: 650a ld a0,128(sp) + +000000008002139e <.LBB4_72>: + 8002139e: 00004597 auipc a1,0x4 + 800213a2: 50258593 addi a1,a1,1282 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800213a6: fffff097 auipc ra,0xfffff + 800213aa: 1c8080e7 jalr 456(ra) # 8002056e <_ZN4core3fmt10ArgumentV13new17hafe633af74a29011E> + 800213ae: f8aa sd a0,112(sp) + 800213b0: fcae sd a1,120(sp) + 800213b2: a009 j 800213b4 <.LBB4_72+0x16> + 800213b4: 7566 ld a0,120(sp) + 800213b6: 75c6 ld a1,112(sp) + 800213b8: 664a ld a2,144(sp) + 800213ba: 66aa ld a3,136(sp) + 800213bc: e336 sd a3,384(sp) + 800213be: e732 sd a2,392(sp) + 800213c0: eb2e sd a1,400(sp) + 800213c2: ef2a sd a0,408(sp) + +00000000800213c4 <.LBB4_73>: + 800213c4: 0000c597 auipc a1,0xc + 800213c8: 0cc58593 addi a1,a1,204 # 8002d490 <.L__unnamed_22> + 800213cc: 0a88 addi a0,sp,336 + 800213ce: 0314 addi a3,sp,384 + 800213d0: 4709 li a4,2 + 800213d2: 863a mv a2,a4 + 800213d4: 00001097 auipc ra,0x1 + 800213d8: 06e080e7 jalr 110(ra) # 80022442 <_ZN4core3fmt9Arguments6new_v117hf60bb287480e0058E> + 800213dc: a009 j 800213de <.LBB4_74> + +00000000800213de <.LBB4_74>: + 800213de: 0000c597 auipc a1,0xc + 800213e2: 0d258593 addi a1,a1,210 # 8002d4b0 <.L__unnamed_23> + 800213e6: 0a88 addi a0,sp,336 + 800213e8: 00002097 auipc ra,0x2 + 800213ec: dc8080e7 jalr -568(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + 800213f0: 0000 unimp + while sizei < self.max_size() { + 800213f2: 754e ld a0,240(sp) + 800213f4: 65f2 ld a1,280(sp) + 800213f6: f0ae sd a1,96(sp) + 800213f8: 00000097 auipc ra,0x0 + 800213fc: 7c6080e7 jalr 1990(ra) # 80021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E> + 80021400: f4aa sd a0,104(sp) + 80021402: a009 j 80021404 <.LBB4_74+0x26> + 80021404: 7506 ld a0,96(sp) + 80021406: 75a6 ld a1,104(sp) + 80021408: 00b56463 bltu a0,a1,80021410 <.LBB4_74+0x32> + 8002140c: a009 j 8002140e <.LBB4_74+0x30> + 8002140e: aa0d j 80021540 <.LBB4_75+0x80> + let bi = self.blk_index(sizei, raw_addr); + 80021410: 754e ld a0,240(sp) + 80021412: 65f2 ld a1,280(sp) + 80021414: 6632 ld a2,264(sp) + 80021416: 00001097 auipc ra,0x1 + 8002141a: 85e080e7 jalr -1954(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 8002141e: 85aa mv a1,a0 + 80021420: ecae sd a1,88(sp) + 80021422: 20a13423 sd a0,520(sp) + 80021426: a009 j 80021428 <.LBB4_74+0x4a> + let buddyi = if bi % 2 == 0 { bi+1 } else { bi-1 }; + 80021428: 6566 ld a0,88(sp) + 8002142a: 8905 andi a0,a0,1 + 8002142c: e909 bnez a0,8002143e <.LBB4_74+0x60> + 8002142e: a009 j 80021430 <.LBB4_74+0x52> + 80021430: 65e6 ld a1,88(sp) + 80021432: 00158513 addi a0,a1,1 + 80021436: e8aa sd a0,80(sp) + 80021438: 18b56563 bltu a0,a1,800215c2 <.LBB4_82> + 8002143c: a801 j 8002144c <.LBB4_74+0x6e> + 8002143e: 6566 ld a0,88(sp) + 80021440: fff50593 addi a1,a0,-1 + 80021444: e4ae sd a1,72(sp) + 80021446: 14b56f63 bltu a0,a1,800215a4 <.LBB4_80> + 8002144a: a021 j 80021452 <.LBB4_74+0x74> + 8002144c: 6546 ld a0,80(sp) + 8002144e: ff2a sd a0,440(sp) + 80021450: a021 j 80021458 <.LBB4_74+0x7a> + 80021452: 6526 ld a0,72(sp) + 80021454: ff2a sd a0,440(sp) + 80021456: a009 j 80021458 <.LBB4_74+0x7a> + let info = unsafe { self.get_info_mut(sizei) }; + 80021458: 754e ld a0,240(sp) + 8002145a: 65f2 ld a1,280(sp) + 8002145c: 00000097 auipc ra,0x0 + 80021460: 70a080e7 jalr 1802(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80021464: e0aa sd a0,64(sp) + 80021466: a009 j 80021468 <.LBB4_74+0x8a> + 80021468: 65e6 ld a1,88(sp) + 8002146a: 6506 ld a0,64(sp) + 8002146c: 20a13823 sd a0,528(sp) + 80021470: 4601 li a2,0 + info.alloc_set(bi, false); + 80021472: 00001097 auipc ra,0x1 + 80021476: bf6080e7 jalr -1034(ra) # 80022068 <_ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E> + 8002147a: a009 j 8002147c <.LBB4_74+0x9e> + + // test if buddy is free + if info.is_alloc_set(buddyi) { + 8002147c: 6506 ld a0,64(sp) + 8002147e: 75fa ld a1,440(sp) + 80021480: 00001097 auipc ra,0x1 + 80021484: c70080e7 jalr -912(ra) # 800220f0 <_ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E> + 80021488: fc2a sd a0,56(sp) + 8002148a: a009 j 8002148c <.LBB4_74+0xae> + 8002148c: 7562 ld a0,56(sp) + 8002148e: 4581 li a1,0 + 80021490: 00b50463 beq a0,a1,80021498 <.LBB4_74+0xba> + 80021494: a009 j 80021496 <.LBB4_74+0xb8> +//! Thread-unsafe, panic-free buddy system allocator. + 80021496: a06d j 80021540 <.LBB4_75+0x80> + break; + } + let buddy_addr = self.blk_addr(sizei, buddyi); + 80021498: 754e ld a0,240(sp) + 8002149a: 65f2 ld a1,280(sp) + 8002149c: 767a ld a2,440(sp) + 8002149e: 00001097 auipc ra,0x1 + 800214a2: 974080e7 jalr -1676(ra) # 80021e12 <_ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE> + 800214a6: 85aa mv a1,a0 + 800214a8: f82e sd a1,48(sp) + 800214aa: 20a13c23 sd a0,536(sp) + 800214ae: a009 j 800214b0 <.LBB4_74+0xd2> + unsafe { (buddy_addr as *mut List).as_mut().unwrap().remove(); } + 800214b0: 7542 ld a0,48(sp) + 800214b2: 00002097 auipc ra,0x2 + 800214b6: 886080e7 jalr -1914(ra) # 80022d38 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE> + 800214ba: f42a sd a0,40(sp) + 800214bc: a009 j 800214be <.LBB4_74+0xe0> + 800214be: 7522 ld a0,40(sp) + +00000000800214c0 <.LBB4_75>: + 800214c0: 0000c597 auipc a1,0xc + 800214c4: 03858593 addi a1,a1,56 # 8002d4f8 <.L__unnamed_24> + 800214c8: 00001097 auipc ra,0x1 + 800214cc: 0d6080e7 jalr 214(ra) # 8002259e <_ZN4core6option15Option$LT$T$GT$6unwrap17h92f45fda96995230E> + 800214d0: f02a sd a0,32(sp) + 800214d2: a009 j 800214d4 <.LBB4_75+0x14> + 800214d4: 7502 ld a0,32(sp) + 800214d6: 00001097 auipc ra,0x1 + 800214da: 094080e7 jalr 148(ra) # 8002256a <_ZN9allocator4list4List6remove17hdaf9d5be7333b4ddE> + 800214de: a009 j 800214e0 <.LBB4_75+0x20> + if buddyi % 2 == 0 { + 800214e0: 1b814503 lbu a0,440(sp) + 800214e4: 8905 andi a0,a0,1 + 800214e6: e509 bnez a0,800214f0 <.LBB4_75+0x30> + 800214e8: a009 j 800214ea <.LBB4_75+0x2a> + raw_addr = buddy_addr; + 800214ea: 7542 ld a0,48(sp) + 800214ec: e62a sd a0,264(sp) + if buddyi % 2 == 0 { + 800214ee: a011 j 800214f2 <.LBB4_75+0x32> + 800214f0: a009 j 800214f2 <.LBB4_75+0x32> + } + + // coalesce and continue + sizei += 1; + 800214f2: 65f2 ld a1,280(sp) + 800214f4: 00158513 addi a0,a1,1 + 800214f8: ec2a sd a0,24(sp) + 800214fa: 0eb56263 bltu a0,a1,800215de <.LBB4_84> + 800214fe: a009 j 80021500 <.LBB4_75+0x40> + 80021500: 65e2 ld a1,24(sp) + 80021502: 754e ld a0,240(sp) + 80021504: ee2e sd a1,280(sp) + let spliti = self.blk_index(sizei, raw_addr); + 80021506: 6632 ld a2,264(sp) + 80021508: 00000097 auipc ra,0x0 + 8002150c: 76c080e7 jalr 1900(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 80021510: 85aa mv a1,a0 + 80021512: e82e sd a1,16(sp) + 80021514: 22a13023 sd a0,544(sp) + 80021518: a009 j 8002151a <.LBB4_75+0x5a> + let info = unsafe { self.get_info_mut(sizei) }; + 8002151a: 754e ld a0,240(sp) + 8002151c: 65f2 ld a1,280(sp) + 8002151e: 00000097 auipc ra,0x0 + 80021522: 648080e7 jalr 1608(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80021526: e42a sd a0,8(sp) + 80021528: a009 j 8002152a <.LBB4_75+0x6a> + 8002152a: 65c2 ld a1,16(sp) + 8002152c: 6522 ld a0,8(sp) + 8002152e: 22a13423 sd a0,552(sp) + 80021532: 4601 li a2,0 + info.split_set(spliti, false); + 80021534: 00001097 auipc ra,0x1 + 80021538: b78080e7 jalr -1160(ra) # 800220ac <_ZN9allocator9BuddyInfo9split_set17hd9896ad2ca355490E> + 8002153c: a009 j 8002153e <.LBB4_75+0x7e> + while sizei < self.max_size() { + 8002153e: bd55 j 800213f2 <.LBB4_74+0x14> + } + + let info = unsafe { self.get_info_mut(sizei) }; + 80021540: 754e ld a0,240(sp) + 80021542: 65f2 ld a1,280(sp) + 80021544: 00000097 auipc ra,0x0 + 80021548: 622080e7 jalr 1570(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 8002154c: e02a sd a0,0(sp) + 8002154e: a009 j 80021550 <.LBB4_75+0x90> + 80021550: 6502 ld a0,0(sp) + 80021552: 22a13823 sd a0,560(sp) + unsafe { info.free.push(raw_addr); } + 80021556: 65b2 ld a1,264(sp) + 80021558: 00001097 auipc ra,0x1 + 8002155c: f46080e7 jalr -186(ra) # 8002249e <_ZN9allocator4list4List4push17h00016bee64ea1dbdE> + 80021560: a009 j 80021562 <.LBB4_75+0xa2> + } + 80021562: 23813083 ld ra,568(sp) + 80021566: 24010113 addi sp,sp,576 + 8002156a: 8082 ret + +000000008002156c <.LBB4_76>: + let bi = self.blk_index(i+1, raw_addr); + 8002156c: 0000c517 auipc a0,0xc + 80021570: d1450513 addi a0,a0,-748 # 8002d280 + +0000000080021574 <.LBB4_77>: + 80021574: 0000c617 auipc a2,0xc + 80021578: e8c60613 addi a2,a2,-372 # 8002d400 <.L__unnamed_25> + 8002157c: 45f1 li a1,28 + 8002157e: 00002097 auipc ra,0x2 + 80021582: bc6080e7 jalr -1082(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021588 <.LBB4_78>: + let info = unsafe { self.get_info_mut(i+1) }; + 80021588: 0000c517 auipc a0,0xc + 8002158c: cf850513 addi a0,a0,-776 # 8002d280 + +0000000080021590 <.LBB4_79>: + 80021590: 0000c617 auipc a2,0xc + 80021594: e8860613 addi a2,a2,-376 # 8002d418 <.L__unnamed_26> + 80021598: 45f1 li a1,28 + 8002159a: 00002097 auipc ra,0x2 + 8002159e: baa080e7 jalr -1110(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800215a4 <.LBB4_80>: + let buddyi = if bi % 2 == 0 { bi+1 } else { bi-1 }; + 800215a4: 0000c517 auipc a0,0xc + 800215a8: c2c50513 addi a0,a0,-980 # 8002d1d0 + +00000000800215ac <.LBB4_81>: + 800215ac: 0000c617 auipc a2,0xc + 800215b0: f1c60613 addi a2,a2,-228 # 8002d4c8 <.L__unnamed_27> + 800215b4: 02100593 li a1,33 + 800215b8: 00002097 auipc ra,0x2 + 800215bc: b8c080e7 jalr -1140(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800215c2 <.LBB4_82>: + 800215c2: 0000c517 auipc a0,0xc + 800215c6: cbe50513 addi a0,a0,-834 # 8002d280 + +00000000800215ca <.LBB4_83>: + 800215ca: 0000c617 auipc a2,0xc + 800215ce: f1660613 addi a2,a2,-234 # 8002d4e0 <.L__unnamed_28> + 800215d2: 45f1 li a1,28 + 800215d4: 00002097 auipc ra,0x2 + 800215d8: b70080e7 jalr -1168(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800215de <.LBB4_84>: + sizei += 1; + 800215de: 0000c517 auipc a0,0xc + 800215e2: ca250513 addi a0,a0,-862 # 8002d280 + +00000000800215e6 <.LBB4_85>: + 800215e6: 0000c617 auipc a2,0xc + 800215ea: f2a60613 addi a2,a2,-214 # 8002d510 <.L__unnamed_29> + 800215ee: 45f1 li a1,28 + 800215f0: 00002097 auipc ra,0x2 + 800215f4: b54080e7 jalr -1196(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem9mark_meta17h01c7ae17553a6764E: + +00000000800215fa <_ZN9allocator11BuddySystem9mark_meta17h01c7ae17553a6764E>: + + /// Mark meta data of buddy system as used. + /// [self.base, cur) + fn mark_meta(&mut self, cur: usize) -> usize { + 800215fa: 7139 addi sp,sp,-64 + 800215fc: fc06 sd ra,56(sp) + 800215fe: e42e sd a1,8(sp) + 80021600: e82a sd a0,16(sp) + 80021602: f02a sd a0,32(sp) + 80021604: f42e sd a1,40(sp) + let meta = cur - self.base; + 80021606: 6108 ld a0,0(a0) + 80021608: 40a58533 sub a0,a1,a0 + 8002160c: ec2a sd a0,24(sp) + 8002160e: 02a5e163 bltu a1,a0,80021630 <.LBB5_4> + 80021612: a009 j 80021614 <_ZN9allocator11BuddySystem9mark_meta17h01c7ae17553a6764E+0x1a> + 80021614: 6622 ld a2,8(sp) + 80021616: 6542 ld a0,16(sp) + 80021618: 65e2 ld a1,24(sp) + 8002161a: f82e sd a1,48(sp) + self.mark(self.base, cur); + 8002161c: 610c ld a1,0(a0) + 8002161e: 00000097 auipc ra,0x0 + 80021622: 0fa080e7 jalr 250(ra) # 80021718 <_ZN9allocator11BuddySystem4mark17h082e3ed5a4c299caE> + 80021626: a009 j 80021628 <_ZN9allocator11BuddySystem9mark_meta17h01c7ae17553a6764E+0x2e> + meta + } + 80021628: 6562 ld a0,24(sp) + 8002162a: 70e2 ld ra,56(sp) + 8002162c: 6121 addi sp,sp,64 + 8002162e: 8082 ret + +0000000080021630 <.LBB5_4>: + let meta = cur - self.base; + 80021630: 0000c517 auipc a0,0xc + 80021634: ba050513 addi a0,a0,-1120 # 8002d1d0 + +0000000080021638 <.LBB5_5>: + 80021638: 0000c617 auipc a2,0xc + 8002163c: ef060613 addi a2,a2,-272 # 8002d528 <.L__unnamed_30> + 80021640: 02100593 li a1,33 + 80021644: 00002097 auipc ra,0x2 + 80021648: b00080e7 jalr -1280(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E: + +000000008002164e <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E>: + + /// Mark unavailable data due to the requirement, + /// that the size of buddy system should be a power of 2. + fn mark_unavail(&mut self) -> usize { + 8002164e: 715d addi sp,sp,-80 + 80021650: e486 sd ra,72(sp) + 80021652: f42a sd a0,40(sp) + 80021654: fc2a sd a0,56(sp) + let unavail = self.blk_size(self.max_size()) - (self.actual_end - self.base); + 80021656: 00000097 auipc ra,0x0 + 8002165a: 568080e7 jalr 1384(ra) # 80021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E> + 8002165e: f82a sd a0,48(sp) + 80021660: a009 j 80021662 <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E+0x14> + 80021662: 75c2 ld a1,48(sp) + 80021664: 7522 ld a0,40(sp) + 80021666: 00001097 auipc ra,0x1 + 8002166a: 82e080e7 jalr -2002(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 8002166e: f02a sd a0,32(sp) + 80021670: a009 j 80021672 <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E+0x24> + 80021672: 75a2 ld a1,40(sp) + 80021674: 6588 ld a0,8(a1) + 80021676: 618c ld a1,0(a1) + 80021678: 40b505b3 sub a1,a0,a1 + 8002167c: ec2e sd a1,24(sp) + 8002167e: 04b56163 bltu a0,a1,800216c0 <.LBB6_10> + 80021682: a009 j 80021684 <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E+0x36> + 80021684: 7502 ld a0,32(sp) + 80021686: 65e2 ld a1,24(sp) + 80021688: 40b505b3 sub a1,a0,a1 + 8002168c: e82e sd a1,16(sp) + 8002168e: 04b56863 bltu a0,a1,800216de <.LBB6_12> + 80021692: a009 j 80021694 <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E+0x46> + 80021694: 6542 ld a0,16(sp) + 80021696: 75a2 ld a1,40(sp) + 80021698: e0aa sd a0,64(sp) + self.mark(self.actual_end, self.actual_end + unavail); + 8002169a: 658c ld a1,8(a1) + 8002169c: e02e sd a1,0(sp) + 8002169e: 952e add a0,a0,a1 + 800216a0: e42a sd a0,8(sp) + 800216a2: 04b56d63 bltu a0,a1,800216fc <.LBB6_14> + 800216a6: a009 j 800216a8 <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E+0x5a> + 800216a8: 6622 ld a2,8(sp) + 800216aa: 6582 ld a1,0(sp) + 800216ac: 7522 ld a0,40(sp) + 800216ae: 00000097 auipc ra,0x0 + 800216b2: 06a080e7 jalr 106(ra) # 80021718 <_ZN9allocator11BuddySystem4mark17h082e3ed5a4c299caE> + 800216b6: a009 j 800216b8 <_ZN9allocator11BuddySystem12mark_unavail17h19653a018281c6a8E+0x6a> + unavail + } + 800216b8: 6542 ld a0,16(sp) + 800216ba: 60a6 ld ra,72(sp) + 800216bc: 6161 addi sp,sp,80 + 800216be: 8082 ret + +00000000800216c0 <.LBB6_10>: + let unavail = self.blk_size(self.max_size()) - (self.actual_end - self.base); + 800216c0: 0000c517 auipc a0,0xc + 800216c4: b1050513 addi a0,a0,-1264 # 8002d1d0 + +00000000800216c8 <.LBB6_11>: + 800216c8: 0000c617 auipc a2,0xc + 800216cc: e7860613 addi a2,a2,-392 # 8002d540 <.L__unnamed_31> + 800216d0: 02100593 li a1,33 + 800216d4: 00002097 auipc ra,0x2 + 800216d8: a70080e7 jalr -1424(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800216de <.LBB6_12>: + 800216de: 0000c517 auipc a0,0xc + 800216e2: af250513 addi a0,a0,-1294 # 8002d1d0 + +00000000800216e6 <.LBB6_13>: + 800216e6: 0000c617 auipc a2,0xc + 800216ea: e7260613 addi a2,a2,-398 # 8002d558 <.L__unnamed_32> + 800216ee: 02100593 li a1,33 + 800216f2: 00002097 auipc ra,0x2 + 800216f6: a52080e7 jalr -1454(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800216fc <.LBB6_14>: + self.mark(self.actual_end, self.actual_end + unavail); + 800216fc: 0000c517 auipc a0,0xc + 80021700: b8450513 addi a0,a0,-1148 # 8002d280 + +0000000080021704 <.LBB6_15>: + 80021704: 0000c617 auipc a2,0xc + 80021708: e6c60613 addi a2,a2,-404 # 8002d570 <.L__unnamed_33> + 8002170c: 45f1 li a1,28 + 8002170e: 00002097 auipc ra,0x2 + 80021712: a36080e7 jalr -1482(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem4mark17h082e3ed5a4c299caE: + +0000000080021718 <_ZN9allocator11BuddySystem4mark17h082e3ed5a4c299caE>: + + /// Mark memory from [left, right) as allocated. + /// Useful for meta and unavailable data. + fn mark(&mut self, left: usize, right: usize) { + 80021718: 7121 addi sp,sp,-448 + 8002171a: ff06 sd ra,440(sp) + 8002171c: f0b2 sd a2,96(sp) + 8002171e: f4ae sd a1,104(sp) + 80021720: f8aa sd a0,112(sp) + 80021722: eeaa sd a0,344(sp) + 80021724: f2ae sd a1,352(sp) + 80021726: f6b2 sd a2,360(sp) + debug_assert_eq!(left % self.leaf_size, 0); + 80021728: 6d08 ld a0,24(a0) + 8002172a: fcaa sd a0,120(sp) + 8002172c: 4581 li a1,0 + 8002172e: 16b50d63 beq a0,a1,800218a8 <.LBB7_32> + 80021732: a009 j 80021734 <_ZN9allocator11BuddySystem4mark17h082e3ed5a4c299caE+0x1c> + 80021734: 7526 ld a0,104(sp) + 80021736: 75e6 ld a1,120(sp) + 80021738: 02b57533 remu a0,a0,a1 + 8002173c: e92a sd a0,144(sp) + 8002173e: 0910 addi a2,sp,144 + 80021740: e8b2 sd a2,80(sp) + 80021742: e132 sd a2,128(sp) + +0000000080021744 <.LBB7_28>: + 80021744: 00006597 auipc a1,0x6 + 80021748: 11458593 addi a1,a1,276 # 80027858 <.L__unnamed_6+0xc8> + 8002174c: ecae sd a1,88(sp) + 8002174e: e52e sd a1,136(sp) + 80021750: fab2 sd a2,368(sp) + 80021752: feae sd a1,376(sp) + 80021754: 4581 li a1,0 + 80021756: 02b50363 beq a0,a1,8002177c <.LBB7_29+0x14> + 8002175a: a009 j 8002175c <.LBB7_28+0x18> + 8002175c: 6666 ld a2,88(sp) + 8002175e: 65c6 ld a1,80(sp) + 80021760: 4501 li a0,0 + 80021762: 08a10fa3 sb a0,159(sp) + 80021766: f12a sd a0,160(sp) + +0000000080021768 <.LBB7_29>: + 80021768: 0000c717 auipc a4,0xc + 8002176c: e7870713 addi a4,a4,-392 # 8002d5e0 <.L__unnamed_35> + 80021770: 1114 addi a3,sp,160 + 80021772: fffff097 auipc ra,0xfffff + 80021776: 100080e7 jalr 256(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 8002177a: 0000 unimp + debug_assert_eq!(right % self.leaf_size, 0); + 8002177c: 7546 ld a0,112(sp) + 8002177e: 6d08 ld a0,24(a0) + 80021780: e4aa sd a0,72(sp) + 80021782: 4581 li a1,0 + 80021784: 14b50163 beq a0,a1,800218c6 <.LBB7_34> + 80021788: a009 j 8002178a <.LBB7_29+0x22> + 8002178a: 7506 ld a0,96(sp) + 8002178c: 65a6 ld a1,72(sp) + 8002178e: 02b57533 remu a0,a0,a1 + 80021792: f1aa sd a0,224(sp) + 80021794: 1190 addi a2,sp,224 + 80021796: fc32 sd a2,56(sp) + 80021798: e9b2 sd a2,208(sp) + +000000008002179a <.LBB7_30>: + 8002179a: 00006597 auipc a1,0x6 + 8002179e: 0be58593 addi a1,a1,190 # 80027858 <.L__unnamed_6+0xc8> + 800217a2: e0ae sd a1,64(sp) + 800217a4: edae sd a1,216(sp) + 800217a6: e332 sd a2,384(sp) + 800217a8: e72e sd a1,392(sp) + 800217aa: 4581 li a1,0 + 800217ac: 02b50363 beq a0,a1,800217d2 <.LBB7_31+0x14> + 800217b0: a009 j 800217b2 <.LBB7_30+0x18> + 800217b2: 6606 ld a2,64(sp) + 800217b4: 75e2 ld a1,56(sp) + 800217b6: 4501 li a0,0 + 800217b8: 0ea107a3 sb a0,239(sp) + 800217bc: f9aa sd a0,240(sp) + +00000000800217be <.LBB7_31>: + 800217be: 0000c717 auipc a4,0xc + 800217c2: e5270713 addi a4,a4,-430 # 8002d610 <.L__unnamed_36> + 800217c6: 1994 addi a3,sp,240 + 800217c8: fffff097 auipc ra,0xfffff + 800217cc: 0aa080e7 jalr 170(ra) # 80020872 <_ZN4core9panicking13assert_failed17h4e6d74c9d534b647E> + 800217d0: 0000 unimp + + for i in 0..self.nsizes { + 800217d2: 7546 ld a0,112(sp) + 800217d4: 690c ld a1,16(a0) + 800217d6: 4501 li a0,0 + 800217d8: f22a sd a0,288(sp) + 800217da: f62e sd a1,296(sp) + 800217dc: fffff097 auipc ra,0xfffff + 800217e0: 034080e7 jalr 52(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 800217e4: f42a sd a0,40(sp) + 800217e6: f82e sd a1,48(sp) + 800217e8: a009 j 800217ea <.LBB7_31+0x2c> + 800217ea: 7542 ld a0,48(sp) + 800217ec: 75a2 ld a1,40(sp) + 800217ee: fa2e sd a1,304(sp) + 800217f0: fe2a sd a0,312(sp) + 800217f2: a009 j 800217f4 <.LBB7_31+0x36> + 800217f4: 1a08 addi a0,sp,304 + 800217f6: fffff097 auipc ra,0xfffff + 800217fa: fac080e7 jalr -84(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 800217fe: e2aa sd a0,320(sp) + 80021800: e6ae sd a1,328(sp) + 80021802: a009 j 80021804 <.LBB7_31+0x46> + 80021804: 6516 ld a0,320(sp) + 80021806: 4581 li a1,0 + 80021808: 00b50463 beq a0,a1,80021810 <.LBB7_31+0x52> + 8002180c: a009 j 8002180e <.LBB7_31+0x50> + 8002180e: a029 j 80021818 <.LBB7_31+0x5a> + info.split_set(bi, true); + } + bi += 1; + } + } + } + 80021810: 70fa ld ra,440(sp) + 80021812: 6139 addi sp,sp,448 + 80021814: 8082 ret + for i in 0..self.nsizes { + 80021816: 0000 unimp + 80021818: 7626 ld a2,104(sp) + 8002181a: 7546 ld a0,112(sp) + 8002181c: 65b6 ld a1,328(sp) + 8002181e: f02e sd a1,32(sp) + 80021820: eb2e sd a1,400(sp) + 80021822: ef2e sd a1,408(sp) + 80021824: f32e sd a1,416(sp) + let mut bi = self.blk_index(i, left); + 80021826: 00000097 auipc ra,0x0 + 8002182a: 44e080e7 jalr 1102(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 8002182e: eaaa sd a0,336(sp) + 80021830: a009 j 80021832 <.LBB7_31+0x74> + let bj = self.blk_index_next(i, right); + 80021832: 7606 ld a2,96(sp) + 80021834: 7582 ld a1,32(sp) + 80021836: 7546 ld a0,112(sp) + 80021838: 00000097 auipc ra,0x0 + 8002183c: 4ba080e7 jalr 1210(ra) # 80021cf2 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE> + 80021840: 85aa mv a1,a0 + 80021842: ec2e sd a1,24(sp) + 80021844: f72a sd a0,424(sp) + 80021846: a009 j 80021848 <.LBB7_31+0x8a> + while bi < bj { + 80021848: 65e2 ld a1,24(sp) + 8002184a: 6556 ld a0,336(sp) + 8002184c: 00b56463 bltu a0,a1,80021854 <.LBB7_31+0x96> + 80021850: a009 j 80021852 <.LBB7_31+0x94> + for i in 0..self.nsizes { + 80021852: b74d j 800217f4 <.LBB7_31+0x36> + let info = unsafe { self.get_info_mut(i) }; + 80021854: 7582 ld a1,32(sp) + 80021856: 7546 ld a0,112(sp) + 80021858: 00000097 auipc ra,0x0 + 8002185c: 30e080e7 jalr 782(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80021860: e82a sd a0,16(sp) + 80021862: a009 j 80021864 <.LBB7_31+0xa6> + 80021864: 6542 ld a0,16(sp) + 80021866: fb2a sd a0,432(sp) + info.alloc_set(bi, true); + 80021868: 65d6 ld a1,336(sp) + 8002186a: 4605 li a2,1 + 8002186c: 00000097 auipc ra,0x0 + 80021870: 7fc080e7 jalr 2044(ra) # 80022068 <_ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E> + 80021874: a009 j 80021876 <.LBB7_31+0xb8> + 80021876: 7502 ld a0,32(sp) + 80021878: 4581 li a1,0 + if i > 0 { + 8002187a: 00b50b63 beq a0,a1,80021890 <.LBB7_31+0xd2> + 8002187e: a009 j 80021880 <.LBB7_31+0xc2> + info.split_set(bi, true); + 80021880: 6542 ld a0,16(sp) + 80021882: 65d6 ld a1,336(sp) + 80021884: 4605 li a2,1 + 80021886: 00001097 auipc ra,0x1 + 8002188a: 826080e7 jalr -2010(ra) # 800220ac <_ZN9allocator9BuddyInfo9split_set17hd9896ad2ca355490E> + 8002188e: a011 j 80021892 <.LBB7_31+0xd4> + if i > 0 { + 80021890: a011 j 80021894 <.LBB7_31+0xd6> + 80021892: a009 j 80021894 <.LBB7_31+0xd6> + bi += 1; + 80021894: 65d6 ld a1,336(sp) + 80021896: 00158513 addi a0,a1,1 + 8002189a: e42a sd a0,8(sp) + 8002189c: 04b56463 bltu a0,a1,800218e4 <.LBB7_36> + 800218a0: a009 j 800218a2 <.LBB7_31+0xe4> + 800218a2: 6522 ld a0,8(sp) + 800218a4: eaaa sd a0,336(sp) + while bi < bj { + 800218a6: b74d j 80021848 <.LBB7_31+0x8a> + +00000000800218a8 <.LBB7_32>: + debug_assert_eq!(left % self.leaf_size, 0); + 800218a8: 0000c517 auipc a0,0xc + 800218ac: cf850513 addi a0,a0,-776 # 8002d5a0 + +00000000800218b0 <.LBB7_33>: + 800218b0: 0000c617 auipc a2,0xc + 800218b4: cd860613 addi a2,a2,-808 # 8002d588 <.L__unnamed_37> + 800218b8: 03900593 li a1,57 + 800218bc: 00002097 auipc ra,0x2 + 800218c0: 888080e7 jalr -1912(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800218c6 <.LBB7_34>: + debug_assert_eq!(right % self.leaf_size, 0); + 800218c6: 0000c517 auipc a0,0xc + 800218ca: cda50513 addi a0,a0,-806 # 8002d5a0 + +00000000800218ce <.LBB7_35>: + 800218ce: 0000c617 auipc a2,0xc + 800218d2: d2a60613 addi a2,a2,-726 # 8002d5f8 <.L__unnamed_38> + 800218d6: 03900593 li a1,57 + 800218da: 00002097 auipc ra,0x2 + 800218de: 86a080e7 jalr -1942(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800218e4 <.LBB7_36>: + bi += 1; + 800218e4: 0000c517 auipc a0,0xc + 800218e8: 99c50513 addi a0,a0,-1636 # 8002d280 + +00000000800218ec <.LBB7_37>: + 800218ec: 0000c617 auipc a2,0xc + 800218f0: d3c60613 addi a2,a2,-708 # 8002d628 <.L__unnamed_39> + 800218f4: 45f1 li a1,28 + 800218f6: 00002097 auipc ra,0x2 + 800218fa: 84e080e7 jalr -1970(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E: + +0000000080021900 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E>: + + /// Init free regions between [left, self.actual_end). + /// Must be called after marking meta and unavail data. + fn init_free(&mut self, left: usize) -> usize { + 80021900: 7151 addi sp,sp,-240 + 80021902: f586 sd ra,232(sp) + 80021904: e8ae sd a1,80(sp) + 80021906: ecaa sd a0,88(sp) + 80021908: f52a sd a0,168(sp) + 8002190a: f92e sd a1,176(sp) + let right = self.actual_end; + 8002190c: 650c ld a1,8(a0) + 8002190e: f0ae sd a1,96(sp) + 80021910: fd2e sd a1,184(sp) + 80021912: 4581 li a1,0 + let mut free = 0; + 80021914: f8ae sd a1,112(sp) + for i in 0..self.max_size() { + 80021916: 00000097 auipc ra,0x0 + 8002191a: 2a8080e7 jalr 680(ra) # 80021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E> + 8002191e: f4aa sd a0,104(sp) + 80021920: a009 j 80021922 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x22> + 80021922: 75a6 ld a1,104(sp) + 80021924: 4501 li a0,0 + 80021926: fcaa sd a0,120(sp) + 80021928: e12e sd a1,128(sp) + 8002192a: fffff097 auipc ra,0xfffff + 8002192e: ee6080e7 jalr -282(ra) # 80020810 <_ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17he0a8d93712e5493bE> + 80021932: e0aa sd a0,64(sp) + 80021934: e4ae sd a1,72(sp) + 80021936: a009 j 80021938 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x38> + 80021938: 6526 ld a0,72(sp) + 8002193a: 6586 ld a1,64(sp) + 8002193c: e52e sd a1,136(sp) + 8002193e: e92a sd a0,144(sp) + 80021940: a009 j 80021942 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x42> + 80021942: 0128 addi a0,sp,136 + 80021944: fffff097 auipc ra,0xfffff + 80021948: e5e080e7 jalr -418(ra) # 800207a2 <_ZN4core4iter5range101_$LT$impl$u20$core..iter..traits..iterator..Iterator$u20$for$u20$core..ops..range..Range$LT$A$GT$$GT$4next17h401d971ddbd8474fE> + 8002194c: ed2a sd a0,152(sp) + 8002194e: f12e sd a1,160(sp) + 80021950: a009 j 80021952 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x52> + 80021952: 656a ld a0,152(sp) + 80021954: 4581 li a1,0 + 80021956: 00b50463 beq a0,a1,8002195e <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x5e> + 8002195a: a009 j 8002195c <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x5c> + 8002195c: a031 j 80021968 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x68> + if left < right { + free += self.init_free_pair(i, rbi); + } + } + free + } + 8002195e: 7546 ld a0,112(sp) + 80021960: 70ae ld ra,232(sp) + 80021962: 616d addi sp,sp,240 + 80021964: 8082 ret + for i in 0..self.max_size() { + 80021966: 0000 unimp + 80021968: 6646 ld a2,80(sp) + 8002196a: 6566 ld a0,88(sp) + 8002196c: 758a ld a1,160(sp) + 8002196e: f82e sd a1,48(sp) + 80021970: e1ae sd a1,192(sp) + 80021972: e5ae sd a1,200(sp) + 80021974: e9ae sd a1,208(sp) + let lbi = self.blk_index_next(i, left); + 80021976: 00000097 auipc ra,0x0 + 8002197a: 37c080e7 jalr 892(ra) # 80021cf2 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE> + 8002197e: 85aa mv a1,a0 + 80021980: fc2e sd a1,56(sp) + 80021982: edaa sd a0,216(sp) + 80021984: a009 j 80021986 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x86> + let rbi = self.blk_index(i, right); + 80021986: 7606 ld a2,96(sp) + 80021988: 75c2 ld a1,48(sp) + 8002198a: 6566 ld a0,88(sp) + 8002198c: 00000097 auipc ra,0x0 + 80021990: 2e8080e7 jalr 744(ra) # 80021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E> + 80021994: 85aa mv a1,a0 + 80021996: f42e sd a1,40(sp) + 80021998: f1aa sd a0,224(sp) + 8002199a: a009 j 8002199c <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x9c> + free += self.init_free_pair(i, lbi); + 8002199c: 7662 ld a2,56(sp) + 8002199e: 75c2 ld a1,48(sp) + 800219a0: 6566 ld a0,88(sp) + 800219a2: 00000097 auipc ra,0x0 + 800219a6: 08a080e7 jalr 138(ra) # 80021a2c <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE> + 800219aa: f02a sd a0,32(sp) + 800219ac: a009 j 800219ae <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xae> + 800219ae: 7502 ld a0,32(sp) + 800219b0: 75c6 ld a1,112(sp) + 800219b2: 952e add a0,a0,a1 + 800219b4: ec2a sd a0,24(sp) + 800219b6: 02b56f63 bltu a0,a1,800219f4 <.LBB8_20> + 800219ba: a009 j 800219bc <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xbc> + 800219bc: 6546 ld a0,80(sp) + 800219be: 7586 ld a1,96(sp) + 800219c0: 6662 ld a2,24(sp) + 800219c2: f8b2 sd a2,112(sp) + if left < right { + 800219c4: 00b57c63 bgeu a0,a1,800219dc <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xdc> + 800219c8: a009 j 800219ca <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xca> + free += self.init_free_pair(i, rbi); + 800219ca: 7622 ld a2,40(sp) + 800219cc: 75c2 ld a1,48(sp) + 800219ce: 6566 ld a0,88(sp) + 800219d0: 00000097 auipc ra,0x0 + 800219d4: 05c080e7 jalr 92(ra) # 80021a2c <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE> + 800219d8: e82a sd a0,16(sp) + 800219da: a011 j 800219de <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xde> + if left < right { + 800219dc: a819 j 800219f2 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xf2> + free += self.init_free_pair(i, rbi); + 800219de: 6542 ld a0,16(sp) + 800219e0: 75c6 ld a1,112(sp) + 800219e2: 952e add a0,a0,a1 + 800219e4: e42a sd a0,8(sp) + 800219e6: 02b56563 bltu a0,a1,80021a10 <.LBB8_22> + 800219ea: a009 j 800219ec <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xec> + 800219ec: 6522 ld a0,8(sp) + 800219ee: f8aa sd a0,112(sp) + if left < right { + 800219f0: a009 j 800219f2 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0xf2> + for i in 0..self.max_size() { + 800219f2: bf81 j 80021942 <_ZN9allocator11BuddySystem9init_free17h25e98e7c902c4f06E+0x42> + +00000000800219f4 <.LBB8_20>: + free += self.init_free_pair(i, lbi); + 800219f4: 0000c517 auipc a0,0xc + 800219f8: 88c50513 addi a0,a0,-1908 # 8002d280 + +00000000800219fc <.LBB8_21>: + 800219fc: 0000c617 auipc a2,0xc + 80021a00: c4460613 addi a2,a2,-956 # 8002d640 <.L__unnamed_40> + 80021a04: 45f1 li a1,28 + 80021a06: 00001097 auipc ra,0x1 + 80021a0a: 73e080e7 jalr 1854(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021a10 <.LBB8_22>: + free += self.init_free_pair(i, rbi); + 80021a10: 0000c517 auipc a0,0xc + 80021a14: 87050513 addi a0,a0,-1936 # 8002d280 + +0000000080021a18 <.LBB8_23>: + 80021a18: 0000c617 auipc a2,0xc + 80021a1c: c4060613 addi a2,a2,-960 # 8002d658 <.L__unnamed_41> + 80021a20: 45f1 li a1,28 + 80021a22: 00001097 auipc ra,0x1 + 80021a26: 722080e7 jalr 1826(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE: + +0000000080021a2c <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE>: + + /// Push a buddy into the list if it cannot be coalesce and upgrade. + fn init_free_pair(&mut self, sizei: usize, bi: usize) -> usize { + 80021a2c: 7135 addi sp,sp,-160 + 80021a2e: ed06 sd ra,152(sp) + 80021a30: e0b2 sd a2,64(sp) + 80021a32: e4ae sd a1,72(sp) + 80021a34: e8aa sd a0,80(sp) + 80021a36: f4aa sd a0,104(sp) + 80021a38: f8ae sd a1,112(sp) + 80021a3a: fcb2 sd a2,120(sp) + let buddyi = if bi % 2 == 0 { bi+1 } else { bi-1 }; + 80021a3c: 00167513 andi a0,a2,1 + 80021a40: e909 bnez a0,80021a52 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x26> + 80021a42: a009 j 80021a44 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x18> + 80021a44: 6586 ld a1,64(sp) + 80021a46: 00158513 addi a0,a1,1 + 80021a4a: fc2a sd a0,56(sp) + 80021a4c: 0eb56f63 bltu a0,a1,80021b4a <.LBB9_24> + 80021a50: a801 j 80021a60 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x34> + 80021a52: 6506 ld a0,64(sp) + 80021a54: fff50593 addi a1,a0,-1 + 80021a58: f82e sd a1,48(sp) + 80021a5a: 0cb56963 bltu a0,a1,80021b2c <.LBB9_22> + 80021a5e: a021 j 80021a66 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x3a> + 80021a60: 7562 ld a0,56(sp) + 80021a62: f0aa sd a0,96(sp) + 80021a64: a021 j 80021a6c <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x40> + 80021a66: 7542 ld a0,48(sp) + 80021a68: f0aa sd a0,96(sp) + 80021a6a: a009 j 80021a6c <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x40> + let blk_addr_bi = self.blk_addr(sizei, bi); + 80021a6c: 6606 ld a2,64(sp) + 80021a6e: 65a6 ld a1,72(sp) + 80021a70: 6546 ld a0,80(sp) + 80021a72: 00000097 auipc ra,0x0 + 80021a76: 3a0080e7 jalr 928(ra) # 80021e12 <_ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE> + 80021a7a: 85aa mv a1,a0 + 80021a7c: f42e sd a1,40(sp) + 80021a7e: e12a sd a0,128(sp) + 80021a80: a009 j 80021a82 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x56> + let blk_addr_buddyi = self.blk_addr(sizei, buddyi); + 80021a82: 65a6 ld a1,72(sp) + 80021a84: 6546 ld a0,80(sp) + 80021a86: 7606 ld a2,96(sp) + 80021a88: 00000097 auipc ra,0x0 + 80021a8c: 38a080e7 jalr 906(ra) # 80021e12 <_ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE> + 80021a90: 85aa mv a1,a0 + 80021a92: f02e sd a1,32(sp) + 80021a94: e52a sd a0,136(sp) + 80021a96: a009 j 80021a98 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x6c> + + let info = unsafe { self.get_info_mut(sizei) }; + 80021a98: 65a6 ld a1,72(sp) + 80021a9a: 6546 ld a0,80(sp) + 80021a9c: 00000097 auipc ra,0x0 + 80021aa0: 0ca080e7 jalr 202(ra) # 80021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE> + 80021aa4: ec2a sd a0,24(sp) + 80021aa6: a009 j 80021aa8 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x7c> + 80021aa8: 6586 ld a1,64(sp) + 80021aaa: 6562 ld a0,24(sp) + 80021aac: e92a sd a0,144(sp) + if info.is_alloc_set(bi) != info.is_alloc_set(buddyi) { + 80021aae: 00000097 auipc ra,0x0 + 80021ab2: 642080e7 jalr 1602(ra) # 800220f0 <_ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E> + 80021ab6: e82a sd a0,16(sp) + 80021ab8: a009 j 80021aba <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x8e> + 80021aba: 6562 ld a0,24(sp) + 80021abc: 7586 ld a1,96(sp) + 80021abe: 00000097 auipc ra,0x0 + 80021ac2: 632080e7 jalr 1586(ra) # 800220f0 <_ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E> + 80021ac6: e42a sd a0,8(sp) + 80021ac8: a009 j 80021aca <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0x9e> + 80021aca: 6542 ld a0,16(sp) + 80021acc: 65a2 ld a1,8(sp) + 80021ace: 00b50b63 beq a0,a1,80021ae4 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xb8> + 80021ad2: a009 j 80021ad4 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xa8> + // one buddy is free, the other is allocated + unsafe { + if info.is_alloc_set(bi) { + 80021ad4: 6586 ld a1,64(sp) + 80021ad6: 6562 ld a0,24(sp) + 80021ad8: 00000097 auipc ra,0x0 + 80021adc: 618080e7 jalr 1560(ra) # 800220f0 <_ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E> + 80021ae0: e02a sd a0,0(sp) + 80021ae2: a021 j 80021aea <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xbe> + 80021ae4: 4501 li a0,0 + info.free.push(blk_addr_bi); + } + } + self.blk_size(sizei) + } else { + 0 + 80021ae6: ecaa sd a0,88(sp) + if info.is_alloc_set(bi) != info.is_alloc_set(buddyi) { + 80021ae8: a835 j 80021b24 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xf8> + 80021aea: 6502 ld a0,0(sp) + 80021aec: 4581 li a1,0 + if info.is_alloc_set(bi) { + 80021aee: 00b50a63 beq a0,a1,80021b02 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xd6> + 80021af2: a009 j 80021af4 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xc8> + info.free.push(blk_addr_buddyi); + 80021af4: 7582 ld a1,32(sp) + 80021af6: 6562 ld a0,24(sp) + 80021af8: 00001097 auipc ra,0x1 + 80021afc: 9a6080e7 jalr -1626(ra) # 8002249e <_ZN9allocator4list4List4push17h00016bee64ea1dbdE> + 80021b00: a801 j 80021b10 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xe4> + info.free.push(blk_addr_bi); + 80021b02: 75a2 ld a1,40(sp) + 80021b04: 6562 ld a0,24(sp) + 80021b06: 00001097 auipc ra,0x1 + 80021b0a: 998080e7 jalr -1640(ra) # 8002249e <_ZN9allocator4list4List4push17h00016bee64ea1dbdE> + 80021b0e: a011 j 80021b12 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xe6> + if info.is_alloc_set(bi) { + 80021b10: a011 j 80021b14 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xe8> + 80021b12: a009 j 80021b14 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xe8> + self.blk_size(sizei) + 80021b14: 65a6 ld a1,72(sp) + 80021b16: 6546 ld a0,80(sp) + 80021b18: 00000097 auipc ra,0x0 + 80021b1c: 37c080e7 jalr 892(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80021b20: ecaa sd a0,88(sp) + 80021b22: a009 j 80021b24 <_ZN9allocator11BuddySystem14init_free_pair17h8a26a6b8be683eeaE+0xf8> + } + } + 80021b24: 6566 ld a0,88(sp) + 80021b26: 60ea ld ra,152(sp) + 80021b28: 610d addi sp,sp,160 + 80021b2a: 8082 ret + +0000000080021b2c <.LBB9_22>: + let buddyi = if bi % 2 == 0 { bi+1 } else { bi-1 }; + 80021b2c: 0000b517 auipc a0,0xb + 80021b30: 6a450513 addi a0,a0,1700 # 8002d1d0 + +0000000080021b34 <.LBB9_23>: + 80021b34: 0000c617 auipc a2,0xc + 80021b38: b3c60613 addi a2,a2,-1220 # 8002d670 <.L__unnamed_42> + 80021b3c: 02100593 li a1,33 + 80021b40: 00001097 auipc ra,0x1 + 80021b44: 604080e7 jalr 1540(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021b4a <.LBB9_24>: + 80021b4a: 0000b517 auipc a0,0xb + 80021b4e: 73650513 addi a0,a0,1846 # 8002d280 + +0000000080021b52 <.LBB9_25>: + 80021b52: 0000c617 auipc a2,0xc + 80021b56: b3660613 addi a2,a2,-1226 # 8002d688 <.L__unnamed_43> + 80021b5a: 45f1 li a1,28 + 80021b5c: 00001097 auipc ra,0x1 + 80021b60: 5e8080e7 jalr 1512(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE: + +0000000080021b66 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE>: + + /// Get buddy info at certain index. + /// + /// SAFETY: must be called after the initialization of infos field. + unsafe fn get_info_mut(&mut self, index: usize) -> &mut BuddyInfo { + 80021b66: 711d addi sp,sp,-96 + 80021b68: ec86 sd ra,88(sp) + 80021b6a: f02e sd a1,32(sp) + 80021b6c: f82a sd a0,48(sp) + 80021b6e: fc2e sd a1,56(sp) + let info_slice_ptr = *self.infos.as_ptr(); + 80021b70: 02850513 addi a0,a0,40 + 80021b74: f42a sd a0,40(sp) + 80021b76: e8aa sd a0,80(sp) + 80021b78: a009 j 80021b7a <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE+0x14> + 80021b7a: 7602 ld a2,32(sp) + 80021b7c: 75a2 ld a1,40(sp) + 80021b7e: 6188 ld a0,0(a1) + 80021b80: 658c ld a1,8(a1) + 80021b82: e0aa sd a0,64(sp) + 80021b84: e4ae sd a1,72(sp) + info_slice_ptr.get_unchecked_mut(index).as_mut().unwrap() + 80021b86: 00001097 auipc ra,0x1 + 80021b8a: f68080e7 jalr -152(ra) # 80022aee <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h83deb5daf75ed8d6E> + 80021b8e: ec2a sd a0,24(sp) + 80021b90: a009 j 80021b92 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE+0x2c> + 80021b92: 6562 ld a0,24(sp) + 80021b94: 00001097 auipc ra,0x1 + 80021b98: ee0080e7 jalr -288(ra) # 80022a74 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E> + 80021b9c: e82a sd a0,16(sp) + 80021b9e: a009 j 80021ba0 <_ZN9allocator11BuddySystem12get_info_mut17h828847c6ad79cffaE+0x3a> + 80021ba0: 6542 ld a0,16(sp) + +0000000080021ba2 <.LBB10_5>: + 80021ba2: 0000c597 auipc a1,0xc + 80021ba6: afe58593 addi a1,a1,-1282 # 8002d6a0 <.L__unnamed_44> + 80021baa: 00001097 auipc ra,0x1 + 80021bae: a60080e7 jalr -1440(ra) # 8002260a <_ZN4core6option15Option$LT$T$GT$6unwrap17hda397585f3de5667E> + 80021bb2: e42a sd a0,8(sp) + 80021bb4: a009 j 80021bb6 <.LBB10_5+0x14> + } + 80021bb6: 6522 ld a0,8(sp) + 80021bb8: 60e6 ld ra,88(sp) + 80021bba: 6125 addi sp,sp,96 + 80021bbc: 8082 ret + +Disassembly of section .text._ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E: + +0000000080021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E>: + + /// The largest block size. + /// Also the last index into the buddy info array. + #[inline] + fn max_size(&self) -> usize { + 80021bbe: 1141 addi sp,sp,-16 + 80021bc0: e42a sd a0,8(sp) + self.nsizes - 1 + 80021bc2: 6908 ld a0,16(a0) + 80021bc4: fff50593 addi a1,a0,-1 + 80021bc8: e02e sd a1,0(sp) + 80021bca: 00b56663 bltu a0,a1,80021bd6 <.LBB11_3> + 80021bce: a009 j 80021bd0 <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E+0x12> + } + 80021bd0: 6502 ld a0,0(sp) + 80021bd2: 0141 addi sp,sp,16 + 80021bd4: 8082 ret + +0000000080021bd6 <.LBB11_3>: + self.nsizes - 1 + 80021bd6: 0000b517 auipc a0,0xb + 80021bda: 5fa50513 addi a0,a0,1530 # 8002d1d0 + +0000000080021bde <.LBB11_4>: + 80021bde: 0000c617 auipc a2,0xc + 80021be2: ada60613 addi a2,a2,-1318 # 8002d6b8 <.L__unnamed_45> + 80021be6: 02100593 li a1,33 + 80021bea: 00001097 auipc ra,0x1 + 80021bee: 55a080e7 jalr 1370(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem5n_blk17hdff1460b10f7c769E: + +0000000080021bf4 <_ZN9allocator11BuddySystem5n_blk17hdff1460b10f7c769E>: + + /// Number of block at size k, based on the total managed memory. + #[inline] + fn n_blk(&self, k: usize) -> usize { + 80021bf4: 7139 addi sp,sp,-64 + 80021bf6: fc06 sd ra,56(sp) + 80021bf8: ec2e sd a1,24(sp) + 80021bfa: f42a sd a0,40(sp) + 80021bfc: f82e sd a1,48(sp) + 1 << (self.max_size() - k) + 80021bfe: 00000097 auipc ra,0x0 + 80021c02: fc0080e7 jalr -64(ra) # 80021bbe <_ZN9allocator11BuddySystem8max_size17hef7a09e8b41b3266E> + 80021c06: f02a sd a0,32(sp) + 80021c08: a009 j 80021c0a <_ZN9allocator11BuddySystem5n_blk17hdff1460b10f7c769E+0x16> + 80021c0a: 7502 ld a0,32(sp) + 80021c0c: 65e2 ld a1,24(sp) + 80021c0e: 40b505b3 sub a1,a0,a1 + 80021c12: e82e sd a1,16(sp) + 80021c14: 02b56263 bltu a0,a1,80021c38 <.LBB12_6> + 80021c18: a009 j 80021c1a <_ZN9allocator11BuddySystem5n_blk17hdff1460b10f7c769E+0x26> + 80021c1a: 6642 ld a2,16(sp) + 80021c1c: fc067513 andi a0,a2,-64 + 80021c20: 4585 li a1,1 + 80021c22: 00c595b3 sll a1,a1,a2 + 80021c26: e42e sd a1,8(sp) + 80021c28: 4581 li a1,0 + 80021c2a: 02b51663 bne a0,a1,80021c56 <.LBB12_8> + 80021c2e: a009 j 80021c30 <_ZN9allocator11BuddySystem5n_blk17hdff1460b10f7c769E+0x3c> + } + 80021c30: 6522 ld a0,8(sp) + 80021c32: 70e2 ld ra,56(sp) + 80021c34: 6121 addi sp,sp,64 + 80021c36: 8082 ret + +0000000080021c38 <.LBB12_6>: + 1 << (self.max_size() - k) + 80021c38: 0000b517 auipc a0,0xb + 80021c3c: 59850513 addi a0,a0,1432 # 8002d1d0 + +0000000080021c40 <.LBB12_7>: + 80021c40: 0000c617 auipc a2,0xc + 80021c44: a9060613 addi a2,a2,-1392 # 8002d6d0 <.L__unnamed_46> + 80021c48: 02100593 li a1,33 + 80021c4c: 00001097 auipc ra,0x1 + 80021c50: 4f8080e7 jalr 1272(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021c56 <.LBB12_8>: + 80021c56: 0000c517 auipc a0,0xc + 80021c5a: aaa50513 addi a0,a0,-1366 # 8002d700 + +0000000080021c5e <.LBB12_9>: + 80021c5e: 0000c617 auipc a2,0xc + 80021c62: a8a60613 addi a2,a2,-1398 # 8002d6e8 <.L__unnamed_47> + 80021c66: 02300593 li a1,35 + 80021c6a: 00001097 auipc ra,0x1 + 80021c6e: 4da080e7 jalr 1242(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E: + +0000000080021c74 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E>: + + fn blk_index(&self, k: usize, addr: usize) -> usize { + 80021c74: 7139 addi sp,sp,-64 + 80021c76: fc06 sd ra,56(sp) + 80021c78: e42e sd a1,8(sp) + 80021c7a: e82a sd a0,16(sp) + 80021c7c: f02a sd a0,32(sp) + 80021c7e: f42e sd a1,40(sp) + 80021c80: f832 sd a2,48(sp) + (addr - self.base) / self.blk_size(k) + 80021c82: 6108 ld a0,0(a0) + 80021c84: 40a60533 sub a0,a2,a0 + 80021c88: ec2a sd a0,24(sp) + 80021c8a: 02a66763 bltu a2,a0,80021cb8 <.LBB13_6> + 80021c8e: a009 j 80021c90 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E+0x1c> + 80021c90: 65a2 ld a1,8(sp) + 80021c92: 6542 ld a0,16(sp) + 80021c94: 00000097 auipc ra,0x0 + 80021c98: 200080e7 jalr 512(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80021c9c: e02a sd a0,0(sp) + 80021c9e: a009 j 80021ca0 <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E+0x2c> + 80021ca0: 6502 ld a0,0(sp) + 80021ca2: 4581 li a1,0 + 80021ca4: 02b50963 beq a0,a1,80021cd6 <.LBB13_8> + 80021ca8: a009 j 80021caa <_ZN9allocator11BuddySystem9blk_index17hcd9ce7a5032bb5d0E+0x36> + 80021caa: 6562 ld a0,24(sp) + 80021cac: 6582 ld a1,0(sp) + 80021cae: 02b55533 divu a0,a0,a1 + } + 80021cb2: 70e2 ld ra,56(sp) + 80021cb4: 6121 addi sp,sp,64 + 80021cb6: 8082 ret + +0000000080021cb8 <.LBB13_6>: + (addr - self.base) / self.blk_size(k) + 80021cb8: 0000b517 auipc a0,0xb + 80021cbc: 51850513 addi a0,a0,1304 # 8002d1d0 + +0000000080021cc0 <.LBB13_7>: + 80021cc0: 0000c617 auipc a2,0xc + 80021cc4: a6860613 addi a2,a2,-1432 # 8002d728 <.L__unnamed_48> + 80021cc8: 02100593 li a1,33 + 80021ccc: 00001097 auipc ra,0x1 + 80021cd0: 478080e7 jalr 1144(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021cd6 <.LBB13_8>: + 80021cd6: 0000b517 auipc a0,0xb + 80021cda: 56a50513 addi a0,a0,1386 # 8002d240 + +0000000080021cde <.LBB13_9>: + 80021cde: 0000c617 auipc a2,0xc + 80021ce2: a4a60613 addi a2,a2,-1462 # 8002d728 <.L__unnamed_48> + 80021ce6: 45e5 li a1,25 + 80021ce8: 00001097 auipc ra,0x1 + 80021cec: 45c080e7 jalr 1116(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE: + +0000000080021cf2 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE>: + + fn blk_index_next(&self, k: usize, addr: usize) -> usize { + 80021cf2: 711d addi sp,sp,-96 + 80021cf4: ec86 sd ra,88(sp) + 80021cf6: ec32 sd a2,24(sp) + 80021cf8: f02a sd a0,32(sp) + 80021cfa: fc2a sd a0,56(sp) + 80021cfc: e0ae sd a1,64(sp) + 80021cfe: e4b2 sd a2,72(sp) + let bs = self.blk_size(k); + 80021d00: 00000097 auipc ra,0x0 + 80021d04: 194080e7 jalr 404(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80021d08: 85aa mv a1,a0 + 80021d0a: f42e sd a1,40(sp) + 80021d0c: e8aa sd a0,80(sp) + 80021d0e: a009 j 80021d10 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x1e> + let mut i = (addr - self.base) / bs; + 80021d10: 6562 ld a0,24(sp) + 80021d12: 7582 ld a1,32(sp) + 80021d14: 618c ld a1,0(a1) + 80021d16: 40b505b3 sub a1,a0,a1 + 80021d1a: e82e sd a1,16(sp) + 80021d1c: 06b56263 bltu a0,a1,80021d80 <.LBB14_15> + 80021d20: a009 j 80021d22 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x30> + 80021d22: 7522 ld a0,40(sp) + 80021d24: 4581 li a1,0 + 80021d26: 06b50c63 beq a0,a1,80021d9e <.LBB14_17> + 80021d2a: a009 j 80021d2c <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x3a> + 80021d2c: 6562 ld a0,24(sp) + 80021d2e: 7582 ld a1,32(sp) + 80021d30: 6642 ld a2,16(sp) + 80021d32: 76a2 ld a3,40(sp) + 80021d34: 02d65633 divu a2,a2,a3 + 80021d38: f832 sd a2,48(sp) + if (addr - self.base) % bs > 0 { + 80021d3a: 618c ld a1,0(a1) + 80021d3c: 40b505b3 sub a1,a0,a1 + 80021d40: e42e sd a1,8(sp) + 80021d42: 06b56c63 bltu a0,a1,80021dba <.LBB14_19> + 80021d46: a009 j 80021d48 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x56> + 80021d48: 7522 ld a0,40(sp) + 80021d4a: 4581 li a1,0 + 80021d4c: 08b50663 beq a0,a1,80021dd8 <.LBB14_21> + 80021d50: a009 j 80021d52 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x60> + 80021d52: 6522 ld a0,8(sp) + 80021d54: 75a2 ld a1,40(sp) + 80021d56: 02b57533 remu a0,a0,a1 + 80021d5a: 4581 li a1,0 + 80021d5c: 00b50a63 beq a0,a1,80021d70 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x7e> + 80021d60: a009 j 80021d62 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x70> + i += 1; + 80021d62: 75c2 ld a1,48(sp) + 80021d64: 00158513 addi a0,a1,1 + 80021d68: e02a sd a0,0(sp) + 80021d6a: 08b56663 bltu a0,a1,80021df6 <.LBB14_23> + 80021d6e: a011 j 80021d72 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x80> + if (addr - self.base) % bs > 0 { + 80021d70: a021 j 80021d78 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x86> + i += 1; + 80021d72: 6502 ld a0,0(sp) + 80021d74: f82a sd a0,48(sp) + if (addr - self.base) % bs > 0 { + 80021d76: a009 j 80021d78 <_ZN9allocator11BuddySystem14blk_index_next17hac914ee1adc8ccddE+0x86> + } + i + } + 80021d78: 7542 ld a0,48(sp) + 80021d7a: 60e6 ld ra,88(sp) + 80021d7c: 6125 addi sp,sp,96 + 80021d7e: 8082 ret + +0000000080021d80 <.LBB14_15>: + let mut i = (addr - self.base) / bs; + 80021d80: 0000b517 auipc a0,0xb + 80021d84: 45050513 addi a0,a0,1104 # 8002d1d0 + +0000000080021d88 <.LBB14_16>: + 80021d88: 0000c617 auipc a2,0xc + 80021d8c: 9b860613 addi a2,a2,-1608 # 8002d740 <.L__unnamed_49> + 80021d90: 02100593 li a1,33 + 80021d94: 00001097 auipc ra,0x1 + 80021d98: 3b0080e7 jalr 944(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021d9e <.LBB14_17>: + 80021d9e: 0000b517 auipc a0,0xb + 80021da2: 4a250513 addi a0,a0,1186 # 8002d240 + +0000000080021da6 <.LBB14_18>: + 80021da6: 0000c617 auipc a2,0xc + 80021daa: 99a60613 addi a2,a2,-1638 # 8002d740 <.L__unnamed_49> + 80021dae: 45e5 li a1,25 + 80021db0: 00001097 auipc ra,0x1 + 80021db4: 394080e7 jalr 916(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021dba <.LBB14_19>: + if (addr - self.base) % bs > 0 { + 80021dba: 0000b517 auipc a0,0xb + 80021dbe: 41650513 addi a0,a0,1046 # 8002d1d0 + +0000000080021dc2 <.LBB14_20>: + 80021dc2: 0000c617 auipc a2,0xc + 80021dc6: 99660613 addi a2,a2,-1642 # 8002d758 <.L__unnamed_50> + 80021dca: 02100593 li a1,33 + 80021dce: 00001097 auipc ra,0x1 + 80021dd2: 376080e7 jalr 886(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021dd8 <.LBB14_21>: + 80021dd8: 0000b517 auipc a0,0xb + 80021ddc: 7c850513 addi a0,a0,1992 # 8002d5a0 + +0000000080021de0 <.LBB14_22>: + 80021de0: 0000c617 auipc a2,0xc + 80021de4: 97860613 addi a2,a2,-1672 # 8002d758 <.L__unnamed_50> + 80021de8: 03900593 li a1,57 + 80021dec: 00001097 auipc ra,0x1 + 80021df0: 358080e7 jalr 856(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021df6 <.LBB14_23>: + i += 1; + 80021df6: 0000b517 auipc a0,0xb + 80021dfa: 48a50513 addi a0,a0,1162 # 8002d280 + +0000000080021dfe <.LBB14_24>: + 80021dfe: 0000c617 auipc a2,0xc + 80021e02: 97260613 addi a2,a2,-1678 # 8002d770 <.L__unnamed_51> + 80021e06: 45f1 li a1,28 + 80021e08: 00001097 auipc ra,0x1 + 80021e0c: 33c080e7 jalr 828(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE: + +0000000080021e12 <_ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE>: + + /// Receive size k and block index bi. + /// Return the block's raw addr at this buddy system. + fn blk_addr(&self, k: usize, bi: usize) -> usize { + 80021e12: 715d addi sp,sp,-80 + 80021e14: e486 sd ra,72(sp) + 80021e16: ec32 sd a2,24(sp) + 80021e18: f82a sd a0,48(sp) + 80021e1a: fc2e sd a1,56(sp) + 80021e1c: e0b2 sd a2,64(sp) + self.base + (bi * self.blk_size(k)) + 80021e1e: 6110 ld a2,0(a0) + 80021e20: f032 sd a2,32(sp) + 80021e22: 00000097 auipc ra,0x0 + 80021e26: 072080e7 jalr 114(ra) # 80021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E> + 80021e2a: f42a sd a0,40(sp) + 80021e2c: a009 j 80021e2e <_ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE+0x1c> + 80021e2e: 6562 ld a0,24(sp) + 80021e30: 75a2 ld a1,40(sp) + 80021e32: 02b50633 mul a2,a0,a1 + 80021e36: e832 sd a2,16(sp) + 80021e38: 02b53533 mulhu a0,a0,a1 + 80021e3c: 4581 li a1,0 + 80021e3e: 00b51e63 bne a0,a1,80021e5a <.LBB15_6> + 80021e42: a009 j 80021e44 <_ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE+0x32> + 80021e44: 7582 ld a1,32(sp) + 80021e46: 6542 ld a0,16(sp) + 80021e48: 952e add a0,a0,a1 + 80021e4a: e42a sd a0,8(sp) + 80021e4c: 02b56663 bltu a0,a1,80021e78 <.LBB15_8> + 80021e50: a009 j 80021e52 <_ZN9allocator11BuddySystem8blk_addr17h1858bf3dd7c08f3fE+0x40> + } + 80021e52: 6522 ld a0,8(sp) + 80021e54: 60a6 ld ra,72(sp) + 80021e56: 6161 addi sp,sp,80 + 80021e58: 8082 ret + +0000000080021e5a <.LBB15_6>: + self.base + (bi * self.blk_size(k)) + 80021e5a: 0000c517 auipc a0,0xc + 80021e5e: 94650513 addi a0,a0,-1722 # 8002d7a0 + +0000000080021e62 <.LBB15_7>: + 80021e62: 0000c617 auipc a2,0xc + 80021e66: 92660613 addi a2,a2,-1754 # 8002d788 <.L__unnamed_52> + 80021e6a: 02100593 li a1,33 + 80021e6e: 00001097 auipc ra,0x1 + 80021e72: 2d6080e7 jalr 726(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021e78 <.LBB15_8>: + 80021e78: 0000b517 auipc a0,0xb + 80021e7c: 40850513 addi a0,a0,1032 # 8002d280 + +0000000080021e80 <.LBB15_9>: + 80021e80: 0000c617 auipc a2,0xc + 80021e84: 94860613 addi a2,a2,-1720 # 8002d7c8 <.L__unnamed_53> + 80021e88: 45f1 li a1,28 + 80021e8a: 00001097 auipc ra,0x1 + 80021e8e: 2ba080e7 jalr 698(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E: + +0000000080021e94 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E>: + + #[inline] + fn blk_size(&self, k: usize) -> usize { + 80021e94: 7179 addi sp,sp,-48 + 80021e96: 862e mv a2,a1 + 80021e98: e82a sd a0,16(sp) + 80021e9a: f02a sd a0,32(sp) + 80021e9c: f432 sd a2,40(sp) + (1 << k) * self.leaf_size + 80021e9e: fc067513 andi a0,a2,-64 + 80021ea2: 4585 li a1,1 + 80021ea4: 00c595b3 sll a1,a1,a2 + 80021ea8: ec2e sd a1,24(sp) + 80021eaa: 4581 li a1,0 + 80021eac: 02b51263 bne a0,a1,80021ed0 <.LBB16_5> + 80021eb0: a009 j 80021eb2 <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E+0x1e> + 80021eb2: 6562 ld a0,24(sp) + 80021eb4: 65c2 ld a1,16(sp) + 80021eb6: 6d8c ld a1,24(a1) + 80021eb8: 02b50633 mul a2,a0,a1 + 80021ebc: e432 sd a2,8(sp) + 80021ebe: 02b53533 mulhu a0,a0,a1 + 80021ec2: 4581 li a1,0 + 80021ec4: 02b51563 bne a0,a1,80021eee <.LBB16_7> + 80021ec8: a009 j 80021eca <_ZN9allocator11BuddySystem8blk_size17h8693939904cd2981E+0x36> + } + 80021eca: 6522 ld a0,8(sp) + 80021ecc: 6145 addi sp,sp,48 + 80021ece: 8082 ret + +0000000080021ed0 <.LBB16_5>: + (1 << k) * self.leaf_size + 80021ed0: 0000c517 auipc a0,0xc + 80021ed4: 83050513 addi a0,a0,-2000 # 8002d700 + +0000000080021ed8 <.LBB16_6>: + 80021ed8: 0000c617 auipc a2,0xc + 80021edc: 90860613 addi a2,a2,-1784 # 8002d7e0 <.L__unnamed_54> + 80021ee0: 02300593 li a1,35 + 80021ee4: 00001097 auipc ra,0x1 + 80021ee8: 260080e7 jalr 608(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080021eee <.LBB16_7>: + 80021eee: 0000c517 auipc a0,0xc + 80021ef2: 8b250513 addi a0,a0,-1870 # 8002d7a0 + +0000000080021ef6 <.LBB16_8>: + 80021ef6: 0000c617 auipc a2,0xc + 80021efa: 8ea60613 addi a2,a2,-1814 # 8002d7e0 <.L__unnamed_54> + 80021efe: 02100593 li a1,33 + 80021f02: 00001097 auipc ra,0x1 + 80021f06: 242080e7 jalr 578(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator9BuddyInfo9get_alloc17hc8e52f4241734faeE: + +0000000080021f0c <_ZN9allocator9BuddyInfo9get_alloc17hc8e52f4241734faeE>: + split: MaybeUninit<*mut [u8]>, // tell if a block is split into smaller size +} + +impl BuddyInfo { + /// SAFETY: must be called after the initialization of alloc field. + unsafe fn get_alloc(&self, index: usize) -> &u8 { + 80021f0c: 711d addi sp,sp,-96 + 80021f0e: ec86 sd ra,88(sp) + 80021f10: f02e sd a1,32(sp) + 80021f12: f82a sd a0,48(sp) + 80021f14: fc2e sd a1,56(sp) + let alloc_slice_ptr = *self.alloc.as_ptr() as *const [u8]; + 80021f16: 0541 addi a0,a0,16 + 80021f18: f42a sd a0,40(sp) + 80021f1a: e8aa sd a0,80(sp) + 80021f1c: a009 j 80021f1e <_ZN9allocator9BuddyInfo9get_alloc17hc8e52f4241734faeE+0x12> + 80021f1e: 7602 ld a2,32(sp) + 80021f20: 75a2 ld a1,40(sp) + 80021f22: 6188 ld a0,0(a1) + 80021f24: 658c ld a1,8(a1) + 80021f26: e0aa sd a0,64(sp) + 80021f28: e4ae sd a1,72(sp) + alloc_slice_ptr.get_unchecked(index).as_ref().unwrap() + 80021f2a: fffff097 auipc ra,0xfffff + 80021f2e: 816080e7 jalr -2026(ra) # 80020740 <_ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$13get_unchecked17h149838d98ef59845E> + 80021f32: ec2a sd a0,24(sp) + 80021f34: a009 j 80021f36 <_ZN9allocator9BuddyInfo9get_alloc17hc8e52f4241734faeE+0x2a> + 80021f36: 6562 ld a0,24(sp) + 80021f38: ffffe097 auipc ra,0xffffe + 80021f3c: 7a0080e7 jalr 1952(ra) # 800206d8 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E> + 80021f40: e82a sd a0,16(sp) + 80021f42: a009 j 80021f44 <_ZN9allocator9BuddyInfo9get_alloc17hc8e52f4241734faeE+0x38> + 80021f44: 6542 ld a0,16(sp) + +0000000080021f46 <.LBB17_5>: + 80021f46: 0000c597 auipc a1,0xc + 80021f4a: 8b258593 addi a1,a1,-1870 # 8002d7f8 <.L__unnamed_55> + 80021f4e: 00000097 auipc ra,0x0 + 80021f52: 6f2080e7 jalr 1778(ra) # 80022640 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf33e22fb94afcd9bE> + 80021f56: e42a sd a0,8(sp) + 80021f58: a009 j 80021f5a <.LBB17_5+0x14> + } + 80021f5a: 6522 ld a0,8(sp) + 80021f5c: 60e6 ld ra,88(sp) + 80021f5e: 6125 addi sp,sp,96 + 80021f60: 8082 ret + +Disassembly of section .text._ZN9allocator9BuddyInfo13get_alloc_mut17he7a2a5362df5d388E: + +0000000080021f62 <_ZN9allocator9BuddyInfo13get_alloc_mut17he7a2a5362df5d388E>: + + /// SAFETY: must be called after the initialization of alloc field. + unsafe fn get_alloc_mut(&mut self, index: usize) -> &mut u8 { + 80021f62: 711d addi sp,sp,-96 + 80021f64: ec86 sd ra,88(sp) + 80021f66: f02e sd a1,32(sp) + 80021f68: f82a sd a0,48(sp) + 80021f6a: fc2e sd a1,56(sp) + let alloc_slice_ptr = *self.alloc.as_ptr(); + 80021f6c: 0541 addi a0,a0,16 + 80021f6e: f42a sd a0,40(sp) + 80021f70: e8aa sd a0,80(sp) + 80021f72: a009 j 80021f74 <_ZN9allocator9BuddyInfo13get_alloc_mut17he7a2a5362df5d388E+0x12> + 80021f74: 7602 ld a2,32(sp) + 80021f76: 75a2 ld a1,40(sp) + 80021f78: 6188 ld a0,0(a1) + 80021f7a: 658c ld a1,8(a1) + 80021f7c: e0aa sd a0,64(sp) + 80021f7e: e4ae sd a1,72(sp) + alloc_slice_ptr.get_unchecked_mut(index).as_mut().unwrap() + 80021f80: ffffe097 auipc ra,0xffffe + 80021f84: 6fc080e7 jalr 1788(ra) # 8002067c <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h1fb5de3e2413636cE> + 80021f88: ec2a sd a0,24(sp) + 80021f8a: a009 j 80021f8c <_ZN9allocator9BuddyInfo13get_alloc_mut17he7a2a5362df5d388E+0x2a> + 80021f8c: 6562 ld a0,24(sp) + 80021f8e: ffffe097 auipc ra,0xffffe + 80021f92: 67c080e7 jalr 1660(ra) # 8002060a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E> + 80021f96: e82a sd a0,16(sp) + 80021f98: a009 j 80021f9a <_ZN9allocator9BuddyInfo13get_alloc_mut17he7a2a5362df5d388E+0x38> + 80021f9a: 6542 ld a0,16(sp) + +0000000080021f9c <.LBB18_5>: + 80021f9c: 0000c597 auipc a1,0xc + 80021fa0: 87458593 addi a1,a1,-1932 # 8002d810 <.L__unnamed_56> + 80021fa4: 00000097 auipc ra,0x0 + 80021fa8: 630080e7 jalr 1584(ra) # 800225d4 <_ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E> + 80021fac: e42a sd a0,8(sp) + 80021fae: a009 j 80021fb0 <.LBB18_5+0x14> + } + 80021fb0: 6522 ld a0,8(sp) + 80021fb2: 60e6 ld ra,88(sp) + 80021fb4: 6125 addi sp,sp,96 + 80021fb6: 8082 ret + +Disassembly of section .text._ZN9allocator9BuddyInfo9get_split17hd25381f0deeea7b0E: + +0000000080021fb8 <_ZN9allocator9BuddyInfo9get_split17hd25381f0deeea7b0E>: + + /// SAFETY: must be called after the initialization of split field. + unsafe fn get_split(&self, index: usize) -> &u8 { + 80021fb8: 711d addi sp,sp,-96 + 80021fba: ec86 sd ra,88(sp) + 80021fbc: f02e sd a1,32(sp) + 80021fbe: f82a sd a0,48(sp) + 80021fc0: fc2e sd a1,56(sp) + let split_slice_ptr = *self.split.as_ptr() as *const [u8]; + 80021fc2: 02050513 addi a0,a0,32 + 80021fc6: f42a sd a0,40(sp) + 80021fc8: e8aa sd a0,80(sp) + 80021fca: a009 j 80021fcc <_ZN9allocator9BuddyInfo9get_split17hd25381f0deeea7b0E+0x14> + 80021fcc: 7602 ld a2,32(sp) + 80021fce: 75a2 ld a1,40(sp) + 80021fd0: 6188 ld a0,0(a1) + 80021fd2: 658c ld a1,8(a1) + 80021fd4: e0aa sd a0,64(sp) + 80021fd6: e4ae sd a1,72(sp) + split_slice_ptr.get_unchecked(index).as_ref().unwrap() + 80021fd8: ffffe097 auipc ra,0xffffe + 80021fdc: 768080e7 jalr 1896(ra) # 80020740 <_ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$13get_unchecked17h149838d98ef59845E> + 80021fe0: ec2a sd a0,24(sp) + 80021fe2: a009 j 80021fe4 <_ZN9allocator9BuddyInfo9get_split17hd25381f0deeea7b0E+0x2c> + 80021fe4: 6562 ld a0,24(sp) + 80021fe6: ffffe097 auipc ra,0xffffe + 80021fea: 6f2080e7 jalr 1778(ra) # 800206d8 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$6as_ref17h1afc8f6daddbc052E> + 80021fee: e82a sd a0,16(sp) + 80021ff0: a009 j 80021ff2 <_ZN9allocator9BuddyInfo9get_split17hd25381f0deeea7b0E+0x3a> + 80021ff2: 6542 ld a0,16(sp) + +0000000080021ff4 <.LBB19_5>: + 80021ff4: 0000c597 auipc a1,0xc + 80021ff8: 83458593 addi a1,a1,-1996 # 8002d828 <.L__unnamed_57> + 80021ffc: 00000097 auipc ra,0x0 + 80022000: 644080e7 jalr 1604(ra) # 80022640 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf33e22fb94afcd9bE> + 80022004: e42a sd a0,8(sp) + 80022006: a009 j 80022008 <.LBB19_5+0x14> + } + 80022008: 6522 ld a0,8(sp) + 8002200a: 60e6 ld ra,88(sp) + 8002200c: 6125 addi sp,sp,96 + 8002200e: 8082 ret + +Disassembly of section .text._ZN9allocator9BuddyInfo13get_split_mut17h16866174694e07d9E: + +0000000080022010 <_ZN9allocator9BuddyInfo13get_split_mut17h16866174694e07d9E>: + + /// SAFETY: must be called after the initialization of split field. + unsafe fn get_split_mut(&mut self, index: usize) -> &mut u8 { + 80022010: 711d addi sp,sp,-96 + 80022012: ec86 sd ra,88(sp) + 80022014: f02e sd a1,32(sp) + 80022016: f82a sd a0,48(sp) + 80022018: fc2e sd a1,56(sp) + let split_slice_ptr = *self.split.as_ptr(); + 8002201a: 02050513 addi a0,a0,32 + 8002201e: f42a sd a0,40(sp) + 80022020: e8aa sd a0,80(sp) + 80022022: a009 j 80022024 <_ZN9allocator9BuddyInfo13get_split_mut17h16866174694e07d9E+0x14> + 80022024: 7602 ld a2,32(sp) + 80022026: 75a2 ld a1,40(sp) + 80022028: 6188 ld a0,0(a1) + 8002202a: 658c ld a1,8(a1) + 8002202c: e0aa sd a0,64(sp) + 8002202e: e4ae sd a1,72(sp) + split_slice_ptr.get_unchecked_mut(index).as_mut().unwrap() + 80022030: ffffe097 auipc ra,0xffffe + 80022034: 64c080e7 jalr 1612(ra) # 8002067c <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h1fb5de3e2413636cE> + 80022038: ec2a sd a0,24(sp) + 8002203a: a009 j 8002203c <_ZN9allocator9BuddyInfo13get_split_mut17h16866174694e07d9E+0x2c> + 8002203c: 6562 ld a0,24(sp) + 8002203e: ffffe097 auipc ra,0xffffe + 80022042: 5cc080e7 jalr 1484(ra) # 8002060a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17he7a20e0a0a2f5b66E> + 80022046: e82a sd a0,16(sp) + 80022048: a009 j 8002204a <_ZN9allocator9BuddyInfo13get_split_mut17h16866174694e07d9E+0x3a> + 8002204a: 6542 ld a0,16(sp) + +000000008002204c <.LBB20_5>: + 8002204c: 0000b597 auipc a1,0xb + 80022050: 7f458593 addi a1,a1,2036 # 8002d840 <.L__unnamed_58> + 80022054: 00000097 auipc ra,0x0 + 80022058: 580080e7 jalr 1408(ra) # 800225d4 <_ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E> + 8002205c: e42a sd a0,8(sp) + 8002205e: a009 j 80022060 <.LBB20_5+0x14> + } + 80022060: 6522 ld a0,8(sp) + 80022062: 60e6 ld ra,88(sp) + 80022064: 6125 addi sp,sp,96 + 80022066: 8082 ret + +Disassembly of section .text._ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E: + +0000000080022068 <_ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E>: + + fn alloc_set(&mut self, index: usize, set_or_clear: bool) { + 80022068: 715d addi sp,sp,-80 + 8002206a: e486 sd ra,72(sp) + 8002206c: e032 sd a2,0(sp) + 8002206e: 862e mv a2,a1 + 80022070: 6582 ld a1,0(sp) + 80022072: 86ae mv a3,a1 + 80022074: e436 sd a3,8(sp) + 80022076: f02a sd a0,32(sp) + 80022078: f432 sd a2,40(sp) + 8002207a: 02b10ba3 sb a1,55(sp) + let i1 = index / 8; + 8002207e: 00365593 srli a1,a2,0x3 + 80022082: fc2e sd a1,56(sp) + let i2 = index % 8; + 80022084: 8a1d andi a2,a2,7 + 80022086: e832 sd a2,16(sp) + 80022088: e0b2 sd a2,64(sp) + unsafe { self.get_alloc_mut(i1).set_bit(i2, set_or_clear); } + 8002208a: 00000097 auipc ra,0x0 + 8002208e: ed8080e7 jalr -296(ra) # 80021f62 <_ZN9allocator9BuddyInfo13get_alloc_mut17he7a2a5362df5d388E> + 80022092: ec2a sd a0,24(sp) + 80022094: a009 j 80022096 <_ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E+0x2e> + 80022096: 6622 ld a2,8(sp) + 80022098: 65c2 ld a1,16(sp) + 8002209a: 6562 ld a0,24(sp) + 8002209c: 00000097 auipc ra,0x0 + 800220a0: 2ca080e7 jalr 714(ra) # 80022366 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7set_bit17h65cd2a40e8cb79a2E> + 800220a4: a009 j 800220a6 <_ZN9allocator9BuddyInfo9alloc_set17h48fdb360b5f9c917E+0x3e> + } + 800220a6: 60a6 ld ra,72(sp) + 800220a8: 6161 addi sp,sp,80 + 800220aa: 8082 ret + +Disassembly of section .text._ZN9allocator9BuddyInfo9split_set17hd9896ad2ca355490E: + +00000000800220ac <_ZN9allocator9BuddyInfo9split_set17hd9896ad2ca355490E>: + + fn split_set(&mut self, index: usize, set_or_clear: bool) { + 800220ac: 715d addi sp,sp,-80 + 800220ae: e486 sd ra,72(sp) + 800220b0: e032 sd a2,0(sp) + 800220b2: 862e mv a2,a1 + 800220b4: 6582 ld a1,0(sp) + 800220b6: 86ae mv a3,a1 + 800220b8: e436 sd a3,8(sp) + 800220ba: f02a sd a0,32(sp) + 800220bc: f432 sd a2,40(sp) + 800220be: 02b10ba3 sb a1,55(sp) + let i1 = index / 8; + 800220c2: 00365593 srli a1,a2,0x3 + 800220c6: fc2e sd a1,56(sp) + let i2 = index % 8; + 800220c8: 8a1d andi a2,a2,7 + 800220ca: e832 sd a2,16(sp) + 800220cc: e0b2 sd a2,64(sp) + unsafe { self.get_split_mut(i1).set_bit(i2, set_or_clear); } + 800220ce: 00000097 auipc ra,0x0 + 800220d2: f42080e7 jalr -190(ra) # 80022010 <_ZN9allocator9BuddyInfo13get_split_mut17h16866174694e07d9E> + 800220d6: ec2a sd a0,24(sp) + 800220d8: a009 j 800220da <_ZN9allocator9BuddyInfo9split_set17hd9896ad2ca355490E+0x2e> + 800220da: 6622 ld a2,8(sp) + 800220dc: 65c2 ld a1,16(sp) + 800220de: 6562 ld a0,24(sp) + 800220e0: 00000097 auipc ra,0x0 + 800220e4: 286080e7 jalr 646(ra) # 80022366 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7set_bit17h65cd2a40e8cb79a2E> + 800220e8: a009 j 800220ea <_ZN9allocator9BuddyInfo9split_set17hd9896ad2ca355490E+0x3e> + } + 800220ea: 60a6 ld ra,72(sp) + 800220ec: 6161 addi sp,sp,80 + 800220ee: 8082 ret + +Disassembly of section .text._ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E: + +00000000800220f0 <_ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E>: + + fn is_alloc_set(&self, index: usize) -> bool { + 800220f0: 7139 addi sp,sp,-64 + 800220f2: fc06 sd ra,56(sp) + 800220f4: 862e mv a2,a1 + 800220f6: ec2a sd a0,24(sp) + 800220f8: f032 sd a2,32(sp) + let i1 = index / 8; + 800220fa: 00365593 srli a1,a2,0x3 + 800220fe: f42e sd a1,40(sp) + let i2 = index % 8; + 80022100: 8a1d andi a2,a2,7 + 80022102: e432 sd a2,8(sp) + 80022104: f832 sd a2,48(sp) + unsafe { self.get_alloc(i1).get_bit(i2) } + 80022106: 00000097 auipc ra,0x0 + 8002210a: e06080e7 jalr -506(ra) # 80021f0c <_ZN9allocator9BuddyInfo9get_alloc17hc8e52f4241734faeE> + 8002210e: e82a sd a0,16(sp) + 80022110: a009 j 80022112 <_ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E+0x22> + 80022112: 65a2 ld a1,8(sp) + 80022114: 6542 ld a0,16(sp) + 80022116: 00000097 auipc ra,0x0 + 8002211a: 1d2080e7 jalr 466(ra) # 800222e8 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7get_bit17h748f572d0cd86d7cE> + 8002211e: e02a sd a0,0(sp) + 80022120: a009 j 80022122 <_ZN9allocator9BuddyInfo12is_alloc_set17h74e6eb5491672d31E+0x32> + } + 80022122: 6502 ld a0,0(sp) + 80022124: 70e2 ld ra,56(sp) + 80022126: 6121 addi sp,sp,64 + 80022128: 8082 ret + +Disassembly of section .text._ZN9allocator9BuddyInfo12is_split_set17hd9054b929d273b40E: + +000000008002212a <_ZN9allocator9BuddyInfo12is_split_set17hd9054b929d273b40E>: + + fn is_split_set(&self, index: usize) -> bool { + 8002212a: 7139 addi sp,sp,-64 + 8002212c: fc06 sd ra,56(sp) + 8002212e: 862e mv a2,a1 + 80022130: ec2a sd a0,24(sp) + 80022132: f032 sd a2,32(sp) + let i1 = index / 8; + 80022134: 00365593 srli a1,a2,0x3 + 80022138: f42e sd a1,40(sp) + let i2 = index % 8; + 8002213a: 8a1d andi a2,a2,7 + 8002213c: e432 sd a2,8(sp) + 8002213e: f832 sd a2,48(sp) + unsafe { self.get_split(i1).get_bit(i2) } + 80022140: 00000097 auipc ra,0x0 + 80022144: e78080e7 jalr -392(ra) # 80021fb8 <_ZN9allocator9BuddyInfo9get_split17hd25381f0deeea7b0E> + 80022148: e82a sd a0,16(sp) + 8002214a: a009 j 8002214c <_ZN9allocator9BuddyInfo12is_split_set17hd9054b929d273b40E+0x22> + 8002214c: 65a2 ld a1,8(sp) + 8002214e: 6542 ld a0,16(sp) + 80022150: 00000097 auipc ra,0x0 + 80022154: 198080e7 jalr 408(ra) # 800222e8 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7get_bit17h748f572d0cd86d7cE> + 80022158: e02a sd a0,0(sp) + 8002215a: a009 j 8002215c <_ZN9allocator9BuddyInfo12is_split_set17hd9054b929d273b40E+0x32> + } + 8002215c: 6502 ld a0,0(sp) + 8002215e: 70e2 ld ra,56(sp) + 80022160: 6121 addi sp,sp,64 + 80022162: 8082 ret + +Disassembly of section .text._ZN9allocator8round_up17h09c23390ccb46398E: + +0000000080022164 <_ZN9allocator8round_up17h09c23390ccb46398E>: + ptr::write_bytes(raw_ptr, 0, len); + ptr::slice_from_raw_parts_mut(raw_ptr, len) +} + +#[inline] +fn round_up(n: usize, size: usize) -> usize { + 80022164: 7179 addi sp,sp,-48 + 80022166: e82e sd a1,16(sp) + 80022168: f02a sd a0,32(sp) + 8002216a: f42e sd a1,40(sp) + (((n-1)/size)+1)*size + 8002216c: fff50593 addi a1,a0,-1 + 80022170: ec2e sd a1,24(sp) + 80022172: 04b56063 bltu a0,a1,800221b2 <.LBB25_9> + 80022176: a009 j 80022178 <_ZN9allocator8round_up17h09c23390ccb46398E+0x14> + 80022178: 6542 ld a0,16(sp) + 8002217a: 4581 li a1,0 + 8002217c: 04b50a63 beq a0,a1,800221d0 <.LBB25_11> + 80022180: a009 j 80022182 <_ZN9allocator8round_up17h09c23390ccb46398E+0x1e> + 80022182: 6562 ld a0,24(sp) + 80022184: 65c2 ld a1,16(sp) + 80022186: 02b555b3 divu a1,a0,a1 + 8002218a: 00158513 addi a0,a1,1 + 8002218e: e42a sd a0,8(sp) + 80022190: 04b56e63 bltu a0,a1,800221ec <.LBB25_13> + 80022194: a009 j 80022196 <_ZN9allocator8round_up17h09c23390ccb46398E+0x32> + 80022196: 6522 ld a0,8(sp) + 80022198: 65c2 ld a1,16(sp) + 8002219a: 02b50633 mul a2,a0,a1 + 8002219e: e032 sd a2,0(sp) + 800221a0: 02b53533 mulhu a0,a0,a1 + 800221a4: 4581 li a1,0 + 800221a6: 06b51163 bne a0,a1,80022208 <.LBB25_15> + 800221aa: a009 j 800221ac <_ZN9allocator8round_up17h09c23390ccb46398E+0x48> +} + 800221ac: 6502 ld a0,0(sp) + 800221ae: 6145 addi sp,sp,48 + 800221b0: 8082 ret + +00000000800221b2 <.LBB25_9>: + (((n-1)/size)+1)*size + 800221b2: 0000b517 auipc a0,0xb + 800221b6: 01e50513 addi a0,a0,30 # 8002d1d0 + +00000000800221ba <.LBB25_10>: + 800221ba: 0000b617 auipc a2,0xb + 800221be: 69e60613 addi a2,a2,1694 # 8002d858 <.L__unnamed_59> + 800221c2: 02100593 li a1,33 + 800221c6: 00001097 auipc ra,0x1 + 800221ca: f7e080e7 jalr -130(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800221d0 <.LBB25_11>: + 800221d0: 0000b517 auipc a0,0xb + 800221d4: 07050513 addi a0,a0,112 # 8002d240 + +00000000800221d8 <.LBB25_12>: + 800221d8: 0000b617 auipc a2,0xb + 800221dc: 69860613 addi a2,a2,1688 # 8002d870 <.L__unnamed_60> + 800221e0: 45e5 li a1,25 + 800221e2: 00001097 auipc ra,0x1 + 800221e6: f62080e7 jalr -158(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +00000000800221ec <.LBB25_13>: + 800221ec: 0000b517 auipc a0,0xb + 800221f0: 09450513 addi a0,a0,148 # 8002d280 + +00000000800221f4 <.LBB25_14>: + 800221f4: 0000b617 auipc a2,0xb + 800221f8: 69460613 addi a2,a2,1684 # 8002d888 <.L__unnamed_61> + 800221fc: 45f1 li a1,28 + 800221fe: 00001097 auipc ra,0x1 + 80022202: f46080e7 jalr -186(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080022208 <.LBB25_15>: + 80022208: 0000b517 auipc a0,0xb + 8002220c: 59850513 addi a0,a0,1432 # 8002d7a0 + +0000000080022210 <.LBB25_16>: + 80022210: 0000b617 auipc a2,0xb + 80022214: 67860613 addi a2,a2,1656 # 8002d888 <.L__unnamed_61> + 80022218: 02100593 li a1,33 + 8002221c: 00001097 auipc ra,0x1 + 80022220: f28080e7 jalr -216(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator10round_down17h97bc9e681a0cc273E: + +0000000080022226 <_ZN9allocator10round_down17h97bc9e681a0cc273E>: + +#[inline] +fn round_down(n: usize, size: usize) -> usize { + 80022226: 7179 addi sp,sp,-48 + 80022228: e82e sd a1,16(sp) + 8002222a: ec2a sd a0,24(sp) + 8002222c: f02a sd a0,32(sp) + 8002222e: f42e sd a1,40(sp) + 80022230: 4501 li a0,0 + (n/size)*size + 80022232: 02a58363 beq a1,a0,80022258 <.LBB26_5> + 80022236: a009 j 80022238 <_ZN9allocator10round_down17h97bc9e681a0cc273E+0x12> + 80022238: 65c2 ld a1,16(sp) + 8002223a: 6562 ld a0,24(sp) + 8002223c: 02b55533 divu a0,a0,a1 + 80022240: 02b50633 mul a2,a0,a1 + 80022244: e432 sd a2,8(sp) + 80022246: 02b53533 mulhu a0,a0,a1 + 8002224a: 4581 li a1,0 + 8002224c: 02b51463 bne a0,a1,80022274 <.LBB26_7> + 80022250: a009 j 80022252 <_ZN9allocator10round_down17h97bc9e681a0cc273E+0x2c> +} + 80022252: 6522 ld a0,8(sp) + 80022254: 6145 addi sp,sp,48 + 80022256: 8082 ret + +0000000080022258 <.LBB26_5>: + (n/size)*size + 80022258: 0000b517 auipc a0,0xb + 8002225c: fe850513 addi a0,a0,-24 # 8002d240 + +0000000080022260 <.LBB26_6>: + 80022260: 0000b617 auipc a2,0xb + 80022264: 64060613 addi a2,a2,1600 # 8002d8a0 <.L__unnamed_62> + 80022268: 45e5 li a1,25 + 8002226a: 00001097 auipc ra,0x1 + 8002226e: eda080e7 jalr -294(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080022274 <.LBB26_7>: + 80022274: 0000b517 auipc a0,0xb + 80022278: 52c50513 addi a0,a0,1324 # 8002d7a0 + +000000008002227c <.LBB26_8>: + 8002227c: 0000b617 auipc a2,0xb + 80022280: 62460613 addi a2,a2,1572 # 8002d8a0 <.L__unnamed_62> + 80022284: 02100593 li a1,33 + 80022288: 00001097 auipc ra,0x1 + 8002228c: ebc080e7 jalr -324(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator4log217h8cd213ee718a0479E: + +0000000080022292 <_ZN9allocator4log217h8cd213ee718a0479E>: + +fn log2(mut n: usize) -> usize { + 80022292: 1101 addi sp,sp,-32 + 80022294: e82a sd a0,16(sp) + 80022296: 4501 li a0,0 + let mut k = 0; + 80022298: ec2a sd a0,24(sp) + while n > 1 { + 8002229a: a009 j 8002229c <_ZN9allocator4log217h8cd213ee718a0479E+0xa> + 8002229c: 65c2 ld a1,16(sp) + 8002229e: 4505 li a0,1 + 800222a0: 00b56663 bltu a0,a1,800222ac <_ZN9allocator4log217h8cd213ee718a0479E+0x1a> + 800222a4: a009 j 800222a6 <_ZN9allocator4log217h8cd213ee718a0479E+0x14> + k += 1; + n >>= 1; + } + k +} + 800222a6: 6562 ld a0,24(sp) + 800222a8: 6105 addi sp,sp,32 + 800222aa: 8082 ret + k += 1; + 800222ac: 65e2 ld a1,24(sp) + 800222ae: 00158513 addi a0,a1,1 + 800222b2: e42a sd a0,8(sp) + 800222b4: 00b56c63 bltu a0,a1,800222cc <.LBB27_7> + 800222b8: a009 j 800222ba <_ZN9allocator4log217h8cd213ee718a0479E+0x28> + 800222ba: 6522 ld a0,8(sp) + 800222bc: ec2a sd a0,24(sp) + n >>= 1; + 800222be: 6542 ld a0,16(sp) + 800222c0: 8105 srli a0,a0,0x1 + 800222c2: e02a sd a0,0(sp) + 800222c4: a009 j 800222c6 <_ZN9allocator4log217h8cd213ee718a0479E+0x34> + 800222c6: 6502 ld a0,0(sp) + 800222c8: e82a sd a0,16(sp) + while n > 1 { + 800222ca: bfc9 j 8002229c <_ZN9allocator4log217h8cd213ee718a0479E+0xa> + +00000000800222cc <.LBB27_7>: + k += 1; + 800222cc: 0000b517 auipc a0,0xb + 800222d0: fb450513 addi a0,a0,-76 # 8002d280 + +00000000800222d4 <.LBB27_8>: + 800222d4: 0000b617 auipc a2,0xb + 800222d8: 5e460613 addi a2,a2,1508 # 8002d8b8 <.L__unnamed_63> + 800222dc: 45f1 li a1,28 + 800222de: 00001097 auipc ra,0x1 + 800222e2: e66080e7 jalr -410(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7get_bit17h748f572d0cd86d7cE: + +00000000800222e8 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7get_bit17h748f572d0cd86d7cE>: + fn get_bit(&self, bit: usize) -> bool { + 800222e8: 7179 addi sp,sp,-48 + 800222ea: e82e sd a1,16(sp) + 800222ec: ec2a sd a0,24(sp) + 800222ee: f02a sd a0,32(sp) + 800222f0: f42e sd a1,40(sp) + 800222f2: 4521 li a0,8 + assert!(bit < Self::BIT_LENGTH); + 800222f4: 02a5e263 bltu a1,a0,80022318 <.LBB0_6+0x16> + 800222f8: a009 j 800222fa <.LBB0_5> + +00000000800222fa <.LBB0_5>: + 800222fa: 0000b517 auipc a0,0xb + 800222fe: 5d650513 addi a0,a0,1494 # 8002d8d0 <.L__unnamed_1> + +0000000080022302 <.LBB0_6>: + 80022302: 0000b617 auipc a2,0xb + 80022306: 65660613 addi a2,a2,1622 # 8002d958 <.L__unnamed_2> + 8002230a: 02800593 li a1,40 + 8002230e: 00001097 auipc ra,0x1 + 80022312: e36080e7 jalr -458(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80022316: 0000 unimp + (*self & (1 << bit)) != 0 + 80022318: 65c2 ld a1,16(sp) + 8002231a: 6562 ld a0,24(sp) + 8002231c: 00054503 lbu a0,0(a0) + 80022320: e02a sd a0,0(sp) + 80022322: ff85f513 andi a0,a1,-8 + 80022326: 0075f613 andi a2,a1,7 + 8002232a: 4585 li a1,1 + 8002232c: 00c595b3 sll a1,a1,a2 + 80022330: e42e sd a1,8(sp) + 80022332: 4581 li a1,0 + 80022334: 00b51a63 bne a0,a1,80022348 <.LBB0_7> + 80022338: a009 j 8002233a <.LBB0_6+0x38> + 8002233a: 6502 ld a0,0(sp) + 8002233c: 65a2 ld a1,8(sp) + 8002233e: 8d6d and a0,a0,a1 + 80022340: 00a03533 snez a0,a0 + } + 80022344: 6145 addi sp,sp,48 + 80022346: 8082 ret + +0000000080022348 <.LBB0_7>: + (*self & (1 << bit)) != 0 + 80022348: 0000b517 auipc a0,0xb + 8002234c: 62850513 addi a0,a0,1576 # 8002d970 + +0000000080022350 <.LBB0_8>: + 80022350: 0000b617 auipc a2,0xb + 80022354: 60860613 addi a2,a2,1544 # 8002d958 <.L__unnamed_2> + 80022358: 02300593 li a1,35 + 8002235c: 00001097 auipc ra,0x1 + 80022360: de8080e7 jalr -536(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7set_bit17h65cd2a40e8cb79a2E: + +0000000080022366 <_ZN42_$LT$u8$u20$as$u20$bit_field..BitField$GT$7set_bit17h65cd2a40e8cb79a2E>: + fn set_bit(&mut self, bit: usize, value: bool) -> &mut Self { + 80022366: 7139 addi sp,sp,-64 + 80022368: e82e sd a1,16(sp) + 8002236a: ec2a sd a0,24(sp) + 8002236c: 86b2 mv a3,a2 + 8002236e: f036 sd a3,32(sp) + 80022370: f42a sd a0,40(sp) + 80022372: f82e sd a1,48(sp) + 80022374: 02c10fa3 sb a2,63(sp) + 80022378: 4521 li a0,8 + assert!(bit < Self::BIT_LENGTH); + 8002237a: 02a5e263 bltu a1,a0,8002239e <.LBB1_11+0x16> + 8002237e: a009 j 80022380 <.LBB1_10> + +0000000080022380 <.LBB1_10>: + 80022380: 0000b517 auipc a0,0xb + 80022384: 55050513 addi a0,a0,1360 # 8002d8d0 <.L__unnamed_1> + +0000000080022388 <.LBB1_11>: + 80022388: 0000b617 auipc a2,0xb + 8002238c: 5d060613 addi a2,a2,1488 # 8002d958 <.L__unnamed_2> + 80022390: 02800593 li a1,40 + 80022394: 00001097 auipc ra,0x1 + 80022398: db0080e7 jalr -592(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8002239c: 0000 unimp + 8002239e: 7502 ld a0,32(sp) + 800223a0: 4581 li a1,0 + if value { + 800223a2: 02b50063 beq a0,a1,800223c2 <.LBB1_11+0x3a> + 800223a6: a009 j 800223a8 <.LBB1_11+0x20> + *self |= 1 << bit; + 800223a8: 65c2 ld a1,16(sp) + 800223aa: ff85f513 andi a0,a1,-8 + 800223ae: 0075f613 andi a2,a1,7 + 800223b2: 4585 li a1,1 + 800223b4: 00c595b3 sll a1,a1,a2 + 800223b8: e42e sd a1,8(sp) + 800223ba: 4581 li a1,0 + 800223bc: 04b51563 bne a0,a1,80022406 <.LBB1_12> + 800223c0: a831 j 800223dc <.LBB1_11+0x54> + *self &= !(1 << bit); + 800223c2: 65c2 ld a1,16(sp) + 800223c4: ff85f513 andi a0,a1,-8 + 800223c8: 0075f613 andi a2,a1,7 + 800223cc: 4585 li a1,1 + 800223ce: 00c595b3 sll a1,a1,a2 + 800223d2: e02e sd a1,0(sp) + 800223d4: 4581 li a1,0 + 800223d6: 04b51763 bne a0,a1,80022424 <.LBB1_14> + 800223da: a809 j 800223ec <.LBB1_11+0x64> + *self |= 1 << bit; + 800223dc: 65e2 ld a1,24(sp) + 800223de: 6622 ld a2,8(sp) + 800223e0: 00058503 lb a0,0(a1) + 800223e4: 8d51 or a0,a0,a2 + 800223e6: 00a58023 sb a0,0(a1) + if value { + 800223ea: a819 j 80022400 <.LBB1_11+0x78> + *self &= !(1 << bit); + 800223ec: 65e2 ld a1,24(sp) + 800223ee: 6502 ld a0,0(sp) + 800223f0: fff54613 not a2,a0 + 800223f4: 00058503 lb a0,0(a1) + 800223f8: 8d71 and a0,a0,a2 + 800223fa: 00a58023 sb a0,0(a1) + if value { + 800223fe: a009 j 80022400 <.LBB1_11+0x78> + } + 80022400: 6562 ld a0,24(sp) + 80022402: 6121 addi sp,sp,64 + 80022404: 8082 ret + +0000000080022406 <.LBB1_12>: + *self |= 1 << bit; + 80022406: 0000b517 auipc a0,0xb + 8002240a: 56a50513 addi a0,a0,1386 # 8002d970 + +000000008002240e <.LBB1_13>: + 8002240e: 0000b617 auipc a2,0xb + 80022412: 54a60613 addi a2,a2,1354 # 8002d958 <.L__unnamed_2> + 80022416: 02300593 li a1,35 + 8002241a: 00001097 auipc ra,0x1 + 8002241e: d2a080e7 jalr -726(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080022424 <.LBB1_14>: + *self &= !(1 << bit); + 80022424: 0000b517 auipc a0,0xb + 80022428: 54c50513 addi a0,a0,1356 # 8002d970 + +000000008002242c <.LBB1_15>: + 8002242c: 0000b617 auipc a2,0xb + 80022430: 52c60613 addi a2,a2,1324 # 8002d958 <.L__unnamed_2> + 80022434: 02300593 li a1,35 + 80022438: 00001097 auipc ra,0x1 + 8002243c: d0c080e7 jalr -756(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core3fmt9Arguments6new_v117hf60bb287480e0058E: + +0000000080022442 <_ZN4core3fmt9Arguments6new_v117hf60bb287480e0058E>: + pub fn new_v1(pieces: &'a [&'static str], args: &'a [ArgumentV1<'a>]) -> Arguments<'a> { + 80022442: 7179 addi sp,sp,-48 + 80022444: e82e sd a1,16(sp) + 80022446: ec32 sd a2,24(sp) + 80022448: f036 sd a3,32(sp) + 8002244a: f43a sd a4,40(sp) + 8002244c: 4781 li a5,0 + Arguments { pieces, fmt: None, args } + 8002244e: e03e sd a5,0(sp) + 80022450: e10c sd a1,0(a0) + 80022452: e510 sd a2,8(a0) + 80022454: 6602 ld a2,0(sp) + 80022456: 65a2 ld a1,8(sp) + 80022458: e910 sd a2,16(a0) + 8002245a: ed0c sd a1,24(a0) + 8002245c: f114 sd a3,32(a0) + 8002245e: f518 sd a4,40(a0) + } + 80022460: 6145 addi sp,sp,48 + 80022462: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout4size17h7a38fec576bdd6a2E: + +0000000080022464 <_ZN4core5alloc6layout6Layout4size17h7a38fec576bdd6a2E>: + pub const fn size(&self) -> usize { + 80022464: 1141 addi sp,sp,-16 + 80022466: e42a sd a0,8(sp) + self.size_ + 80022468: 6108 ld a0,0(a0) + } + 8002246a: 0141 addi sp,sp,16 + 8002246c: 8082 ret + +Disassembly of section .text._ZN4core5alloc6layout6Layout5align17habc8d2502287bfe5E: + +000000008002246e <_ZN4core5alloc6layout6Layout5align17habc8d2502287bfe5E>: + pub const fn align(&self) -> usize { + 8002246e: 1101 addi sp,sp,-32 + 80022470: ec06 sd ra,24(sp) + 80022472: e82a sd a0,16(sp) + self.align_.get() + 80022474: 6508 ld a0,8(a0) + 80022476: 00000097 auipc ra,0x0 + 8002247a: 014080e7 jalr 20(ra) # 8002248a <_ZN4core3num7nonzero12NonZeroUsize3get17h6255ed88f1e61af7E> + 8002247e: e42a sd a0,8(sp) + 80022480: a009 j 80022482 <_ZN4core5alloc6layout6Layout5align17habc8d2502287bfe5E+0x14> + } + 80022482: 6522 ld a0,8(sp) + 80022484: 60e2 ld ra,24(sp) + 80022486: 6105 addi sp,sp,32 + 80022488: 8082 ret + +Disassembly of section .text._ZN4core3num7nonzero12NonZeroUsize3get17h6255ed88f1e61af7E: + +000000008002248a <_ZN4core3num7nonzero12NonZeroUsize3get17h6255ed88f1e61af7E>: + pub const fn get(self) -> $Int { + 8002248a: 1141 addi sp,sp,-16 + 8002248c: e42a sd a0,8(sp) + } + 8002248e: 0141 addi sp,sp,16 + 80022490: 8082 ret + +Disassembly of section .text._ZN9allocator4list4List4init17ha2ca564ea80bf5d5E: + +0000000080022492 <_ZN9allocator4list4List4init17ha2ca564ea80bf5d5E>: + prev: *mut List, + next: *mut List, +} + +impl List { + pub fn init(&mut self) { + 80022492: 1141 addi sp,sp,-16 + 80022494: e42a sd a0,8(sp) + self.prev = self; + 80022496: e108 sd a0,0(a0) + self.next = self; + 80022498: e508 sd a0,8(a0) + } + 8002249a: 0141 addi sp,sp,16 + 8002249c: 8082 ret + +Disassembly of section .text._ZN9allocator4list4List4push17h00016bee64ea1dbdE: + +000000008002249e <_ZN9allocator4list4List4push17h00016bee64ea1dbdE>: + + pub unsafe fn push(&mut self, raw_addr: usize) { + 8002249e: 711d addi sp,sp,-96 + 800224a0: ec86 sd ra,88(sp) + 800224a2: ec2e sd a1,24(sp) + 800224a4: 85aa mv a1,a0 + 800224a6: 6562 ld a0,24(sp) + 800224a8: f02e sd a1,32(sp) + 800224aa: e0ae sd a1,64(sp) + 800224ac: e4aa sd a0,72(sp) + let raw_list = raw_addr as *mut List; + 800224ae: 862a mv a2,a0 + 800224b0: f432 sd a2,40(sp) + 800224b2: e8aa sd a0,80(sp) + ptr::write(raw_list, List { + prev: self, + next: self.next, + 800224b4: 6590 ld a2,8(a1) + ptr::write(raw_list, List { + 800224b6: f82e sd a1,48(sp) + 800224b8: fc32 sd a2,56(sp) + 800224ba: 00000097 auipc ra,0x0 + 800224be: 272080e7 jalr 626(ra) # 8002272c <_ZN4core3ptr5write17h20482a37cc2ee430E> + 800224c2: a009 j 800224c4 <_ZN9allocator4list4List4push17h00016bee64ea1dbdE+0x26> + }); + self.next.as_mut().unwrap().prev = raw_list; + 800224c4: 7502 ld a0,32(sp) + 800224c6: 6508 ld a0,8(a0) + 800224c8: 00001097 auipc ra,0x1 + 800224cc: 870080e7 jalr -1936(ra) # 80022d38 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE> + 800224d0: e82a sd a0,16(sp) + 800224d2: a009 j 800224d4 <_ZN9allocator4list4List4push17h00016bee64ea1dbdE+0x36> + 800224d4: 6542 ld a0,16(sp) + +00000000800224d6 <.LBB1_4>: + 800224d6: 0000b597 auipc a1,0xb + 800224da: 4ea58593 addi a1,a1,1258 # 8002d9c0 <.L__unnamed_1> + 800224de: 00000097 auipc ra,0x0 + 800224e2: 0c0080e7 jalr 192(ra) # 8002259e <_ZN4core6option15Option$LT$T$GT$6unwrap17h92f45fda96995230E> + 800224e6: e42a sd a0,8(sp) + 800224e8: a009 j 800224ea <.LBB1_4+0x14> + 800224ea: 7522 ld a0,40(sp) + 800224ec: 7582 ld a1,32(sp) + 800224ee: 6622 ld a2,8(sp) + 800224f0: e208 sd a0,0(a2) + self.next = raw_list; + 800224f2: e588 sd a0,8(a1) + } + 800224f4: 60e6 ld ra,88(sp) + 800224f6: 6125 addi sp,sp,96 + 800224f8: 8082 ret + +Disassembly of section .text._ZN9allocator4list4List3pop17h8165b98152b25881E: + +00000000800224fa <_ZN9allocator4list4List3pop17h8165b98152b25881E>: + + pub unsafe fn pop(&mut self) -> Option { + 800224fa: 715d addi sp,sp,-80 + 800224fc: e486 sd ra,72(sp) + 800224fe: ec2a sd a0,24(sp) + 80022500: fc2a sd a0,56(sp) + if self.is_empty() { + 80022502: 00000097 auipc ra,0x0 + 80022506: 07e080e7 jalr 126(ra) # 80022580 <_ZN9allocator4list4List8is_empty17h2b5a11437d86acd9E> + 8002250a: f02a sd a0,32(sp) + 8002250c: a009 j 8002250e <_ZN9allocator4list4List3pop17h8165b98152b25881E+0x14> + 8002250e: 7502 ld a0,32(sp) + 80022510: 4581 li a1,0 + 80022512: 00b50663 beq a0,a1,8002251e <_ZN9allocator4list4List3pop17h8165b98152b25881E+0x24> + 80022516: a009 j 80022518 <_ZN9allocator4list4List3pop17h8165b98152b25881E+0x1e> + 80022518: 4501 li a0,0 + return None + 8002251a: f42a sd a0,40(sp) + } + let raw_addr = self.next as usize; + self.next.as_mut().unwrap().remove(); + Some(raw_addr) + } + 8002251c: a091 j 80022560 <.LBB2_8+0x2a> + let raw_addr = self.next as usize; + 8002251e: 6562 ld a0,24(sp) + 80022520: 650c ld a1,8(a0) + 80022522: e42e sd a1,8(sp) + 80022524: e0ae sd a1,64(sp) + self.next.as_mut().unwrap().remove(); + 80022526: 6508 ld a0,8(a0) + 80022528: 00001097 auipc ra,0x1 + 8002252c: 810080e7 jalr -2032(ra) # 80022d38 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE> + 80022530: e82a sd a0,16(sp) + 80022532: a009 j 80022534 <_ZN9allocator4list4List3pop17h8165b98152b25881E+0x3a> + 80022534: 6542 ld a0,16(sp) + +0000000080022536 <.LBB2_8>: + 80022536: 0000b597 auipc a1,0xb + 8002253a: 4a258593 addi a1,a1,1186 # 8002d9d8 <.L__unnamed_2> + 8002253e: 00000097 auipc ra,0x0 + 80022542: 060080e7 jalr 96(ra) # 8002259e <_ZN4core6option15Option$LT$T$GT$6unwrap17h92f45fda96995230E> + 80022546: e02a sd a0,0(sp) + 80022548: a009 j 8002254a <.LBB2_8+0x14> + 8002254a: 6502 ld a0,0(sp) + 8002254c: 00000097 auipc ra,0x0 + 80022550: 01e080e7 jalr 30(ra) # 8002256a <_ZN9allocator4list4List6remove17hdaf9d5be7333b4ddE> + 80022554: a009 j 80022556 <.LBB2_8+0x20> + Some(raw_addr) + 80022556: 6522 ld a0,8(sp) + 80022558: f82a sd a0,48(sp) + 8002255a: 4505 li a0,1 + 8002255c: f42a sd a0,40(sp) + } + 8002255e: a009 j 80022560 <.LBB2_8+0x2a> + 80022560: 7522 ld a0,40(sp) + 80022562: 75c2 ld a1,48(sp) + 80022564: 60a6 ld ra,72(sp) + 80022566: 6161 addi sp,sp,80 + 80022568: 8082 ret + +Disassembly of section .text._ZN9allocator4list4List6remove17hdaf9d5be7333b4ddE: + +000000008002256a <_ZN9allocator4list4List6remove17hdaf9d5be7333b4ddE>: + + pub unsafe fn remove(&mut self) { + 8002256a: 1141 addi sp,sp,-16 + 8002256c: 85aa mv a1,a0 + 8002256e: e42e sd a1,8(sp) + (*self.prev).next = self.next; + 80022570: 6588 ld a0,8(a1) + 80022572: 6190 ld a2,0(a1) + 80022574: e608 sd a0,8(a2) + (*self.next).prev = self.prev; + 80022576: 6188 ld a0,0(a1) + 80022578: 658c ld a1,8(a1) + 8002257a: e188 sd a0,0(a1) + } + 8002257c: 0141 addi sp,sp,16 + 8002257e: 8082 ret + +Disassembly of section .text._ZN9allocator4list4List8is_empty17h2b5a11437d86acd9E: + +0000000080022580 <_ZN9allocator4list4List8is_empty17h2b5a11437d86acd9E>: + + pub fn is_empty(&self) -> bool { + 80022580: 1101 addi sp,sp,-32 + 80022582: ec06 sd ra,24(sp) + 80022584: 85aa mv a1,a0 + 80022586: e82e sd a1,16(sp) + ptr::eq(self.next, self) + 80022588: 6588 ld a0,8(a1) + 8002258a: 00000097 auipc ra,0x0 + 8002258e: 150080e7 jalr 336(ra) # 800226da <_ZN4core3ptr2eq17ha5b82c23507454aeE> + 80022592: e42a sd a0,8(sp) + 80022594: a009 j 80022596 <_ZN9allocator4list4List8is_empty17h2b5a11437d86acd9E+0x16> + } + 80022596: 6522 ld a0,8(sp) + 80022598: 60e2 ld ra,24(sp) + 8002259a: 6105 addi sp,sp,32 + 8002259c: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h92f45fda96995230E: + +000000008002259e <_ZN4core6option15Option$LT$T$GT$6unwrap17h92f45fda96995230E>: + pub const fn unwrap(self) -> T { + 8002259e: 1101 addi sp,sp,-32 + 800225a0: e42e sd a1,8(sp) + 800225a2: e82a sd a0,16(sp) + Some(val) => val, + 800225a4: 00a035b3 snez a1,a0 + 800225a8: 4581 li a1,0 + 800225aa: 00b50463 beq a0,a1,800225b2 <_ZN4core6option15Option$LT$T$GT$6unwrap17h92f45fda96995230E+0x14> + 800225ae: a009 j 800225b0 <_ZN4core6option15Option$LT$T$GT$6unwrap17h92f45fda96995230E+0x12> + 800225b0: a831 j 800225cc <.LBB0_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 800225b2: 6622 ld a2,8(sp) + +00000000800225b4 <.LBB0_5>: + 800225b4: 0000b517 auipc a0,0xb + 800225b8: 43c50513 addi a0,a0,1084 # 8002d9f0 <.L__unnamed_1> + 800225bc: 02b00593 li a1,43 + 800225c0: 00001097 auipc ra,0x1 + 800225c4: b84080e7 jalr -1148(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800225c8: 0000 unimp + match self { + 800225ca: 0000 unimp + Some(val) => val, + 800225cc: 6542 ld a0,16(sp) + 800225ce: ec2a sd a0,24(sp) + } + 800225d0: 6105 addi sp,sp,32 + 800225d2: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E: + +00000000800225d4 <_ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E>: + pub const fn unwrap(self) -> T { + 800225d4: 1101 addi sp,sp,-32 + 800225d6: e42e sd a1,8(sp) + 800225d8: e82a sd a0,16(sp) + Some(val) => val, + 800225da: 00a035b3 snez a1,a0 + 800225de: 4581 li a1,0 + 800225e0: 00b50463 beq a0,a1,800225e8 <_ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E+0x14> + 800225e4: a009 j 800225e6 <_ZN4core6option15Option$LT$T$GT$6unwrap17h9c7c2e8ce1270a73E+0x12> + 800225e6: a831 j 80022602 <.LBB1_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 800225e8: 6622 ld a2,8(sp) + +00000000800225ea <.LBB1_5>: + 800225ea: 0000b517 auipc a0,0xb + 800225ee: 40650513 addi a0,a0,1030 # 8002d9f0 <.L__unnamed_1> + 800225f2: 02b00593 li a1,43 + 800225f6: 00001097 auipc ra,0x1 + 800225fa: b4e080e7 jalr -1202(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 800225fe: 0000 unimp + match self { + 80022600: 0000 unimp + Some(val) => val, + 80022602: 6542 ld a0,16(sp) + 80022604: ec2a sd a0,24(sp) + } + 80022606: 6105 addi sp,sp,32 + 80022608: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17hda397585f3de5667E: + +000000008002260a <_ZN4core6option15Option$LT$T$GT$6unwrap17hda397585f3de5667E>: + pub const fn unwrap(self) -> T { + 8002260a: 1101 addi sp,sp,-32 + 8002260c: e42e sd a1,8(sp) + 8002260e: e82a sd a0,16(sp) + Some(val) => val, + 80022610: 00a035b3 snez a1,a0 + 80022614: 4581 li a1,0 + 80022616: 00b50463 beq a0,a1,8002261e <_ZN4core6option15Option$LT$T$GT$6unwrap17hda397585f3de5667E+0x14> + 8002261a: a009 j 8002261c <_ZN4core6option15Option$LT$T$GT$6unwrap17hda397585f3de5667E+0x12> + 8002261c: a831 j 80022638 <.LBB2_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 8002261e: 6622 ld a2,8(sp) + +0000000080022620 <.LBB2_5>: + 80022620: 0000b517 auipc a0,0xb + 80022624: 3d050513 addi a0,a0,976 # 8002d9f0 <.L__unnamed_1> + 80022628: 02b00593 li a1,43 + 8002262c: 00001097 auipc ra,0x1 + 80022630: b18080e7 jalr -1256(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80022634: 0000 unimp + match self { + 80022636: 0000 unimp + Some(val) => val, + 80022638: 6542 ld a0,16(sp) + 8002263a: ec2a sd a0,24(sp) + } + 8002263c: 6105 addi sp,sp,32 + 8002263e: 8082 ret + +Disassembly of section .text._ZN4core6option15Option$LT$T$GT$6unwrap17hf33e22fb94afcd9bE: + +0000000080022640 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf33e22fb94afcd9bE>: + pub const fn unwrap(self) -> T { + 80022640: 1101 addi sp,sp,-32 + 80022642: e42e sd a1,8(sp) + 80022644: e82a sd a0,16(sp) + Some(val) => val, + 80022646: 00a035b3 snez a1,a0 + 8002264a: 4581 li a1,0 + 8002264c: 00b50463 beq a0,a1,80022654 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf33e22fb94afcd9bE+0x14> + 80022650: a009 j 80022652 <_ZN4core6option15Option$LT$T$GT$6unwrap17hf33e22fb94afcd9bE+0x12> + 80022652: a831 j 8002266e <.LBB3_5+0x18> + None => panic!("called `Option::unwrap()` on a `None` value"), + 80022654: 6622 ld a2,8(sp) + +0000000080022656 <.LBB3_5>: + 80022656: 0000b517 auipc a0,0xb + 8002265a: 39a50513 addi a0,a0,922 # 8002d9f0 <.L__unnamed_1> + 8002265e: 02b00593 li a1,43 + 80022662: 00001097 auipc ra,0x1 + 80022666: ae2080e7 jalr -1310(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 8002266a: 0000 unimp + match self { + 8002266c: 0000 unimp + Some(val) => val, + 8002266e: 6542 ld a0,16(sp) + 80022670: ec2a sd a0,24(sp) + } + 80022672: 6105 addi sp,sp,32 + 80022674: 8082 ret + +Disassembly of section .text._ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E: + +0000000080022676 <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E>: +pub const fn slice_from_raw_parts_mut(data: *mut T, len: usize) -> *mut [T] { + 80022676: 7139 addi sp,sp,-64 + 80022678: fc06 sd ra,56(sp) + 8002267a: ec2e sd a1,24(sp) + 8002267c: f42a sd a0,40(sp) + 8002267e: f82e sd a1,48(sp) + from_raw_parts_mut(data.cast(), len) + 80022680: ffffe097 auipc ra,0xffffe + 80022684: f68080e7 jalr -152(ra) # 800205e8 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$4cast17h7b791e143f90db99E> + 80022688: f02a sd a0,32(sp) + 8002268a: a009 j 8002268c <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E+0x16> + 8002268c: 65e2 ld a1,24(sp) + 8002268e: 7502 ld a0,32(sp) + 80022690: 00000097 auipc ra,0x0 + 80022694: 5e2080e7 jalr 1506(ra) # 80022c72 <_ZN4core3ptr8metadata18from_raw_parts_mut17hf93e4b94956554aaE> + 80022698: e42a sd a0,8(sp) + 8002269a: e82e sd a1,16(sp) + 8002269c: a009 j 8002269e <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E+0x28> +} + 8002269e: 65c2 ld a1,16(sp) + 800226a0: 6522 ld a0,8(sp) + 800226a2: 70e2 ld ra,56(sp) + 800226a4: 6121 addi sp,sp,64 + 800226a6: 8082 ret + +Disassembly of section .text._ZN4core3ptr24slice_from_raw_parts_mut17h9355ff019662f88fE: + +00000000800226a8 <_ZN4core3ptr24slice_from_raw_parts_mut17h9355ff019662f88fE>: +pub const fn slice_from_raw_parts_mut(data: *mut T, len: usize) -> *mut [T] { + 800226a8: 7139 addi sp,sp,-64 + 800226aa: fc06 sd ra,56(sp) + 800226ac: ec2e sd a1,24(sp) + 800226ae: f42a sd a0,40(sp) + 800226b0: f82e sd a1,48(sp) + from_raw_parts_mut(data.cast(), len) + 800226b2: 00000097 auipc ra,0x0 + 800226b6: 3a0080e7 jalr 928(ra) # 80022a52 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$4cast17h8ad85686487e19c0E> + 800226ba: f02a sd a0,32(sp) + 800226bc: a009 j 800226be <_ZN4core3ptr24slice_from_raw_parts_mut17h9355ff019662f88fE+0x16> + 800226be: 65e2 ld a1,24(sp) + 800226c0: 7502 ld a0,32(sp) + 800226c2: 00000097 auipc ra,0x0 + 800226c6: 59e080e7 jalr 1438(ra) # 80022c60 <_ZN4core3ptr8metadata18from_raw_parts_mut17hd3633c4516987911E> + 800226ca: e42a sd a0,8(sp) + 800226cc: e82e sd a1,16(sp) + 800226ce: a009 j 800226d0 <_ZN4core3ptr24slice_from_raw_parts_mut17h9355ff019662f88fE+0x28> +} + 800226d0: 65c2 ld a1,16(sp) + 800226d2: 6522 ld a0,8(sp) + 800226d4: 70e2 ld ra,56(sp) + 800226d6: 6121 addi sp,sp,64 + 800226d8: 8082 ret + +Disassembly of section .text._ZN4core3ptr2eq17ha5b82c23507454aeE: + +00000000800226da <_ZN4core3ptr2eq17ha5b82c23507454aeE>: +pub fn eq(a: *const T, b: *const T) -> bool { + 800226da: 1141 addi sp,sp,-16 + 800226dc: e02a sd a0,0(sp) + 800226de: e42e sd a1,8(sp) + a == b + 800226e0: 8d2d xor a0,a0,a1 + 800226e2: 00153513 seqz a0,a0 +} + 800226e6: 0141 addi sp,sp,16 + 800226e8: 8082 ret + +Disassembly of section .text._ZN4core3ptr4read17hc3975c6c06864098E: + +00000000800226ea <_ZN4core3ptr4read17hc3975c6c06864098E>: +pub const unsafe fn read(src: *const T) -> T { + 800226ea: 7139 addi sp,sp,-64 + 800226ec: e42a sd a0,8(sp) + 800226ee: ec2a sd a0,24(sp) + 800226f0: 7502 ld a0,32(sp) + let mut tmp = MaybeUninit::::uninit(); + 800226f2: e82a sd a0,16(sp) + 800226f4: a009 j 800226f6 <_ZN4core3ptr4read17hc3975c6c06864098E+0xc> + 800226f6: 0808 addi a0,sp,16 + 800226f8: fc2a sd a0,56(sp) + copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + 800226fa: a009 j 800226fc <_ZN4core3ptr4read17hc3975c6c06864098E+0x12> + 800226fc: 6522 ld a0,8(sp) + 800226fe: 6108 ld a0,0(a0) + 80022700: e02a sd a0,0(sp) + 80022702: e82a sd a0,16(sp) + 80022704: f42a sd a0,40(sp) + 80022706: f82a sd a0,48(sp) + tmp.assume_init() + 80022708: a009 j 8002270a <_ZN4core3ptr4read17hc3975c6c06864098E+0x20> +} + 8002270a: 6502 ld a0,0(sp) + 8002270c: 6121 addi sp,sp,64 + 8002270e: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h05084118c665240bE: + +0000000080022710 <_ZN4core3ptr5write17h05084118c665240bE>: +pub const unsafe fn write(dst: *mut T, src: T) { + 80022710: 1101 addi sp,sp,-32 + 80022712: e42e sd a1,8(sp) + 80022714: e832 sd a2,16(sp) + 80022716: ec2a sd a0,24(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 80022718: e510 sd a2,8(a0) + 8002271a: e10c sd a1,0(a0) +} + 8002271c: 6105 addi sp,sp,32 + 8002271e: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h087ddd4d9bf79c51E: + +0000000080022720 <_ZN4core3ptr5write17h087ddd4d9bf79c51E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 80022720: 1141 addi sp,sp,-16 + 80022722: e02e sd a1,0(sp) + 80022724: e42a sd a0,8(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 80022726: e10c sd a1,0(a0) +} + 80022728: 0141 addi sp,sp,16 + 8002272a: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17h20482a37cc2ee430E: + +000000008002272c <_ZN4core3ptr5write17h20482a37cc2ee430E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 8002272c: 1101 addi sp,sp,-32 + 8002272e: e42e sd a1,8(sp) + 80022730: e832 sd a2,16(sp) + 80022732: ec2a sd a0,24(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 80022734: e510 sd a2,8(a0) + 80022736: e10c sd a1,0(a0) +} + 80022738: 6105 addi sp,sp,32 + 8002273a: 8082 ret + +Disassembly of section .text._ZN4core3ptr5write17he24a5dabd5fc0ae9E: + +000000008002273c <_ZN4core3ptr5write17he24a5dabd5fc0ae9E>: +pub const unsafe fn write(dst: *mut T, src: T) { + 8002273c: 1101 addi sp,sp,-32 + 8002273e: e42e sd a1,8(sp) + 80022740: e832 sd a2,16(sp) + 80022742: ec2a sd a0,24(sp) + copy_nonoverlapping(&src as *const T, dst, 1); + 80022744: e510 sd a2,8(a0) + 80022746: e10c sd a1,0(a0) +} + 80022748: 6105 addi sp,sp,32 + 8002274a: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17h72d1856430c619feE: + +000000008002274c <_ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17h72d1856430c619feE>: + pub const fn count_ones(self) -> u32 { + 8002274c: 1101 addi sp,sp,-32 + 8002274e: e82a sd a0,16(sp) + intrinsics::ctpop(self as $ActualT) as u32 + 80022750: 00155593 srli a1,a0,0x1 + 80022754: 05555637 lui a2,0x5555 + 80022758: 5556061b addiw a2,a2,1365 + 8002275c: 0632 slli a2,a2,0xc + 8002275e: 55560613 addi a2,a2,1365 # 5555555 <.Lline_table_start0+0x551e0f0> + 80022762: 0632 slli a2,a2,0xc + 80022764: 55560613 addi a2,a2,1365 + 80022768: 0632 slli a2,a2,0xc + 8002276a: 55560613 addi a2,a2,1365 + 8002276e: 8df1 and a1,a1,a2 + 80022770: 40b505b3 sub a1,a0,a1 + 80022774: 03333537 lui a0,0x3333 + 80022778: 3335051b addiw a0,a0,819 + 8002277c: 0532 slli a0,a0,0xc + 8002277e: 33350513 addi a0,a0,819 # 3333333 <.Lline_table_start0+0x32fbece> + 80022782: 0532 slli a0,a0,0xc + 80022784: 33350513 addi a0,a0,819 + 80022788: 0532 slli a0,a0,0xc + 8002278a: 33350613 addi a2,a0,819 + 8002278e: 00c5f533 and a0,a1,a2 + 80022792: 8189 srli a1,a1,0x2 + 80022794: 8df1 and a1,a1,a2 + 80022796: 952e add a0,a0,a1 + 80022798: 00455593 srli a1,a0,0x4 + 8002279c: 952e add a0,a0,a1 + 8002279e: 00f0f5b7 lui a1,0xf0f + 800227a2: 0f15859b addiw a1,a1,241 + 800227a6: 05b2 slli a1,a1,0xc + 800227a8: f0f58593 addi a1,a1,-241 # f0ef0f <.Lline_table_start0+0xed7aaa> + 800227ac: 05b2 slli a1,a1,0xc + 800227ae: 0f158593 addi a1,a1,241 + 800227b2: 05b2 slli a1,a1,0xc + 800227b4: f0f58593 addi a1,a1,-241 + 800227b8: 8d6d and a0,a0,a1 + 800227ba: 010105b7 lui a1,0x1010 + 800227be: 1015859b addiw a1,a1,257 + 800227c2: 05c2 slli a1,a1,0x10 + 800227c4: 10158593 addi a1,a1,257 # 1010101 <.Lline_table_start0+0xfd8c9c> + 800227c8: 05c2 slli a1,a1,0x10 + 800227ca: 10158593 addi a1,a1,257 + 800227ce: 02b50533 mul a0,a0,a1 + 800227d2: 9161 srli a0,a0,0x38 + 800227d4: e42a sd a0,8(sp) + 800227d6: ec2a sd a0,24(sp) + 800227d8: a009 j 800227da <_ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17h72d1856430c619feE+0x8e> + } + 800227da: 6522 ld a0,8(sp) + 800227dc: 6105 addi sp,sp,32 + 800227de: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hcd1907f29e8c72abE: + +00000000800227e0 <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hcd1907f29e8c72abE>: + pub unsafe fn unchecked_add(self, rhs: Self) -> Self { + 800227e0: 1101 addi sp,sp,-32 + 800227e2: e42a sd a0,8(sp) + 800227e4: e82e sd a1,16(sp) + unsafe { intrinsics::unchecked_add(self, rhs) } + 800227e6: 952e add a0,a0,a1 + 800227e8: e02a sd a0,0(sp) + 800227ea: ec2a sd a0,24(sp) + 800227ec: a009 j 800227ee <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hcd1907f29e8c72abE+0xe> + } + 800227ee: 6502 ld a0,0(sp) + 800227f0: 6105 addi sp,sp,32 + 800227f2: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$14trailing_zeros17h26e4a056cb05b6fbE: + +00000000800227f4 <_ZN4core3num23_$LT$impl$u20$usize$GT$14trailing_zeros17h26e4a056cb05b6fbE>: + pub const fn trailing_zeros(self) -> u32 { + 800227f4: 1101 addi sp,sp,-32 + 800227f6: e82a sd a0,16(sp) + intrinsics::cttz(self) as u32 + 800227f8: fff50593 addi a1,a0,-1 + 800227fc: fff54513 not a0,a0 + 80022800: 8d6d and a0,a0,a1 + 80022802: 00155593 srli a1,a0,0x1 + 80022806: 05555637 lui a2,0x5555 + 8002280a: 5556061b addiw a2,a2,1365 + 8002280e: 0632 slli a2,a2,0xc + 80022810: 55560613 addi a2,a2,1365 # 5555555 <.Lline_table_start0+0x551e0f0> + 80022814: 0632 slli a2,a2,0xc + 80022816: 55560613 addi a2,a2,1365 + 8002281a: 0632 slli a2,a2,0xc + 8002281c: 55560613 addi a2,a2,1365 + 80022820: 8df1 and a1,a1,a2 + 80022822: 40b505b3 sub a1,a0,a1 + 80022826: 03333537 lui a0,0x3333 + 8002282a: 3335051b addiw a0,a0,819 + 8002282e: 0532 slli a0,a0,0xc + 80022830: 33350513 addi a0,a0,819 # 3333333 <.Lline_table_start0+0x32fbece> + 80022834: 0532 slli a0,a0,0xc + 80022836: 33350513 addi a0,a0,819 + 8002283a: 0532 slli a0,a0,0xc + 8002283c: 33350613 addi a2,a0,819 + 80022840: 00c5f533 and a0,a1,a2 + 80022844: 8189 srli a1,a1,0x2 + 80022846: 8df1 and a1,a1,a2 + 80022848: 952e add a0,a0,a1 + 8002284a: 00455593 srli a1,a0,0x4 + 8002284e: 952e add a0,a0,a1 + 80022850: 00f0f5b7 lui a1,0xf0f + 80022854: 0f15859b addiw a1,a1,241 + 80022858: 05b2 slli a1,a1,0xc + 8002285a: f0f58593 addi a1,a1,-241 # f0ef0f <.Lline_table_start0+0xed7aaa> + 8002285e: 05b2 slli a1,a1,0xc + 80022860: 0f158593 addi a1,a1,241 + 80022864: 05b2 slli a1,a1,0xc + 80022866: f0f58593 addi a1,a1,-241 + 8002286a: 8d6d and a0,a0,a1 + 8002286c: 010105b7 lui a1,0x1010 + 80022870: 1015859b addiw a1,a1,257 + 80022874: 05c2 slli a1,a1,0x10 + 80022876: 10158593 addi a1,a1,257 # 1010101 <.Lline_table_start0+0xfd8c9c> + 8002287a: 05c2 slli a1,a1,0x10 + 8002287c: 10158593 addi a1,a1,257 + 80022880: 02b50533 mul a0,a0,a1 + 80022884: 9161 srli a0,a0,0x38 + 80022886: e42a sd a0,8(sp) + 80022888: ec2a sd a0,24(sp) + 8002288a: a009 j 8002288c <_ZN4core3num23_$LT$impl$u20$usize$GT$14trailing_zeros17h26e4a056cb05b6fbE+0x98> + } + 8002288c: 6522 ld a0,8(sp) + 8002288e: 6105 addi sp,sp,32 + 80022890: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h4d07b92e227ceed8E: + +0000000080022892 <_ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h4d07b92e227ceed8E>: + pub const fn is_power_of_two(self) -> bool { + 80022892: 1101 addi sp,sp,-32 + 80022894: ec06 sd ra,24(sp) + 80022896: e82a sd a0,16(sp) + self.count_ones() == 1 + 80022898: 00000097 auipc ra,0x0 + 8002289c: eb4080e7 jalr -332(ra) # 8002274c <_ZN4core3num23_$LT$impl$u20$usize$GT$10count_ones17h72d1856430c619feE> + 800228a0: e42a sd a0,8(sp) + 800228a2: a009 j 800228a4 <_ZN4core3num23_$LT$impl$u20$usize$GT$15is_power_of_two17h4d07b92e227ceed8E+0x12> + 800228a4: 6522 ld a0,8(sp) + 800228a6: 2501 sext.w a0,a0 + 800228a8: 157d addi a0,a0,-1 + 800228aa: 00153513 seqz a0,a0 + } + 800228ae: 60e2 ld ra,24(sp) + 800228b0: 6105 addi sp,sp,32 + 800228b2: 8082 ret + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$17next_power_of_two17h8eeaf87577f4331fE: + +00000000800228b4 <_ZN4core3num23_$LT$impl$u20$usize$GT$17next_power_of_two17h8eeaf87577f4331fE>: + pub const fn next_power_of_two(self) -> Self { + 800228b4: 1101 addi sp,sp,-32 + 800228b6: ec06 sd ra,24(sp) + 800228b8: e82a sd a0,16(sp) + self.one_less_than_next_power_of_two() + 1 + 800228ba: 00000097 auipc ra,0x0 + 800228be: 03e080e7 jalr 62(ra) # 800228f8 <_ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE> + 800228c2: e42a sd a0,8(sp) + 800228c4: a009 j 800228c6 <_ZN4core3num23_$LT$impl$u20$usize$GT$17next_power_of_two17h8eeaf87577f4331fE+0x12> + 800228c6: 65a2 ld a1,8(sp) + 800228c8: 00158513 addi a0,a1,1 + 800228cc: e02a sd a0,0(sp) + 800228ce: 00b56763 bltu a0,a1,800228dc <.LBB4_4> + 800228d2: a009 j 800228d4 <_ZN4core3num23_$LT$impl$u20$usize$GT$17next_power_of_two17h8eeaf87577f4331fE+0x20> + } + 800228d4: 6502 ld a0,0(sp) + 800228d6: 60e2 ld ra,24(sp) + 800228d8: 6105 addi sp,sp,32 + 800228da: 8082 ret + +00000000800228dc <.LBB4_4>: + self.one_less_than_next_power_of_two() + 1 + 800228dc: 0000b517 auipc a0,0xb + 800228e0: 1d450513 addi a0,a0,468 # 8002dab0 + +00000000800228e4 <.LBB4_5>: + 800228e4: 0000b617 auipc a2,0xb + 800228e8: 1b460613 addi a2,a2,436 # 8002da98 <.L__unnamed_1> + 800228ec: 45f1 li a1,28 + 800228ee: 00001097 auipc ra,0x1 + 800228f2: 856080e7 jalr -1962(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE: + +00000000800228f8 <_ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE>: + const fn one_less_than_next_power_of_two(self) -> Self { + 800228f8: 7139 addi sp,sp,-64 + 800228fa: 85aa mv a1,a0 + 800228fc: e82e sd a1,16(sp) + 800228fe: f02e sd a1,32(sp) + 80022900: 4505 li a0,1 + if self <= 1 { return 0; } + 80022902: 00b56663 bltu a0,a1,8002290e <_ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE+0x16> + 80022906: a009 j 80022908 <_ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE+0x10> + 80022908: 4501 li a0,0 + 8002290a: ec2a sd a0,24(sp) + } + 8002290c: a0e1 j 800229d4 <_ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE+0xdc> + let p = self - 1; + 8002290e: 6542 ld a0,16(sp) + 80022910: 157d addi a0,a0,-1 + 80022912: f42a sd a0,40(sp) + let z = unsafe { intrinsics::ctlz_nonzero(p) }; + 80022914: 00155593 srli a1,a0,0x1 + 80022918: 8d4d or a0,a0,a1 + 8002291a: 00255593 srli a1,a0,0x2 + 8002291e: 8d4d or a0,a0,a1 + 80022920: 00455593 srli a1,a0,0x4 + 80022924: 8d4d or a0,a0,a1 + 80022926: 00855593 srli a1,a0,0x8 + 8002292a: 8d4d or a0,a0,a1 + 8002292c: 01055593 srli a1,a0,0x10 + 80022930: 8d4d or a0,a0,a1 + 80022932: 02055593 srli a1,a0,0x20 + 80022936: 8d4d or a0,a0,a1 + 80022938: fff54513 not a0,a0 + 8002293c: 00155593 srli a1,a0,0x1 + 80022940: 05555637 lui a2,0x5555 + 80022944: 5556061b addiw a2,a2,1365 + 80022948: 0632 slli a2,a2,0xc + 8002294a: 55560613 addi a2,a2,1365 # 5555555 <.Lline_table_start0+0x551e0f0> + 8002294e: 0632 slli a2,a2,0xc + 80022950: 55560613 addi a2,a2,1365 + 80022954: 0632 slli a2,a2,0xc + 80022956: 55560613 addi a2,a2,1365 + 8002295a: 8df1 and a1,a1,a2 + 8002295c: 40b505b3 sub a1,a0,a1 + 80022960: 03333537 lui a0,0x3333 + 80022964: 3335051b addiw a0,a0,819 + 80022968: 0532 slli a0,a0,0xc + 8002296a: 33350513 addi a0,a0,819 # 3333333 <.Lline_table_start0+0x32fbece> + 8002296e: 0532 slli a0,a0,0xc + 80022970: 33350513 addi a0,a0,819 + 80022974: 0532 slli a0,a0,0xc + 80022976: 33350613 addi a2,a0,819 + 8002297a: 00c5f533 and a0,a1,a2 + 8002297e: 8189 srli a1,a1,0x2 + 80022980: 8df1 and a1,a1,a2 + 80022982: 952e add a0,a0,a1 + 80022984: 00455593 srli a1,a0,0x4 + 80022988: 952e add a0,a0,a1 + 8002298a: 00f0f5b7 lui a1,0xf0f + 8002298e: 0f15859b addiw a1,a1,241 + 80022992: 05b2 slli a1,a1,0xc + 80022994: f0f58593 addi a1,a1,-241 # f0ef0f <.Lline_table_start0+0xed7aaa> + 80022998: 05b2 slli a1,a1,0xc + 8002299a: 0f158593 addi a1,a1,241 + 8002299e: 05b2 slli a1,a1,0xc + 800229a0: f0f58593 addi a1,a1,-241 + 800229a4: 8d6d and a0,a0,a1 + 800229a6: 010105b7 lui a1,0x1010 + 800229aa: 1015859b addiw a1,a1,257 + 800229ae: 05c2 slli a1,a1,0x10 + 800229b0: 10158593 addi a1,a1,257 # 1010101 <.Lline_table_start0+0xfd8c9c> + 800229b4: 05c2 slli a1,a1,0x10 + 800229b6: 10158593 addi a1,a1,257 + 800229ba: 02b50533 mul a0,a0,a1 + 800229be: 9161 srli a0,a0,0x38 + 800229c0: e42a sd a0,8(sp) + 800229c2: f82a sd a0,48(sp) + 800229c4: fc2a sd a0,56(sp) + 800229c6: a009 j 800229c8 <_ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE+0xd0> + 800229c8: 65a2 ld a1,8(sp) + 800229ca: 557d li a0,-1 + <$SelfT>::MAX >> z + 800229cc: 00b55533 srl a0,a0,a1 + 800229d0: ec2a sd a0,24(sp) + } + 800229d2: a009 j 800229d4 <_ZN4core3num23_$LT$impl$u20$usize$GT$31one_less_than_next_power_of_two17hfbc6a00474408ebbE+0xdc> + 800229d4: 6562 ld a0,24(sp) + 800229d6: 6121 addi sp,sp,64 + 800229d8: 8082 ret + +Disassembly of section .text._ZN4core10intrinsics11write_bytes17hd3155cf1c4a39b27E: + +00000000800229da <_ZN4core10intrinsics11write_bytes17hd3155cf1c4a39b27E>: +pub unsafe fn write_bytes(dst: *mut T, val: u8, count: usize) { + 800229da: 1101 addi sp,sp,-32 + 800229dc: ec06 sd ra,24(sp) + 800229de: e02a sd a0,0(sp) + 800229e0: 00b107a3 sb a1,15(sp) + 800229e4: e832 sd a2,16(sp) + 800229e6: 03000693 li a3,48 + unsafe { write_bytes(dst, val, count) } + 800229ea: 02d60633 mul a2,a2,a3 + 800229ee: 00003097 auipc ra,0x3 + 800229f2: 6e6080e7 jalr 1766(ra) # 800260d4 + 800229f6: a009 j 800229f8 <_ZN4core10intrinsics11write_bytes17hd3155cf1c4a39b27E+0x1e> +} + 800229f8: 60e2 ld ra,24(sp) + 800229fa: 6105 addi sp,sp,32 + 800229fc: 8082 ret + +Disassembly of section .text._ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E: + +00000000800229fe <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E>: +pub unsafe fn write_bytes(dst: *mut T, val: u8, count: usize) { + 800229fe: 1101 addi sp,sp,-32 + 80022a00: ec06 sd ra,24(sp) + 80022a02: e02a sd a0,0(sp) + 80022a04: 00b107a3 sb a1,15(sp) + 80022a08: e832 sd a2,16(sp) + unsafe { write_bytes(dst, val, count) } + 80022a0a: 00003097 auipc ra,0x3 + 80022a0e: 6ca080e7 jalr 1738(ra) # 800260d4 + 80022a12: a009 j 80022a14 <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E+0x16> +} + 80022a14: 60e2 ld ra,24(sp) + 80022a16: 6105 addi sp,sp,32 + 80022a18: 8082 ret + +Disassembly of section .text._ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h8a22fb325f3ddf5bE: + +0000000080022a1a <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h8a22fb325f3ddf5bE>: + unsafe fn forward_unchecked(start: Self, n: usize) -> Self { + 80022a1a: 1101 addi sp,sp,-32 + 80022a1c: ec06 sd ra,24(sp) + 80022a1e: e42a sd a0,8(sp) + 80022a20: e82e sd a1,16(sp) + unsafe { start.unchecked_add(n as Self) } + 80022a22: 00000097 auipc ra,0x0 + 80022a26: dbe080e7 jalr -578(ra) # 800227e0 <_ZN4core3num23_$LT$impl$u20$usize$GT$13unchecked_add17hcd1907f29e8c72abE> + 80022a2a: e02a sd a0,0(sp) + 80022a2c: a009 j 80022a2e <_ZN49_$LT$usize$u20$as$u20$core..iter..range..Step$GT$17forward_unchecked17h8a22fb325f3ddf5bE+0x14> + } + 80022a2e: 6502 ld a0,0(sp) + 80022a30: 60e2 ld ra,24(sp) + 80022a32: 6105 addi sp,sp,32 + 80022a34: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h94cbb879d32de261E: + +0000000080022a36 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h94cbb879d32de261E>: + pub const unsafe fn add(self, count: usize) -> Self + 80022a36: 1101 addi sp,sp,-32 + 80022a38: ec06 sd ra,24(sp) + 80022a3a: e42a sd a0,8(sp) + 80022a3c: e82e sd a1,16(sp) + unsafe { self.offset(count as isize) } + 80022a3e: 00000097 auipc ra,0x0 + 80022a42: 068080e7 jalr 104(ra) # 80022aa6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h19b052a8866d770eE> + 80022a46: e02a sd a0,0(sp) + 80022a48: a009 j 80022a4a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h94cbb879d32de261E+0x14> + } + 80022a4a: 6502 ld a0,0(sp) + 80022a4c: 60e2 ld ra,24(sp) + 80022a4e: 6105 addi sp,sp,32 + 80022a50: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$4cast17h8ad85686487e19c0E: + +0000000080022a52 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$4cast17h8ad85686487e19c0E>: + pub const fn cast(self) -> *mut U { + 80022a52: 1141 addi sp,sp,-16 + 80022a54: e42a sd a0,8(sp) + } + 80022a56: 0141 addi sp,sp,16 + 80022a58: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h69211318640bf224E: + +0000000080022a5a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h69211318640bf224E>: + pub const unsafe fn write(self, val: T) + 80022a5a: 1101 addi sp,sp,-32 + 80022a5c: ec06 sd ra,24(sp) + 80022a5e: e02a sd a0,0(sp) + 80022a60: e42e sd a1,8(sp) + 80022a62: e832 sd a2,16(sp) + unsafe { write(self, val) } + 80022a64: 00000097 auipc ra,0x0 + 80022a68: cd8080e7 jalr -808(ra) # 8002273c <_ZN4core3ptr5write17he24a5dabd5fc0ae9E> + 80022a6c: a009 j 80022a6e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$5write17h69211318640bf224E+0x14> + } + 80022a6e: 60e2 ld ra,24(sp) + 80022a70: 6105 addi sp,sp,32 + 80022a72: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E: + +0000000080022a74 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E>: + pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> { + 80022a74: 7179 addi sp,sp,-48 + 80022a76: f406 sd ra,40(sp) + 80022a78: e42a sd a0,8(sp) + 80022a7a: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&mut *self) } } + 80022a7c: 00000097 auipc ra,0x0 + 80022a80: 046080e7 jalr 70(ra) # 80022ac2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h7ee5bf75e9cc9a60E> + 80022a84: e82a sd a0,16(sp) + 80022a86: a009 j 80022a88 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E+0x14> + 80022a88: 6542 ld a0,16(sp) + 80022a8a: 4581 li a1,0 + 80022a8c: 00b50663 beq a0,a1,80022a98 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E+0x24> + 80022a90: a009 j 80022a92 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E+0x1e> + 80022a92: 4501 li a0,0 + 80022a94: ec2a sd a0,24(sp) + 80022a96: a021 j 80022a9e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E+0x2a> + 80022a98: 6522 ld a0,8(sp) + 80022a9a: ec2a sd a0,24(sp) + 80022a9c: a009 j 80022a9e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h46e365b62bffa500E+0x2a> + } + 80022a9e: 6562 ld a0,24(sp) + 80022aa0: 70a2 ld ra,40(sp) + 80022aa2: 6145 addi sp,sp,48 + 80022aa4: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h19b052a8866d770eE: + +0000000080022aa6 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h19b052a8866d770eE>: + pub const unsafe fn offset(self, count: isize) -> *mut T + 80022aa6: 1101 addi sp,sp,-32 + 80022aa8: e42a sd a0,8(sp) + 80022aaa: e82e sd a1,16(sp) + 80022aac: 03000613 li a2,48 + unsafe { intrinsics::offset(self, count) as *mut T } + 80022ab0: 02c585b3 mul a1,a1,a2 + 80022ab4: 952e add a0,a0,a1 + 80022ab6: e02a sd a0,0(sp) + 80022ab8: ec2a sd a0,24(sp) + 80022aba: a009 j 80022abc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6offset17h19b052a8866d770eE+0x16> + } + 80022abc: 6502 ld a0,0(sp) + 80022abe: 6105 addi sp,sp,32 + 80022ac0: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h7ee5bf75e9cc9a60E: + +0000000080022ac2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h7ee5bf75e9cc9a60E>: + pub const fn is_null(self) -> bool { + 80022ac2: 1101 addi sp,sp,-32 + 80022ac4: ec06 sd ra,24(sp) + 80022ac6: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 80022ac8: e42a sd a0,8(sp) + 80022aca: a009 j 80022acc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h7ee5bf75e9cc9a60E+0xa> + 80022acc: 6522 ld a0,8(sp) + 80022ace: 4581 li a1,0 + 80022ad0: ffffe097 auipc ra,0xffffe + 80022ad4: ae2080e7 jalr -1310(ra) # 800205b2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h568dab4191b83956E> + 80022ad8: e02a sd a0,0(sp) + 80022ada: a009 j 80022adc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17h7ee5bf75e9cc9a60E+0x1a> + } + 80022adc: 6502 ld a0,0(sp) + 80022ade: 60e2 ld ra,24(sp) + 80022ae0: 6105 addi sp,sp,32 + 80022ae2: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h6f6f43a247b8051cE: + +0000000080022ae4 <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h6f6f43a247b8051cE>: + pub const fn as_mut_ptr(self) -> *mut T { + 80022ae4: 1141 addi sp,sp,-16 + 80022ae6: e02a sd a0,0(sp) + 80022ae8: e42e sd a1,8(sp) + } + 80022aea: 0141 addi sp,sp,16 + 80022aec: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h83deb5daf75ed8d6E: + +0000000080022aee <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h83deb5daf75ed8d6E>: + pub unsafe fn get_unchecked_mut(self, index: I) -> *mut I::Output + 80022aee: 7179 addi sp,sp,-48 + 80022af0: f406 sd ra,40(sp) + 80022af2: e032 sd a2,0(sp) + 80022af4: 862e mv a2,a1 + 80022af6: 85aa mv a1,a0 + 80022af8: 6502 ld a0,0(sp) + 80022afa: e82e sd a1,16(sp) + 80022afc: ec32 sd a2,24(sp) + 80022afe: f02a sd a0,32(sp) + unsafe { index.get_unchecked_mut(self) } + 80022b00: 00000097 auipc ra,0x0 + 80022b04: 1c0080e7 jalr 448(ra) # 80022cc0 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17ha2bcc8944b7af021E> + 80022b08: e42a sd a0,8(sp) + 80022b0a: a009 j 80022b0c <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$17get_unchecked_mut17h83deb5daf75ed8d6E+0x1e> + } + 80022b0c: 6522 ld a0,8(sp) + 80022b0e: 70a2 ld ra,40(sp) + 80022b10: 6145 addi sp,sp,48 + 80022b12: 8082 ret + +Disassembly of section .text._ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E: + +0000000080022b14 <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E>: +unsafe fn init_slice_empty(cur: &mut usize, len: usize) -> *mut [T] { + 80022b14: 711d addi sp,sp,-96 + 80022b16: ec86 sd ra,88(sp) + 80022b18: f42e sd a1,40(sp) + 80022b1a: f82a sd a0,48(sp) + 80022b1c: e0aa sd a0,64(sp) + 80022b1e: e4ae sd a1,72(sp) + let raw_ptr = *cur as *mut T; + 80022b20: 6108 ld a0,0(a0) + 80022b22: fc2a sd a0,56(sp) + 80022b24: e8aa sd a0,80(sp) + *cur += mem::size_of::() * len; + 80022b26: a009 j 80022b28 <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E+0x14> + 80022b28: 7522 ld a0,40(sp) + 80022b2a: f02a sd a0,32(sp) + 80022b2c: 4501 li a0,0 + 80022b2e: e139 bnez a0,80022b74 <.LBB8_8> + 80022b30: a009 j 80022b32 <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E+0x1e> + 80022b32: 7502 ld a0,32(sp) + 80022b34: 75c2 ld a1,48(sp) + 80022b36: 618c ld a1,0(a1) + 80022b38: 952e add a0,a0,a1 + 80022b3a: ec2a sd a0,24(sp) + 80022b3c: 04b56b63 bltu a0,a1,80022b92 <.LBB8_10> + 80022b40: a009 j 80022b42 <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E+0x2e> + 80022b42: 7622 ld a2,40(sp) + 80022b44: 7562 ld a0,56(sp) + 80022b46: 65e2 ld a1,24(sp) + 80022b48: 76c2 ld a3,48(sp) + 80022b4a: e28c sd a1,0(a3) + 80022b4c: 4581 li a1,0 + ptr::write_bytes(raw_ptr, 0, len); + 80022b4e: 00000097 auipc ra,0x0 + 80022b52: eb0080e7 jalr -336(ra) # 800229fe <_ZN4core10intrinsics11write_bytes17hfabd30e5bfcb1b55E> + 80022b56: a009 j 80022b58 <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E+0x44> + ptr::slice_from_raw_parts_mut(raw_ptr, len) + 80022b58: 75a2 ld a1,40(sp) + 80022b5a: 7562 ld a0,56(sp) + 80022b5c: 00000097 auipc ra,0x0 + 80022b60: b1a080e7 jalr -1254(ra) # 80022676 <_ZN4core3ptr24slice_from_raw_parts_mut17h39496eba86137ee5E> + 80022b64: e42a sd a0,8(sp) + 80022b66: e82e sd a1,16(sp) + 80022b68: a009 j 80022b6a <_ZN9allocator16init_slice_empty17h3fa3ac5493bc8701E+0x56> +} + 80022b6a: 65c2 ld a1,16(sp) + 80022b6c: 6522 ld a0,8(sp) + 80022b6e: 60e6 ld ra,88(sp) + 80022b70: 6125 addi sp,sp,96 + 80022b72: 8082 ret + +0000000080022b74 <.LBB8_8>: + *cur += mem::size_of::() * len; + 80022b74: 0000b517 auipc a0,0xb + 80022b78: f9c50513 addi a0,a0,-100 # 8002db10 + +0000000080022b7c <.LBB8_9>: + 80022b7c: 0000b617 auipc a2,0xb + 80022b80: f7c60613 addi a2,a2,-132 # 8002daf8 <.L__unnamed_1> + 80022b84: 02100593 li a1,33 + 80022b88: 00000097 auipc ra,0x0 + 80022b8c: 5bc080e7 jalr 1468(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080022b92 <.LBB8_10>: + 80022b92: 0000b517 auipc a0,0xb + 80022b96: fbe50513 addi a0,a0,-66 # 8002db50 + +0000000080022b9a <.LBB8_11>: + 80022b9a: 0000b617 auipc a2,0xb + 80022b9e: f9e60613 addi a2,a2,-98 # 8002db38 <.L__unnamed_2> + 80022ba2: 45f1 li a1,28 + 80022ba4: 00000097 auipc ra,0x0 + 80022ba8: 5a0080e7 jalr 1440(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN9allocator16init_slice_empty17h570498bae7ef4c88E: + +0000000080022bae <_ZN9allocator16init_slice_empty17h570498bae7ef4c88E>: +unsafe fn init_slice_empty(cur: &mut usize, len: usize) -> *mut [T] { + 80022bae: 711d addi sp,sp,-96 + 80022bb0: ec86 sd ra,88(sp) + 80022bb2: f42e sd a1,40(sp) + 80022bb4: f82a sd a0,48(sp) + 80022bb6: e0aa sd a0,64(sp) + 80022bb8: e4ae sd a1,72(sp) + let raw_ptr = *cur as *mut T; + 80022bba: 6108 ld a0,0(a0) + 80022bbc: fc2a sd a0,56(sp) + 80022bbe: e8aa sd a0,80(sp) + *cur += mem::size_of::() * len; + 80022bc0: a009 j 80022bc2 <_ZN9allocator16init_slice_empty17h570498bae7ef4c88E+0x14> + 80022bc2: 7522 ld a0,40(sp) + 80022bc4: 03000593 li a1,48 + 80022bc8: 02b50633 mul a2,a0,a1 + 80022bcc: f032 sd a2,32(sp) + 80022bce: 02b53533 mulhu a0,a0,a1 + 80022bd2: 4581 li a1,0 + 80022bd4: 04b51463 bne a0,a1,80022c1c <.LBB9_8> + 80022bd8: a009 j 80022bda <_ZN9allocator16init_slice_empty17h570498bae7ef4c88E+0x2c> + 80022bda: 7502 ld a0,32(sp) + 80022bdc: 75c2 ld a1,48(sp) + 80022bde: 618c ld a1,0(a1) + 80022be0: 952e add a0,a0,a1 + 80022be2: ec2a sd a0,24(sp) + 80022be4: 04b56b63 bltu a0,a1,80022c3a <.LBB9_10> + 80022be8: a009 j 80022bea <_ZN9allocator16init_slice_empty17h570498bae7ef4c88E+0x3c> + 80022bea: 7622 ld a2,40(sp) + 80022bec: 7562 ld a0,56(sp) + 80022bee: 65e2 ld a1,24(sp) + 80022bf0: 76c2 ld a3,48(sp) + 80022bf2: e28c sd a1,0(a3) + 80022bf4: 4581 li a1,0 + ptr::write_bytes(raw_ptr, 0, len); + 80022bf6: 00000097 auipc ra,0x0 + 80022bfa: de4080e7 jalr -540(ra) # 800229da <_ZN4core10intrinsics11write_bytes17hd3155cf1c4a39b27E> + 80022bfe: a009 j 80022c00 <_ZN9allocator16init_slice_empty17h570498bae7ef4c88E+0x52> + ptr::slice_from_raw_parts_mut(raw_ptr, len) + 80022c00: 75a2 ld a1,40(sp) + 80022c02: 7562 ld a0,56(sp) + 80022c04: 00000097 auipc ra,0x0 + 80022c08: aa4080e7 jalr -1372(ra) # 800226a8 <_ZN4core3ptr24slice_from_raw_parts_mut17h9355ff019662f88fE> + 80022c0c: e42a sd a0,8(sp) + 80022c0e: e82e sd a1,16(sp) + 80022c10: a009 j 80022c12 <_ZN9allocator16init_slice_empty17h570498bae7ef4c88E+0x64> +} + 80022c12: 65c2 ld a1,16(sp) + 80022c14: 6522 ld a0,8(sp) + 80022c16: 60e6 ld ra,88(sp) + 80022c18: 6125 addi sp,sp,96 + 80022c1a: 8082 ret + +0000000080022c1c <.LBB9_8>: + *cur += mem::size_of::() * len; + 80022c1c: 0000b517 auipc a0,0xb + 80022c20: ef450513 addi a0,a0,-268 # 8002db10 + +0000000080022c24 <.LBB9_9>: + 80022c24: 0000b617 auipc a2,0xb + 80022c28: ed460613 addi a2,a2,-300 # 8002daf8 <.L__unnamed_1> + 80022c2c: 02100593 li a1,33 + 80022c30: 00000097 auipc ra,0x0 + 80022c34: 514080e7 jalr 1300(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +0000000080022c3a <.LBB9_10>: + 80022c3a: 0000b517 auipc a0,0xb + 80022c3e: f1650513 addi a0,a0,-234 # 8002db50 + +0000000080022c42 <.LBB9_11>: + 80022c42: 0000b617 auipc a2,0xb + 80022c46: ef660613 addi a2,a2,-266 # 8002db38 <.L__unnamed_2> + 80022c4a: 45f1 li a1,28 + 80022c4c: 00000097 auipc ra,0x0 + 80022c50: 4f8080e7 jalr 1272(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h2bd08456cf1cb28dE: + +0000000080022c56 <_ZN4core5clone5impls54_$LT$impl$u20$core..clone..Clone$u20$for$u20$usize$GT$5clone17h2bd08456cf1cb28dE>: + fn clone(&self) -> Self { + 80022c56: 1141 addi sp,sp,-16 + 80022c58: e42a sd a0,8(sp) + *self + 80022c5a: 6108 ld a0,0(a0) + } + 80022c5c: 0141 addi sp,sp,16 + 80022c5e: 8082 ret + +Disassembly of section .text._ZN4core3ptr8metadata18from_raw_parts_mut17hd3633c4516987911E: + +0000000080022c60 <_ZN4core3ptr8metadata18from_raw_parts_mut17hd3633c4516987911E>: +/// +/// See the documentation of [`from_raw_parts`] for more details. +#[unstable(feature = "ptr_metadata", issue = "81513")] +#[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")] +#[inline] +pub const fn from_raw_parts_mut( + 80022c60: 7179 addi sp,sp,-48 + 80022c62: f02a sd a0,32(sp) + 80022c64: f42e sd a1,40(sp) + metadata: ::Metadata, +) -> *mut T { + // SAFETY: Accessing the value from the `PtrRepr` union is safe since *const T + // and PtrComponents have the same memory layouts. Only std can make this + // guarantee. + unsafe { PtrRepr { components: PtrComponents { data_address, metadata } }.mut_ptr } + 80022c66: e82a sd a0,16(sp) + 80022c68: ec2e sd a1,24(sp) + 80022c6a: e02a sd a0,0(sp) + 80022c6c: e42e sd a1,8(sp) +} + 80022c6e: 6145 addi sp,sp,48 + 80022c70: 8082 ret + +Disassembly of section .text._ZN4core3ptr8metadata18from_raw_parts_mut17hf93e4b94956554aaE: + +0000000080022c72 <_ZN4core3ptr8metadata18from_raw_parts_mut17hf93e4b94956554aaE>: +pub const fn from_raw_parts_mut( + 80022c72: 7179 addi sp,sp,-48 + 80022c74: f02a sd a0,32(sp) + 80022c76: f42e sd a1,40(sp) + unsafe { PtrRepr { components: PtrComponents { data_address, metadata } }.mut_ptr } + 80022c78: e82a sd a0,16(sp) + 80022c7a: ec2e sd a1,24(sp) + 80022c7c: e02a sd a0,0(sp) + 80022c7e: e42e sd a1,8(sp) +} + 80022c80: 6145 addi sp,sp,48 + 80022c82: 8082 ret + +Disassembly of section .text._ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$13get_unchecked17hb36b3c40d6b3daa6E: + +0000000080022c84 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$13get_unchecked17hb36b3c40d6b3daa6E>: + unsafe fn get_unchecked(self, slice: *const [T]) -> *const T { + 80022c84: 715d addi sp,sp,-80 + 80022c86: e486 sd ra,72(sp) + 80022c88: e832 sd a2,16(sp) + 80022c8a: 862e mv a2,a1 + 80022c8c: 65c2 ld a1,16(sp) + 80022c8e: ec32 sd a2,24(sp) + 80022c90: 862a mv a2,a0 + 80022c92: 6562 ld a0,24(sp) + 80022c94: f032 sd a2,32(sp) + 80022c96: f832 sd a2,48(sp) + 80022c98: fc2a sd a0,56(sp) + 80022c9a: e0ae sd a1,64(sp) + unsafe { slice.as_ptr().add(self) } + 80022c9c: ffffe097 auipc ra,0xffffe + 80022ca0: aca080e7 jalr -1334(ra) # 80020766 <_ZN4core3ptr9const_ptr43_$LT$impl$u20$$BP$const$u20$$u5b$T$u5d$$GT$6as_ptr17hcf3eefd405b9d730E> + 80022ca4: f42a sd a0,40(sp) + 80022ca6: a009 j 80022ca8 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$13get_unchecked17hb36b3c40d6b3daa6E+0x24> + 80022ca8: 7582 ld a1,32(sp) + 80022caa: 7522 ld a0,40(sp) + 80022cac: ffffe097 auipc ra,0xffffe + 80022cb0: a10080e7 jalr -1520(ra) # 800206bc <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$3add17h3ef2f165a29b2365E> + 80022cb4: e42a sd a0,8(sp) + 80022cb6: a009 j 80022cb8 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$13get_unchecked17hb36b3c40d6b3daa6E+0x34> + } + 80022cb8: 6522 ld a0,8(sp) + 80022cba: 60a6 ld ra,72(sp) + 80022cbc: 6161 addi sp,sp,80 + 80022cbe: 8082 ret + +Disassembly of section .text._ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17ha2bcc8944b7af021E: + +0000000080022cc0 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17ha2bcc8944b7af021E>: + unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T { + 80022cc0: 715d addi sp,sp,-80 + 80022cc2: e486 sd ra,72(sp) + 80022cc4: e832 sd a2,16(sp) + 80022cc6: 862e mv a2,a1 + 80022cc8: 65c2 ld a1,16(sp) + 80022cca: ec32 sd a2,24(sp) + 80022ccc: 862a mv a2,a0 + 80022cce: 6562 ld a0,24(sp) + 80022cd0: f032 sd a2,32(sp) + 80022cd2: f832 sd a2,48(sp) + 80022cd4: fc2a sd a0,56(sp) + 80022cd6: e0ae sd a1,64(sp) + unsafe { slice.as_mut_ptr().add(self) } + 80022cd8: 00000097 auipc ra,0x0 + 80022cdc: e0c080e7 jalr -500(ra) # 80022ae4 <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h6f6f43a247b8051cE> + 80022ce0: f42a sd a0,40(sp) + 80022ce2: a009 j 80022ce4 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17ha2bcc8944b7af021E+0x24> + 80022ce4: 7582 ld a1,32(sp) + 80022ce6: 7522 ld a0,40(sp) + 80022ce8: 00000097 auipc ra,0x0 + 80022cec: d4e080e7 jalr -690(ra) # 80022a36 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h94cbb879d32de261E> + 80022cf0: e42a sd a0,8(sp) + 80022cf2: a009 j 80022cf4 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17ha2bcc8944b7af021E+0x34> + } + 80022cf4: 6522 ld a0,8(sp) + 80022cf6: 60a6 ld ra,72(sp) + 80022cf8: 6161 addi sp,sp,80 + 80022cfa: 8082 ret + +Disassembly of section .text._ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17hc32ec1251c36865fE: + +0000000080022cfc <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17hc32ec1251c36865fE>: + unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T { + 80022cfc: 715d addi sp,sp,-80 + 80022cfe: e486 sd ra,72(sp) + 80022d00: e832 sd a2,16(sp) + 80022d02: 862e mv a2,a1 + 80022d04: 65c2 ld a1,16(sp) + 80022d06: ec32 sd a2,24(sp) + 80022d08: 862a mv a2,a0 + 80022d0a: 6562 ld a0,24(sp) + 80022d0c: f032 sd a2,32(sp) + 80022d0e: f832 sd a2,48(sp) + 80022d10: fc2a sd a0,56(sp) + 80022d12: e0ae sd a1,64(sp) + unsafe { slice.as_mut_ptr().add(self) } + 80022d14: ffffe097 auipc ra,0xffffe + 80022d18: 95e080e7 jalr -1698(ra) # 80020672 <_ZN4core3ptr7mut_ptr41_$LT$impl$u20$$BP$mut$u20$$u5b$T$u5d$$GT$10as_mut_ptr17h80398cc0098c8b0fE> + 80022d1c: f42a sd a0,40(sp) + 80022d1e: a009 j 80022d20 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17hc32ec1251c36865fE+0x24> + 80022d20: 7582 ld a1,32(sp) + 80022d22: 7522 ld a0,40(sp) + 80022d24: ffffe097 auipc ra,0xffffe + 80022d28: 8a8080e7 jalr -1880(ra) # 800205cc <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$3add17h1d203f00cca684c1E> + 80022d2c: e42a sd a0,8(sp) + 80022d2e: a009 j 80022d30 <_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$17get_unchecked_mut17hc32ec1251c36865fE+0x34> + } + 80022d30: 6522 ld a0,8(sp) + 80022d32: 60a6 ld ra,72(sp) + 80022d34: 6161 addi sp,sp,80 + 80022d36: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE: + +0000000080022d38 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE>: + pub unsafe fn as_mut<'a>(self) -> Option<&'a mut T> { + 80022d38: 7179 addi sp,sp,-48 + 80022d3a: f406 sd ra,40(sp) + 80022d3c: e42a sd a0,8(sp) + 80022d3e: f02a sd a0,32(sp) + if self.is_null() { None } else { unsafe { Some(&mut *self) } } + 80022d40: 00000097 auipc ra,0x0 + 80022d44: 02a080e7 jalr 42(ra) # 80022d6a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hb17ce9bdda6c1a43E> + 80022d48: e82a sd a0,16(sp) + 80022d4a: a009 j 80022d4c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE+0x14> + 80022d4c: 6542 ld a0,16(sp) + 80022d4e: 4581 li a1,0 + 80022d50: 00b50663 beq a0,a1,80022d5c <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE+0x24> + 80022d54: a009 j 80022d56 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE+0x1e> + 80022d56: 4501 li a0,0 + 80022d58: ec2a sd a0,24(sp) + 80022d5a: a021 j 80022d62 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE+0x2a> + 80022d5c: 6522 ld a0,8(sp) + 80022d5e: ec2a sd a0,24(sp) + 80022d60: a009 j 80022d62 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$6as_mut17h1d891c09167259ccE+0x2a> + } + 80022d62: 6562 ld a0,24(sp) + 80022d64: 70a2 ld ra,40(sp) + 80022d66: 6145 addi sp,sp,48 + 80022d68: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hb17ce9bdda6c1a43E: + +0000000080022d6a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hb17ce9bdda6c1a43E>: + pub const fn is_null(self) -> bool { + 80022d6a: 1101 addi sp,sp,-32 + 80022d6c: ec06 sd ra,24(sp) + 80022d6e: e82a sd a0,16(sp) + (self as *mut u8).guaranteed_eq(null_mut()) + 80022d70: e42a sd a0,8(sp) + 80022d72: a009 j 80022d74 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hb17ce9bdda6c1a43E+0xa> + 80022d74: 6522 ld a0,8(sp) + 80022d76: 4581 li a1,0 + 80022d78: ffffe097 auipc ra,0xffffe + 80022d7c: 83a080e7 jalr -1990(ra) # 800205b2 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h568dab4191b83956E> + 80022d80: e02a sd a0,0(sp) + 80022d82: a009 j 80022d84 <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$7is_null17hb17ce9bdda6c1a43E+0x1a> + } + 80022d84: 6502 ld a0,0(sp) + 80022d86: 60e2 ld ra,24(sp) + 80022d88: 6105 addi sp,sp,32 + 80022d8a: 8082 ret + +Disassembly of section .text._ZN4core3cmp3Ord3max17ha4f6a78e5e1bca09E: + +0000000080022d8c <_ZN4core3cmp3Ord3max17ha4f6a78e5e1bca09E>: + fn max(self, other: Self) -> Self + 80022d8c: 1101 addi sp,sp,-32 + 80022d8e: ec06 sd ra,24(sp) + 80022d90: e42a sd a0,8(sp) + 80022d92: e82e sd a1,16(sp) + max_by(self, other, Ord::cmp) + 80022d94: 00000097 auipc ra,0x0 + 80022d98: 030080e7 jalr 48(ra) # 80022dc4 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E> + 80022d9c: e02a sd a0,0(sp) + 80022d9e: a009 j 80022da0 <_ZN4core3cmp3Ord3max17ha4f6a78e5e1bca09E+0x14> + } + 80022da0: 6502 ld a0,0(sp) + 80022da2: 60e2 ld ra,24(sp) + 80022da4: 6105 addi sp,sp,32 + 80022da6: 8082 ret + +Disassembly of section .text._ZN4core3cmp3max17h3dc8da765fcdebd4E: + +0000000080022da8 <_ZN4core3cmp3max17h3dc8da765fcdebd4E>: +pub fn max(v1: T, v2: T) -> T { + 80022da8: 1101 addi sp,sp,-32 + 80022daa: ec06 sd ra,24(sp) + 80022dac: e42a sd a0,8(sp) + 80022dae: e82e sd a1,16(sp) + v1.max(v2) + 80022db0: 00000097 auipc ra,0x0 + 80022db4: fdc080e7 jalr -36(ra) # 80022d8c <_ZN4core3cmp3Ord3max17ha4f6a78e5e1bca09E> + 80022db8: e02a sd a0,0(sp) + 80022dba: a009 j 80022dbc <_ZN4core3cmp3max17h3dc8da765fcdebd4E+0x14> +} + 80022dbc: 6502 ld a0,0(sp) + 80022dbe: 60e2 ld ra,24(sp) + 80022dc0: 6105 addi sp,sp,32 + 80022dc2: 8082 ret + +Disassembly of section .text._ZN4core3cmp6max_by17h5ce2d208ffcd1be0E: + +0000000080022dc4 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E>: +pub fn max_by Ordering>(v1: T, v2: T, compare: F) -> T { + 80022dc4: 715d addi sp,sp,-80 + 80022dc6: e486 sd ra,72(sp) + 80022dc8: e42a sd a0,8(sp) + 80022dca: e82e sd a1,16(sp) + 80022dcc: 4505 li a0,1 + match compare(&v1, &v2) { + 80022dce: 02a10fa3 sb a0,63(sp) + 80022dd2: 02a10f23 sb a0,62(sp) + 80022dd6: 0028 addi a0,sp,8 + 80022dd8: f42a sd a0,40(sp) + 80022dda: 080c addi a1,sp,16 + 80022ddc: f82e sd a1,48(sp) + 80022dde: ffffe097 auipc ra,0xffffe + 80022de2: ad2080e7 jalr -1326(ra) # 800208b0 <_ZN4core3ops8function6FnOnce9call_once17h199d3571a582934bE> + 80022de6: 02a103a3 sb a0,39(sp) + 80022dea: a009 j 80022dec <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x28> + Ordering::Less | Ordering::Equal => v2, + 80022dec: 02710503 lb a0,39(sp) + 80022df0: 0505 addi a0,a0,1 + 80022df2: 4589 li a1,2 + 80022df4: 00b56a63 bltu a0,a1,80022e08 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x44> + 80022df8: a009 j 80022dfa <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x36> + 80022dfa: 4501 li a0,0 + Ordering::Greater => v1, + 80022dfc: 02a10fa3 sb a0,63(sp) + 80022e00: 6522 ld a0,8(sp) + 80022e02: ec2a sd a0,24(sp) + match compare(&v1, &v2) { + 80022e04: a801 j 80022e14 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x50> + 80022e06: 0000 unimp + 80022e08: 4501 li a0,0 + Ordering::Less | Ordering::Equal => v2, + 80022e0a: 02a10f23 sb a0,62(sp) + 80022e0e: 6542 ld a0,16(sp) + 80022e10: ec2a sd a0,24(sp) + match compare(&v1, &v2) { + 80022e12: a009 j 80022e14 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x50> +} + 80022e14: 03e14503 lbu a0,62(sp) + 80022e18: 8905 andi a0,a0,1 + 80022e1a: e919 bnez a0,80022e30 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x6c> + 80022e1c: a009 j 80022e1e <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x5a> + 80022e1e: 03f14503 lbu a0,63(sp) + 80022e22: 8905 andi a0,a0,1 + 80022e24: e519 bnez a0,80022e32 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x6e> + 80022e26: a009 j 80022e28 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x64> + 80022e28: 6562 ld a0,24(sp) + 80022e2a: 60a6 ld ra,72(sp) + 80022e2c: 6161 addi sp,sp,80 + 80022e2e: 8082 ret + 80022e30: b7fd j 80022e1e <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x5a> + 80022e32: bfdd j 80022e28 <_ZN4core3cmp6max_by17h5ce2d208ffcd1be0E+0x64> + +Disassembly of section .text._ZN4core4sync6atomic11atomic_load17h7c28be5fa6ab6ea0E: + +0000000080022e34 <_ZN4core4sync6atomic11atomic_load17h7c28be5fa6ab6ea0E>: +unsafe fn atomic_load(dst: *const T, order: Ordering) -> T { + 80022e34: 1101 addi sp,sp,-32 + 80022e36: e02a sd a0,0(sp) + 80022e38: 00b10b23 sb a1,22(sp) + 80022e3c: ec2a sd a0,24(sp) + Acquire => intrinsics::atomic_load_acq(dst), + 80022e3e: 0ff5f513 andi a0,a1,255 + 80022e42: e42a sd a0,8(sp) + 80022e44: 6522 ld a0,8(sp) + 80022e46: 050e slli a0,a0,0x3 + +0000000080022e48 <.LBB1_12>: + 80022e48: 0000b597 auipc a1,0xb + 80022e4c: d2858593 addi a1,a1,-728 # 8002db70 <.LJTI1_0> + 80022e50: 952e add a0,a0,a1 + 80022e52: 6108 ld a0,0(a0) + 80022e54: 8502 jr a0 + +0000000080022e56 <.LBB1_13>: + AcqRel => panic!("there is no such thing as an acquire/release load"), + 80022e56: 0000b517 auipc a0,0xb + 80022e5a: d4250513 addi a0,a0,-702 # 8002db98 <.L__unnamed_1> + +0000000080022e5e <.LBB1_14>: + 80022e5e: 0000b617 auipc a2,0xb + 80022e62: dea60613 addi a2,a2,-534 # 8002dc48 <.L__unnamed_2> + 80022e66: 03100593 li a1,49 + 80022e6a: 00000097 auipc ra,0x0 + 80022e6e: 2da080e7 jalr 730(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80022e72: 0000 unimp + ... + +0000000080022e76 <.LBB1_4>: + Acquire => intrinsics::atomic_load_acq(dst), + 80022e76: 6502 ld a0,0(sp) + 80022e78: 00050503 lb a0,0(a0) + 80022e7c: 0230000f fence r,rw + 80022e80: 00a10ba3 sb a0,23(sp) + 80022e84: a009 j 80022e86 <.LBB1_4+0x10> + match order { + 80022e86: a091 j 80022eca <.LBB1_16+0x16> + +0000000080022e88 <.LBB1_6>: + Relaxed => intrinsics::atomic_load_relaxed(dst), + 80022e88: 6502 ld a0,0(sp) + 80022e8a: 00050503 lb a0,0(a0) + 80022e8e: 00a10ba3 sb a0,23(sp) + 80022e92: a009 j 80022e94 <.LBB1_6+0xc> + match order { + 80022e94: a81d j 80022eca <.LBB1_16+0x16> + +0000000080022e96 <.LBB1_8>: + SeqCst => intrinsics::atomic_load(dst), + 80022e96: 6502 ld a0,0(sp) + 80022e98: 0330000f fence rw,rw + 80022e9c: 00050503 lb a0,0(a0) + 80022ea0: 0230000f fence r,rw + 80022ea4: 00a10ba3 sb a0,23(sp) + 80022ea8: a009 j 80022eaa <.LBB1_8+0x14> + match order { + 80022eaa: a005 j 80022eca <.LBB1_16+0x16> + +0000000080022eac <.LBB1_10>: + Release => panic!("there is no such thing as a release load"), + 80022eac: 0000b517 auipc a0,0xb + 80022eb0: db450513 addi a0,a0,-588 # 8002dc60 <.L__unnamed_3> + +0000000080022eb4 <.LBB1_16>: + 80022eb4: 0000b617 auipc a2,0xb + 80022eb8: dd460613 addi a2,a2,-556 # 8002dc88 <.L__unnamed_4> + 80022ebc: 02800593 li a1,40 + 80022ec0: 00000097 auipc ra,0x0 + 80022ec4: 284080e7 jalr 644(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80022ec8: 0000 unimp +} + 80022eca: 01710503 lb a0,23(sp) + 80022ece: 6105 addi sp,sp,32 + 80022ed0: 8082 ret + +Disassembly of section .text._ZN4core3fmt10ArgumentV13new17ha67f1954b9155e6dE: + +0000000080022ed2 <_ZN4core3fmt10ArgumentV13new17ha67f1954b9155e6dE>: + pub fn new<'b, T>(x: &'b T, f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> { + 80022ed2: 715d addi sp,sp,-80 + 80022ed4: e82a sd a0,16(sp) + 80022ed6: f82a sd a0,48(sp) + 80022ed8: fc2e sd a1,56(sp) + unsafe { ArgumentV1 { formatter: mem::transmute(f), value: mem::transmute(x) } } + 80022eda: e0ae sd a1,64(sp) + 80022edc: ec2e sd a1,24(sp) + 80022ede: a009 j 80022ee0 <_ZN4core3fmt10ArgumentV13new17ha67f1954b9155e6dE+0xe> + 80022ee0: 6542 ld a0,16(sp) + 80022ee2: e4aa sd a0,72(sp) + 80022ee4: e42a sd a0,8(sp) + 80022ee6: a009 j 80022ee8 <_ZN4core3fmt10ArgumentV13new17ha67f1954b9155e6dE+0x16> + 80022ee8: 65e2 ld a1,24(sp) + 80022eea: 6522 ld a0,8(sp) + 80022eec: f02a sd a0,32(sp) + 80022eee: f42e sd a1,40(sp) + } + 80022ef0: 6161 addi sp,sp,80 + 80022ef2: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17h34ebeaa57b5c7248E: + +0000000080022ef4 <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17h34ebeaa57b5c7248E>: + pub const fn get(&self) -> *mut T { + 80022ef4: 1141 addi sp,sp,-16 + 80022ef6: e42a sd a0,8(sp) + } + 80022ef8: 0141 addi sp,sp,16 + 80022efa: 8082 ret + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3new17h3aa2f2534c029263E: + +0000000080022efc <_ZN4core4cell19UnsafeCell$LT$T$GT$3new17h3aa2f2534c029263E>: + pub const fn new(value: T) -> UnsafeCell { + 80022efc: 1141 addi sp,sp,-16 + 80022efe: 00a107a3 sb a0,15(sp) + UnsafeCell { value } + 80022f02: 00a10723 sb a0,14(sp) + } + 80022f06: 0141 addi sp,sp,16 + 80022f08: 8082 ret + +Disassembly of section .text._ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE: + +0000000080022f0a <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE>: + pub const fn guaranteed_eq(self, other: *mut T) -> bool + 80022f0a: 1101 addi sp,sp,-32 + 80022f0c: e42a sd a0,8(sp) + 80022f0e: e82e sd a1,16(sp) + intrinsics::ptr_guaranteed_eq(self as *const _, other as *const _) + 80022f10: 8d2d xor a0,a0,a1 + 80022f12: 00153513 seqz a0,a0 + 80022f16: e02a sd a0,0(sp) + 80022f18: 00a10fa3 sb a0,31(sp) + 80022f1c: a009 j 80022f1e <_ZN4core3ptr7mut_ptr31_$LT$impl$u20$$BP$mut$u20$T$GT$13guaranteed_eq17h32ea8c99c0b8220dE+0x14> + } + 80022f1e: 6502 ld a0,0(sp) + 80022f20: 6105 addi sp,sp,32 + 80022f22: 8082 ret + +Disassembly of section .text._ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17h0ce622e77376dc6cE: + +0000000080022f24 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17h0ce622e77376dc6cE>: + pub const fn guaranteed_eq(self, other: *const T) -> bool + 80022f24: 1101 addi sp,sp,-32 + 80022f26: e42a sd a0,8(sp) + 80022f28: e82e sd a1,16(sp) + intrinsics::ptr_guaranteed_eq(self, other) + 80022f2a: 8d2d xor a0,a0,a1 + 80022f2c: 00153513 seqz a0,a0 + 80022f30: e02a sd a0,0(sp) + 80022f32: 00a10fa3 sb a0,31(sp) + 80022f36: a009 j 80022f38 <_ZN4core3ptr9const_ptr33_$LT$impl$u20$$BP$const$u20$T$GT$13guaranteed_eq17h0ce622e77376dc6cE+0x14> + } + 80022f38: 6502 ld a0,0(sp) + 80022f3a: 6105 addi sp,sp,32 + 80022f3c: 8082 ret + +Disassembly of section .text.unlikely._ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE: + +0000000080022f3e <_ZN5alloc5alloc18handle_alloc_error17haa1b1c0a80642c5aE>: + 80022f3e: 1141 addi sp,sp,-16 + 80022f40: e406 sd ra,8(sp) + 80022f42: ffffd097 auipc ra,0xffffd + 80022f46: 606080e7 jalr 1542(ra) # 80020548 <__rust_alloc_error_handler> + ... + +Disassembly of section .text.__rg_oom: + +0000000080022f4c <__rg_oom>: + 80022f4c: 1141 addi sp,sp,-16 + 80022f4e: e406 sd ra,8(sp) + 80022f50: fffea097 auipc ra,0xfffea + 80022f54: 16e080e7 jalr 366(ra) # 8000d0be + ... + +Disassembly of section .text._ZN5alloc7raw_vec17capacity_overflow17hae1c560931d103e4E: + +0000000080022f5a <_ZN5alloc7raw_vec17capacity_overflow17hae1c560931d103e4E>: + 80022f5a: 1141 addi sp,sp,-16 + 80022f5c: e406 sd ra,8(sp) + +0000000080022f5e <.LBB24_1>: + 80022f5e: 0000b517 auipc a0,0xb + 80022f62: d5e50513 addi a0,a0,-674 # 8002dcbc <.Lanon.44beac3b33b5e076e135e766d0ea4256.19> + +0000000080022f66 <.LBB24_2>: + 80022f66: 0000b617 auipc a2,0xb + 80022f6a: d6a60613 addi a2,a2,-662 # 8002dcd0 <.Lanon.44beac3b33b5e076e135e766d0ea4256.20> + 80022f6e: 45c5 li a1,17 + 80022f70: 00000097 auipc ra,0x0 + 80022f74: 1d4080e7 jalr 468(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN4core4cell19UnsafeCell$LT$T$GT$3get17hcdc438fb74b7ecc8E: + +0000000080022f7a <_ZN4core4cell19UnsafeCell$LT$T$GT$3get17hcdc438fb74b7ecc8E>: + pub const fn get(&self) -> *mut T { + 80022f7a: 1141 addi sp,sp,-16 + 80022f7c: e42a sd a0,8(sp) + } + 80022f7e: 0141 addi sp,sp,16 + 80022f80: 8082 ret + +Disassembly of section .text._ZN4core3ops8function6FnOnce9call_once17h6147212214d3120cE: + +0000000080022f82 <_ZN4core3ops8function6FnOnce9call_once17h6147212214d3120cE>: + 80022f82: 6108 ld a0,0(a0) + 80022f84: a001 j 80022f84 <_ZN4core3ops8function6FnOnce9call_once17h6147212214d3120cE+0x2> + +Disassembly of section .text._ZN4core3ptr102drop_in_place$LT$$RF$core..iter..adapters..copied..Copied$LT$core..slice..iter..Iter$LT$u8$GT$$GT$$GT$17hedf53d70a7e54828E: + +0000000080022f86 <_ZN4core3ptr102drop_in_place$LT$$RF$core..iter..adapters..copied..Copied$LT$core..slice..iter..Iter$LT$u8$GT$$GT$$GT$17hedf53d70a7e54828E>: + 80022f86: 8082 ret + +Disassembly of section .text._ZN71_$LT$core..ops..range..Range$LT$Idx$GT$$u20$as$u20$core..fmt..Debug$GT$3fmt17hafa23fe214721e38E: + +0000000080022f88 <_ZN71_$LT$core..ops..range..Range$LT$Idx$GT$$u20$as$u20$core..fmt..Debug$GT$3fmt17hafa23fe214721e38E>: + 80022f88: 715d addi sp,sp,-80 + 80022f8a: e486 sd ra,72(sp) + 80022f8c: e0a2 sd s0,64(sp) + 80022f8e: fc26 sd s1,56(sp) + 80022f90: 842e mv s0,a1 + 80022f92: 84aa mv s1,a0 + 80022f94: 00002097 auipc ra,0x2 + 80022f98: 3e2080e7 jalr 994(ra) # 80025376 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE> + 80022f9c: e51d bnez a0,80022fca <.LBB78_5+0x18> + 80022f9e: 7008 ld a0,32(s0) + 80022fa0: 740c ld a1,40(s0) + +0000000080022fa2 <.LBB78_4>: + 80022fa2: 0000b617 auipc a2,0xb + 80022fa6: dae60613 addi a2,a2,-594 # 8002dd50 <.Lanon.f077182aff5f58a5660f14b1290425e3.134> + 80022faa: e432 sd a2,8(sp) + 80022fac: 4605 li a2,1 + 80022fae: e832 sd a2,16(sp) + 80022fb0: ec02 sd zero,24(sp) + +0000000080022fb2 <.LBB78_5>: + 80022fb2: 0000b617 auipc a2,0xb + 80022fb6: d9660613 addi a2,a2,-618 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 80022fba: f432 sd a2,40(sp) + 80022fbc: f802 sd zero,48(sp) + 80022fbe: 0030 addi a2,sp,8 + 80022fc0: 00001097 auipc ra,0x1 + 80022fc4: 9e6080e7 jalr -1562(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 80022fc8: c519 beqz a0,80022fd6 <.LBB78_5+0x24> + 80022fca: 4505 li a0,1 + 80022fcc: 74e2 ld s1,56(sp) + 80022fce: 6406 ld s0,64(sp) + 80022fd0: 60a6 ld ra,72(sp) + 80022fd2: 6161 addi sp,sp,80 + 80022fd4: 8082 ret + 80022fd6: 00848513 addi a0,s1,8 + 80022fda: 85a2 mv a1,s0 + 80022fdc: 74e2 ld s1,56(sp) + 80022fde: 6406 ld s0,64(sp) + 80022fe0: 60a6 ld ra,72(sp) + 80022fe2: 6161 addi sp,sp,80 + 80022fe4: 00002317 auipc t1,0x2 + 80022fe8: 39230067 jr 914(t1) # 80025376 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE> + +Disassembly of section .text._ZN36_$LT$T$u20$as$u20$core..any..Any$GT$7type_id17h43d5b99303c08f4dE: + +0000000080022fec <_ZN36_$LT$T$u20$as$u20$core..any..Any$GT$7type_id17h43d5b99303c08f4dE>: + 80022fec: 032d3537 lui a0,0x32d3 + 80022ff0: 2895051b addiw a0,a0,649 + 80022ff4: 0532 slli a0,a0,0xc + 80022ff6: 48950513 addi a0,a0,1161 # 32d3489 <.Lline_table_start0+0x329c024> + 80022ffa: 0532 slli a0,a0,0xc + 80022ffc: 69f50513 addi a0,a0,1695 + 80023000: 0532 slli a0,a0,0xc + 80023002: 85850513 addi a0,a0,-1960 + 80023006: 8082 ret + +Disassembly of section .text.unlikely._ZN4core6option13expect_failed17h0edd1e4bb5304a50E: + +0000000080023008 <_ZN4core6option13expect_failed17h0edd1e4bb5304a50E>: + 80023008: 711d addi sp,sp,-96 + 8002300a: ec86 sd ra,88(sp) + 8002300c: e42a sd a0,8(sp) + 8002300e: e82e sd a1,16(sp) + 80023010: 0028 addi a0,sp,8 + 80023012: e4aa sd a0,72(sp) + +0000000080023014 <.LBB119_1>: + 80023014: 00003517 auipc a0,0x3 + 80023018: ce450513 addi a0,a0,-796 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 8002301c: e8aa sd a0,80(sp) + +000000008002301e <.LBB119_2>: + 8002301e: 0000b517 auipc a0,0xb + 80023022: d7250513 addi a0,a0,-654 # 8002dd90 <.Lanon.f077182aff5f58a5660f14b1290425e3.169> + 80023026: ec2a sd a0,24(sp) + 80023028: 4505 li a0,1 + 8002302a: f02a sd a0,32(sp) + 8002302c: f402 sd zero,40(sp) + 8002302e: 00ac addi a1,sp,72 + 80023030: fc2e sd a1,56(sp) + 80023032: e0aa sd a0,64(sp) + 80023034: 0828 addi a0,sp,24 + 80023036: 85b2 mv a1,a2 + 80023038: 00000097 auipc ra,0x0 + 8002303c: 178080e7 jalr 376(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text._ZN61_$LT$core..panic..PanicInfo$u20$as$u20$core..fmt..Display$GT$3fmt17h17913560c4fcc8feE: + +0000000080023042 <_ZN61_$LT$core..panic..PanicInfo$u20$as$u20$core..fmt..Display$GT$3fmt17h17913560c4fcc8feE>: + 80023042: 7175 addi sp,sp,-144 + 80023044: e506 sd ra,136(sp) + 80023046: e122 sd s0,128(sp) + 80023048: fca6 sd s1,120(sp) + 8002304a: f8ca sd s2,112(sp) + 8002304c: f4ce sd s3,104(sp) + 8002304e: 0285b983 ld s3,40(a1) + 80023052: 7184 ld s1,32(a1) + 80023054: 0189b683 ld a3,24(s3) + 80023058: 892a mv s2,a0 + +000000008002305a <.LBB123_8>: + 8002305a: 0000b597 auipc a1,0xb + 8002305e: d6658593 addi a1,a1,-666 # 8002ddc0 <.Lanon.f077182aff5f58a5660f14b1290425e3.171> + 80023062: 4631 li a2,12 + 80023064: 8526 mv a0,s1 + 80023066: 9682 jalr a3 + 80023068: 4405 li s0,1 + 8002306a: e569 bnez a0,80023134 <.LBB123_14+0x26> + 8002306c: 01093503 ld a0,16(s2) + 80023070: c909 beqz a0,80023082 <.LBB123_9+0xa> + 80023072: e02a sd a0,0(sp) + 80023074: 850a mv a0,sp + 80023076: e42a sd a0,8(sp) + +0000000080023078 <.LBB123_9>: + 80023078: 00003517 auipc a0,0x3 + 8002307c: c9050513 addi a0,a0,-880 # 80025d08 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h78c3d125c3c6a2c3E> + 80023080: a835 j 800230bc <.LBB123_10+0x8> + 80023082: 00893503 ld a0,8(s2) + 80023086: 00093403 ld s0,0(s2) + 8002308a: 6d0c ld a1,24(a0) + 8002308c: 8522 mv a0,s0 + 8002308e: 9582 jalr a1 + 80023090: 007ef5b7 lui a1,0x7ef + 80023094: 2a95859b addiw a1,a1,681 + 80023098: 05ba slli a1,a1,0xe + 8002309a: 7bb58593 addi a1,a1,1979 # 7ef7bb <.Lline_table_start0+0x7b8356> + 8002309e: 05b2 slli a1,a1,0xc + 800230a0: 31f58593 addi a1,a1,799 + 800230a4: 05ba slli a1,a1,0xe + 800230a6: cf458593 addi a1,a1,-780 + 800230aa: 02b51e63 bne a0,a1,800230e6 <.LBB123_11+0x28> + 800230ae: e022 sd s0,0(sp) + 800230b0: 850a mv a0,sp + 800230b2: e42a sd a0,8(sp) + +00000000800230b4 <.LBB123_10>: + 800230b4: 00003517 auipc a0,0x3 + 800230b8: c8650513 addi a0,a0,-890 # 80025d3a <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h874d6ce7f8524becE> + 800230bc: e82a sd a0,16(sp) + +00000000800230be <.LBB123_11>: + 800230be: 0000b517 auipc a0,0xb + 800230c2: d1250513 addi a0,a0,-750 # 8002ddd0 <.Lanon.f077182aff5f58a5660f14b1290425e3.174> + 800230c6: fc2a sd a0,56(sp) + 800230c8: 4509 li a0,2 + 800230ca: e0aa sd a0,64(sp) + 800230cc: e482 sd zero,72(sp) + 800230ce: 0028 addi a0,sp,8 + 800230d0: ecaa sd a0,88(sp) + 800230d2: 4405 li s0,1 + 800230d4: f0a2 sd s0,96(sp) + 800230d6: 1830 addi a2,sp,56 + 800230d8: 8526 mv a0,s1 + 800230da: 85ce mv a1,s3 + 800230dc: 00001097 auipc ra,0x1 + 800230e0: 8ca080e7 jalr -1846(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 800230e4: e921 bnez a0,80023134 <.LBB123_14+0x26> + 800230e6: 01893503 ld a0,24(s2) + 800230ea: 01050593 addi a1,a0,16 + 800230ee: 01450613 addi a2,a0,20 + 800230f2: e42a sd a0,8(sp) + +00000000800230f4 <.LBB123_12>: + 800230f4: 00003517 auipc a0,0x3 + 800230f8: c0450513 addi a0,a0,-1020 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 800230fc: e82a sd a0,16(sp) + 800230fe: ec2e sd a1,24(sp) + +0000000080023100 <.LBB123_13>: + 80023100: 00002517 auipc a0,0x2 + 80023104: 5e450513 addi a0,a0,1508 # 800256e4 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u32$GT$3fmt17h19c6429b08a072b1E> + 80023108: f02a sd a0,32(sp) + 8002310a: f432 sd a2,40(sp) + 8002310c: f82a sd a0,48(sp) + +000000008002310e <.LBB123_14>: + 8002310e: 0000b517 auipc a0,0xb + 80023112: cea50513 addi a0,a0,-790 # 8002ddf8 <.Lanon.f077182aff5f58a5660f14b1290425e3.176> + 80023116: fc2a sd a0,56(sp) + 80023118: 450d li a0,3 + 8002311a: e0aa sd a0,64(sp) + 8002311c: e482 sd zero,72(sp) + 8002311e: 002c addi a1,sp,8 + 80023120: ecae sd a1,88(sp) + 80023122: f0aa sd a0,96(sp) + 80023124: 1830 addi a2,sp,56 + 80023126: 8526 mv a0,s1 + 80023128: 85ce mv a1,s3 + 8002312a: 00001097 auipc ra,0x1 + 8002312e: 87c080e7 jalr -1924(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 80023132: 842a mv s0,a0 + 80023134: 8522 mv a0,s0 + 80023136: 79a6 ld s3,104(sp) + 80023138: 7946 ld s2,112(sp) + 8002313a: 74e6 ld s1,120(sp) + 8002313c: 640a ld s0,128(sp) + 8002313e: 60aa ld ra,136(sp) + 80023140: 6149 addi sp,sp,144 + 80023142: 8082 ret + +Disassembly of section .text.unlikely._ZN4core9panicking5panic17h153a4ce3c60ede6bE: + +0000000080023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE>: + 80023144: 715d addi sp,sp,-80 + 80023146: e486 sd ra,72(sp) + 80023148: fc2a sd a0,56(sp) + 8002314a: e0ae sd a1,64(sp) + 8002314c: 1828 addi a0,sp,56 + 8002314e: e42a sd a0,8(sp) + 80023150: 4505 li a0,1 + 80023152: e82a sd a0,16(sp) + 80023154: ec02 sd zero,24(sp) + +0000000080023156 <.LBB130_1>: + 80023156: 0000b517 auipc a0,0xb + 8002315a: bf250513 addi a0,a0,-1038 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 8002315e: f42a sd a0,40(sp) + 80023160: f802 sd zero,48(sp) + 80023162: 0028 addi a0,sp,8 + 80023164: 85b2 mv a1,a2 + 80023166: 00000097 auipc ra,0x0 + 8002316a: 04a080e7 jalr 74(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text.unlikely._ZN4core9panicking18panic_bounds_check17h8e071db613335003E: + +0000000080023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E>: + 80023170: 7159 addi sp,sp,-112 + 80023172: f486 sd ra,104(sp) + 80023174: e42a sd a0,8(sp) + 80023176: e82e sd a1,16(sp) + 80023178: 0808 addi a0,sp,16 + 8002317a: e4aa sd a0,72(sp) + +000000008002317c <.LBB131_1>: + 8002317c: 00002517 auipc a0,0x2 + 80023180: 72450513 addi a0,a0,1828 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80023184: e8aa sd a0,80(sp) + 80023186: 002c addi a1,sp,8 + 80023188: ecae sd a1,88(sp) + 8002318a: f0aa sd a0,96(sp) + +000000008002318c <.LBB131_2>: + 8002318c: 0000b517 auipc a0,0xb + 80023190: cb450513 addi a0,a0,-844 # 8002de40 <.Lanon.f077182aff5f58a5660f14b1290425e3.179> + 80023194: ec2a sd a0,24(sp) + 80023196: 4509 li a0,2 + 80023198: f02a sd a0,32(sp) + 8002319a: f402 sd zero,40(sp) + 8002319c: 00ac addi a1,sp,72 + 8002319e: fc2e sd a1,56(sp) + 800231a0: e0aa sd a0,64(sp) + 800231a2: 0828 addi a0,sp,24 + 800231a4: 85b2 mv a1,a2 + 800231a6: 00000097 auipc ra,0x0 + 800231aa: 00a080e7 jalr 10(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text.unlikely._ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E: + +00000000800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E>: + 800231b0: 7179 addi sp,sp,-48 + 800231b2: f406 sd ra,40(sp) + +00000000800231b4 <.LBB132_1>: + 800231b4: 0000b617 auipc a2,0xb + 800231b8: b9460613 addi a2,a2,-1132 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 800231bc: e432 sd a2,8(sp) + +00000000800231be <.LBB132_2>: + 800231be: 0000b617 auipc a2,0xb + 800231c2: be260613 addi a2,a2,-1054 # 8002dda0 <.Lanon.f077182aff5f58a5660f14b1290425e3.170> + 800231c6: e832 sd a2,16(sp) + 800231c8: ec2a sd a0,24(sp) + 800231ca: f02e sd a1,32(sp) + 800231cc: 0028 addi a0,sp,8 + 800231ce: ffffc097 auipc ra,0xffffc + 800231d2: aa2080e7 jalr -1374(ra) # 8001ec70 + ... + +Disassembly of section .text._ZN4core9panicking19assert_failed_inner17h4615d2e87cda8e50E: + +00000000800231d8 <_ZN4core9panicking19assert_failed_inner17h4615d2e87cda8e50E>: + 800231d8: 7115 addi sp,sp,-224 + 800231da: ed86 sd ra,216(sp) + 800231dc: e42e sd a1,8(sp) + 800231de: e832 sd a2,16(sp) + 800231e0: ec36 sd a3,24(sp) + 800231e2: 0ff57513 andi a0,a0,255 + 800231e6: f03a sd a4,32(sp) + 800231e8: c909 beqz a0,800231fa <.LBB135_10> + 800231ea: 4585 li a1,1 + 800231ec: 04b51d63 bne a0,a1,80023246 <.LBB135_14> + +00000000800231f0 <.LBB135_9>: + 800231f0: 0000b517 auipc a0,0xb + 800231f4: c7750513 addi a0,a0,-905 # 8002de67 <.Lanon.f077182aff5f58a5660f14b1290425e3.182> + 800231f8: a029 j 80023202 <.LBB135_10+0x8> + +00000000800231fa <.LBB135_10>: + 800231fa: 0000b517 auipc a0,0xb + 800231fe: c6f50513 addi a0,a0,-913 # 8002de69 <.Lanon.f077182aff5f58a5660f14b1290425e3.183> + 80023202: f42a sd a0,40(sp) + 80023204: 4509 li a0,2 + 80023206: 638c ld a1,0(a5) + 80023208: f82a sd a0,48(sp) + 8002320a: e5b9 bnez a1,80023258 <.LBB135_14+0x12> + 8002320c: 1028 addi a0,sp,40 + 8002320e: f4aa sd a0,104(sp) + +0000000080023210 <.LBB135_11>: + 80023210: 00003517 auipc a0,0x3 + 80023214: ae850513 addi a0,a0,-1304 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 80023218: f8aa sd a0,112(sp) + 8002321a: 0028 addi a0,sp,8 + 8002321c: fcaa sd a0,120(sp) + +000000008002321e <.LBB135_12>: + 8002321e: 00003517 auipc a0,0x3 + 80023222: 9d050513 addi a0,a0,-1584 # 80025bee <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h729ad47dd83507edE> + 80023226: e12a sd a0,128(sp) + 80023228: 082c addi a1,sp,24 + 8002322a: e52e sd a1,136(sp) + 8002322c: e92a sd a0,144(sp) + +000000008002322e <.LBB135_13>: + 8002322e: 0000b517 auipc a0,0xb + 80023232: cc250513 addi a0,a0,-830 # 8002def0 <.Lanon.f077182aff5f58a5660f14b1290425e3.190> + 80023236: f52a sd a0,168(sp) + 80023238: 4511 li a0,4 + 8002323a: f92a sd a0,176(sp) + 8002323c: fd02 sd zero,184(sp) + 8002323e: 10a8 addi a0,sp,104 + 80023240: e5aa sd a0,200(sp) + 80023242: 450d li a0,3 + 80023244: a885 j 800232b4 <.LBB135_18+0x14> + +0000000080023246 <.LBB135_14>: + 80023246: 0000b517 auipc a0,0xb + 8002324a: c1a50513 addi a0,a0,-998 # 8002de60 <.Lanon.f077182aff5f58a5660f14b1290425e3.181> + 8002324e: f42a sd a0,40(sp) + 80023250: 451d li a0,7 + 80023252: 638c ld a1,0(a5) + 80023254: f82a sd a0,48(sp) + 80023256: d9dd beqz a1,8002320c <.LBB135_10+0x12> + 80023258: 7788 ld a0,40(a5) + 8002325a: 738c ld a1,32(a5) + 8002325c: f0aa sd a0,96(sp) + 8002325e: ecae sd a1,88(sp) + 80023260: 6f88 ld a0,24(a5) + 80023262: 6b8c ld a1,16(a5) + 80023264: 6790 ld a2,8(a5) + 80023266: 6394 ld a3,0(a5) + 80023268: e8aa sd a0,80(sp) + 8002326a: e4ae sd a1,72(sp) + 8002326c: e0b2 sd a2,64(sp) + 8002326e: fc36 sd a3,56(sp) + 80023270: 1028 addi a0,sp,40 + 80023272: f4aa sd a0,104(sp) + +0000000080023274 <.LBB135_15>: + 80023274: 00003517 auipc a0,0x3 + 80023278: a8450513 addi a0,a0,-1404 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 8002327c: f8aa sd a0,112(sp) + 8002327e: 0028 addi a0,sp,8 + 80023280: fcaa sd a0,120(sp) + +0000000080023282 <.LBB135_16>: + 80023282: 00003517 auipc a0,0x3 + 80023286: 96c50513 addi a0,a0,-1684 # 80025bee <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h729ad47dd83507edE> + 8002328a: e12a sd a0,128(sp) + 8002328c: 082c addi a1,sp,24 + 8002328e: e52e sd a1,136(sp) + 80023290: e92a sd a0,144(sp) + 80023292: 1828 addi a0,sp,56 + 80023294: ed2a sd a0,152(sp) + +0000000080023296 <.LBB135_17>: + 80023296: 00000517 auipc a0,0x0 + 8002329a: 6de50513 addi a0,a0,1758 # 80023974 <_ZN59_$LT$core..fmt..Arguments$u20$as$u20$core..fmt..Display$GT$3fmt17hff7b3fee0b75a94eE> + 8002329e: f12a sd a0,160(sp) + +00000000800232a0 <.LBB135_18>: + 800232a0: 0000b517 auipc a0,0xb + 800232a4: c0850513 addi a0,a0,-1016 # 8002dea8 <.Lanon.f077182aff5f58a5660f14b1290425e3.188> + 800232a8: f52a sd a0,168(sp) + 800232aa: 4511 li a0,4 + 800232ac: f92a sd a0,176(sp) + 800232ae: fd02 sd zero,184(sp) + 800232b0: 10ac addi a1,sp,104 + 800232b2: e5ae sd a1,200(sp) + 800232b4: e9aa sd a0,208(sp) + 800232b6: 1128 addi a0,sp,168 + 800232b8: 85c2 mv a1,a6 + 800232ba: 00000097 auipc ra,0x0 + 800232be: ef6080e7 jalr -266(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text.unlikely._ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E: + +00000000800232c4 <_ZN4core6result13unwrap_failed17h07d3c4e2b4f310f6E>: + 800232c4: 7119 addi sp,sp,-128 + 800232c6: fc86 sd ra,120(sp) + 800232c8: e42a sd a0,8(sp) + 800232ca: e82e sd a1,16(sp) + 800232cc: ec32 sd a2,24(sp) + 800232ce: f036 sd a3,32(sp) + 800232d0: 0028 addi a0,sp,8 + 800232d2: ecaa sd a0,88(sp) + +00000000800232d4 <.LBB136_1>: + 800232d4: 00003517 auipc a0,0x3 + 800232d8: a2450513 addi a0,a0,-1500 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 800232dc: f0aa sd a0,96(sp) + 800232de: 0828 addi a0,sp,24 + 800232e0: f4aa sd a0,104(sp) + +00000000800232e2 <.LBB136_2>: + 800232e2: 00003517 auipc a0,0x3 + 800232e6: 90c50513 addi a0,a0,-1780 # 80025bee <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h729ad47dd83507edE> + 800232ea: f8aa sd a0,112(sp) + +00000000800232ec <.LBB136_3>: + 800232ec: 0000b517 auipc a0,0xb + 800232f0: c4c50513 addi a0,a0,-948 # 8002df38 <.Lanon.f077182aff5f58a5660f14b1290425e3.192> + 800232f4: f42a sd a0,40(sp) + 800232f6: 4509 li a0,2 + 800232f8: f82a sd a0,48(sp) + 800232fa: fc02 sd zero,56(sp) + 800232fc: 08ac addi a1,sp,88 + 800232fe: e4ae sd a1,72(sp) + 80023300: e8aa sd a0,80(sp) + 80023302: 1028 addi a0,sp,40 + 80023304: 85ba mv a1,a4 + 80023306: 00000097 auipc ra,0x0 + 8002330a: eaa080e7 jalr -342(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text._ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE: + +0000000080023310 <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE>: + 80023310: 711d addi sp,sp,-96 + 80023312: ec86 sd ra,88(sp) + 80023314: e8a2 sd s0,80(sp) + 80023316: e4a6 sd s1,72(sp) + 80023318: e0ca sd s2,64(sp) + 8002331a: fc4e sd s3,56(sp) + 8002331c: f852 sd s4,48(sp) + 8002331e: f456 sd s5,40(sp) + 80023320: f05a sd s6,32(sp) + 80023322: ec5e sd s7,24(sp) + 80023324: e862 sd s8,16(sp) + 80023326: e466 sd s9,8(sp) + 80023328: e06a sd s10,0(sp) + 8002332a: 10060c63 beqz a2,80023442 <.LBB138_30+0x1a> + 8002332e: 84b2 mv s1,a2 + 80023330: 89ae mv s3,a1 + 80023332: 01053a03 ld s4,16(a0) + 80023336: 00053903 ld s2,0(a0) + 8002333a: 00853a83 ld s5,8(a0) + 8002333e: 4b3d li s6,15 + 80023340: 4ba9 li s7,10 + 80023342: 4c05 li s8,1 + 80023344: fbf00c93 li s9,-65 + 80023348: a819 j 8002335e <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE+0x4e> + 8002334a: 018ab683 ld a3,24(s5) + 8002334e: 854a mv a0,s2 + 80023350: 85ce mv a1,s3 + 80023352: 8622 mv a2,s0 + 80023354: 9682 jalr a3 + 80023356: e965 bnez a0,80023446 <.LBB138_30+0x1e> + 80023358: 8c81 sub s1,s1,s0 + 8002335a: 89ea mv s3,s10 + 8002335c: c0fd beqz s1,80023442 <.LBB138_30+0x1a> + 8002335e: 000a4503 lbu a0,0(s4) + 80023362: c919 beqz a0,80023378 <.LBB138_29+0x10> + 80023364: 018ab683 ld a3,24(s5) + +0000000080023368 <.LBB138_29>: + 80023368: 00004597 auipc a1,0x4 + 8002336c: 37058593 addi a1,a1,880 # 800276d8 <.LJTI3_0+0x58> + 80023370: 4611 li a2,4 + 80023372: 854a mv a0,s2 + 80023374: 9682 jalr a3 + 80023376: e961 bnez a0,80023446 <.LBB138_30+0x1e> + 80023378: 4401 li s0,0 + 8002337a: 8626 mv a2,s1 + 8002337c: a031 j 80023388 <.LBB138_29+0x20> + 8002337e: 0084b533 sltu a0,s1,s0 + 80023382: 40848633 sub a2,s1,s0 + 80023386: e925 bnez a0,800233f6 <.LBB138_29+0x8e> + 80023388: 008986b3 add a3,s3,s0 + 8002338c: 02cb6263 bltu s6,a2,800233b0 <.LBB138_29+0x48> + 80023390: 4581 li a1,0 + 80023392: ca05 beqz a2,800233c2 <.LBB138_29+0x5a> + 80023394: 00b68533 add a0,a3,a1 + 80023398: 00054503 lbu a0,0(a0) + 8002339c: 03750763 beq a0,s7,800233ca <.LBB138_29+0x62> + 800233a0: 0585 addi a1,a1,1 + 800233a2: feb619e3 bne a2,a1,80023394 <.LBB138_29+0x2c> + 800233a6: 4501 li a0,0 + 800233a8: 85b2 mv a1,a2 + 800233aa: 03850363 beq a0,s8,800233d0 <.LBB138_29+0x68> + 800233ae: a0a1 j 800233f6 <.LBB138_29+0x8e> + 800233b0: 4529 li a0,10 + 800233b2: 85b6 mv a1,a3 + 800233b4: 00001097 auipc ra,0x1 + 800233b8: 41c080e7 jalr 1052(ra) # 800247d0 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE> + 800233bc: 01850a63 beq a0,s8,800233d0 <.LBB138_29+0x68> + 800233c0: a81d j 800233f6 <.LBB138_29+0x8e> + 800233c2: 4501 li a0,0 + 800233c4: 01850663 beq a0,s8,800233d0 <.LBB138_29+0x68> + 800233c8: a03d j 800233f6 <.LBB138_29+0x8e> + 800233ca: 4505 li a0,1 + 800233cc: 03851563 bne a0,s8,800233f6 <.LBB138_29+0x8e> + 800233d0: 00858533 add a0,a1,s0 + 800233d4: 00150413 addi s0,a0,1 + 800233d8: fa9573e3 bgeu a0,s1,8002337e <.LBB138_29+0x16> + 800233dc: 954e add a0,a0,s3 + 800233de: 00054503 lbu a0,0(a0) + 800233e2: f9751ee3 bne a0,s7,8002337e <.LBB138_29+0x16> + 800233e6: 4505 li a0,1 + 800233e8: 00aa0023 sb a0,0(s4) + 800233ec: 00898d33 add s10,s3,s0 + 800233f0: f4848de3 beq s1,s0,8002334a <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE+0x3a> + 800233f4: a809 j 80023406 <.LBB138_29+0x9e> + 800233f6: 4501 li a0,0 + 800233f8: 8426 mv s0,s1 + 800233fa: 00aa0023 sb a0,0(s4) + 800233fe: 00898d33 add s10,s3,s0 + 80023402: f48484e3 beq s1,s0,8002334a <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE+0x3a> + 80023406: 04947f63 bgeu s0,s1,80023464 <.LBB138_31> + 8002340a: 000d0503 lb a0,0(s10) + 8002340e: 04acdb63 bge s9,a0,80023464 <.LBB138_31> + 80023412: 018ab683 ld a3,24(s5) + 80023416: 854a mv a0,s2 + 80023418: 85ce mv a1,s3 + 8002341a: 8622 mv a2,s0 + 8002341c: 9682 jalr a3 + 8002341e: e505 bnez a0,80023446 <.LBB138_30+0x1e> + 80023420: 000d0503 lb a0,0(s10) + 80023424: f2accae3 blt s9,a0,80023358 <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE+0x48> + +0000000080023428 <.LBB138_30>: + 80023428: 0000b717 auipc a4,0xb + 8002342c: b7870713 addi a4,a4,-1160 # 8002dfa0 <.Lanon.f077182aff5f58a5660f14b1290425e3.197> + 80023430: 854e mv a0,s3 + 80023432: 85a6 mv a1,s1 + 80023434: 8622 mv a2,s0 + 80023436: 86a6 mv a3,s1 + 80023438: 00001097 auipc ra,0x1 + 8002343c: 7cc080e7 jalr 1996(ra) # 80024c04 <_ZN4core3str16slice_error_fail17h98613a818fa8baa4E> + 80023440: 0000 unimp + 80023442: 4501 li a0,0 + 80023444: a011 j 80023448 <.LBB138_30+0x20> + 80023446: 4505 li a0,1 + 80023448: 6d02 ld s10,0(sp) + 8002344a: 6ca2 ld s9,8(sp) + 8002344c: 6c42 ld s8,16(sp) + 8002344e: 6be2 ld s7,24(sp) + 80023450: 7b02 ld s6,32(sp) + 80023452: 7aa2 ld s5,40(sp) + 80023454: 7a42 ld s4,48(sp) + 80023456: 79e2 ld s3,56(sp) + 80023458: 6906 ld s2,64(sp) + 8002345a: 64a6 ld s1,72(sp) + 8002345c: 6446 ld s0,80(sp) + 8002345e: 60e6 ld ra,88(sp) + 80023460: 6125 addi sp,sp,96 + 80023462: 8082 ret + +0000000080023464 <.LBB138_31>: + 80023464: 0000b717 auipc a4,0xb + 80023468: b2470713 addi a4,a4,-1244 # 8002df88 <.Lanon.f077182aff5f58a5660f14b1290425e3.196> + 8002346c: 854e mv a0,s3 + 8002346e: 85a6 mv a1,s1 + 80023470: 4601 li a2,0 + 80023472: 86a2 mv a3,s0 + 80023474: 00001097 auipc ra,0x1 + 80023478: 790080e7 jalr 1936(ra) # 80024c04 <_ZN4core3str16slice_error_fail17h98613a818fa8baa4E> + ... + +Disassembly of section .text._ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E: + +000000008002347e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E>: + 8002347e: 7171 addi sp,sp,-176 + 80023480: f506 sd ra,168(sp) + 80023482: f122 sd s0,160(sp) + 80023484: ed26 sd s1,152(sp) + 80023486: e94a sd s2,144(sp) + 80023488: e54e sd s3,136(sp) + 8002348a: e152 sd s4,128(sp) + 8002348c: fcd6 sd s5,120(sp) + 8002348e: f8da sd s6,112(sp) + 80023490: f4de sd s7,104(sp) + 80023492: 842a mv s0,a0 + 80023494: 00854503 lbu a0,8(a0) + 80023498: 4b85 li s7,1 + 8002349a: 4485 li s1,1 + 8002349c: c10d beqz a0,800234be <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x40> + 8002349e: 00940423 sb s1,8(s0) + 800234a2: 017404a3 sb s7,9(s0) + 800234a6: 8522 mv a0,s0 + 800234a8: 7ba6 ld s7,104(sp) + 800234aa: 7b46 ld s6,112(sp) + 800234ac: 7ae6 ld s5,120(sp) + 800234ae: 6a0a ld s4,128(sp) + 800234b0: 69aa ld s3,136(sp) + 800234b2: 694a ld s2,144(sp) + 800234b4: 64ea ld s1,152(sp) + 800234b6: 740a ld s0,160(sp) + 800234b8: 70aa ld ra,168(sp) + 800234ba: 614d addi sp,sp,176 + 800234bc: 8082 ret + 800234be: 89ba mv s3,a4 + 800234c0: 8936 mv s2,a3 + 800234c2: 8a32 mv s4,a2 + 800234c4: 8aae mv s5,a1 + 800234c6: 00043b03 ld s6,0(s0) + 800234ca: 030b6503 lwu a0,48(s6) + 800234ce: 00944583 lbu a1,9(s0) + 800234d2: 00457693 andi a3,a0,4 + 800234d6: 0015b613 seqz a2,a1 + 800234da: e699 bnez a3,800234e8 <.LBB139_18+0xa> + 800234dc: e261 bnez a2,8002359c <.LBB139_23> + +00000000800234de <.LBB139_18>: + 800234de: 0000b597 auipc a1,0xb + 800234e2: adf58593 addi a1,a1,-1313 # 8002dfbd <.Lanon.f077182aff5f58a5660f14b1290425e3.200> + 800234e6: a87d j 800235a4 <.LBB139_23+0x8> + 800234e8: c205 beqz a2,80023508 <.LBB139_19+0x14> + 800234ea: 028b3583 ld a1,40(s6) + 800234ee: 020b3503 ld a0,32(s6) + 800234f2: 6d94 ld a3,24(a1) + +00000000800234f4 <.LBB139_19>: + 800234f4: 0000b597 auipc a1,0xb + 800234f8: ac458593 addi a1,a1,-1340 # 8002dfb8 <.Lanon.f077182aff5f58a5660f14b1290425e3.198> + 800234fc: 460d li a2,3 + 800234fe: 9682 jalr a3 + 80023500: 4485 li s1,1 + 80023502: fd51 bnez a0,8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + 80023504: 030b6503 lwu a0,48(s6) + 80023508: 4485 li s1,1 + 8002350a: 029103a3 sb s1,39(sp) + 8002350e: 020b3583 ld a1,32(s6) + 80023512: 028b3603 ld a2,40(s6) + 80023516: e42e sd a1,8(sp) + 80023518: e832 sd a2,16(sp) + 8002351a: 02710593 addi a1,sp,39 + 8002351e: ec2e sd a1,24(sp) + 80023520: 034b2583 lw a1,52(s6) + 80023524: 038b0603 lb a2,56(s6) + 80023528: 000b3683 ld a3,0(s6) + 8002352c: 008b3703 ld a4,8(s6) + 80023530: 010b3783 ld a5,16(s6) + 80023534: 018b3803 ld a6,24(s6) + 80023538: ccaa sw a0,88(sp) + 8002353a: ceae sw a1,92(sp) + 8002353c: 06c10023 sb a2,96(sp) + 80023540: f436 sd a3,40(sp) + 80023542: f83a sd a4,48(sp) + 80023544: fc3e sd a5,56(sp) + 80023546: e0c2 sd a6,64(sp) + 80023548: 0028 addi a0,sp,8 + 8002354a: e4aa sd a0,72(sp) + +000000008002354c <.LBB139_20>: + 8002354c: 0000b517 auipc a0,0xb + 80023550: a0c50513 addi a0,a0,-1524 # 8002df58 <.Lanon.f077182aff5f58a5660f14b1290425e3.194> + 80023554: e8aa sd a0,80(sp) + 80023556: 0028 addi a0,sp,8 + 80023558: 85d6 mv a1,s5 + 8002355a: 8652 mv a2,s4 + 8002355c: 00000097 auipc ra,0x0 + 80023560: db4080e7 jalr -588(ra) # 80023310 <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE> + 80023564: fd0d bnez a0,8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + +0000000080023566 <.LBB139_21>: + 80023566: 0000b597 auipc a1,0xb + 8002356a: 9ca58593 addi a1,a1,-1590 # 8002df30 <.Lanon.f077182aff5f58a5660f14b1290425e3.191> + 8002356e: 0028 addi a0,sp,8 + 80023570: 4609 li a2,2 + 80023572: 00000097 auipc ra,0x0 + 80023576: d9e080e7 jalr -610(ra) # 80023310 <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE> + 8002357a: f115 bnez a0,8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + 8002357c: 0189b603 ld a2,24(s3) + 80023580: 102c addi a1,sp,40 + 80023582: 854a mv a0,s2 + 80023584: 9602 jalr a2 + 80023586: fd01 bnez a0,8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + 80023588: 65c6 ld a1,80(sp) + 8002358a: 6526 ld a0,72(sp) + 8002358c: 6d94 ld a3,24(a1) + +000000008002358e <.LBB139_22>: + 8002358e: 0000b597 auipc a1,0xb + 80023592: a2d58593 addi a1,a1,-1491 # 8002dfbb <.Lanon.f077182aff5f58a5660f14b1290425e3.199> + 80023596: 4609 li a2,2 + 80023598: 9682 jalr a3 + 8002359a: a8b1 j 800235f6 <.LBB139_24+0x1c> + +000000008002359c <.LBB139_23>: + 8002359c: 0000b597 auipc a1,0xb + 800235a0: a2358593 addi a1,a1,-1501 # 8002dfbf <.Lanon.f077182aff5f58a5660f14b1290425e3.201> + 800235a4: 028b3683 ld a3,40(s6) + 800235a8: 020b3503 ld a0,32(s6) + 800235ac: 6e94 ld a3,24(a3) + 800235ae: 00266613 ori a2,a2,2 + 800235b2: 9682 jalr a3 + 800235b4: 4485 li s1,1 + 800235b6: ee0514e3 bnez a0,8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + 800235ba: 028b3583 ld a1,40(s6) + 800235be: 020b3503 ld a0,32(s6) + 800235c2: 6d94 ld a3,24(a1) + 800235c4: 85d6 mv a1,s5 + 800235c6: 8652 mv a2,s4 + 800235c8: 9682 jalr a3 + 800235ca: 4485 li s1,1 + 800235cc: ec0519e3 bnez a0,8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + 800235d0: 028b3583 ld a1,40(s6) + 800235d4: 020b3503 ld a0,32(s6) + 800235d8: 6d94 ld a3,24(a1) + +00000000800235da <.LBB139_24>: + 800235da: 0000b597 auipc a1,0xb + 800235de: 95658593 addi a1,a1,-1706 # 8002df30 <.Lanon.f077182aff5f58a5660f14b1290425e3.191> + 800235e2: 4609 li a2,2 + 800235e4: 9682 jalr a3 + 800235e6: 4485 li s1,1 + 800235e8: ea051be3 bnez a0,8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + 800235ec: 0189b603 ld a2,24(s3) + 800235f0: 854a mv a0,s2 + 800235f2: 85da mv a1,s6 + 800235f4: 9602 jalr a2 + 800235f6: 84aa mv s1,a0 + 800235f8: b55d j 8002349e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E+0x20> + +Disassembly of section .text._ZN4core3fmt8builders10DebugTuple5field17h5bd338b8cb98b948E: + +00000000800235fa <_ZN4core3fmt8builders10DebugTuple5field17h5bd338b8cb98b948E>: + 800235fa: 7135 addi sp,sp,-160 + 800235fc: ed06 sd ra,152(sp) + 800235fe: e922 sd s0,144(sp) + 80023600: e526 sd s1,136(sp) + 80023602: e14a sd s2,128(sp) + 80023604: fcce sd s3,120(sp) + 80023606: f8d2 sd s4,112(sp) + 80023608: f4d6 sd s5,104(sp) + 8002360a: 842a mv s0,a0 + 8002360c: 01054503 lbu a0,16(a0) + 80023610: c509 beqz a0,8002361a <_ZN4core3fmt8builders10DebugTuple5field17h5bd338b8cb98b948E+0x20> + 80023612: 00843a83 ld s5,8(s0) + 80023616: 4485 li s1,1 + 80023618: a0d5 j 800236fc <.LBB142_20+0xe> + 8002361a: 89b2 mv s3,a2 + 8002361c: 892e mv s2,a1 + 8002361e: 00043a03 ld s4,0(s0) + 80023622: 030a6503 lwu a0,48(s4) + 80023626: 00843a83 ld s5,8(s0) + 8002362a: 00457593 andi a1,a0,4 + 8002362e: 001ab613 seqz a2,s5 + 80023632: e599 bnez a1,80023640 <.LBB142_16+0xa> + 80023634: e615 bnez a2,80023660 <.LBB142_18> + +0000000080023636 <.LBB142_16>: + 80023636: 0000b597 auipc a1,0xb + 8002363a: 98758593 addi a1,a1,-1657 # 8002dfbd <.Lanon.f077182aff5f58a5660f14b1290425e3.200> + 8002363e: a02d j 80023668 <.LBB142_18+0x8> + 80023640: c639 beqz a2,8002368e <.LBB142_18+0x2e> + 80023642: 028a3583 ld a1,40(s4) + 80023646: 020a3503 ld a0,32(s4) + 8002364a: 6d94 ld a3,24(a1) + +000000008002364c <.LBB142_17>: + 8002364c: 0000b597 auipc a1,0xb + 80023650: 97958593 addi a1,a1,-1671 # 8002dfc5 <.Lanon.f077182aff5f58a5660f14b1290425e3.207> + 80023654: 4609 li a2,2 + 80023656: 9682 jalr a3 + 80023658: c90d beqz a0,8002368a <.LBB142_18+0x2a> + 8002365a: 4a81 li s5,0 + 8002365c: 4485 li s1,1 + 8002365e: a879 j 800236fc <.LBB142_20+0xe> + +0000000080023660 <.LBB142_18>: + 80023660: 0000b597 auipc a1,0xb + 80023664: 96758593 addi a1,a1,-1689 # 8002dfc7 <.Lanon.f077182aff5f58a5660f14b1290425e3.208> + 80023668: 028a3683 ld a3,40(s4) + 8002366c: 020a3503 ld a0,32(s4) + 80023670: 6e94 ld a3,24(a3) + 80023672: 4709 li a4,2 + 80023674: 40c70633 sub a2,a4,a2 + 80023678: 9682 jalr a3 + 8002367a: 4485 li s1,1 + 8002367c: e141 bnez a0,800236fc <.LBB142_20+0xe> + 8002367e: 0189b603 ld a2,24(s3) + 80023682: 854a mv a0,s2 + 80023684: 85d2 mv a1,s4 + 80023686: 9602 jalr a2 + 80023688: a88d j 800236fa <.LBB142_20+0xc> + 8002368a: 030a6503 lwu a0,48(s4) + 8002368e: 4485 li s1,1 + 80023690: 029103a3 sb s1,39(sp) + 80023694: 020a3583 ld a1,32(s4) + 80023698: 028a3603 ld a2,40(s4) + 8002369c: e42e sd a1,8(sp) + 8002369e: e832 sd a2,16(sp) + 800236a0: 02710593 addi a1,sp,39 + 800236a4: ec2e sd a1,24(sp) + 800236a6: 034a2583 lw a1,52(s4) + 800236aa: 038a0603 lb a2,56(s4) + 800236ae: 000a3683 ld a3,0(s4) + 800236b2: 008a3703 ld a4,8(s4) + 800236b6: 010a3783 ld a5,16(s4) + 800236ba: 018a3803 ld a6,24(s4) + 800236be: ccaa sw a0,88(sp) + 800236c0: ceae sw a1,92(sp) + 800236c2: 06c10023 sb a2,96(sp) + 800236c6: f436 sd a3,40(sp) + 800236c8: f83a sd a4,48(sp) + 800236ca: fc3e sd a5,56(sp) + 800236cc: e0c2 sd a6,64(sp) + 800236ce: 0028 addi a0,sp,8 + 800236d0: 0189b603 ld a2,24(s3) + 800236d4: e4aa sd a0,72(sp) + +00000000800236d6 <.LBB142_19>: + 800236d6: 0000b517 auipc a0,0xb + 800236da: 88250513 addi a0,a0,-1918 # 8002df58 <.Lanon.f077182aff5f58a5660f14b1290425e3.194> + 800236de: e8aa sd a0,80(sp) + 800236e0: 102c addi a1,sp,40 + 800236e2: 854a mv a0,s2 + 800236e4: 9602 jalr a2 + 800236e6: e919 bnez a0,800236fc <.LBB142_20+0xe> + 800236e8: 65c6 ld a1,80(sp) + 800236ea: 6526 ld a0,72(sp) + 800236ec: 6d94 ld a3,24(a1) + +00000000800236ee <.LBB142_20>: + 800236ee: 0000b597 auipc a1,0xb + 800236f2: 8cd58593 addi a1,a1,-1843 # 8002dfbb <.Lanon.f077182aff5f58a5660f14b1290425e3.199> + 800236f6: 4609 li a2,2 + 800236f8: 9682 jalr a3 + 800236fa: 84aa mv s1,a0 + 800236fc: 00940823 sb s1,16(s0) + 80023700: 001a8513 addi a0,s5,1 + 80023704: e408 sd a0,8(s0) + 80023706: 8522 mv a0,s0 + 80023708: 7aa6 ld s5,104(sp) + 8002370a: 7a46 ld s4,112(sp) + 8002370c: 79e6 ld s3,120(sp) + 8002370e: 690a ld s2,128(sp) + 80023710: 64aa ld s1,136(sp) + 80023712: 644a ld s0,144(sp) + 80023714: 60ea ld ra,152(sp) + 80023716: 610d addi sp,sp,160 + 80023718: 8082 ret + +Disassembly of section .text._ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE: + +000000008002371a <_ZN4core3fmt8builders10DebugTuple6finish17h6827aca48e8d75ceE>: + 8002371a: 1101 addi sp,sp,-32 + 8002371c: ec06 sd ra,24(sp) + 8002371e: e822 sd s0,16(sp) + 80023720: e426 sd s1,8(sp) + 80023722: 842a mv s0,a0 + 80023724: 650c ld a1,8(a0) + 80023726: 01054503 lbu a0,16(a0) + 8002372a: c5b9 beqz a1,80023778 <.LBB143_10+0x14> + 8002372c: 4485 li s1,1 + 8002372e: e131 bnez a0,80023772 <.LBB143_10+0xe> + 80023730: 4505 li a0,1 + 80023732: 02a59563 bne a1,a0,8002375c <.LBB143_9+0x10> + 80023736: 01144503 lbu a0,17(s0) + 8002373a: c10d beqz a0,8002375c <.LBB143_9+0x10> + 8002373c: 6008 ld a0,0(s0) + 8002373e: 03054583 lbu a1,48(a0) + 80023742: 8991 andi a1,a1,4 + 80023744: ed81 bnez a1,8002375c <.LBB143_9+0x10> + 80023746: 750c ld a1,40(a0) + 80023748: 7108 ld a0,32(a0) + 8002374a: 6d94 ld a3,24(a1) + +000000008002374c <.LBB143_9>: + 8002374c: 0000b597 auipc a1,0xb + 80023750: 87c58593 addi a1,a1,-1924 # 8002dfc8 <.Lanon.f077182aff5f58a5660f14b1290425e3.209> + 80023754: 4605 li a2,1 + 80023756: 4485 li s1,1 + 80023758: 9682 jalr a3 + 8002375a: ed01 bnez a0,80023772 <.LBB143_10+0xe> + 8002375c: 6008 ld a0,0(s0) + 8002375e: 750c ld a1,40(a0) + 80023760: 7108 ld a0,32(a0) + 80023762: 6d94 ld a3,24(a1) + +0000000080023764 <.LBB143_10>: + 80023764: 0000b597 auipc a1,0xb + 80023768: 86558593 addi a1,a1,-1947 # 8002dfc9 <.Lanon.f077182aff5f58a5660f14b1290425e3.210> + 8002376c: 4605 li a2,1 + 8002376e: 9682 jalr a3 + 80023770: 84aa mv s1,a0 + 80023772: 00940823 sb s1,16(s0) + 80023776: 8526 mv a0,s1 + 80023778: 00a03533 snez a0,a0 + 8002377c: 64a2 ld s1,8(sp) + 8002377e: 6442 ld s0,16(sp) + 80023780: 60e2 ld ra,24(sp) + 80023782: 6105 addi sp,sp,32 + 80023784: 8082 ret + +Disassembly of section .text._ZN4core3fmt5Write10write_char17h618b2d222791a8a5E: + +0000000080023786 <_ZN4core3fmt5Write10write_char17h618b2d222791a8a5E>: + 80023786: 1141 addi sp,sp,-16 + 80023788: e406 sd ra,8(sp) + 8002378a: 0005861b sext.w a2,a1 + 8002378e: 08000693 li a3,128 + 80023792: c202 sw zero,4(sp) + 80023794: 00d67663 bgeu a2,a3,800237a0 <_ZN4core3fmt5Write10write_char17h618b2d222791a8a5E+0x1a> + 80023798: 00b10223 sb a1,4(sp) + 8002379c: 4605 li a2,1 + 8002379e: a841 j 8002382e <_ZN4core3fmt5Write10write_char17h618b2d222791a8a5E+0xa8> + 800237a0: 00b5d61b srliw a2,a1,0xb + 800237a4: ee19 bnez a2,800237c2 <_ZN4core3fmt5Write10write_char17h618b2d222791a8a5E+0x3c> + 800237a6: 0065d613 srli a2,a1,0x6 + 800237aa: 0c066613 ori a2,a2,192 + 800237ae: 00c10223 sb a2,4(sp) + 800237b2: 03f5f593 andi a1,a1,63 + 800237b6: 0805e593 ori a1,a1,128 + 800237ba: 00b102a3 sb a1,5(sp) + 800237be: 4609 li a2,2 + 800237c0: a0bd j 8002382e <_ZN4core3fmt5Write10write_char17h618b2d222791a8a5E+0xa8> + 800237c2: 0105d61b srliw a2,a1,0x10 + 800237c6: e61d bnez a2,800237f4 <_ZN4core3fmt5Write10write_char17h618b2d222791a8a5E+0x6e> + 800237c8: 00c5d61b srliw a2,a1,0xc + 800237cc: 0e066613 ori a2,a2,224 + 800237d0: 00c10223 sb a2,4(sp) + 800237d4: 0065d61b srliw a2,a1,0x6 + 800237d8: 03f67613 andi a2,a2,63 + 800237dc: 08066613 ori a2,a2,128 + 800237e0: 00c102a3 sb a2,5(sp) + 800237e4: 03f5f593 andi a1,a1,63 + 800237e8: 0805e593 ori a1,a1,128 + 800237ec: 00b10323 sb a1,6(sp) + 800237f0: 460d li a2,3 + 800237f2: a835 j 8002382e <_ZN4core3fmt5Write10write_char17h618b2d222791a8a5E+0xa8> + 800237f4: 0125d61b srliw a2,a1,0x12 + 800237f8: 0f066613 ori a2,a2,240 + 800237fc: 00c10223 sb a2,4(sp) + 80023800: 00c5d61b srliw a2,a1,0xc + 80023804: 03f67613 andi a2,a2,63 + 80023808: 08066613 ori a2,a2,128 + 8002380c: 00c102a3 sb a2,5(sp) + 80023810: 0065d61b srliw a2,a1,0x6 + 80023814: 03f67613 andi a2,a2,63 + 80023818: 08066613 ori a2,a2,128 + 8002381c: 00c10323 sb a2,6(sp) + 80023820: 03f5f593 andi a1,a1,63 + 80023824: 0805e593 ori a1,a1,128 + 80023828: 00b103a3 sb a1,7(sp) + 8002382c: 4611 li a2,4 + 8002382e: 004c addi a1,sp,4 + 80023830: 00000097 auipc ra,0x0 + 80023834: ae0080e7 jalr -1312(ra) # 80023310 <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE> + 80023838: 60a2 ld ra,8(sp) + 8002383a: 0141 addi sp,sp,16 + 8002383c: 8082 ret + +Disassembly of section .text._ZN4core3fmt5Write9write_fmt17h35126b63af1cfc53E: + +000000008002383e <_ZN4core3fmt5Write9write_fmt17h35126b63af1cfc53E>: + 8002383e: 7139 addi sp,sp,-64 + 80023840: fc06 sd ra,56(sp) + 80023842: 7590 ld a2,40(a1) + 80023844: 7194 ld a3,32(a1) + 80023846: e02a sd a0,0(sp) + 80023848: f832 sd a2,48(sp) + 8002384a: f436 sd a3,40(sp) + 8002384c: 6d88 ld a0,24(a1) + 8002384e: 6990 ld a2,16(a1) + 80023850: 6594 ld a3,8(a1) + 80023852: 618c ld a1,0(a1) + 80023854: f02a sd a0,32(sp) + 80023856: ec32 sd a2,24(sp) + 80023858: e836 sd a3,16(sp) + 8002385a: e42e sd a1,8(sp) + +000000008002385c <.LBB165_1>: + 8002385c: 0000b597 auipc a1,0xb + 80023860: 89c58593 addi a1,a1,-1892 # 8002e0f8 <.Lanon.f077182aff5f58a5660f14b1290425e3.232> + 80023864: 850a mv a0,sp + 80023866: 0030 addi a2,sp,8 + 80023868: 00000097 auipc ra,0x0 + 8002386c: 13e080e7 jalr 318(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 80023870: 70e2 ld ra,56(sp) + 80023872: 6121 addi sp,sp,64 + 80023874: 8082 ret + +Disassembly of section .text._ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17h3e38ec0fac65c122E: + +0000000080023876 <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_str17h3e38ec0fac65c122E>: + 80023876: 6108 ld a0,0(a0) + 80023878: 00000317 auipc t1,0x0 + 8002387c: a9830067 jr -1384(t1) # 80023310 <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE> + +Disassembly of section .text._ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E: + +0000000080023880 <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E>: + 80023880: 1141 addi sp,sp,-16 + 80023882: e406 sd ra,8(sp) + 80023884: 6108 ld a0,0(a0) + 80023886: 0005861b sext.w a2,a1 + 8002388a: 08000693 li a3,128 + 8002388e: c202 sw zero,4(sp) + 80023890: 00d67663 bgeu a2,a3,8002389c <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E+0x1c> + 80023894: 00b10223 sb a1,4(sp) + 80023898: 4605 li a2,1 + 8002389a: a841 j 8002392a <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E+0xaa> + 8002389c: 00b5d61b srliw a2,a1,0xb + 800238a0: ee19 bnez a2,800238be <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E+0x3e> + 800238a2: 0065d613 srli a2,a1,0x6 + 800238a6: 0c066613 ori a2,a2,192 + 800238aa: 00c10223 sb a2,4(sp) + 800238ae: 03f5f593 andi a1,a1,63 + 800238b2: 0805e593 ori a1,a1,128 + 800238b6: 00b102a3 sb a1,5(sp) + 800238ba: 4609 li a2,2 + 800238bc: a0bd j 8002392a <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E+0xaa> + 800238be: 0105d61b srliw a2,a1,0x10 + 800238c2: e61d bnez a2,800238f0 <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E+0x70> + 800238c4: 00c5d61b srliw a2,a1,0xc + 800238c8: 0e066613 ori a2,a2,224 + 800238cc: 00c10223 sb a2,4(sp) + 800238d0: 0065d61b srliw a2,a1,0x6 + 800238d4: 03f67613 andi a2,a2,63 + 800238d8: 08066613 ori a2,a2,128 + 800238dc: 00c102a3 sb a2,5(sp) + 800238e0: 03f5f593 andi a1,a1,63 + 800238e4: 0805e593 ori a1,a1,128 + 800238e8: 00b10323 sb a1,6(sp) + 800238ec: 460d li a2,3 + 800238ee: a835 j 8002392a <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$10write_char17h00198f5ff26d8c43E+0xaa> + 800238f0: 0125d61b srliw a2,a1,0x12 + 800238f4: 0f066613 ori a2,a2,240 + 800238f8: 00c10223 sb a2,4(sp) + 800238fc: 00c5d61b srliw a2,a1,0xc + 80023900: 03f67613 andi a2,a2,63 + 80023904: 08066613 ori a2,a2,128 + 80023908: 00c102a3 sb a2,5(sp) + 8002390c: 0065d61b srliw a2,a1,0x6 + 80023910: 03f67613 andi a2,a2,63 + 80023914: 08066613 ori a2,a2,128 + 80023918: 00c10323 sb a2,6(sp) + 8002391c: 03f5f593 andi a1,a1,63 + 80023920: 0805e593 ori a1,a1,128 + 80023924: 00b103a3 sb a1,7(sp) + 80023928: 4611 li a2,4 + 8002392a: 004c addi a1,sp,4 + 8002392c: 00000097 auipc ra,0x0 + 80023930: 9e4080e7 jalr -1564(ra) # 80023310 <_ZN68_$LT$core..fmt..builders..PadAdapter$u20$as$u20$core..fmt..Write$GT$9write_str17haa7f46eb365e41edE> + 80023934: 60a2 ld ra,8(sp) + 80023936: 0141 addi sp,sp,16 + 80023938: 8082 ret + +Disassembly of section .text._ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_fmt17ha842f9ebf6244b3dE: + +000000008002393a <_ZN50_$LT$$RF$mut$u20$W$u20$as$u20$core..fmt..Write$GT$9write_fmt17ha842f9ebf6244b3dE>: + 8002393a: 7139 addi sp,sp,-64 + 8002393c: fc06 sd ra,56(sp) + 8002393e: 6108 ld a0,0(a0) + 80023940: 7590 ld a2,40(a1) + 80023942: 7194 ld a3,32(a1) + 80023944: e02a sd a0,0(sp) + 80023946: f832 sd a2,48(sp) + 80023948: f436 sd a3,40(sp) + 8002394a: 6d88 ld a0,24(a1) + 8002394c: 6990 ld a2,16(a1) + 8002394e: 6594 ld a3,8(a1) + 80023950: 618c ld a1,0(a1) + 80023952: f02a sd a0,32(sp) + 80023954: ec32 sd a2,24(sp) + 80023956: e836 sd a3,16(sp) + 80023958: e42e sd a1,8(sp) + +000000008002395a <.LBB168_1>: + 8002395a: 0000a597 auipc a1,0xa + 8002395e: 79e58593 addi a1,a1,1950 # 8002e0f8 <.Lanon.f077182aff5f58a5660f14b1290425e3.232> + 80023962: 850a mv a0,sp + 80023964: 0030 addi a2,sp,8 + 80023966: 00000097 auipc ra,0x0 + 8002396a: 040080e7 jalr 64(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 8002396e: 70e2 ld ra,56(sp) + 80023970: 6121 addi sp,sp,64 + 80023972: 8082 ret + +Disassembly of section .text._ZN59_$LT$core..fmt..Arguments$u20$as$u20$core..fmt..Display$GT$3fmt17hff7b3fee0b75a94eE: + +0000000080023974 <_ZN59_$LT$core..fmt..Arguments$u20$as$u20$core..fmt..Display$GT$3fmt17hff7b3fee0b75a94eE>: + 80023974: 7139 addi sp,sp,-64 + 80023976: fc06 sd ra,56(sp) + 80023978: 7510 ld a2,40(a0) + 8002397a: 7118 ld a4,32(a0) + 8002397c: 6d1c ld a5,24(a0) + 8002397e: f832 sd a2,48(sp) + 80023980: 7194 ld a3,32(a1) + 80023982: f43a sd a4,40(sp) + 80023984: f03e sd a5,32(sp) + 80023986: 6910 ld a2,16(a0) + 80023988: 6518 ld a4,8(a0) + 8002398a: 6108 ld a0,0(a0) + 8002398c: 758c ld a1,40(a1) + 8002398e: ec32 sd a2,24(sp) + 80023990: e83a sd a4,16(sp) + 80023992: e42a sd a0,8(sp) + 80023994: 0030 addi a2,sp,8 + 80023996: 8536 mv a0,a3 + 80023998: 00000097 auipc ra,0x0 + 8002399c: 00e080e7 jalr 14(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 800239a0: 70e2 ld ra,56(sp) + 800239a2: 6121 addi sp,sp,64 + 800239a4: 8082 ret + +Disassembly of section .text._ZN4core3fmt5write17hf87af17b3ec995a2E: + +00000000800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E>: + 800239a6: 7175 addi sp,sp,-144 + 800239a8: e506 sd ra,136(sp) + 800239aa: e122 sd s0,128(sp) + 800239ac: fca6 sd s1,120(sp) + 800239ae: f8ca sd s2,112(sp) + 800239b0: f4ce sd s3,104(sp) + 800239b2: f0d2 sd s4,96(sp) + 800239b4: ecd6 sd s5,88(sp) + 800239b6: e8da sd s6,80(sp) + 800239b8: e4de sd s7,72(sp) + 800239ba: e0e2 sd s8,64(sp) + 800239bc: 8432 mv s0,a2 + 800239be: 4605 li a2,1 + 800239c0: 1616 slli a2,a2,0x25 + 800239c2: f832 sd a2,48(sp) + 800239c4: 460d li a2,3 + 800239c6: 02c10c23 sb a2,56(sp) + 800239ca: 6804 ld s1,16(s0) + 800239cc: e002 sd zero,0(sp) + 800239ce: e802 sd zero,16(sp) + 800239d0: f02a sd a0,32(sp) + 800239d2: f42e sd a1,40(sp) + 800239d4: c0f1 beqz s1,80023a98 <.LBB172_35+0x90> + 800239d6: 6c10 ld a2,24(s0) + 800239d8: 00843903 ld s2,8(s0) + 800239dc: 8a4a mv s4,s2 + 800239de: 00c96363 bltu s2,a2,800239e4 <_ZN4core3fmt5write17hf87af17b3ec995a2E+0x3e> + 800239e2: 8a32 mv s4,a2 + 800239e4: 00043983 ld s3,0(s0) + 800239e8: 100a0363 beqz s4,80023aee <.LBB172_35+0xe6> + 800239ec: 0009b683 ld a3,0(s3) + 800239f0: 0089b603 ld a2,8(s3) + 800239f4: 6d98 ld a4,24(a1) + 800239f6: 85b6 mv a1,a3 + 800239f8: 9702 jalr a4 + 800239fa: 10051863 bnez a0,80023b0a <.LBB172_35+0x102> + 800239fe: 02043b83 ld s7,32(s0) + 80023a02: 01898c13 addi s8,s3,24 + 80023a06: 4a89 li s5,2 + +0000000080023a08 <.LBB172_35>: + 80023a08: fffffb17 auipc s6,0xfffff + 80023a0c: 57ab0b13 addi s6,s6,1402 # 80022f82 <_ZN4core3ops8function6FnOnce9call_once17h6147212214d3120cE> + 80023a10: 8452 mv s0,s4 + 80023a12: 5488 lw a0,40(s1) + 80023a14: da2a sw a0,52(sp) + 80023a16: 03048503 lb a0,48(s1) + 80023a1a: 02a10c23 sb a0,56(sp) + 80023a1e: 54c8 lw a0,44(s1) + 80023a20: d82a sw a0,48(sp) + 80023a22: 6c90 ld a2,24(s1) + 80023a24: 7088 ld a0,32(s1) + 80023a26: ce09 beqz a2,80023a40 <.LBB172_35+0x38> + 80023a28: 4581 li a1,0 + 80023a2a: 01560c63 beq a2,s5,80023a42 <.LBB172_35+0x3a> + 80023a2e: 0512 slli a0,a0,0x4 + 80023a30: 955e add a0,a0,s7 + 80023a32: 650c ld a1,8(a0) + 80023a34: 01658463 beq a1,s6,80023a3c <.LBB172_35+0x34> + 80023a38: 4581 li a1,0 + 80023a3a: a021 j 80023a42 <.LBB172_35+0x3a> + 80023a3c: 6108 ld a0,0(a0) + 80023a3e: 6108 ld a0,0(a0) + 80023a40: 4585 li a1,1 + 80023a42: e02e sd a1,0(sp) + 80023a44: e42a sd a0,8(sp) + 80023a46: 6490 ld a2,8(s1) + 80023a48: 6888 ld a0,16(s1) + 80023a4a: ce09 beqz a2,80023a64 <.LBB172_35+0x5c> + 80023a4c: 4581 li a1,0 + 80023a4e: 01560c63 beq a2,s5,80023a66 <.LBB172_35+0x5e> + 80023a52: 0512 slli a0,a0,0x4 + 80023a54: 955e add a0,a0,s7 + 80023a56: 650c ld a1,8(a0) + 80023a58: 01658463 beq a1,s6,80023a60 <.LBB172_35+0x58> + 80023a5c: 4581 li a1,0 + 80023a5e: a021 j 80023a66 <.LBB172_35+0x5e> + 80023a60: 6108 ld a0,0(a0) + 80023a62: 6108 ld a0,0(a0) + 80023a64: 4585 li a1,1 + 80023a66: e82e sd a1,16(sp) + 80023a68: ec2a sd a0,24(sp) + 80023a6a: 6088 ld a0,0(s1) + 80023a6c: 0512 slli a0,a0,0x4 + 80023a6e: 955e add a0,a0,s7 + 80023a70: 6510 ld a2,8(a0) + 80023a72: 6108 ld a0,0(a0) + 80023a74: 858a mv a1,sp + 80023a76: 9602 jalr a2 + 80023a78: e949 bnez a0,80023b0a <.LBB172_35+0x102> + 80023a7a: 147d addi s0,s0,-1 + 80023a7c: c835 beqz s0,80023af0 <.LBB172_35+0xe8> + 80023a7e: 76a2 ld a3,40(sp) + 80023a80: 7502 ld a0,32(sp) + 80023a82: ff8c3583 ld a1,-8(s8) + 80023a86: 000c3603 ld a2,0(s8) + 80023a8a: 6e94 ld a3,24(a3) + 80023a8c: 03848493 addi s1,s1,56 + 80023a90: 0c41 addi s8,s8,16 + 80023a92: 9682 jalr a3 + 80023a94: dd3d beqz a0,80023a12 <.LBB172_35+0xa> + 80023a96: a895 j 80023b0a <.LBB172_35+0x102> + 80023a98: 7410 ld a2,40(s0) + 80023a9a: 00843903 ld s2,8(s0) + 80023a9e: 8a4a mv s4,s2 + 80023aa0: 00c96363 bltu s2,a2,80023aa6 <.LBB172_35+0x9e> + 80023aa4: 8a32 mv s4,a2 + 80023aa6: 00043983 ld s3,0(s0) + 80023aaa: 040a0263 beqz s4,80023aee <.LBB172_35+0xe6> + 80023aae: 02043a83 ld s5,32(s0) + 80023ab2: 0009b683 ld a3,0(s3) + 80023ab6: 0089b603 ld a2,8(s3) + 80023aba: 6d98 ld a4,24(a1) + 80023abc: 85b6 mv a1,a3 + 80023abe: 9702 jalr a4 + 80023ac0: e529 bnez a0,80023b0a <.LBB172_35+0x102> + 80023ac2: 4401 li s0,0 + 80023ac4: 84d2 mv s1,s4 + 80023ac6: 008a8533 add a0,s5,s0 + 80023aca: 6510 ld a2,8(a0) + 80023acc: 6108 ld a0,0(a0) + 80023ace: 858a mv a1,sp + 80023ad0: 9602 jalr a2 + 80023ad2: ed05 bnez a0,80023b0a <.LBB172_35+0x102> + 80023ad4: 14fd addi s1,s1,-1 + 80023ad6: cc89 beqz s1,80023af0 <.LBB172_35+0xe8> + 80023ad8: 7502 ld a0,32(sp) + 80023ada: 76a2 ld a3,40(sp) + 80023adc: 00898633 add a2,s3,s0 + 80023ae0: 6a0c ld a1,16(a2) + 80023ae2: 6e10 ld a2,24(a2) + 80023ae4: 6e94 ld a3,24(a3) + 80023ae6: 0441 addi s0,s0,16 + 80023ae8: 9682 jalr a3 + 80023aea: dd71 beqz a0,80023ac6 <.LBB172_35+0xbe> + 80023aec: a839 j 80023b0a <.LBB172_35+0x102> + 80023aee: 4a01 li s4,0 + 80023af0: 012a7f63 bgeu s4,s2,80023b0e <.LBB172_35+0x106> + 80023af4: 7502 ld a0,32(sp) + 80023af6: 76a2 ld a3,40(sp) + 80023af8: 004a1593 slli a1,s4,0x4 + 80023afc: 00b98633 add a2,s3,a1 + 80023b00: 620c ld a1,0(a2) + 80023b02: 6610 ld a2,8(a2) + 80023b04: 6e94 ld a3,24(a3) + 80023b06: 9682 jalr a3 + 80023b08: c119 beqz a0,80023b0e <.LBB172_35+0x106> + 80023b0a: 4505 li a0,1 + 80023b0c: a011 j 80023b10 <.LBB172_35+0x108> + 80023b0e: 4501 li a0,0 + 80023b10: 6c06 ld s8,64(sp) + 80023b12: 6ba6 ld s7,72(sp) + 80023b14: 6b46 ld s6,80(sp) + 80023b16: 6ae6 ld s5,88(sp) + 80023b18: 7a06 ld s4,96(sp) + 80023b1a: 79a6 ld s3,104(sp) + 80023b1c: 7946 ld s2,112(sp) + 80023b1e: 74e6 ld s1,120(sp) + 80023b20: 640a ld s0,128(sp) + 80023b22: 60aa ld ra,136(sp) + 80023b24: 6149 addi sp,sp,144 + 80023b26: 8082 ret + +Disassembly of section .text._ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E: + +0000000080023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E>: + 80023b28: 711d addi sp,sp,-96 + 80023b2a: ec86 sd ra,88(sp) + 80023b2c: e8a2 sd s0,80(sp) + 80023b2e: e4a6 sd s1,72(sp) + 80023b30: e0ca sd s2,64(sp) + 80023b32: fc4e sd s3,56(sp) + 80023b34: f852 sd s4,48(sp) + 80023b36: f456 sd s5,40(sp) + 80023b38: f05a sd s6,32(sp) + 80023b3a: ec5e sd s7,24(sp) + 80023b3c: e862 sd s8,16(sp) + 80023b3e: e466 sd s9,8(sp) + 80023b40: e06a sd s10,0(sp) + 80023b42: 89be mv s3,a5 + 80023b44: 893a mv s2,a4 + 80023b46: 8ab6 mv s5,a3 + 80023b48: 8baa mv s7,a0 + 80023b4a: c5b1 beqz a1,80023b96 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x6e> + 80023b4c: 030be503 lwu a0,48(s7) + 80023b50: 00157593 andi a1,a0,1 + 80023b54: 00110a37 lui s4,0x110 + 80023b58: c199 beqz a1,80023b5e <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x36> + 80023b5a: 02b00a13 li s4,43 + 80023b5e: 01358433 add s0,a1,s3 + 80023b62: 00457593 andi a1,a0,4 + 80023b66: c1a9 beqz a1,80023ba8 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x80> + 80023b68: 4581 li a1,0 + 80023b6a: 020a8063 beqz s5,80023b8a <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x62> + 80023b6e: 86d6 mv a3,s5 + 80023b70: 8732 mv a4,a2 + 80023b72: 00074783 lbu a5,0(a4) + 80023b76: 0705 addi a4,a4,1 + 80023b78: 0c07f793 andi a5,a5,192 + 80023b7c: f8078793 addi a5,a5,-128 + 80023b80: 00f037b3 snez a5,a5 + 80023b84: 16fd addi a3,a3,-1 + 80023b86: 95be add a1,a1,a5 + 80023b88: f6ed bnez a3,80023b72 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x4a> + 80023b8a: 942e add s0,s0,a1 + 80023b8c: 8c32 mv s8,a2 + 80023b8e: 000bb583 ld a1,0(s7) + 80023b92: ed99 bnez a1,80023bb0 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x88> + 80023b94: a0a9 j 80023bde <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xb6> + 80023b96: 030be503 lwu a0,48(s7) + 80023b9a: 00198413 addi s0,s3,1 + 80023b9e: 02d00a13 li s4,45 + 80023ba2: 00457593 andi a1,a0,4 + 80023ba6: f1e9 bnez a1,80023b68 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x40> + 80023ba8: 4c01 li s8,0 + 80023baa: 000bb583 ld a1,0(s7) + 80023bae: c985 beqz a1,80023bde <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xb6> + 80023bb0: 008bb483 ld s1,8(s7) + 80023bb4: 02947563 bgeu s0,s1,80023bde <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xb6> + 80023bb8: 8921 andi a0,a0,8 + 80023bba: e141 bnez a0,80023c3a <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x112> + 80023bbc: 038bc583 lbu a1,56(s7) + 80023bc0: 460d li a2,3 + 80023bc2: 4505 li a0,1 + 80023bc4: 00c58363 beq a1,a2,80023bca <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xa2> + 80023bc8: 852e mv a0,a1 + 80023bca: 00357593 andi a1,a0,3 + 80023bce: 40848533 sub a0,s1,s0 + 80023bd2: c9cd beqz a1,80023c84 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x15c> + 80023bd4: 4605 li a2,1 + 80023bd6: 0ac59a63 bne a1,a2,80023c8a <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x162> + 80023bda: 4c81 li s9,0 + 80023bdc: a865 j 80023c94 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x16c> + 80023bde: 855e mv a0,s7 + 80023be0: 85d2 mv a1,s4 + 80023be2: 8662 mv a2,s8 + 80023be4: 86d6 mv a3,s5 + 80023be6: 00000097 auipc ra,0x0 + 80023bea: 1aa080e7 jalr 426(ra) # 80023d90 <_ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE> + 80023bee: 4b05 li s6,1 + 80023bf0: c105 beqz a0,80023c10 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xe8> + 80023bf2: 855a mv a0,s6 + 80023bf4: 6d02 ld s10,0(sp) + 80023bf6: 6ca2 ld s9,8(sp) + 80023bf8: 6c42 ld s8,16(sp) + 80023bfa: 6be2 ld s7,24(sp) + 80023bfc: 7b02 ld s6,32(sp) + 80023bfe: 7aa2 ld s5,40(sp) + 80023c00: 7a42 ld s4,48(sp) + 80023c02: 79e2 ld s3,56(sp) + 80023c04: 6906 ld s2,64(sp) + 80023c06: 64a6 ld s1,72(sp) + 80023c08: 6446 ld s0,80(sp) + 80023c0a: 60e6 ld ra,88(sp) + 80023c0c: 6125 addi sp,sp,96 + 80023c0e: 8082 ret + 80023c10: 028bb583 ld a1,40(s7) + 80023c14: 020bb503 ld a0,32(s7) + 80023c18: 6d9c ld a5,24(a1) + 80023c1a: 85ca mv a1,s2 + 80023c1c: 864e mv a2,s3 + 80023c1e: 6d02 ld s10,0(sp) + 80023c20: 6ca2 ld s9,8(sp) + 80023c22: 6c42 ld s8,16(sp) + 80023c24: 6be2 ld s7,24(sp) + 80023c26: 7b02 ld s6,32(sp) + 80023c28: 7aa2 ld s5,40(sp) + 80023c2a: 7a42 ld s4,48(sp) + 80023c2c: 79e2 ld s3,56(sp) + 80023c2e: 6906 ld s2,64(sp) + 80023c30: 64a6 ld s1,72(sp) + 80023c32: 6446 ld s0,80(sp) + 80023c34: 60e6 ld ra,88(sp) + 80023c36: 6125 addi sp,sp,96 + 80023c38: 8782 jr a5 + 80023c3a: 034bec83 lwu s9,52(s7) + 80023c3e: 03000513 li a0,48 + 80023c42: 038bcd03 lbu s10,56(s7) + 80023c46: 02abaa23 sw a0,52(s7) + 80023c4a: 4b05 li s6,1 + 80023c4c: 036b8c23 sb s6,56(s7) + 80023c50: 855e mv a0,s7 + 80023c52: 85d2 mv a1,s4 + 80023c54: 8662 mv a2,s8 + 80023c56: 86d6 mv a3,s5 + 80023c58: 00000097 auipc ra,0x0 + 80023c5c: 138080e7 jalr 312(ra) # 80023d90 <_ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE> + 80023c60: f949 bnez a0,80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023c62: 038bc583 lbu a1,56(s7) + 80023c66: 460d li a2,3 + 80023c68: 4505 li a0,1 + 80023c6a: 00c58363 beq a1,a2,80023c70 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x148> + 80023c6e: 852e mv a0,a1 + 80023c70: 00357593 andi a1,a0,3 + 80023c74: 40848533 sub a0,s1,s0 + 80023c78: c5d9 beqz a1,80023d06 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x1de> + 80023c7a: 4605 li a2,1 + 80023c7c: 08c59863 bne a1,a2,80023d0c <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x1e4> + 80023c80: 4a01 li s4,0 + 80023c82: a851 j 80023d16 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x1ee> + 80023c84: 8caa mv s9,a0 + 80023c86: 4501 li a0,0 + 80023c88: a031 j 80023c94 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x16c> + 80023c8a: 00150593 addi a1,a0,1 + 80023c8e: 8105 srli a0,a0,0x1 + 80023c90: 0015dc93 srli s9,a1,0x1 + 80023c94: 020bbb03 ld s6,32(s7) + 80023c98: 028bb403 ld s0,40(s7) + 80023c9c: 034bed03 lwu s10,52(s7) + 80023ca0: 00150493 addi s1,a0,1 + 80023ca4: 14fd addi s1,s1,-1 + 80023ca6: c499 beqz s1,80023cb4 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x18c> + 80023ca8: 7010 ld a2,32(s0) + 80023caa: 855a mv a0,s6 + 80023cac: 85ea mv a1,s10 + 80023cae: 9602 jalr a2 + 80023cb0: d975 beqz a0,80023ca4 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x17c> + 80023cb2: a049 j 80023d34 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x20c> + 80023cb4: 000d051b sext.w a0,s10 + 80023cb8: 001105b7 lui a1,0x110 + 80023cbc: 4b05 li s6,1 + 80023cbe: f2b50ae3 beq a0,a1,80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023cc2: 855e mv a0,s7 + 80023cc4: 85d2 mv a1,s4 + 80023cc6: 8662 mv a2,s8 + 80023cc8: 86d6 mv a3,s5 + 80023cca: 00000097 auipc ra,0x0 + 80023cce: 0c6080e7 jalr 198(ra) # 80023d90 <_ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE> + 80023cd2: f105 bnez a0,80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023cd4: 028bb583 ld a1,40(s7) + 80023cd8: 020bb503 ld a0,32(s7) + 80023cdc: 6d94 ld a3,24(a1) + 80023cde: 85ca mv a1,s2 + 80023ce0: 864e mv a2,s3 + 80023ce2: 9682 jalr a3 + 80023ce4: f519 bnez a0,80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023ce6: 020bb903 ld s2,32(s7) + 80023cea: 028bb403 ld s0,40(s7) + 80023cee: 4481 li s1,0 + 80023cf0: 089c8c63 beq s9,s1,80023d88 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x260> + 80023cf4: 7010 ld a2,32(s0) + 80023cf6: 0485 addi s1,s1,1 + 80023cf8: 854a mv a0,s2 + 80023cfa: 85ea mv a1,s10 + 80023cfc: 9602 jalr a2 + 80023cfe: d96d beqz a0,80023cf0 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x1c8> + 80023d00: fff48513 addi a0,s1,-1 + 80023d04: a059 j 80023d8a <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x262> + 80023d06: 8a2a mv s4,a0 + 80023d08: 4501 li a0,0 + 80023d0a: a031 j 80023d16 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x1ee> + 80023d0c: 00150593 addi a1,a0,1 + 80023d10: 8105 srli a0,a0,0x1 + 80023d12: 0015da13 srli s4,a1,0x1 + 80023d16: 020bbb03 ld s6,32(s7) + 80023d1a: 028bb403 ld s0,40(s7) + 80023d1e: 034bea83 lwu s5,52(s7) + 80023d22: 00150493 addi s1,a0,1 + 80023d26: 14fd addi s1,s1,-1 + 80023d28: c881 beqz s1,80023d38 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x210> + 80023d2a: 7010 ld a2,32(s0) + 80023d2c: 855a mv a0,s6 + 80023d2e: 85d6 mv a1,s5 + 80023d30: 9602 jalr a2 + 80023d32: d975 beqz a0,80023d26 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x1fe> + 80023d34: 4b05 li s6,1 + 80023d36: bd75 j 80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023d38: 000a851b sext.w a0,s5 + 80023d3c: 001105b7 lui a1,0x110 + 80023d40: 4b05 li s6,1 + 80023d42: eab508e3 beq a0,a1,80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023d46: 028bb583 ld a1,40(s7) + 80023d4a: 020bb503 ld a0,32(s7) + 80023d4e: 6d94 ld a3,24(a1) + 80023d50: 85ca mv a1,s2 + 80023d52: 864e mv a2,s3 + 80023d54: 9682 jalr a3 + 80023d56: e8051ee3 bnez a0,80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023d5a: 020bb903 ld s2,32(s7) + 80023d5e: 028bb483 ld s1,40(s7) + 80023d62: 4401 li s0,0 + 80023d64: 008a0c63 beq s4,s0,80023d7c <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x254> + 80023d68: 7090 ld a2,32(s1) + 80023d6a: 0405 addi s0,s0,1 + 80023d6c: 854a mv a0,s2 + 80023d6e: 85d6 mv a1,s5 + 80023d70: 9602 jalr a2 + 80023d72: d96d beqz a0,80023d64 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0x23c> + 80023d74: fff40513 addi a0,s0,-1 + 80023d78: e7456de3 bltu a0,s4,80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023d7c: 4b01 li s6,0 + 80023d7e: 039baa23 sw s9,52(s7) + 80023d82: 03ab8c23 sb s10,56(s7) + 80023d86: b5b5 j 80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + 80023d88: 8566 mv a0,s9 + 80023d8a: 01953b33 sltu s6,a0,s9 + 80023d8e: b595 j 80023bf2 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E+0xca> + +Disassembly of section .text._ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE: + +0000000080023d90 <_ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE>: + 80023d90: 1101 addi sp,sp,-32 + 80023d92: ec06 sd ra,24(sp) + 80023d94: e822 sd s0,16(sp) + 80023d96: e426 sd s1,8(sp) + 80023d98: e04a sd s2,0(sp) + 80023d9a: 0005871b sext.w a4,a1 + 80023d9e: 001107b7 lui a5,0x110 + 80023da2: 8936 mv s2,a3 + 80023da4: 84b2 mv s1,a2 + 80023da6: 842a mv s0,a0 + 80023da8: 00f70963 beq a4,a5,80023dba <_ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE+0x2a> + 80023dac: 7410 ld a2,40(s0) + 80023dae: 7008 ld a0,32(s0) + 80023db0: 7210 ld a2,32(a2) + 80023db2: 9602 jalr a2 + 80023db4: 85aa mv a1,a0 + 80023db6: 4505 li a0,1 + 80023db8: ed91 bnez a1,80023dd4 <_ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE+0x44> + 80023dba: cc81 beqz s1,80023dd2 <_ZN4core3fmt9Formatter12pad_integral12write_prefix17h8dc03175dafd03baE+0x42> + 80023dbc: 740c ld a1,40(s0) + 80023dbe: 7008 ld a0,32(s0) + 80023dc0: 6d9c ld a5,24(a1) + 80023dc2: 85a6 mv a1,s1 + 80023dc4: 864a mv a2,s2 + 80023dc6: 6902 ld s2,0(sp) + 80023dc8: 64a2 ld s1,8(sp) + 80023dca: 6442 ld s0,16(sp) + 80023dcc: 60e2 ld ra,24(sp) + 80023dce: 6105 addi sp,sp,32 + 80023dd0: 8782 jr a5 + 80023dd2: 4501 li a0,0 + 80023dd4: 6902 ld s2,0(sp) + 80023dd6: 64a2 ld s1,8(sp) + 80023dd8: 6442 ld s0,16(sp) + 80023dda: 60e2 ld ra,24(sp) + 80023ddc: 6105 addi sp,sp,32 + 80023dde: 8082 ret + +Disassembly of section .text._ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE: + +0000000080023de0 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE>: + 80023de0: 715d addi sp,sp,-80 + 80023de2: e486 sd ra,72(sp) + 80023de4: e0a2 sd s0,64(sp) + 80023de6: fc26 sd s1,56(sp) + 80023de8: f84a sd s2,48(sp) + 80023dea: f44e sd s3,40(sp) + 80023dec: f052 sd s4,32(sp) + 80023dee: ec56 sd s5,24(sp) + 80023df0: e85a sd s6,16(sp) + 80023df2: e45e sd s7,8(sp) + 80023df4: 6918 ld a4,16(a0) + 80023df6: 6114 ld a3,0(a0) + 80023df8: 89b2 mv s3,a2 + 80023dfa: 892e mv s2,a1 + 80023dfc: fff70593 addi a1,a4,-1 + 80023e00: 4605 li a2,1 + 80023e02: 0015b593 seqz a1,a1 + 80023e06: 00c69463 bne a3,a2,80023e0e <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x2e> + 80023e0a: e581 bnez a1,80023e12 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x32> + 80023e0c: a235 j 80023f38 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x158> + 80023e0e: 18058c63 beqz a1,80023fa6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1c6> + 80023e12: 6d18 ld a4,24(a0) + 80023e14: fff68593 addi a1,a3,-1 + 80023e18: 0015b293 seqz t0,a1 + 80023e1c: 013904b3 add s1,s2,s3 + 80023e20: 4601 li a2,0 + 80023e22: cb45 beqz a4,80023ed2 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0xf2> + 80023e24: 5e7d li t3,-1 + 80023e26: 0e000393 li t2,224 + 80023e2a: 0f000313 li t1,240 + 80023e2e: 001c0837 lui a6,0x1c0 + 80023e32: 001108b7 lui a7,0x110 + 80023e36: 844a mv s0,s2 + 80023e38: 0e940e63 beq s0,s1,80023f34 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x154> + 80023e3c: 00040683 lb a3,0(s0) + 80023e40: 00140593 addi a1,s0,1 + 80023e44: 00de5a63 bge t3,a3,80023e58 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x78> + 80023e48: 86ae mv a3,a1 + 80023e4a: 408687b3 sub a5,a3,s0 + 80023e4e: 177d addi a4,a4,-1 + 80023e50: 963e add a2,a2,a5 + 80023e52: 8436 mv s0,a3 + 80023e54: f375 bnez a4,80023e38 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x58> + 80023e56: a8bd j 80023ed4 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0xf4> + 80023e58: 00958d63 beq a1,s1,80023e72 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x92> + 80023e5c: 00144783 lbu a5,1(s0) + 80023e60: 00240593 addi a1,s0,2 + 80023e64: 03f7fe93 andi t4,a5,63 + 80023e68: 0ff6f793 andi a5,a3,255 + 80023e6c: fc77eee3 bltu a5,t2,80023e48 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x68> + 80023e70: a039 j 80023e7e <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x9e> + 80023e72: 4e81 li t4,0 + 80023e74: 85a6 mv a1,s1 + 80023e76: 0ff6f793 andi a5,a3,255 + 80023e7a: fc77e7e3 bltu a5,t2,80023e48 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x68> + 80023e7e: 00958a63 beq a1,s1,80023e92 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0xb2> + 80023e82: 0005c683 lbu a3,0(a1) # 110000 <.Lline_table_start0+0xd8b9b> + 80023e86: 0585 addi a1,a1,1 + 80023e88: 03f6ff13 andi t5,a3,63 + 80023e8c: fa67eee3 bltu a5,t1,80023e48 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x68> + 80023e90: a029 j 80023e9a <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0xba> + 80023e92: 4f01 li t5,0 + 80023e94: 85a6 mv a1,s1 + 80023e96: fa67e9e3 bltu a5,t1,80023e48 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x68> + 80023e9a: 00958a63 beq a1,s1,80023eae <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0xce> + 80023e9e: 0005cf83 lbu t6,0(a1) + 80023ea2: 00158693 addi a3,a1,1 + 80023ea6: 03ffff93 andi t6,t6,63 + 80023eaa: 85b6 mv a1,a3 + 80023eac: a019 j 80023eb2 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0xd2> + 80023eae: 4f81 li t6,0 + 80023eb0: 86a6 mv a3,s1 + 80023eb2: 07ca slli a5,a5,0x12 + 80023eb4: 0107fa33 and s4,a5,a6 + 80023eb8: 00ce9793 slli a5,t4,0xc + 80023ebc: 006f1e93 slli t4,t5,0x6 + 80023ec0: 0147e7b3 or a5,a5,s4 + 80023ec4: 01d7e7b3 or a5,a5,t4 + 80023ec8: 01f7e7b3 or a5,a5,t6 + 80023ecc: f7179fe3 bne a5,a7,80023e4a <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x6a> + 80023ed0: a095 j 80023f34 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x154> + 80023ed2: 85ca mv a1,s2 + 80023ed4: 06958063 beq a1,s1,80023f34 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x154> + 80023ed8: 00058683 lb a3,0(a1) + 80023edc: 577d li a4,-1 + 80023ede: 02d75763 bge a4,a3,80023f0c <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x12c> + 80023ee2: 00163593 seqz a1,a2 + 80023ee6: 013646b3 xor a3,a2,s3 + 80023eea: 0016b693 seqz a3,a3 + 80023eee: 8dd5 or a1,a1,a3 + 80023ef0: e999 bnez a1,80023f06 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x126> + 80023ef2: 03367d63 bgeu a2,s3,80023f2c <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x14c> + 80023ef6: 00c905b3 add a1,s2,a2 + 80023efa: 00058583 lb a1,0(a1) + 80023efe: fc000693 li a3,-64 + 80023f02: 02d5c563 blt a1,a3,80023f2c <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x14c> + 80023f06: 85ca mv a1,s2 + 80023f08: e585 bnez a1,80023f30 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x150> + 80023f0a: a02d j 80023f34 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x154> + 80023f0c: 00158793 addi a5,a1,1 + 80023f10: 0ff6f713 andi a4,a3,255 + 80023f14: 10978e63 beq a5,s1,80024030 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x250> + 80023f18: 0015c683 lbu a3,1(a1) + 80023f1c: 0589 addi a1,a1,2 + 80023f1e: 03f6f693 andi a3,a3,63 + 80023f22: 0e000793 li a5,224 + 80023f26: 10f77b63 bgeu a4,a5,8002403c <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x25c> + 80023f2a: bf65 j 80023ee2 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x102> + 80023f2c: 4581 li a1,0 + 80023f2e: c199 beqz a1,80023f34 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x154> + 80023f30: 892e mv s2,a1 + 80023f32: 89b2 mv s3,a2 + 80023f34: 06028963 beqz t0,80023fa6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1c6> + 80023f38: 04098463 beqz s3,80023f80 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1a0> + 80023f3c: 4601 li a2,0 + 80023f3e: 85ce mv a1,s3 + 80023f40: 86ca mv a3,s2 + 80023f42: 0006c703 lbu a4,0(a3) + 80023f46: 0685 addi a3,a3,1 + 80023f48: 0c077713 andi a4,a4,192 + 80023f4c: f8070713 addi a4,a4,-128 + 80023f50: 00e03733 snez a4,a4 + 80023f54: 15fd addi a1,a1,-1 + 80023f56: 963a add a2,a2,a4 + 80023f58: f5ed bnez a1,80023f42 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x162> + 80023f5a: 650c ld a1,8(a0) + 80023f5c: 04b67563 bgeu a2,a1,80023fa6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1c6> + 80023f60: 4601 li a2,0 + 80023f62: 86ce mv a3,s3 + 80023f64: 874a mv a4,s2 + 80023f66: 00074783 lbu a5,0(a4) + 80023f6a: 0705 addi a4,a4,1 + 80023f6c: 0c07f793 andi a5,a5,192 + 80023f70: f8078793 addi a5,a5,-128 # 10ff80 <.Lline_table_start0+0xd8b1b> + 80023f74: 00f037b3 snez a5,a5 + 80023f78: 16fd addi a3,a3,-1 + 80023f7a: 963e add a2,a2,a5 + 80023f7c: f6ed bnez a3,80023f66 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x186> + 80023f7e: a021 j 80023f86 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1a6> + 80023f80: 650c ld a1,8(a0) + 80023f82: 4601 li a2,0 + 80023f84: c18d beqz a1,80023fa6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1c6> + 80023f86: 03854683 lbu a3,56(a0) + 80023f8a: 478d li a5,3 + 80023f8c: 4701 li a4,0 + 80023f8e: 00f68363 beq a3,a5,80023f94 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1b4> + 80023f92: 8736 mv a4,a3 + 80023f94: 00377693 andi a3,a4,3 + 80023f98: 8d91 sub a1,a1,a2 + 80023f9a: c695 beqz a3,80023fc6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1e6> + 80023f9c: 4605 li a2,1 + 80023f9e: 02c69763 bne a3,a2,80023fcc <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1ec> + 80023fa2: 4a81 li s5,0 + 80023fa4: a80d j 80023fd6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1f6> + 80023fa6: 750c ld a1,40(a0) + 80023fa8: 7108 ld a0,32(a0) + 80023faa: 6d9c ld a5,24(a1) + 80023fac: 85ca mv a1,s2 + 80023fae: 864e mv a2,s3 + 80023fb0: 6ba2 ld s7,8(sp) + 80023fb2: 6b42 ld s6,16(sp) + 80023fb4: 6ae2 ld s5,24(sp) + 80023fb6: 7a02 ld s4,32(sp) + 80023fb8: 79a2 ld s3,40(sp) + 80023fba: 7942 ld s2,48(sp) + 80023fbc: 74e2 ld s1,56(sp) + 80023fbe: 6406 ld s0,64(sp) + 80023fc0: 60a6 ld ra,72(sp) + 80023fc2: 6161 addi sp,sp,80 + 80023fc4: 8782 jr a5 + 80023fc6: 8aae mv s5,a1 + 80023fc8: 4581 li a1,0 + 80023fca: a031 j 80023fd6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x1f6> + 80023fcc: 00158613 addi a2,a1,1 + 80023fd0: 8185 srli a1,a1,0x1 + 80023fd2: 00165a93 srli s5,a2,0x1 + 80023fd6: 02053b03 ld s6,32(a0) + 80023fda: 02853b83 ld s7,40(a0) + 80023fde: 03456403 lwu s0,52(a0) + 80023fe2: 00158493 addi s1,a1,1 + 80023fe6: 14fd addi s1,s1,-1 + 80023fe8: c889 beqz s1,80023ffa <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x21a> + 80023fea: 020bb603 ld a2,32(s7) + 80023fee: 855a mv a0,s6 + 80023ff0: 85a2 mv a1,s0 + 80023ff2: 9602 jalr a2 + 80023ff4: d96d beqz a0,80023fe6 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x206> + 80023ff6: 4a05 li s4,1 + 80023ff8: a095 j 8002405c <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x27c> + 80023ffa: 0004051b sext.w a0,s0 + 80023ffe: 001105b7 lui a1,0x110 + 80024002: 4a05 li s4,1 + 80024004: 04b50c63 beq a0,a1,8002405c <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x27c> + 80024008: 018bb683 ld a3,24(s7) + 8002400c: 855a mv a0,s6 + 8002400e: 85ca mv a1,s2 + 80024010: 864e mv a2,s3 + 80024012: 9682 jalr a3 + 80024014: e521 bnez a0,8002405c <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x27c> + 80024016: 4481 li s1,0 + 80024018: 029a8f63 beq s5,s1,80024056 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x276> + 8002401c: 020bb603 ld a2,32(s7) + 80024020: 0485 addi s1,s1,1 + 80024022: 855a mv a0,s6 + 80024024: 85a2 mv a1,s0 + 80024026: 9602 jalr a2 + 80024028: d965 beqz a0,80024018 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x238> + 8002402a: fff48513 addi a0,s1,-1 + 8002402e: a02d j 80024058 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x278> + 80024030: 4681 li a3,0 + 80024032: 85a6 mv a1,s1 + 80024034: 0e000793 li a5,224 + 80024038: eaf765e3 bltu a4,a5,80023ee2 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x102> + 8002403c: 02958c63 beq a1,s1,80024074 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x294> + 80024040: 0005c403 lbu s0,0(a1) # 110000 <.Lline_table_start0+0xd8b9b> + 80024044: 00158793 addi a5,a1,1 + 80024048: 03f47593 andi a1,s0,63 + 8002404c: 0f000413 li s0,240 + 80024050: 02877863 bgeu a4,s0,80024080 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x2a0> + 80024054: b579 j 80023ee2 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x102> + 80024056: 8556 mv a0,s5 + 80024058: 01553a33 sltu s4,a0,s5 + 8002405c: 8552 mv a0,s4 + 8002405e: 6ba2 ld s7,8(sp) + 80024060: 6b42 ld s6,16(sp) + 80024062: 6ae2 ld s5,24(sp) + 80024064: 7a02 ld s4,32(sp) + 80024066: 79a2 ld s3,40(sp) + 80024068: 7942 ld s2,48(sp) + 8002406a: 74e2 ld s1,56(sp) + 8002406c: 6406 ld s0,64(sp) + 8002406e: 60a6 ld ra,72(sp) + 80024070: 6161 addi sp,sp,80 + 80024072: 8082 ret + 80024074: 4581 li a1,0 + 80024076: 87a6 mv a5,s1 + 80024078: 0f000413 li s0,240 + 8002407c: e68763e3 bltu a4,s0,80023ee2 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x102> + 80024080: 00978763 beq a5,s1,8002408e <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x2ae> + 80024084: 0007c783 lbu a5,0(a5) + 80024088: 03f7f793 andi a5,a5,63 + 8002408c: a011 j 80024090 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x2b0> + 8002408e: 4781 li a5,0 + 80024090: 074a slli a4,a4,0x12 + 80024092: 001c04b7 lui s1,0x1c0 + 80024096: 8f65 and a4,a4,s1 + 80024098: 06b2 slli a3,a3,0xc + 8002409a: 059a slli a1,a1,0x6 + 8002409c: 8ed9 or a3,a3,a4 + 8002409e: 8dd5 or a1,a1,a3 + 800240a0: 8ddd or a1,a1,a5 + 800240a2: 001106b7 lui a3,0x110 + 800240a6: e8d587e3 beq a1,a3,80023f34 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x154> + 800240aa: bd25 j 80023ee2 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE+0x102> + +Disassembly of section .text._ZN4core3fmt9Formatter15debug_lower_hex17h7c86defbf028d215E: + +00000000800240ac <_ZN4core3fmt9Formatter15debug_lower_hex17h7c86defbf028d215E>: + 800240ac: 03054503 lbu a0,48(a0) + 800240b0: 8941 andi a0,a0,16 + 800240b2: 8111 srli a0,a0,0x4 + 800240b4: 8082 ret + +Disassembly of section .text._ZN4core3fmt9Formatter15debug_upper_hex17hdf276d50be1e3931E: + +00000000800240b6 <_ZN4core3fmt9Formatter15debug_upper_hex17hdf276d50be1e3931E>: + 800240b6: 03054503 lbu a0,48(a0) + 800240ba: 02057513 andi a0,a0,32 + 800240be: 8115 srli a0,a0,0x5 + 800240c0: 8082 ret + +Disassembly of section .text._ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E: + +00000000800240c2 <_ZN4core3fmt9Formatter11debug_tuple17hbc5c17cdaba95414E>: + 800240c2: 1101 addi sp,sp,-32 + 800240c4: ec06 sd ra,24(sp) + 800240c6: e822 sd s0,16(sp) + 800240c8: e426 sd s1,8(sp) + 800240ca: e04a sd s2,0(sp) + 800240cc: 842e mv s0,a1 + 800240ce: 7598 ld a4,40(a1) + 800240d0: 718c ld a1,32(a1) + 800240d2: 6f18 ld a4,24(a4) + 800240d4: 8936 mv s2,a3 + 800240d6: 84aa mv s1,a0 + 800240d8: 852e mv a0,a1 + 800240da: 85b2 mv a1,a2 + 800240dc: 8636 mv a2,a3 + 800240de: 9702 jalr a4 + 800240e0: 00193593 seqz a1,s2 + 800240e4: e080 sd s0,0(s1) + 800240e6: 00a48823 sb a0,16(s1) # 1c0010 <.Lline_table_start0+0x188bab> + 800240ea: 0004b423 sd zero,8(s1) + 800240ee: 00b488a3 sb a1,17(s1) + 800240f2: 6902 ld s2,0(sp) + 800240f4: 64a2 ld s1,8(sp) + 800240f6: 6442 ld s0,16(sp) + 800240f8: 60e2 ld ra,24(sp) + 800240fa: 6105 addi sp,sp,32 + 800240fc: 8082 ret + +Disassembly of section .text._ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE: + +00000000800240fe <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE>: + 800240fe: 7131 addi sp,sp,-192 + 80024100: fd06 sd ra,184(sp) + 80024102: f922 sd s0,176(sp) + 80024104: f526 sd s1,168(sp) + 80024106: f14a sd s2,160(sp) + 80024108: ed4e sd s3,152(sp) + 8002410a: e952 sd s4,144(sp) + 8002410c: e556 sd s5,136(sp) + 8002410e: e15a sd s6,128(sp) + 80024110: fcde sd s7,120(sp) + 80024112: f8e2 sd s8,112(sp) + 80024114: f4e6 sd s9,104(sp) + 80024116: f0ea sd s10,96(sp) + 80024118: ecee sd s11,88(sp) + 8002411a: 7614 ld a3,40(a2) + 8002411c: 7200 ld s0,32(a2) + 8002411e: e0b6 sd a3,64(sp) + 80024120: 729c ld a5,32(a3) + 80024122: 89ae mv s3,a1 + 80024124: e4aa sd a0,72(sp) + 80024126: 02200593 li a1,34 + 8002412a: 8522 mv a0,s0 + 8002412c: e8be sd a5,80(sp) + 8002412e: 9782 jalr a5 + 80024130: c10d beqz a0,80024152 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x54> + 80024132: 4505 li a0,1 + 80024134: 6de6 ld s11,88(sp) + 80024136: 7d06 ld s10,96(sp) + 80024138: 7ca6 ld s9,104(sp) + 8002413a: 7c46 ld s8,112(sp) + 8002413c: 7be6 ld s7,120(sp) + 8002413e: 6b0a ld s6,128(sp) + 80024140: 6aaa ld s5,136(sp) + 80024142: 6a4a ld s4,144(sp) + 80024144: 69ea ld s3,152(sp) + 80024146: 790a ld s2,160(sp) + 80024148: 74aa ld s1,168(sp) + 8002414a: 744a ld s0,176(sp) + 8002414c: 70ea ld ra,184(sp) + 8002414e: 6129 addi sp,sp,192 + 80024150: 8082 ret + 80024152: 4481 li s1,0 + 80024154: 3a098263 beqz s3,800244f8 <.LBB201_67+0x3e> + 80024158: 4a01 li s4,0 + 8002415a: 6926 ld s2,72(sp) + 8002415c: 01390b33 add s6,s2,s3 + 80024160: f0100513 li a0,-255 + 80024164: 1502 slli a0,a0,0x20 + 80024166: fff50c93 addi s9,a0,-1 + 8002416a: 4bb1 li s7,12 + 8002416c: 4d89 li s11,2 + 8002416e: fbf00813 li a6,-65 + 80024172: 05555537 lui a0,0x5555 + 80024176: 5555051b addiw a0,a0,1365 + 8002417a: 0532 slli a0,a0,0xc + 8002417c: 55550513 addi a0,a0,1365 # 5555555 <.Lline_table_start0+0x551e0f0> + 80024180: 0532 slli a0,a0,0xc + 80024182: 55550513 addi a0,a0,1365 + 80024186: 0532 slli a0,a0,0xc + 80024188: 55550513 addi a0,a0,1365 + 8002418c: f02a sd a0,32(sp) + 8002418e: 03333537 lui a0,0x3333 + 80024192: 3335051b addiw a0,a0,819 + 80024196: 0532 slli a0,a0,0xc + 80024198: 33350513 addi a0,a0,819 # 3333333 <.Lline_table_start0+0x32fbece> + 8002419c: 0532 slli a0,a0,0xc + 8002419e: 33350513 addi a0,a0,819 + 800241a2: 0532 slli a0,a0,0xc + 800241a4: 33350513 addi a0,a0,819 + 800241a8: ec2a sd a0,24(sp) + 800241aa: 00f0f537 lui a0,0xf0f + 800241ae: 0f15051b addiw a0,a0,241 + 800241b2: 0532 slli a0,a0,0xc + 800241b4: f0f50513 addi a0,a0,-241 # f0ef0f <.Lline_table_start0+0xed7aaa> + 800241b8: 0532 slli a0,a0,0xc + 800241ba: 0f150513 addi a0,a0,241 + 800241be: 0532 slli a0,a0,0xc + 800241c0: f0f50513 addi a0,a0,-241 + 800241c4: e82a sd a0,16(sp) + 800241c6: 01010537 lui a0,0x1010 + 800241ca: 1015051b addiw a0,a0,257 + 800241ce: 0542 slli a0,a0,0x10 + 800241d0: 10150513 addi a0,a0,257 # 1010101 <.Lline_table_start0+0xfd8c9c> + 800241d4: 0542 slli a0,a0,0x10 + 800241d6: 10150513 addi a0,a0,257 + 800241da: e42a sd a0,8(sp) + 800241dc: 4515 li a0,5 + 800241de: 1502 slli a0,a0,0x20 + 800241e0: e02a sd a0,0(sp) + 800241e2: 87ca mv a5,s2 + 800241e4: f45a sd s6,40(sp) + 800241e6: 00090503 lb a0,0(s2) + 800241ea: 00190693 addi a3,s2,1 + 800241ee: 0ff57c13 andi s8,a0,255 + 800241f2: 00054463 bltz a0,800241fa <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0xfc> + 800241f6: 8936 mv s2,a3 + 800241f8: a869 j 80024292 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x194> + 800241fa: 05668663 beq a3,s6,80024246 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x148> + 800241fe: 00194503 lbu a0,1(s2) + 80024202: 0909 addi s2,s2,2 + 80024204: 03f57593 andi a1,a0,63 + 80024208: 01fc7513 andi a0,s8,31 + 8002420c: 0e000613 li a2,224 + 80024210: 04cc6363 bltu s8,a2,80024256 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x158> + 80024214: 05690663 beq s2,s6,80024260 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x162> + 80024218: 00094603 lbu a2,0(s2) + 8002421c: 00190693 addi a3,s2,1 + 80024220: 03f67613 andi a2,a2,63 + 80024224: 8936 mv s2,a3 + 80024226: 059a slli a1,a1,0x6 + 80024228: 8dd1 or a1,a1,a2 + 8002422a: 0f000613 li a2,240 + 8002422e: 04cc6163 bltu s8,a2,80024270 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x172> + 80024232: 05668363 beq a3,s6,80024278 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x17a> + 80024236: 0006c603 lbu a2,0(a3) # 110000 <.Lline_table_start0+0xd8b9b> + 8002423a: 00168913 addi s2,a3,1 + 8002423e: 03f67613 andi a2,a2,63 + 80024242: 86ca mv a3,s2 + 80024244: a81d j 8002427a <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x17c> + 80024246: 4581 li a1,0 + 80024248: 895a mv s2,s6 + 8002424a: 01fc7513 andi a0,s8,31 + 8002424e: 0e000613 li a2,224 + 80024252: fccc71e3 bgeu s8,a2,80024214 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x116> + 80024256: 051a slli a0,a0,0x6 + 80024258: 00b56c33 or s8,a0,a1 + 8002425c: 86ca mv a3,s2 + 8002425e: a815 j 80024292 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x194> + 80024260: 4601 li a2,0 + 80024262: 86da mv a3,s6 + 80024264: 059a slli a1,a1,0x6 + 80024266: 8dd1 or a1,a1,a2 + 80024268: 0f000613 li a2,240 + 8002426c: fccc73e3 bgeu s8,a2,80024232 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x134> + 80024270: 0532 slli a0,a0,0xc + 80024272: 00a5ec33 or s8,a1,a0 + 80024276: a831 j 80024292 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x194> + 80024278: 4601 li a2,0 + 8002427a: 054a slli a0,a0,0x12 + 8002427c: 001c0737 lui a4,0x1c0 + 80024280: 8d79 and a0,a0,a4 + 80024282: 059a slli a1,a1,0x6 + 80024284: 8d4d or a0,a0,a1 + 80024286: 00c56c33 or s8,a0,a2 + 8002428a: 00110537 lui a0,0x110 + 8002428e: 24ac0363 beq s8,a0,800244d4 <.LBB201_67+0x1a> + 80024292: 4d09 li s10,2 + 80024294: fc3e sd a5,56(sp) + 80024296: f836 sd a3,48(sp) + 80024298: 038bd263 bge s7,s8,800242bc <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1be> + 8002429c: 05c00513 li a0,92 + 800242a0: 02ac0b63 beq s8,a0,800242d6 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1d8> + 800242a4: 02200513 li a0,34 + 800242a8: 02ac0763 beq s8,a0,800242d6 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1d8> + 800242ac: 4535 li a0,13 + 800242ae: 18ac1363 bne s8,a0,80024434 <.LBB201_51+0x40> + 800242b2: 07200a93 li s5,114 + 800242b6: 029a7363 bgeu s4,s1,800242dc <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1de> + 800242ba: a401 j 800244ba <.LBB201_67> + 800242bc: 07400a93 li s5,116 + 800242c0: 4525 li a0,9 + 800242c2: 00ac0b63 beq s8,a0,800242d8 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1da> + 800242c6: 4529 li a0,10 + 800242c8: 16ac1663 bne s8,a0,80024434 <.LBB201_51+0x40> + 800242cc: 06e00a93 li s5,110 + 800242d0: 009a7663 bgeu s4,s1,800242dc <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1de> + 800242d4: a2dd j 800244ba <.LBB201_67> + 800242d6: 8ae2 mv s5,s8 + 800242d8: 1e9a6163 bltu s4,s1,800244ba <.LBB201_67> + 800242dc: 0014b513 seqz a0,s1 + 800242e0: 0134c5b3 xor a1,s1,s3 + 800242e4: 0015b593 seqz a1,a1 + 800242e8: 8d4d or a0,a0,a1 + 800242ea: 65a6 ld a1,72(sp) + 800242ec: 95a6 add a1,a1,s1 + 800242ee: e519 bnez a0,800242fc <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1fe> + 800242f0: 1d34f563 bgeu s1,s3,800244ba <.LBB201_67> + 800242f4: 00058503 lb a0,0(a1) + 800242f8: 1ca85163 bge a6,a0,800244ba <.LBB201_67> + 800242fc: 001a3513 seqz a0,s4 + 80024300: 013a4633 xor a2,s4,s3 + 80024304: 00163613 seqz a2,a2 + 80024308: 8d51 or a0,a0,a2 + 8002430a: e909 bnez a0,8002431c <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x21e> + 8002430c: 1b3a7763 bgeu s4,s3,800244ba <.LBB201_67> + 80024310: 6526 ld a0,72(sp) + 80024312: 9552 add a0,a0,s4 + 80024314: 00050503 lb a0,0(a0) # 110000 <.Lline_table_start0+0xd8b9b> + 80024318: 1aa85163 bge a6,a0,800244ba <.LBB201_67> + 8002431c: 6506 ld a0,64(sp) + 8002431e: 6d14 ld a3,24(a0) + 80024320: 409a0633 sub a2,s4,s1 + 80024324: 8522 mv a0,s0 + 80024326: 9682 jalr a3 + 80024328: 54fd li s1,-1 + 8002432a: c115 beqz a0,8002434e <.LBB201_35+0x20> + 8002432c: b519 j 80024132 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x34> + +000000008002432e <.LBB201_35>: + 8002432e: 009b7b33 and s6,s6,s1 + 80024332: 019bf533 and a0,s7,s9 + 80024336: 4d0d li s10,3 + 80024338: 020d1593 slli a1,s10,0x20 + 8002433c: 00b56bb3 or s7,a0,a1 + 80024340: 07500593 li a1,117 + 80024344: 8522 mv a0,s0 + 80024346: 67c6 ld a5,80(sp) + 80024348: 9782 jalr a5 + 8002434a: de0514e3 bnez a0,80024132 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x34> + 8002434e: 020d1513 slli a0,s10,0x20 + 80024352: 9101 srli a0,a0,0x20 + 80024354: 4d05 li s10,1 + 80024356: 02ad5a63 bge s10,a0,8002438a <.LBB201_40+0x10> + 8002435a: 05c00593 li a1,92 + 8002435e: ffb503e3 beq a0,s11,80024344 <.LBB201_35+0x16> + 80024362: 020bd513 srli a0,s7,0x20 + 80024366: 0ff57513 andi a0,a0,255 + 8002436a: 050e slli a0,a0,0x3 + +000000008002436c <.LBB201_66>: + 8002436c: 0000a617 auipc a2,0xa + 80024370: 97c60613 addi a2,a2,-1668 # 8002dce8 <.LJTI201_0> + 80024374: 9532 add a0,a0,a2 + 80024376: 6108 ld a0,0(a0) + 80024378: 8502 jr a0 + +000000008002437a <.LBB201_40>: + 8002437a: 009b7b33 and s6,s6,s1 + 8002437e: 019bfbb3 and s7,s7,s9 + 80024382: 4d0d li s10,3 + 80024384: 07d00593 li a1,125 + 80024388: bf75 j 80024344 <.LBB201_35+0x16> + 8002438a: 4585 li a1,1 + 8002438c: 06b51463 bne a0,a1,800243f4 <.LBB201_51> + 80024390: 4d01 li s10,0 + 80024392: 85d6 mv a1,s5 + 80024394: bf45 j 80024344 <.LBB201_35+0x16> + +0000000080024396 <.LBB201_43>: + 80024396: 002b1513 slli a0,s6,0x2 + 8002439a: 00abd53b srlw a0,s7,a0 + 8002439e: 893d andi a0,a0,15 + 800243a0: 03000593 li a1,48 + 800243a4: 4629 li a2,10 + 800243a6: 00c56463 bltu a0,a2,800243ae <.LBB201_43+0x18> + 800243aa: 05700593 li a1,87 + 800243ae: 95aa add a1,a1,a0 + 800243b0: 020b0863 beqz s6,800243e0 <.LBB201_48+0xe> + 800243b4: 1b7d addi s6,s6,-1 + 800243b6: 4d0d li s10,3 + 800243b8: b771 j 80024344 <.LBB201_35+0x16> + +00000000800243ba <.LBB201_47>: + 800243ba: 009b7b33 and s6,s6,s1 + 800243be: 019bf533 and a0,s7,s9 + 800243c2: 4585 li a1,1 + 800243c4: 1586 slli a1,a1,0x21 + 800243c6: 00b56bb3 or s7,a0,a1 + 800243ca: 4d0d li s10,3 + 800243cc: 07b00593 li a1,123 + 800243d0: bf95 j 80024344 <.LBB201_35+0x16> + +00000000800243d2 <.LBB201_48>: + 800243d2: 009b7b33 and s6,s6,s1 + 800243d6: 019bf533 and a0,s7,s9 + 800243da: 4605 li a2,1 + 800243dc: 160a slli a2,a2,0x22 + 800243de: a039 j 800243ec <.LBB201_48+0x1a> + 800243e0: 009b7b33 and s6,s6,s1 + 800243e4: 019bf533 and a0,s7,s9 + 800243e8: 4605 li a2,1 + 800243ea: 1602 slli a2,a2,0x20 + 800243ec: 00c56bb3 or s7,a0,a2 + 800243f0: 4d0d li s10,3 + 800243f2: bf89 j 80024344 <.LBB201_35+0x16> + +00000000800243f4 <.LBB201_51>: + 800243f4: 4505 li a0,1 + 800243f6: 08000593 li a1,128 + 800243fa: 00bc6d63 bltu s8,a1,80024414 <.LBB201_51+0x20> + 800243fe: 00bc5593 srli a1,s8,0xb + 80024402: 4509 li a0,2 + 80024404: c981 beqz a1,80024414 <.LBB201_51+0x20> + 80024406: 010c5513 srli a0,s8,0x10 + 8002440a: 00153513 seqz a0,a0 + 8002440e: 4591 li a1,4 + 80024410: 40a58533 sub a0,a1,a0 + 80024414: 014504b3 add s1,a0,s4 + 80024418: 7b22 ld s6,40(sp) + 8002441a: 4bb1 li s7,12 + 8002441c: fbf00813 li a6,-65 + 80024420: 7562 ld a0,56(sp) + 80024422: 75c2 ld a1,48(sp) + 80024424: 40aa0533 sub a0,s4,a0 + 80024428: 00b50a33 add s4,a0,a1 + 8002442c: 87ca mv a5,s2 + 8002442e: db691ce3 bne s2,s6,800241e6 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0xe8> + 80024432: a04d j 800244d4 <.LBB201_67+0x1a> + 80024434: 8562 mv a0,s8 + 80024436: 00002097 auipc ra,0x2 + 8002443a: 9ce080e7 jalr -1586(ra) # 80025e04 <_ZN4core7unicode12unicode_data15grapheme_extend6lookup17hb6efbf5d86b330e2E> + 8002443e: e519 bnez a0,8002444c <.LBB201_51+0x58> + 80024440: 8562 mv a0,s8 + 80024442: 00001097 auipc ra,0x1 + 80024446: a7c080e7 jalr -1412(ra) # 80024ebe <_ZN4core7unicode9printable12is_printable17hd386595a5390c2aaE> + 8002444a: f969 bnez a0,8002441c <.LBB201_51+0x28> + 8002444c: 001c6513 ori a0,s8,1 + 80024450: 00155593 srli a1,a0,0x1 + 80024454: 8d4d or a0,a0,a1 + 80024456: 00255593 srli a1,a0,0x2 + 8002445a: 8d4d or a0,a0,a1 + 8002445c: 00455593 srli a1,a0,0x4 + 80024460: 8d4d or a0,a0,a1 + 80024462: 00855593 srli a1,a0,0x8 + 80024466: 8d4d or a0,a0,a1 + 80024468: 01055593 srli a1,a0,0x10 + 8002446c: 8d4d or a0,a0,a1 + 8002446e: 02055593 srli a1,a0,0x20 + 80024472: 8d4d or a0,a0,a1 + 80024474: fff54513 not a0,a0 + 80024478: 00155593 srli a1,a0,0x1 + 8002447c: 7602 ld a2,32(sp) + 8002447e: 8df1 and a1,a1,a2 + 80024480: 8d0d sub a0,a0,a1 + 80024482: 6662 ld a2,24(sp) + 80024484: 00c575b3 and a1,a0,a2 + 80024488: 8109 srli a0,a0,0x2 + 8002448a: 8d71 and a0,a0,a2 + 8002448c: 952e add a0,a0,a1 + 8002448e: 00455593 srli a1,a0,0x4 + 80024492: 952e add a0,a0,a1 + 80024494: 65c2 ld a1,16(sp) + 80024496: 8d6d and a0,a0,a1 + 80024498: 65a2 ld a1,8(sp) + 8002449a: 02b50533 mul a0,a0,a1 + 8002449e: 9161 srli a0,a0,0x38 + 800244a0: 1501 addi a0,a0,-32 + 800244a2: 0025551b srliw a0,a0,0x2 + 800244a6: 00754b13 xori s6,a0,7 + 800244aa: 6502 ld a0,0(sp) + 800244ac: 00ac6bb3 or s7,s8,a0 + 800244b0: 4d0d li s10,3 + 800244b2: fbf00813 li a6,-65 + 800244b6: e29a73e3 bgeu s4,s1,800242dc <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x1de> + +00000000800244ba <.LBB201_67>: + 800244ba: 0000a717 auipc a4,0xa + 800244be: c8e70713 addi a4,a4,-882 # 8002e148 <.Lanon.f077182aff5f58a5660f14b1290425e3.240> + 800244c2: 6526 ld a0,72(sp) + 800244c4: 85ce mv a1,s3 + 800244c6: 8626 mv a2,s1 + 800244c8: 86d2 mv a3,s4 + 800244ca: 00000097 auipc ra,0x0 + 800244ce: 73a080e7 jalr 1850(ra) # 80024c04 <_ZN4core3str16slice_error_fail17h98613a818fa8baa4E> + 800244d2: 0000 unimp + 800244d4: 0014b513 seqz a0,s1 + 800244d8: 0134c5b3 xor a1,s1,s3 + 800244dc: 0015b593 seqz a1,a1 + 800244e0: 8d4d or a0,a0,a1 + 800244e2: e919 bnez a0,800244f8 <.LBB201_67+0x3e> + 800244e4: 0534f863 bgeu s1,s3,80024534 <.LBB201_68> + 800244e8: 6526 ld a0,72(sp) + 800244ea: 9526 add a0,a0,s1 + 800244ec: 00050503 lb a0,0(a0) + 800244f0: fbf00593 li a1,-65 + 800244f4: 04a5d063 bge a1,a0,80024534 <.LBB201_68> + 800244f8: 6506 ld a0,64(sp) + 800244fa: 6d14 ld a3,24(a0) + 800244fc: 6526 ld a0,72(sp) + 800244fe: 009505b3 add a1,a0,s1 + 80024502: 40998633 sub a2,s3,s1 + 80024506: 8522 mv a0,s0 + 80024508: 9682 jalr a3 + 8002450a: c20514e3 bnez a0,80024132 <_ZN40_$LT$str$u20$as$u20$core..fmt..Debug$GT$3fmt17h399f9f006bebcceeE+0x34> + 8002450e: 02200593 li a1,34 + 80024512: 8522 mv a0,s0 + 80024514: 67c6 ld a5,80(sp) + 80024516: 6de6 ld s11,88(sp) + 80024518: 7d06 ld s10,96(sp) + 8002451a: 7ca6 ld s9,104(sp) + 8002451c: 7c46 ld s8,112(sp) + 8002451e: 7be6 ld s7,120(sp) + 80024520: 6b0a ld s6,128(sp) + 80024522: 6aaa ld s5,136(sp) + 80024524: 6a4a ld s4,144(sp) + 80024526: 69ea ld s3,152(sp) + 80024528: 790a ld s2,160(sp) + 8002452a: 74aa ld s1,168(sp) + 8002452c: 744a ld s0,176(sp) + 8002452e: 70ea ld ra,184(sp) + 80024530: 6129 addi sp,sp,192 + 80024532: 8782 jr a5 + +0000000080024534 <.LBB201_68>: + 80024534: 0000a717 auipc a4,0xa + 80024538: c2c70713 addi a4,a4,-980 # 8002e160 <.Lanon.f077182aff5f58a5660f14b1290425e3.241> + 8002453c: 6526 ld a0,72(sp) + 8002453e: 85ce mv a1,s3 + 80024540: 8626 mv a2,s1 + 80024542: 86ce mv a3,s3 + 80024544: 00000097 auipc ra,0x0 + 80024548: 6c0080e7 jalr 1728(ra) # 80024c04 <_ZN4core3str16slice_error_fail17h98613a818fa8baa4E> + ... + +Disassembly of section .text._ZN42_$LT$str$u20$as$u20$core..fmt..Display$GT$3fmt17h0539661bd0865efeE: + +000000008002454e <_ZN42_$LT$str$u20$as$u20$core..fmt..Display$GT$3fmt17h0539661bd0865efeE>: + 8002454e: 86ae mv a3,a1 + 80024550: 85aa mv a1,a0 + 80024552: 8532 mv a0,a2 + 80024554: 8636 mv a2,a3 + 80024556: 00000317 auipc t1,0x0 + 8002455a: 88a30067 jr -1910(t1) # 80023de0 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE> + +Disassembly of section .text._ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE: + +000000008002455e <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE>: + 8002455e: 7159 addi sp,sp,-112 + 80024560: f486 sd ra,104(sp) + 80024562: f0a2 sd s0,96(sp) + 80024564: eca6 sd s1,88(sp) + 80024566: e8ca sd s2,80(sp) + 80024568: e4ce sd s3,72(sp) + 8002456a: e0d2 sd s4,64(sp) + 8002456c: fc56 sd s5,56(sp) + 8002456e: f85a sd s6,48(sp) + 80024570: f45e sd s7,40(sp) + 80024572: f062 sd s8,32(sp) + 80024574: ec66 sd s9,24(sp) + 80024576: e86a sd s10,16(sp) + 80024578: e46e sd s11,8(sp) + 8002457a: 7590 ld a2,40(a1) + 8002457c: 0205ba03 ld s4,32(a1) + 80024580: 721c ld a5,32(a2) + 80024582: 84aa mv s1,a0 + 80024584: 02700593 li a1,39 + 80024588: 8552 mv a0,s4 + 8002458a: e03e sd a5,0(sp) + 8002458c: 9782 jalr a5 + 8002458e: c10d beqz a0,800245b0 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x52> + 80024590: 4505 li a0,1 + 80024592: 6da2 ld s11,8(sp) + 80024594: 6d42 ld s10,16(sp) + 80024596: 6ce2 ld s9,24(sp) + 80024598: 7c02 ld s8,32(sp) + 8002459a: 7ba2 ld s7,40(sp) + 8002459c: 7b42 ld s6,48(sp) + 8002459e: 7ae2 ld s5,56(sp) + 800245a0: 6a06 ld s4,64(sp) + 800245a2: 69a6 ld s3,72(sp) + 800245a4: 6946 ld s2,80(sp) + 800245a6: 64e6 ld s1,88(sp) + 800245a8: 7406 ld s0,96(sp) + 800245aa: 70a6 ld ra,104(sp) + 800245ac: 6165 addi sp,sp,112 + 800245ae: 8082 ret + 800245b0: 0004e903 lwu s2,0(s1) + 800245b4: 4531 li a0,12 + 800245b6: 4489 li s1,2 + 800245b8: 03255063 bge a0,s2,800245d8 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x7a> + 800245bc: 05c00993 li s3,92 + 800245c0: 03390463 beq s2,s3,800245e8 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x8a> + 800245c4: 02700993 li s3,39 + 800245c8: 03390063 beq s2,s3,800245e8 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x8a> + 800245cc: 4535 li a0,13 + 800245ce: 02a91163 bne s2,a0,800245f0 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x92> + 800245d2: 07200993 li s3,114 + 800245d6: a8ed j 800246d0 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x172> + 800245d8: 4525 li a0,9 + 800245da: 00a90863 beq s2,a0,800245ea <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x8c> + 800245de: 4529 li a0,10 + 800245e0: 00a91863 bne s2,a0,800245f0 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x92> + 800245e4: 06e00993 li s3,110 + 800245e8: a0e5 j 800246d0 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x172> + 800245ea: 07400993 li s3,116 + 800245ee: a0cd j 800246d0 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x172> + 800245f0: 854a mv a0,s2 + 800245f2: 00002097 auipc ra,0x2 + 800245f6: 812080e7 jalr -2030(ra) # 80025e04 <_ZN4core7unicode12unicode_data15grapheme_extend6lookup17hb6efbf5d86b330e2E> + 800245fa: e911 bnez a0,8002460e <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0xb0> + 800245fc: 854a mv a0,s2 + 800245fe: 00001097 auipc ra,0x1 + 80024602: 8c0080e7 jalr -1856(ra) # 80024ebe <_ZN4core7unicode9printable12is_printable17hd386595a5390c2aaE> + 80024606: c501 beqz a0,8002460e <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0xb0> + 80024608: 4485 li s1,1 + 8002460a: 89ca mv s3,s2 + 8002460c: a0d1 j 800246d0 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x172> + 8002460e: 00196513 ori a0,s2,1 + 80024612: 00155593 srli a1,a0,0x1 + 80024616: 8d4d or a0,a0,a1 + 80024618: 00255593 srli a1,a0,0x2 + 8002461c: 8d4d or a0,a0,a1 + 8002461e: 00455593 srli a1,a0,0x4 + 80024622: 8d4d or a0,a0,a1 + 80024624: 00855593 srli a1,a0,0x8 + 80024628: 8d4d or a0,a0,a1 + 8002462a: 01055593 srli a1,a0,0x10 + 8002462e: 8d4d or a0,a0,a1 + 80024630: 02055593 srli a1,a0,0x20 + 80024634: 8d4d or a0,a0,a1 + 80024636: fff54513 not a0,a0 + 8002463a: 00155593 srli a1,a0,0x1 + 8002463e: 05555637 lui a2,0x5555 + 80024642: 5556061b addiw a2,a2,1365 + 80024646: 0632 slli a2,a2,0xc + 80024648: 55560613 addi a2,a2,1365 # 5555555 <.Lline_table_start0+0x551e0f0> + 8002464c: 0632 slli a2,a2,0xc + 8002464e: 55560613 addi a2,a2,1365 + 80024652: 0632 slli a2,a2,0xc + 80024654: 55560613 addi a2,a2,1365 + 80024658: 8df1 and a1,a1,a2 + 8002465a: 8d0d sub a0,a0,a1 + 8002465c: 033335b7 lui a1,0x3333 + 80024660: 3335859b addiw a1,a1,819 + 80024664: 05b2 slli a1,a1,0xc + 80024666: 33358593 addi a1,a1,819 # 3333333 <.Lline_table_start0+0x32fbece> + 8002466a: 05b2 slli a1,a1,0xc + 8002466c: 33358593 addi a1,a1,819 + 80024670: 05b2 slli a1,a1,0xc + 80024672: 33358593 addi a1,a1,819 + 80024676: 00b57633 and a2,a0,a1 + 8002467a: 8109 srli a0,a0,0x2 + 8002467c: 8d6d and a0,a0,a1 + 8002467e: 9532 add a0,a0,a2 + 80024680: 00455593 srli a1,a0,0x4 + 80024684: 952e add a0,a0,a1 + 80024686: 00f0f5b7 lui a1,0xf0f + 8002468a: 0f15859b addiw a1,a1,241 + 8002468e: 05b2 slli a1,a1,0xc + 80024690: f0f58593 addi a1,a1,-241 # f0ef0f <.Lline_table_start0+0xed7aaa> + 80024694: 05b2 slli a1,a1,0xc + 80024696: 0f158593 addi a1,a1,241 + 8002469a: 05b2 slli a1,a1,0xc + 8002469c: f0f58593 addi a1,a1,-241 + 800246a0: 8d6d and a0,a0,a1 + 800246a2: 010105b7 lui a1,0x1010 + 800246a6: 1015859b addiw a1,a1,257 + 800246aa: 05c2 slli a1,a1,0x10 + 800246ac: 10158593 addi a1,a1,257 # 1010101 <.Lline_table_start0+0xfd8c9c> + 800246b0: 05c2 slli a1,a1,0x10 + 800246b2: 10158593 addi a1,a1,257 + 800246b6: 02b50533 mul a0,a0,a1 + 800246ba: 9161 srli a0,a0,0x38 + 800246bc: 1501 addi a0,a0,-32 + 800246be: 0025551b srliw a0,a0,0x2 + 800246c2: 00754a93 xori s5,a0,7 + 800246c6: 4515 li a0,5 + 800246c8: 1502 slli a0,a0,0x20 + 800246ca: 00a96433 or s0,s2,a0 + 800246ce: 448d li s1,3 + 800246d0: 597d li s2,-1 + 800246d2: f0100513 li a0,-255 + 800246d6: 1502 slli a0,a0,0x20 + 800246d8: fff50b13 addi s6,a0,-1 + 800246dc: 4b85 li s7,1 + 800246de: 4c09 li s8,2 + +00000000800246e0 <.LBB203_35>: + 800246e0: 00009c97 auipc s9,0x9 + 800246e4: 638c8c93 addi s9,s9,1592 # 8002dd18 <.LJTI203_0> + 800246e8: 020b9d93 slli s11,s7,0x20 + 800246ec: 021b9d13 slli s10,s7,0x21 + 800246f0: a039 j 800246fe <.LBB203_35+0x1e> + 800246f2: 4485 li s1,1 + 800246f4: 8552 mv a0,s4 + 800246f6: 6782 ld a5,0(sp) + 800246f8: 9782 jalr a5 + 800246fa: e8051be3 bnez a0,80024590 <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE+0x32> + 800246fe: 02049513 slli a0,s1,0x20 + 80024702: 9101 srli a0,a0,0x20 + 80024704: 02abd663 bge s7,a0,80024730 <.LBB203_22+0x10> + 80024708: 05c00593 li a1,92 + 8002470c: ff8503e3 beq a0,s8,800246f2 <.LBB203_35+0x12> + 80024710: 02045513 srli a0,s0,0x20 + 80024714: 0ff57513 andi a0,a0,255 + 80024718: 050e slli a0,a0,0x3 + 8002471a: 9566 add a0,a0,s9 + 8002471c: 6108 ld a0,0(a0) + 8002471e: 8502 jr a0 + +0000000080024720 <.LBB203_22>: + 80024720: 012afab3 and s5,s5,s2 + 80024724: 01647433 and s0,s0,s6 + 80024728: 448d li s1,3 + 8002472a: 07d00593 li a1,125 + 8002472e: b7d9 j 800246f4 <.LBB203_35+0x14> + 80024730: 07751d63 bne a0,s7,800247aa <.LBB203_34> + 80024734: 4481 li s1,0 + 80024736: 85ce mv a1,s3 + 80024738: bf75 j 800246f4 <.LBB203_35+0x14> + +000000008002473a <.LBB203_25>: + 8002473a: 002a9513 slli a0,s5,0x2 + 8002473e: 00a4553b srlw a0,s0,a0 + 80024742: 893d andi a0,a0,15 + 80024744: 03000593 li a1,48 + 80024748: 4629 li a2,10 + 8002474a: 00c56463 bltu a0,a2,80024752 <.LBB203_25+0x18> + 8002474e: 05700593 li a1,87 + 80024752: 95aa add a1,a1,a0 + 80024754: 040a8363 beqz s5,8002479a <.LBB203_31+0x12> + 80024758: 1afd addi s5,s5,-1 + 8002475a: a0b1 j 800247a6 <.LBB203_31+0x1e> + +000000008002475c <.LBB203_29>: + 8002475c: 012afab3 and s5,s5,s2 + 80024760: 01647533 and a0,s0,s6 + 80024764: 01a56433 or s0,a0,s10 + 80024768: 448d li s1,3 + 8002476a: 07b00593 li a1,123 + 8002476e: b759 j 800246f4 <.LBB203_35+0x14> + +0000000080024770 <.LBB203_30>: + 80024770: 012afab3 and s5,s5,s2 + 80024774: 01647533 and a0,s0,s6 + 80024778: 448d li s1,3 + 8002477a: 02049593 slli a1,s1,0x20 + 8002477e: 00b56433 or s0,a0,a1 + 80024782: 07500593 li a1,117 + 80024786: b7bd j 800246f4 <.LBB203_35+0x14> + +0000000080024788 <.LBB203_31>: + 80024788: 012afab3 and s5,s5,s2 + 8002478c: 01647533 and a0,s0,s6 + 80024790: 022b9613 slli a2,s7,0x22 + 80024794: 00c56433 or s0,a0,a2 + 80024798: a039 j 800247a6 <.LBB203_31+0x1e> + 8002479a: 012afab3 and s5,s5,s2 + 8002479e: 01647533 and a0,s0,s6 + 800247a2: 01b56433 or s0,a0,s11 + 800247a6: 448d li s1,3 + 800247a8: b7b1 j 800246f4 <.LBB203_35+0x14> + +00000000800247aa <.LBB203_34>: + 800247aa: 02700593 li a1,39 + 800247ae: 8552 mv a0,s4 + 800247b0: 6782 ld a5,0(sp) + 800247b2: 6da2 ld s11,8(sp) + 800247b4: 6d42 ld s10,16(sp) + 800247b6: 6ce2 ld s9,24(sp) + 800247b8: 7c02 ld s8,32(sp) + 800247ba: 7ba2 ld s7,40(sp) + 800247bc: 7b42 ld s6,48(sp) + 800247be: 7ae2 ld s5,56(sp) + 800247c0: 6a06 ld s4,64(sp) + 800247c2: 69a6 ld s3,72(sp) + 800247c4: 6946 ld s2,80(sp) + 800247c6: 64e6 ld s1,88(sp) + 800247c8: 7406 ld s0,96(sp) + 800247ca: 70a6 ld ra,104(sp) + 800247cc: 6165 addi sp,sp,112 + 800247ce: 8782 jr a5 + +Disassembly of section .text._ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE: + +00000000800247d0 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE>: + 800247d0: 1141 addi sp,sp,-16 + 800247d2: e406 sd ra,8(sp) + 800247d4: 00758693 addi a3,a1,7 + 800247d8: 9ae1 andi a3,a3,-8 + 800247da: 8e8d sub a3,a3,a1 + 800247dc: 0ff57813 andi a6,a0,255 + 800247e0: c68d beqz a3,8002480a <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0x3a> + 800247e2: 8532 mv a0,a2 + 800247e4: 00d66363 bltu a2,a3,800247ea <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0x1a> + 800247e8: 8536 mv a0,a3 + 800247ea: c105 beqz a0,8002480a <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0x3a> + 800247ec: 4681 li a3,0 + 800247ee: 00d58733 add a4,a1,a3 + 800247f2: 00074703 lbu a4,0(a4) + 800247f6: 0b070e63 beq a4,a6,800248b2 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0xe2> + 800247fa: 0685 addi a3,a3,1 + 800247fc: fed519e3 bne a0,a3,800247ee <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0x1e> + 80024800: ff060893 addi a7,a2,-16 + 80024804: 00a8f663 bgeu a7,a0,80024810 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0x40> + 80024808: a049 j 8002488a <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0xba> + 8002480a: 4501 li a0,0 + 8002480c: ff060893 addi a7,a2,-16 + 80024810: feff06b7 lui a3,0xfeff0 + 80024814: eff6869b addiw a3,a3,-257 + 80024818: 06c2 slli a3,a3,0x10 + 8002481a: eff68693 addi a3,a3,-257 # fffffffffefefeff + 8002481e: 06c2 slli a3,a3,0x10 + 80024820: eff68293 addi t0,a3,-257 + 80024824: 76c1 lui a3,0xffff0 + 80024826: 1016869b addiw a3,a3,257 + 8002482a: 06c2 slli a3,a3,0x10 + 8002482c: 10168693 addi a3,a3,257 # ffffffffffff0101 + 80024830: 06c2 slli a3,a3,0x10 + 80024832: 10168693 addi a3,a3,257 + 80024836: 06be slli a3,a3,0xf + 80024838: 08068313 addi t1,a3,128 + 8002483c: 010106b7 lui a3,0x1010 + 80024840: 1016869b addiw a3,a3,257 + 80024844: 06c2 slli a3,a3,0x10 + 80024846: 10168693 addi a3,a3,257 # 1010101 <.Lline_table_start0+0xfd8c9c> + 8002484a: 06c2 slli a3,a3,0x10 + 8002484c: 10168693 addi a3,a3,257 + 80024850: 02d803b3 mul t2,a6,a3 + 80024854: 00a587b3 add a5,a1,a0 + 80024858: 6398 ld a4,0(a5) + 8002485a: 679c ld a5,8(a5) + 8002485c: 00774733 xor a4,a4,t2 + 80024860: fff74693 not a3,a4 + 80024864: 9716 add a4,a4,t0 + 80024866: 0066f6b3 and a3,a3,t1 + 8002486a: 8ef9 and a3,a3,a4 + 8002486c: 0077c733 xor a4,a5,t2 + 80024870: fff74793 not a5,a4 + 80024874: 9716 add a4,a4,t0 + 80024876: 0067f7b3 and a5,a5,t1 + 8002487a: 8f7d and a4,a4,a5 + 8002487c: 8ed9 or a3,a3,a4 + 8002487e: e681 bnez a3,80024886 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0xb6> + 80024880: 0541 addi a0,a0,16 + 80024882: fca8f9e3 bgeu a7,a0,80024854 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0x84> + 80024886: 02a66b63 bltu a2,a0,800248bc <.LBB209_21> + 8002488a: 00c50e63 beq a0,a2,800248a6 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0xd6> + 8002488e: 4681 li a3,0 + 80024890: 95aa add a1,a1,a0 + 80024892: 8e09 sub a2,a2,a0 + 80024894: 00d58733 add a4,a1,a3 + 80024898: 00074703 lbu a4,0(a4) + 8002489c: 01070a63 beq a4,a6,800248b0 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0xe0> + 800248a0: 0685 addi a3,a3,1 + 800248a2: fed619e3 bne a2,a3,80024894 <_ZN4core5slice6memchr19memchr_general_case17hea58e64f15abdd7dE+0xc4> + 800248a6: 4501 li a0,0 + 800248a8: 85b6 mv a1,a3 + 800248aa: 60a2 ld ra,8(sp) + 800248ac: 0141 addi sp,sp,16 + 800248ae: 8082 ret + 800248b0: 96aa add a3,a3,a0 + 800248b2: 4505 li a0,1 + 800248b4: 85b6 mv a1,a3 + 800248b6: 60a2 ld ra,8(sp) + 800248b8: 0141 addi sp,sp,16 + 800248ba: 8082 ret + +00000000800248bc <.LBB209_21>: + 800248bc: 0000a697 auipc a3,0xa + 800248c0: 8c468693 addi a3,a3,-1852 # 8002e180 <.Lanon.f077182aff5f58a5660f14b1290425e3.246> + 800248c4: 85b2 mv a1,a2 + 800248c6: 8636 mv a2,a3 + 800248c8: 00000097 auipc ra,0x0 + 800248cc: 00a080e7 jalr 10(ra) # 800248d2 <_ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E> + ... + +Disassembly of section .text.unlikely._ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E: + +00000000800248d2 <_ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E>: + 800248d2: 7159 addi sp,sp,-112 + 800248d4: f486 sd ra,104(sp) + 800248d6: e42a sd a0,8(sp) + 800248d8: e82e sd a1,16(sp) + 800248da: 0028 addi a0,sp,8 + 800248dc: e4aa sd a0,72(sp) + +00000000800248de <.LBB215_1>: + 800248de: 00001517 auipc a0,0x1 + 800248e2: fc250513 addi a0,a0,-62 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 800248e6: e8aa sd a0,80(sp) + 800248e8: 080c addi a1,sp,16 + 800248ea: ecae sd a1,88(sp) + 800248ec: f0aa sd a0,96(sp) + +00000000800248ee <.LBB215_2>: + 800248ee: 0000a517 auipc a0,0xa + 800248f2: 8e250513 addi a0,a0,-1822 # 8002e1d0 <.Lanon.f077182aff5f58a5660f14b1290425e3.252> + 800248f6: ec2a sd a0,24(sp) + 800248f8: 4509 li a0,2 + 800248fa: f02a sd a0,32(sp) + 800248fc: f402 sd zero,40(sp) + 800248fe: 00ac addi a1,sp,72 + 80024900: fc2e sd a1,56(sp) + 80024902: e0aa sd a0,64(sp) + 80024904: 0828 addi a0,sp,24 + 80024906: 85b2 mv a1,a2 + 80024908: fffff097 auipc ra,0xfffff + 8002490c: 8a8080e7 jalr -1880(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text.unlikely._ZN4core5slice5index24slice_end_index_len_fail17hbdcbb59c061b5014E: + +0000000080024912 <_ZN4core5slice5index24slice_end_index_len_fail17hbdcbb59c061b5014E>: + 80024912: 7159 addi sp,sp,-112 + 80024914: f486 sd ra,104(sp) + 80024916: e42a sd a0,8(sp) + 80024918: e82e sd a1,16(sp) + 8002491a: 0028 addi a0,sp,8 + 8002491c: e4aa sd a0,72(sp) + +000000008002491e <.LBB216_1>: + 8002491e: 00001517 auipc a0,0x1 + 80024922: f8250513 addi a0,a0,-126 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80024926: e8aa sd a0,80(sp) + 80024928: 080c addi a1,sp,16 + 8002492a: ecae sd a1,88(sp) + 8002492c: f0aa sd a0,96(sp) + +000000008002492e <.LBB216_2>: + 8002492e: 0000a517 auipc a0,0xa + 80024932: 8c250513 addi a0,a0,-1854 # 8002e1f0 <.Lanon.f077182aff5f58a5660f14b1290425e3.254> + 80024936: ec2a sd a0,24(sp) + 80024938: 4509 li a0,2 + 8002493a: f02a sd a0,32(sp) + 8002493c: f402 sd zero,40(sp) + 8002493e: 00ac addi a1,sp,72 + 80024940: fc2e sd a1,56(sp) + 80024942: e0aa sd a0,64(sp) + 80024944: 0828 addi a0,sp,24 + 80024946: 85b2 mv a1,a2 + 80024948: fffff097 auipc ra,0xfffff + 8002494c: 868080e7 jalr -1944(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text.unlikely._ZN4core5slice5index22slice_index_order_fail17h8c18576576dbf4e3E: + +0000000080024952 <_ZN4core5slice5index22slice_index_order_fail17h8c18576576dbf4e3E>: + 80024952: 7159 addi sp,sp,-112 + 80024954: f486 sd ra,104(sp) + 80024956: e42a sd a0,8(sp) + 80024958: e82e sd a1,16(sp) + 8002495a: 0028 addi a0,sp,8 + 8002495c: e4aa sd a0,72(sp) + +000000008002495e <.LBB217_1>: + 8002495e: 00001517 auipc a0,0x1 + 80024962: f4250513 addi a0,a0,-190 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80024966: e8aa sd a0,80(sp) + 80024968: 080c addi a1,sp,16 + 8002496a: ecae sd a1,88(sp) + 8002496c: f0aa sd a0,96(sp) + +000000008002496e <.LBB217_2>: + 8002496e: 0000a517 auipc a0,0xa + 80024972: 8ca50513 addi a0,a0,-1846 # 8002e238 <.Lanon.f077182aff5f58a5660f14b1290425e3.257> + 80024976: ec2a sd a0,24(sp) + 80024978: 4509 li a0,2 + 8002497a: f02a sd a0,32(sp) + 8002497c: f402 sd zero,40(sp) + 8002497e: 00ac addi a1,sp,72 + 80024980: fc2e sd a1,56(sp) + 80024982: e0aa sd a0,64(sp) + 80024984: 0828 addi a0,sp,24 + 80024986: 85b2 mv a1,a2 + 80024988: fffff097 auipc ra,0xfffff + 8002498c: 828080e7 jalr -2008(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text._ZN4core3str8converts9from_utf817h3f0a2d8686bfd9bbE: + +0000000080024992 <_ZN4core3str8converts9from_utf817h3f0a2d8686bfd9bbE>: + 80024992: 711d addi sp,sp,-96 + 80024994: eca2 sd s0,88(sp) + 80024996: e8a6 sd s1,80(sp) + 80024998: e4ca sd s2,72(sp) + 8002499a: e0ce sd s3,64(sp) + 8002499c: fc52 sd s4,56(sp) + 8002499e: f856 sd s5,48(sp) + 800249a0: f45a sd s6,40(sp) + 800249a2: f05e sd s7,32(sp) + 800249a4: ec62 sd s8,24(sp) + 800249a6: e866 sd s9,16(sp) + 800249a8: e46a sd s10,8(sp) + 800249aa: ff160693 addi a3,a2,-15 + 800249ae: 00d63733 sltu a4,a2,a3 + 800249b2: 4c81 li s9,0 + 800249b4: e311 bnez a4,800249b8 <_ZN4core3str8converts9from_utf817h3f0a2d8686bfd9bbE+0x26> + 800249b6: 8cb6 mv s9,a3 + 800249b8: 20060663 beqz a2,80024bc4 <.LBB222_49+0x1f4> + 800249bc: 4681 li a3,0 + 800249be: 00758713 addi a4,a1,7 + 800249c2: 9b61 andi a4,a4,-8 + 800249c4: 40b70833 sub a6,a4,a1 + 800249c8: 00180713 addi a4,a6,1 # 1c0001 <.Lline_table_start0+0x188b9c> + 800249cc: 00173c13 seqz s8,a4 + +00000000800249d0 <.LBB222_49>: + 800249d0: 0000a897 auipc a7,0xa + 800249d4: 88888893 addi a7,a7,-1912 # 8002e258 <_ZN4core3str11validations15UTF8_CHAR_WIDTH17h26c7bb6d1905d302E> + 800249d8: 4291 li t0,4 + 800249da: 0f400313 li t1,244 + 800249de: 08000393 li t2,128 + 800249e2: 0f000e13 li t3,240 + 800249e6: 03000e93 li t4,48 + 800249ea: 4f09 li t5,2 + 800249ec: 5ffd li t6,-1 + 800249ee: 0bf00913 li s2,191 + 800249f2: 4b8d li s7,3 + 800249f4: 0ed00b13 li s6,237 + 800249f8: 0e000993 li s3,224 + 800249fc: 0a000a13 li s4,160 + 80024a00: 4aad li s5,11 + 80024a02: 7741 lui a4,0xffff0 + 80024a04: 1017071b addiw a4,a4,257 + 80024a08: 0742 slli a4,a4,0x10 + 80024a0a: 10170713 addi a4,a4,257 # ffffffffffff0101 + 80024a0e: 0742 slli a4,a4,0x10 + 80024a10: 10170713 addi a4,a4,257 + 80024a14: 073e slli a4,a4,0xf + 80024a16: 08070413 addi s0,a4,128 + 80024a1a: a029 j 80024a24 <.LBB222_49+0x54> + 80024a1c: 00170693 addi a3,a4,1 + 80024a20: 1ac6f263 bgeu a3,a2,80024bc4 <.LBB222_49+0x1f4> + 80024a24: 00d58733 add a4,a1,a3 + 80024a28: 00074703 lbu a4,0(a4) + 80024a2c: 03871793 slli a5,a4,0x38 + 80024a30: 4387d493 srai s1,a5,0x38 + 80024a34: 0004cc63 bltz s1,80024a4c <.LBB222_49+0x7c> + 80024a38: 000c1663 bnez s8,80024a44 <.LBB222_49+0x74> + 80024a3c: 40d80733 sub a4,a6,a3 + 80024a40: 8b1d andi a4,a4,7 + 80024a42: cf05 beqz a4,80024a7a <.LBB222_49+0xaa> + 80024a44: 0685 addi a3,a3,1 + 80024a46: fcc6efe3 bltu a3,a2,80024a24 <.LBB222_49+0x54> + 80024a4a: aaad j 80024bc4 <.LBB222_49+0x1f4> + 80024a4c: 011707b3 add a5,a4,a7 + 80024a50: 0007c783 lbu a5,0(a5) + 80024a54: 04578b63 beq a5,t0,80024aaa <.LBB222_49+0xda> + 80024a58: 07778b63 beq a5,s7,80024ace <.LBB222_49+0xfe> + 80024a5c: 17e79b63 bne a5,t5,80024bd2 <.LBB222_49+0x202> + 80024a60: 00168713 addi a4,a3,1 + 80024a64: 16c77463 bgeu a4,a2,80024bcc <.LBB222_49+0x1fc> + 80024a68: 00e587b3 add a5,a1,a4 + 80024a6c: 0007c783 lbu a5,0(a5) + 80024a70: 0c07f793 andi a5,a5,192 + 80024a74: fa7784e3 beq a5,t2,80024a1c <.LBB222_49+0x4c> + 80024a78: aaa9 j 80024bd2 <.LBB222_49+0x202> + 80024a7a: 0196fc63 bgeu a3,s9,80024a92 <.LBB222_49+0xc2> + 80024a7e: 00d58733 add a4,a1,a3 + 80024a82: 631c ld a5,0(a4) + 80024a84: 6718 ld a4,8(a4) + 80024a86: 8f5d or a4,a4,a5 + 80024a88: 8f61 and a4,a4,s0 + 80024a8a: e701 bnez a4,80024a92 <.LBB222_49+0xc2> + 80024a8c: 06c1 addi a3,a3,16 + 80024a8e: ff96e8e3 bltu a3,s9,80024a7e <.LBB222_49+0xae> + 80024a92: fac6fae3 bgeu a3,a2,80024a46 <.LBB222_49+0x76> + 80024a96: 00d58733 add a4,a1,a3 + 80024a9a: 00070703 lb a4,0(a4) + 80024a9e: fa0744e3 bltz a4,80024a46 <.LBB222_49+0x76> + 80024aa2: 0685 addi a3,a3,1 + 80024aa4: fed619e3 bne a2,a3,80024a96 <.LBB222_49+0xc6> + 80024aa8: aa31 j 80024bc4 <.LBB222_49+0x1f4> + 80024aaa: 00168793 addi a5,a3,1 + 80024aae: 10c7ff63 bgeu a5,a2,80024bcc <.LBB222_49+0x1fc> + 80024ab2: 97ae add a5,a5,a1 + 80024ab4: 0007c783 lbu a5,0(a5) + 80024ab8: 02670b63 beq a4,t1,80024aee <.LBB222_49+0x11e> + 80024abc: 05c71363 bne a4,t3,80024b02 <.LBB222_49+0x132> + 80024ac0: 07078713 addi a4,a5,112 + 80024ac4: 0ff77713 andi a4,a4,255 + 80024ac8: 05d76d63 bltu a4,t4,80024b22 <.LBB222_49+0x152> + 80024acc: a219 j 80024bd2 <.LBB222_49+0x202> + 80024ace: 00168793 addi a5,a3,1 + 80024ad2: 0ec7fd63 bgeu a5,a2,80024bcc <.LBB222_49+0x1fc> + 80024ad6: 97ae add a5,a5,a1 + 80024ad8: 0007c783 lbu a5,0(a5) + 80024adc: 07670c63 beq a4,s6,80024b54 <.LBB222_49+0x184> + 80024ae0: 09371463 bne a4,s3,80024b68 <.LBB222_49+0x198> + 80024ae4: 0e07f713 andi a4,a5,224 + 80024ae8: 0b470f63 beq a4,s4,80024ba6 <.LBB222_49+0x1d6> + 80024aec: a0dd j 80024bd2 <.LBB222_49+0x202> + 80024aee: 03879713 slli a4,a5,0x38 + 80024af2: 9761 srai a4,a4,0x38 + 80024af4: 00072713 slti a4,a4,0 + 80024af8: 0907b793 sltiu a5,a5,144 + 80024afc: 8f7d and a4,a4,a5 + 80024afe: e315 bnez a4,80024b22 <.LBB222_49+0x152> + 80024b00: a8c9 j 80024bd2 <.LBB222_49+0x202> + 80024b02: 00f48713 addi a4,s1,15 + 80024b06: 0ff77713 andi a4,a4,255 + 80024b0a: 00ef3733 sltu a4,t5,a4 + 80024b0e: 03879493 slli s1,a5,0x38 + 80024b12: 94e1 srai s1,s1,0x38 + 80024b14: 009fa4b3 slt s1,t6,s1 + 80024b18: 8f45 or a4,a4,s1 + 80024b1a: 00f937b3 sltu a5,s2,a5 + 80024b1e: 8f5d or a4,a4,a5 + 80024b20: eb4d bnez a4,80024bd2 <.LBB222_49+0x202> + 80024b22: 00268713 addi a4,a3,2 + 80024b26: 0ac77363 bgeu a4,a2,80024bcc <.LBB222_49+0x1fc> + 80024b2a: 972e add a4,a4,a1 + 80024b2c: 00074703 lbu a4,0(a4) + 80024b30: 0c077713 andi a4,a4,192 + 80024b34: 4485 li s1,1 + 80024b36: 0c771363 bne a4,t2,80024bfc <.LBB222_49+0x22c> + 80024b3a: 00368713 addi a4,a3,3 + 80024b3e: 08c77763 bgeu a4,a2,80024bcc <.LBB222_49+0x1fc> + 80024b42: 00e587b3 add a5,a1,a4 + 80024b46: 0007c783 lbu a5,0(a5) + 80024b4a: 0c07f793 andi a5,a5,192 + 80024b4e: ec7787e3 beq a5,t2,80024a1c <.LBB222_49+0x4c> + 80024b52: a07d j 80024c00 <.LBB222_49+0x230> + 80024b54: 03879713 slli a4,a5,0x38 + 80024b58: 9761 srai a4,a4,0x38 + 80024b5a: 00072713 slti a4,a4,0 + 80024b5e: 0a07b793 sltiu a5,a5,160 + 80024b62: 8f7d and a4,a4,a5 + 80024b64: e329 bnez a4,80024ba6 <.LBB222_49+0x1d6> + 80024b66: a0b5 j 80024bd2 <.LBB222_49+0x202> + 80024b68: 01f48713 addi a4,s1,31 + 80024b6c: 0ff77713 andi a4,a4,255 + 80024b70: 03879d13 slli s10,a5,0x38 + 80024b74: 00eaeb63 bltu s5,a4,80024b8a <.LBB222_49+0x1ba> + 80024b78: 438d5713 srai a4,s10,0x38 + 80024b7c: 00072713 slti a4,a4,0 + 80024b80: 0c07b793 sltiu a5,a5,192 + 80024b84: 8f7d and a4,a4,a5 + 80024b86: e305 bnez a4,80024ba6 <.LBB222_49+0x1d6> + 80024b88: a0a9 j 80024bd2 <.LBB222_49+0x202> + 80024b8a: ffe4f713 andi a4,s1,-2 + 80024b8e: 0749 addi a4,a4,18 + 80024b90: 00e03733 snez a4,a4 + 80024b94: 438d5493 srai s1,s10,0x38 + 80024b98: 009fa4b3 slt s1,t6,s1 + 80024b9c: 8f45 or a4,a4,s1 + 80024b9e: 00f937b3 sltu a5,s2,a5 + 80024ba2: 8f5d or a4,a4,a5 + 80024ba4: e71d bnez a4,80024bd2 <.LBB222_49+0x202> + 80024ba6: 00268713 addi a4,a3,2 + 80024baa: 02c77163 bgeu a4,a2,80024bcc <.LBB222_49+0x1fc> + 80024bae: 00e587b3 add a5,a1,a4 + 80024bb2: 0007c783 lbu a5,0(a5) + 80024bb6: 0c07f793 andi a5,a5,192 + 80024bba: e67781e3 beq a5,t2,80024a1c <.LBB222_49+0x4c> + 80024bbe: 4485 li s1,1 + 80024bc0: 4589 li a1,2 + 80024bc2: a811 j 80024bd6 <.LBB222_49+0x206> + 80024bc4: 4681 li a3,0 + 80024bc6: e50c sd a1,8(a0) + 80024bc8: e910 sd a2,16(a0) + 80024bca: a819 j 80024be0 <.LBB222_49+0x210> + 80024bcc: 4581 li a1,0 + 80024bce: 4481 li s1,0 + 80024bd0: a019 j 80024bd6 <.LBB222_49+0x206> + 80024bd2: 4585 li a1,1 + 80024bd4: 4485 li s1,1 + 80024bd6: 05a2 slli a1,a1,0x8 + 80024bd8: 8dc5 or a1,a1,s1 + 80024bda: e514 sd a3,8(a0) + 80024bdc: e90c sd a1,16(a0) + 80024bde: 4685 li a3,1 + 80024be0: e114 sd a3,0(a0) + 80024be2: 6d22 ld s10,8(sp) + 80024be4: 6cc2 ld s9,16(sp) + 80024be6: 6c62 ld s8,24(sp) + 80024be8: 7b82 ld s7,32(sp) + 80024bea: 7b22 ld s6,40(sp) + 80024bec: 7ac2 ld s5,48(sp) + 80024bee: 7a62 ld s4,56(sp) + 80024bf0: 6986 ld s3,64(sp) + 80024bf2: 6926 ld s2,72(sp) + 80024bf4: 64c6 ld s1,80(sp) + 80024bf6: 6466 ld s0,88(sp) + 80024bf8: 6125 addi sp,sp,96 + 80024bfa: 8082 ret + 80024bfc: 4589 li a1,2 + 80024bfe: bfe1 j 80024bd6 <.LBB222_49+0x206> + 80024c00: 458d li a1,3 + 80024c02: bfd1 j 80024bd6 <.LBB222_49+0x206> + +Disassembly of section .text.unlikely._ZN4core3str16slice_error_fail17h98613a818fa8baa4E: + +0000000080024c04 <_ZN4core3str16slice_error_fail17h98613a818fa8baa4E>: + 80024c04: 7115 addi sp,sp,-224 + 80024c06: ed86 sd ra,216(sp) + 80024c08: e432 sd a2,8(sp) + 80024c0a: 10100793 li a5,257 + 80024c0e: e836 sd a3,16(sp) + 80024c10: 00f5fb63 bgeu a1,a5,80024c26 <.LBB239_47+0x10> + 80024c14: 4801 li a6,0 + +0000000080024c16 <.LBB239_47>: + 80024c16: 00009797 auipc a5,0x9 + 80024c1a: 13278793 addi a5,a5,306 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 80024c1e: f43e sd a5,40(sp) + 80024c20: ec2a sd a0,24(sp) + 80024c22: f02e sd a1,32(sp) + 80024c24: a889 j 80024c76 <.LBB239_48+0xc> + 80024c26: 0ff00793 li a5,255 + 80024c2a: 40b788b3 sub a7,a5,a1 + 80024c2e: 10000313 li t1,256 + 80024c32: fbf00813 li a6,-65 + 80024c36: a839 j 80024c54 <.LBB239_47+0x3e> + 80024c38: fff30293 addi t0,t1,-1 + 80024c3c: 006887b3 add a5,a7,t1 + 80024c40: 00503333 snez t1,t0 + 80024c44: f0078793 addi a5,a5,-256 + 80024c48: 00f037b3 snez a5,a5 + 80024c4c: 00f377b3 and a5,t1,a5 + 80024c50: 8316 mv t1,t0 + 80024c52: cb91 beqz a5,80024c66 <.LBB239_47+0x50> + 80024c54: feb372e3 bgeu t1,a1,80024c38 <.LBB239_47+0x22> + 80024c58: 006507b3 add a5,a0,t1 + 80024c5c: 00078783 lb a5,0(a5) + 80024c60: fcf85ce3 bge a6,a5,80024c38 <.LBB239_47+0x22> + 80024c64: 829a mv t0,t1 + 80024c66: ec2a sd a0,24(sp) + 80024c68: f016 sd t0,32(sp) + +0000000080024c6a <.LBB239_48>: + 80024c6a: 00009797 auipc a5,0x9 + 80024c6e: 6ee78793 addi a5,a5,1774 # 8002e358 <.Lanon.f077182aff5f58a5660f14b1290425e3.315> + 80024c72: f43e sd a5,40(sp) + 80024c74: 4815 li a6,5 + 80024c76: 00c5b8b3 sltu a7,a1,a2 + 80024c7a: 0018c293 xori t0,a7,1 + 80024c7e: 00d5b7b3 sltu a5,a1,a3 + 80024c82: 0017c793 xori a5,a5,1 + 80024c86: 00f2f7b3 and a5,t0,a5 + 80024c8a: f842 sd a6,48(sp) + 80024c8c: ef8d bnez a5,80024cc6 <.LBB239_51+0xe> + 80024c8e: 00089363 bnez a7,80024c94 <.LBB239_48+0x2a> + 80024c92: 8636 mv a2,a3 + 80024c94: e4b2 sd a2,72(sp) + 80024c96: 00a8 addi a0,sp,72 + 80024c98: e52a sd a0,136(sp) + +0000000080024c9a <.LBB239_49>: + 80024c9a: 00001517 auipc a0,0x1 + 80024c9e: c0650513 addi a0,a0,-1018 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80024ca2: e92a sd a0,144(sp) + 80024ca4: 0828 addi a0,sp,24 + 80024ca6: ed2a sd a0,152(sp) + +0000000080024ca8 <.LBB239_50>: + 80024ca8: 00001517 auipc a0,0x1 + 80024cac: 05050513 addi a0,a0,80 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 80024cb0: f12a sd a0,160(sp) + 80024cb2: 102c addi a1,sp,40 + 80024cb4: f52e sd a1,168(sp) + 80024cb6: f92a sd a0,176(sp) + +0000000080024cb8 <.LBB239_51>: + 80024cb8: 00009517 auipc a0,0x9 + 80024cbc: 6c850513 addi a0,a0,1736 # 8002e380 <.Lanon.f077182aff5f58a5660f14b1290425e3.318> + 80024cc0: ecaa sd a0,88(sp) + 80024cc2: 450d li a0,3 + 80024cc4: a2cd j 80024ea6 <.LBB239_60+0xc> + 80024cc6: 02c6fd63 bgeu a3,a2,80024d00 <.LBB239_54+0xe> + 80024cca: 0028 addi a0,sp,8 + 80024ccc: e52a sd a0,136(sp) + +0000000080024cce <.LBB239_52>: + 80024cce: 00001517 auipc a0,0x1 + 80024cd2: bd250513 addi a0,a0,-1070 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80024cd6: e92a sd a0,144(sp) + 80024cd8: 080c addi a1,sp,16 + 80024cda: ed2e sd a1,152(sp) + 80024cdc: f12a sd a0,160(sp) + 80024cde: 0828 addi a0,sp,24 + 80024ce0: f52a sd a0,168(sp) + +0000000080024ce2 <.LBB239_53>: + 80024ce2: 00001517 auipc a0,0x1 + 80024ce6: 01650513 addi a0,a0,22 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 80024cea: f92a sd a0,176(sp) + 80024cec: 102c addi a1,sp,40 + 80024cee: fd2e sd a1,184(sp) + 80024cf0: e1aa sd a0,192(sp) + +0000000080024cf2 <.LBB239_54>: + 80024cf2: 00009517 auipc a0,0x9 + 80024cf6: 6ce50513 addi a0,a0,1742 # 8002e3c0 <.Lanon.f077182aff5f58a5660f14b1290425e3.322> + 80024cfa: ecaa sd a0,88(sp) + 80024cfc: 4511 li a0,4 + 80024cfe: a265 j 80024ea6 <.LBB239_60+0xc> + 80024d00: 00163813 seqz a6,a2 + 80024d04: 00c5c7b3 xor a5,a1,a2 + 80024d08: 0017b793 seqz a5,a5 + 80024d0c: 00f867b3 or a5,a6,a5 + 80024d10: c399 beqz a5,80024d16 <.LBB239_54+0x24> + 80024d12: 8636 mv a2,a3 + 80024d14: a819 j 80024d2a <.LBB239_54+0x38> + 80024d16: 00b67a63 bgeu a2,a1,80024d2a <.LBB239_54+0x38> + 80024d1a: 00c507b3 add a5,a0,a2 + 80024d1e: 00078803 lb a6,0(a5) + 80024d22: fc000793 li a5,-64 + 80024d26: fef856e3 bge a6,a5,80024d12 <.LBB239_54+0x20> + 80024d2a: 00163693 seqz a3,a2 + 80024d2e: 00b647b3 xor a5,a2,a1 + 80024d32: 0017b793 seqz a5,a5 + 80024d36: 8edd or a3,a3,a5 + 80024d38: fc32 sd a2,56(sp) + 80024d3a: c28d beqz a3,80024d5c <.LBB239_55+0x18> + 80024d3c: 87b2 mv a5,a2 + 80024d3e: 863e mv a2,a5 + 80024d40: 04b61763 bne a2,a1,80024d8e <.LBB239_55+0x4a> + +0000000080024d44 <.LBB239_55>: + 80024d44: 00009517 auipc a0,0x9 + 80024d48: 01c50513 addi a0,a0,28 # 8002dd60 <.Lanon.f077182aff5f58a5660f14b1290425e3.168> + 80024d4c: 02b00593 li a1,43 + 80024d50: 863a mv a2,a4 + 80024d52: ffffe097 auipc ra,0xffffe + 80024d56: 3f2080e7 jalr 1010(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + 80024d5a: 0000 unimp + 80024d5c: 00158893 addi a7,a1,1 + 80024d60: fc000813 li a6,-64 + 80024d64: a821 j 80024d7c <.LBB239_55+0x38> + 80024d66: fff60793 addi a5,a2,-1 + 80024d6a: 0017b693 seqz a3,a5 + 80024d6e: 00c8c633 xor a2,a7,a2 + 80024d72: 00163613 seqz a2,a2 + 80024d76: 8ed1 or a3,a3,a2 + 80024d78: 863e mv a2,a5 + 80024d7a: f2f1 bnez a3,80024d3e <.LBB239_54+0x4c> + 80024d7c: feb675e3 bgeu a2,a1,80024d66 <.LBB239_55+0x22> + 80024d80: 00c507b3 add a5,a0,a2 + 80024d84: 00078783 lb a5,0(a5) + 80024d88: fd07cfe3 blt a5,a6,80024d66 <.LBB239_55+0x22> + 80024d8c: bf55 j 80024d40 <.LBB239_54+0x4e> + 80024d8e: 00c507b3 add a5,a0,a2 + 80024d92: 00078683 lb a3,0(a5) + 80024d96: 0ff6f293 andi t0,a3,255 + 80024d9a: 0006c563 bltz a3,80024da4 <.LBB239_55+0x60> + 80024d9e: c296 sw t0,68(sp) + 80024da0: 4585 li a1,1 + 80024da2: a84d j 80024e54 <.LBB239_55+0x110> + 80024da4: 952e add a0,a0,a1 + 80024da6: 00178593 addi a1,a5,1 + 80024daa: 00a59e63 bne a1,a0,80024dc6 <.LBB239_55+0x82> + 80024dae: 4781 li a5,0 + 80024db0: 85aa mv a1,a0 + 80024db2: 0e000693 li a3,224 + 80024db6: 01f2f813 andi a6,t0,31 + 80024dba: 02d2f263 bgeu t0,a3,80024dde <.LBB239_55+0x9a> + 80024dbe: 00681513 slli a0,a6,0x6 + 80024dc2: 8d5d or a0,a0,a5 + 80024dc4: a88d j 80024e36 <.LBB239_55+0xf2> + 80024dc6: 0017c683 lbu a3,1(a5) + 80024dca: 00278593 addi a1,a5,2 + 80024dce: 03f6f793 andi a5,a3,63 + 80024dd2: 0e000693 li a3,224 + 80024dd6: 01f2f813 andi a6,t0,31 + 80024dda: fed2e2e3 bltu t0,a3,80024dbe <.LBB239_55+0x7a> + 80024dde: 00a59563 bne a1,a0,80024de8 <.LBB239_55+0xa4> + 80024de2: 4581 li a1,0 + 80024de4: 88aa mv a7,a0 + 80024de6: a039 j 80024df4 <.LBB239_55+0xb0> + 80024de8: 0005c683 lbu a3,0(a1) + 80024dec: 00158893 addi a7,a1,1 + 80024df0: 03f6f593 andi a1,a3,63 + 80024df4: 00679693 slli a3,a5,0x6 + 80024df8: 0f000313 li t1,240 + 80024dfc: 00b6e7b3 or a5,a3,a1 + 80024e00: 0062e663 bltu t0,t1,80024e0c <.LBB239_55+0xc8> + 80024e04: 00a89863 bne a7,a0,80024e14 <.LBB239_55+0xd0> + 80024e08: 4501 li a0,0 + 80024e0a: a809 j 80024e1c <.LBB239_55+0xd8> + 80024e0c: 00c81513 slli a0,a6,0xc + 80024e10: 8d5d or a0,a0,a5 + 80024e12: a015 j 80024e36 <.LBB239_55+0xf2> + 80024e14: 0008c503 lbu a0,0(a7) + 80024e18: 03f57513 andi a0,a0,63 + 80024e1c: 01281593 slli a1,a6,0x12 + 80024e20: 001c06b7 lui a3,0x1c0 + 80024e24: 8df5 and a1,a1,a3 + 80024e26: 00679693 slli a3,a5,0x6 + 80024e2a: 8dd5 or a1,a1,a3 + 80024e2c: 8d4d or a0,a0,a1 + 80024e2e: 001105b7 lui a1,0x110 + 80024e32: f0b509e3 beq a0,a1,80024d44 <.LBB239_55> + 80024e36: c2aa sw a0,68(sp) + 80024e38: 08000693 li a3,128 + 80024e3c: 4585 li a1,1 + 80024e3e: 00d56b63 bltu a0,a3,80024e54 <.LBB239_55+0x110> + 80024e42: 00b55693 srli a3,a0,0xb + 80024e46: 4589 li a1,2 + 80024e48: c691 beqz a3,80024e54 <.LBB239_55+0x110> + 80024e4a: 8141 srli a0,a0,0x10 + 80024e4c: 00153513 seqz a0,a0 + 80024e50: 4591 li a1,4 + 80024e52: 8d89 sub a1,a1,a0 + 80024e54: 00c58533 add a0,a1,a2 + 80024e58: e4b2 sd a2,72(sp) + 80024e5a: e8aa sd a0,80(sp) + 80024e5c: 1828 addi a0,sp,56 + 80024e5e: e52a sd a0,136(sp) + +0000000080024e60 <.LBB239_56>: + 80024e60: 00001517 auipc a0,0x1 + 80024e64: a4050513 addi a0,a0,-1472 # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 80024e68: e92a sd a0,144(sp) + 80024e6a: 00c8 addi a0,sp,68 + 80024e6c: ed2a sd a0,152(sp) + +0000000080024e6e <.LBB239_57>: + 80024e6e: fffff517 auipc a0,0xfffff + 80024e72: 6f050513 addi a0,a0,1776 # 8002455e <_ZN41_$LT$char$u20$as$u20$core..fmt..Debug$GT$3fmt17hdf5d4d6f5f47000aE> + 80024e76: f12a sd a0,160(sp) + 80024e78: 00a8 addi a0,sp,72 + 80024e7a: f52a sd a0,168(sp) + +0000000080024e7c <.LBB239_58>: + 80024e7c: ffffe517 auipc a0,0xffffe + 80024e80: 10c50513 addi a0,a0,268 # 80022f88 <_ZN71_$LT$core..ops..range..Range$LT$Idx$GT$$u20$as$u20$core..fmt..Debug$GT$3fmt17hafa23fe214721e38E> + 80024e84: f92a sd a0,176(sp) + 80024e86: 0828 addi a0,sp,24 + 80024e88: fd2a sd a0,184(sp) + +0000000080024e8a <.LBB239_59>: + 80024e8a: 00001517 auipc a0,0x1 + 80024e8e: e6e50513 addi a0,a0,-402 # 80025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E> + 80024e92: e1aa sd a0,192(sp) + 80024e94: 102c addi a1,sp,40 + 80024e96: e5ae sd a1,200(sp) + 80024e98: e9aa sd a0,208(sp) + +0000000080024e9a <.LBB239_60>: + 80024e9a: 00009517 auipc a0,0x9 + 80024e9e: 59650513 addi a0,a0,1430 # 8002e430 <.Lanon.f077182aff5f58a5660f14b1290425e3.326> + 80024ea2: ecaa sd a0,88(sp) + 80024ea4: 4515 li a0,5 + 80024ea6: f0aa sd a0,96(sp) + 80024ea8: f482 sd zero,104(sp) + 80024eaa: 012c addi a1,sp,136 + 80024eac: fcae sd a1,120(sp) + 80024eae: e12a sd a0,128(sp) + 80024eb0: 08a8 addi a0,sp,88 + 80024eb2: 85ba mv a1,a4 + 80024eb4: ffffe097 auipc ra,0xffffe + 80024eb8: 2fc080e7 jalr 764(ra) # 800231b0 <_ZN4core9panicking9panic_fmt17h28c6d8bc15c6b6b3E> + ... + +Disassembly of section .text._ZN4core7unicode9printable12is_printable17hd386595a5390c2aaE: + +0000000080024ebe <_ZN4core7unicode9printable12is_printable17hd386595a5390c2aaE>: + 80024ebe: 1141 addi sp,sp,-16 + 80024ec0: e406 sd ra,8(sp) + 80024ec2: 0105559b srliw a1,a0,0x10 + 80024ec6: e1d9 bnez a1,80024f4c <.LBB255_42+0x12> + 80024ec8: 4581 li a1,0 + 80024eca: 0085561b srliw a2,a0,0x8 + +0000000080024ece <.LBB255_40>: + 80024ece: 00009797 auipc a5,0x9 + 80024ed2: 60a78793 addi a5,a5,1546 # 8002e4d8 <.Lanon.f077182aff5f58a5660f14b1290425e3.349> + 80024ed6: 0ff67313 andi t1,a2,255 + 80024eda: 12300813 li a6,291 + +0000000080024ede <.LBB255_41>: + 80024ede: 00009897 auipc a7,0x9 + 80024ee2: 64c88893 addi a7,a7,1612 # 8002e52a <.Lanon.f077182aff5f58a5660f14b1290425e3.350> + 80024ee6: 05278293 addi t0,a5,82 + 80024eea: 0ff57713 andi a4,a0,255 + 80024eee: a811 j 80024f02 <.LBB255_41+0x24> + 80024ef0: 00d335b3 sltu a1,t1,a3 + 80024ef4: 0057c633 xor a2,a5,t0 + 80024ef8: 00163613 seqz a2,a2 + 80024efc: 8e4d or a2,a2,a1 + 80024efe: 859e mv a1,t2 + 80024f00: ea15 bnez a2,80024f34 <.LBB255_41+0x56> + 80024f02: 0007c683 lbu a3,0(a5) + 80024f06: 0017c603 lbu a2,1(a5) + 80024f0a: 0789 addi a5,a5,2 + 80024f0c: 00c583b3 add t2,a1,a2 + 80024f10: fe6690e3 bne a3,t1,80024ef0 <.LBB255_41+0x12> + 80024f14: 1eb3e463 bltu t2,a1,800250fc <.LBB255_46> + 80024f18: 1f03fd63 bgeu t2,a6,80025112 <.LBB255_47> + 80024f1c: 95c6 add a1,a1,a7 + 80024f1e: ca01 beqz a2,80024f2e <.LBB255_41+0x50> + 80024f20: 0005c683 lbu a3,0(a1) # 110000 <.Lline_table_start0+0xd8b9b> + 80024f24: 0585 addi a1,a1,1 + 80024f26: 167d addi a2,a2,-1 + 80024f28: fee69be3 bne a3,a4,80024f1e <.LBB255_41+0x40> + 80024f2c: a06d j 80024fd6 <.LBB255_45+0x12> + 80024f2e: 859e mv a1,t2 + 80024f30: fc5799e3 bne a5,t0,80024f02 <.LBB255_41+0x24> + 80024f34: 65c1 lui a1,0x10 + 80024f36: 35fd addiw a1,a1,-1 + 80024f38: 8de9 and a1,a1,a0 + +0000000080024f3a <.LBB255_42>: + 80024f3a: 00009717 auipc a4,0x9 + 80024f3e: 71270713 addi a4,a4,1810 # 8002e64c <.Lanon.f077182aff5f58a5660f14b1290425e3.351> + 80024f42: 4505 li a0,1 + 80024f44: 587d li a6,-1 + 80024f46: 13570693 addi a3,a4,309 + 80024f4a: a06d j 80024ff4 <.LBB255_45+0x30> + 80024f4c: 0115559b srliw a1,a0,0x11 + 80024f50: e5e9 bnez a1,8002501a <.LBB255_45+0x56> + 80024f52: 4581 li a1,0 + 80024f54: 0085561b srliw a2,a0,0x8 + +0000000080024f58 <.LBB255_43>: + 80024f58: 0000a797 auipc a5,0xa + 80024f5c: 82978793 addi a5,a5,-2007 # 8002e781 <.Lanon.f077182aff5f58a5660f14b1290425e3.352> + 80024f60: 0ff67313 andi t1,a2,255 + 80024f64: 0b000813 li a6,176 + +0000000080024f68 <.LBB255_44>: + 80024f68: 0000a897 auipc a7,0xa + 80024f6c: 86588893 addi a7,a7,-1947 # 8002e7cd <.Lanon.f077182aff5f58a5660f14b1290425e3.353> + 80024f70: 04c78293 addi t0,a5,76 + 80024f74: 0ff57713 andi a4,a0,255 + 80024f78: a811 j 80024f8c <.LBB255_44+0x24> + 80024f7a: 00d335b3 sltu a1,t1,a3 + 80024f7e: 0057c633 xor a2,a5,t0 + 80024f82: 00163613 seqz a2,a2 + 80024f86: 8e4d or a2,a2,a1 + 80024f88: 859e mv a1,t2 + 80024f8a: ea15 bnez a2,80024fbe <.LBB255_44+0x56> + 80024f8c: 0007c683 lbu a3,0(a5) + 80024f90: 0017c603 lbu a2,1(a5) + 80024f94: 0789 addi a5,a5,2 + 80024f96: 00c583b3 add t2,a1,a2 + 80024f9a: fe6690e3 bne a3,t1,80024f7a <.LBB255_44+0x12> + 80024f9e: 14b3ef63 bltu t2,a1,800250fc <.LBB255_46> + 80024fa2: 1703ff63 bgeu t2,a6,80025120 <.LBB255_48> + 80024fa6: 95c6 add a1,a1,a7 + 80024fa8: ca01 beqz a2,80024fb8 <.LBB255_44+0x50> + 80024faa: 0005c683 lbu a3,0(a1) # 10000 <.Lline_table_start0+0x19d> + 80024fae: 0585 addi a1,a1,1 + 80024fb0: 167d addi a2,a2,-1 + 80024fb2: fee69be3 bne a3,a4,80024fa8 <.LBB255_44+0x40> + 80024fb6: a005 j 80024fd6 <.LBB255_45+0x12> + 80024fb8: 859e mv a1,t2 + 80024fba: fc5799e3 bne a5,t0,80024f8c <.LBB255_44+0x24> + 80024fbe: 65c1 lui a1,0x10 + 80024fc0: 35fd addiw a1,a1,-1 + 80024fc2: 8de9 and a1,a1,a0 + +0000000080024fc4 <.LBB255_45>: + 80024fc4: 0000a717 auipc a4,0xa + 80024fc8: 8b870713 addi a4,a4,-1864 # 8002e87c <.Lanon.f077182aff5f58a5660f14b1290425e3.354> + 80024fcc: 4505 li a0,1 + 80024fce: 587d li a6,-1 + 80024fd0: 1a370693 addi a3,a4,419 + 80024fd4: a209 j 800250d6 <.LBB255_45+0x112> + 80024fd6: 4501 li a0,0 + 80024fd8: 8905 andi a0,a0,1 + 80024fda: 60a2 ld ra,8(sp) + 80024fdc: 0141 addi sp,sp,16 + 80024fde: 8082 ret + 80024fe0: 0ff7f793 andi a5,a5,255 + 80024fe4: 8732 mv a4,a2 + 80024fe6: 9d9d subw a1,a1,a5 + 80024fe8: fe05c8e3 bltz a1,80024fd8 <.LBB255_45+0x14> + 80024fec: 00154513 xori a0,a0,1 + 80024ff0: fed704e3 beq a4,a3,80024fd8 <.LBB255_45+0x14> + 80024ff4: 00070783 lb a5,0(a4) + 80024ff8: 00170613 addi a2,a4,1 + 80024ffc: fef842e3 blt a6,a5,80024fe0 <.LBB255_45+0x1c> + 80025000: 12d60c63 beq a2,a3,80025138 <.LBB255_49> + 80025004: 00174603 lbu a2,1(a4) + 80025008: 07f7f793 andi a5,a5,127 + 8002500c: 07a2 slli a5,a5,0x8 + 8002500e: 0709 addi a4,a4,2 + 80025010: 8fd1 or a5,a5,a2 + 80025012: 9d9d subw a1,a1,a5 + 80025014: fc05dce3 bgez a1,80024fec <.LBB255_45+0x28> + 80025018: b7c1 j 80024fd8 <.LBB255_45+0x14> + 8002501a: fffd65b7 lui a1,0xfffd6 + 8002501e: 9225859b addiw a1,a1,-1758 + 80025022: 9da9 addw a1,a1,a0 + 80025024: 0005061b sext.w a2,a0 + 80025028: 02100693 li a3,33 + 8002502c: 00b6b5b3 sltu a1,a3,a1 + 80025030: fffd56b7 lui a3,0xfffd5 + 80025034: 8cb6869b addiw a3,a3,-1845 + 80025038: 9ea9 addw a3,a3,a0 + 8002503a: 4729 li a4,10 + 8002503c: 00d736b3 sltu a3,a4,a3 + 80025040: 8df5 and a1,a1,a3 + 80025042: 002006b7 lui a3,0x200 + 80025046: 36f9 addiw a3,a3,-2 + 80025048: 8ee9 and a3,a3,a0 + 8002504a: 0002c737 lui a4,0x2c + 8002504e: 81e7071b addiw a4,a4,-2018 + 80025052: 8eb9 xor a3,a3,a4 + 80025054: 00d036b3 snez a3,a3 + 80025058: 8df5 and a1,a1,a3 + 8002505a: fffd36b7 lui a3,0xfffd3 + 8002505e: 15e6869b addiw a3,a3,350 + 80025062: 9ea9 addw a3,a3,a0 + 80025064: 4735 li a4,13 + 80025066: 00d736b3 sltu a3,a4,a3 + 8002506a: 8df5 and a1,a1,a3 + 8002506c: fffd16b7 lui a3,0xfffd1 + 80025070: 41f6869b addiw a3,a3,1055 + 80025074: 9ea9 addw a3,a3,a0 + 80025076: 6705 lui a4,0x1 + 80025078: c1e7071b addiw a4,a4,-994 + 8002507c: 00d736b3 sltu a3,a4,a3 + 80025080: 8df5 and a1,a1,a3 + 80025082: fffd06b7 lui a3,0xfffd0 + 80025086: 5e26869b addiw a3,a3,1506 + 8002508a: 9ea9 addw a3,a3,a0 + 8002508c: 5e100713 li a4,1505 + 80025090: 00d736b3 sltu a3,a4,a3 + 80025094: 8df5 and a1,a1,a3 + 80025096: fffcf6b7 lui a3,0xfffcf + 8002509a: cb56869b addiw a3,a3,-843 + 8002509e: 9d35 addw a0,a0,a3 + 800250a0: 000af6b7 lui a3,0xaf + 800250a4: db46869b addiw a3,a3,-588 + 800250a8: 00a6b533 sltu a0,a3,a0 + 800250ac: 8d6d and a0,a0,a1 + 800250ae: 000e05b7 lui a1,0xe0 + 800250b2: 1f05859b addiw a1,a1,496 + 800250b6: 00b635b3 sltu a1,a2,a1 + 800250ba: 8d6d and a0,a0,a1 + 800250bc: 60a2 ld ra,8(sp) + 800250be: 0141 addi sp,sp,16 + 800250c0: 8082 ret + 800250c2: 0ff7f793 andi a5,a5,255 + 800250c6: 8732 mv a4,a2 + 800250c8: 9d9d subw a1,a1,a5 + 800250ca: f005c7e3 bltz a1,80024fd8 <.LBB255_45+0x14> + 800250ce: 00154513 xori a0,a0,1 + 800250d2: f0d703e3 beq a4,a3,80024fd8 <.LBB255_45+0x14> + 800250d6: 00070783 lb a5,0(a4) # 1000 <.Lline_table_start0+0x140> + 800250da: 00170613 addi a2,a4,1 + 800250de: fef842e3 blt a6,a5,800250c2 <.LBB255_45+0xfe> + 800250e2: 04d60b63 beq a2,a3,80025138 <.LBB255_49> + 800250e6: 00174603 lbu a2,1(a4) + 800250ea: 07f7f793 andi a5,a5,127 + 800250ee: 07a2 slli a5,a5,0x8 + 800250f0: 0709 addi a4,a4,2 + 800250f2: 8fd1 or a5,a5,a2 + 800250f4: 9d9d subw a1,a1,a5 + 800250f6: fc05dce3 bgez a1,800250ce <.LBB255_45+0x10a> + 800250fa: bdf9 j 80024fd8 <.LBB255_45+0x14> + +00000000800250fc <.LBB255_46>: + 800250fc: 00009617 auipc a2,0x9 + 80025100: 3ac60613 addi a2,a2,940 # 8002e4a8 <.Lanon.f077182aff5f58a5660f14b1290425e3.347> + 80025104: 852e mv a0,a1 + 80025106: 859e mv a1,t2 + 80025108: 00000097 auipc ra,0x0 + 8002510c: 84a080e7 jalr -1974(ra) # 80024952 <_ZN4core5slice5index22slice_index_order_fail17h8c18576576dbf4e3E> + ... + +0000000080025112 <.LBB255_47>: + 80025112: 00009617 auipc a2,0x9 + 80025116: 39660613 addi a2,a2,918 # 8002e4a8 <.Lanon.f077182aff5f58a5660f14b1290425e3.347> + 8002511a: 12200593 li a1,290 + 8002511e: a039 j 8002512c <.LBB255_48+0xc> + +0000000080025120 <.LBB255_48>: + 80025120: 00009617 auipc a2,0x9 + 80025124: 38860613 addi a2,a2,904 # 8002e4a8 <.Lanon.f077182aff5f58a5660f14b1290425e3.347> + 80025128: 0af00593 li a1,175 + 8002512c: 851e mv a0,t2 + 8002512e: fffff097 auipc ra,0xfffff + 80025132: 7e4080e7 jalr 2020(ra) # 80024912 <_ZN4core5slice5index24slice_end_index_len_fail17hbdcbb59c061b5014E> + ... + +0000000080025138 <.LBB255_49>: + 80025138: 00009517 auipc a0,0x9 + 8002513c: c2850513 addi a0,a0,-984 # 8002dd60 <.Lanon.f077182aff5f58a5660f14b1290425e3.168> + +0000000080025140 <.LBB255_50>: + 80025140: 00009617 auipc a2,0x9 + 80025144: 38060613 addi a2,a2,896 # 8002e4c0 <.Lanon.f077182aff5f58a5660f14b1290425e3.348> + 80025148: 02b00593 li a1,43 + 8002514c: ffffe097 auipc ra,0xffffe + 80025150: ff8080e7 jalr -8(ra) # 80023144 <_ZN4core9panicking5panic17h153a4ce3c60ede6bE> + ... + +Disassembly of section .text._ZN70_$LT$core..num..error..TryFromIntError$u20$as$u20$core..fmt..Debug$GT$3fmt17hc144b27efd65b050E: + +0000000080025156 <_ZN70_$LT$core..num..error..TryFromIntError$u20$as$u20$core..fmt..Debug$GT$3fmt17hc144b27efd65b050E>: + 80025156: 7139 addi sp,sp,-64 + 80025158: fc06 sd ra,56(sp) + 8002515a: f822 sd s0,48(sp) + 8002515c: f426 sd s1,40(sp) + 8002515e: 842e mv s0,a1 + 80025160: 758c ld a1,40(a1) + 80025162: 7014 ld a3,32(s0) + 80025164: 6d98 ld a4,24(a1) + 80025166: 84aa mv s1,a0 + +0000000080025168 <.LBB324_8>: + 80025168: 0000a597 auipc a1,0xa + 8002516c: 94858593 addi a1,a1,-1720 # 8002eab0 <.Lanon.f077182aff5f58a5660f14b1290425e3.425> + 80025170: 463d li a2,15 + 80025172: 8536 mv a0,a3 + 80025174: 9702 jalr a4 + 80025176: e422 sd s0,8(sp) + 80025178: 00a10c23 sb a0,24(sp) + 8002517c: e802 sd zero,16(sp) + 8002517e: 00010ca3 sb zero,25(sp) + 80025182: f026 sd s1,32(sp) + +0000000080025184 <.LBB324_9>: + 80025184: 0000a617 auipc a2,0xa + 80025188: 93c60613 addi a2,a2,-1732 # 8002eac0 <.Lanon.f077182aff5f58a5660f14b1290425e3.426> + 8002518c: 0028 addi a0,sp,8 + 8002518e: 100c addi a1,sp,32 + 80025190: ffffe097 auipc ra,0xffffe + 80025194: 46a080e7 jalr 1130(ra) # 800235fa <_ZN4core3fmt8builders10DebugTuple5field17h5bd338b8cb98b948E> + 80025198: 6542 ld a0,16(sp) + 8002519a: 01814583 lbu a1,24(sp) + 8002519e: c921 beqz a0,800251ee <.LBB324_11+0x10> + 800251a0: 4405 li s0,1 + 800251a2: e5a9 bnez a1,800251ec <.LBB324_11+0xe> + 800251a4: 01914583 lbu a1,25(sp) + 800251a8: 157d addi a0,a0,-1 + 800251aa: 00a03533 snez a0,a0 + 800251ae: 0015b593 seqz a1,a1 + 800251b2: 8d4d or a0,a0,a1 + 800251b4: e10d bnez a0,800251d6 <.LBB324_10+0x10> + 800251b6: 6522 ld a0,8(sp) + 800251b8: 03054583 lbu a1,48(a0) + 800251bc: 8991 andi a1,a1,4 + 800251be: ed81 bnez a1,800251d6 <.LBB324_10+0x10> + 800251c0: 750c ld a1,40(a0) + 800251c2: 7108 ld a0,32(a0) + 800251c4: 6d94 ld a3,24(a1) + +00000000800251c6 <.LBB324_10>: + 800251c6: 00009597 auipc a1,0x9 + 800251ca: e0258593 addi a1,a1,-510 # 8002dfc8 <.Lanon.f077182aff5f58a5660f14b1290425e3.209> + 800251ce: 4605 li a2,1 + 800251d0: 4405 li s0,1 + 800251d2: 9682 jalr a3 + 800251d4: ed01 bnez a0,800251ec <.LBB324_11+0xe> + 800251d6: 6522 ld a0,8(sp) + 800251d8: 750c ld a1,40(a0) + 800251da: 7108 ld a0,32(a0) + 800251dc: 6d94 ld a3,24(a1) + +00000000800251de <.LBB324_11>: + 800251de: 00009597 auipc a1,0x9 + 800251e2: deb58593 addi a1,a1,-533 # 8002dfc9 <.Lanon.f077182aff5f58a5660f14b1290425e3.210> + 800251e6: 4605 li a2,1 + 800251e8: 9682 jalr a3 + 800251ea: 842a mv s0,a0 + 800251ec: 85a2 mv a1,s0 + 800251ee: 00b03533 snez a0,a1 + 800251f2: 74a2 ld s1,40(sp) + 800251f4: 7442 ld s0,48(sp) + 800251f6: 70e2 ld ra,56(sp) + 800251f8: 6121 addi sp,sp,64 + 800251fa: 8082 ret + +Disassembly of section .text._ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17hf71897f85e3edf35E: + +00000000800251fc <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17hf71897f85e3edf35E>: + 800251fc: 7175 addi sp,sp,-144 + 800251fe: e506 sd ra,136(sp) + 80025200: 882e mv a6,a1 + 80025202: 4581 li a1,0 + 80025204: 00056603 lwu a2,0(a0) + 80025208: 00810893 addi a7,sp,8 + 8002520c: 100006b7 lui a3,0x10000 + 80025210: 36fd addiw a3,a3,-1 + 80025212: 4729 li a4,10 + 80025214: a819 j 8002522a <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17hf71897f85e3edf35E+0x2e> + 80025216: 03778793 addi a5,a5,55 + 8002521a: 00b88533 add a0,a7,a1 + 8002521e: 8211 srli a2,a2,0x4 + 80025220: 8e75 and a2,a2,a3 + 80025222: 06f50fa3 sb a5,127(a0) + 80025226: 15fd addi a1,a1,-1 + 80025228: ca01 beqz a2,80025238 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17hf71897f85e3edf35E+0x3c> + 8002522a: 00f67793 andi a5,a2,15 + 8002522e: fee7f4e3 bgeu a5,a4,80025216 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17hf71897f85e3edf35E+0x1a> + 80025232: 0307e793 ori a5,a5,48 + 80025236: b7d5 j 8002521a <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i32$GT$3fmt17hf71897f85e3edf35E+0x1e> + 80025238: 08058513 addi a0,a1,128 + 8002523c: 08100613 li a2,129 + 80025240: 02c57663 bgeu a0,a2,8002526c <.LBB466_9> + 80025244: 40b007b3 neg a5,a1 + 80025248: 0028 addi a0,sp,8 + 8002524a: 952e add a0,a0,a1 + 8002524c: 08050713 addi a4,a0,128 + +0000000080025250 <.LBB466_8>: + 80025250: 00009617 auipc a2,0x9 + 80025254: dd860613 addi a2,a2,-552 # 8002e028 <.Lanon.f077182aff5f58a5660f14b1290425e3.226> + 80025258: 4585 li a1,1 + 8002525a: 4689 li a3,2 + 8002525c: 8542 mv a0,a6 + 8002525e: fffff097 auipc ra,0xfffff + 80025262: 8ca080e7 jalr -1846(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 80025266: 60aa ld ra,136(sp) + 80025268: 6149 addi sp,sp,144 + 8002526a: 8082 ret + +000000008002526c <.LBB466_9>: + 8002526c: 00009617 auipc a2,0x9 + 80025270: da460613 addi a2,a2,-604 # 8002e010 <.Lanon.f077182aff5f58a5660f14b1290425e3.225> + 80025274: 08000593 li a1,128 + 80025278: fffff097 auipc ra,0xfffff + 8002527c: 65a080e7 jalr 1626(ra) # 800248d2 <_ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E> + ... + +Disassembly of section .text._ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E: + +0000000080025282 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E>: + 80025282: 7175 addi sp,sp,-144 + 80025284: e506 sd ra,136(sp) + 80025286: 6108 ld a0,0(a0) + 80025288: 882e mv a6,a1 + 8002528a: 4581 li a1,0 + 8002528c: 0030 addi a2,sp,8 + 8002528e: 46a9 li a3,10 + 80025290: a811 j 800252a4 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E+0x22> + 80025292: 05770713 addi a4,a4,87 + 80025296: 00b607b3 add a5,a2,a1 + 8002529a: 8111 srli a0,a0,0x4 + 8002529c: 06e78fa3 sb a4,127(a5) + 800252a0: 15fd addi a1,a1,-1 + 800252a2: c901 beqz a0,800252b2 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E+0x30> + 800252a4: 00f57713 andi a4,a0,15 + 800252a8: fed775e3 bgeu a4,a3,80025292 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E+0x10> + 800252ac: 03076713 ori a4,a4,48 + 800252b0: b7dd j 80025296 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..LowerHex$u20$for$u20$i64$GT$3fmt17h760b07191d46b3f2E+0x14> + 800252b2: 08058513 addi a0,a1,128 + 800252b6: 08100613 li a2,129 + 800252ba: 02c57663 bgeu a0,a2,800252e6 <.LBB469_9> + 800252be: 40b007b3 neg a5,a1 + 800252c2: 0028 addi a0,sp,8 + 800252c4: 952e add a0,a0,a1 + 800252c6: 08050713 addi a4,a0,128 + +00000000800252ca <.LBB469_8>: + 800252ca: 00009617 auipc a2,0x9 + 800252ce: d5e60613 addi a2,a2,-674 # 8002e028 <.Lanon.f077182aff5f58a5660f14b1290425e3.226> + 800252d2: 4585 li a1,1 + 800252d4: 4689 li a3,2 + 800252d6: 8542 mv a0,a6 + 800252d8: fffff097 auipc ra,0xfffff + 800252dc: 850080e7 jalr -1968(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 800252e0: 60aa ld ra,136(sp) + 800252e2: 6149 addi sp,sp,144 + 800252e4: 8082 ret + +00000000800252e6 <.LBB469_9>: + 800252e6: 00009617 auipc a2,0x9 + 800252ea: d2a60613 addi a2,a2,-726 # 8002e010 <.Lanon.f077182aff5f58a5660f14b1290425e3.225> + 800252ee: 08000593 li a1,128 + 800252f2: fffff097 auipc ra,0xfffff + 800252f6: 5e0080e7 jalr 1504(ra) # 800248d2 <_ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E> + ... + +Disassembly of section .text._ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i64$GT$3fmt17h66734376af0f4671E: + +00000000800252fc <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i64$GT$3fmt17h66734376af0f4671E>: + 800252fc: 7175 addi sp,sp,-144 + 800252fe: e506 sd ra,136(sp) + 80025300: 6108 ld a0,0(a0) + 80025302: 882e mv a6,a1 + 80025304: 4581 li a1,0 + 80025306: 0030 addi a2,sp,8 + 80025308: 46a9 li a3,10 + 8002530a: a811 j 8002531e <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i64$GT$3fmt17h66734376af0f4671E+0x22> + 8002530c: 03770713 addi a4,a4,55 + 80025310: 00b607b3 add a5,a2,a1 + 80025314: 8111 srli a0,a0,0x4 + 80025316: 06e78fa3 sb a4,127(a5) + 8002531a: 15fd addi a1,a1,-1 + 8002531c: c901 beqz a0,8002532c <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i64$GT$3fmt17h66734376af0f4671E+0x30> + 8002531e: 00f57713 andi a4,a0,15 + 80025322: fed775e3 bgeu a4,a3,8002530c <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i64$GT$3fmt17h66734376af0f4671E+0x10> + 80025326: 03076713 ori a4,a4,48 + 8002532a: b7dd j 80025310 <_ZN4core3fmt3num53_$LT$impl$u20$core..fmt..UpperHex$u20$for$u20$i64$GT$3fmt17h66734376af0f4671E+0x14> + 8002532c: 08058513 addi a0,a1,128 + 80025330: 08100613 li a2,129 + 80025334: 02c57663 bgeu a0,a2,80025360 <.LBB470_9> + 80025338: 40b007b3 neg a5,a1 + 8002533c: 0028 addi a0,sp,8 + 8002533e: 952e add a0,a0,a1 + 80025340: 08050713 addi a4,a0,128 + +0000000080025344 <.LBB470_8>: + 80025344: 00009617 auipc a2,0x9 + 80025348: ce460613 addi a2,a2,-796 # 8002e028 <.Lanon.f077182aff5f58a5660f14b1290425e3.226> + 8002534c: 4585 li a1,1 + 8002534e: 4689 li a3,2 + 80025350: 8542 mv a0,a6 + 80025352: ffffe097 auipc ra,0xffffe + 80025356: 7d6080e7 jalr 2006(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 8002535a: 60aa ld ra,136(sp) + 8002535c: 6149 addi sp,sp,144 + 8002535e: 8082 ret + +0000000080025360 <.LBB470_9>: + 80025360: 00009617 auipc a2,0x9 + 80025364: cb060613 addi a2,a2,-848 # 8002e010 <.Lanon.f077182aff5f58a5660f14b1290425e3.225> + 80025368: 08000593 li a1,128 + 8002536c: fffff097 auipc ra,0xfffff + 80025370: 566080e7 jalr 1382(ra) # 800248d2 <_ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E> + ... + +Disassembly of section .text._ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE: + +0000000080025376 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE>: + 80025376: 7175 addi sp,sp,-144 + 80025378: e506 sd ra,136(sp) + 8002537a: 882e mv a6,a1 + 8002537c: 0305e583 lwu a1,48(a1) + 80025380: 0105f613 andi a2,a1,16 + 80025384: ea19 bnez a2,8002539a <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x24> + 80025386: 0205f593 andi a1,a1,32 + 8002538a: ed8d bnez a1,800253c4 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x4e> + 8002538c: 85c2 mv a1,a6 + 8002538e: 60aa ld ra,136(sp) + 80025390: 6149 addi sp,sp,144 + 80025392: 00000317 auipc t1,0x0 + 80025396: 50e30067 jr 1294(t1) # 800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E> + 8002539a: 6108 ld a0,0(a0) + 8002539c: 4581 li a1,0 + 8002539e: 0030 addi a2,sp,8 + 800253a0: 46a9 li a3,10 + 800253a2: a811 j 800253b6 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x40> + 800253a4: 05770713 addi a4,a4,87 + 800253a8: 00b607b3 add a5,a2,a1 + 800253ac: 8111 srli a0,a0,0x4 + 800253ae: 06e78fa3 sb a4,127(a5) + 800253b2: 15fd addi a1,a1,-1 + 800253b4: cd0d beqz a0,800253ee <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x78> + 800253b6: 00f57713 andi a4,a0,15 + 800253ba: fed775e3 bgeu a4,a3,800253a4 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x2e> + 800253be: 03076713 ori a4,a4,48 + 800253c2: b7dd j 800253a8 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x32> + 800253c4: 6108 ld a0,0(a0) + 800253c6: 4581 li a1,0 + 800253c8: 0030 addi a2,sp,8 + 800253ca: 46a9 li a3,10 + 800253cc: a811 j 800253e0 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x6a> + 800253ce: 03770713 addi a4,a4,55 + 800253d2: 00b607b3 add a5,a2,a1 + 800253d6: 8111 srli a0,a0,0x4 + 800253d8: 06e78fa3 sb a4,127(a5) + 800253dc: 15fd addi a1,a1,-1 + 800253de: c901 beqz a0,800253ee <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x78> + 800253e0: 00f57713 andi a4,a0,15 + 800253e4: fed775e3 bgeu a4,a3,800253ce <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x58> + 800253e8: 03076713 ori a4,a4,48 + 800253ec: b7dd j 800253d2 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE+0x5c> + 800253ee: 08058513 addi a0,a1,128 + 800253f2: 08100613 li a2,129 + 800253f6: 02c57663 bgeu a0,a2,80025422 <.LBB475_17> + 800253fa: 40b007b3 neg a5,a1 + 800253fe: 0028 addi a0,sp,8 + 80025400: 952e add a0,a0,a1 + 80025402: 08050713 addi a4,a0,128 + +0000000080025406 <.LBB475_16>: + 80025406: 00009617 auipc a2,0x9 + 8002540a: c2260613 addi a2,a2,-990 # 8002e028 <.Lanon.f077182aff5f58a5660f14b1290425e3.226> + 8002540e: 4585 li a1,1 + 80025410: 4689 li a3,2 + 80025412: 8542 mv a0,a6 + 80025414: ffffe097 auipc ra,0xffffe + 80025418: 714080e7 jalr 1812(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 8002541c: 60aa ld ra,136(sp) + 8002541e: 6149 addi sp,sp,144 + 80025420: 8082 ret + +0000000080025422 <.LBB475_17>: + 80025422: 00009617 auipc a2,0x9 + 80025426: bee60613 addi a2,a2,-1042 # 8002e010 <.Lanon.f077182aff5f58a5660f14b1290425e3.225> + 8002542a: 08000593 li a1,128 + 8002542e: fffff097 auipc ra,0xfffff + 80025432: 4a4080e7 jalr 1188(ra) # 800248d2 <_ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E> + ... + +Disassembly of section .text._ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E: + +0000000080025438 <_ZN4core3fmt3num3imp51_$LT$impl$u20$core..fmt..Display$u20$for$u20$u8$GT$3fmt17h88f04bfded474003E>: + 80025438: 7179 addi sp,sp,-48 + 8002543a: f406 sd ra,40(sp) + 8002543c: 00054603 lbu a2,0(a0) + 80025440: 06400693 li a3,100 + 80025444: 852e mv a0,a1 + 80025446: 04d66e63 bltu a2,a3,800254a2 <.LBB477_6+0x22> + 8002544a: 0fc67593 andi a1,a2,252 + 8002544e: 8189 srli a1,a1,0x2 + 80025450: 0051f737 lui a4,0x51f + 80025454: b857071b addiw a4,a4,-1147 + 80025458: 0736 slli a4,a4,0xd + 8002545a: 3d770713 addi a4,a4,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 8002545e: 073a slli a4,a4,0xe + 80025460: 28f70713 addi a4,a4,655 + 80025464: 0732 slli a4,a4,0xc + 80025466: 5c370713 addi a4,a4,1475 + 8002546a: 02e5b5b3 mulhu a1,a1,a4 + 8002546e: 0025d713 srli a4,a1,0x2 + 80025472: 02d705b3 mul a1,a4,a3 + 80025476: 40b605b3 sub a1,a2,a1 + 8002547a: 0586 slli a1,a1,0x1 + 8002547c: 0fe5f593 andi a1,a1,254 + +0000000080025480 <.LBB477_6>: + 80025480: 00009617 auipc a2,0x9 + 80025484: baa60613 addi a2,a2,-1110 # 8002e02a <.Lanon.f077182aff5f58a5660f14b1290425e3.229> + 80025488: 95b2 add a1,a1,a2 + 8002548a: 00158603 lb a2,1(a1) + 8002548e: 0005c583 lbu a1,0(a1) + 80025492: 02c103a3 sb a2,39(sp) + 80025496: 02b10323 sb a1,38(sp) + 8002549a: 02400593 li a1,36 + 8002549e: 863a mv a2,a4 + 800254a0: a031 j 800254ac <.LBB477_6+0x2c> + 800254a2: 46a5 li a3,9 + 800254a4: 02600593 li a1,38 + 800254a8: 00c6ea63 bltu a3,a2,800254bc <.LBB477_6+0x3c> + 800254ac: 00110693 addi a3,sp,1 + 800254b0: 96ae add a3,a3,a1 + 800254b2: 03060613 addi a2,a2,48 + 800254b6: 00c68023 sb a2,0(a3) # 10000000 <.Lline_table_start0+0xffc8b9b> + 800254ba: a015 j 800254de <.LBB477_7+0x1e> + 800254bc: 00161593 slli a1,a2,0x1 + +00000000800254c0 <.LBB477_7>: + 800254c0: 00009617 auipc a2,0x9 + 800254c4: b6a60613 addi a2,a2,-1174 # 8002e02a <.Lanon.f077182aff5f58a5660f14b1290425e3.229> + 800254c8: 95b2 add a1,a1,a2 + 800254ca: 00158603 lb a2,1(a1) + 800254ce: 0005c583 lbu a1,0(a1) + 800254d2: 02c103a3 sb a2,39(sp) + 800254d6: 02b10323 sb a1,38(sp) + 800254da: 02500593 li a1,37 + 800254de: 00110613 addi a2,sp,1 + 800254e2: 00b60733 add a4,a2,a1 + 800254e6: 02700613 li a2,39 + 800254ea: 40b607b3 sub a5,a2,a1 + +00000000800254ee <.LBB477_8>: + 800254ee: 00009617 auipc a2,0x9 + 800254f2: 85a60613 addi a2,a2,-1958 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 800254f6: 4585 li a1,1 + 800254f8: 4681 li a3,0 + 800254fa: ffffe097 auipc ra,0xffffe + 800254fe: 62e080e7 jalr 1582(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 80025502: 70a2 ld ra,40(sp) + 80025504: 6145 addi sp,sp,48 + 80025506: 8082 ret + +Disassembly of section .text._ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h1b385cecfac82c6bE: + +0000000080025508 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h1b385cecfac82c6bE>: + 80025508: 711d addi sp,sp,-96 + 8002550a: ec86 sd ra,88(sp) + 8002550c: e8a2 sd s0,80(sp) + 8002550e: e4a6 sd s1,72(sp) + 80025510: e0ca sd s2,64(sp) + 80025512: fc4e sd s3,56(sp) + 80025514: f852 sd s4,48(sp) + 80025516: 00056f83 lwu t6,0(a0) + 8002551a: 000f889b sext.w a7,t6 + 8002551e: 587d li a6,-1 + 80025520: 852e mv a0,a1 + 80025522: 01184763 blt a6,a7,80025530 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$i32$GT$3fmt17h1b385cecfac82c6bE+0x28> + 80025526: ffffc593 not a1,t6 + 8002552a: 2581 sext.w a1,a1 + 8002552c: 00158f93 addi t6,a1,1 + 80025530: 004fd593 srli a1,t6,0x4 + 80025534: 02700693 li a3,39 + 80025538: 27100613 li a2,625 + +000000008002553c <.LBB480_12>: + 8002553c: 00009297 auipc t0,0x9 + 80025540: aee28293 addi t0,t0,-1298 # 8002e02a <.Lanon.f077182aff5f58a5660f14b1290425e3.229> + 80025544: 02c5f563 bgeu a1,a2,8002556e <.LBB480_12+0x32> + 80025548: 06300593 li a1,99 + 8002554c: 0ff5c063 blt a1,t6,8002562c <.LBB480_12+0xf0> + 80025550: 4625 li a2,9 + 80025552: 011825b3 slt a1,a6,a7 + 80025556: 13f64d63 blt a2,t6,80025690 <.LBB480_12+0x154> + 8002555a: fff68613 addi a2,a3,-1 + 8002555e: 00910693 addi a3,sp,9 + 80025562: 96b2 add a3,a3,a2 + 80025564: 030f8713 addi a4,t6,48 + 80025568: 00e68023 sb a4,0(a3) + 8002556c: a299 j 800256b2 <.LBB480_12+0x176> + 8002556e: 4581 li a1,0 + 80025570: 001a3637 lui a2,0x1a3 + 80025574: 6e36061b addiw a2,a2,1763 + 80025578: 063a slli a2,a2,0xe + 8002557a: ac760613 addi a2,a2,-1337 # 1a2ac7 <.Lline_table_start0+0x16b662> + 8002557e: 063a slli a2,a2,0xe + 80025580: 43360613 addi a2,a2,1075 + 80025584: 0636 slli a2,a2,0xd + 80025586: 94b60313 addi t1,a2,-1717 + 8002558a: 6609 lui a2,0x2 + 8002558c: 71060e1b addiw t3,a2,1808 + 80025590: 6641 lui a2,0x10 + 80025592: ffc60f1b addiw t5,a2,-4 + 80025596: 0051f6b7 lui a3,0x51f + 8002559a: b856869b addiw a3,a3,-1147 + 8002559e: 06b6 slli a3,a3,0xd + 800255a0: 3d768693 addi a3,a3,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 800255a4: 06ba slli a3,a3,0xe + 800255a6: 28f68693 addi a3,a3,655 + 800255aa: 06b2 slli a3,a3,0xc + 800255ac: 5c368913 addi s2,a3,1475 + 800255b0: 06400393 li t2,100 + 800255b4: ffe6099b addiw s3,a2,-2 + 800255b8: 00910e93 addi t4,sp,9 + 800255bc: 05f5e7b7 lui a5,0x5f5e + 800255c0: 0ff78a1b addiw s4,a5,255 + 800255c4: 877e mv a4,t6 + 800255c6: 026fb6b3 mulhu a3,t6,t1 + 800255ca: 00b6df93 srli t6,a3,0xb + 800255ce: 03cf86b3 mul a3,t6,t3 + 800255d2: 40d706b3 sub a3,a4,a3 + 800255d6: 01e6f4b3 and s1,a3,t5 + 800255da: 8089 srli s1,s1,0x2 + 800255dc: 0324b4b3 mulhu s1,s1,s2 + 800255e0: 8089 srli s1,s1,0x2 + 800255e2: 00149413 slli s0,s1,0x1 + 800255e6: 027484b3 mul s1,s1,t2 + 800255ea: 8e85 sub a3,a3,s1 + 800255ec: 0686 slli a3,a3,0x1 + 800255ee: 0136f6b3 and a3,a3,s3 + 800255f2: 9416 add s0,s0,t0 + 800255f4: 00be84b3 add s1,t4,a1 + 800255f8: 00044603 lbu a2,0(s0) + 800255fc: 00140403 lb s0,1(s0) + 80025600: 9696 add a3,a3,t0 + 80025602: 00168783 lb a5,1(a3) + 80025606: 0006c683 lbu a3,0(a3) + 8002560a: 02848223 sb s0,36(s1) + 8002560e: 02c481a3 sb a2,35(s1) + 80025612: 02f48323 sb a5,38(s1) + 80025616: 02d482a3 sb a3,37(s1) + 8002561a: 15f1 addi a1,a1,-4 + 8002561c: faea64e3 bltu s4,a4,800255c4 <.LBB480_12+0x88> + 80025620: 02758693 addi a3,a1,39 + 80025624: 06300593 li a1,99 + 80025628: f3f5d4e3 bge a1,t6,80025550 <.LBB480_12+0x14> + 8002562c: 65c1 lui a1,0x10 + 8002562e: ffc5861b addiw a2,a1,-4 + 80025632: 00cff633 and a2,t6,a2 + 80025636: 8209 srli a2,a2,0x2 + 80025638: 0051f737 lui a4,0x51f + 8002563c: b857071b addiw a4,a4,-1147 + 80025640: 0736 slli a4,a4,0xd + 80025642: 3d770713 addi a4,a4,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 80025646: 073a slli a4,a4,0xe + 80025648: 28f70713 addi a4,a4,655 + 8002564c: 0732 slli a4,a4,0xc + 8002564e: 5c370713 addi a4,a4,1475 + 80025652: 02e63633 mulhu a2,a2,a4 + 80025656: 8209 srli a2,a2,0x2 + 80025658: 06400713 li a4,100 + 8002565c: 02e60733 mul a4,a2,a4 + 80025660: 40ef8733 sub a4,t6,a4 + 80025664: 0706 slli a4,a4,0x1 + 80025666: 35f9 addiw a1,a1,-2 + 80025668: 8df9 and a1,a1,a4 + 8002566a: 16f9 addi a3,a3,-2 + 8002566c: 9596 add a1,a1,t0 + 8002566e: 00158703 lb a4,1(a1) # 10001 <.Lline_table_start0+0x19e> + 80025672: 0005c583 lbu a1,0(a1) + 80025676: 00910793 addi a5,sp,9 + 8002567a: 97b6 add a5,a5,a3 + 8002567c: 00e780a3 sb a4,1(a5) # 5f5e001 <.Lline_table_start0+0x5f26b9c> + 80025680: 00b78023 sb a1,0(a5) + 80025684: 8fb2 mv t6,a2 + 80025686: 4625 li a2,9 + 80025688: 011825b3 slt a1,a6,a7 + 8002568c: edf657e3 bge a2,t6,8002555a <.LBB480_12+0x1e> + 80025690: 001f9713 slli a4,t6,0x1 + 80025694: ffe68613 addi a2,a3,-2 + 80025698: 005706b3 add a3,a4,t0 + 8002569c: 00168703 lb a4,1(a3) + 800256a0: 0006c683 lbu a3,0(a3) + 800256a4: 00910793 addi a5,sp,9 + 800256a8: 97b2 add a5,a5,a2 + 800256aa: 00e780a3 sb a4,1(a5) + 800256ae: 00d78023 sb a3,0(a5) + 800256b2: 00910693 addi a3,sp,9 + 800256b6: 00c68733 add a4,a3,a2 + 800256ba: 02700693 li a3,39 + 800256be: 40c687b3 sub a5,a3,a2 + +00000000800256c2 <.LBB480_13>: + 800256c2: 00008617 auipc a2,0x8 + 800256c6: 68660613 addi a2,a2,1670 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 800256ca: 4681 li a3,0 + 800256cc: ffffe097 auipc ra,0xffffe + 800256d0: 45c080e7 jalr 1116(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 800256d4: 7a42 ld s4,48(sp) + 800256d6: 79e2 ld s3,56(sp) + 800256d8: 6906 ld s2,64(sp) + 800256da: 64a6 ld s1,72(sp) + 800256dc: 6446 ld s0,80(sp) + 800256de: 60e6 ld ra,88(sp) + 800256e0: 6125 addi sp,sp,96 + 800256e2: 8082 ret + +Disassembly of section .text._ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u32$GT$3fmt17h19c6429b08a072b1E: + +00000000800256e4 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u32$GT$3fmt17h19c6429b08a072b1E>: + 800256e4: 715d addi sp,sp,-80 + 800256e6: e486 sd ra,72(sp) + 800256e8: e0a2 sd s0,64(sp) + 800256ea: fc26 sd s1,56(sp) + 800256ec: f84a sd s2,48(sp) + 800256ee: 00056903 lwu s2,0(a0) + 800256f2: 852e mv a0,a1 + 800256f4: 00495593 srli a1,s2,0x4 + 800256f8: 02700693 li a3,39 + 800256fc: 27100713 li a4,625 + +0000000080025700 <.LBB481_10>: + 80025700: 00009817 auipc a6,0x9 + 80025704: 92a80813 addi a6,a6,-1750 # 8002e02a <.Lanon.f077182aff5f58a5660f14b1290425e3.229> + 80025708: 02e5f363 bgeu a1,a4,8002572e <.LBB481_10+0x2e> + 8002570c: 06300593 li a1,99 + 80025710: 0f25e063 bltu a1,s2,800257f0 <.LBB481_10+0xf0> + 80025714: 45a5 li a1,9 + 80025716: 1325cd63 blt a1,s2,80025850 <.LBB481_10+0x150> + 8002571a: fff68593 addi a1,a3,-1 + 8002571e: 00910613 addi a2,sp,9 + 80025722: 962e add a2,a2,a1 + 80025724: 03090693 addi a3,s2,48 + 80025728: 00d60023 sb a3,0(a2) + 8002572c: a291 j 80025870 <.LBB481_10+0x170> + 8002572e: 4681 li a3,0 + 80025730: 001a35b7 lui a1,0x1a3 + 80025734: 6e35859b addiw a1,a1,1763 + 80025738: 05ba slli a1,a1,0xe + 8002573a: ac758593 addi a1,a1,-1337 # 1a2ac7 <.Lline_table_start0+0x16b662> + 8002573e: 05ba slli a1,a1,0xe + 80025740: 43358593 addi a1,a1,1075 + 80025744: 05b6 slli a1,a1,0xd + 80025746: 94b58893 addi a7,a1,-1717 + 8002574a: 6589 lui a1,0x2 + 8002574c: 7105831b addiw t1,a1,1808 + 80025750: 65c1 lui a1,0x10 + 80025752: ffc58e1b addiw t3,a1,-4 + 80025756: 0051f737 lui a4,0x51f + 8002575a: b857071b addiw a4,a4,-1147 + 8002575e: 0736 slli a4,a4,0xd + 80025760: 3d770713 addi a4,a4,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 80025764: 073a slli a4,a4,0xe + 80025766: 28f70713 addi a4,a4,655 + 8002576a: 0732 slli a4,a4,0xc + 8002576c: 5c370e93 addi t4,a4,1475 + 80025770: 06400293 li t0,100 + 80025774: ffe58f1b addiw t5,a1,-2 + 80025778: 00910393 addi t2,sp,9 + 8002577c: 05f5e5b7 lui a1,0x5f5e + 80025780: 0ff58f9b addiw t6,a1,255 + 80025784: 864a mv a2,s2 + 80025786: 031937b3 mulhu a5,s2,a7 + 8002578a: 00b7d913 srli s2,a5,0xb + 8002578e: 02690733 mul a4,s2,t1 + 80025792: 40e60733 sub a4,a2,a4 + 80025796: 01c775b3 and a1,a4,t3 + 8002579a: 8189 srli a1,a1,0x2 + 8002579c: 03d5b5b3 mulhu a1,a1,t4 + 800257a0: 8189 srli a1,a1,0x2 + 800257a2: 00159413 slli s0,a1,0x1 + 800257a6: 025585b3 mul a1,a1,t0 + 800257aa: 40b705b3 sub a1,a4,a1 + 800257ae: 0586 slli a1,a1,0x1 + 800257b0: 01e5f5b3 and a1,a1,t5 + 800257b4: 01040733 add a4,s0,a6 + 800257b8: 00d38433 add s0,t2,a3 + 800257bc: 00074483 lbu s1,0(a4) + 800257c0: 00170703 lb a4,1(a4) + 800257c4: 95c2 add a1,a1,a6 + 800257c6: 00158783 lb a5,1(a1) # 5f5e001 <.Lline_table_start0+0x5f26b9c> + 800257ca: 0005c583 lbu a1,0(a1) + 800257ce: 02e40223 sb a4,36(s0) + 800257d2: 029401a3 sb s1,35(s0) + 800257d6: 02f40323 sb a5,38(s0) + 800257da: 02b402a3 sb a1,37(s0) + 800257de: 16f1 addi a3,a3,-4 + 800257e0: facfe2e3 bltu t6,a2,80025784 <.LBB481_10+0x84> + 800257e4: 02768693 addi a3,a3,39 + 800257e8: 06300593 li a1,99 + 800257ec: f325f4e3 bgeu a1,s2,80025714 <.LBB481_10+0x14> + 800257f0: 65c1 lui a1,0x10 + 800257f2: ffc5861b addiw a2,a1,-4 + 800257f6: 00c97633 and a2,s2,a2 + 800257fa: 8209 srli a2,a2,0x2 + 800257fc: 0051f737 lui a4,0x51f + 80025800: b857071b addiw a4,a4,-1147 + 80025804: 0736 slli a4,a4,0xd + 80025806: 3d770713 addi a4,a4,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 8002580a: 073a slli a4,a4,0xe + 8002580c: 28f70713 addi a4,a4,655 + 80025810: 0732 slli a4,a4,0xc + 80025812: 5c370713 addi a4,a4,1475 + 80025816: 02e63633 mulhu a2,a2,a4 + 8002581a: 8209 srli a2,a2,0x2 + 8002581c: 06400713 li a4,100 + 80025820: 02e60733 mul a4,a2,a4 + 80025824: 40e90733 sub a4,s2,a4 + 80025828: 0706 slli a4,a4,0x1 + 8002582a: 35f9 addiw a1,a1,-2 + 8002582c: 8df9 and a1,a1,a4 + 8002582e: 16f9 addi a3,a3,-2 + 80025830: 95c2 add a1,a1,a6 + 80025832: 00158703 lb a4,1(a1) # 10001 <.Lline_table_start0+0x19e> + 80025836: 0005c583 lbu a1,0(a1) + 8002583a: 00910793 addi a5,sp,9 + 8002583e: 97b6 add a5,a5,a3 + 80025840: 00e780a3 sb a4,1(a5) + 80025844: 00b78023 sb a1,0(a5) + 80025848: 8932 mv s2,a2 + 8002584a: 45a5 li a1,9 + 8002584c: ed25d7e3 bge a1,s2,8002571a <.LBB481_10+0x1a> + 80025850: 00191613 slli a2,s2,0x1 + 80025854: ffe68593 addi a1,a3,-2 + 80025858: 9642 add a2,a2,a6 + 8002585a: 00160683 lb a3,1(a2) + 8002585e: 00064603 lbu a2,0(a2) + 80025862: 00910713 addi a4,sp,9 + 80025866: 972e add a4,a4,a1 + 80025868: 00d700a3 sb a3,1(a4) + 8002586c: 00c70023 sb a2,0(a4) + 80025870: 00910613 addi a2,sp,9 + 80025874: 00b60733 add a4,a2,a1 + 80025878: 02700613 li a2,39 + 8002587c: 40b607b3 sub a5,a2,a1 + +0000000080025880 <.LBB481_11>: + 80025880: 00008617 auipc a2,0x8 + 80025884: 4c860613 addi a2,a2,1224 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 80025888: 4585 li a1,1 + 8002588a: 4681 li a3,0 + 8002588c: ffffe097 auipc ra,0xffffe + 80025890: 29c080e7 jalr 668(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 80025894: 7942 ld s2,48(sp) + 80025896: 74e2 ld s1,56(sp) + 80025898: 6406 ld s0,64(sp) + 8002589a: 60a6 ld ra,72(sp) + 8002589c: 6161 addi sp,sp,80 + 8002589e: 8082 ret + +Disassembly of section .text._ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E: + +00000000800258a0 <_ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u64$GT$3fmt17h9c6c4af1578f7c29E>: + 800258a0: 715d addi sp,sp,-80 + 800258a2: e486 sd ra,72(sp) + 800258a4: e0a2 sd s0,64(sp) + 800258a6: fc26 sd s1,56(sp) + 800258a8: f84a sd s2,48(sp) + 800258aa: 00053903 ld s2,0(a0) + 800258ae: 852e mv a0,a1 + 800258b0: 00495593 srli a1,s2,0x4 + 800258b4: 02700693 li a3,39 + 800258b8: 27100713 li a4,625 + +00000000800258bc <.LBB483_10>: + 800258bc: 00008817 auipc a6,0x8 + 800258c0: 76e80813 addi a6,a6,1902 # 8002e02a <.Lanon.f077182aff5f58a5660f14b1290425e3.229> + 800258c4: 02e5f363 bgeu a1,a4,800258ea <.LBB483_10+0x2e> + 800258c8: 06300593 li a1,99 + 800258cc: 0f25c063 blt a1,s2,800259ac <.LBB483_10+0xf0> + 800258d0: 45a5 li a1,9 + 800258d2: 1325cd63 blt a1,s2,80025a0c <.LBB483_10+0x150> + 800258d6: fff68593 addi a1,a3,-1 + 800258da: 00910613 addi a2,sp,9 + 800258de: 962e add a2,a2,a1 + 800258e0: 03090693 addi a3,s2,48 + 800258e4: 00d60023 sb a3,0(a2) + 800258e8: a291 j 80025a2c <.LBB483_10+0x170> + 800258ea: 4681 li a3,0 + 800258ec: 001a35b7 lui a1,0x1a3 + 800258f0: 6e35859b addiw a1,a1,1763 + 800258f4: 05ba slli a1,a1,0xe + 800258f6: ac758593 addi a1,a1,-1337 # 1a2ac7 <.Lline_table_start0+0x16b662> + 800258fa: 05ba slli a1,a1,0xe + 800258fc: 43358593 addi a1,a1,1075 + 80025900: 05b6 slli a1,a1,0xd + 80025902: 94b58893 addi a7,a1,-1717 + 80025906: 6589 lui a1,0x2 + 80025908: 7105831b addiw t1,a1,1808 + 8002590c: 65c1 lui a1,0x10 + 8002590e: ffc58e1b addiw t3,a1,-4 + 80025912: 0051f737 lui a4,0x51f + 80025916: b857071b addiw a4,a4,-1147 + 8002591a: 0736 slli a4,a4,0xd + 8002591c: 3d770713 addi a4,a4,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 80025920: 073a slli a4,a4,0xe + 80025922: 28f70713 addi a4,a4,655 + 80025926: 0732 slli a4,a4,0xc + 80025928: 5c370e93 addi t4,a4,1475 + 8002592c: 06400293 li t0,100 + 80025930: ffe58f1b addiw t5,a1,-2 + 80025934: 00910393 addi t2,sp,9 + 80025938: 05f5e5b7 lui a1,0x5f5e + 8002593c: 0ff58f9b addiw t6,a1,255 + 80025940: 864a mv a2,s2 + 80025942: 031937b3 mulhu a5,s2,a7 + 80025946: 00b7d913 srli s2,a5,0xb + 8002594a: 02690733 mul a4,s2,t1 + 8002594e: 40e60733 sub a4,a2,a4 + 80025952: 01c775b3 and a1,a4,t3 + 80025956: 8189 srli a1,a1,0x2 + 80025958: 03d5b5b3 mulhu a1,a1,t4 + 8002595c: 8189 srli a1,a1,0x2 + 8002595e: 00159413 slli s0,a1,0x1 + 80025962: 025585b3 mul a1,a1,t0 + 80025966: 40b705b3 sub a1,a4,a1 + 8002596a: 0586 slli a1,a1,0x1 + 8002596c: 01e5f5b3 and a1,a1,t5 + 80025970: 01040733 add a4,s0,a6 + 80025974: 00d38433 add s0,t2,a3 + 80025978: 00074483 lbu s1,0(a4) + 8002597c: 00170703 lb a4,1(a4) + 80025980: 95c2 add a1,a1,a6 + 80025982: 00158783 lb a5,1(a1) # 5f5e001 <.Lline_table_start0+0x5f26b9c> + 80025986: 0005c583 lbu a1,0(a1) + 8002598a: 02e40223 sb a4,36(s0) + 8002598e: 029401a3 sb s1,35(s0) + 80025992: 02f40323 sb a5,38(s0) + 80025996: 02b402a3 sb a1,37(s0) + 8002599a: 16f1 addi a3,a3,-4 + 8002599c: facfe2e3 bltu t6,a2,80025940 <.LBB483_10+0x84> + 800259a0: 02768693 addi a3,a3,39 + 800259a4: 06300593 li a1,99 + 800259a8: f325d4e3 bge a1,s2,800258d0 <.LBB483_10+0x14> + 800259ac: 65c1 lui a1,0x10 + 800259ae: ffc5861b addiw a2,a1,-4 + 800259b2: 00c97633 and a2,s2,a2 + 800259b6: 8209 srli a2,a2,0x2 + 800259b8: 0051f737 lui a4,0x51f + 800259bc: b857071b addiw a4,a4,-1147 + 800259c0: 0736 slli a4,a4,0xd + 800259c2: 3d770713 addi a4,a4,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 800259c6: 073a slli a4,a4,0xe + 800259c8: 28f70713 addi a4,a4,655 + 800259cc: 0732 slli a4,a4,0xc + 800259ce: 5c370713 addi a4,a4,1475 + 800259d2: 02e63633 mulhu a2,a2,a4 + 800259d6: 8209 srli a2,a2,0x2 + 800259d8: 06400713 li a4,100 + 800259dc: 02e60733 mul a4,a2,a4 + 800259e0: 40e90733 sub a4,s2,a4 + 800259e4: 0706 slli a4,a4,0x1 + 800259e6: 35f9 addiw a1,a1,-2 + 800259e8: 8df9 and a1,a1,a4 + 800259ea: 16f9 addi a3,a3,-2 + 800259ec: 95c2 add a1,a1,a6 + 800259ee: 00158703 lb a4,1(a1) # 10001 <.Lline_table_start0+0x19e> + 800259f2: 0005c583 lbu a1,0(a1) + 800259f6: 00910793 addi a5,sp,9 + 800259fa: 97b6 add a5,a5,a3 + 800259fc: 00e780a3 sb a4,1(a5) + 80025a00: 00b78023 sb a1,0(a5) + 80025a04: 8932 mv s2,a2 + 80025a06: 45a5 li a1,9 + 80025a08: ed25d7e3 bge a1,s2,800258d6 <.LBB483_10+0x1a> + 80025a0c: 00191613 slli a2,s2,0x1 + 80025a10: ffe68593 addi a1,a3,-2 + 80025a14: 9642 add a2,a2,a6 + 80025a16: 00160683 lb a3,1(a2) + 80025a1a: 00064603 lbu a2,0(a2) + 80025a1e: 00910713 addi a4,sp,9 + 80025a22: 972e add a4,a4,a1 + 80025a24: 00d700a3 sb a3,1(a4) + 80025a28: 00c70023 sb a2,0(a4) + 80025a2c: 00910613 addi a2,sp,9 + 80025a30: 00b60733 add a4,a2,a1 + 80025a34: 02700613 li a2,39 + 80025a38: 40b607b3 sub a5,a2,a1 + +0000000080025a3c <.LBB483_11>: + 80025a3c: 00008617 auipc a2,0x8 + 80025a40: 30c60613 addi a2,a2,780 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 80025a44: 4585 li a1,1 + 80025a46: 4681 li a3,0 + 80025a48: ffffe097 auipc ra,0xffffe + 80025a4c: 0e0080e7 jalr 224(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 80025a50: 7942 ld s2,48(sp) + 80025a52: 74e2 ld s1,56(sp) + 80025a54: 6406 ld s0,64(sp) + 80025a56: 60a6 ld ra,72(sp) + 80025a58: 6161 addi sp,sp,80 + 80025a5a: 8082 ret + +Disassembly of section .text._ZN53_$LT$core..fmt..Error$u20$as$u20$core..fmt..Debug$GT$3fmt17h2b8d1e77328b4836E: + +0000000080025a5c <_ZN53_$LT$core..fmt..Error$u20$as$u20$core..fmt..Debug$GT$3fmt17h2b8d1e77328b4836E>: + 80025a5c: 7590 ld a2,40(a1) + 80025a5e: 7188 ld a0,32(a1) + 80025a60: 6e1c ld a5,24(a2) + +0000000080025a62 <.LBB507_1>: + 80025a62: 00009597 auipc a1,0x9 + 80025a66: 07e58593 addi a1,a1,126 # 8002eae0 <.Lanon.f077182aff5f58a5660f14b1290425e3.546> + 80025a6a: 4615 li a2,5 + 80025a6c: 8782 jr a5 + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h017525c41f63708eE: + +0000000080025a6e <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h017525c41f63708eE>: + 80025a6e: 7175 addi sp,sp,-144 + 80025a70: e506 sd ra,136(sp) + 80025a72: 882e mv a6,a1 + 80025a74: 0305e583 lwu a1,48(a1) + 80025a78: 6108 ld a0,0(a0) + 80025a7a: 0105f613 andi a2,a1,16 + 80025a7e: e625 bnez a2,80025ae6 <.LBB508_21+0x22> + 80025a80: 0205f593 andi a1,a1,32 + 80025a84: e9c1 bnez a1,80025b14 <.LBB508_21+0x50> + 80025a86: 00054503 lbu a0,0(a0) + 80025a8a: 06400593 li a1,100 + 80025a8e: 0eb56463 bltu a0,a1,80025b76 <.LBB508_22+0x1c> + 80025a92: 0fc57613 andi a2,a0,252 + 80025a96: 8209 srli a2,a2,0x2 + 80025a98: 0051f6b7 lui a3,0x51f + 80025a9c: b856869b addiw a3,a3,-1147 + 80025aa0: 06b6 slli a3,a3,0xd + 80025aa2: 3d768693 addi a3,a3,983 # 51f3d7 <.Lline_table_start0+0x4e7f72> + 80025aa6: 06ba slli a3,a3,0xe + 80025aa8: 28f68693 addi a3,a3,655 + 80025aac: 06b2 slli a3,a3,0xc + 80025aae: 5c368693 addi a3,a3,1475 + 80025ab2: 02d63633 mulhu a2,a2,a3 + 80025ab6: 8209 srli a2,a2,0x2 + 80025ab8: 02b605b3 mul a1,a2,a1 + 80025abc: 8d0d sub a0,a0,a1 + 80025abe: 0506 slli a0,a0,0x1 + 80025ac0: 0fe57513 andi a0,a0,254 + +0000000080025ac4 <.LBB508_21>: + 80025ac4: 00008597 auipc a1,0x8 + 80025ac8: 56658593 addi a1,a1,1382 # 8002e02a <.Lanon.f077182aff5f58a5660f14b1290425e3.229> + 80025acc: 952e add a0,a0,a1 + 80025ace: 00150583 lb a1,1(a0) + 80025ad2: 00054503 lbu a0,0(a0) + 80025ad6: 02b10723 sb a1,46(sp) + 80025ada: 02a106a3 sb a0,45(sp) + 80025ade: 02400593 li a1,36 + 80025ae2: 8532 mv a0,a2 + 80025ae4: a871 j 80025b80 <.LBB508_22+0x26> + 80025ae6: 00054503 lbu a0,0(a0) + 80025aea: 4581 li a1,0 + 80025aec: 0030 addi a2,sp,8 + 80025aee: 46a9 li a3,10 + 80025af0: a819 j 80025b06 <.LBB508_21+0x42> + 80025af2: 05770713 addi a4,a4,87 + 80025af6: 00b607b3 add a5,a2,a1 + 80025afa: 8111 srli a0,a0,0x4 + 80025afc: 893d andi a0,a0,15 + 80025afe: 06e78fa3 sb a4,127(a5) + 80025b02: 15fd addi a1,a1,-1 + 80025b04: cd1d beqz a0,80025b42 <.LBB508_21+0x7e> + 80025b06: 00f57713 andi a4,a0,15 + 80025b0a: fed774e3 bgeu a4,a3,80025af2 <.LBB508_21+0x2e> + 80025b0e: 03076713 ori a4,a4,48 + 80025b12: b7d5 j 80025af6 <.LBB508_21+0x32> + 80025b14: 00054503 lbu a0,0(a0) + 80025b18: 4581 li a1,0 + 80025b1a: 0030 addi a2,sp,8 + 80025b1c: 46a9 li a3,10 + 80025b1e: a819 j 80025b34 <.LBB508_21+0x70> + 80025b20: 03770713 addi a4,a4,55 + 80025b24: 00b607b3 add a5,a2,a1 + 80025b28: 8111 srli a0,a0,0x4 + 80025b2a: 893d andi a0,a0,15 + 80025b2c: 06e78fa3 sb a4,127(a5) + 80025b30: 15fd addi a1,a1,-1 + 80025b32: c901 beqz a0,80025b42 <.LBB508_21+0x7e> + 80025b34: 00f57713 andi a4,a0,15 + 80025b38: fed774e3 bgeu a4,a3,80025b20 <.LBB508_21+0x5c> + 80025b3c: 03076713 ori a4,a4,48 + 80025b40: b7d5 j 80025b24 <.LBB508_21+0x60> + 80025b42: 08058513 addi a0,a1,128 + 80025b46: 08100613 li a2,129 + 80025b4a: 08c57763 bgeu a0,a2,80025bd8 <.LBB508_25> + 80025b4e: 40b007b3 neg a5,a1 + 80025b52: 0028 addi a0,sp,8 + 80025b54: 952e add a0,a0,a1 + 80025b56: 08050713 addi a4,a0,128 + +0000000080025b5a <.LBB508_22>: + 80025b5a: 00008617 auipc a2,0x8 + 80025b5e: 4ce60613 addi a2,a2,1230 # 8002e028 <.Lanon.f077182aff5f58a5660f14b1290425e3.226> + 80025b62: 4585 li a1,1 + 80025b64: 4689 li a3,2 + 80025b66: 8542 mv a0,a6 + 80025b68: ffffe097 auipc ra,0xffffe + 80025b6c: fc0080e7 jalr -64(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 80025b70: 60aa ld ra,136(sp) + 80025b72: 6149 addi sp,sp,144 + 80025b74: 8082 ret + 80025b76: 4625 li a2,9 + 80025b78: 02600593 li a1,38 + 80025b7c: 00a66963 bltu a2,a0,80025b8e <.LBB508_22+0x34> + 80025b80: 0030 addi a2,sp,8 + 80025b82: 962e add a2,a2,a1 + 80025b84: 03050513 addi a0,a0,48 + 80025b88: 00a60023 sb a0,0(a2) + 80025b8c: a00d j 80025bae <.LBB508_23+0x1e> + 80025b8e: 0506 slli a0,a0,0x1 + +0000000080025b90 <.LBB508_23>: + 80025b90: 00008597 auipc a1,0x8 + 80025b94: 49a58593 addi a1,a1,1178 # 8002e02a <.Lanon.f077182aff5f58a5660f14b1290425e3.229> + 80025b98: 952e add a0,a0,a1 + 80025b9a: 00150583 lb a1,1(a0) + 80025b9e: 00054503 lbu a0,0(a0) + 80025ba2: 02b10723 sb a1,46(sp) + 80025ba6: 02a106a3 sb a0,45(sp) + 80025baa: 02500593 li a1,37 + 80025bae: 0028 addi a0,sp,8 + 80025bb0: 00b50733 add a4,a0,a1 + 80025bb4: 02700513 li a0,39 + 80025bb8: 40b507b3 sub a5,a0,a1 + +0000000080025bbc <.LBB508_24>: + 80025bbc: 00008617 auipc a2,0x8 + 80025bc0: 18c60613 addi a2,a2,396 # 8002dd48 <.Lanon.f077182aff5f58a5660f14b1290425e3.133> + 80025bc4: 4585 li a1,1 + 80025bc6: 8542 mv a0,a6 + 80025bc8: 4681 li a3,0 + 80025bca: ffffe097 auipc ra,0xffffe + 80025bce: f5e080e7 jalr -162(ra) # 80023b28 <_ZN4core3fmt9Formatter12pad_integral17h663298466d3a1ae5E> + 80025bd2: 60aa ld ra,136(sp) + 80025bd4: 6149 addi sp,sp,144 + 80025bd6: 8082 ret + +0000000080025bd8 <.LBB508_25>: + 80025bd8: 00008617 auipc a2,0x8 + 80025bdc: 43860613 addi a2,a2,1080 # 8002e010 <.Lanon.f077182aff5f58a5660f14b1290425e3.225> + 80025be0: 08000593 li a1,128 + 80025be4: fffff097 auipc ra,0xfffff + 80025be8: cee080e7 jalr -786(ra) # 800248d2 <_ZN4core5slice5index26slice_start_index_len_fail17h9b5b4d8717655b24E> + ... + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h729ad47dd83507edE: + +0000000080025bee <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h729ad47dd83507edE>: + 80025bee: 6510 ld a2,8(a0) + 80025bf0: 6108 ld a0,0(a0) + 80025bf2: 6e1c ld a5,24(a2) + 80025bf4: 8782 jr a5 + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17haf4f75541e037c12E: + +0000000080025bf6 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17haf4f75541e037c12E>: + 80025bf6: 6108 ld a0,0(a0) + 80025bf8: fffff317 auipc t1,0xfffff + 80025bfc: 77e30067 jr 1918(t1) # 80025376 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE> + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb809428d9f1f0981E: + +0000000080025c00 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb809428d9f1f0981E>: + 80025c00: 00008697 auipc a3,0x8 + 80025c04: 57868693 addi a3,a3,1400 # 8002e178 <.Lanon.f077182aff5f58a5660f14b1290425e3.242> + 80025c08: 4609 li a2,2 + 80025c0a: 852e mv a0,a1 + 80025c0c: 85b6 mv a1,a3 + 80025c0e: ffffe317 auipc t1,0xffffe + 80025c12: 1d230067 jr 466(t1) # 80023de0 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE> + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb8cc379c2a0c894eE: + +0000000080025c16 <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb8cc379c2a0c894eE>: + 80025c16: 7139 addi sp,sp,-64 + 80025c18: fc06 sd ra,56(sp) + 80025c1a: f822 sd s0,48(sp) + 80025c1c: f426 sd s1,40(sp) + 80025c1e: 6110 ld a2,0(a0) + 80025c20: 00064503 lbu a0,0(a2) + 80025c24: 842e mv s0,a1 + 80025c26: cd59 beqz a0,80025cc4 <.LBB572_13+0x1e> + 80025c28: 740c ld a1,40(s0) + 80025c2a: 7008 ld a0,32(s0) + 80025c2c: 6d94 ld a3,24(a1) + 80025c2e: 00160493 addi s1,a2,1 + +0000000080025c32 <.LBB572_10>: + 80025c32: 00002597 auipc a1,0x2 + 80025c36: aaa58593 addi a1,a1,-1366 # 800276dc <.LJTI3_0+0x5c> + 80025c3a: 4611 li a2,4 + 80025c3c: 9682 jalr a3 + 80025c3e: e422 sd s0,8(sp) + 80025c40: 00a10c23 sb a0,24(sp) + 80025c44: e802 sd zero,16(sp) + 80025c46: 00010ca3 sb zero,25(sp) + 80025c4a: f026 sd s1,32(sp) + +0000000080025c4c <.LBB572_11>: + 80025c4c: 00008617 auipc a2,0x8 + 80025c50: 38460613 addi a2,a2,900 # 8002dfd0 <.Lanon.f077182aff5f58a5660f14b1290425e3.214> + 80025c54: 0028 addi a0,sp,8 + 80025c56: 100c addi a1,sp,32 + 80025c58: ffffe097 auipc ra,0xffffe + 80025c5c: 9a2080e7 jalr -1630(ra) # 800235fa <_ZN4core3fmt8builders10DebugTuple5field17h5bd338b8cb98b948E> + 80025c60: 6542 ld a0,16(sp) + 80025c62: 01814583 lbu a1,24(sp) + 80025c66: c921 beqz a0,80025cb6 <.LBB572_13+0x10> + 80025c68: 4405 li s0,1 + 80025c6a: e5a9 bnez a1,80025cb4 <.LBB572_13+0xe> + 80025c6c: 01914583 lbu a1,25(sp) + 80025c70: 157d addi a0,a0,-1 + 80025c72: 00a03533 snez a0,a0 + 80025c76: 0015b593 seqz a1,a1 + 80025c7a: 8d4d or a0,a0,a1 + 80025c7c: e10d bnez a0,80025c9e <.LBB572_12+0x10> + 80025c7e: 6522 ld a0,8(sp) + 80025c80: 03054583 lbu a1,48(a0) + 80025c84: 8991 andi a1,a1,4 + 80025c86: ed81 bnez a1,80025c9e <.LBB572_12+0x10> + 80025c88: 750c ld a1,40(a0) + 80025c8a: 7108 ld a0,32(a0) + 80025c8c: 6d94 ld a3,24(a1) + +0000000080025c8e <.LBB572_12>: + 80025c8e: 00008597 auipc a1,0x8 + 80025c92: 33a58593 addi a1,a1,826 # 8002dfc8 <.Lanon.f077182aff5f58a5660f14b1290425e3.209> + 80025c96: 4605 li a2,1 + 80025c98: 4405 li s0,1 + 80025c9a: 9682 jalr a3 + 80025c9c: ed01 bnez a0,80025cb4 <.LBB572_13+0xe> + 80025c9e: 6522 ld a0,8(sp) + 80025ca0: 750c ld a1,40(a0) + 80025ca2: 7108 ld a0,32(a0) + 80025ca4: 6d94 ld a3,24(a1) + +0000000080025ca6 <.LBB572_13>: + 80025ca6: 00008597 auipc a1,0x8 + 80025caa: 32358593 addi a1,a1,803 # 8002dfc9 <.Lanon.f077182aff5f58a5660f14b1290425e3.210> + 80025cae: 4605 li a2,1 + 80025cb0: 9682 jalr a3 + 80025cb2: 842a mv s0,a0 + 80025cb4: 85a2 mv a1,s0 + 80025cb6: 00b03533 snez a0,a1 + 80025cba: 74a2 ld s1,40(sp) + 80025cbc: 7442 ld s0,48(sp) + 80025cbe: 70e2 ld ra,56(sp) + 80025cc0: 6121 addi sp,sp,64 + 80025cc2: 8082 ret + 80025cc4: 740c ld a1,40(s0) + 80025cc6: 7008 ld a0,32(s0) + 80025cc8: 6d9c ld a5,24(a1) + +0000000080025cca <.LBB572_14>: + 80025cca: 00002597 auipc a1,0x2 + 80025cce: a3658593 addi a1,a1,-1482 # 80027700 <.LJTI3_0+0x80> + 80025cd2: 4611 li a2,4 + 80025cd4: 74a2 ld s1,40(sp) + 80025cd6: 7442 ld s0,48(sp) + 80025cd8: 70e2 ld ra,56(sp) + 80025cda: 6121 addi sp,sp,64 + 80025cdc: 8782 jr a5 + +Disassembly of section .text._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hd91955f1ed16292bE: + +0000000080025cde <_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hd91955f1ed16292bE>: + 80025cde: 1141 addi sp,sp,-16 + 80025ce0: e406 sd ra,8(sp) + 80025ce2: 6108 ld a0,0(a0) + 80025ce4: 6108 ld a0,0(a0) + 80025ce6: e02a sd a0,0(sp) + 80025ce8: 850a mv a0,sp + 80025cea: fffff097 auipc ra,0xfffff + 80025cee: 68c080e7 jalr 1676(ra) # 80025376 <_ZN4core3fmt3num52_$LT$impl$u20$core..fmt..Debug$u20$for$u20$usize$GT$3fmt17h46dfaf96577b17ecE> + 80025cf2: 60a2 ld ra,8(sp) + 80025cf4: 0141 addi sp,sp,16 + 80025cf6: 8082 ret + +Disassembly of section .text._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E: + +0000000080025cf8 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h65c6410ca8a4d3e4E>: + 80025cf8: 6114 ld a3,0(a0) + 80025cfa: 6510 ld a2,8(a0) + 80025cfc: 852e mv a0,a1 + 80025cfe: 85b6 mv a1,a3 + 80025d00: ffffe317 auipc t1,0xffffe + 80025d04: 0e030067 jr 224(t1) # 80023de0 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE> + +Disassembly of section .text._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h78c3d125c3c6a2c3E: + +0000000080025d08 <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h78c3d125c3c6a2c3E>: + 80025d08: 7139 addi sp,sp,-64 + 80025d0a: fc06 sd ra,56(sp) + 80025d0c: 6110 ld a2,0(a0) + 80025d0e: 7608 ld a0,40(a2) + 80025d10: f82a sd a0,48(sp) + 80025d12: 7208 ld a0,32(a2) + 80025d14: f42a sd a0,40(sp) + 80025d16: 6e08 ld a0,24(a2) + 80025d18: f02a sd a0,32(sp) + 80025d1a: 6a08 ld a0,16(a2) + 80025d1c: ec2a sd a0,24(sp) + 80025d1e: 6614 ld a3,8(a2) + 80025d20: 7188 ld a0,32(a1) + 80025d22: e836 sd a3,16(sp) + 80025d24: 6210 ld a2,0(a2) + 80025d26: 758c ld a1,40(a1) + 80025d28: e432 sd a2,8(sp) + 80025d2a: 0030 addi a2,sp,8 + 80025d2c: ffffe097 auipc ra,0xffffe + 80025d30: c7a080e7 jalr -902(ra) # 800239a6 <_ZN4core3fmt5write17hf87af17b3ec995a2E> + 80025d34: 70e2 ld ra,56(sp) + 80025d36: 6121 addi sp,sp,64 + 80025d38: 8082 ret + +Disassembly of section .text._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h874d6ce7f8524becE: + +0000000080025d3a <_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17h874d6ce7f8524becE>: + 80025d3a: 6108 ld a0,0(a0) + 80025d3c: 6114 ld a3,0(a0) + 80025d3e: 6510 ld a2,8(a0) + 80025d40: 852e mv a0,a1 + 80025d42: 85b6 mv a1,a3 + 80025d44: ffffe317 auipc t1,0xffffe + 80025d48: 09c30067 jr 156(t1) # 80023de0 <_ZN4core3fmt9Formatter3pad17hc4783833ae1fffcaE> + +Disassembly of section .text._ZN64_$LT$core..str..error..Utf8Error$u20$as$u20$core..fmt..Debug$GT$3fmt17ha0e809482d073ba7E: + +0000000080025d4c <_ZN64_$LT$core..str..error..Utf8Error$u20$as$u20$core..fmt..Debug$GT$3fmt17ha0e809482d073ba7E>: + 80025d4c: 7139 addi sp,sp,-64 + 80025d4e: fc06 sd ra,56(sp) + 80025d50: f822 sd s0,48(sp) + 80025d52: f426 sd s1,40(sp) + 80025d54: f04a sd s2,32(sp) + 80025d56: 842e mv s0,a1 + 80025d58: 758c ld a1,40(a1) + 80025d5a: 7014 ld a3,32(s0) + 80025d5c: 6d98 ld a4,24(a1) + 80025d5e: 84aa mv s1,a0 + 80025d60: 00850913 addi s2,a0,8 + +0000000080025d64 <.LBB599_8>: + 80025d64: 00009597 auipc a1,0x9 + 80025d68: d8158593 addi a1,a1,-639 # 8002eae5 <.Lanon.f077182aff5f58a5660f14b1290425e3.570> + 80025d6c: 4625 li a2,9 + 80025d6e: 8536 mv a0,a3 + 80025d70: 9702 jalr a4 + 80025d72: e42a sd a0,8(sp) + 80025d74: e022 sd s0,0(sp) + 80025d76: ec26 sd s1,24(sp) + +0000000080025d78 <.LBB599_9>: + 80025d78: 00009597 auipc a1,0x9 + 80025d7c: d7658593 addi a1,a1,-650 # 8002eaee <.Lanon.f077182aff5f58a5660f14b1290425e3.571> + +0000000080025d80 <.LBB599_10>: + 80025d80: 00009717 auipc a4,0x9 + 80025d84: d1070713 addi a4,a4,-752 # 8002ea90 <.Lanon.f077182aff5f58a5660f14b1290425e3.422> + 80025d88: 850a mv a0,sp + 80025d8a: 462d li a2,11 + 80025d8c: 0834 addi a3,sp,24 + 80025d8e: ffffd097 auipc ra,0xffffd + 80025d92: 6f0080e7 jalr 1776(ra) # 8002347e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E> + 80025d96: ec4a sd s2,24(sp) + +0000000080025d98 <.LBB599_11>: + 80025d98: 00009597 auipc a1,0x9 + 80025d9c: d6158593 addi a1,a1,-671 # 8002eaf9 <.Lanon.f077182aff5f58a5660f14b1290425e3.572> + +0000000080025da0 <.LBB599_12>: + 80025da0: 00009717 auipc a4,0x9 + 80025da4: d6870713 addi a4,a4,-664 # 8002eb08 <.Lanon.f077182aff5f58a5660f14b1290425e3.573> + 80025da8: 850a mv a0,sp + 80025daa: 4625 li a2,9 + 80025dac: 0834 addi a3,sp,24 + 80025dae: ffffd097 auipc ra,0xffffd + 80025db2: 6d0080e7 jalr 1744(ra) # 8002347e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E> + 80025db6: 00914503 lbu a0,9(sp) + 80025dba: 00814583 lbu a1,8(sp) + 80025dbe: c91d beqz a0,80025df4 <.LBB599_14+0xe> + 80025dc0: 4505 li a0,1 + 80025dc2: e985 bnez a1,80025df2 <.LBB599_14+0xc> + 80025dc4: 6502 ld a0,0(sp) + 80025dc6: 03054583 lbu a1,48(a0) + 80025dca: 8991 andi a1,a1,4 + 80025dcc: e991 bnez a1,80025de0 <.LBB599_13+0xc> + 80025dce: 750c ld a1,40(a0) + 80025dd0: 7108 ld a0,32(a0) + 80025dd2: 6d94 ld a3,24(a1) + +0000000080025dd4 <.LBB599_13>: + 80025dd4: 00008597 auipc a1,0x8 + 80025dd8: 1ef58593 addi a1,a1,495 # 8002dfc3 <.Lanon.f077182aff5f58a5660f14b1290425e3.206> + 80025ddc: 4609 li a2,2 + 80025dde: a809 j 80025df0 <.LBB599_14+0xa> + 80025de0: 750c ld a1,40(a0) + 80025de2: 7108 ld a0,32(a0) + 80025de4: 6d94 ld a3,24(a1) + +0000000080025de6 <.LBB599_14>: + 80025de6: 00008597 auipc a1,0x8 + 80025dea: 1dc58593 addi a1,a1,476 # 8002dfc2 <.Lanon.f077182aff5f58a5660f14b1290425e3.205> + 80025dee: 4605 li a2,1 + 80025df0: 9682 jalr a3 + 80025df2: 85aa mv a1,a0 + 80025df4: 00b03533 snez a0,a1 + 80025df8: 7902 ld s2,32(sp) + 80025dfa: 74a2 ld s1,40(sp) + 80025dfc: 7442 ld s0,48(sp) + 80025dfe: 70e2 ld ra,56(sp) + 80025e00: 6121 addi sp,sp,64 + 80025e02: 8082 ret + +Disassembly of section .text._ZN4core7unicode12unicode_data15grapheme_extend6lookup17hb6efbf5d86b330e2E: + +0000000080025e04 <_ZN4core7unicode12unicode_data15grapheme_extend6lookup17hb6efbf5d86b330e2E>: + 80025e04: 1141 addi sp,sp,-16 + 80025e06: e406 sd ra,8(sp) + 80025e08: 4701 li a4,0 + 80025e0a: 00b51593 slli a1,a0,0xb + 80025e0e: 47fd li a5,31 + +0000000080025e10 <.LBB627_25>: + 80025e10: 00009817 auipc a6,0x9 + 80025e14: d1880813 addi a6,a6,-744 # 8002eb28 <_ZN4core7unicode12unicode_data15grapheme_extend17SHORT_OFFSET_RUNS17h48ab6df2484a36f4E> + 80025e18: 0005889b sext.w a7,a1 + 80025e1c: 46fd li a3,31 + 80025e1e: a039 j 80025e2c <.LBB627_25+0x1c> + 80025e20: 00178713 addi a4,a5,1 + 80025e24: 40e687b3 sub a5,a3,a4 + 80025e28: 02d77a63 bgeu a4,a3,80025e5c <.LBB627_25+0x4c> + 80025e2c: 0017d593 srli a1,a5,0x1 + 80025e30: 00e587b3 add a5,a1,a4 + 80025e34: 00279593 slli a1,a5,0x2 + 80025e38: 95c2 add a1,a1,a6 + 80025e3a: 418c lw a1,0(a1) + 80025e3c: 00b5961b slliw a2,a1,0xb + 80025e40: ff1660e3 bltu a2,a7,80025e20 <.LBB627_25+0x10> + 80025e44: 05ae slli a1,a1,0xb + 80025e46: 2581 sext.w a1,a1 + 80025e48: 01158863 beq a1,a7,80025e58 <.LBB627_25+0x48> + 80025e4c: 86be mv a3,a5 + 80025e4e: 40e687b3 sub a5,a3,a4 + 80025e52: fcd76de3 bltu a4,a3,80025e2c <.LBB627_25+0x1c> + 80025e56: a019 j 80025e5c <.LBB627_25+0x4c> + 80025e58: 00178713 addi a4,a5,1 + 80025e5c: 46f9 li a3,30 + 80025e5e: 0ae6e863 bltu a3,a4,80025f0e <.LBB627_28> + 80025e62: 00271793 slli a5,a4,0x2 + 80025e66: 2b100613 li a2,689 + 80025e6a: 00d70863 beq a4,a3,80025e7a <.LBB627_25+0x6a> + 80025e6e: 00f805b3 add a1,a6,a5 + 80025e72: 0045e583 lwu a1,4(a1) + 80025e76: 0155d613 srli a2,a1,0x15 + 80025e7a: fff70693 addi a3,a4,-1 + 80025e7e: 00d77463 bgeu a4,a3,80025e86 <.LBB627_25+0x76> + 80025e82: 4701 li a4,0 + 80025e84: a831 j 80025ea0 <.LBB627_25+0x90> + 80025e86: 45fd li a1,31 + 80025e88: 08b6fe63 bgeu a3,a1,80025f24 <.LBB627_29> + 80025e8c: 00269593 slli a1,a3,0x2 + 80025e90: 95c2 add a1,a1,a6 + 80025e92: 0005e583 lwu a1,0(a1) + 80025e96: 002006b7 lui a3,0x200 + 80025e9a: 36fd addiw a3,a3,-1 + 80025e9c: 00d5f733 and a4,a1,a3 + 80025ea0: 010785b3 add a1,a5,a6 + 80025ea4: 0005e583 lwu a1,0(a1) + 80025ea8: 81d5 srli a1,a1,0x15 + 80025eaa: 00158693 addi a3,a1,1 + 80025eae: 02d60f63 beq a2,a3,80025eec <.LBB627_26+0x22> + 80025eb2: 2b100793 li a5,689 + 80025eb6: 882e mv a6,a1 + 80025eb8: 00b7e463 bltu a5,a1,80025ec0 <.LBB627_25+0xb0> + 80025ebc: 2b100813 li a6,689 + 80025ec0: 4781 li a5,0 + 80025ec2: 40e5073b subw a4,a0,a4 + 80025ec6: fff60513 addi a0,a2,-1 + +0000000080025eca <.LBB627_26>: + 80025eca: 00009617 auipc a2,0x9 + 80025ece: cda60613 addi a2,a2,-806 # 8002eba4 <_ZN4core7unicode12unicode_data15grapheme_extend7OFFSETS17h8de8e75bf9625e57E> + 80025ed2: 02b80263 beq a6,a1,80025ef6 <.LBB627_27> + 80025ed6: 00c586b3 add a3,a1,a2 + 80025eda: 0006c683 lbu a3,0(a3) # 200000 <.Lline_table_start0+0x1c8b9b> + 80025ede: 9fb5 addw a5,a5,a3 + 80025ee0: 00f76663 bltu a4,a5,80025eec <.LBB627_26+0x22> + 80025ee4: 0585 addi a1,a1,1 + 80025ee6: feb516e3 bne a0,a1,80025ed2 <.LBB627_26+0x8> + 80025eea: 85aa mv a1,a0 + 80025eec: 0015f513 andi a0,a1,1 + 80025ef0: 60a2 ld ra,8(sp) + 80025ef2: 0141 addi sp,sp,16 + 80025ef4: 8082 ret + +0000000080025ef6 <.LBB627_27>: + 80025ef6: 00009617 auipc a2,0x9 + 80025efa: b6a60613 addi a2,a2,-1174 # 8002ea60 <.Lanon.f077182aff5f58a5660f14b1290425e3.360> + 80025efe: 2b100593 li a1,689 + 80025f02: 8542 mv a0,a6 + 80025f04: ffffd097 auipc ra,0xffffd + 80025f08: 26c080e7 jalr 620(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080025f0e <.LBB627_28>: + 80025f0e: 00009617 auipc a2,0x9 + 80025f12: b3a60613 addi a2,a2,-1222 # 8002ea48 <.Lanon.f077182aff5f58a5660f14b1290425e3.359> + 80025f16: 45fd li a1,31 + 80025f18: 853a mv a0,a4 + 80025f1a: ffffd097 auipc ra,0xffffd + 80025f1e: 256080e7 jalr 598(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +0000000080025f24 <.LBB627_29>: + 80025f24: 00009617 auipc a2,0x9 + 80025f28: b5460613 addi a2,a2,-1196 # 8002ea78 <.Lanon.f077182aff5f58a5660f14b1290425e3.361> + 80025f2c: 45fd li a1,31 + 80025f2e: 8536 mv a0,a3 + 80025f30: ffffd097 auipc ra,0xffffd + 80025f34: 240080e7 jalr 576(ra) # 80023170 <_ZN4core9panicking18panic_bounds_check17h8e071db613335003E> + ... + +Disassembly of section .text._ZN64_$LT$core..alloc..layout..Layout$u20$as$u20$core..fmt..Debug$GT$3fmt17h791c624323e1e5daE: + +0000000080025f3a <_ZN64_$LT$core..alloc..layout..Layout$u20$as$u20$core..fmt..Debug$GT$3fmt17h791c624323e1e5daE>: + 80025f3a: 7139 addi sp,sp,-64 + 80025f3c: fc06 sd ra,56(sp) + 80025f3e: f822 sd s0,48(sp) + 80025f40: f426 sd s1,40(sp) + 80025f42: f04a sd s2,32(sp) + 80025f44: 842e mv s0,a1 + 80025f46: 758c ld a1,40(a1) + 80025f48: 7014 ld a3,32(s0) + 80025f4a: 6d98 ld a4,24(a1) + 80025f4c: 84aa mv s1,a0 + 80025f4e: 00850913 addi s2,a0,8 + +0000000080025f52 <.LBB637_8>: + 80025f52: 00009597 auipc a1,0x9 + 80025f56: f0358593 addi a1,a1,-253 # 8002ee55 <.Lanon.f077182aff5f58a5660f14b1290425e3.643> + 80025f5a: 4619 li a2,6 + 80025f5c: 8536 mv a0,a3 + 80025f5e: 9702 jalr a4 + 80025f60: e42a sd a0,8(sp) + 80025f62: e022 sd s0,0(sp) + 80025f64: ec26 sd s1,24(sp) + +0000000080025f66 <.LBB637_9>: + 80025f66: 00009597 auipc a1,0x9 + 80025f6a: ef558593 addi a1,a1,-267 # 8002ee5b <.Lanon.f077182aff5f58a5660f14b1290425e3.644> + +0000000080025f6e <.LBB637_10>: + 80025f6e: 00009717 auipc a4,0x9 + 80025f72: b2270713 addi a4,a4,-1246 # 8002ea90 <.Lanon.f077182aff5f58a5660f14b1290425e3.422> + 80025f76: 850a mv a0,sp + 80025f78: 4615 li a2,5 + 80025f7a: 0834 addi a3,sp,24 + 80025f7c: ffffd097 auipc ra,0xffffd + 80025f80: 502080e7 jalr 1282(ra) # 8002347e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E> + 80025f84: ec4a sd s2,24(sp) + +0000000080025f86 <.LBB637_11>: + 80025f86: 00009597 auipc a1,0x9 + 80025f8a: eda58593 addi a1,a1,-294 # 8002ee60 <.Lanon.f077182aff5f58a5660f14b1290425e3.645> + +0000000080025f8e <.LBB637_12>: + 80025f8e: 00009717 auipc a4,0x9 + 80025f92: eda70713 addi a4,a4,-294 # 8002ee68 <.Lanon.f077182aff5f58a5660f14b1290425e3.646> + 80025f96: 850a mv a0,sp + 80025f98: 4619 li a2,6 + 80025f9a: 0834 addi a3,sp,24 + 80025f9c: ffffd097 auipc ra,0xffffd + 80025fa0: 4e2080e7 jalr 1250(ra) # 8002347e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E> + 80025fa4: 00914503 lbu a0,9(sp) + 80025fa8: 00814583 lbu a1,8(sp) + 80025fac: c91d beqz a0,80025fe2 <.LBB637_14+0xe> + 80025fae: 4505 li a0,1 + 80025fb0: e985 bnez a1,80025fe0 <.LBB637_14+0xc> + 80025fb2: 6502 ld a0,0(sp) + 80025fb4: 03054583 lbu a1,48(a0) + 80025fb8: 8991 andi a1,a1,4 + 80025fba: e991 bnez a1,80025fce <.LBB637_13+0xc> + 80025fbc: 750c ld a1,40(a0) + 80025fbe: 7108 ld a0,32(a0) + 80025fc0: 6d94 ld a3,24(a1) + +0000000080025fc2 <.LBB637_13>: + 80025fc2: 00008597 auipc a1,0x8 + 80025fc6: 00158593 addi a1,a1,1 # 8002dfc3 <.Lanon.f077182aff5f58a5660f14b1290425e3.206> + 80025fca: 4609 li a2,2 + 80025fcc: a809 j 80025fde <.LBB637_14+0xa> + 80025fce: 750c ld a1,40(a0) + 80025fd0: 7108 ld a0,32(a0) + 80025fd2: 6d94 ld a3,24(a1) + +0000000080025fd4 <.LBB637_14>: + 80025fd4: 00008597 auipc a1,0x8 + 80025fd8: fee58593 addi a1,a1,-18 # 8002dfc2 <.Lanon.f077182aff5f58a5660f14b1290425e3.205> + 80025fdc: 4605 li a2,1 + 80025fde: 9682 jalr a3 + 80025fe0: 85aa mv a1,a0 + 80025fe2: 00b03533 snez a0,a1 + 80025fe6: 7902 ld s2,32(sp) + 80025fe8: 74a2 ld s1,40(sp) + 80025fea: 7442 ld s0,48(sp) + 80025fec: 70e2 ld ra,56(sp) + 80025fee: 6121 addi sp,sp,64 + 80025ff0: 8082 ret + +Disassembly of section .text._ZN69_$LT$core..alloc..layout..LayoutError$u20$as$u20$core..fmt..Debug$GT$3fmt17hfec9be36260ff346E: + +0000000080025ff2 <_ZN69_$LT$core..alloc..layout..LayoutError$u20$as$u20$core..fmt..Debug$GT$3fmt17hfec9be36260ff346E>: + 80025ff2: 7179 addi sp,sp,-48 + 80025ff4: f406 sd ra,40(sp) + 80025ff6: f022 sd s0,32(sp) + 80025ff8: ec26 sd s1,24(sp) + 80025ffa: 842e mv s0,a1 + 80025ffc: 758c ld a1,40(a1) + 80025ffe: 7014 ld a3,32(s0) + 80026000: 6d98 ld a4,24(a1) + 80026002: 84aa mv s1,a0 + +0000000080026004 <.LBB638_8>: + 80026004: 00009597 auipc a1,0x9 + 80026008: e8458593 addi a1,a1,-380 # 8002ee88 <.Lanon.f077182aff5f58a5660f14b1290425e3.647> + 8002600c: 462d li a2,11 + 8002600e: 8536 mv a0,a3 + 80026010: 9702 jalr a4 + 80026012: e42a sd a0,8(sp) + 80026014: e022 sd s0,0(sp) + 80026016: e826 sd s1,16(sp) + +0000000080026018 <.LBB638_9>: + 80026018: 00009597 auipc a1,0x9 + 8002601c: e7b58593 addi a1,a1,-389 # 8002ee93 <.Lanon.f077182aff5f58a5660f14b1290425e3.648> + +0000000080026020 <.LBB638_10>: + 80026020: 00009717 auipc a4,0x9 + 80026024: aa070713 addi a4,a4,-1376 # 8002eac0 <.Lanon.f077182aff5f58a5660f14b1290425e3.426> + 80026028: 850a mv a0,sp + 8002602a: 461d li a2,7 + 8002602c: 0814 addi a3,sp,16 + 8002602e: ffffd097 auipc ra,0xffffd + 80026032: 450080e7 jalr 1104(ra) # 8002347e <_ZN4core3fmt8builders11DebugStruct5field17hd4a9c9da942f00c3E> + 80026036: 00914503 lbu a0,9(sp) + 8002603a: 00814583 lbu a1,8(sp) + 8002603e: c91d beqz a0,80026074 <.LBB638_12+0xe> + 80026040: 4505 li a0,1 + 80026042: e985 bnez a1,80026072 <.LBB638_12+0xc> + 80026044: 6502 ld a0,0(sp) + 80026046: 03054583 lbu a1,48(a0) + 8002604a: 8991 andi a1,a1,4 + 8002604c: e991 bnez a1,80026060 <.LBB638_11+0xc> + 8002604e: 750c ld a1,40(a0) + 80026050: 7108 ld a0,32(a0) + 80026052: 6d94 ld a3,24(a1) + +0000000080026054 <.LBB638_11>: + 80026054: 00008597 auipc a1,0x8 + 80026058: f6f58593 addi a1,a1,-145 # 8002dfc3 <.Lanon.f077182aff5f58a5660f14b1290425e3.206> + 8002605c: 4609 li a2,2 + 8002605e: a809 j 80026070 <.LBB638_12+0xa> + 80026060: 750c ld a1,40(a0) + 80026062: 7108 ld a0,32(a0) + 80026064: 6d94 ld a3,24(a1) + +0000000080026066 <.LBB638_12>: + 80026066: 00008597 auipc a1,0x8 + 8002606a: f5c58593 addi a1,a1,-164 # 8002dfc2 <.Lanon.f077182aff5f58a5660f14b1290425e3.205> + 8002606e: 4605 li a2,1 + 80026070: 9682 jalr a3 + 80026072: 85aa mv a1,a0 + 80026074: 00b03533 snez a0,a1 + 80026078: 64e2 ld s1,24(sp) + 8002607a: 7402 ld s0,32(sp) + 8002607c: 70a2 ld ra,40(sp) + 8002607e: 6145 addi sp,sp,48 + 80026080: 8082 ret + +Disassembly of section .text.memcpy: + +0000000080026082 : + 80026082: ca11 beqz a2,80026096 + 80026084: 86aa mv a3,a0 + 80026086: 00058703 lb a4,0(a1) + 8002608a: 00e68023 sb a4,0(a3) + 8002608e: 167d addi a2,a2,-1 + 80026090: 0685 addi a3,a3,1 + 80026092: 0585 addi a1,a1,1 + 80026094: fa6d bnez a2,80026086 + 80026096: 8082 ret + +Disassembly of section .text.memmove: + +0000000080026098 : + 80026098: 40b506b3 sub a3,a0,a1 + 8002609c: 02c6f163 bgeu a3,a2,800260be + 800260a0: fff50693 addi a3,a0,-1 + 800260a4: 15fd addi a1,a1,-1 + 800260a6: 00c58733 add a4,a1,a2 + 800260aa: 00070703 lb a4,0(a4) + 800260ae: fff60793 addi a5,a2,-1 + 800260b2: 9636 add a2,a2,a3 + 800260b4: 00e60023 sb a4,0(a2) + 800260b8: 863e mv a2,a5 + 800260ba: f7f5 bnez a5,800260a6 + 800260bc: a819 j 800260d2 + 800260be: ca11 beqz a2,800260d2 + 800260c0: 86aa mv a3,a0 + 800260c2: 00058703 lb a4,0(a1) + 800260c6: 00e68023 sb a4,0(a3) + 800260ca: 167d addi a2,a2,-1 + 800260cc: 0685 addi a3,a3,1 + 800260ce: 0585 addi a1,a1,1 + 800260d0: fa6d bnez a2,800260c2 + 800260d2: 8082 ret + +Disassembly of section .text.memset: + +00000000800260d4 : + 800260d4: c619 beqz a2,800260e2 + 800260d6: 86aa mv a3,a0 + 800260d8: 00b68023 sb a1,0(a3) + 800260dc: 167d addi a2,a2,-1 + 800260de: 0685 addi a3,a3,1 + 800260e0: fe65 bnez a2,800260d8 + 800260e2: 8082 ret + +Disassembly of section .text.bcmp: + +00000000800260e4 : + 800260e4: ca19 beqz a2,800260fa + 800260e6: 00054683 lbu a3,0(a0) + 800260ea: 0005c703 lbu a4,0(a1) + 800260ee: 00e69863 bne a3,a4,800260fe + 800260f2: 167d addi a2,a2,-1 + 800260f4: 0585 addi a1,a1,1 + 800260f6: 0505 addi a0,a0,1 + 800260f8: f67d bnez a2,800260e6 + 800260fa: 4501 li a0,0 + 800260fc: 8082 ret + 800260fe: 40e68533 sub a0,a3,a4 + 80026102: 8082 ret diff --git a/kernel/.cargo/config.toml b/kernel/.cargo/config.toml old mode 100644 new mode 100755 diff --git a/kernel/Makefile b/kernel/Makefile index 31b6621..199c6ed 100755 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -2,7 +2,7 @@ TARGET := riscv64gc-unknown-none-elf MODE := debug KERNEL_FILE := target/$(TARGET)/$(MODE)/kernel BIN_FILE := target/$(TARGET)/$(MODE)/kernel.bin -CPUS := 3 +CPUS := 1 FS_IMG := ../fs.img KERNEL_ASM := kernel.S diff --git a/kernel/src/arch/mod.rs b/kernel/src/arch/mod.rs old mode 100644 new mode 100755 diff --git a/kernel/src/arch/riscv/mod.rs b/kernel/src/arch/riscv/mod.rs old mode 100644 new mode 100755 diff --git a/kernel/src/arch/riscv/qemu/devices.rs b/kernel/src/arch/riscv/qemu/devices.rs old mode 100644 new mode 100755 diff --git a/kernel/src/arch/riscv/qemu/e1000.rs b/kernel/src/arch/riscv/qemu/e1000.rs old mode 100644 new mode 100755 diff --git a/kernel/src/arch/riscv/qemu/fs.rs b/kernel/src/arch/riscv/qemu/fs.rs old mode 100644 new mode 100755 diff --git a/kernel/src/arch/riscv/qemu/layout.rs b/kernel/src/arch/riscv/qemu/layout.rs index 166b7cc..86e578e 100755 --- a/kernel/src/arch/riscv/qemu/layout.rs +++ b/kernel/src/arch/riscv/qemu/layout.rs @@ -82,4 +82,8 @@ pub const TRAMPOLINE: usize = MAXVA - PGSIZE; pub const TRAPFRAME: usize = TRAMPOLINE - PGSIZE; +pub const MAP_END: usize = KERNEL_BASE - PGSIZE; +pub const MAP_START: usize = MAP_END - 128*1024*1024; + + diff --git a/kernel/src/arch/riscv/qemu/param.rs b/kernel/src/arch/riscv/qemu/param.rs index cfc117a..4a22a97 100755 --- a/kernel/src/arch/riscv/qemu/param.rs +++ b/kernel/src/arch/riscv/qemu/param.rs @@ -1,4 +1,4 @@ -pub const NPROC:usize = 64; // maximum number of processes +pub const NTASK:usize = 8; // maximum number of processes pub const NCPU:usize = 8; // maximum number of CPUs pub const NDEV:usize = 10; // maximum major device number pub const MAXARG:usize = 32; // max exec arguments diff --git a/kernel/src/arch/riscv/register/scause.rs b/kernel/src/arch/riscv/register/scause.rs index 0b8ab7a..5905d0a 100755 --- a/kernel/src/arch/riscv/register/scause.rs +++ b/kernel/src/arch/riscv/register/scause.rs @@ -120,6 +120,7 @@ impl Scause{ if self.is_interrupt() { Trap::Interrupt(Interrupt::from(self.code())) }else{ + Trap::Exception(Exception::from(self.code())) } } diff --git a/kernel/src/asm/switch.S b/kernel/src/asm/switch.S old mode 100644 new mode 100755 diff --git a/kernel/src/driver/console.rs b/kernel/src/driver/console.rs old mode 100644 new mode 100755 diff --git a/kernel/src/driver/plic.rs b/kernel/src/driver/plic.rs old mode 100644 new mode 100755 diff --git a/kernel/src/driver/virtio_disk.rs b/kernel/src/driver/virtio_disk.rs old mode 100644 new mode 100755 diff --git a/kernel/src/fs/bitmap.rs b/kernel/src/fs/bitmap.rs old mode 100644 new mode 100755 diff --git a/kernel/src/fs/devices.rs b/kernel/src/fs/devices.rs old mode 100644 new mode 100755 diff --git a/kernel/src/fs/dinode.rs b/kernel/src/fs/dinode.rs old mode 100644 new mode 100755 index 65d1fcc..057dbc4 --- a/kernel/src/fs/dinode.rs +++ b/kernel/src/fs/dinode.rs @@ -8,7 +8,8 @@ pub enum InodeType { Empty = 0, Directory = 1, File = 2, - Device = 3 + Device = 3, + FIFO = 4 } /// On-disk inode structure diff --git a/kernel/src/fs/file.rs b/kernel/src/fs/file.rs old mode 100644 new mode 100755 index 1145bcc..c8b4ce6 --- a/kernel/src/fs/file.rs +++ b/kernel/src/fs/file.rs @@ -3,6 +3,7 @@ use crate::arch::riscv::qemu::param::NDEV; use crate::lock::spinlock::Spinlock; use crate::lock::sleeplock::SleepLock; use crate::process::CPU_MANAGER; +// use crate::ipc::fifo::Fifo_t; use super::pipe::Pipe; use super::inode::Inode; use super::devices::DEVICE_LIST; @@ -17,11 +18,12 @@ use core::ptr::NonNull; #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u16)] pub enum FileType { - None = 0, - Pipe = 1, - Inode = 2, + None = 0, + Pipe = 1, + Inode = 2, Device = 3, Socket = 4, + Fifo = 5, } #[derive(Clone)] @@ -49,6 +51,7 @@ pub struct VFile { pub(crate) readable: bool, pub(crate) writeable: bool, pub(crate) pipe: Option<*mut Pipe>, + // pub(crate) fifo: Option<*mut Fifo_t>, pub(crate) inode: Option, pub(crate) offset: u32, pub(crate) major: i16 @@ -63,6 +66,7 @@ impl VFile { writeable: false, pipe: None, inode: None, + // fifo: None, offset: 0, major: 0 } @@ -80,11 +84,17 @@ impl VFile { match self.ftype { FileType::Pipe => { - let pipe = unsafe{ &*self.pipe.unwrap() }; + let pipe = unsafe{ &mut *self.pipe.unwrap() }; ret = pipe.read(addr, len)?; return Ok(ret) }, + // FileType::Fifo => { + // let fifo = unsafe{ &*self.fifo.unwrap() }; + // ret = fifo.read(addr, len)?; + // return Ok(ret) + // } + FileType::Device => { if self.major < 0 || self.major as usize >= NDEV || @@ -135,11 +145,19 @@ impl VFile { match self.ftype { FileType::Pipe => { - let pipe = unsafe{ &*self.pipe.unwrap() }; + let pipe = unsafe{ &mut *self.pipe.unwrap() }; + ret = pipe.write(addr, len)?; + // println!(")))"); Ok(ret) }, + // FileType::Fifo => { + // let fifo = unsafe{ &*self.fifo.unwrap() }; + // ret = fifo.write(addr, len)?; + // Ok(ret) + // }, + FileType::Device => { if self.major < 0 || self.major as usize >= NDEV || @@ -227,12 +245,8 @@ impl VFile { inode_guard.stat(&mut stat); drop(inode_guard); - // println!( - // "[Kernel] stat: dev: {}, inum: {}, nlink: {}, size: {}, type: {:?}", - // stat.dev, stat.inum, stat.nlink, stat.size, stat.itype - // ); - let pdata = p.data.get_mut(); - let page_table = pdata.pagetable.as_mut().unwrap(); + + let page_table = unsafe { &mut *p.pagetable }; page_table.copy_out(addr, (&stat) as *const Stat as *const u8, size_of::())?; Ok(()) }, diff --git a/kernel/src/fs/inode.rs b/kernel/src/fs/inode.rs old mode 100644 new mode 100755 index 010e183..f30c3eb --- a/kernel/src/fs/inode.rs +++ b/kernel/src/fs/inode.rs @@ -174,7 +174,7 @@ impl InodeCache { inode = self.get(ROOTDEV, ROOTINUM); } else { let p = unsafe { CPU_MANAGER.myproc().unwrap() }; - inode = self.dup(p.data.get_mut().cwd.as_ref().unwrap()); + inode = self.dup(p.cwd.as_ref().unwrap()); } let mut cur: usize = 0; loop { @@ -244,7 +244,7 @@ impl InodeCache { drop(dirinode_guard); let inode_guard = inode.lock(); match inode_guard.dinode.itype { - InodeType::Device | InodeType::File => { + InodeType::Device | InodeType::File | InodeType::FIFO => { if itype == InodeType::File { drop(inode_guard); return Ok(inode) diff --git a/kernel/src/fs/log.rs b/kernel/src/fs/log.rs old mode 100644 new mode 100755 diff --git a/kernel/src/fs/mod.rs b/kernel/src/fs/mod.rs index 8c26612..cb82435 100755 --- a/kernel/src/fs/mod.rs +++ b/kernel/src/fs/mod.rs @@ -23,6 +23,7 @@ pub use dinode::{ DiskInode, DirEntry, InodeType }; pub use superblock::{ SUPER_BLOCK, SuperBlock }; pub use devices::DEVICE_LIST; pub use pipe::Pipe; +// pub use pipe::PipeData; use log::Log; use bio::BufData; diff --git a/kernel/src/fs/pipe.rs b/kernel/src/fs/pipe.rs old mode 100644 new mode 100755 index d6877bf..b7be342 --- a/kernel/src/fs/pipe.rs +++ b/kernel/src/fs/pipe.rs @@ -8,157 +8,224 @@ use super::{FileType, VFile}; const PIPE_SIZE: usize = 512; #[repr(C)] pub struct Pipe { - guard: Spinlock -} - -#[repr(C)] -#[derive(Clone, Copy)] -struct PipeGuard { data: [u8; PIPE_SIZE], - /// number of bytes read - read_number: usize, - /// number of bytes written - write_number: usize, - /// read fd is still open + + nread: usize, + + nwrite: usize, + read_open: bool, - /// write fd is still open - write_open: bool + + write_open: bool, + + pub pipe_lock: Spinlock<()> } +// #[repr(C)] +// #[derive(Clone, Copy)] +// pub struct PipeData { +// data: [u8; PIPE_SIZE], +// /// number of bytes read +// read_number: usize, +// /// number of bytes written +// write_number: usize, +// /// read fd is still open +// read_open: bool, +// /// write fd is still open +// write_open: bool +// } + impl Pipe { - pub fn alloc(rf: &mut &mut VFile, wf: &mut &mut VFile) -> Self { - let pipe_guard = unsafe{ *PipeGuard::alloc() }; - let mut pipe = Self { - guard: Spinlock::new(pipe_guard, "pipe") - }; + pub fn init() -> *mut Pipe{ + let pipe_ptr = unsafe{ RawPage::new_zeroed() as *mut Pipe }; + let pipe = unsafe { &mut *pipe_ptr }; + pipe.read_open = true; + pipe.write_open = true; + pipe.nread = 0; + pipe.nwrite = 0; + pipe.pipe_lock = Spinlock::new((), "pipelock"); + + pipe_ptr + } + + pub unsafe fn alloc(rf: *mut *mut VFile, wf: *mut *mut VFile) -> *mut Pipe { + let pipe_ptr = unsafe{ RawPage::new_zeroed() as *mut Pipe }; + + // let pipedata = unsafe{ *PipeData::alloc() }; + // let mut pipe = Self { + // pipe: PipeData::alloc(), + // pipe_lock: Spinlock::new((), "pipe") + // }; + + let pipe = &mut *pipe_ptr; + pipe.read_open = true; + pipe.write_open = true; + pipe.nread = 0; + pipe.nwrite = 0; + pipe.pipe_lock = Spinlock::new((), "pipelock"); + **rf = VFile::init(); **wf = VFile::init(); - rf.ftype = FileType::Pipe; - rf.readable = true; - rf.writeable = false; - rf.pipe = Some(&mut pipe as *mut Pipe); - wf.ftype = FileType::Pipe; - wf.readable = false; - wf.writeable = true; - wf.pipe = Some(&mut pipe as *mut Pipe); - - pipe + (*(*rf)).ftype = FileType::Pipe; + (*(*rf)).readable = true; + (*(*rf)).writeable = false; + (*(*rf)).pipe = Some(pipe as *mut Pipe); + (*(*wf)).ftype = FileType::Pipe; + (*(*wf)).readable = false; + (*(*wf)).writeable = true; + (*(*wf)).pipe = Some(pipe as *mut Pipe); + + pipe_ptr } - pub fn read(&self, addr: usize, len: usize) -> Result { + pub fn read(&mut self, addr: usize, len: usize) -> Result { let my_proc = unsafe { CPU_MANAGER.myproc().ok_or("Fail to get my process")? }; - let mut pipe_guard = self.guard.acquire(); - while pipe_guard.read_number == pipe_guard.write_number && pipe_guard.write_open { + let mut guard = self.pipe_lock.acquire(); + // let pipe = unsafe { &mut *self.pipe }; + while self.nread == self.nwrite && self.write_open { // Pipe empty if my_proc.killed() { - drop(pipe_guard); + drop(guard); return Err("pipe read: current process has been killed") } // pipe read sleep + my_proc.sleep( - &pipe_guard.read_number as *const _ as usize, - pipe_guard + &self.nread as *const _ as usize, + guard ); - pipe_guard = self.guard.acquire(); + guard = self.pipe_lock.acquire(); } + // let mut i = 0; + // for index in 0..len { + // if pipe_guard.read_number == pipe_guard.write_number { break; } + // let read_cursor = pipe_guard.read_number % PIPE_SIZE; + // let ch = pipe_guard.data[read_cursor % PIPE_SIZE]; + // pipe_guard.read_number += 1; + // let pgt = unsafe { &mut *my_proc.pagetable }; + // if pgt.copy_out(addr + index, &ch as *const u8, 1).is_err() { + // break; + // } + // i = index; + // // pipe_guard.read_number += 1; + + // } + + let mut i = 0; - for index in 0..len { - if pipe_guard.read_number == pipe_guard.write_number { break; } - let read_cursor = pipe_guard.read_number % PIPE_SIZE; - let ch = pipe_guard.data[read_cursor % PIPE_SIZE]; - pipe_guard.read_number += 1; - let pgt = my_proc.page_table(); - if pgt.copy_out(addr + index, &ch as *const u8, 1).is_err() { + while i < len { + if self.nread == self.nwrite { break; } - i = index; + let ch = self.data[self.nread % PIPE_SIZE]; + self.nread += 1; + + let pgt = unsafe { &mut *my_proc.pagetable }; + if pgt.copy_out(addr + i, &ch as *const u8, 1).is_err() { + break; + } + i += 1; } - unsafe{ PROC_MANAGER.wake_up(&pipe_guard.write_number as *const _ as usize) }; - drop(pipe_guard); + unsafe{ PROC_MANAGER.wake_up(&self.nwrite as *const _ as usize) }; + drop(guard); Ok(i) } - pub fn write(&self, addr: usize, len: usize) -> Result { + pub fn write(&mut self, addr: usize, len: usize) -> Result { + let my_proc = unsafe { CPU_MANAGER.myproc().ok_or("Fail to get current process")? }; - - let mut pipe_guard = self.guard.acquire(); + // println!("$$$"); + + let mut guard = self.pipe_lock.acquire(); + // let pipe = unsafe { &mut *self.pipe }; let mut i = 0; + while i < len { - if !pipe_guard.read_open || my_proc.killed() { - drop(pipe_guard); + // println!("#{}", i); + if !self.read_open || my_proc.killed() { + drop(guard); return Err("pipe write: pipe read close or current process has been killed") } - - if pipe_guard.write_number == pipe_guard.read_number + PIPE_SIZE { + // println!("HEHE"); + + if self.nwrite == self.nread + PIPE_SIZE { + + unsafe { - PROC_MANAGER.wake_up(&pipe_guard.read_number as *const _ as usize); + PROC_MANAGER.wake_up(&self.nread as *const _ as usize); } - my_proc.sleep(&pipe_guard.write_number as *const _ as usize, pipe_guard); - pipe_guard = self.guard.acquire(); + my_proc.sleep(&self.nwrite as *const _ as usize, guard); + guard = self.pipe_lock.acquire(); } else { + let mut char: u8 = 0; - let pgt = my_proc.page_table(); + let pgt = unsafe { &mut *my_proc.pagetable }; if pgt.copy_in(&mut char as *mut u8, addr + i, 1).is_err() { break; } - let write_cursor = pipe_guard.write_number % PIPE_SIZE; - pipe_guard.data[write_cursor % PIPE_SIZE] = char; + let write_cursor = self.nwrite % PIPE_SIZE; + self.data[write_cursor] = char; + + self.nwrite += 1; i += 1; } } + + unsafe { - PROC_MANAGER.wake_up(&pipe_guard.read_number as *const _ as usize); + PROC_MANAGER.wake_up(&self.nread as *const _ as usize); } - drop(pipe_guard); - + drop(guard); + Ok(i) } - pub fn close(&self, writeable: bool) { - let mut pipe_guard = self.guard.acquire(); + pub fn close(&mut self, writeable: bool) { + let guard = self.pipe_lock.acquire(); + // let self = unsafe { &mut *self.self }; if writeable { - pipe_guard.write_open = false; + self.write_open = false; unsafe { - PROC_MANAGER.wake_up(&pipe_guard.read_number as *const _ as usize); + PROC_MANAGER.wake_up(&self.nread as *const _ as usize); } } else { - pipe_guard.read_open = false; + self.read_open = false; unsafe { - PROC_MANAGER.wake_up(&pipe_guard.write_number as *const _ as usize); + PROC_MANAGER.wake_up(&self.nwrite as *const _ as usize); } } - if !pipe_guard.read_open && !pipe_guard.write_open { - pipe_guard.free(); - drop(pipe_guard); + if !self.read_open && !self.write_open { + drop(guard); + drop(self); } else { - drop(pipe_guard); + drop(guard); } } } -impl PipeGuard { - fn alloc() -> *mut Self { - let pipe = unsafe{ RawPage::new_zeroed() as *mut PipeGuard }; - let pipe = unsafe{ &mut *pipe }; - pipe.read_number = 0; - pipe.write_number = 0; - pipe.read_open = true; - pipe.write_open = true; - pipe as *mut Self - } - - pub fn free(&mut self) { - unsafe { - drop_in_place(self as *const _ as *mut RawPage) - } - } -} +// impl PipeData { +// pub fn alloc() -> *mut Self { +// let pipe = unsafe{ RawPage::new_zeroed() as *mut PipeData }; +// let pipe = unsafe{ &mut *pipe }; +// pipe.read_number = 0; +// pipe.write_number = 0; +// pipe.read_open = true; +// pipe.write_open = true; +// pipe as *mut Self +// } + +// pub fn free(&mut self) { +// unsafe { +// drop_in_place(self as *const _ as *mut RawPage) +// } +// } +// } diff --git a/kernel/src/fs/stat.rs b/kernel/src/fs/stat.rs old mode 100644 new mode 100755 diff --git a/kernel/src/fs/superblock.rs b/kernel/src/fs/superblock.rs old mode 100644 new mode 100755 diff --git a/kernel/src/ipc/bitmap.rs b/kernel/src/ipc/bitmap.rs new file mode 100644 index 0000000..53254e5 --- /dev/null +++ b/kernel/src/ipc/bitmap.rs @@ -0,0 +1,96 @@ +use crate::{lock::spinlock::Spinlock, memory::{ RawPage, PageAllocator }, process::{CPU, CPU_MANAGER, PROC_MANAGER}}; +use crate::arch::riscv::qemu::layout::*; + +use core::sync::atomic::{AtomicI32, Ordering, fence}; +use core::ptr::drop_in_place; +use array_macro::array; + + + +pub const SHARE_MEM_AREA_SIZE: usize = 4*1024*1024; + + +pub const SHARE_MEM_MAP_PAGES: usize = SHARE_MEM_AREA_SIZE/(PGSIZE); +pub const SHARE_MEM_BIT_MAP_SIZE: usize = SHARE_MEM_MAP_PAGES/8+1; + + +pub struct BitMap{ + bitmap: [u8; SHARE_MEM_BIT_MAP_SIZE] +} + +impl BitMap{ + pub fn page_to_addr(page: usize) -> usize{ + return MAP_START + page * PGSIZE; + } + + pub fn addr_to_page(addr: usize) -> usize{ + if addr < MAP_START || addr > MAP_END { + panic!("OUT OF MAP RANGE"); + } + + return (addr - MAP_START) / PGSIZE; + } + + pub fn get_bit(&self, page: usize) -> usize { + let index = page / 8; + let bit = (self.bitmap[index] >> (page % 8)) & 1; + return bit as usize; + } + + pub fn set_bit(&mut self, page: usize, bit: usize){ + if bit == 1 { + self.bitmap[page / 8] = self.bitmap[page / 8] | (1 << (page % 8)); + }else{ + self.bitmap[page / 8] = self.bitmap[page / 8] & !(1 << (page % 8)); + } + } + + pub fn set_nbits(&mut self, page: usize, num: usize, bit: usize){ + for i in 0..num { + self.set_bit(page + i, bit); + } + } + + pub fn get_unmapped_addr(&mut self, npages: usize) -> usize{ + let mut flag = false; + let mut i: usize = 0; + let mut j: usize = 0; + let mut cnt: usize = 0; + + + for idx in 0..SHARE_MEM_MAP_PAGES { + if self.get_bit(idx) == 1 { + continue; + } + + i = idx; + + j = i; + cnt = 0; + + while self.get_bit(j) == 0{ + j += 1; + cnt += 1; + + if cnt >= npages { + flag = true; + break; + } + } + + if flag == true{ + break; + } + } + + if flag == true { + self.set_nbits(i, npages, 1); + return BitMap::page_to_addr(i); + }else{ + return 0; + } + } + + +} + diff --git a/kernel/src/ipc/fifo.rs b/kernel/src/ipc/fifo.rs new file mode 100644 index 0000000..f374c0e --- /dev/null +++ b/kernel/src/ipc/fifo.rs @@ -0,0 +1,176 @@ +use crate::{lock::spinlock::Spinlock, memory::{ RawPage, PageAllocator }, process::{CPU, CPU_MANAGER, PROC_MANAGER}}; +use crate::fs::{FileType, VFile}; +use crate::fs::Pipe; +use core::ptr::drop_in_place; + + +use array_macro::array; + +pub const NAME_LEN: usize = 24; +pub const N_FIFOS: usize = 64; + + +pub struct Fifo_t { + pub pipe: Option<*mut Pipe>, + pub name: [u8; NAME_LEN], + pub used: bool, + pub ID: usize +} + +// pub struct SemTable{ +// sems: [sem_t; N_SEM], +// st_lock: Spinlock<()>, +// semID: i32, +// } + +// pub static mut SEM_MANAGER: SemTable = SemTable::new(); + + +impl Fifo_t { + pub const fn new() -> Self { + Fifo_t{ + pipe: None, + name: [0; NAME_LEN], + used: false, + ID: 0 + } + } + + // pub fn alloc(s: [u8; NAME_LEN]) -> Self { + // let pipe_guard = unsafe{ *PipeGuard::alloc() }; + // let mut pipe = Pipe { + // guard: Spinlock::new(pipe_guard, "pipe") + // }; + // Fifo_t{ + // fifo: Some(&mut pipe as *mut Pipe), + // name: s + // } + // } + + pub fn read(& self, addr: usize, len: usize) -> Result { + let pipe = unsafe{&mut *self.pipe.unwrap()}; + + println!("In Fifo_t read"); + pipe.read(addr, len) + } + + pub fn write(&self, addr: usize, len: usize) -> Result { + let pipe = unsafe{&mut *self.pipe.unwrap()}; + + println!("In Fifo_t write"); + pipe.write(addr, len) + } + + pub fn close(&self){ + let pipe = unsafe{&mut *self.pipe.unwrap()}; + + println!("In Fifo_t close"); + pipe.close(true); + pipe.close(false); + + drop(self); + } + + +} + + +pub struct FifoTable{ + fifos: [Fifo_t; N_FIFOS], + fifos_lock: Spinlock<()>, + fifoID: usize +} + +pub static mut FIFO_MANAGER: FifoTable = FifoTable::new(); + +impl FifoTable { + pub const fn new() -> Self { + Self{ + fifos: array![_ => Fifo_t::new(); N_FIFOS], + fifos_lock: Spinlock::new((), "fifos_lock"), + fifoID: 5 + } + } + + pub fn alloc(&mut self, s: [u8; NAME_LEN]) -> Option{ + + let pipe = Pipe::init(); + + // let pipe_guard = unsafe{ *PipeGuard::alloc() }; + // let mut pipe = Self { + // guard: Spinlock::new(pipe_guard, "pipe") + // }; + + let guard = self.fifos_lock.acquire(); + + + for fifo_iter in self.fifos.iter_mut() { + if fifo_iter.used == false { + + fifo_iter.pipe = Some(pipe); + fifo_iter.name = s; + fifo_iter.used = true; + fifo_iter.ID = self.fifoID; + self.fifoID += 1; + + drop(guard); + return Some(fifo_iter.ID); + } + } + drop(guard); + None + } + + pub fn get(&mut self, name: [u8; NAME_LEN]) -> Option { + let fifo_guard = self.fifos_lock.acquire(); + + // let fifo_ret: &mut Fifo_t; + for fifo_iter in self.fifos.iter_mut() { + if fifo_iter.name == name { + + println!("In FifoTable get, the id is {}", fifo_iter.ID); + drop(fifo_guard); + return Some(fifo_iter.ID); + } + } + drop(fifo_guard); + None + } + + pub fn getByID(&mut self, id: usize) -> Option<*mut Fifo_t>{ + let guard = self.fifos_lock.acquire(); + for it in self.fifos.iter_mut() { + if it.ID == id { + drop(guard); + return Some(it as *mut Fifo_t); + } + } + drop(guard); + None + } + + pub fn put(&mut self, id: usize) -> Option{ + let fifo_guard = self.fifos_lock.acquire(); + + for fifo_iter in self.fifos.iter_mut() { + if fifo_iter.ID == id { + + fifo_iter.close(); + + fifo_iter.pipe = None; + fifo_iter.name = [0; NAME_LEN]; + fifo_iter.used = false; + fifo_iter.ID = 0; + + println!("In FifoTable put, the id is {}", id); + + drop(fifo_guard); + return Some(0); + } + } + drop(fifo_guard); + None + } +} + + diff --git a/kernel/src/ipc/mod.rs b/kernel/src/ipc/mod.rs new file mode 100644 index 0000000..966a03e --- /dev/null +++ b/kernel/src/ipc/mod.rs @@ -0,0 +1,5 @@ +pub mod semaphore; +pub mod fifo; +pub mod msgqueue; +pub mod sharemem; +pub mod bitmap; \ No newline at end of file diff --git a/kernel/src/ipc/msgqueue.rs b/kernel/src/ipc/msgqueue.rs new file mode 100644 index 0000000..e159afc --- /dev/null +++ b/kernel/src/ipc/msgqueue.rs @@ -0,0 +1,229 @@ +use crate::{lock::spinlock::Spinlock, memory::{ RawPage, PageAllocator }, process::{CPU, CPU_MANAGER, PROC_MANAGER}}; +use crate::fs::{FileType, VFile}; + +use crate::fs::Pipe; +use core::ptr::{drop_in_place, null_mut, null}; +use array_macro::array; + +use alloc::{boxed::Box, sync::Arc}; + + +pub const MSG_LEN: usize = 128; + +struct msg { + data: [u8; MSG_LEN], + dataID: usize, + flags: usize, + + next: *mut msg +} + +impl msg { + + pub fn init() -> *mut msg{ + let boxMsg: Box = unsafe { Box::new_zeroed().assume_init() }; + let pmsg = Box::into_raw(boxMsg); + let msg = unsafe {&mut *pmsg }; + + msg.dataID = 0; + msg.next = null_mut(); + msg.flags = 0; + + pmsg + } + + pub fn new(_data: [u8; MSG_LEN], _id: usize, _flags: usize) -> Self{ + Self { + data: _data, + dataID: _id, + flags: _flags, + + next: null_mut() + } + } + + pub fn free(&mut self){ + drop(self); + } +} + +struct msgque { + pmsgHead: *mut msg, + pmsgTail: *mut msg, + id: usize, + name: [u8; 16], + used: bool, + lock: Spinlock<()>, + +} + +impl msgque { + pub const fn new() -> Self{ + Self{ + pmsgHead: null_mut(), + pmsgTail: null_mut(), + id: 0, + name: [0; 16], + used: false, + lock: Spinlock::new((), "Msgqueue Lock") + } + } + + pub fn write(&mut self, addr: usize, len: usize){ + let pmsg = msg::init(); + let msg = unsafe {&mut *pmsg }; + + let curTask = unsafe { CPU_MANAGER.myproc().unwrap() }; + let pgt = unsafe {&mut *curTask.pagetable }; + + let dst = &mut msg.data as *mut u8; + + pgt.copy_in(dst, addr, len); + + + let guard = self.lock.acquire(); + if self.pmsgHead == null_mut() && self.pmsgTail == null_mut() { + self.pmsgHead = pmsg; + self.pmsgTail = pmsg; + }else{ + let tail = unsafe {&mut *self.pmsgTail }; + tail.next = pmsg; + self.pmsgTail = pmsg; + } + drop(guard); + } + + pub fn read(&mut self, addr: usize, len: usize){ + let curTask = unsafe { CPU_MANAGER.myproc().unwrap() }; + let pgt = unsafe {&mut *curTask.pagetable }; + + let pmsg = self.pmsgHead; + let msg = unsafe{&mut *pmsg }; + let dst = &mut msg.data as *mut u8; + + pgt.copy_out(addr, dst, len); + + let guard = self.lock.acquire(); + + let next = msg.next; + self.pmsgHead = next; + + msg.free(); + + drop(guard); + } + +} + +pub const N_MSG_QUEUES: usize = 16; +pub static mut msgQueueID: usize = 1; + +pub static mut MSG_QUE_MANAGER: MsgQueManager = MsgQueManager::new(); +pub struct MsgQueManager { + msg_queues: [msgque; N_MSG_QUEUES], + lock: Spinlock<()> +} + +impl MsgQueManager{ + pub const fn new() -> Self{ + Self{ + msg_queues: array![_=> msgque::new(); N_MSG_QUEUES], + lock: Spinlock::new((), "Msg Queue Lock") + } + } + + pub fn alloc(&mut self, name: [u8; 16]) -> Option { + let guard = self.lock.acquire(); + + let mut ret: usize = 0; + for i in 0..N_MSG_QUEUES { + let msg_q = &mut self.msg_queues[i]; + if msg_q.used == false { + + unsafe { + msg_q.id = msgQueueID; + msgQueueID += 1; + } + + msg_q.name = name; + msg_q.used = true; + + ret = msg_q.id; + + drop(guard); + return Some(ret); + } + } + + drop(guard); + None + } + + pub fn get(&mut self, name: [u8; 16]) -> Option { + let guard = self.lock.acquire(); + + let mut ret: usize = 0; + for i in 0..N_MSG_QUEUES { + let msg_q = &mut self.msg_queues[i]; + if msg_q.name == name { + + ret = msg_q.id; + + drop(guard); + return Some(ret); + } + } + + drop(guard); + None + } + + // Borrow twice !!!! TODO + + pub fn getMsgQueByID(id: usize) -> usize{ + let mq_manager = unsafe { &mut MSG_QUE_MANAGER }; + let guard = mq_manager.lock.acquire(); + + let mut ret: usize = N_MSG_QUEUES + 1; + for i in 0..N_MSG_QUEUES { + let msg_q = &mut mq_manager.msg_queues[i]; + if msg_q.id == id { + + ret = i; + drop(guard); + return ret; + } + } + + drop(guard); + ret + } + + pub fn write(&mut self, id: usize, addr: usize, len: usize) -> Option{ + let index = MsgQueManager::getMsgQueByID(id); + let mq = unsafe { &mut MSG_QUE_MANAGER.msg_queues[index] }; + mq.write(addr, len); + + Some(0) + } + + pub fn read(&mut self, id: usize, addr: usize, len: usize) -> Option { + let index = MsgQueManager::getMsgQueByID(id); + let mq = unsafe { &mut MSG_QUE_MANAGER.msg_queues[index] }; + mq.read(addr, len); + + Some(0) + } + + pub fn put(&mut self, id: usize){ + let index = MsgQueManager::getMsgQueByID(id); + let mq = unsafe { &mut MSG_QUE_MANAGER.msg_queues[index] }; + + // mq.name = [0; 16]; + // mq.pmsgHead = null_mut(); + // mq.pmsgTail = null_mut(); + } +} + + + diff --git a/kernel/src/ipc/semaphore.rs b/kernel/src/ipc/semaphore.rs new file mode 100644 index 0000000..09a2c6b --- /dev/null +++ b/kernel/src/ipc/semaphore.rs @@ -0,0 +1,205 @@ +use crate::{lock::spinlock::Spinlock, memory::{ RawPage, PageAllocator }, process::{CPU, CPU_MANAGER, PROC_MANAGER}}; +use core::sync::atomic::{AtomicI32, Ordering, fence}; +use core::ptr::drop_in_place; +use array_macro::array; +// pub struct semaphore { +// counter : AtomicI32, + +// } + +// impl semaphore { +// pub fn new(cnt: i32) -> Self{ +// let sem = AtomicI32::new(cnt); +// sem +// } +// pub fn semaphore_down(&self){ +// let cnt = self.counter.load(Ordering::Relaxed); +// if cnt > 0 { +// self.counter.fetch_sub(1, Ordering::Relaxed); +// }else{ +// let my_proc = unsafe { +// CPU_MANAGER.myproc().ok_or("Fail to get my process")? +// }; +// my_proc.sleep( +// &pipe_guard.read_number as *const _ as usize, +// pipe_guard +// ); +// } +// } +// } + +pub const N_SEM: usize = 128; + +pub struct semaphore{ + cnt: i32, + sem_lock: Spinlock<()>, +} + +impl semaphore{ + pub const fn new(value: i32) -> Self{ + Self{ + cnt: value, + sem_lock: Spinlock::new((), "sem_lock"), + } + } + pub fn semaphore_down(&mut self){ + println!("semaphore down"); + let guard = self.sem_lock.acquire(); + self.cnt -= 1; + drop(guard); + } + pub fn semaphore_up(&mut self){ + let guard = self.sem_lock.acquire(); + self.cnt += 1; + drop(guard); + } + + pub fn get_value(&self) -> i32{ + self.cnt + } +} + +pub struct sem_t{ + sem: semaphore, + used: bool, + + id: i32, + // sem_lock: Spinlock, +} + +impl sem_t{ + pub const fn new(cnt: i32) -> Self{ + sem_t{ + sem: semaphore::new(cnt), + used: false, + id: -1, + // sem_lock: Spinlock::new(0, "Nope"), + } + } + + pub fn sem_init(&mut self, cnt: i32) -> i32{ + println!("sem_init in semaphore.rs"); + let sem_guard = self.sem.sem_lock.acquire(); + self.sem.cnt = cnt; + drop(sem_guard); + 0 + } + + pub fn sem_down(&mut self){ + while self.sem.get_value() <= 0{ + + let my_proc = unsafe { CPU_MANAGER.myproc().unwrap() }; + let sem_guard = self.sem.sem_lock.acquire(); + println!("ready to sleep {} {} {} {}", &self.id, &self.sem.cnt, &self.sem as *const _ as usize, &sem_guard as *const _ as usize); + // println!("SEM_MANAGER in sem_down {}",unsafe{&SEM_MANAGER.sems as *const _ as usize}); + my_proc.sleep( + &self.sem as *const _ as usize, + sem_guard + ); + } + println!("sem down"); + self.sem.semaphore_down(); + } + + pub fn sem_up(&mut self){ + println!("sem up"); + self.sem.semaphore_up(); + if self.sem.get_value() > 0{ + let sem_guard = self.sem.sem_lock.acquire(); + unsafe { + PROC_MANAGER.wake_up(&self.sem as *const _ as usize); + } + println!("wake up in semaphore.rs {} {} {} {}", &self.id, &self.sem.cnt, &self.sem as *const _ as usize, &sem_guard as *const _ as usize); + // println!("SEM_MANAGER in sem_down {}",unsafe{&SEM_MANAGER.sems as *const _ as usize}); + } + } +} + +pub struct SemTable{ + sems: [sem_t; N_SEM], + st_lock: Spinlock<()>, + semID: i32, +} + +pub static mut SEM_MANAGER: SemTable = SemTable::new(); + +impl SemTable{ + pub const fn new() -> Self{ + Self{ + sems: array![_ => sem_t::new(0); N_SEM], + st_lock: Spinlock::new((), "st_lock"), + semID: 36 + } + + // let semsTmp = array![_ => sem_t::new(0); N_SEM]; + // let mut id = 0; + // for sem in semsTmp.iter_mut(){ + // sem.id = id; + // id += 1; + // } + + // Self{ + // sems: semsTmp, + // st_lock: Spinlock::new((), "st_lock") + // } + } + pub fn alloc(&mut self) -> i32{ + println!("sem alloc"); + let st_guard = self.st_lock.acquire(); + let mut resId = 0; + for sem in self.sems.iter_mut(){ + if sem.used == false{ + sem.id = self.semID; + self.semID += 1; + resId = sem.id; + sem.used = true; + + println!("alloc in semaphore.rs, find one unused {}", resId); + break; + } + } + drop(st_guard); + resId + } + + pub fn get(&mut self, id: i32) -> i32{ + + if id == -1{ + println!("sem alloc in semaphore.rs"); + self.alloc() + }else{ + let mut res = -1; + for sem in self.sems.iter_mut(){ + if sem.id == id{ + res = id; + } + } + println!("sem get in semaphore.rs {}", res); + res + } + } + + pub fn put(&mut self, id: i32) -> i32{ + println!("sem put"); + let mut res = -1; + for sem in self.sems.iter_mut(){ + if sem.id == id{ + sem.used = false; + res = 0; + } + } + res + } + + pub fn getSemById(&mut self, id: i32) -> Option<&mut sem_t>{ + println!("sem find"); + // let mut semRes: &mut sem_t; + for sem in self.sems.iter_mut(){ + if sem.id == id{ + println!("sem find !!!!{}", id); + return Some(sem) + } + } + None + } +} diff --git a/kernel/src/ipc/sharemem.rs b/kernel/src/ipc/sharemem.rs new file mode 100644 index 0000000..8621e63 --- /dev/null +++ b/kernel/src/ipc/sharemem.rs @@ -0,0 +1,268 @@ +use crate::{lock::spinlock::Spinlock, memory::{ RawPage, PageAllocator, VirtualAddress, PhysicalAddress, page_round_up }, process::{CPU, CPU_MANAGER, PROC_MANAGER}}; +use crate::fs::{FileType, VFile}; +use core::ptr::{drop_in_place, null_mut, null}; +use array_macro::array; +use alloc::{boxed::Box, sync::Arc}; +use crate::arch::riscv::qemu::layout::{ PGSIZE }; +use crate::memory::page_table_entry::*; +use super::bitmap::*; + + + +pub const SHARE_MEM_TYPE_NR: usize = 64; +pub const MAX_NAME_LEN: usize = 20; + + +pub const SHARE_MEM_PRIVATE_FLAG: usize = 0x01; + + +pub const IPC_CREATE: usize = 0x1; +pub const IPC_EXCL: usize = 0x2; + +struct ShareMem{ + id: usize, + used: bool, + vaddr: usize, + paddr: usize, + npages: usize, + flags: usize, + links: usize, + name: [u8; MAX_NAME_LEN], + + lock: Spinlock<()> +} + +impl ShareMem { + pub const fn new() -> Self{ + Self{ + id: 0, + used: false, + vaddr: 0, + paddr: 0, + npages: 0, + flags: 0, + links: 0, + name: [0; MAX_NAME_LEN], + lock: Spinlock::new((), "Share Mem Lock") + } + } + + pub fn reset(&mut self){ + self.id = 0; + self.flags = 0; + self.used = false; + self.vaddr = 0; + self.paddr = 0; + self.npages = 0; + self.links = 0; + self.name = [0; MAX_NAME_LEN]; + } + + + //TODO npages, memory management + pub fn free(&mut self){ + if self.paddr != 0 { + let mut pa = self.paddr; + for i in 0..self.npages { + unsafe { drop_in_place(pa as *mut RawPage) }; + pa += PGSIZE; + } + + } + + self.reset(); + } + + pub unsafe fn map(&mut self, shmaddr: usize, flags: usize) -> Option { + let task = CPU_MANAGER.myproc().unwrap(); + let pgt = &mut *task.pagetable ; + + if shmaddr == 0 { + + let bitmap = &mut *task.sharemem_bitmap; + let vaddr = bitmap.get_unmapped_addr(self.npages); + self.vaddr = vaddr; + + if self.paddr == 0 { + let paddr = RawPage::new_zeroed(); + self.paddr = paddr; + + + pgt.map(VirtualAddress::new(vaddr), + PhysicalAddress::new(paddr), + PGSIZE, + PteFlags::W | PteFlags::R | PteFlags::U); + + //TODO npages + } else { + pgt.map(VirtualAddress::new(self.vaddr), + PhysicalAddress::new(self.paddr), + PGSIZE, + PteFlags::W | PteFlags::R | PteFlags::U); + } + }else{ + //TODO fixed mapping addr + } + + self.links += 1; + + //TODO error situation + Some(self.vaddr) + } + + //TODO directly use paddr? + pub unsafe fn unmap(&mut self){ + let task = CPU_MANAGER.myproc().unwrap(); + let pgt = &mut *task.pagetable ; + + let mut vaddr = self.vaddr; + for i in 0..self.npages{ + let pte = pgt.translate(VirtualAddress::new(vaddr)).unwrap(); + + //TODO Check exist + pte.0 = 0; + + vaddr += PGSIZE; + } + + + + let bitmap = &mut *task.sharemem_bitmap; + bitmap.set_nbits(BitMap::addr_to_page(self.vaddr), self.npages, 0); + + self.links -= 1; + //TODO return value + } +} + + +pub struct ShareMemManager{ + shares: [ShareMem; SHARE_MEM_TYPE_NR], + lock: Spinlock<()> +} + +static mut nextID: usize = 1; + +pub static mut SHARE_MEM_MANAGER: ShareMemManager = ShareMemManager::new(); + +impl ShareMemManager{ + pub const fn new() -> Self { + Self{ + shares: array![_=>ShareMem::new(); SHARE_MEM_TYPE_NR], + lock: Spinlock::new((), "Share Mem Manager Lock") + } + } + + pub fn alloc(&mut self, name:[u8; MAX_NAME_LEN], size: usize) -> Option { + let guard = self.lock.acquire(); + for i in 0..SHARE_MEM_TYPE_NR { + let sharemem = &mut self.shares[i]; + if sharemem.used == true { + continue; + }else{ + sharemem.used = true; + sharemem.name = name; + unsafe { + sharemem.id = nextID; + nextID += 1; + } + let sz = page_round_up(size); + sharemem.npages = sz / PGSIZE; + + drop(guard); + return Some(sharemem.id); + } + } + + drop(guard); + Some(0) + } + + pub fn getShareIndexByName(&mut self, name: [u8; MAX_NAME_LEN]) -> Option { + for i in 0..SHARE_MEM_TYPE_NR { + let sharemem = &mut self.shares[i]; + if sharemem.used == true && sharemem.name == name { + return Some(i); + } + } + None + } + + pub fn getShareIndexByID(&mut self, id: usize) -> Option { + for i in 0..SHARE_MEM_TYPE_NR { + let sharemem = &mut self.shares[i]; + if sharemem.used == true && sharemem.id == id { + return Some(i); + } + } + + None + } + + pub fn map(&mut self, id: usize, shmaddr: usize, shmflag: usize) -> Option{ + let idxOption = self.getShareIndexByID(id); + match idxOption { + Some(idx) => { + let sharemem = &mut self.shares[idx]; + unsafe { sharemem.map(shmaddr, shmflag) } + } + + None => None + } + } + + pub fn unmap(&mut self, id: usize) -> Option { + let idxOption = self.getShareIndexByID(id); + match idxOption { + Some(idx) => { + let sharemem = &mut self.shares[idx]; + unsafe { sharemem.unmap() }; + Some(0) + } + + None => None + } + } + + pub fn get(&mut self, name: [u8; MAX_NAME_LEN], size: usize, flags: usize) -> Option { + if name == [0; MAX_NAME_LEN] { + return None; + } + if size > 0 && page_round_up(size) >= SHARE_MEM_AREA_SIZE { + return None; + } + + println!("In mana get, size: {}, flag: {}", size, flags); + + if flags & IPC_CREATE != 0 { + let idOption = self.alloc(name, size); + return idOption; + }else{ + + let idxOption = self.getShareIndexByName(name); + match idxOption { + Some(idx) => { + let id = self.shares[idx].id; + Some(id) + } + None => { + None + } + } + } + } + + pub fn put(&mut self, id: usize) -> Option { + let idxOption = self.getShareIndexByID(id); + match idxOption { + Some(idx) => { + let sharemem = &mut self.shares[idx]; + sharemem.free(); + Some(0) + } + None => { + None + } + } + } +} \ No newline at end of file diff --git a/kernel/src/linker/k210.ld b/kernel/src/linker/k210.ld old mode 100644 new mode 100755 diff --git a/kernel/src/lock/spinlock.rs b/kernel/src/lock/spinlock.rs index eb31a0a..64138be 100755 --- a/kernel/src/lock/spinlock.rs +++ b/kernel/src/lock/spinlock.rs @@ -35,6 +35,7 @@ impl Spinlock{ if self.holding() { panic!("spinlock {} acquire", self.name); } + while self.locked.swap(true, Ordering::Acquire){ // Now we signals the processor that it is inside a busy-wait spin-loop diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 77ea33f..474871a 100755 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -48,6 +48,7 @@ mod driver; mod net; mod misc; mod trap; +mod ipc; use core::sync::atomic::{ AtomicBool, Ordering }; diff --git a/kernel/src/memory/mapping/page_table.rs b/kernel/src/memory/mapping/page_table.rs index c59b5b6..1a5cccb 100755 --- a/kernel/src/memory/mapping/page_table.rs +++ b/kernel/src/memory/mapping/page_table.rs @@ -60,24 +60,96 @@ impl PageTable{ /// Recursively free page-table pages. /// All leaf mappings must already have been removed. - pub fn free(&mut self) { + pub fn free_pagetable(&mut self) { // there are 2^9 = 512 PTEs in a pagetable for i in 0..self.entries.len() { - let pte = self.entries[i]; + let pte = &mut self.entries[i]; if pte.is_valid() && !pte.is_leaf() { // this PTE points to a lower-level page. unsafe { let child_pgt = &mut *(pte.as_pagetable()); - child_pgt.free(); + child_pgt.free_pagetable(); } - self.entries[i] = PageTableEntry::new(0); - } else if pte.is_valid() { - panic!("pagetable free(): leaf not be removed"); + self.entries[i].0 = 0; + // pte.free(); + } + //TODO BUG TRAPONLINE Don't need free, + else if pte.is_valid() && pte.is_leaf() { + // panic!("pagetable free(): leaf not be removed {} ", pte.0); } } drop(self); } + pub fn copy_pagetable(&mut self, pgt_b: &mut Self){ + for i in 0..self.entries.len(){ + let pte_a = &mut self.entries[i]; + let pte_b = &mut pgt_b.entries[i]; + let pte_flag_a = pte_a.as_flags(); + if pte_a.is_valid() && !pte_a.is_leaf() { + let zeroed_pgt: Box = unsafe { Box::new_zeroed().assume_init() }; + let child_pgt_b = Box::into_raw(zeroed_pgt); + pte_b.0 = ((child_pgt_b as usize >> 12) << 10) | pte_flag_a; + + let child_pgt_a = unsafe { &mut *(pte_a.as_pagetable()) }; + child_pgt_a.copy_pagetable( unsafe {&mut *child_pgt_b} ); + }else if pte_a.is_valid() { + pte_b.0 = pte_a.0; + } + } + } + + pub fn copy_pagetable_rmW(&mut self, pgt_b: &mut Self){ + for i in 0..self.entries.len(){ + let pte_a = &mut self.entries[i]; + let pte_b = &mut pgt_b.entries[i]; + let pte_flag_a = pte_a.as_flags(); + if pte_a.is_valid() && !pte_a.is_leaf() { + let zeroed_pgt: Box = unsafe { Box::new_zeroed().assume_init() }; + let child_pgt_b = Box::into_raw(zeroed_pgt); + pte_b.0 = ((child_pgt_b as usize >> 12) << 10) | pte_flag_a; + + let child_pgt_a = unsafe { &mut *(pte_a.as_pagetable()) }; + child_pgt_a.copy_pagetable( unsafe {&mut *child_pgt_b} ); + }else if pte_a.is_valid() { + // pte_b.0 = pte_a.0; + pte_b.rm_W_bit(); + pte_a.rm_W_bit(); + } + } + } + + + + pub unsafe fn print_pagetable(&mut self) { + for i in 0..self.entries.len(){ + let pte_1 = &mut self.entries[i]; + + if pte_1.is_valid(){ + println!("{}--{:x}", i, (*pte_1.as_pagetable()).as_addr()); + + let pgt_2 = unsafe { &mut *pte_1.as_pagetable() }; + for j in 0..pgt_2.entries.len(){ + let pte_2 = &mut pgt_2.entries[j]; + + if pte_2.is_valid() { + println!(" {}--{}", j, (*pte_2.as_pagetable()).as_addr()); + + let pgt_3 = unsafe { &mut *pte_2.as_pagetable() }; + for k in 0..pgt_3.entries.len(){ + let pte_3 = &mut pgt_3.entries[k]; + + if pte_3.is_valid(){ + println!(" {}--{}", k, (*pte_3.as_pagetable()).as_addr()); + } + } + } + } + } + } + } + + /// Return the address of the PTE in page table pagetable /// that corresponds to virtual address va. If alloc!=0, /// create any required page-table pages. @@ -95,7 +167,7 @@ impl PageTable{ /// or 0 if not mapped. /// Can only be used to look up user pages. /// 将虚拟地址翻译成物理地址,返回页表项 - fn translate( + pub fn translate( &mut self, va: VirtualAddress ) -> Option<&mut PageTableEntry> { @@ -235,8 +307,10 @@ impl PageTable{ /// Create an empty user page table. /// return None if out of memory - pub unsafe fn uvmcreate() -> Box{ - Box::new_zeroed().assume_init() + pub unsafe fn uvmcreate() -> *mut PageTable{ + let pagetable: Box = Box::new_zeroed().assume_init(); + let ptr = Box::into_raw(pagetable); + ptr } /// Load the user initcode into address 0 of pagetable @@ -302,11 +376,11 @@ impl PageTable{ let ppn = pa.as_usize() / PGSIZE; self.uvm_unmap( VirtualAddress::new(0), - ppn, + ppn, true ); } - drop(self); + // drop(self); } @@ -353,15 +427,21 @@ impl PageTable{ for _ in 0..npages { match self.translate(va) { Some(pte) => { + // TO DO !!!!!!!!!!!! is valid check ? + if !pte.is_valid() { panic!("uvm_unmap: not mapped"); } + if !pte.is_leaf() { + panic!("IS NOT LEAF"); + } if pte.as_flags() == PteFlags::V.bits() { panic!("uvm_unmap: not a leaf"); } if free { let pa = pte.as_pagetable(); unsafe{ drop_in_place(pa) }; + pte.0 = 0; } }, @@ -427,6 +507,68 @@ impl PageTable{ Ok(()) } + pub unsafe fn uvm_cow( + &mut self, + child_pgt: &mut Self, + size: usize + ) -> Result<(), &'static str> { + let mut va = VirtualAddress::new(0); + while va.as_usize() != size { + match self.translate(va) { + Some(pte) => { + if !pte.is_valid() { + panic!("uvmcopy(): page not present"); + } + + let page_table = pte.as_pagetable(); + let flags = pte.as_flags(); + let flags = PteFlags::new(flags); + + // COW Don't need copy uvm + + // let allocated_pgt = &mut *(RawPage::new_zeroed() as *mut PageTable); + // allocated_pgt.write(& *page_table); + + // println!("uvm_copy: va: 0x{:x}", va.as_usize()); + + let pa = (&mut *page_table).as_addr(); + + if !child_pgt.map( + va, + PhysicalAddress::new(pa), + PGSIZE, + flags + ) { + // drop(allocated_pgt); + // child_pgt.uvm_unmap( + // VirtualAddress::new(0), + // va.as_usize() / PGSIZE, + // true + // ); + return Err("uvmcopy: Fail.") + } + }, + + None => { + panic!("uvmcopy: No exist pte(pte should exist)"); + } + } + + //set pte Only Read + let pte_parent = self.translate(va).unwrap(); + let pte_child = child_pgt.translate(va).unwrap(); + pte_parent.rm_W_bit(); + pte_child.rm_W_bit(); + + + va.add_page(); + } + + Ok(()) + } + + + /// mark a PTE invalid for user access. /// used by exec for the user stack guard page. pub fn uvm_clear(&mut self, va: VirtualAddress) { @@ -604,6 +746,7 @@ impl PageTable{ ); self.uvm_free(size); + // self.free(); } } diff --git a/kernel/src/memory/mapping/page_table_entry.rs b/kernel/src/memory/mapping/page_table_entry.rs index ad01e4a..bf09546 100755 --- a/kernel/src/memory/mapping/page_table_entry.rs +++ b/kernel/src/memory/mapping/page_table_entry.rs @@ -22,7 +22,7 @@ bitflags!{ const X = PTE_X; const U = PTE_U; } - + } impl PteFlags { @@ -94,11 +94,33 @@ impl PageTableEntry{ Self(pte) } + pub fn add_W_bit(&self) -> Self { + let pte = self.as_usize() | (PteFlags::W.bits()); + Self(pte) + } + + pub fn add_R_bit(&self) -> Self { + let pte = self.as_usize() | (PteFlags::R.bits()); + Self(pte) + } + #[inline] pub fn rm_user_bit(&mut self) { self.0 &= !(PteFlags::U.bits()); } + pub fn rm_W_bit(&mut self){ + self.0 &= !(PteFlags::W.bits()); + } + + pub fn rm_R_bit(&mut self){ + self.0 &= !(PteFlags::R.bits()); + } + + pub fn rm_X_bit(&mut self){ + self.0 &= !(PteFlags::X.bits()); + } + // implement PTE2PA #[inline] pub fn as_pagetable(&self) -> *mut PageTable{ diff --git a/kernel/src/memory/mod.rs b/kernel/src/memory/mod.rs index 62cd695..2570e20 100755 --- a/kernel/src/memory/mod.rs +++ b/kernel/src/memory/mod.rs @@ -50,8 +50,7 @@ pub fn copy_to_kernel( let my_proc = CPU_MANAGER.myproc().unwrap(); if is_user { - let pdata = &mut *(my_proc.data.get()); - let page_table = pdata.pagetable.as_mut().unwrap(); + let page_table = my_proc.pagetable.as_mut().unwrap(); page_table.copy_in( dst, src, @@ -81,8 +80,7 @@ pub fn copy_from_kernel( unsafe{ let p = CPU_MANAGER.myproc().unwrap(); if is_user { - let pdata = p.data.get_mut(); - let page_table = pdata.pagetable.as_mut().unwrap(); + let page_table = p.pagetable.as_mut().unwrap(); page_table .copy_out( dst, diff --git a/kernel/src/misc.rs b/kernel/src/misc.rs old mode 100644 new mode 100755 diff --git a/kernel/src/process/cpu.rs b/kernel/src/process/cpu.rs index dd0bdaf..b9c5fcc 100755 --- a/kernel/src/process/cpu.rs +++ b/kernel/src/process/cpu.rs @@ -1,4 +1,6 @@ +use alloc::task; use array_macro::array; +use spin::MutexGuard; use crate::fs::VFile; use crate::arch::riscv::{ tp, sstatus }; use crate::arch::riscv::qemu::param::NCPU; @@ -8,7 +10,7 @@ use core::ops::IndexMut; use core::ptr::NonNull; use super::*; pub struct CPU { - pub process: Option>, // The process running on this cpu, or null. + pub process: Option>, // The process running on this cpu, or null. pub context: Context, // swtch() here to enter scheduler(). pub noff: usize, // Depth of push_off() nesting. pub intena: usize // Were interrupts enabled before push_off()? @@ -37,7 +39,7 @@ impl CPUManager{ &mut self.cpus[cpu_id] } - pub unsafe fn myproc(&mut self) -> Option<&mut Process>{ + pub unsafe fn myproc(&mut self) -> Option<&mut task_struct>{ push_off(); let c = CPU_MANAGER.mycpu(); let p = &mut *c.process.unwrap().as_ptr(); @@ -45,17 +47,17 @@ impl CPUManager{ Some(p) } - pub fn yield_proc(&mut self) { - if let Some(my_proc) = unsafe{ self.myproc() } { - let guard = my_proc.meta.acquire(); - if guard.state == ProcState::RUNNING { - drop(guard); - my_proc.yielding(); - }else { - drop(guard); - } - } - } + // pub fn yield_proc(&mut self) { + // if let Some(my_proc) = unsafe{ self.myproc() } { + // let guard = my_proc.meta.acquire(); + // if guard.state == ProcState::RUNNING { + // drop(guard); + // my_proc.yielding(); + // }else { + // drop(guard); + // } + // } + // } /// Per-CPU process scheduler. /// Each CPU calls scheduler() after setting itself up. @@ -73,29 +75,35 @@ impl CPUManager{ loop { // Avoid deadlock by ensuring that devices can interrupt. sstatus::intr_on(); + + let guard = PROC_MANAGER.tasks_lock.acquire(); match PROC_MANAGER.seek_runnable() { - Some(proc) => { + Some(task) => { // Switch to chosen process. It is the process's job // to release it's lock and then reacquire it // before jumping back to us. - c.set_proc(NonNull::new(proc as *mut Process)); - let mut pmeta = proc.meta.acquire(); - pmeta.state = ProcState::RUNNING; + c.set_proc(NonNull::new(task as *mut task_struct)); + + task.state = ProcState::RUNNING; + switch( c.get_context_mut(), - &mut proc.data.get_mut().context as *mut Context + &mut task.context as *mut Context ); + if c.get_context_mut().is_null() { panic!("context switch back with no process reference."); } // Process is done running for now. // It should have changed it's process state before coming back. c.set_proc(None); - drop(pmeta); + + } None => {} } + drop(guard); } } @@ -108,8 +116,7 @@ impl CPUManager{ let proc = unsafe { self.myproc().unwrap() }; - let pdata = unsafe{ &mut *proc.data.get() }; - pdata.open_files[fd].take(); + proc.open_files[fd].take(); } } @@ -123,7 +130,7 @@ impl CPU{ } } - pub fn set_proc(&mut self, proc:Option>){ + pub fn set_proc(&mut self, proc:Option>){ self.process = proc; } @@ -139,19 +146,16 @@ impl CPU{ /// be proc->intena and proc->noff, but that would /// break in the few places where a lock is held but /// there's no process. - pub unsafe fn sched<'a> - ( - &mut self, - guard: SpinlockGuard<'a, ProcMeta>, - ctx: *mut Context - ) - -> SpinlockGuard<'a, ProcMeta> + pub unsafe fn sched<'a>(&mut self) { extern "C" { fn switch(old: *mut Context, new: *mut Context); } - if !guard.holding() { + let curtask = CPU_MANAGER.myproc().unwrap(); + let cur_ctx = &mut curtask.context as *mut Context ; + + if !PROC_MANAGER.tasks_lock.holding() { panic!("sched: not holding proc's lock"); } // only holding self.proc.lock @@ -161,7 +165,7 @@ impl CPU{ } // proc is not running. - if guard.state == ProcState::RUNNING { + if curtask.state == ProcState::RUNNING { panic!("sched: proc is running"); } @@ -174,27 +178,29 @@ impl CPU{ // println!("[Kernel] switch"); // println!("[Kernel] old_context: 0x{:x}, new_context: 0x{:x}", ctx as usize, &mut self.context as *mut Context as usize); switch( - ctx, + cur_ctx, &mut self.context as *mut Context ); - self.intena = intena; - guard - + + + self.intena = intena; } /// Yield the holding process if any and it's RUNNING. /// Directly return if none. pub fn try_yield_proc(&mut self) { + if !self.process.is_none() { - let guard = unsafe { - (&mut *self.process.unwrap().as_ptr()).meta.acquire() - }; - if guard.state == ProcState::RUNNING { - drop(guard); - unsafe { self.process.unwrap().as_mut().yielding() } - } else { - drop(guard); - } + // let guard = unsafe { + // (&mut *self.process.unwrap().as_ptr()).meta.acquire() + // }; + // if guard.state == ProcState::RUNNING { + // drop(guard); + // unsafe { self.process.unwrap().as_mut().yielding() } + // } else { + // drop(guard); + // } + unsafe { self.process.unwrap().as_mut().yielding(); } } } diff --git a/kernel/src/process/elf.rs b/kernel/src/process/elf.rs index ecaf9f8..aea61ad 100755 --- a/kernel/src/process/elf.rs +++ b/kernel/src/process/elf.rs @@ -11,7 +11,7 @@ use core::mem::size_of; use core::ops::IndexMut; use super::CPU_MANAGER; -use super::Process; +use super::task_struct; use alloc::boxed::Box; use alloc::string::String; @@ -67,7 +67,7 @@ pub struct ProgHeader { #[allow(unused_variables)] #[allow(unused_assignments)] fn load_seg( - page_table: &mut Box, + page_table: *mut PageTable, va: usize, inode_data: &mut SleepLockGuard, offset: usize, @@ -80,8 +80,9 @@ fn load_seg( } let mut copy_size: usize = 0; + let pagetable = unsafe { &mut *page_table }; while copy_size < size { - match page_table + match pagetable .pgt_translate(va) { Some(pa) => { // 将用户虚拟地址翻译成物理地址 @@ -121,9 +122,9 @@ pub unsafe fn exec( ) -> Result { let elf = Box::::new_zeroed().assume_init(); let ph = Box::::new_zeroed().assume_init(); - let mut page_table: Box; + // let mut page_table: *mut PageTable; let mut size = 0; - let p: &mut Process; + let p: &mut task_struct; let mut sp: usize; let stack_base: usize; let mut user_stack: [usize; MAXARG] = [0;MAXARG]; @@ -158,9 +159,9 @@ pub unsafe fn exec( } let my_proc = CPU_MANAGER.myproc().unwrap(); - page_table = my_proc - .proc_pagetable() - .expect("Fail to alloc pagetable for current process."); + let pagetable = my_proc.proc_pagetable(); + let page_table = &mut *pagetable; + let ph_size = size_of::() as u32; // Load program into memeory. @@ -213,7 +214,7 @@ pub unsafe fn exec( // load segement information // println!("[Debug] 偏移量: 0x{:x}, 文件大小: 0x{:x}", ph.off, ph.file_size); if load_seg( - &mut page_table, + pagetable, ph.vaddr, &mut inode_guard, ph.off, @@ -240,7 +241,7 @@ pub unsafe fn exec( LOG.end_op(); p = CPU_MANAGER.myproc().unwrap(); - let old_size = (&*p.data.get()).size; + let old_size = p.size; // Allocate two pages at the next page boundary // Use the second as the user stack. @@ -321,8 +322,8 @@ pub unsafe fn exec( // arguments to user main(argc, argv) // argc is returned via the system call return // value, which goes in a0. - let pdata = p.data.get_mut(); - let trapframe = &mut *pdata.trapframe; + + let trapframe = &mut *p.trapframe; trapframe.a1 = sp; // Save program name for debugging @@ -333,14 +334,14 @@ pub unsafe fn exec( exec_name.push(c); } } - core::ptr::copy(exec_name.as_ptr(), &mut pdata.name as *mut u8, 16); + core::ptr::copy(exec_name.as_ptr(), &mut p.name as *mut u8, 16); // Commit to user image. - let old_pgt = pdata.pagetable.as_mut().take().unwrap(); + let old_pgt = p.pagetable.as_mut().take().unwrap(); old_pgt.proc_free_pagetable(old_size); - pdata.pagetable = Some(page_table); - pdata.size = size; + p.pagetable = pagetable; + p.size = size; // initial program counter = main trapframe.epc = elf.entry; // initial stack pointer diff --git a/kernel/src/process/manager.rs b/kernel/src/process/manager.rs index b8d6e3d..6bb5c39 100755 --- a/kernel/src/process/manager.rs +++ b/kernel/src/process/manager.rs @@ -1,61 +1,77 @@ +use alloc::task; use array_macro::array; +use spin::MutexGuard; use core::cell::RefCell; use core::str::{from_utf8, from_utf8_unchecked}; use core::{mem::size_of_val, ptr::NonNull}; use core::ops::{ DerefMut }; +use alloc::{boxed::Box, vec}; use super::*; use crate::arch::riscv::qemu::fs::ROOTIPATH; use crate::arch::riscv::qemu::{ - param::NPROC, + param::NTASK, layout::{ PGSIZE, TRAMPOLINE } }; use crate::fs::VFile; use crate::lock::spinlock::{ Spinlock, SpinlockGuard }; use crate::arch::riscv::register::sstatus::intr_on; use crate::memory::*; +use crate::ipc::bitmap::*; pub struct ProcManager { - proc: [Process; NPROC], - init_proc: *mut Process, - pid_lock: Spinlock, + tasks: [task_struct; NTASK], + init_proc: *mut task_struct, + // pid_lock: Spinlock, /// helps ensure that wakeups of wait()ing /// parents are not lost. helps obey the /// memory model when using p->parent. /// must be acquired before any p->lock. + + // pub wait_lock: Spinlock<()>, + + pub tasks_lock: Spinlock<()>, pub wait_lock: Spinlock<()>, } pub static mut PROC_MANAGER:ProcManager = ProcManager::new(); +pub static mut TasksLock:Spinlock<()> = Spinlock::new((), "TasksLock"); +pub static mut nextpid: usize = 0; impl ProcManager{ pub const fn new() -> Self { Self{ - proc: array![_ => Process::new(); NPROC], - init_proc: 0 as *mut Process, - pid_lock: Spinlock::new(0, "pid_lock"), - wait_lock: Spinlock::new((), "wait_lock"), + tasks: array![_ => task_struct::new(); NTASK], + init_proc: 0 as *mut task_struct, + // pid_lock: Spinlock::new(0, "pid_lock"), + // wait_lock: Spinlock::new((), "wait_lock"), + + tasks_lock: Spinlock::new((), "tasks_lock"), + wait_lock: Spinlock::new((), "wait_lock") } } - pub fn get_table_mut(&mut self) -> &mut [Process; NPROC] { - &mut self.proc - } + // pub fn get_table_mut(&mut self) -> &mut [task_struct; NTASK] { + // &mut self.tasks + // } - pub fn alloc_pid(&mut self) -> usize { - let mut guard = self.pid_lock.acquire(); - let pid; - *guard += 1; - pid = *guard; - drop(guard); - pid + pub fn alloc_pid() -> usize { + // let curtask = unsafe { + // CPU_MANAGER.myproc().expect("Current cpu's process is none.") + // }; + unsafe { + let ret = nextpid; + + nextpid += 1; + ret + } } /// initialize the proc table at boot time. /// Only used in boot. pub unsafe fn init(&mut self){ println!("process init......"); - for (pos, proc) in self.proc.iter_mut().enumerate() { + for (pos, proc) in self.tasks.iter_mut().enumerate() { proc.init(kernel_stack(pos)); } } @@ -64,7 +80,7 @@ impl ProcManager{ /// Map it high in memory, followed by an invalid /// group page pub unsafe fn proc_mapstacks(&mut self) { - for (pos, _) in self.proc.iter_mut().enumerate() { + for (pos, _) in self.tasks.iter_mut().enumerate() { let pa = Stack::new_zeroed(); let va = kernel_stack(pos); @@ -83,33 +99,32 @@ impl ProcManager{ /// Set up first user programe pub unsafe fn user_init(&mut self) { println!("first user process init......"); - let p = self.alloc_proc().expect("Fail to get unused process"); + let task = ProcManager::alloc_proc().expect("Fail to get unused process"); // allocate one user page and copy init's instructions // and data into it. - let pdata = &mut *p.data.get(); - pdata.pagetable.as_mut().unwrap().uvm_init( + task.pagetable.as_mut().unwrap().uvm_init( &INITCODE, ); - pdata.size = PGSIZE; + task.size = PGSIZE; // prepare for the very first "return" from kernel to user. - let tf = &mut *pdata.trapframe; + let tf = &mut *task.trapframe; tf.epc = 0; // user program counter tf.sp = 4 * PGSIZE; // user stack pointer let init_name = b"initname\0"; - pdata.set_name(init_name); + task.set_name(init_name); // Set init process's directory - pdata.cwd = Some(ICACHE.namei(&ROOTIPATH).expect("cannot find root inode")); + task.cwd = Some(ICACHE.namei(&ROOTIPATH).expect("cannot find root inode")); - let mut guard = p.meta.acquire(); - guard.set_state(ProcState::RUNNABLE); + let guard = self.tasks_lock.acquire(); + task.set_state(ProcState::RUNNABLE); drop(guard); // Set init process - self.init_proc = p as *mut Process; + self.init_proc = task as *mut task_struct; } @@ -119,79 +134,142 @@ impl ProcManager{ /// If there are a free procs, or a memory allocation fails, return 0. /// WARNING: possible error occurs here. - pub fn alloc_proc(&mut self) -> Option<&mut Process> { - let alloc_pid = self.alloc_pid(); - // self.proc_dump(); - for proc in self.proc.iter_mut() { - let mut pmeta = proc.meta.acquire(); - match pmeta.state { + pub fn alloc_proc() -> Option<&'static mut task_struct> { + + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + + // let alloc_pid = self.alloc_pid(); + + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + match task.state { ProcState::UNUSED => { - pmeta.pid = alloc_pid; - pmeta.set_state(ProcState::ALLOCATED); - let pdata = proc.data.get_mut(); + task.pid = ProcManager::alloc_pid(); + task.set_state(ProcState::ALLOCATED); + + drop(guard); + // Allocate a trapframe page. let trapframe = unsafe{ RawPage::new_zeroed() as *mut u8 }; - pdata.set_trapframe(trapframe as *mut Trapframe); + task.set_trapframe(trapframe as *mut Trapframe); // An empty user page table - unsafe{ - pdata.proc_pagetable(); - } + // unsafe{ + // task.proc_pagetable(); + // } + task.pagetable = task.proc_pagetable(); + + let box_bitmap: Box = unsafe { Box::new_zeroed().assume_init() }; + let ptr = Box::into_raw(box_bitmap); + task.sharemem_bitmap = ptr; + // Set up new context to start executing at forkret, // which returns to user space. - pdata.init_context(); - drop(pmeta); - return Some(proc) + task.init_context(); + task.thread = 0; + + return Some(task) } _ => {} } } + drop(guard); None } - /// Wake up all processes sleeping on chan. - /// Must be called without any p->lock. - pub fn wake_up(&self, channel: usize) { - for p in self.proc.iter() { - let mut guard = p.meta.acquire(); - if guard.state == ProcState::SLEEPING && guard.channel == channel { - // println!("[Debug] Wake up process {}", guard.pid); - guard.state = ProcState::RUNNABLE; + pub fn alloc_thread() -> Option<&'static mut task_struct> { + + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + + // let alloc_pid = self.alloc_pid(); + + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + match task.state { + ProcState::UNUSED => { + task.pid = ProcManager::alloc_pid(); + task.set_state(ProcState::ALLOCATED); + + drop(guard); + + // Allocate a trapframe page. + // let trapframe = unsafe{ RawPage::new_zeroed() as *mut u8 }; + // task.set_trapframe(trapframe as *mut Trapframe); + + // task.pagetable = ; + // Set up new context to start executing at forkret, + // which returns to user space. + task.init_context(); + task.thread = 1; + + return Some(task) + } + _ => {} } - drop(guard); } + drop(guard); + None + } + + + pub fn wakeup1(channel: usize){ + for task in unsafe { PROC_MANAGER.tasks.iter_mut() }{ + if task.state == ProcState::SLEEPING && task.channel == channel { + task.state = ProcState::RUNNABLE; + } + } + } + + /// Wake up all processes sleeping on chan. + /// Must be called without any p->lock. + + pub fn wake_up(&mut self, channel: usize) { + let guard = self.tasks_lock.acquire(); + ProcManager::wakeup1(channel); + drop(guard); } /// Find a runnable and set status to allocated - pub fn seek_runnable(&mut self) -> Option<&mut Process> { - for p in self.proc.iter_mut() { - let mut guard = p.meta.acquire(); - match guard.state { - ProcState::RUNNABLE => { - guard.state = ProcState::ALLOCATED; - drop(guard); - return Some(p) - }, - _ => { - drop(guard); - }, + /// should in lock + pub fn seek_runnable(&mut self) -> Option<&mut task_struct> { + // let guard = self.tasks_lock.acquire(); + for task in self.tasks.iter_mut() { + // match task.state { + // ProcState::RUNNABLE => { + // task.state = ProcState::ALLOCATED; + // drop(guard); + // return Some(task) + // }, + // _ => { + // drop(guard); + // }, + // } + if task.state == ProcState::RUNNABLE { + return Some(task) } } None } /// Pass p's abandonded children to init. - /// Caller must hold wait lock. - pub fn reparent(&self, proc: &mut Process) { - for index in 0..self.proc.len() { - let p = &self.proc[index]; - let pdata = unsafe{ &mut *p.data.get() }; - if let Some(parent) = pdata.parent { - if parent as *const _ == proc as *const _ { - pdata.parent = Some(self.init_proc); - self.wake_up(self.init_proc as usize); - } - } + /// Caller must hold wait lock. tasks_lock + pub fn reparent(proc: &mut task_struct) { + // for index in 0..self.proc.len() { + // let p = &self.proc[index]; + // let pdata = unsafe{ &mut *p.data.get() }; + // if let Some(parent) = pdata.parent { + // if parent as *const _ == proc as *const _ { + // pdata.parent = Some(self.init_proc); + // self.wake_up(self.init_proc as usize); + // } + // } + // } + for task in unsafe { PROC_MANAGER.tasks.iter_mut() } { + if let Some(parent) = task.parent { + if parent as *const _ == proc as *const _ { + task.parent = unsafe { Some(PROC_MANAGER.init_proc) }; + // if task.state == ProcState::ZOMBIE !!!!!!!!TODO + ProcManager::wakeup1(unsafe { PROC_MANAGER.init_proc as usize }); + } + } } } @@ -199,12 +277,12 @@ impl ProcManager{ /// An exited process remains in the zombie state /// until its parent calls wait. pub fn exit(&mut self, status : usize) -> ! { - let my_proc = unsafe { + let curtask = unsafe { CPU_MANAGER.myproc().expect("Current cpu's process is none.") }; // close all open files. - let pdata = unsafe{ &mut *my_proc.data.get() }; - let open_files = &mut pdata.open_files; + // println!("STATUS {}", status); + let open_files = &mut curtask.open_files; // 遍历该进程打开的文件,夺取所有权,即将引用计数减一 for index in 0..open_files.len() { if open_files[index].is_some() { @@ -213,34 +291,32 @@ impl ProcManager{ } LOG.begin_op(); - let cwd = pdata.cwd.as_mut().expect("Fail to get inode"); + let cwd = curtask.cwd.as_mut().expect("Fail to get inode"); drop(cwd); LOG.end_op(); - pdata.cwd = None; - let wait_guard = self.wait_lock.acquire(); - // Give any children to init. - self.reparent(my_proc); + + curtask.cwd = None; + + + + let guard = self.tasks_lock.acquire(); // Parent might be sleeping in wait. // 唤醒父进程 - self.wake_up(pdata.parent.expect("Fail to find parent process") as usize); + ProcManager::wakeup1(curtask.parent.expect("Fail to find parent process") as usize); - let mut proc_data = my_proc.meta.acquire(); + // Give any children to init. + ProcManager::reparent(curtask); // 设置退出状态 - proc_data.xstate = status; + curtask.xstate = status; // 设置运行状态 - proc_data.set_state(ProcState::ZOMBIE); - - drop(wait_guard); + curtask.state = ProcState::ZOMBIE; let my_cpu = unsafe { CPU_MANAGER.mycpu() }; unsafe { - my_cpu.sched( - proc_data, - &mut pdata.context as *mut Context - ); + my_cpu.sched(); } panic!("zombie exit!"); @@ -250,54 +326,107 @@ impl ProcManager{ /// 等待子进程退出并返回 pid pub fn wait(&mut self, addr: usize) -> Option { let pid; - let my_proc = unsafe { + let curtask = unsafe { CPU_MANAGER.myproc().expect("Fail to get my process") }; - let mut wait_guard = self.wait_lock.acquire(); + + // let wait_guard = self.wait_lock.acquire(); + loop { + let tasks_guard = self.tasks_lock.acquire(); + + let mut have_kids = false; // Scan through table looking for exited children. // 遍历所有进程是否为其他进程的子进程 - for index in 0..self.proc.len() { - let p = &mut self.proc[index]; - let pdata = unsafe { - p.data.get().as_mut().unwrap() - }; - if let Some(parent) = pdata.parent { - if parent as *const _ == my_proc as *const _ { - // 确报子进程不会退出或者进行被调度出去 - let proc_meta = p.meta.acquire(); + for index in 0..self.tasks.len() { + let task = &mut self.tasks[index]; + + if let Some(parent) = task.parent { + if parent as *const _ == curtask as *const _ { + have_kids = true; // make sure the child isn't still in exit or swtch. - if proc_meta.state == ProcState::ZOMBIE { + if task.state == ProcState::ZOMBIE { // Found one - pid = proc_meta.pid; - let page_table = pdata.pagetable.as_mut().expect("Fail to get pagetable"); + pid = task.pid; + let page_table = unsafe { &mut *task.pagetable }; // 这里是要获取子进程退出的状态,当 addr 的值为 0 的时候为悬空指针,表示 // 不需要获取子进程退出的状态 - if addr != 0 && page_table.copy_out(addr, proc_meta.xstate as *const u8, size_of_val(&proc_meta.xstate)).is_err() { - drop(proc_meta); - drop(wait_guard); + if addr != 0 && page_table.copy_out(addr, task.xstate as *const u8, size_of_val(&task.xstate)).is_err() { + // drop(wait_guard); + drop(tasks_guard); return None } - drop(proc_meta); - p.free_proc(); - drop(wait_guard); + task.free_proc(); + + // drop(wait_guard); + drop(tasks_guard); + return Some(pid) + } + } + } + } + + // No point waiting if we don't have any children. + if !have_kids || curtask.killed { + drop(tasks_guard); + // drop(wait_guard); + return None + } + + + drop(tasks_guard); + // Wait for a child to exit. + let mut wait_guard = unsafe { PROC_MANAGER.wait_lock.acquire() }; + curtask.sleep( + curtask as *const _ as usize, + wait_guard + ); + wait_guard = self.wait_lock.acquire(); + } + } + + pub fn join(&mut self, stack: usize) -> Option { + let pid; + let my_proc = unsafe { + CPU_MANAGER.myproc().expect("Fail to get my process") + }; + println!("In join the stack varible addr is {}", stack); + loop { + let mut guard = self.tasks_lock.acquire(); + let mut have_kids = false; + // Scan through table looking for exited children. + // 遍历所有进程是否为其他进程的子进程 + for index in 0..self.tasks.len() { + let p = &mut self.tasks[index]; + + if let Some(parent) = p.parent { + if parent as *const _ == my_proc as *const _ { + have_kids = true; + if p.state == ProcState::ZOMBIE { + pid = p.pid; + + //TODO BUG!!!!!!!!!!!!!!!!!!!!!! + + // let page_table = unsafe { &mut *p.pagetable }; + // page_table.copy_out(stack, p.thread_ustack as *const u8, size_of::()); + // println!("(FIND"); + p.free_thread(); + drop(guard); return Some(pid); } - drop(proc_meta); } } } - let my_proc_data = my_proc.meta.acquire(); // No point waiting if we don't have any children. - if !have_kids || my_proc_data.killed { - drop(wait_guard); - drop(my_proc_data); + if !have_kids || my_proc.killed { + drop(guard); return None } // 释放锁,否则会死锁 - drop(my_proc_data); + drop(guard); + let mut wait_guard = self.wait_lock.acquire(); // Wait for a child to exit. my_proc.sleep( my_proc as *const _ as usize, @@ -307,20 +436,24 @@ impl ProcManager{ } } + /// Kill the process with the given pid. /// The victim won't exit until it tries to return. /// to user space (user_trap) pub fn kill(&mut self, pid: usize) -> Result { - for proc in self.proc.iter_mut() { - if proc.pid() == pid { - proc.set_killed(true); - if proc.state() == ProcState::SLEEPING { + let guard = self.tasks_lock.acquire(); + for task in self.tasks.iter_mut() { + if task.pid == pid { + task.killed = true; + if task.state == ProcState::SLEEPING { // Wake process from sleep. - proc.set_state(ProcState::RUNNABLE); - return Ok(0) + task.state = ProcState::RUNNABLE; } + drop(guard); + return Ok(0) } } + drop(guard); Err(()) } @@ -328,7 +461,7 @@ impl ProcManager{ /// Runs when user type ^P on console. /// No lock to avoid wedging a stuck machine further pub fn proc_dump(&self) { - for proc in self.proc.iter() { + for proc in self.tasks.iter() { if proc.state() == ProcState::UNUSED { continue; } else { println!("pid: {} state: {:?} name: {}", proc.pid(), proc.state(), proc.name()); diff --git a/kernel/src/process/mod.rs b/kernel/src/process/mod.rs index 90758fa..a2196be 100755 --- a/kernel/src/process/mod.rs +++ b/kernel/src/process/mod.rs @@ -16,6 +16,7 @@ mod trapframe; mod manager; mod elf; mod process; +mod thread; pub use context::*; pub use trapframe::*; pub use cpu::*; @@ -33,49 +34,46 @@ static INITCODE: [u8; 51] = [ /// Exit the current process. Does not return. /// An exited process remains in the zombie state /// until its parent calls wait() -pub unsafe fn exit(status: i32) { - let my_proc = CPU_MANAGER.myproc().unwrap(); - - // TODO: initproc - - // Get extern data in current process. - let pdata = my_proc.data.get_mut(); - - // Close all open files - for f in pdata.open_files.iter_mut() { - f.take(); - } - pdata.open_files = array![_ => None; NFILE]; - - LOG.begin_op(); - // extern_data.cwd.as_ref().unwrap().put(); - // ICACHE.put(extern_data.cwd.as_ref()); - drop(pdata.cwd.as_mut()); - LOG.end_op(); - pdata.cwd = None; - - let wait_guard = PROC_MANAGER.wait_lock.acquire(); - // TODO: Give any children to init +// pub unsafe fn exit(status: i32) { +// let my_proc = CPU_MANAGER.myproc().unwrap(); + +// // TODO: initproc + +// // Close all open files +// for f in my_proc.open_files.iter_mut() { +// f.take(); +// } +// my_proc.open_files = array![_ => None; NFILE]; + +// LOG.begin_op(); +// // extern_data.cwd.as_ref().unwrap().put(); +// // ICACHE.put(extern_data.cwd.as_ref()); +// drop(my_proc.cwd.as_mut()); +// LOG.end_op(); +// my_proc.cwd = None; + +// let wait_guard = PROC_MANAGER.wait_lock.acquire(); +// // TODO: Give any children to init - // Parent might be sleeping in wait(). - PROC_MANAGER.wake_up(pdata.parent.unwrap() as usize); +// // Parent might be sleeping in wait(). +// PROC_MANAGER.wake_up(pdata.parent.unwrap() as usize); - let mut guard = my_proc.meta.acquire(); +// let mut guard = my_proc.meta.acquire(); - guard.set_state(ProcState::ZOMBIE); - guard.xstate = status as usize; +// guard.set_state(ProcState::ZOMBIE); +// guard.xstate = status as usize; - drop(guard); +// drop(guard); - drop(wait_guard); +// drop(wait_guard); - // Jump into scheduler, never to return. - CPU_MANAGER.scheduler(); - panic!("zombine exit"); +// // Jump into scheduler, never to return. +// CPU_MANAGER.scheduler(); +// panic!("zombine exit"); -} +// } /// A fork child's very first scheduling by scheduler() /// will switch to forkret. @@ -85,7 +83,7 @@ unsafe fn fork_ret() -> ! { static mut FIRST: bool = true; // Still holding p->lock from scheduler - CPU_MANAGER.myproc().unwrap().meta.release(); + PROC_MANAGER.tasks_lock.release(); if FIRST { // File system initialization @@ -93,6 +91,11 @@ unsafe fn fork_ret() -> ! { init(ROOTDEV); } // println!("user trap return"); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let tf = unsafe { &mut *task.trapframe } ; + if tf.a7 == 40 { + println!("In fork_ret, pid {} epc {} sp {}", task.pid, tf.epc, tf.sp); + } user_trap_ret(); } diff --git a/kernel/src/process/process.rs b/kernel/src/process/process.rs index 9eef923..c67b77f 100755 --- a/kernel/src/process/process.rs +++ b/kernel/src/process/process.rs @@ -3,7 +3,7 @@ use core::ptr::*; use core::cell::{ UnsafeCell, RefCell }; use core::str::from_utf8; use alloc::vec::Vec; -use alloc::vec; +use alloc::{vec, task}; use alloc::sync::Arc; use array_macro::array; @@ -19,6 +19,7 @@ use crate::arch::riscv::qemu::layout::{ PGSIZE, TRAMPOLINE, TRAPFRAME }; use crate::arch::riscv::register::satp; use super::*; use crate::fs::{FileType, Inode, VFile}; +use crate::ipc::bitmap::*; use alloc::boxed::Box; @@ -35,64 +36,100 @@ pub enum ProcState{ } -pub struct Process { - pub meta: Spinlock, - pub data: UnsafeCell, -} - -pub struct ProcMeta { - // p->lock must be held when using these - pub state: ProcState, - pub channel: usize, // If non-zero, sleeping on chan - pub killed: bool, // If non-zero, have been killed - pub xstate: usize, // Exit status to be returned to parent's wait - pub pid: usize, // Process ID -} +pub struct task_struct { + // pub meta: Spinlock, + // pub data: UnsafeCell, -impl ProcMeta { - pub const fn new() -> Self { - Self { - state: ProcState::UNUSED, - channel: 0, - killed: false, - xstate: 0, - pid: 0, - - } - } - - pub fn set_state(&mut self, state: ProcState) { - self.state = state; - } -} - -pub struct ProcData { - // these are private to the process, so p->lock need to be held pub kstack:usize, // Virtual address of kernel stack + pub thread_ustack: usize, pub size:usize, // size of process memory - pub pagetable: Option>, // User page table + pub pagetable: *mut PageTable, // User page table pub trapframe: *mut Trapframe, // data page for trampoline.S pub context: Context, // switch() here to run processs pub name: [u8; 16], // Process name (debugging) // proc_tree_lock must be held when using this: - pub parent: Option<*mut Process>, + pub parent: Option<*mut task_struct>, pub open_files: [Option>; NFILE], - pub cwd: Option + pub cwd: Option, + + pub sharemem_bitmap: *mut BitMap, + + + pub state: ProcState, + pub channel: usize, // If non-zero, sleeping on chan + pub killed: bool, // If non-zero, have been killed + pub xstate: usize, // Exit status to be returned to parent's wait + pub pid: usize, // Process ID + pub thread: usize } -impl ProcData { +// pub struct ProcMeta { +// // p->lock must be held when using these +// pub state: ProcState, +// pub channel: usize, // If non-zero, sleeping on chan +// pub killed: bool, // If non-zero, have been killed +// pub xstate: usize, // Exit status to be returned to parent's wait +// pub pid: usize, // Process ID +// } + +// impl ProcMeta { +// pub const fn new() -> Self { +// Self { +// state: ProcState::UNUSED, +// channel: 0, +// killed: false, +// xstate: 0, +// pid: 0, + +// } +// } + +// pub fn set_state(&mut self, state: ProcState) { +// self.state = state; +// } +// } + +// pub struct ProcData { +// // these are private to the process, so p->lock need to be held +// pub kstack:usize, // Virtual address of kernel stack +// pub thread_ustack: usize, +// pub size:usize, // size of process memory +// pub pagetable: Option>, // User page table +// pub trapframe: *mut Trapframe, // data page for trampoline.S +// pub context: Context, // switch() here to run processs +// pub name: [u8; 16], // Process name (debugging) +// // proc_tree_lock must be held when using this: +// pub parent: Option<*mut Process>, +// pub open_files: [Option>; NFILE], +// pub cwd: Option, + +// pub meta: ProcMeta +// } + +impl task_struct { pub const fn new() -> Self { Self { kstack:0, + thread_ustack: 0, size: 0, - pagetable: None, + pagetable: null_mut(), trapframe: null_mut(), context: Context::new(), name: [0u8; 16], parent: None, open_files: array![_ => None; NFILE], - cwd: None + cwd: None, + + sharemem_bitmap: null_mut(), + + state: ProcState::UNUSED, + channel: 0, + killed: false, + xstate: 0, + pid: 0, + + thread: 0 } } @@ -110,7 +147,7 @@ impl ProcData { } } - pub fn set_parent(&mut self, parent: Option<*mut Process>) { + pub fn set_parent(&mut self, parent: Option<*mut task_struct>) { self.parent = parent; } @@ -122,7 +159,7 @@ impl ProcData { self.trapframe = trapframe; } - pub fn set_pagetable(&mut self, pagetable: Option>) { + pub fn set_pagetable(&mut self, pagetable: *mut PageTable) { self.pagetable = pagetable } @@ -154,39 +191,39 @@ impl ProcData { // Create a user page table for a given process, // with no user memory, but with trampoline pages - pub unsafe fn proc_pagetable(&mut self) { - - extern "C" { - fn trampoline(); - } - - // An empty page table - let mut page_table = PageTable::uvmcreate(); - // map the trampoline code (for system call return ) - // at the highest user virtual address. - // only the supervisor uses it, on the way - // to/from user space, so not PTE_U. - if !page_table.map( - VirtualAddress::new(TRAMPOLINE), - PhysicalAddress::new(trampoline as usize), - PGSIZE, - PteFlags::R | PteFlags::X - ) { - page_table.uvm_free(0); - } - - // map the trapframe just below TRAMPOLINE, for trampoline.S - if !page_table.map( - VirtualAddress::new(TRAPFRAME), - PhysicalAddress::new(self.trapframe as usize), - PGSIZE, - PteFlags::R | PteFlags::W - ) { - page_table.uvm_free(0); - } - - self.pagetable = Some(page_table); - } + // pub unsafe fn proc_pagetable(&mut self) { + + // extern "C" { + // fn trampoline(); + // } + + // // An empty page table + // let mut page_table = PageTable::uvmcreate(); + // // map the trampoline code (for system call return ) + // // at the highest user virtual address. + // // only the supervisor uses it, on the way + // // to/from user space, so not PTE_U. + // if !page_table.map( + // VirtualAddress::new(TRAMPOLINE), + // PhysicalAddress::new(trampoline as usize), + // PGSIZE, + // PteFlags::R | PteFlags::X + // ) { + // page_table.uvm_free(0); + // } + + // // map the trapframe just below TRAMPOLINE, for trampoline.S + // if !page_table.map( + // VirtualAddress::new(TRAPFRAME), + // PhysicalAddress::new(self.trapframe as usize), + // PGSIZE, + // PteFlags::R | PteFlags::W + // ) { + // page_table.uvm_free(0); + // } + + // self.pagetable = Some(page_table); + // } /// Initialize first user process pub fn user_init(&mut self) { @@ -205,172 +242,198 @@ impl ProcData { cpu::cpuid() }; } -} -impl Process{ - pub const fn new() -> Self{ - Self{ - meta: Spinlock::new(ProcMeta::new(), "process"), - data: UnsafeCell::new(ProcData::new()), - } - } + // pub const fn new() -> Self{ + // Self{ + // meta: Spinlock::new(ProcMeta::new(), "process"), + // data: UnsafeCell::new(ProcData::new()), + // } + // } pub fn init(&mut self, kstack: usize) { - let pdata = unsafe { - &mut *self.data.get() - }; + // let pdata = unsafe { + // &mut *self.data.get() + // }; - pdata.open_files = array![_ => None; NFILE]; + self.open_files = array![_ => None; NFILE]; - pdata.set_kstack(kstack); + self.set_kstack(kstack); } - pub fn as_ptr(&self) -> *const Process{ - self as *const Process + pub fn as_ptr(&self) -> *const task_struct{ + self as *const task_struct } - pub fn as_mut_ptr(&mut self) -> *mut Process{ - self as *mut Process + pub fn as_mut_ptr(&mut self) -> *mut task_struct{ + self as *mut task_struct } pub fn as_ptr_addr(&self) -> usize{ - self as *const Process as usize + self as *const task_struct as usize } pub fn as_mut_ptr_addr(&mut self) -> usize{ - self as *mut Process as usize + self as *mut task_struct as usize } pub fn killed(&self) -> bool { - let proc_data = self.meta.acquire(); - let killed = proc_data.killed; - drop(proc_data); - killed + self.killed } pub fn pid(&self) -> usize { - let proc_data = self.meta.acquire(); - let pid = proc_data.pid; - drop(proc_data); - pid + self.pid } pub fn set_state(&mut self, state: ProcState) { - let mut proc_data = self.meta.acquire(); - proc_data.set_state(state); - drop(proc_data); + self.state = state; } pub fn set_killed(&mut self, killed: bool) { - let mut proc_data = self.meta.acquire(); - proc_data.killed = killed; - drop(proc_data); + self.killed = killed; } pub fn state(&self) -> ProcState { - let proc_data = self.meta.acquire(); - let state = proc_data.state; - drop(proc_data); - state + self.state } pub fn name(&self) -> &str { - let pdata = unsafe{ &*self.data.get() }; - from_utf8(&pdata.name).unwrap() + from_utf8(&self.name).unwrap() } - pub fn modify_kill(&self, killed: bool) { - let mut proc_data = self.meta.acquire(); - proc_data.killed = killed; - drop(proc_data); + pub fn modify_kill(&mut self, killed: bool) { + self.killed = killed; } - pub fn page_table(&self) -> &mut Box { - let pdata = unsafe{ &mut *self.data.get() }; - let page_table = pdata.pagetable.as_mut().expect("Fail to get page table"); - page_table - } + // pub fn page_table(&mut self) -> &mut Box { + // &mut self.pagetable.unwrap() + // } /// Create a user page table for a given process, /// with no user memory, but with trampoline pages. - pub fn proc_pagetable(&self) -> Option> { + + + pub fn proc_pagetable(&self) -> *mut PageTable { // An empty page table let mut page_table = unsafe{ PageTable::uvmcreate() }; - + let pagetable = unsafe { &mut *page_table }; // map the trampoline code(for system call return) // at the highest user virtual address. // only the supervisor uses it, on the way // to/from user space, so not PTE_U. unsafe{ - if !page_table.map( + if !pagetable.map( VirtualAddress::new(TRAMPOLINE), PhysicalAddress::new(trampoline as usize), PGSIZE, PteFlags::R | PteFlags::X ) { - page_table.uvm_free(0); - return None + pagetable.uvm_free(0); + return null_mut(); } // map the trapframe just below TRAMPOLINE, for trampoline.S - if !page_table.map( + if !pagetable.map( VirtualAddress::new(TRAPFRAME), - PhysicalAddress::new((&*self.data.get()).get_trapframe() as usize), + PhysicalAddress::new(self.get_trapframe() as usize), PGSIZE, PteFlags::R | PteFlags::W ) { - page_table.uvm_unmap( + pagetable.uvm_unmap( VirtualAddress::new(TRAPFRAME), 1, false ); - page_table.uvm_free(0); - return None + pagetable.uvm_free(0); + return null_mut(); } } - Some(page_table) + page_table } /// free a proc structure and the data hanging from it, /// including user pages. /// p.acquire() must be held. pub fn free_proc(&mut self) { - let mut pdata = self.data.get_mut(); - if !pdata.trapframe.is_null() { - drop(pdata.trapframe as *mut RawPage); - pdata.set_trapframe(0 as *mut Trapframe); + if !self.trapframe.is_null() { + unsafe { drop_in_place(self.trapframe as *mut RawPage) }; + + + + self.set_trapframe(0 as *mut Trapframe); + + // if let Some(page_table) = self.pagetable { + // page_table.proc_free_pagetable(self.size); + // } + let pagetable = unsafe { &mut *self.pagetable }; + + + + // pagetable.proc_free_pagetable(self.size); - if let Some(page_table) = pdata.pagetable.as_mut() { - page_table.proc_free_pagetable(pdata.size); + + + pagetable.free_pagetable(); + self.set_pagetable(0 as *mut PageTable); + + + + unsafe{ + drop_in_place(self.sharemem_bitmap); } + self.sharemem_bitmap = 0 as *mut BitMap; - let mut guard = self.meta.acquire(); - pdata.set_pagetable(None); - pdata.set_parent(None); - pdata.size = 0; + self.set_parent(None); + self.size = 0; - guard.pid = 0; - guard.channel = 0; - guard.killed = false; - guard.xstate = 0; - guard.set_state(ProcState::UNUSED); + - drop(guard); + self.pid = 0; + self.channel = 0; + self.killed = false; + self.xstate = 0; + self.set_state(ProcState::UNUSED); } } + pub fn free_thread(&mut self) { + // if !self.trapframe.is_null() { + // unsafe { drop_in_place(self.trapframe as *mut RawPage); } + + // self.set_trapframe(0 as *mut Trapframe); + + // let pagetable = unsafe { &mut *self.pagetable }; + // pagetable.proc_free_pagetable(self.size); + + // pagetable.free_pagetable(); + self.set_pagetable(0 as *mut PageTable); + self.set_trapframe(0 as *mut Trapframe); + + // self.set_pagetable(None); + self.set_parent(None); + self.size = 0; + + self.thread_ustack = 0; + + self.pid = 0; + self.channel = 0; + self.killed = false; + self.xstate = 0; + self.set_state(ProcState::UNUSED); + + // } + } + /// Grow or shrink user memory by n bytes. /// Return true on success, false on failure. pub fn grow_proc(&mut self, count: isize) -> Result<(), &'static str> { - let mut pdata = self.data.get_mut(); - let mut size = pdata.size; - let page_table = pdata.pagetable.as_mut().unwrap(); + let mut size = self.size; + let page_table = unsafe { &mut *self.pagetable }; if count > 0 { match unsafe { page_table.uvm_alloc(size, size + count as usize) } { Some(new_size) => { @@ -386,7 +449,7 @@ impl Process{ size = page_table.uvm_dealloc(size, new_size); } - pdata.size = size; + self.size = size; Ok(()) } @@ -396,91 +459,126 @@ impl Process{ /// yield is a keyword in rust pub fn yielding(&mut self) { // println!("[Debug] 让出 CPU"); - let mut pmeta = self.meta.acquire(); - let ctx = self.data.get_mut().get_context_mut(); - pmeta.set_state(ProcState::RUNNABLE); + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + + self.set_state(ProcState::RUNNABLE); unsafe { let my_cpu = CPU_MANAGER.mycpu(); - pmeta = my_cpu.sched( - pmeta, - ctx - ); + my_cpu.sched(); } - drop(pmeta) + drop(guard); } /// Atomically release lock and sleep on chan /// Reacquires lock when awakened. - pub fn sleep(&self, channel: usize, lock: SpinlockGuard<'_, T>) { + pub fn sleep(&mut self, channel: usize, lock: SpinlockGuard<'_, T>) { // Must acquire p->lock in order to // change p->state and then call sched. // Once we hold p->lock, we can be // guaranteed that we won't miss any wakeup // (wakeup locks p->lock) // so it's okay to release lk; - let mut guard = self.meta.acquire(); + + + // let mut guard = self.meta.acquire(); + // drop(lock); + // // Go to sleep. + // guard.channel = channel; + // guard.set_state(ProcState::SLEEPING); + // unsafe { + // let my_cpu = CPU_MANAGER.mycpu(); + // let ctx = (&mut (*self.data.get())).get_context_mut(); + // // get schedule process + // guard = my_cpu.sched( + // guard, + // ctx + // ); + // // Tide up + // guard.channel = 0; + // drop(guard); + // } + + let tasks_guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; drop(lock); - // Go to sleep. - guard.channel = channel; - guard.set_state(ProcState::SLEEPING); + + self.channel = channel; + self.state = ProcState::SLEEPING; + unsafe { - let my_cpu = CPU_MANAGER.mycpu(); - let ctx = (&mut (*self.data.get())).get_context_mut(); - // get schedule process - guard = my_cpu.sched( - guard, - ctx - ); - // Tide up - guard.channel = 0; - drop(guard); + let mycpu = CPU_MANAGER.mycpu(); + // let cur_ctx = (&mut self.context); + + mycpu.sched(); } + + self.channel = 0; + + drop(tasks_guard); + } /// Find a unallocated fd pub fn fd_alloc(&mut self, file: &VFile) -> Result{ - let pdata = unsafe { - &mut *self.data.get() - }; - let fd = pdata.find_unallocated_fd()?; - pdata.open_files[fd].replace(Arc::new(file.clone())); + + let fd = self.find_unallocated_fd()?; + self.open_files[fd].replace(Arc::new(file.clone())); Ok(fd) } pub fn fork(&mut self) -> Option<&mut Self> { // 从表中获取未被分配的子进程 - if let Some(child_proc) = unsafe{ PROC_MANAGER.alloc_proc() } { - // 从当前进程的页表拷贝到子进程中 - let pdata = unsafe{ &mut *self.data.get() }; - let child_data = unsafe{ &mut *child_proc.data.get() }; - if unsafe{ pdata.pagetable.as_mut().unwrap().uvm_copy( - child_data.pagetable.as_mut().unwrap(), - pdata.size + if let Some(child_proc) = ProcManager::alloc_proc() { + + //COW + + if unsafe{ self.pagetable.as_mut().unwrap().uvm_copy( + child_proc.pagetable.as_mut().unwrap(), + self.size ).is_err() } { panic!("fork: Fail to copy data from parent process.") } + + // let pgt_a = unsafe { &mut *self.pagetable }; + // let pgt_b = unsafe { &mut *child_proc.pagetable }; + // pgt_a.copy_pagetable_rmW(pgt_b); + + + + // 将当前进程的 trapframe 拷贝到子进程 - let ptf = pdata.trapframe as *const Trapframe; - let child_tf = unsafe{ &mut *child_data.trapframe }; + let ptf = self.trapframe as *const Trapframe; + let child_tf = unsafe{ &mut *child_proc.trapframe }; unsafe{ copy_nonoverlapping(ptf, child_tf, 1); } // fork 后子进程应当返回0 child_tf.a0 = 0; // 子进程拷贝父进程的文件和工作目录 - child_data.open_files.clone_from(&pdata.open_files); - child_data.cwd.clone_from(&pdata.cwd); + child_proc.open_files.clone_from(&self.open_files); + child_proc.cwd.clone_from(&self.cwd); - child_data.name = pdata.name; - child_data.size = pdata.size; + child_proc.name = self.name; + child_proc.size = self.size; - let mut child_meta = child_proc.meta.acquire(); - child_meta.state = ProcState::RUNNABLE; - drop(child_meta); + // let wait = unsafe{ PROC_MANAGER.wait_lock.acquire() }; + child_proc.parent = Some(self as *mut task_struct); + // drop(wait); + + // unsafe { + // (&mut *(self.pagetable)).print_pagetable(); + // (&mut *(child_proc.pagetable)).print_pagetable(); + // } + + + // while(true){ + + // } + + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + child_proc.state = ProcState::RUNNABLE; + drop(guard); - let wait = unsafe{ PROC_MANAGER.wait_lock.acquire() }; - child_data.parent = Some(self as *mut Process); - drop(wait); + // println!("Self pid is {}, child pid is {}", self.pid, child_proc.pid); Some(child_proc) }else { println!("[Kernel] fork: None"); diff --git a/kernel/src/process/thread.rs b/kernel/src/process/thread.rs new file mode 100644 index 0000000..84e95af --- /dev/null +++ b/kernel/src/process/thread.rs @@ -0,0 +1,67 @@ +use crate::{process::*, arch::riscv::layout::PGSIZE}; + +impl task_struct { + pub fn threadclone(&mut self, func: usize, ustack: usize) -> usize { + + let thread = ProcManager::alloc_thread().unwrap(); + thread.parent = Some(self as *mut task_struct); + + // let pgt_p = self.pagetable.as_mut().unwrap(); + // let pgt_t = thread.pagetable.as_mut().unwrap(); + + // pgt_p.copy_pagetable(pgt_t); + thread.pagetable = self.pagetable; + + thread.open_files.clone_from(&self.open_files); + thread.cwd.clone_from(&self.cwd); + + // check page table copy + + // unsafe { (*self.pagetable).print_pagetable() }; + // println!("-----------------------"); + // unsafe { (*thread.pagetable).print_pagetable() }; + // println!("++++++++++++++++++++++"); + // while (true){ + + // } + // println!("In threadclone pid is {} the child is {} func is {} ustack is {}", self.pid, thread.pid, func, ustack); + thread.size = self.size; + thread.name = self.name; //to do + thread.thread_ustack = ustack; + + + + let ptf = self.trapframe as *const Trapframe; + + let ptfaddr = ptf as usize; + let ttfaddr = ptfaddr + size_of::(); + thread.trapframe = ttfaddr as *mut Trapframe; + let ttf = unsafe { &mut *(ttfaddr as *mut Trapframe) }; + + println!("In clone ptf {} ttf {}", ptf as usize, ttf as *const _ as usize); + unsafe{ copy_nonoverlapping(ptf, ttf, 1); } + // ttf.a0 = 0; + + ttf.epc = func; + + ttf.sp = ustack + PGSIZE; + // ttf.ra = 0; + // ttf.s0 = ttf.sp; + //file + + let guard = unsafe { PROC_MANAGER.tasks_lock.acquire() }; + thread.state = ProcState::RUNNABLE; + drop(guard); + + // let ctx_p = &mut self.context; + // let ctx_t = &mut thread.context; + + // println!("In threadclone proc {}, ctx_p {}, thread {} ctx_t {}", self.pid, ctx_p.ra(), thread.pid, ctx_t.ra()); + + + // let tf = unsafe{ &mut *thread.trapframe }; + // println!("In threadclone pid {} epc {}", thread.pid, tf.epc); + thread.pid + } + +} diff --git a/kernel/src/shutdown.rs b/kernel/src/shutdown.rs old mode 100644 new mode 100755 diff --git a/kernel/src/syscall/file.rs b/kernel/src/syscall/file.rs old mode 100644 new mode 100755 index a247d6c..015ceef --- a/kernel/src/syscall/file.rs +++ b/kernel/src/syscall/file.rs @@ -14,6 +14,7 @@ use crate::misc::str_cmp; use crate::{arch::riscv::qemu::{fs::OpenMode, param::MAXPATH}, fs::{FileType, ICACHE, Inode, InodeData, InodeType, LOG, VFile}, lock::sleeplock::{SleepLock, SleepLockGuard}}; use crate::fs::{Pipe, DirEntry}; use super::*; +use crate::process::*; use alloc::string::String; use alloc::sync::Arc; @@ -23,12 +24,12 @@ use bit_field::BitField; impl Syscall<'_> { pub fn sys_dup(&self) -> SysResult { let old_fd = self.arg(0); - let pdata = unsafe{ &mut *self.process.data.get() }; - let file = pdata.open_files[old_fd].as_ref().unwrap(); + let curtask = unsafe { CPU_MANAGER.myproc().unwrap() }; + let file = curtask.open_files[old_fd].as_ref().unwrap(); // 使用 Arc 来代替 refs let new_fd = unsafe{ CPU_MANAGER.alloc_fd(&file) }.unwrap(); let new_file = Arc::clone(&file); - pdata.open_files[new_fd].replace(new_file); + curtask.open_files[new_fd].replace(new_file); Ok(new_fd) } @@ -37,8 +38,8 @@ impl Syscall<'_> { let size: usize; // Get file let fd = self.arg(0); - let pdata = unsafe{ &mut *self.process.data.get() }; - let file = pdata.open_files[fd].as_ref().unwrap(); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let file = task.open_files[fd].as_ref().unwrap(); // 两个参数分别是读取存储的地址和读取的最大字节数 // Get user read address let ptr = self.arg(1); @@ -63,8 +64,8 @@ impl Syscall<'_> { pub fn sys_write(&self) -> SysResult { let size; let fd = self.arg(0); - let pdata = unsafe{ &mut *self.process.data.get() }; - let file = pdata.open_files[fd].as_ref().unwrap(); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let file = task.open_files[fd].as_ref().unwrap(); let ptr = self.arg(1); let len = self.arg(2); match file.write(ptr, len) { @@ -133,6 +134,12 @@ impl Syscall<'_> { file.readable = true; file.writeable = true; }, + InodeType::FIFO => { + file.ftype = FileType::Fifo; + file.offset= 0; + file.readable = true; + file.writeable = true; + } _ => { file.ftype = FileType::Inode; file.offset = 0; @@ -264,9 +271,9 @@ impl Syscall<'_> { pub fn sys_close(&self) -> SysResult { let fd = self.arg(0); - let pdata = unsafe{ &mut *self.process.data.get() }; + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; // 使用 take() 夺取所有权来将引用数减 1 - pdata.open_files[fd].take(); + task.open_files[fd].take(); Ok(0) } @@ -277,8 +284,8 @@ impl Syscall<'_> { #[cfg(feature = "kernel_debug")] println!("[Kernel] sys_fstat: fd: {}, stat:0x{:x}", fd, stat); - let pdata = unsafe{ &mut *self.process.data.get() }; - let file = pdata.open_files[fd].as_ref().unwrap(); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let file = task.open_files[fd].as_ref().unwrap(); #[cfg(feature = "kernel_debug")] println!("[Kernel] sys_fstat: File Type: {:?}", file.ftype); @@ -306,7 +313,8 @@ impl Syscall<'_> { match inode_guard.dinode.itype { InodeType::Directory => { drop(inode_guard); - let old_cwd = unsafe{ (&mut *self.process.data.get()).cwd.replace(inode) }; + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let old_cwd = task.cwd.replace(inode); drop(old_cwd); LOG.end_op(); return Ok(0) @@ -328,11 +336,11 @@ impl Syscall<'_> { } - pub fn sys_pipe(&self) -> SysResult { - // User use an array to represent two file. + pub unsafe fn sys_pipe(&self) -> SysResult { + // User use an array to represent two file. // let mut fd_array: usize = 0; - let mut rf: &mut VFile = &mut VFile::init(); - let mut wf: &mut VFile = &mut VFile::init(); + let mut rf = &mut VFile::init() as *mut VFile; + let mut wf = &mut VFile::init() as *mut VFile; // arg_addr(0, &mut &mut fd_array)?; let fd_array = self.arg(0); Pipe::alloc(&mut rf, &mut wf); @@ -344,7 +352,7 @@ impl Syscall<'_> { // Allocate file descriptor for r/w file. let rfd: usize; let wfd: usize; - match p.fd_alloc(rf) { + match p.fd_alloc(&mut *rf) { Ok(fd) => { rfd = fd; }, @@ -356,7 +364,7 @@ impl Syscall<'_> { } } - match p.fd_alloc(wf) { + match p.fd_alloc(&mut*wf) { Ok(fd) => { wfd = fd; }, @@ -369,10 +377,10 @@ impl Syscall<'_> { } } - let pgt = p.page_table(); - let pdata = unsafe{ &mut *self.process.data.get() }; - let open_files = &mut pdata.open_files; - if pgt.copy_out(fd_array, rf as *const _ as *const u8, size_of::()).is_err() { + let pgt = unsafe { &mut *p.pagetable }; + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let open_files = &mut task.open_files; + if pgt.copy_out(fd_array, &rfd as *const _ as *const u8, 4).is_err() { open_files[rfd].take(); open_files[wfd].take(); // rf.close(); @@ -381,9 +389,9 @@ impl Syscall<'_> { } if pgt.copy_out( - fd_array + size_of::(), - wf as *const _ as *const u8, - size_of::() + fd_array + 4, + &wfd as *const usize as *const u8, + 4 ).is_err() { open_files[rfd].take(); open_files[wfd].take(); diff --git a/kernel/src/syscall/ipc.rs b/kernel/src/syscall/ipc.rs new file mode 100644 index 0000000..87ed8cf --- /dev/null +++ b/kernel/src/syscall/ipc.rs @@ -0,0 +1,341 @@ +use crate::ipc::semaphore::SEM_MANAGER; +// use crate::ipc::fifo::FIFO_MANAGER; +use crate::ipc::fifo::*; +use crate::ipc::msgqueue::*; +use crate::ipc::sharemem::MAX_NAME_LEN; +use crate::ipc::sharemem::SHARE_MEM_MANAGER; +use crate::{arch::riscv::qemu::{fs::OpenMode, param::MAXPATH}, fs::{FileType, ICACHE, Inode, InodeData, InodeType, LOG, VFile}, lock::sleeplock::{SleepLock, SleepLockGuard}}; + +use super::*; + +//TODO Type!!!! + +impl Syscall<'_>{ + + + /**Semaphore */ + pub fn sys_sem_get(&mut self) -> SysResult{ + println!("sys_sem_get in ipc.rs"); + let id = self.arg(0) as i32; + let res = unsafe{SEM_MANAGER.get(id)}; + if res >= 0 { + println!("sys_sem_get res >= 0 in ipc.rs"); + Ok(res as usize) + }else{ + Err(()) + } + // let res = SEM_MANAGER.get(id); + // Ok(res); + } + + pub fn sys_sem_put(&mut self) -> SysResult{ + println!("sys_sem_put in ipc.rs"); + let id = self.arg(0) as i32; + let res = unsafe{SEM_MANAGER.put(id) as usize}; + if res == 0 { + Ok(res) + }else{ + Err(()) + } + } + + pub fn sys_sem_up(&mut self) -> SysResult{ + println!("sys_sem_up in ipc.rs"); + let id = self.arg(0) as i32; + let semOption = unsafe{SEM_MANAGER.getSemById(id)}; + match semOption{ + Some(sem) => { + sem.sem_up(); + Ok(0) + } + None => Err(()) + } + } + + pub fn sys_sem_down(&mut self) -> SysResult{ + println!("sys_sem_down in ipc.rs"); + let id = self.arg(0) as i32; + let semOption = unsafe{SEM_MANAGER.getSemById(id)}; + match semOption{ + Some(sem) => { + sem.sem_down(); + Ok(0) + } + None => Err(()) + } + } + + pub fn sys_sem_init(&mut self) -> SysResult{ + println!("sys_sem_init in ipc.rs"); + let id = self.arg(0) as i32; + let cnt = self.arg(1) as i32; + let semOption = unsafe{SEM_MANAGER.getSemById(id)}; + match semOption{ + Some(sem) => { + sem.sem_init(cnt); + // println!("sys_sem_get in ipc.rs"); + Ok(0) + } + None => Err(()) + } + } + + + + pub fn sys_mkfifo(&self) -> SysResult { + let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + let addr = self.arg(0); + self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + // let mode = self.arg(1); + + + // Fifo_t::alloc(&mut rf, &mut wf, name); + + let fifo_opt = unsafe{FIFO_MANAGER.alloc(name)}; + match fifo_opt { + Some(i) => { + println!("In sys_mkfifo, {} {} {} {}", name[0], name[1], name[2], name[3]); + // let ret = unsafe { (*i).ID }; + Ok(i) + } + + None => { + Err(()) + } + } + + } + + // to_do fd + pub fn sys_fifo_get(&self) -> SysResult{ + let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + let addr = self.arg(0); + self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + let id = self.arg(0); + + let fifo_opt = unsafe{FIFO_MANAGER.get(name)}; + match fifo_opt { + Some(i) => { + println!("In sys_fifo_get, {} {} {} {}", name[0], name[1], name[2], name[3]); + Ok(i) + } + + None => { + Err(()) + } + } + } + + pub fn sys_fifo_put(&self) -> SysResult{ + // let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + // let addr = self.arg(0); + // self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + let id = self.arg(0); + + let fifo_opt = unsafe{FIFO_MANAGER.put(id)}; + match fifo_opt { + Some(i) => { + // println!("In sys_fifo_put, {} {} {} {}", name[0], name[1], name[2], name[3]); + println!("In sys_fifo_put, id {}", id); + Ok(0) + } + + None => { + Err(()) + } + } + } + + pub fn sys_fifo_read(&self) -> SysResult{ + // let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + // let addr = self.arg(0); + // self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + // let fifo_opt = unsafe{FIFO_MANAGER.get(name)}; + + let id = self.arg(0); + let fifo_opt = unsafe { FIFO_MANAGER.getByID(id) }; + + let ptr = self.arg(1); + let len = self.arg(2); + + println!("the ptr is {}, the len is {}", ptr, len); + match fifo_opt { + Some(fifo_ptr) => { + let fifo = unsafe { &mut *fifo_ptr }; + fifo.read(ptr, len); //to_do + // println!("In sys_fifo_read, the name is {} {} {} {}", name[0], name[1], name[2], name[3]); + Ok(0) + } + + None => { + Err(()) + } + } + } + + pub fn sys_fifo_write(&self) -> SysResult { + // let mut name: [u8; NAME_LEN] = [0;NAME_LEN]; + // let addr = self.arg(0); + // self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + let id = self.arg(0); + let fifo_opt = unsafe { FIFO_MANAGER.getByID(id) }; + + + + let ptr = self.arg(1); + let len = self.arg(2); + + // let mut char: [u8; 1] = [0; 1]; + // self.copy_from_str(ptr, &mut char, 1); + // println!("The first is {}", char[0]); + + println!("the ptr is {}, the len is {}", ptr, len); + + match fifo_opt { + Some(fifo_ptr) => { + let fifo = unsafe { &mut *fifo_ptr }; + fifo.write(ptr, len); //to_do + // println!("In sys_fifo_write, finished, the name is {} {} {} {}", name[0], name[1], name[2], name[3]); + Ok(0) + } + + None => { + Err(()) + } + } + } + + + pub fn sys_mq_alloc(&self) -> SysResult { + let mut name: [u8; 16] = [0;16]; + let addr = self.arg(0); + self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + let id = unsafe { MSG_QUE_MANAGER.alloc(name) }; + + match id { + Some(ret) => { + Ok(ret) + } + None => { + Err(()) + } + } + } + + pub fn sys_mq_get(&self) -> SysResult { + let mut name: [u8; 16] = [0;16]; + let addr = self.arg(0); + self.copy_from_str(addr, &mut name, NAME_LEN).unwrap(); + + let id = unsafe {MSG_QUE_MANAGER.get(name) }; + + match id{ + Some(ret) => { + Ok(ret) + } + None => { + Err(()) + } + } + } + + pub fn sys_mq_send(&self) -> SysResult { + let id = self.arg(0); + let addr = self.arg(1); + let len = self.arg(2); + + let ret = unsafe { MSG_QUE_MANAGER.write(id, addr, len) }; + match ret{ + Some(res) => { + Ok(res) + } + None => { + Err(()) + } + } + } + + pub fn sys_mq_recv(&self) -> SysResult { + let id = self.arg(0); + let addr = self.arg(1); + let len = self.arg(2); + + let ret = unsafe { MSG_QUE_MANAGER.read(id, addr, len) }; + match ret{ + Some(res) => { + Ok(res) + } + None => { + Err(()) + } + } + } + + pub fn sys_shm_get(&self) -> SysResult { + let nameAddr = self.arg(0); + let size = self.arg(1); + let flags = self.arg(2); + + let mut name: [u8; MAX_NAME_LEN] = [0; MAX_NAME_LEN]; + self.copy_from_str(nameAddr, &mut name, MAX_NAME_LEN).unwrap(); + + let opt = unsafe { SHARE_MEM_MANAGER.get(name, size, flags) }; + match opt { + Some(id) => { + Ok(id) + } + None => { + Err(()) + } + } + } + + pub fn sys_shm_map(&self) -> SysResult { + let id = self.arg(0); + let shmaddr = self.arg(1); + let shmflag = self.arg(2); + + let opt = unsafe{SHARE_MEM_MANAGER.map(id, shmaddr, shmflag)}; + match opt { + Some(addr) => { + Ok(addr) + } + None => { + Err(()) + } + } + } + + pub fn sys_shm_unmap(&self) -> SysResult { + let id = self.arg(0); + + let opt = unsafe{SHARE_MEM_MANAGER.unmap(id)}; + match opt{ + Some(res) => { + Ok(res) + } + None => { + Err(()) + } + } + } + + pub fn sys_shm_put(&self) -> SysResult { + let id = self.arg(0); + + let opt = unsafe{SHARE_MEM_MANAGER.put(id)}; + match opt{ + Some(res) => { + Ok(res) + } + None => { + Err(()) + } + } + } +} \ No newline at end of file diff --git a/kernel/src/syscall/mod.rs b/kernel/src/syscall/mod.rs index 2766b95..025d6d1 100755 --- a/kernel/src/syscall/mod.rs +++ b/kernel/src/syscall/mod.rs @@ -1,7 +1,9 @@ mod proc; mod file; +mod ipc; pub use proc::*; pub use file::*; +pub use ipc::*; use crate::arch::riscv::qemu::fs::NOFILE; use crate::{println, process::*}; @@ -25,12 +27,16 @@ pub unsafe fn handle_syscall() { let proc = CPU_MANAGER.myproc().unwrap(); let mut syscall = Syscall{ process: proc }; if let Ok(res) = syscall.syscall() { - let pdata = &mut *proc.data.get(); - let tf = &mut *pdata.trapframe; + + let tf = &mut *proc.trapframe; tf.a0 = res; + + // if tf.a7 == 40 || tf.a7 == 1{ + // println!("In handle_syscall pid {} epc {}, sp {}",proc.pid, tf.epc, tf.sp); + // } }else{ - let pdata = &mut *proc.data.get(); - let tf = &mut *pdata.trapframe; + + let tf = &mut *proc.trapframe; tf.a0 = -1 as isize as usize } @@ -61,6 +67,33 @@ pub enum SysCallID { SysLink = 19, SysMkdir = 20, SysClose = 21, + + SysSemGet = 22, + SysSemPut = 23, + SysSemUp = 24, + SysSemDown= 25, + SysSemInit= 26, + + + SysMkfifo = 27, + SysFifoGet = 28, + SysFifoPut = 29, + SysFifoRead = 30, + SysFifoWrite = 31, + + SysMsgAlloc = 32, + SysMsgGet = 33, + SysMsgWrite = 34, + SysMsgRead = 35, + + SysShmGet = 36, + SysShmPut = 37, + SysShmMap = 38, + SysShmUnmap = 39, + + SysClone = 40, + SysJoin = 41, + Unknown } @@ -87,21 +120,48 @@ impl SysCallID { 18 => { Self::SysUnlink }, 19 => { Self::SysLink }, 20 => { Self::SysMkdir }, - 21 => { Self::SysClose } + 21 => { Self::SysClose }, + + 22 => { Self::SysSemGet}, + 23 => { Self::SysSemPut}, + 24 => { Self::SysSemUp}, + 25 => { Self::SysSemDown}, + 26 => { Self::SysSemInit}, + + + 27 => { Self::SysMkfifo}, + 28 => { Self::SysFifoGet}, + 29 => { Self::SysFifoPut}, + 30 => { Self::SysFifoRead}, + 31 => { Self::SysFifoWrite}, + + 32 => { Self::SysMsgAlloc}, + 33 => { Self::SysMsgGet}, + 34 => { Self::SysMsgWrite}, + 35 => { Self::SysMsgRead}, + + 36 => { Self::SysShmGet}, + 37 => { Self::SysShmPut}, + 38 => { Self::SysShmMap}, + 39 => { Self::SysShmUnmap}, + + 40 => { Self::SysClone}, + 41 => { Self::SysJoin}, + _ => { Self::Unknown } } } } pub struct Syscall<'a>{ - process: &'a mut Process + process: &'a mut task_struct } impl Syscall<'_> { pub fn syscall(&mut self) -> SysResult { - let pdata = self.process.data.get_mut(); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; // 获取进程的trapframe - let tf = unsafe{ &mut *pdata.trapframe }; + let tf = unsafe{ &mut *task.trapframe }; // 获取系统调用 id 号 let sys_id = SysCallID::new(tf.a7); @@ -120,18 +180,47 @@ impl Syscall<'_> { SysCallID::SysSbrk => { self.sys_sbrk() }, SysCallID::SysFstat => { self.sys_fstat() }, SysCallID::SysChdir => { self.sys_chdir()}, - SysCallID::SysPipe => { self.sys_pipe() }, + SysCallID::SysPipe => { unsafe { self.sys_pipe() } }, SysCallID::SysUnlink => { self.sys_unlink() }, SysCallID::SysLink => { self.sys_link() }, SysCallID::SysMkdir => { self.sys_mkdir() }, + + SysCallID::SysSemGet => { self.sys_sem_get() }, + SysCallID::SysSemPut => { self.sys_sem_put() }, + SysCallID::SysSemUp => { self.sys_sem_up() }, + SysCallID::SysSemDown => { self.sys_sem_down() }, + SysCallID::SysSemInit => { self.sys_sem_init() }, + + SysCallID::SysClone => { + self.sys_clone() + }, + SysCallID::SysJoin => { self.sys_join() }, + + + SysCallID::SysMsgAlloc => { self.sys_mq_alloc() }, + SysCallID::SysMsgGet => { self.sys_mq_get() }, + SysCallID::SysMsgWrite => { self.sys_mq_send() }, + SysCallID::SysMsgRead => { self.sys_mq_recv() }, + + SysCallID::SysMkfifo => { self.sys_mkfifo()}, + SysCallID::SysFifoGet => { self.sys_fifo_get() }, + SysCallID::SysFifoPut => { self.sys_fifo_put() }, + SysCallID::SysFifoRead => { self.sys_fifo_read() }, + SysCallID::SysFifoWrite => { self.sys_fifo_write() }, + + SysCallID::SysShmGet => { self.sys_shm_get() }, + SysCallID::SysShmPut => { self.sys_shm_put() }, + SysCallID::SysShmMap => { self.sys_shm_map() }, + SysCallID::SysShmUnmap => { self.sys_shm_unmap() }, + _ => { panic!("Invalid syscall id: {:?}", sys_id) } } } /// 获取第n个位置的参数 pub fn arg(&self, id: usize) -> usize { - let pdata = unsafe{ &mut* self.process.data.get() }; - let tf = unsafe{ &*pdata.trapframe }; + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let tf = unsafe{ &*task.trapframe }; match id { 0 => tf.a0, 1 => tf.a1, @@ -145,8 +234,8 @@ impl Syscall<'_> { /// 通过地址获取str并将其填入到缓冲区中 pub fn copy_from_str(&self, addr: usize, buf: &mut [u8], max_len: usize) -> Result<(), ()> { - let pdata = unsafe{ &mut *self.process.data.get() }; - let pgt = pdata.pagetable.as_mut().unwrap(); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let pgt = unsafe { &mut *task.pagetable }; if pgt.copy_in_str(buf.as_mut_ptr(), addr, max_len).is_err() { println!("Fail to copy in str"); return Err(()) @@ -155,15 +244,15 @@ impl Syscall<'_> { } pub fn copy_form_addr(&self, addr: usize, buf: &mut [u8], len: usize) -> Result<(), ()> { - let pdata = unsafe{ &mut *self.process.data.get() }; + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; - if addr > pdata.size || addr + size_of::() > pdata.size { + if addr > task.size || addr + size_of::() > task.size { println!("[Debug] addr: 0x{:x}", addr); - println!("[Debug] pdata size: 0x{:x}", pdata.size); + println!("[Debug] task size: 0x{:x}", task.size); panic!("拷贝的地址值超出了进程") } - let pgt = pdata.pagetable.as_mut().unwrap(); + let pgt = unsafe { &mut *task.pagetable }; if pgt.copy_in(buf.as_mut_ptr(), addr, len).is_err() { println!("Fail copy data from pagetable!"); return Err(()) diff --git a/kernel/src/syscall/proc.rs b/kernel/src/syscall/proc.rs index d57735e..f61070e 100755 --- a/kernel/src/syscall/proc.rs +++ b/kernel/src/syscall/proc.rs @@ -1,17 +1,29 @@ -use crate::trap::TICKS_LOCK; +use crate::{trap::TICKS_LOCK, memory::page_round_up}; use super::*; impl Syscall<'_> { pub fn sys_fork(&mut self) -> SysResult { - let proc_meta = self.process.meta.acquire(); - drop(proc_meta); + let child_proc = self.process.fork().ok_or(())?; - let pmeta = child_proc.meta.acquire(); - let pid = pmeta.pid; - drop(pmeta); + + let pid = child_proc.pid; + Ok(pid) } + pub fn sys_clone(&mut self) -> SysResult { + let func = self.arg(0); + + let ustack = self.arg(1); + + let ret = self.process.threadclone(func, ustack); + + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let tf = unsafe { &mut *task.trapframe } ; + println!("In sys_clone, pid {} epc {}", task.pid, tf.epc); + Ok(ret) + } + pub fn sys_exit(&self) -> SysResult { let status = self.arg(0); unsafe { @@ -34,19 +46,35 @@ impl Syscall<'_> { } } + pub fn sys_join(&self) -> SysResult { + let ustack_addr = self.arg(0); + match unsafe { + PROC_MANAGER.join(ustack_addr) + } { + Some(ret) => { + Ok(ret) + }, + + None => { + Err(()) + } + } + } + pub fn sys_getpid(&self) -> SysResult { - let pmeta = self.process.meta.acquire(); - let pid = pmeta.pid; - drop(pmeta); + let task = unsafe { CPU_MANAGER.myproc().unwrap() }; + let pid = task.pid; + Ok(pid) } pub fn sys_sbrk(&mut self) -> SysResult { let size = self.arg(0); - let pdata = unsafe{ &*self.process.data.get() }; - let addr = pdata.size; - drop(pdata); + + let task = unsafe{ &mut *self.process }; + let addr = task.size; + match self.process.grow_proc(size as isize) { Ok(()) => { return Ok(addr) @@ -56,6 +84,13 @@ impl Syscall<'_> { panic!("err: {:?}", err); } } + + + //TODO Lazy allocation + + // task.size += page_round_up(size); + + // Ok(0) } diff --git a/kernel/src/trap.rs b/kernel/src/trap.rs index bc02dbc..c535246 100755 --- a/kernel/src/trap.rs +++ b/kernel/src/trap.rs @@ -1,5 +1,12 @@ +use core::intrinsics::write_bytes; use core::panic; +use core::mem::*; +use crate::memory::PageAllocator; +use crate::memory::PhysicalAddress; +use crate::memory::VirtualAddress; +use crate::memory::mapping::page_table_entry::{ PageTableEntry, PteFlags}; +use crate::memory::page_round_down; use crate::syscall::handle_syscall; use crate::driver::plic::{plic_claim, plic_complete}; use crate::driver::virtio_disk::DISK; @@ -30,6 +37,7 @@ pub unsafe fn trap_init_hart() { pub unsafe fn user_trap() { let sepc = sepc::read(); let scause = Scause::new(scause::read()); + let stval = stval::read(); if !sstatus::is_from_user() { panic!("user_trap(): not from user mode"); @@ -42,16 +50,21 @@ pub unsafe fn user_trap() { stvec::write(kernelvec as usize); let my_proc = CPU_MANAGER.myproc().unwrap(); - let pdata = my_proc.data.get_mut(); - - let tf = &mut *pdata.trapframe; + let tf = &mut *my_proc.trapframe; tf.epc = sepc; - + // println!("{}", sepc); match scause.cause() { + Trap::Exception(Exception::UserEnvCall) => { + + // if tf.a7 == 40 { + // println!("In cause, pid {}", my_proc.pid); + // } + + // user system call if my_proc.killed() { - exit(-1); + PROC_MANAGER.exit(1); } // Spec points to the ecall instruction, // but we want to return to the next instrcution @@ -61,6 +74,7 @@ pub unsafe fn user_trap() { // so don't enable until done with those registers. sstatus::intr_on(); handle_syscall(); + }, // Device interrupt @@ -97,12 +111,26 @@ pub unsafe fn user_trap() { // the SSIP bit in sip. sip::clear_ssip(); if my_proc.killed() { - exit(-1); + PROC_MANAGER.exit(1); } // yield up the CPU if this is a timer interrupt my_proc.yielding(); }, + // Trap::Exception(Exception::LoadPageFault | Exception::StorePageFault) => { + // let mut va = page_round_down(stval); + // let mut pa = RawPage::new_zeroed(); + // write_bytes(pa as *mut u8, 0, PGSIZE); + + // let task = CPU_MANAGER.myproc().unwrap(); + // let pgtable = &mut *task.pagetable; + + // pgtable.map(VirtualAddress::new(va), + // PhysicalAddress::new(pa), + // PGSIZE, + // PteFlags::W | PteFlags::R | PteFlags::X | PteFlags::U); + // } + _ => { println!("usertrap: unexpected scacuse: {:?}\n pid: {}", scause.cause(), my_proc.pid()); println!("sepc: 0x{:x}, stval: 0x{:x}", sepc, stval::read()); @@ -112,9 +140,12 @@ pub unsafe fn user_trap() { } if my_proc.killed() { - exit(-1); + PROC_MANAGER.exit(1); } + // if tf.a7 == 40 { + // println!("In user_trap, pid {} epc {} sp {}", my_proc.pid, tf.epc, tf.sp); + // } user_trap_ret(); } @@ -141,8 +172,19 @@ pub unsafe fn user_trap_ret() -> ! { // set up trapframe values that uservec will need when // the process next re-enters the kernel. - let pdata = my_proc.data.get_mut(); - pdata.user_init(); + + // my_proc.user_init(); + + let tf = &mut *my_proc.trapframe; + // kernel page table + tf.kernel_satp = satp::read(); + // process's kernel stack + tf.kernel_sp = my_proc.kstack + PGSIZE * 4; + // kernel user trap address + tf.kernel_trap = user_trap as usize; + // current process's cpu id. + tf.kernel_hartid = cpu::cpuid(); + // set up the registers that trampoline.S's sret will use // to get to user space. @@ -153,10 +195,19 @@ pub unsafe fn user_trap_ret() -> ! { sstatus::write(sstatus); // set S Exception Program Counter to the saved user pc. - sepc::write((*pdata.trapframe).epc); + // if tf.a7 == 1 { + // println!("hehe pid {} epc {} ra {}", my_proc.pid, tf.epc, tf.ra); + // } + sepc::write(tf.epc); + + // if (*my_proc.trapframe).epc == 0 { + // println!("In user_trap_ret, pid {}", my_proc.pid); + // } + + // println!("------{}", (*my_proc.trapframe).epc); // tell trampoline.S the user page table to switch to - let satp = pdata.pagetable.as_ref().unwrap().as_satp(); + let satp = my_proc.pagetable.as_ref().unwrap().as_satp(); // jump to trampoline.S at the top of memory, which // switches to the user page table, restores user registers, @@ -164,7 +215,8 @@ pub unsafe fn user_trap_ret() -> ! { let userret_virt = TRAMPOLINE + (userret as usize - trampoline as usize); let userret_virt: extern "C" fn(usize, usize) -> ! = core::mem::transmute(userret_virt as usize); - userret_virt(TRAPFRAME, satp); + + userret_virt(TRAPFRAME + (my_proc.thread * size_of::()), satp); } /// interrupts and exceptions from kernel code go here via kernelvec, @@ -206,6 +258,8 @@ pub unsafe fn kernel_trap( panic!("[Panic] Store Page Fault!\n stval: 0x{:x}\n sepc: 0x{:x}\n", stval, sepc); }, + + Trap::Exception(Exception::KernelEnvCall) => { match which { SHUTDOWN => { diff --git a/mkfs/.gitignore b/mkfs/.gitignore old mode 100644 new mode 100755 diff --git a/mkfs/Cargo.lock b/mkfs/Cargo.lock old mode 100644 new mode 100755 diff --git a/mkfs/Cargo.toml b/mkfs/Cargo.toml old mode 100644 new mode 100755 diff --git a/mkfs/Makefile b/mkfs/Makefile old mode 100644 new mode 100755 diff --git a/mkfs/src/main.rs b/mkfs/src/main.rs old mode 100644 new mode 100755 diff --git a/null.d b/null.d new file mode 100644 index 0000000..ff21f30 --- /dev/null +++ b/null.d @@ -0,0 +1 @@ +null.o: /dev/null diff --git a/user/.cargo/config.toml b/user/.cargo/config.toml old mode 100644 new mode 100755 diff --git a/user/src/allocator.rs b/user/src/allocator.rs old mode 100644 new mode 100755 diff --git a/user/src/bin/init.rs b/user/src/bin/init.rs old mode 100644 new mode 100755 diff --git a/user/src/bin/sh.rs b/user/src/bin/sh.rs old mode 100644 new mode 100755 diff --git a/user/src/print.rs b/user/src/print.rs old mode 100644 new mode 100755 diff --git a/utils/Makefile b/utils/Makefile old mode 100644 new mode 100755 diff --git a/utils/gen.py b/utils/gen.py old mode 100644 new mode 100755 diff --git a/xv6-user b/xv6-user deleted file mode 160000 index 29018ea..0000000 --- a/xv6-user +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 29018eaa2e42139cb2b091dfdf31215516a4a9b4 diff --git a/xv6-user/.gitignore b/xv6-user/.gitignore new file mode 100755 index 0000000..c0e8380 --- /dev/null +++ b/xv6-user/.gitignore @@ -0,0 +1,5 @@ +_* +*.asm +*.d +*.o +*.sym \ No newline at end of file diff --git a/xv6-user/LICENSE b/xv6-user/LICENSE new file mode 100755 index 0000000..b9f1b62 --- /dev/null +++ b/xv6-user/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Ko.ok OS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/xv6-user/README.md b/xv6-user/README.md new file mode 100755 index 0000000..06beda2 --- /dev/null +++ b/xv6-user/README.md @@ -0,0 +1,2 @@ +# xv6-user +user programe copy from xv6-riscv diff --git a/xv6-user/cat.c b/xv6-user/cat.c new file mode 100755 index 0000000..971716b --- /dev/null +++ b/xv6-user/cat.c @@ -0,0 +1,43 @@ +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +char buf[512]; + +void +cat(int fd) +{ + int n; + + while((n = read(fd, buf, sizeof(buf))) > 0) { + if (write(1, buf, n) != n) { + fprintf(2, "cat: write error\n"); + exit(1); + } + } + if(n < 0){ + fprintf(2, "cat: read error\n"); + exit(1); + } +} + +int +main(int argc, char *argv[]) +{ + int fd, i; + + if(argc <= 1){ + cat(0); + exit(0); + } + + for(i = 1; i < argc; i++){ + if((fd = open(argv[i], 0)) < 0){ + fprintf(2, "cat: cannot open %s\n", argv[i]); + exit(1); + } + cat(fd); + close(fd); + } + exit(0); +} \ No newline at end of file diff --git a/xv6-user/echo.c b/xv6-user/echo.c new file mode 100755 index 0000000..afd7239 --- /dev/null +++ b/xv6-user/echo.c @@ -0,0 +1,21 @@ +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +int +main(int argc, char *argv[]) +{ + int i; + + // printf("$$$ %d\n", argc); + + for(i = 1; i < argc; i++){ + write(1, argv[i], strlen(argv[i])); + if(i + 1 < argc){ + write(1, " ", 1); + } else { + write(1, "\n", 1); + } + } + exit(0); +} \ No newline at end of file diff --git a/xv6-user/fifo_test1.c b/xv6-user/fifo_test1.c new file mode 100644 index 0000000..185f735 --- /dev/null +++ b/xv6-user/fifo_test1.c @@ -0,0 +1,17 @@ +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +int main(){ + + int fd = mkfifo("TEST"); + + char* buf = "Hello, World!"; + + printf("Process 1, write [Hello, World] to fifo\n"); + fifo_write(fd, buf, 14); + + + printf("Write Finished\n"); + exit(0); +} \ No newline at end of file diff --git a/xv6-user/fifo_test2.c b/xv6-user/fifo_test2.c new file mode 100644 index 0000000..407c681 --- /dev/null +++ b/xv6-user/fifo_test2.c @@ -0,0 +1,16 @@ +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +int main(){ + char buf[14]; + int fd = fifo_get("TEST"); + + fifo_read(fd, buf, 14); + + printf("Process 2, read [%s] from fifo", buf); + + fifo_put(fd); + + exit(0); +} \ No newline at end of file diff --git a/xv6-user/fork_test.c b/xv6-user/fork_test.c new file mode 100644 index 0000000..71db843 --- /dev/null +++ b/xv6-user/fork_test.c @@ -0,0 +1,54 @@ +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +#define N 1 + +void +forktest(void) +{ + int n, pid; + + printf("fork test\n"); + + for(n=0; n 0; n--){ + if(wait(0) < 0){ + // printf("wait stopped early\n"); + exit(1); + } + } + + if(wait(0) != -1){ + // printf("wait got too many\n"); + exit(1); + } + + printf("fork test OK\n"); +} + +int +main(void) +{ + forktest(); + exit(0); +} \ No newline at end of file diff --git a/xv6-user/forktest.c b/xv6-user/forktest.c new file mode 100755 index 0000000..f41e377 --- /dev/null +++ b/xv6-user/forktest.c @@ -0,0 +1,61 @@ +// Test that fork fails gracefully. +// Tiny executable so that the limit can be filling the proc table. + +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +#define N 1000 + +void +print(const char *s) +{ + write(1, s, strlen(s)); +} + +void +forktest(void) +{ + int n, pid; + + print("fork test\n"); + + for(n=0; n 0; n--){ + if(wait(0) < 0){ + print("wait stopped early\n"); + exit(1); + } + } + + if(wait(0) != -1){ + print("wait got too many\n"); + exit(1); + } + + print("fork test OK\n"); +} + +int +main(void) +{ + forktest(); + exit(0); +} \ No newline at end of file diff --git a/xv6-user/include/fcntl.h b/xv6-user/include/fcntl.h new file mode 100755 index 0000000..2a17644 --- /dev/null +++ b/xv6-user/include/fcntl.h @@ -0,0 +1,5 @@ +#define O_RDONLY 0x000 +#define O_WRONLY 0x001 +#define O_RDWR 0x002 +#define O_CREATE 0x200 +#define O_TRUNC 0x400 \ No newline at end of file diff --git a/xv6-user/include/file.h b/xv6-user/include/file.h new file mode 100755 index 0000000..c2f44a6 --- /dev/null +++ b/xv6-user/include/file.h @@ -0,0 +1,40 @@ +struct file { + enum { FD_NONE, FD_PIPE, FD_INODE, FD_DEVICE } type; + int ref; // reference count + char readable; + char writable; + struct pipe *pipe; // FD_PIPE + struct inode *ip; // FD_INODE and FD_DEVICE + uint off; // FD_INODE + short major; // FD_DEVICE +}; + +#define major(dev) ((dev) >> 16 & 0xFFFF) +#define minor(dev) ((dev) & 0xFFFF) +#define mkdev(m,n) ((uint)((m)<<16| (n))) + +// in-memory copy of an inode +struct inode { + uint dev; // Device number + uint inum; // Inode number + int ref; // Reference count + struct sleeplock lock; // protects everything below here + int valid; // inode has been read from disk? + + short type; // copy of disk inode + short major; + short minor; + short nlink; + uint size; + uint addrs[NDIRECT+1]; +}; + +// map major device number to device functions. +struct devsw { + int (*read)(int, uint64, int); + int (*write)(int, uint64, int); +}; + +extern struct devsw devsw[]; + +#define CONSOLE 1 \ No newline at end of file diff --git a/xv6-user/include/fs.h b/xv6-user/include/fs.h new file mode 100755 index 0000000..15b2b9a --- /dev/null +++ b/xv6-user/include/fs.h @@ -0,0 +1,59 @@ +// On-disk file system format. +// Both the kernel and user programs use this header file. + + +#define ROOTINO 1 // root i-number +#define BSIZE 1024 // block size + +// Disk layout: +// [ boot block | super block | log | inode blocks | +// free bit map | data blocks] +// +// mkfs computes the super block and builds an initial file system. The +// super block describes the disk layout: +struct superblock { + uint magic; // Must be FSMAGIC + uint size; // Size of file system image (blocks) + uint nblocks; // Number of data blocks + uint ninodes; // Number of inodes. + uint nlog; // Number of log blocks + uint logstart; // Block number of first log block + uint inodestart; // Block number of first inode block + uint bmapstart; // Block number of first free map block +}; + +#define FSMAGIC 0x10203040 + +#define NDIRECT 12 +#define NINDIRECT (BSIZE / sizeof(uint)) +#define MAXFILE (NDIRECT + NINDIRECT) + +// On-disk inode structure +struct dinode { + short type; // File type + short major; // Major device number (T_DEVICE only) + short minor; // Minor device number (T_DEVICE only) + short nlink; // Number of links to inode in file system + uint size; // Size of file (bytes) + uint addrs[NDIRECT+1]; // Data block addresses +}; + +// Inodes per block. +#define IPB (BSIZE / sizeof(struct dinode)) + +// Block containing inode i +#define IBLOCK(i, sb) ((i) / IPB + sb.inodestart) + +// Bitmap bits per block +#define BPB (BSIZE*8) + +// Block of free map containing bit for block b +#define BBLOCK(b, sb) ((b)/BPB + sb.bmapstart) + +// Directory is a file containing a sequence of dirent structures. +#define DIRSIZ 14 + +struct dirent { + ushort inum; + char name[DIRSIZ]; +}; \ No newline at end of file diff --git a/xv6-user/include/memlayout.h b/xv6-user/include/memlayout.h new file mode 100755 index 0000000..fea9ecd --- /dev/null +++ b/xv6-user/include/memlayout.h @@ -0,0 +1,67 @@ +// Physical memory layout + +// qemu -machine virt is set up like this, +// based on qemu's hw/riscv/virt.c: +// +// 00001000 -- boot ROM, provided by qemu +// 02000000 -- CLINT +// 0C000000 -- PLIC +// 10000000 -- uart0 +// 10001000 -- virtio disk +// 80000000 -- boot ROM jumps here in machine mode +// -kernel loads the kernel here +// unused RAM after 80000000. + +// the kernel uses physical memory thus: +// 80000000 -- entry.S, then kernel text and data +// end -- start of kernel page allocation area +// PHYSTOP -- end RAM used by the kernel + +// qemu puts UART registers here in physical memory. +#define UART0 0x10000000L +#define UART0_IRQ 10 + +// virtio mmio interface +#define VIRTIO0 0x10001000 +#define VIRTIO0_IRQ 1 + +// core local interruptor (CLINT), which contains the timer. +#define CLINT 0x2000000L +#define CLINT_MTIMECMP(hartid) (CLINT + 0x4000 + 8*(hartid)) +#define CLINT_MTIME (CLINT + 0xBFF8) // cycles since boot. + +// qemu puts platform-level interrupt controller (PLIC) here. +#define PLIC 0x0c000000L +#define PLIC_PRIORITY (PLIC + 0x0) +#define PLIC_PENDING (PLIC + 0x1000) +#define PLIC_MENABLE(hart) (PLIC + 0x2000 + (hart)*0x100) +#define PLIC_SENABLE(hart) (PLIC + 0x2080 + (hart)*0x100) +#define PLIC_MPRIORITY(hart) (PLIC + 0x200000 + (hart)*0x2000) +#define PLIC_SPRIORITY(hart) (PLIC + 0x201000 + (hart)*0x2000) +#define PLIC_MCLAIM(hart) (PLIC + 0x200004 + (hart)*0x2000) +#define PLIC_SCLAIM(hart) (PLIC + 0x201004 + (hart)*0x2000) + +// the kernel expects there to be RAM +// for use by the kernel and user pages +// from physical address 0x80000000 to PHYSTOP. +#define KERNBASE 0x80000000L +#define PHYSTOP (KERNBASE + 128*1024*1024) + +// map the trampoline page to the highest address, +// in both user and kernel space. +#define TRAMPOLINE (MAXVA - PGSIZE) + +// map kernel stacks beneath the trampoline, +// each surrounded by invalid guard pages. +#define KSTACK(p) (TRAMPOLINE - ((p)+1)* 2*PGSIZE) + +// User memory layout. +// Address zero first: +// text +// original data and bss +// fixed-size stack +// expandable heap +// ... +// TRAPFRAME (p->trapframe, used by the trampoline) +// TRAMPOLINE (the same page as in the kernel) +#define TRAPFRAME (TRAMPOLINE - PGSIZE) \ No newline at end of file diff --git a/xv6-user/include/param.h b/xv6-user/include/param.h new file mode 100755 index 0000000..bc48576 --- /dev/null +++ b/xv6-user/include/param.h @@ -0,0 +1,13 @@ +#define NPROC 64 // maximum number of processes +#define NCPU 8 // maximum number of CPUs +#define NOFILE 16 // open files per process +#define NFILE 100 // open files per system +#define NINODE 50 // maximum number of active i-nodes +#define NDEV 10 // maximum major device number +#define ROOTDEV 1 // device number of file system root disk +#define MAXARG 32 // max exec arguments +#define MAXOPBLOCKS 10 // max # of blocks any FS op writes +#define LOGSIZE (MAXOPBLOCKS*3) // max data blocks in on-disk log +#define NBUF (MAXOPBLOCKS*3) // size of disk block cache +#define FSSIZE 1000 // size of file system in blocks +#define MAXPATH 128 // maximum file path name \ No newline at end of file diff --git a/xv6-user/include/riscv.h b/xv6-user/include/riscv.h new file mode 100755 index 0000000..61a7bee --- /dev/null +++ b/xv6-user/include/riscv.h @@ -0,0 +1,354 @@ +// which hart (core) is this? +static inline uint64 +r_mhartid() +{ + uint64 x; + asm volatile("csrr %0, mhartid" : "=r" (x) ); + return x; +} + +// Machine Status Register, mstatus + +#define MSTATUS_MPP_MASK (3L << 11) // previous mode. +#define MSTATUS_MPP_M (3L << 11) +#define MSTATUS_MPP_S (1L << 11) +#define MSTATUS_MPP_U (0L << 11) +#define MSTATUS_MIE (1L << 3) // machine-mode interrupt enable. + +static inline uint64 +r_mstatus() +{ + uint64 x; + asm volatile("csrr %0, mstatus" : "=r" (x) ); + return x; +} + +static inline void +w_mstatus(uint64 x) +{ + asm volatile("csrw mstatus, %0" : : "r" (x)); +} + +// machine exception program counter, holds the +// instruction address to which a return from +// exception will go. +static inline void +w_mepc(uint64 x) +{ + asm volatile("csrw mepc, %0" : : "r" (x)); +} + +// Supervisor Status Register, sstatus + +#define SSTATUS_SPP (1L << 8) // Previous mode, 1=Supervisor, 0=User +#define SSTATUS_SPIE (1L << 5) // Supervisor Previous Interrupt Enable +#define SSTATUS_UPIE (1L << 4) // User Previous Interrupt Enable +#define SSTATUS_SIE (1L << 1) // Supervisor Interrupt Enable +#define SSTATUS_UIE (1L << 0) // User Interrupt Enable + +static inline uint64 +r_sstatus() +{ + uint64 x; + asm volatile("csrr %0, sstatus" : "=r" (x) ); + return x; +} + +static inline void +w_sstatus(uint64 x) +{ + asm volatile("csrw sstatus, %0" : : "r" (x)); +} + +// Supervisor Interrupt Pending +static inline uint64 +r_sip() +{ + uint64 x; + asm volatile("csrr %0, sip" : "=r" (x) ); + return x; +} + +static inline void +w_sip(uint64 x) +{ + asm volatile("csrw sip, %0" : : "r" (x)); +} + +// Supervisor Interrupt Enable +#define SIE_SEIE (1L << 9) // external +#define SIE_STIE (1L << 5) // timer +#define SIE_SSIE (1L << 1) // software +static inline uint64 +r_sie() +{ + uint64 x; + asm volatile("csrr %0, sie" : "=r" (x) ); + return x; +} + +static inline void +w_sie(uint64 x) +{ + asm volatile("csrw sie, %0" : : "r" (x)); +} + +// Machine-mode Interrupt Enable +#define MIE_MEIE (1L << 11) // external +#define MIE_MTIE (1L << 7) // timer +#define MIE_MSIE (1L << 3) // software +static inline uint64 +r_mie() +{ + uint64 x; + asm volatile("csrr %0, mie" : "=r" (x) ); + return x; +} + +static inline void +w_mie(uint64 x) +{ + asm volatile("csrw mie, %0" : : "r" (x)); +} + +// machine exception program counter, holds the +// instruction address to which a return from +// exception will go. +static inline void +w_sepc(uint64 x) +{ + asm volatile("csrw sepc, %0" : : "r" (x)); +} + +static inline uint64 +r_sepc() +{ + uint64 x; + asm volatile("csrr %0, sepc" : "=r" (x) ); + return x; +} + +// Machine Exception Delegation +static inline uint64 +r_medeleg() +{ + uint64 x; + asm volatile("csrr %0, medeleg" : "=r" (x) ); + return x; +} + +static inline void +w_medeleg(uint64 x) +{ + asm volatile("csrw medeleg, %0" : : "r" (x)); +} + +// Machine Interrupt Delegation +static inline uint64 +r_mideleg() +{ + uint64 x; + asm volatile("csrr %0, mideleg" : "=r" (x) ); + return x; +} + +static inline void +w_mideleg(uint64 x) +{ + asm volatile("csrw mideleg, %0" : : "r" (x)); +} + +// Supervisor Trap-Vector Base Address +// low two bits are mode. +static inline void +w_stvec(uint64 x) +{ + asm volatile("csrw stvec, %0" : : "r" (x)); +} + +static inline uint64 +r_stvec() +{ + uint64 x; + asm volatile("csrr %0, stvec" : "=r" (x) ); + return x; +} + +// Machine-mode interrupt vector +static inline void +w_mtvec(uint64 x) +{ + asm volatile("csrw mtvec, %0" : : "r" (x)); +} + +// use riscv's sv39 page table scheme. +#define SATP_SV39 (8L << 60) + +#define MAKE_SATP(pagetable) (SATP_SV39 | (((uint64)pagetable) >> 12)) + +// supervisor address translation and protection; +// holds the address of the page table. +static inline void +w_satp(uint64 x) +{ + asm volatile("csrw satp, %0" : : "r" (x)); +} + +static inline uint64 +r_satp() +{ + uint64 x; + asm volatile("csrr %0, satp" : "=r" (x) ); + return x; +} + +// Supervisor Scratch register, for early trap handler in trampoline.S. +static inline void +w_sscratch(uint64 x) +{ + asm volatile("csrw sscratch, %0" : : "r" (x)); +} + +static inline void +w_mscratch(uint64 x) +{ + asm volatile("csrw mscratch, %0" : : "r" (x)); +} + +// Supervisor Trap Cause +static inline uint64 +r_scause() +{ + uint64 x; + asm volatile("csrr %0, scause" : "=r" (x) ); + return x; +} + +// Supervisor Trap Value +static inline uint64 +r_stval() +{ + uint64 x; + asm volatile("csrr %0, stval" : "=r" (x) ); + return x; +} + +// Machine-mode Counter-Enable +static inline void +w_mcounteren(uint64 x) +{ + asm volatile("csrw mcounteren, %0" : : "r" (x)); +} + +static inline uint64 +r_mcounteren() +{ + uint64 x; + asm volatile("csrr %0, mcounteren" : "=r" (x) ); + return x; +} + +// machine-mode cycle counter +static inline uint64 +r_time() +{ + uint64 x; + asm volatile("csrr %0, time" : "=r" (x) ); + return x; +} + +// enable device interrupts +static inline void +intr_on() +{ + w_sstatus(r_sstatus() | SSTATUS_SIE); +} + +// disable device interrupts +static inline void +intr_off() +{ + w_sstatus(r_sstatus() & ~SSTATUS_SIE); +} + +// are device interrupts enabled? +static inline int +intr_get() +{ + uint64 x = r_sstatus(); + return (x & SSTATUS_SIE) != 0; +} + +static inline uint64 +r_sp() +{ + uint64 x; + asm volatile("mv %0, sp" : "=r" (x) ); + return x; +} + +// read and write tp, the thread pointer, which holds +// this core's hartid (core number), the index into cpus[]. +static inline uint64 +r_tp() +{ + uint64 x; + asm volatile("mv %0, tp" : "=r" (x) ); + return x; +} + +static inline void +w_tp(uint64 x) +{ + asm volatile("mv tp, %0" : : "r" (x)); +} + +static inline uint64 +r_ra() +{ + uint64 x; + asm volatile("mv %0, ra" : "=r" (x) ); + return x; +} + +// flush the TLB. +static inline void +sfence_vma() +{ + // the zero, zero means flush all TLB entries. + asm volatile("sfence.vma zero, zero"); +} + + +#define PGSIZE 4096 // bytes per page +#define PGSHIFT 12 // bits of offset within a page + +#define PGROUNDUP(sz) (((sz)+PGSIZE-1) & ~(PGSIZE-1)) +#define PGROUNDDOWN(a) (((a)) & ~(PGSIZE-1)) + +#define PTE_V (1L << 0) // valid +#define PTE_R (1L << 1) +#define PTE_W (1L << 2) +#define PTE_X (1L << 3) +#define PTE_U (1L << 4) // 1 -> user can access + +// shift a physical address to the right place for a PTE. +#define PA2PTE(pa) ((((uint64)pa) >> 12) << 10) + +#define PTE2PA(pte) (((pte) >> 10) << 12) + +#define PTE_FLAGS(pte) ((pte) & 0x3FF) + +// extract the three 9-bit page table indices from a virtual address. +#define PXMASK 0x1FF // 9 bits +#define PXSHIFT(level) (PGSHIFT+(9*(level))) +#define PX(level, va) ((((uint64) (va)) >> PXSHIFT(level)) & PXMASK) + +// one beyond the highest possible virtual address. +// MAXVA is actually one bit less than the max allowed by +// Sv39, to avoid having to sign-extend virtual addresses +// that have the high bit set. +#define MAXVA (1L << (9 + 9 + 9 + 12 - 1)) + +typedef uint64 pte_t; +typedef uint64 *pagetable_t; // 512 PTEs \ No newline at end of file diff --git a/xv6-user/include/sleeplock.h b/xv6-user/include/sleeplock.h new file mode 100755 index 0000000..d40463b --- /dev/null +++ b/xv6-user/include/sleeplock.h @@ -0,0 +1,9 @@ +// Long-term locks for processes +struct sleeplock { + uint locked; // Is the lock held? + struct spinlock lk; // spinlock protecting this sleep lock + + // For debugging: + char *name; // Name of lock. + int pid; // Process holding lock +}; \ No newline at end of file diff --git a/xv6-user/include/spinlock.h b/xv6-user/include/spinlock.h new file mode 100755 index 0000000..f8c92cc --- /dev/null +++ b/xv6-user/include/spinlock.h @@ -0,0 +1,8 @@ +// Mutual exclusion lock. +struct spinlock { + uint locked; // Is the lock held? + + // For debugging: + char *name; // Name of lock. + struct cpu *cpu; // The cpu holding the lock. +}; diff --git a/xv6-user/include/stat.h b/xv6-user/include/stat.h new file mode 100755 index 0000000..e67c4d1 --- /dev/null +++ b/xv6-user/include/stat.h @@ -0,0 +1,11 @@ +#define T_DIR 1 // Directory +#define T_FILE 2 // File +#define T_DEVICE 3 // Device + +struct stat { + int dev; // File system's disk device + uint ino; // Inode number + short type; // Type of file + short nlink; // Number of links to file + uint64 size; // Size of file in bytes +}; \ No newline at end of file diff --git a/xv6-user/include/syscall.h b/xv6-user/include/syscall.h new file mode 100755 index 0000000..8be91ac --- /dev/null +++ b/xv6-user/include/syscall.h @@ -0,0 +1,47 @@ +// System call numbers +#define SYS_fork 1 +#define SYS_exit 2 +#define SYS_wait 3 +#define SYS_pipe 4 +#define SYS_read 5 +#define SYS_kill 6 +#define SYS_exec 7 +#define SYS_fstat 8 +#define SYS_chdir 9 +#define SYS_dup 10 +#define SYS_getpid 11 +#define SYS_sbrk 12 +#define SYS_sleep 13 +#define SYS_uptime 14 +#define SYS_open 15 +#define SYS_write 16 +#define SYS_mknod 17 +#define SYS_unlink 18 +#define SYS_link 19 +#define SYS_mkdir 20 +#define SYS_close 21 + +#define SYS_sem_get 22 +#define SYS_sem_put 23 +#define SYS_sem_up 24 +#define SYS_sem_down 25 +#define SYS_sem_init 26 + +#define SYS_mkfifo 27 +#define SYS_fifo_get 28 +#define SYS_fifo_put 29 +#define SYS_fifo_read 30 +#define SYS_fifo_write 31 + +#define SYS_msg_alloc 32 +#define SYS_msg_get 33 +#define SYS_msg_send 34 +#define SYS_msg_recv 35 + +#define SYS_shm_get 36 +#define SYS_shm_put 37 +#define SYS_shm_map 38 +#define SYS_shm_unmap 39 + +#define SYS_clone 40 +#define SYS_join 41 \ No newline at end of file diff --git a/xv6-user/include/types.h b/xv6-user/include/types.h new file mode 100755 index 0000000..59965a3 --- /dev/null +++ b/xv6-user/include/types.h @@ -0,0 +1,10 @@ +typedef unsigned int uint; +typedef unsigned short ushort; +typedef unsigned char uchar; + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned int uint32; +typedef unsigned long uint64; + +typedef uint64 pde_t; \ No newline at end of file diff --git a/xv6-user/init.c b/xv6-user/init.c new file mode 100755 index 0000000..ffa91a9 --- /dev/null +++ b/xv6-user/init.c @@ -0,0 +1,54 @@ +// init: The initial user-level program + +#include "include/types.h" +#include "include/stat.h" +#include "include/spinlock.h" +#include "include/sleeplock.h" +#include "include/fs.h" +#include "include/file.h" +#include "include/fcntl.h" +#include "user.h" + +char *argv[] = { "sh", 0 }; + +int +main(void) +{ + int pid, wpid; + + if(open("console", O_RDWR) < 0){ + mknod("console", CONSOLE, 0); + open("console", O_RDWR); + } + dup(0); // stdout + dup(0); // stderr + + for(;;){ + printf("init: starting sh\n"); + pid = fork(); + if(pid < 0){ + printf("init: fork failed\n"); + exit(1); + } + if(pid == 0){ + exec("sh", argv); + printf("init: exec sh failed\n"); + exit(1); + } + + for(;;){ + // this call to wait() returns if the shell exits, + // or if a parentless process exits. + wpid = wait((int *) 0); + if(wpid == pid){ + // the shell exited; restart it. + break; + } else if(wpid < 0){ + printf("init: wait returned an error\n"); + exit(1); + } else { + // it was a parentless process; do nothing. + } + } + } +} \ No newline at end of file diff --git a/xv6-user/initcode.S b/xv6-user/initcode.S new file mode 100755 index 0000000..a8d9923 --- /dev/null +++ b/xv6-user/initcode.S @@ -0,0 +1,28 @@ +# Initial process that execs /init. +# This code runs in user space. + +#include "syscall.h" + +# exec(init, argv) +.globl start +start: + la a0, init + la a1, argv + li a7, SYS_exec + ecall + +# for(;;) exit(); +exit: + li a7, SYS_exit + ecall + jal exit + +# char init[] = "/init\0"; +init: + .string "/init\0" + +# char *argv[] = { init, 0 }; +.p2align 2 +argv: + .long init + .long 0 \ No newline at end of file diff --git a/xv6-user/ls.c b/xv6-user/ls.c new file mode 100755 index 0000000..c91538b --- /dev/null +++ b/xv6-user/ls.c @@ -0,0 +1,87 @@ +#include "include/types.h" +#include "include/stat.h" +#include "include/fs.h" +#include "user.h" + +char* +fmtname(char *path) +{ + static char buf[DIRSIZ+1]; + char *p; + + // Find first character after last slash. + for(p=path+strlen(path); p >= path && *p != '/'; p--) + ; + p++; + + // Return blank-padded name. + if(strlen(p) >= DIRSIZ) + return p; + memmove(buf, p, strlen(p)); + memset(buf+strlen(p), ' ', DIRSIZ-strlen(p)); + return buf; +} + +void +ls(char *path) +{ + char buf[512], *p; + int fd; + struct dirent de; + struct stat st; + + if((fd = open(path, 0)) < 0){ + fprintf(2, "ls: cannot open %s\n", path); + return; + } + + if(fstat(fd, &st) < 0){ + fprintf(2, "ls: cannot stat %s\n", path); + close(fd); + return; + } + + switch(st.type){ + case T_FILE: + printf("path: %s, dev: %d, inum: %d, nlink: %d, size: %l, type: %d\n", fmtname(path), st.dev, st.ino, st.nlink, st.size, st.type); + break; + + case T_DIR: + // printf("path: %s, dev: %d, inum: %d, nlink: %d, size: %l, type: %d\n", fmtname(path), st.dev, st.ino, st.nlink, st.size, st.type); + if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){ + printf("ls: path too long\n"); + break; + } + strcpy(buf, path); + p = buf+strlen(buf); + *p++ = '/'; + while(read(fd, &de, sizeof(de)) == sizeof(de)){ + if(de.inum == 0){ + continue; + } + memmove(p, de.name, DIRSIZ); + p[DIRSIZ] = 0; + if(stat(buf, &st) < 0){ + printf("ls: cannot stat %s\n", buf); + continue; + } + printf("%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size); + } + break; + } + close(fd); +} + +int +main(int argc, char *argv[]) +{ + int i; + + if(argc < 2){ + ls("."); + exit(0); + } + for(i=1; i + +static char digits[] = "0123456789ABCDEF"; + +static void +putc(int fd, char c) +{ + write(fd, &c, 1); +} + +static void +printint(int fd, int xx, int base, int sgn) +{ + char buf[16]; + int i, neg; + uint x; + + neg = 0; + if(sgn && xx < 0){ + neg = 1; + x = -xx; + } else { + x = xx; + } + + i = 0; + do{ + buf[i++] = digits[x % base]; + }while((x /= base) != 0); + if(neg) + buf[i++] = '-'; + + while(--i >= 0) + putc(fd, buf[i]); +} + +static void +printptr(int fd, uint64 x) { + int i; + putc(fd, '0'); + putc(fd, 'x'); + for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) + putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); +} + +// Print to the given fd. Only understands %d, %x, %p, %s. +void +vprintf(int fd, const char *fmt, va_list ap) +{ + char *s; + int c, i, state; + + state = 0; + for(i = 0; fmt[i]; i++){ + c = fmt[i] & 0xff; + if(state == 0){ + if(c == '%'){ + state = '%'; + } else { + putc(fd, c); + } + } else if(state == '%'){ + if(c == 'd'){ + printint(fd, va_arg(ap, int), 10, 1); + } else if(c == 'l') { + printint(fd, va_arg(ap, uint64), 10, 0); + } else if(c == 'x') { + printint(fd, va_arg(ap, int), 16, 0); + } else if(c == 'p') { + printptr(fd, va_arg(ap, uint64)); + } else if(c == 's'){ + s = va_arg(ap, char*); + if(s == 0) + s = "(null)"; + while(*s != 0){ + putc(fd, *s); + s++; + } + } else if(c == 'c'){ + putc(fd, va_arg(ap, uint)); + } else if(c == '%'){ + putc(fd, c); + } else { + // Unknown % sequence. Print it to draw attention. + putc(fd, '%'); + putc(fd, c); + } + state = 0; + } + } +} + +void +fprintf(int fd, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(fd, fmt, ap); +} + +void +printf(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vprintf(1, fmt, ap); +} \ No newline at end of file diff --git a/xv6-user/rm.c b/xv6-user/rm.c new file mode 100755 index 0000000..d197708 --- /dev/null +++ b/xv6-user/rm.c @@ -0,0 +1,23 @@ +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +int +main(int argc, char *argv[]) +{ + int i; + + if(argc < 2){ + fprintf(2, "Usage: rm files...\n"); + exit(1); + } + + for(i = 1; i < argc; i++){ + if(unlink(argv[i]) < 0){ + fprintf(2, "rm: %s failed to delete\n", argv[i]); + break; + } + } + + exit(0); +} \ No newline at end of file diff --git a/xv6-user/sem_test1.c b/xv6-user/sem_test1.c new file mode 100644 index 0000000..aead691 --- /dev/null +++ b/xv6-user/sem_test1.c @@ -0,0 +1,18 @@ +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + +int main(){ + int id = sem_get(-1); + sem_init(id, 2); + + sem_down(id); + sem_down(id); + sem_down(id); + + int i = 0; + for(; i < 1000; i++){}; + fprintf(1, "[sem_test1 succeed and exit]\n"); + for(; i < 1000; i++){}; + exit(0); +} \ No newline at end of file diff --git a/xv6-user/sem_test2.c b/xv6-user/sem_test2.c new file mode 100644 index 0000000..2a1f681 --- /dev/null +++ b/xv6-user/sem_test2.c @@ -0,0 +1,15 @@ +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + +int main(){ + int id = sem_get(36); + // sem_init(id, 2); + + sem_up(id); + + + + fprintf(1, "[sem_test2 succeed and exit]\n"); + exit(0); +} \ No newline at end of file diff --git a/xv6-user/sh.c b/xv6-user/sh.c new file mode 100755 index 0000000..35d898d --- /dev/null +++ b/xv6-user/sh.c @@ -0,0 +1,496 @@ +// Shell. + +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + +// Parsed command representation +#define EXEC 1 +#define REDIR 2 +#define PIPE 3 +#define LIST 4 +#define BACK 5 + +#define MAXARGS 10 + +struct cmd { + int type; +}; + +struct execcmd { + int type; + char *argv[MAXARGS]; + char *eargv[MAXARGS]; +}; + +struct redircmd { + int type; + struct cmd *cmd; + char *file; + char *efile; + int mode; + int fd; +}; + +struct pipecmd { + int type; + struct cmd *left; + struct cmd *right; +}; + +struct listcmd { + int type; + struct cmd *left; + struct cmd *right; +}; + +struct backcmd { + int type; + struct cmd *cmd; +}; + +int fork1(void); // Fork but panics on failure. +void panic(char*); +struct cmd *parsecmd(char*); + +// Execute cmd. Never returns. +void +runcmd(struct cmd *cmd) +{ + int p[2]; + struct backcmd *bcmd; + struct execcmd *ecmd; + struct listcmd *lcmd; + struct pipecmd *pcmd; + struct redircmd *rcmd; + + if(cmd == 0) + exit(1); + + switch(cmd->type){ + default: + panic("runcmd"); + + case EXEC: + ecmd = (struct execcmd*)cmd; + if(ecmd->argv[0] == 0){ + exit(1); + } + exec(ecmd->argv[0], ecmd->argv); + fprintf(2, "exec %s failed\n", ecmd->argv[0]); + break; + + case REDIR: + rcmd = (struct redircmd*)cmd; + close(rcmd->fd); + if(open(rcmd->file, rcmd->mode) < 0){ + fprintf(2, "open %s failed\n", rcmd->file); + exit(1); + } + runcmd(rcmd->cmd); + break; + + case LIST: + lcmd = (struct listcmd*)cmd; + if(fork1() == 0) + runcmd(lcmd->left); + wait(0); + runcmd(lcmd->right); + break; + + case PIPE: + pcmd = (struct pipecmd*)cmd; + if(pipe(p) < 0) + panic("pipe"); + if(fork1() == 0){ + close(1); + dup(p[1]); + close(p[0]); + close(p[1]); + runcmd(pcmd->left); + } + if(fork1() == 0){ + close(0); + dup(p[0]); + close(p[0]); + close(p[1]); + runcmd(pcmd->right); + } + close(p[0]); + close(p[1]); + wait(0); + wait(0); + break; + + case BACK: + bcmd = (struct backcmd*)cmd; + if(fork1() == 0) + runcmd(bcmd->cmd); + break; + } + printf("[User] childen process exit.\n"); + exit(0); +} + +int +getcmd(char *buf, int nbuf) +{ + fprintf(2, "xv6 Rust >>> "); + memset(buf, 0, nbuf); + gets(buf, nbuf); + if(buf[0] == 0){ // EOF + return -1; + } + return 0; +} + +int +main(void) +{ + static char buf[100]; + int fd; + + // Ensure that three file descriptors are open. + while((fd = open("console", O_RDWR)) >= 0){ + if(fd >= 3){ + close(fd); + break; + } + } + + // Read and run input commands. + while(getcmd(buf, sizeof(buf)) >= 0){ + if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){ + // Chdir must be called by the parent, not the child. + buf[strlen(buf)-1] = 0; // chop \n + if(chdir(buf+3) < 0) + fprintf(2, "cannot cd %s\n", buf+3); + continue; + } + if(fork1() == 0) + runcmd(parsecmd(buf)); + wait(0); + } + exit(0); +} + +void +panic(char *s) +{ + fprintf(2, "%s\n", s); + exit(1); +} + +int +fork1(void) +{ + int pid; + + pid = fork(); + if(pid == -1) + panic("fork"); + return pid; +} + +//PAGEBREAK! +// Constructors + +struct cmd* +execcmd(void) +{ + struct execcmd *cmd; + + cmd = malloc(sizeof(*cmd)); + memset(cmd, 0, sizeof(*cmd)); + cmd->type = EXEC; + return (struct cmd*)cmd; +} + +struct cmd* +redircmd(struct cmd *subcmd, char *file, char *efile, int mode, int fd) +{ + struct redircmd *cmd; + + cmd = malloc(sizeof(*cmd)); + memset(cmd, 0, sizeof(*cmd)); + cmd->type = REDIR; + cmd->cmd = subcmd; + cmd->file = file; + cmd->efile = efile; + cmd->mode = mode; + cmd->fd = fd; + return (struct cmd*)cmd; +} + +struct cmd* +pipecmd(struct cmd *left, struct cmd *right) +{ + struct pipecmd *cmd; + + cmd = malloc(sizeof(*cmd)); + memset(cmd, 0, sizeof(*cmd)); + cmd->type = PIPE; + cmd->left = left; + cmd->right = right; + return (struct cmd*)cmd; +} + +struct cmd* +listcmd(struct cmd *left, struct cmd *right) +{ + struct listcmd *cmd; + + cmd = malloc(sizeof(*cmd)); + memset(cmd, 0, sizeof(*cmd)); + cmd->type = LIST; + cmd->left = left; + cmd->right = right; + return (struct cmd*)cmd; +} + +struct cmd* +backcmd(struct cmd *subcmd) +{ + struct backcmd *cmd; + + cmd = malloc(sizeof(*cmd)); + memset(cmd, 0, sizeof(*cmd)); + cmd->type = BACK; + cmd->cmd = subcmd; + return (struct cmd*)cmd; +} +//PAGEBREAK! +// Parsing + +char whitespace[] = " \t\r\n\v"; +char symbols[] = "<|>&;()"; + +int +gettoken(char **ps, char *es, char **q, char **eq) +{ + char *s; + int ret; + + s = *ps; + while(s < es && strchr(whitespace, *s)) + s++; + if(q) + *q = s; + ret = *s; + switch(*s){ + case 0: + break; + case '|': + case '(': + case ')': + case ';': + case '&': + case '<': + s++; + break; + case '>': + s++; + if(*s == '>'){ + ret = '+'; + s++; + } + break; + default: + ret = 'a'; + while(s < es && !strchr(whitespace, *s) && !strchr(symbols, *s)) + s++; + break; + } + if(eq) + *eq = s; + + while(s < es && strchr(whitespace, *s)) + s++; + *ps = s; + return ret; +} + +int +peek(char **ps, char *es, char *toks) +{ + char *s; + + s = *ps; + while(s < es && strchr(whitespace, *s)) + s++; + *ps = s; + return *s && strchr(toks, *s); +} + +struct cmd *parseline(char**, char*); +struct cmd *parsepipe(char**, char*); +struct cmd *parseexec(char**, char*); +struct cmd *nulterminate(struct cmd*); + +struct cmd* +parsecmd(char *s) +{ + char *es; + struct cmd *cmd; + + es = s + strlen(s); + cmd = parseline(&s, es); + peek(&s, es, ""); + if(s != es){ + fprintf(2, "leftovers: %s\n", s); + panic("syntax"); + } + nulterminate(cmd); + return cmd; +} + +struct cmd* +parseline(char **ps, char *es) +{ + struct cmd *cmd; + + cmd = parsepipe(ps, es); + while(peek(ps, es, "&")){ + gettoken(ps, es, 0, 0); + cmd = backcmd(cmd); + } + if(peek(ps, es, ";")){ + gettoken(ps, es, 0, 0); + cmd = listcmd(cmd, parseline(ps, es)); + } + return cmd; +} + +struct cmd* +parsepipe(char **ps, char *es) +{ + struct cmd *cmd; + + cmd = parseexec(ps, es); + if(peek(ps, es, "|")){ + gettoken(ps, es, 0, 0); + cmd = pipecmd(cmd, parsepipe(ps, es)); + } + return cmd; +} + +struct cmd* +parseredirs(struct cmd *cmd, char **ps, char *es) +{ + int tok; + char *q, *eq; + + while(peek(ps, es, "<>")){ + tok = gettoken(ps, es, 0, 0); + if(gettoken(ps, es, &q, &eq) != 'a') + panic("missing file for redirection"); + switch(tok){ + case '<': + cmd = redircmd(cmd, q, eq, O_RDONLY, 0); + break; + case '>': + cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE|O_TRUNC, 1); + break; + case '+': // >> + cmd = redircmd(cmd, q, eq, O_WRONLY|O_CREATE, 1); + break; + } + } + return cmd; +} + +struct cmd* +parseblock(char **ps, char *es) +{ + struct cmd *cmd; + + if(!peek(ps, es, "(")) + panic("parseblock"); + gettoken(ps, es, 0, 0); + cmd = parseline(ps, es); + if(!peek(ps, es, ")")) + panic("syntax - missing )"); + gettoken(ps, es, 0, 0); + cmd = parseredirs(cmd, ps, es); + return cmd; +} + +struct cmd* +parseexec(char **ps, char *es) +{ + char *q, *eq; + int tok, argc; + struct execcmd *cmd; + struct cmd *ret; + + if(peek(ps, es, "(")) + return parseblock(ps, es); + + ret = execcmd(); + cmd = (struct execcmd*)ret; + + argc = 0; + ret = parseredirs(ret, ps, es); + while(!peek(ps, es, "|)&;")){ + if((tok=gettoken(ps, es, &q, &eq)) == 0) + break; + if(tok != 'a') + panic("syntax"); + cmd->argv[argc] = q; + cmd->eargv[argc] = eq; + argc++; + if(argc >= MAXARGS) + panic("too many args"); + ret = parseredirs(ret, ps, es); + } + cmd->argv[argc] = 0; + cmd->eargv[argc] = 0; + return ret; +} + +// NUL-terminate all the counted strings. +struct cmd* +nulterminate(struct cmd *cmd) +{ + int i; + struct backcmd *bcmd; + struct execcmd *ecmd; + struct listcmd *lcmd; + struct pipecmd *pcmd; + struct redircmd *rcmd; + + if(cmd == 0) + return 0; + + switch(cmd->type){ + case EXEC: + ecmd = (struct execcmd*)cmd; + for(i=0; ecmd->argv[i]; i++) + *ecmd->eargv[i] = 0; + break; + + case REDIR: + rcmd = (struct redircmd*)cmd; + nulterminate(rcmd->cmd); + *rcmd->efile = 0; + break; + + case PIPE: + pcmd = (struct pipecmd*)cmd; + nulterminate(pcmd->left); + nulterminate(pcmd->right); + break; + + case LIST: + lcmd = (struct listcmd*)cmd; + nulterminate(lcmd->left); + nulterminate(lcmd->right); + break; + + case BACK: + bcmd = (struct backcmd*)cmd; + nulterminate(bcmd->cmd); + break; + } + return cmd; +} \ No newline at end of file diff --git a/xv6-user/shmtest1.c b/xv6-user/shmtest1.c new file mode 100644 index 0000000..fc081b7 --- /dev/null +++ b/xv6-user/shmtest1.c @@ -0,0 +1,52 @@ +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + +int main(){ + int shmid; + char *shmaddr; + int pid; + + shmid = shm_get("Test", 4096, 1); + + printf("In shmtest1 the id is %x\n", shmid); + // if(shmid < 0){ + // printf("In shmget, shmid < 1\n"); + // return -1; + // } + + // printf("Process1 The shm has get\n"); + + // if(pid == 0){ + + + // printf("********\n"); + shmaddr = (char*)shm_map(shmid, (long)0, 0); + if(shmaddr == 0){ + printf("In shmat, shmaddr is NULL\n"); + } + printf("Process 1, the shmaddr is %x, and write abcdefg\n", (long)shmaddr); + strcpy(shmaddr, "abcdefg"); + + + + printf("________Start Sleep_________\n"); + + int i = 0; + for(int i = 0; i < 1000000; i++); + // sleep(1000); + printf("Process 1, FINISH\n"); + + shm_unmap(shmid); + // shm_put(shmid); + + // }else{ + // sleep(3); + // printf(1, "###########\n"); + // shmaddr = (char*)shm_map(shmid, 0, 0); + // printf(1, "$$$$$$ %s $$$$$\n", shmaddr); + // wait(); + // shm_put(shmid); + // } + return 0; +} \ No newline at end of file diff --git a/xv6-user/shmtest2.c b/xv6-user/shmtest2.c new file mode 100644 index 0000000..2614195 --- /dev/null +++ b/xv6-user/shmtest2.c @@ -0,0 +1,45 @@ +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + + + +int main(){ + int shmid; + char *shmaddr; + int pid; + + shmid = shm_get("Test", 4096, 0); + + printf("In shmtest2 the id is %x\n", shmid); + // if(shmid < 0){ + // printf("In shmget, shmid < 1\n"); + // return -1; + // } + + // printf("Process2 The shm has get\n"); + + + // printf(1, "********\n"); + // shmaddr = (char*)shm_map(shmid, 0, 0); + // if(shmaddr == 0){ + // printf(2, "In shmat, shmaddr is NULL\n"); + // } + // printf(1, "PID0, the shmaddr is %x\n", (uint)shmaddr); + // strcpy(shmaddr, "abcdefg"); + // printf(1, "SHMTEST : here 1\n"); + // shm_unmap(shmaddr); + // printf(1, "SHMTEST : here 2\n"); + + + + // printf("###########\n"); + shmaddr = (char*)shm_map(shmid, (long)0, 0); + printf("Process 2, the shm addr is %x, and the content is %s\n", (long)shmaddr, shmaddr); + + printf("Process 2, FINISH\n"); + shm_unmap(shmaddr); + shm_put(shmid); + + return 0; +} \ No newline at end of file diff --git a/xv6-user/start.S b/xv6-user/start.S new file mode 100644 index 0000000..09b48a0 --- /dev/null +++ b/xv6-user/start.S @@ -0,0 +1,10 @@ +.globl main +.globl exit + +.section .text +.globl _start +_start: + + jal ra, main + + jal x0, exit \ No newline at end of file diff --git a/xv6-user/stressfs.c b/xv6-user/stressfs.c new file mode 100755 index 0000000..dcbaf9c --- /dev/null +++ b/xv6-user/stressfs.c @@ -0,0 +1,50 @@ +// Demonstrate that moving the "acquire" in iderw after the loop that +// appends to the idequeue results in a race. + +// For this to work, you should also add a spin within iderw's +// idequeue traversal loop. Adding the following demonstrated a panic +// after about 5 runs of stressfs in QEMU on a 2.1GHz CPU: +// for (i = 0; i < 40000; i++) +// asm volatile(""); + +#include "include/types.h" +#include "include/stat.h" +#include "include/fs.h" +#include "include/fcntl.h" +#include "user.h" + +int +main(int argc, char *argv[]) +{ + int fd, i; + char path[] = "stressfs0"; + char data[512]; + + printf("stressfs starting\n"); + memset(data, 'a', sizeof(data)); + + for(i = 0; i < 4; i++) + if(fork() > 0) + break; + + // printf("write %d\n", i); + + path[8] += i; + fd = open(path, O_CREATE | O_RDWR); + for(i = 0; i < 20; i++){ + printf("fd: %d\n", fd); + write(fd, data, sizeof(data)); + } + close(fd); + + printf("read\n"); + + fd = open(path, O_RDONLY); + for (i = 0; i < 20; i++) + read(fd, data, sizeof(data)); + close(fd); + + wait(0); + + exit(0); +} \ No newline at end of file diff --git a/xv6-user/thread.c b/xv6-user/thread.c new file mode 100644 index 0000000..6026e05 --- /dev/null +++ b/xv6-user/thread.c @@ -0,0 +1,32 @@ +#include "include/types.h" +#include "include/stat.h" +#include "include/param.h" +#include "user.h" + +#define PGSIZE 4096 +int thread_create(void (*start_routine)(void *)){ + void *stack; + + // printf("In thread.c, start malloc\n");gi + stack = malloc(4096); + printf("In thread.c, func: %d, stack: %d\n", (long)start_routine, (long)stack); + printf("the size of long is %d\n", sizeof(long)); + + int ret = clone(start_routine, stack); + + // for(int i = 0; i < 100000; i++); + + printf("In thread the ret is %d\n", ret); + return ret; +} + +int thread_join(){ + long stack; + printf("In thread_join the stack varible addr is %d", (long)&stack); + int ret = join(&stack); + + printf("In thread.c the stack address is %d, the ret is %d\n", stack, ret); + + // free((void*)stack); + return 0; +} \ No newline at end of file diff --git a/xv6-user/thread_test.c b/xv6-user/thread_test.c new file mode 100644 index 0000000..2c51bbe --- /dev/null +++ b/xv6-user/thread_test.c @@ -0,0 +1,55 @@ +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + +// void *func1(void *arg){ +// int num = *(int*)arg; +// printf("Thread Create Success %d !!!!\n", num); + +// exit(0); +// } + +void func1(){ + printf("FUNC1\n"); +} + +void *func(); + + +int main(){ + printf("Start create thread\n"); + + // int num = 9; + + // printf("In thread_test, func: %d\n", (long)&func); + func1(); + + thread_create((void(*)())&func); + + thread_join(); + + + printf("###thread test is success!!!\n"); + exit(0); + + + + + // printf("^^^^^, parent \n"); + // while(1){ + // printf("hehe"); + // } + // for(int i = 0; i < 100000; i++); + +} + + +void *func(){ + // int num = *(int*)arg; + printf("***Thread Function is Executing !!!!\n"); + + // while(1){ + // printf("rand"); + // } + exit(0); +} \ No newline at end of file diff --git a/xv6-user/touch.c b/xv6-user/touch.c new file mode 100755 index 0000000..eb04a89 --- /dev/null +++ b/xv6-user/touch.c @@ -0,0 +1,25 @@ +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + +int main(int argc, char **argv) +{ + if (argc != 2){ + printf("Usage: %s \n", argv[0]); + exit(-1); + } + + char *f = argv[1]; + int fd; + fd = open(f, O_CREATE); + if (fd < 0){ + printf("Open %s fail.\n", f); + exit(-1); + } + fd = close(fd); + if(fd){ + printf("Close %s fail.\n", f); + exit(-1); + } + exit(0); +} \ No newline at end of file diff --git a/xv6-user/ulib.c b/xv6-user/ulib.c new file mode 100755 index 0000000..4a00e2e --- /dev/null +++ b/xv6-user/ulib.c @@ -0,0 +1,140 @@ +#include "include/types.h" +#include "include/stat.h" +#include "include/fcntl.h" +#include "user.h" + +#define PGSIZE 4096 + +char* +strcpy(char *s, const char *t) +{ + char *os; + + os = s; + while((*s++ = *t++) != 0) + ; + return os; +} + +int +strcmp(const char *p, const char *q) +{ + while(*p && *p == *q) + p++, q++; + return (uchar)*p - (uchar)*q; +} + +uint +strlen(const char *s) +{ + int n; + + for(n = 0; s[n]; n++) + ; + return n; +} + +void* +memset(void *dst, int c, uint n) +{ + char *cdst = (char *) dst; + int i; + for(i = 0; i < n; i++){ + cdst[i] = c; + } + return dst; +} + +char* +strchr(const char *s, char c) +{ + for(; *s; s++) + if(*s == c) + return (char*)s; + return 0; +} + +char* +gets(char *buf, int max) +{ + int i, cc; + char c; + + for(i=0; i+1 < max; ){ + cc = read(0, &c, 1); + if(cc < 1) + break; + buf[i++] = c; + if(c == '\n' || c == '\r') + break; + } + buf[i] = '\0'; + return buf; +} + +int +stat(const char *n, struct stat *st) +{ + int fd; + int r; + + fd = open(n, O_RDONLY); + if(fd < 0) + return -1; + r = fstat(fd, st); + close(fd); + return r; +} + +int +atoi(const char *s) +{ + int n; + + n = 0; + while('0' <= *s && *s <= '9') + n = n*10 + *s++ - '0'; + return n; +} + +void* +memmove(void *vdst, const void *vsrc, int n) +{ + char *dst; + const char *src; + + dst = vdst; + src = vsrc; + if (src > dst) { + while(n-- > 0) + *dst++ = *src++; + } else { + dst += n; + src += n; + while(n-- > 0) + *--dst = *--src; + } + return vdst; +} + +int +memcmp(const void *s1, const void *s2, uint n) +{ + const char *p1 = s1, *p2 = s2; + while (n-- > 0) { + if (*p1 != *p2) { + return *p1 - *p2; + } + p1++; + p2++; + } + return 0; +} + +void * +memcpy(void *dst, const void *src, uint n) +{ + return memmove(dst, src, n); +} + + diff --git a/xv6-user/umalloc.c b/xv6-user/umalloc.c new file mode 100755 index 0000000..928285c --- /dev/null +++ b/xv6-user/umalloc.c @@ -0,0 +1,92 @@ +#include "include/types.h" +#include "include/stat.h" +#include "include/param.h" +#include "user.h" + +// Memory allocator by Kernighan and Ritchie, +// The C programming Language, 2nd ed. Section 8.7. + +typedef long Align; + +union header { + struct { + union header *ptr; + uint size; + } s; + Align x; +}; + +typedef union header Header; + +static Header base; +static Header *freep; + +void +free(void *ap) +{ + Header *bp, *p; + + bp = (Header*)ap - 1; + for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) + if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) + break; + if(bp + bp->s.size == p->s.ptr){ + bp->s.size += p->s.ptr->s.size; + bp->s.ptr = p->s.ptr->s.ptr; + } else + bp->s.ptr = p->s.ptr; + if(p + p->s.size == bp){ + p->s.size += bp->s.size; + p->s.ptr = bp->s.ptr; + } else + p->s.ptr = bp; + freep = p; +} + +static Header* +morecore(uint nu) +{ + char *p; + Header *hp; + + if(nu < 4096) + nu = 4096; + p = sbrk(nu * sizeof(Header)); + if(p == (char*)-1) + return 0; + hp = (Header*)p; + hp->s.size = nu; + free((void*)(hp + 1)); + return freep; +} + +void* +malloc(uint nbytes) +{ + + // printf("mmmm"); + Header *p, *prevp; + uint nunits; + + nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; + if((prevp = freep) == 0){ + base.s.ptr = freep = prevp = &base; + base.s.size = 0; + } + for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ + if(p->s.size >= nunits){ + if(p->s.size == nunits) + prevp->s.ptr = p->s.ptr; + else { + p->s.size -= nunits; + p += p->s.size; + p->s.size = nunits; + } + freep = prevp; + return (void*)(p + 1); + } + if(p == freep) + if((p = morecore(nunits)) == 0) + return 0; + } +} \ No newline at end of file diff --git a/xv6-user/user.h b/xv6-user/user.h new file mode 100755 index 0000000..3c2f689 --- /dev/null +++ b/xv6-user/user.h @@ -0,0 +1,71 @@ +struct stat; +struct rtcdate; + +// system calls +int fork(void); +int exit(int) __attribute__((noreturn)); +int wait(int*); +int pipe(int*); +int write(int, const void*, int); +int read(int, void*, int); +int close(int); +int kill(int); +int exec(char*, char**); +int open(const char*, int); +int mknod(const char*, short, short); +int unlink(const char*); +int fstat(int fd, struct stat*); +int link(const char*, const char*); +int mkdir(const char*); +int chdir(const char*); +int dup(int); +int getpid(void); +char* sbrk(int); +int sleep(int); +int uptime(void); + +int sem_get(int id); +int sem_put(int id); +int sem_up(int id); +int sem_down(int id); +int sem_init(int id, int cnt); + +int mkfifo(char*); +int fifo_get(char*); +int fifo_put(int); +int fifo_read(int, void*, int); +int fifo_write(int, void*, int); + +int msg_alloc(char*); +int msg_get(char*); +int msg_send(int, void*, int); +int msg_recv(int, void*, int); + + +int shm_get(char*, int, int); +int shm_put(int); +int shm_map(int, long, int); +int shm_unmap(int); + + +int clone(void (*start_routine)(void *), void *stack); +int join(void*); +int thread_create(void (*start_routine)(void *)); +int thread_join(); + +// ulib.c +int stat(const char*, struct stat*); +char* strcpy(char*, const char*); +void *memmove(void*, const void*, int); +char* strchr(const char*, char c); +int strcmp(const char*, const char*); +void fprintf(int, const char*, ...); +void printf(const char*, ...); +char* gets(char*, int max); +uint strlen(const char*); +void* memset(void*, int, uint); +void* malloc(uint); +void free(void*); +int atoi(const char*); +int memcmp(const void *, const void *, uint); +void *memcpy(void *, const void *, uint); \ No newline at end of file diff --git a/xv6-user/usys.S b/xv6-user/usys.S new file mode 100644 index 0000000..6cafbc6 --- /dev/null +++ b/xv6-user/usys.S @@ -0,0 +1,207 @@ +# generated by usys.pl - do not edit +#include "include/syscall.h" +.global fork +fork: + li a7, SYS_fork + ecall + ret +.global exit +exit: + li a7, SYS_exit + ecall + ret +.global wait +wait: + li a7, SYS_wait + ecall + ret +.global pipe +pipe: + li a7, SYS_pipe + ecall + ret +.global read +read: + li a7, SYS_read + ecall + ret +.global write +write: + li a7, SYS_write + ecall + ret +.global close +close: + li a7, SYS_close + ecall + ret +.global kill +kill: + li a7, SYS_kill + ecall + ret +.global exec +exec: + li a7, SYS_exec + ecall + ret +.global open +open: + li a7, SYS_open + ecall + ret +.global mknod +mknod: + li a7, SYS_mknod + ecall + ret +.global unlink +unlink: + li a7, SYS_unlink + ecall + ret +.global fstat +fstat: + li a7, SYS_fstat + ecall + ret +.global link +link: + li a7, SYS_link + ecall + ret +.global mkdir +mkdir: + li a7, SYS_mkdir + ecall + ret +.global chdir +chdir: + li a7, SYS_chdir + ecall + ret +.global dup +dup: + li a7, SYS_dup + ecall + ret +.global getpid +getpid: + li a7, SYS_getpid + ecall + ret +.global sbrk +sbrk: + li a7, SYS_sbrk + ecall + ret +.global sleep +sleep: + li a7, SYS_sleep + ecall + ret +.global uptime +uptime: + li a7, SYS_uptime + ecall + ret +.global sem_get +sem_get: + li a7, SYS_sem_get + ecall + ret +.global sem_put +sem_put: + li a7, SYS_sem_put + ecall + ret +.global sem_down +sem_down: + li a7, SYS_sem_down + ecall + ret +.global sem_up +sem_up: + li a7, SYS_sem_up + ecall + ret +.global sem_init +sem_init: + li a7, SYS_sem_init + ecall + ret +.global mkfifo +mkfifo: + li a7, SYS_mkfifo + ecall + ret +.global fifo_get +fifo_get: + li a7, SYS_fifo_get + ecall + ret +.global fifo_write +fifo_write: + li a7, SYS_fifo_write + ecall + ret +.global fifo_read +fifo_read: + li a7, SYS_fifo_read + ecall + ret +.global fifo_put +fifo_put: + li a7, SYS_fifo_put + ecall + ret +.global clone +clone: + li a7, SYS_clone + ecall + ret +.global join +join: + li a7, SYS_join + ecall + ret +.global msg_alloc +msg_alloc: + li a7, SYS_msg_alloc + ecall + ret +.global msg_get +msg_get: + li a7, SYS_msg_get + ecall + ret +.global msg_send +msg_send: + li a7, SYS_msg_send + ecall + ret +.global msg_recv +msg_recv: + li a7, SYS_msg_recv + ecall + ret +.global shm_get +shm_get: + li a7, SYS_shm_get + ecall + ret +.global shm_put +shm_put: + li a7, SYS_shm_put + ecall + ret +.global shm_map +shm_map: + li a7, SYS_shm_map + ecall + ret +.global shm_unmap +shm_unmap: + li a7, SYS_shm_unmap + ecall + ret diff --git a/xv6-user/usys.pl b/xv6-user/usys.pl new file mode 100755 index 0000000..33e604a --- /dev/null +++ b/xv6-user/usys.pl @@ -0,0 +1,63 @@ +#!/usr/bin/perl -w + +# Generate usys.S, the stubs for syscalls. + +print "# generated by usys.pl - do not edit\n"; + +print "#include \"include/syscall.h\"\n"; + +sub entry { + my $name = shift; + print ".global $name\n"; + print "${name}:\n"; + print " li a7, SYS_${name}\n"; + print " ecall\n"; + print " ret\n"; +} + +entry("fork"); +entry("exit"); +entry("wait"); +entry("pipe"); +entry("read"); +entry("write"); +entry("close"); +entry("kill"); +entry("exec"); +entry("open"); +entry("mknod"); +entry("unlink"); +entry("fstat"); +entry("link"); +entry("mkdir"); +entry("chdir"); +entry("dup"); +entry("getpid"); +entry("sbrk"); +entry("sleep"); +entry("uptime"); + +entry("sem_get"); +entry("sem_put"); +entry("sem_down"); +entry("sem_up"); +entry("sem_init"); + +entry("mkfifo"); +entry("fifo_get"); +entry("fifo_write"); +entry("fifo_read"); +entry("fifo_put"); + +entry("clone"); +entry("join"); + +entry("msg_alloc"); +entry("msg_get"); +entry("msg_send"); +entry("msg_recv"); + +entry("shm_get"); +entry("shm_put"); +entry("shm_map"); +entry("shm_unmap"); \ No newline at end of file diff --git a/xv6-user/uthread/getcontext.S b/xv6-user/uthread/getcontext.S new file mode 100644 index 0000000..b6c27d4 --- /dev/null +++ b/xv6-user/uthread/getcontext.S @@ -0,0 +1,20 @@ +// getcontext(ucontext_t *uctx); +.section .text +.globl getcontext +getcontext: + sd ra, 0(a0) + sd sp, 8(a0) + sd s0, 16(a0) + sd s1, 24(a0) + sd s2, 32(a0) + sd s3, 40(a0) + sd s4, 48(a0) + sd s5, 56(a0) + sd s6, 64(a0) + sd s7, 72(a0) + sd s8, 80(a0) + sd s9, 88(a0) + sd s10, 96(a0) + sd s11, 104(a0) + + ret diff --git a/xv6-user/uthread/setcontext.S b/xv6-user/uthread/setcontext.S new file mode 100644 index 0000000..522cd7f --- /dev/null +++ b/xv6-user/uthread/setcontext.S @@ -0,0 +1,20 @@ +# setcontext(ucontext_t *ucp); +.section .text +.globl setcontext +setcontext: + ld ra, 0(a0) + ld sp, 8(a0) + ld s0, 16(a0) + ld s1, 24(a0) + ld s2, 32(a0) + ld s3, 40(a0) + ld s4, 48(a0) + ld s5, 56(a0) + ld s6, 64(a0) + ld s7, 72(a0) + ld s8, 80(a0) + ld s9, 88(a0) + ld s10, 96(a0) + ld s11, 104(a0) + + ret \ No newline at end of file diff --git a/xv6-user/uthread/ucontext.c b/xv6-user/uthread/ucontext.c new file mode 100644 index 0000000..c77eafd --- /dev/null +++ b/xv6-user/uthread/ucontext.c @@ -0,0 +1,15 @@ +#include "ucontext.h" + + +void swapcontext(ucontext *o, ucontext *n){ + // ((void (*)(ucontext*)))getcontext(o); + // ((void (*)(ucontext*)))setcontext(n); + + getcontext(o); + setcontext(n); +} + +void makecontext(ucontext *ctx, long func, long stack){ + ctx->ra = (long)func; + ctx->sp = (long)stack; +} \ No newline at end of file diff --git a/xv6-user/uthread/ucontext.h b/xv6-user/uthread/ucontext.h new file mode 100644 index 0000000..13e68fa --- /dev/null +++ b/xv6-user/uthread/ucontext.h @@ -0,0 +1,51 @@ +#ifndef UCONTEXT_H +#define UCONTEXT_H + + + + +// typedef struct { +// void *sp; +// // int ss_flags; +// long size; +// } stack_t; + +// typedef struct { +// long gregset[14]; +// } mcontext_t; + +// typedef struct ucontext_t { +// struct ucontext_t *uc_link; +// stack_t uc_stack; +// } ucontext_t; + +typedef struct { + long ra; + long sp; + + long s0; + long s1; + long s2; + long s3; + long s4; + long s5; + long s6; + long s7; + long s8; + long s9; + long s10; + long s11; +} ucontext; + +// extern char getcontext[]; +// extern char setcontext[]; + +extern void getcontext(ucontext *ctx); +extern void setcontext(ucontext *ctx); + +void swapcontext(ucontext *o, ucontext *n); +void makecontext(ucontext *ctx, long func, long stack); + + + +#endif \ No newline at end of file diff --git a/xv6-user/uthread/uswtch.S b/xv6-user/uthread/uswtch.S new file mode 100644 index 0000000..c1f8b2e --- /dev/null +++ b/xv6-user/uthread/uswtch.S @@ -0,0 +1,33 @@ +.globl uswtch +uswtch: + sd ra, 0(a0) + sd sp, 8(a0) + sd s0, 16(a0) + sd s1, 24(a0) + sd s2, 32(a0) + sd s3, 40(a0) + sd s4, 48(a0) + sd s5, 56(a0) + sd s6, 64(a0) + sd s7, 72(a0) + sd s8, 80(a0) + sd s9, 88(a0) + sd s10, 96(a0) + sd s11, 104(a0) + + ld ra, 0(a1) + ld sp, 8(a1) + ld s0, 16(a1) + ld s1, 24(a1) + ld s2, 32(a1) + ld s3, 40(a1) + ld s4, 48(a1) + ld s5, 56(a1) + ld s6, 64(a1) + ld s7, 72(a1) + ld s8, 80(a1) + ld s9, 88(a1) + ld s10, 96(a1) + ld s11, 104(a1) + + ret \ No newline at end of file diff --git a/xv6-user/uthread/uthread.c b/xv6-user/uthread/uthread.c new file mode 100644 index 0000000..e3c8f80 --- /dev/null +++ b/xv6-user/uthread/uthread.c @@ -0,0 +1,130 @@ +#include "uthread.h" +#include "include/types.h" +#include "include/stat.h" +#include "user.h" + +extern void uswtch(ucontext *o, ucontext *n); + +void scheduler_init(scheduler *sched){ + printf("scheduler init\n"); + int i = 0; + for(i = 0; i < MAX_THREADS; i++){ + sched->threads[i].state = FREE; + } +} + +int getThread(scheduler *schedule){ + int id = -1; + for(id = 0; id < MAX_THREADS; id++){ + if(schedule->threads[id].state == RUNNABLE){ + return id; + } + } + return id; +} + + +int uthread_create(scheduler *sched, Func func){ + int id = 0; + for(id = 0; id < MAX_THREADS; id++){ + if(sched->threads[id].state == FREE){ + break; + } + } + + if(id >= MAX_THREADS){ + return -1; + } + + uthread_t *t = &(sched->threads[id]); + + + t->func = func; + // t->arg = arg; + char *stack = malloc(4096); + t->stack = stack; + + t->state = RUNNABLE; + + ucontext *ctx = &t->ctx; + ctx->ra = (long)func; + ctx->sp = (long)(stack) + STACK_SIZE - 1; + + printf("In create, id %x, func %x, stack %x\n", id, (long)func, (long)stack); + + return id; +} + +void runScheduler(scheduler *schedule){ + // while(1){ + + // volatile int start = -1; + // volatile int i = 0; + // volatile int exitFlag = 0; + // for(i = 0; i < MAX_THREADS; i++){ + // if(start == i){ + // exitFlag = 1; + // break; + // } + // if(schedule->threads[i].state != RUNNABLE){ + // continue; + // } + // printf("ss"); + // start = i; + // uthread_t *t = &(schedule->threads[i]); + // printf("id %x, func %x, stack %x\n", i, (long)t->func, (long)t->stack); + // printf("ra %x, sp %x\n", (long)t->ctx.ra, (long)t->ctx.sp); + // schedule->running_thread = i; + // uswtch(&schedule->ctx, &t->ctx); + // schedule->running_thread = -1; + // } + + // if(exitFlag){ + // break; + // } + // } + + while(1){ + if(isFinished(schedule)){ + break; + }else{ + int i = 0; + for(i = 0; i < MAX_THREADS; i++){ + if(schedule->threads[i].state == RUNNABLE){ + break; + } + } + uthread_t *t = &(schedule->threads[i]); + schedule->running_thread = i; + uswtch(&schedule->ctx, &t->ctx); + schedule->running_thread = -1; + printf("***\n"); + } + } +} + +int isFinished(scheduler *s){ + int i = 0; + for(i = 0; i < MAX_THREADS; i++){ + if(s->threads[i].state != FREE){ + return 0; + } + } + return 1; +} + +void uthread_yield(scheduler *schedule){ + int id = schedule->running_thread; + uthread_t *t = &(schedule->threads[id]); + t->state = RUNNABLE; + swapcontext(&t->ctx, &schedule->ctx); +} + +void uthread_exit(scheduler *schedule){ + printf("uthread_exit\n"); + int id = schedule->running_thread; + uthread_t *t = &(schedule->threads[id]); + t->state = FREE; + setcontext(&schedule->ctx); +} + diff --git a/xv6-user/uthread/uthread.h b/xv6-user/uthread/uthread.h new file mode 100644 index 0000000..82d4b03 --- /dev/null +++ b/xv6-user/uthread/uthread.h @@ -0,0 +1,53 @@ +#ifndef UTHTEAD_H +#define UTHREAD_H + +#include "ucontext.h" + +#define STACK_SIZE 4096 +#define MAX_THREADS 3 + +typedef void (*Func)(); +enum ThreadState {FREE, RUNNABLE, RUNNING}; + + +// typedef struct { +// long ra; +// long sp; + +// long s0; +// long s1; +// long s2; +// long s3; +// long s4; +// long s5; +// long s6; +// long s7; +// long s8; +// long s9; +// long s10; +// long s11; +// } ucontext; + +typedef struct uthread_t { + ucontext ctx; + Func func; + void *arg; + enum ThreadState state; + char *stack; +}uthread_t; + +typedef struct scheduler { + ucontext ctx; + int running_thread; + uthread_t threads[MAX_THREADS]; +} scheduler; + + +void scheduler_init(scheduler *sched); +int uthread_create(scheduler *sched, Func func); +void run(scheduler *schedule); +void uthread_yield(scheduler *schedule); +void uthread_exit(scheduler *schedule); +int getThread(scheduler *schedule); + +#endif \ No newline at end of file diff --git a/xv6-user/uthreadtest.c b/xv6-user/uthreadtest.c new file mode 100644 index 0000000..389f8b3 --- /dev/null +++ b/xv6-user/uthreadtest.c @@ -0,0 +1,71 @@ +#include "uthread/uthread.h" +#include "include/types.h" +#include "include/fcntl.h" +#include "user.h" + +scheduler s; + +void func1(){ + printf("func1 exec\n"); + + uthread_exit(&s); +} + +void func2(){ + printf("func2 exec\n"); + uthread_exit(&s); +} + +// void print(){ +// printf("Function print exec!!! the num is %x", *(int*)arg); + +// while(1); +// } + +int main(){ + + /*Test get set context*/ + + + // volatile int cnt = 0; + // ucontext ctx1, ctx2; + + // getcontext(&ctx1); + // printf("CTX1\n"); + // getcontext(&ctx2); + // printf("CTX2\n"); + + // if(cnt == 0){ + // cnt++; + // swapcontext(&ctx1, &ctx2); + // } + + + + // ucontext ctx; + // ctx.ra = (long)&func1; + // void *stack = malloc(4096); + // ctx.sp = (long)stack + 4096 - 1; + + // setcontext(&ctx); + + // printf("Finish\n"); + + + + printf("haha\n"); + scheduler_init(&s); + + uthread_create(&s, func1); + uthread_create(&s, func2); + + // int id = getThread(&s); + // uthread_t *t = &(s.threads[id]); + + // printf("%x %x", t->ctx.ra, t->ctx.sp); + + // setcontext(&t->ctx); + runScheduler(&s); + + exit(0); +} \ No newline at end of file diff --git a/xv6-user/wc.c b/xv6-user/wc.c new file mode 100644 index 0000000..f76195e --- /dev/null +++ b/xv6-user/wc.c @@ -0,0 +1,55 @@ +#include "include/types.h" +#include "include/stat.h" +#include "include/param.h" +#include "user.h" + +char buf[512]; + +void +wc(int fd, char *name) +{ + int i, n; + int l, w, c, inword; + + l = w = c = 0; + inword = 0; + while((n = read(fd, buf, sizeof(buf))) > 0){ + for(i=0; i