File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
page_table_entry/src/arch Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,11 @@ pub struct LA64PTE(u64);
125125
126126impl LA64PTE {
127127 const PHYS_ADDR_MASK : u64 = 0x0000_ffff_ffff_f000 ; // bits 12..48
128+
129+ /// Creates an empty descriptor with all bits set to zero.
130+ pub const fn empty ( ) -> Self {
131+ Self ( 0 )
132+ }
128133}
129134
130135impl GenericPTE for LA64PTE {
Original file line number Diff line number Diff line change @@ -81,6 +81,11 @@ pub struct Rv64PTE(u64);
8181
8282impl Rv64PTE {
8383 const PHYS_ADDR_MASK : u64 = ( 1 << 54 ) - ( 1 << 10 ) ; // bits 10..54
84+
85+ /// Creates an empty descriptor with all bits set to zero.
86+ pub const fn empty ( ) -> Self {
87+ Self ( 0 )
88+ }
8489}
8590
8691impl GenericPTE for Rv64PTE {
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ pub struct X64PTE(u64);
5858
5959impl X64PTE {
6060 const PHYS_ADDR_MASK : u64 = 0x000f_ffff_ffff_f000 ; // bits 12..52
61+
62+ /// Creates an empty descriptor with all bits set to zero.
63+ pub const fn empty ( ) -> Self {
64+ Self ( 0 )
65+ }
6166}
6267
6368impl GenericPTE for X64PTE {
You can’t perform that action at this time.
0 commit comments