Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 1 | // Copyright 2022, The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | //! Basic functionality for bare-metal binaries to run in a VM under crosvm. |
| 16 | |
| 17 | #![no_std] |
| 18 | |
Alice Wang | f47b234 | 2023-06-02 11:51:57 +0000 | [diff] [blame] | 19 | extern crate alloc; |
| 20 | |
Alice Wang | 81399f5 | 2023-05-26 14:23:43 +0000 | [diff] [blame] | 21 | pub mod arch; |
Pierre-Clément Tosi | 6a42fdc | 2022-12-08 13:51:05 +0000 | [diff] [blame] | 22 | mod bionic; |
Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 23 | pub mod console; |
Andrew Walbran | b996b4a | 2022-04-22 15:15:41 +0000 | [diff] [blame] | 24 | mod entry; |
Pierre-Clément Tosi | 9a658f7 | 2022-10-10 15:18:54 +0100 | [diff] [blame] | 25 | pub mod layout; |
| 26 | mod linker; |
David Brazdil | 8b55777 | 2022-07-05 12:22:20 +0100 | [diff] [blame] | 27 | pub mod logger; |
Alice Wang | 4dd2093 | 2023-05-26 13:47:16 +0000 | [diff] [blame] | 28 | pub mod memory; |
Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 29 | pub mod power; |
| 30 | pub mod uart; |
Alice Wang | eacb738 | 2023-06-05 12:53:54 +0000 | [diff] [blame] | 31 | pub mod util; |
Alice Wang | eade167 | 2023-06-08 14:56:20 +0000 | [diff] [blame] | 32 | pub mod virtio; |
Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 33 | |
Pierre-Clément Tosi | 6a42fdc | 2022-12-08 13:51:05 +0000 | [diff] [blame] | 34 | pub use bionic::STACK_CHK_GUARD; |
| 35 | |
Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 36 | use core::panic::PanicInfo; |
| 37 | use power::reboot; |
| 38 | |
| 39 | #[panic_handler] |
| 40 | fn panic(info: &PanicInfo) -> ! { |
| 41 | eprintln!("{}", info); |
| 42 | reboot() |
| 43 | } |