| //! Trivial Shodan elf loader capsule |
| |
| use kernel::{AppId, AppSlice, Callback, Driver, ReturnCode, Shared}; |
| use matcha_hal::dprintf; |
| |
| pub struct ElfLoaderCapsule {} |
| |
| impl Driver for ElfLoaderCapsule { |
| fn subscribe(&self, _: usize, _: Option<Callback>, _: AppId) -> ReturnCode { |
| return ReturnCode::EINVAL; |
| } |
| |
| fn command(&self, minor_num: usize, _r2: usize, _r3: usize, _app_id: AppId) -> ReturnCode { |
| dprintf!("ElfLoaderCapsule::command()\n"); |
| |
| if minor_num == matcha_config::CMD_ELFLOADER_BOOT_SEL4 { |
| matcha_utils::load_sel4(); |
| return ReturnCode::SUCCESS; |
| } |
| |
| return ReturnCode::EINVAL; |
| } |
| |
| fn allow(&self, _: AppId, _: usize, _: Option<AppSlice<Shared, u8>>) -> ReturnCode { |
| return ReturnCode::EINVAL; |
| } |
| } |