|
1 | | -#[path = "../unsupported/args.rs"] |
2 | | -pub mod args; |
3 | | -pub mod env; |
4 | | -pub mod fs; |
5 | | -#[path = "../unsupported/io.rs"] |
6 | | -pub mod io; |
7 | | -#[path = "../unsupported/net.rs"] |
8 | | -pub mod net; |
9 | 1 | #[path = "../unsupported/os.rs"] |
10 | 2 | pub mod os; |
11 | 3 | #[path = "../unsupported/pipe.rs"] |
12 | 4 | pub mod pipe; |
13 | | -#[path = "../unsupported/process.rs"] |
14 | | -pub mod process; |
15 | | -pub mod stdio; |
16 | 5 | pub mod thread; |
17 | 6 | pub mod time; |
18 | 7 |
|
@@ -41,39 +30,19 @@ pub unsafe extern "C" fn _start() -> ! { |
41 | 30 | fn main() -> i32; |
42 | 31 | } |
43 | 32 |
|
44 | | - // VEXos doesn't explicitly clean out .bss. |
45 | | - ptr::slice_from_raw_parts_mut( |
46 | | - addr_of_mut!(__bss_start), |
47 | | - addr_of_mut!(__bss_end).offset_from(addr_of_mut!(__bss_start)) as usize, |
48 | | - ) |
49 | | - .as_mut() |
50 | | - .unwrap_unchecked() |
51 | | - .fill(0); |
| 33 | + // Clear the .bss (uninitialized statics) section by filling it with zeroes. |
| 34 | + // This is required, since the compiler assumes it will be zeroed on first access. |
| 35 | + ptr::write_bytes( |
| 36 | + &raw mut __bss_start, |
| 37 | + 0, |
| 38 | + (&raw mut __bss_end).offset_from(&raw mut __bss_start) as usize, |
| 39 | + ); |
52 | 40 |
|
53 | 41 | main(); |
54 | 42 |
|
55 | 43 | abort_internal() |
56 | 44 | } |
57 | 45 |
|
58 | | -// The code signature is a 32 byte header at the start of user programs that |
59 | | -// identifies the owner and type of the program, as well as certain flags for |
60 | | -// program behavior dictated by the OS. In the event that the user wants to |
61 | | -// change this header, we use weak linkage so it can be overwritten. |
62 | | -#[link_section = ".code_signature"] |
63 | | -#[linkage = "weak"] |
64 | | -#[used] |
65 | | -static CODE_SIGNATURE: vex_sdk::vcodesig = |
66 | | - vex_sdk::vcodesig { magic: u32::from_le_bytes(*b"XVX5"), r#type: 0, owner: 2, options: 0 }; |
67 | | - |
68 | | -// This function is needed by the panic runtime. The symbol is named in |
69 | | -// pre-link args for the target specification, so keep that in sync. |
70 | | -#[cfg(not(test))] |
71 | | -#[no_mangle] |
72 | | -// NB. used by both libunwind and libpanic_abort |
73 | | -pub extern "C" fn __rust_abort() -> ! { |
74 | | - abort_internal() |
75 | | -} |
76 | | - |
77 | 46 | // SAFETY: must be called only once during runtime initialization. |
78 | 47 | // NOTE: this is not guaranteed to run, for example when Rust code is called externally. |
79 | 48 | pub unsafe fn init(_argc: isize, _argv: *const *const u8, _sigpipe: u8) {} |
|
0 commit comments