Lines Matching refs:usize
64 pub fn virt_2_phys(addr: usize) -> usize { in virt_2_phys() argument
65 addr - PAGE_OFFSET as usize in virt_2_phys()
70 pub fn phys_2_virt(addr: usize) -> usize { in phys_2_virt() argument
71 addr + PAGE_OFFSET as usize in phys_2_virt()
85 pub struct PhysAddr(usize);
89 pub const fn new(address: usize) -> Self { in new()
95 pub fn data(&self) -> usize { in data() argument
101 pub fn add(self, offset: usize) -> Self { in add()
107 pub fn check_aligned(&self, align: usize) -> bool { in check_aligned()
123 impl core::ops::Add<usize> for PhysAddr {
127 fn add(self, rhs: usize) -> Self::Output { in add()
132 impl core::ops::AddAssign<usize> for PhysAddr {
134 fn add_assign(&mut self, rhs: usize) { in add_assign() argument
155 impl core::ops::Sub<usize> for PhysAddr {
159 fn sub(self, rhs: usize) -> Self::Output { in sub()
164 impl core::ops::SubAssign<usize> for PhysAddr {
166 fn sub_assign(&mut self, rhs: usize) { in sub_assign() argument
172 type Output = usize;
190 pub struct VirtAddr(usize);
194 pub const fn new(address: usize) -> Self { in new()
200 pub fn data(&self) -> usize { in data() argument
216 pub fn check_aligned(&self, align: usize) -> bool { in check_aligned()
250 impl Add<usize> for VirtAddr {
254 fn add(self, rhs: usize) -> Self::Output { in add()
260 type Output = usize;
268 impl Sub<usize> for VirtAddr {
272 fn sub(self, rhs: usize) -> Self::Output { in sub()
277 impl AddAssign<usize> for VirtAddr {
279 fn add_assign(&mut self, rhs: usize) { in add_assign() argument
291 impl SubAssign<usize> for VirtAddr {
293 fn sub_assign(&mut self, rhs: usize) { in sub_assign() argument
317 pub size: usize,
322 const PAGE_SHIFT: usize;
324 const PAGE_ENTRY_SHIFT: usize;
326 const PAGE_LEVELS: usize;
329 const ENTRY_ADDRESS_SHIFT: usize;
331 const ENTRY_FLAG_DEFAULT_PAGE: usize;
333 const ENTRY_FLAG_DEFAULT_TABLE: usize;
335 const ENTRY_FLAG_PRESENT: usize;
337 const ENTRY_FLAG_READONLY: usize;
339 const ENTRY_FLAG_READWRITE: usize;
341 const ENTRY_FLAG_USER: usize;
343 const ENTRY_FLAG_WRITE_THROUGH: usize;
345 const ENTRY_FLAG_CACHE_DISABLE: usize;
347 const ENTRY_FLAG_NO_EXEC: usize;
349 const ENTRY_FLAG_EXEC: usize;
352 const PHYS_OFFSET: usize;
355 const PAGE_SIZE: usize = 1 << Self::PAGE_SHIFT;
357 const PAGE_OFFSET_MASK: usize = Self::PAGE_SIZE - 1;
360 const PAGE_ADDRESS_SHIFT: usize = Self::PAGE_LEVELS * Self::PAGE_ENTRY_SHIFT + Self::PAGE_SHIFT;
362 const PAGE_ADDRESS_SIZE: usize = 1 << Self::PAGE_ADDRESS_SHIFT;
364 const PAGE_ADDRESS_MASK: usize = Self::PAGE_ADDRESS_SIZE - Self::PAGE_SIZE;
366 const PAGE_ENTRY_SIZE: usize = 1 << (Self::PAGE_SHIFT - Self::PAGE_ENTRY_SHIFT);
368 const PAGE_ENTRY_NUM: usize = 1 << Self::PAGE_ENTRY_SHIFT;
370 const PAGE_ENTRY_MASK: usize = Self::PAGE_ENTRY_NUM - 1;
372 const PAGE_NEGATIVE_MASK: usize = !((Self::PAGE_ADDRESS_SIZE) - 1);
374 const ENTRY_ADDRESS_SIZE: usize = 1 << Self::ENTRY_ADDRESS_SHIFT;
376 const ENTRY_ADDRESS_MASK: usize = Self::ENTRY_ADDRESS_SIZE - Self::PAGE_SIZE;
378 const ENTRY_FLAGS_MASK: usize = !Self::ENTRY_ADDRESS_MASK;
404 unsafe fn write_bytes(address: VirtAddr, value: u8, count: usize) { in write_bytes() argument
469 size: usize,
475 pub fn new(start: VirtAddr, size: usize) -> Self { in new()
518 pub fn size(&self) -> usize { in size() argument
524 pub fn set_size(&mut self, size: usize) { in set_size() argument
614 pub fn verify_area(addr: VirtAddr, size: usize) -> Result<(), SystemError> { in verify_area()