File tree Expand file tree Collapse file tree 6 files changed +31
-2
lines changed Expand file tree Collapse file tree 6 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ jobs:
153
153
# Run
154
154
- run : ${{ env.BUILD_DIR }}usr/gen_init_cpio .github/workflows/qemu-initramfs.desc > qemu-initramfs.img
155
155
156
- - run : qemu-system-${{ env.QEMU_ARCH }} -kernel ${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }} -initrd qemu-initramfs.img -M ${{ env.QEMU_MACHINE }} -cpu ${{ env.QEMU_CPU }} -smp 2 -nographic -no-reboot -append '${{ env.QEMU_APPEND }} rust_example.my_i32=123321 rust_example.my_str=🦀mod rust_example.my_invbool=y rust_example_2.my_i32=234432' | tee qemu-stdout.log
156
+ - run : qemu-system-${{ env.QEMU_ARCH }} -kernel ${{ env.BUILD_DIR }}${{ env.IMAGE_PATH }} -initrd qemu-initramfs.img -M ${{ env.QEMU_MACHINE }} -cpu ${{ env.QEMU_CPU }} -smp 2 -nographic -no-reboot -append '${{ env.QEMU_APPEND }} rust_example.my_i32=123321 rust_example.my_str=🦀mod rust_example_2.my_i32=234432' | tee qemu-stdout.log
157
157
158
158
# Check
159
159
- run : grep -F '] Rust Example (init)' qemu-stdout.log
@@ -166,6 +166,11 @@ jobs:
166
166
- run : " grep -F '] [3] my_i32: 345543' qemu-stdout.log"
167
167
- run : " grep -F '] [4] my_i32: 456654' qemu-stdout.log"
168
168
169
+ - run : " grep -F '] my_usize: 42' qemu-stdout.log"
170
+ - run : " grep -F '] [2] my_usize: 42' qemu-stdout.log"
171
+ - run : " grep -F '] [3] my_usize: 42' qemu-stdout.log"
172
+ - run : " grep -F '] [4] my_usize: 84' qemu-stdout.log"
173
+
169
174
- run : " grep '\\ ] my_str: 🦀mod\\ s*$' qemu-stdout.log"
170
175
- run : " grep '\\ ] \\ [2\\ ] my_str: default str val\\ s*$' qemu-stdout.log"
171
176
- run : " grep '\\ ] \\ [3\\ ] my_str: 🦀mod\\ s*$' qemu-stdout.log"
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
3
busybox insmod rust_example_3.ko my_i32=345543 my_str=🦀mod
4
- busybox insmod rust_example_4.ko my_i32=456654
4
+ busybox insmod rust_example_4.ko my_i32=456654 my_usize=84
5
5
busybox rmmod rust_example_3.ko
6
6
busybox rmmod rust_example_4.ko
7
7
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ module! {
31
31
permissions: 0o644 ,
32
32
description: b"Example of a string param" ,
33
33
} ,
34
+ my_usize: usize {
35
+ default : 42 ,
36
+ permissions: 0o644 ,
37
+ description: b"Example of usize" ,
38
+ } ,
34
39
} ,
35
40
}
36
41
@@ -63,6 +68,7 @@ impl KernelModule for RustExample {
63
68
" my_str: {}" ,
64
69
core:: str :: from_utf8( my_str. read( & lock) ) ?
65
70
) ;
71
+ println ! ( " my_usize: {}" , my_usize. read( & lock) ) ;
66
72
}
67
73
68
74
// Including this large variable on the stack will trigger
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ module! {
28
28
permissions: 0o644 ,
29
29
description: b"Example of a string param" ,
30
30
} ,
31
+ my_usize: usize {
32
+ default : 42 ,
33
+ permissions: 0o644 ,
34
+ description: b"Example of usize" ,
35
+ } ,
31
36
} ,
32
37
}
33
38
@@ -48,6 +53,7 @@ impl KernelModule for RustExample2 {
48
53
"[2] my_str: {}" ,
49
54
core:: str :: from_utf8( my_str. read( & lock) ) ?
50
55
) ;
56
+ println ! ( "[2] my_usize: {}" , my_usize. read( & lock) ) ;
51
57
}
52
58
53
59
// Including this large variable on the stack will trigger
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ module! {
28
28
permissions: 0o644 ,
29
29
description: b"Example of a string param" ,
30
30
} ,
31
+ my_usize: usize {
32
+ default : 42 ,
33
+ permissions: 0o644 ,
34
+ description: b"Example of usize" ,
35
+ } ,
31
36
} ,
32
37
}
33
38
@@ -48,6 +53,7 @@ impl KernelModule for RustExample3 {
48
53
"[3] my_str: {}" ,
49
54
core:: str :: from_utf8( my_str. read( & lock) ) ?
50
55
) ;
56
+ println ! ( "[3] my_usize: {}" , my_usize. read( & lock) ) ;
51
57
}
52
58
53
59
// Including this large variable on the stack will trigger
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ module! {
28
28
permissions: 0o644 ,
29
29
description: b"Example of a string param" ,
30
30
} ,
31
+ my_usize: usize {
32
+ default : 42 ,
33
+ permissions: 0o644 ,
34
+ description: b"Example of usize" ,
35
+ } ,
31
36
} ,
32
37
}
33
38
@@ -48,6 +53,7 @@ impl KernelModule for RustExample4 {
48
53
"[4] my_str: {}" ,
49
54
core:: str :: from_utf8( my_str. read( & lock) ) ?
50
55
) ;
56
+ println ! ( "[4] my_usize: {}" , my_usize. read( & lock) ) ;
51
57
}
52
58
53
59
// Including this large variable on the stack will trigger
You can’t perform that action at this time.
0 commit comments