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 | 67108c3 | 2023-06-30 11:04:02 +0000 | [diff] [blame] | 22 | pub 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; |
Alice Wang | a9fe1fb | 2023-07-04 09:10:35 +0000 | [diff] [blame] | 25 | pub mod exceptions; |
Alice Wang | a397106 | 2023-06-13 11:48:53 +0000 | [diff] [blame] | 26 | pub mod fdt; |
Pierre-Clément Tosi | c332fae | 2023-06-22 11:37:12 +0000 | [diff] [blame] | 27 | pub mod heap; |
Pierre-Clément Tosi | 3e3d733 | 2023-06-22 10:44:29 +0000 | [diff] [blame] | 28 | mod hvc; |
Pierre-Clément Tosi | a9b345f | 2024-04-27 01:01:42 +0100 | [diff] [blame] | 29 | pub mod hyp; |
Pierre-Clément Tosi | 9a658f7 | 2022-10-10 15:18:54 +0100 | [diff] [blame] | 30 | pub mod layout; |
Pierre-Clément Tosi | 67108c3 | 2023-06-30 11:04:02 +0000 | [diff] [blame] | 31 | pub mod linker; |
David Brazdil | 8b55777 | 2022-07-05 12:22:20 +0100 | [diff] [blame] | 32 | pub mod logger; |
Alice Wang | 4dd2093 | 2023-05-26 13:47:16 +0000 | [diff] [blame] | 33 | pub mod memory; |
Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 34 | pub mod power; |
Pierre-Clément Tosi | 3e3d733 | 2023-06-22 10:44:29 +0000 | [diff] [blame] | 35 | pub mod rand; |
Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 36 | pub mod uart; |
Alice Wang | eacb738 | 2023-06-05 12:53:54 +0000 | [diff] [blame] | 37 | pub mod util; |
Alice Wang | eade167 | 2023-06-08 14:56:20 +0000 | [diff] [blame] | 38 | pub mod virtio; |
Andrew Walbran | dd74b90 | 2022-04-14 16:12:50 +0000 | [diff] [blame] | 39 | |
| 40 | use core::panic::PanicInfo; |
| 41 | use power::reboot; |
| 42 | |
| 43 | #[panic_handler] |
| 44 | fn panic(info: &PanicInfo) -> ! { |
| 45 | eprintln!("{}", info); |
| 46 | reboot() |
| 47 | } |