File tree 6 files changed +35
-2
lines changed
6 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,11 @@ jobs:
165
165
-smp 2 \
166
166
-nographic \
167
167
-no-reboot \
168
- -append '${{ env.QEMU_APPEND }} rust_example.my_i32=123321 rust_example.my_str=🦀mod rust_example_2.my_i32=234432' \
168
+ -append '${{ env.QEMU_APPEND }} \
169
+ rust_example.my_i32=123321 \
170
+ rust_example.my_str=🦀mod \
171
+ rust_example_2.my_i32=234432 \
172
+ rust_example_2.my_array=1,2,3' \
169
173
| sed s:$'\r'$:: \
170
174
| tee qemu-stdout.log
171
175
@@ -191,6 +195,11 @@ jobs:
191
195
grep '] \[3] my_str: 🦀mod$' qemu-stdout.log
192
196
grep '] \[4] my_str: default str val$' qemu-stdout.log
193
197
198
+ grep '] my_array: [0, 1]$' qemu-stdout.log
199
+ grep '] \[2] my_array: [1, 2, 3]$' qemu-stdout.log
200
+ grep '] \[3] my_array: [0, 1]$' qemu-stdout.log
201
+ grep '] \[4] my_array: [1, 2, 3]$' qemu-stdout.log
202
+
194
203
grep '] \[3] Rust Example (exit)$' qemu-stdout.log
195
204
grep '] \[4] Rust Example (exit)$' qemu-stdout.log
196
205
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 my_usize=84
4
+ busybox insmod rust_example_4.ko my_i32=456654 my_usize=84 my_array=1,2,3
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 @@ -43,6 +43,11 @@ module! {
43
43
permissions: 0o644 ,
44
44
description: b"Example of usize" ,
45
45
} ,
46
+ my_array: ArrayParam <i32 , 3 > {
47
+ default : [ 0 , 1 ] ,
48
+ permissions: 0 ,
49
+ description: b"Example of array" ,
50
+ } ,
46
51
} ,
47
52
}
48
53
@@ -79,6 +84,7 @@ impl KernelModule for RustExample {
79
84
core:: str :: from_utf8( my_str. read( & lock) ) ?
80
85
) ;
81
86
println ! ( " my_usize: {}" , my_usize. read( & lock) ) ;
87
+ println ! ( " my_array: {:?}" , my_array. read( ) ) ;
82
88
}
83
89
84
90
// Test mutexes.
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ module! {
33
33
permissions: 0o644 ,
34
34
description: b"Example of usize" ,
35
35
} ,
36
+ my_array: ArrayParam <i32 , 3 > {
37
+ default : [ 0 , 1 ] ,
38
+ permissions: 0 ,
39
+ description: b"Example of array" ,
40
+ } ,
36
41
} ,
37
42
}
38
43
@@ -54,6 +59,7 @@ impl KernelModule for RustExample2 {
54
59
core:: str :: from_utf8( my_str. read( & lock) ) ?
55
60
) ;
56
61
println ! ( "[2] my_usize: {}" , my_usize. read( & lock) ) ;
62
+ println ! ( "[2] my_array: {:?}" , my_array. read( ) ) ;
57
63
}
58
64
59
65
// Including this large variable on the stack will trigger
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ module! {
33
33
permissions: 0o644 ,
34
34
description: b"Example of usize" ,
35
35
} ,
36
+ my_array: ArrayParam <i32 , 3 > {
37
+ default : [ 0 , 1 ] ,
38
+ permissions: 0 ,
39
+ description: b"Example of array" ,
40
+ } ,
36
41
} ,
37
42
}
38
43
@@ -54,6 +59,7 @@ impl KernelModule for RustExample3 {
54
59
core:: str :: from_utf8( my_str. read( & lock) ) ?
55
60
) ;
56
61
println ! ( "[3] my_usize: {}" , my_usize. read( & lock) ) ;
62
+ println ! ( "[3] my_array: {:?}" , my_array. read( ) ) ;
57
63
}
58
64
59
65
// Including this large variable on the stack will trigger
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ module! {
33
33
permissions: 0o644 ,
34
34
description: b"Example of usize" ,
35
35
} ,
36
+ my_array: ArrayParam <i32 , 3 > {
37
+ default : [ 0 , 1 ] ,
38
+ permissions: 0 ,
39
+ description: b"Example of array" ,
40
+ } ,
36
41
} ,
37
42
}
38
43
@@ -54,6 +59,7 @@ impl KernelModule for RustExample4 {
54
59
core:: str :: from_utf8( my_str. read( & lock) ) ?
55
60
) ;
56
61
println ! ( "[4] my_usize: {}" , my_usize. read( & lock) ) ;
62
+ println ! ( "[4] my_array: {:?}" , my_array. read( ) ) ;
57
63
}
58
64
59
65
// Including this large variable on the stack will trigger
You can’t perform that action at this time.
0 commit comments