feat(init): add init crate with declarative boot manifest, boot sequence, supervisor and shutdown stubs
Also: make types from_raw/raw const fn, add create_process/kill/delegate/revoke to userspace syscall stubs.
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
pub struct EntryPoint(usize);
|
||||
|
||||
impl EntryPoint {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
pub const fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
pub const fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@@ -15,11 +15,11 @@ impl EntryPoint {
|
||||
pub struct StackPointer(usize);
|
||||
|
||||
impl StackPointer {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
pub const fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
pub const fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,11 @@ impl StackPointer {
|
||||
pub struct VirtualAddress(usize);
|
||||
|
||||
impl VirtualAddress {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
pub const fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
pub const fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
@@ -41,11 +41,11 @@ impl VirtualAddress {
|
||||
pub struct PhysicalAddress(usize);
|
||||
|
||||
impl PhysicalAddress {
|
||||
pub fn from_raw(addr: usize) -> Self {
|
||||
pub const fn from_raw(addr: usize) -> Self {
|
||||
Self(addr)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> usize {
|
||||
pub const fn raw(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ macro_rules! kernel_id {
|
||||
pub struct $name($inner);
|
||||
|
||||
impl $name {
|
||||
pub fn from_raw(value: $inner) -> Self {
|
||||
pub const fn from_raw(value: $inner) -> Self {
|
||||
Self(value)
|
||||
}
|
||||
|
||||
pub fn raw(&self) -> $inner {
|
||||
pub const fn raw(&self) -> $inner {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user