Skip to main content

SizeConstants

Trait SizeConstants 

Source
pub trait SizeConstants {
Show 22 associated constants and 0 method const SZ_1K: Self; const SZ_2K: Self; const SZ_4K: Self; const SZ_8K: Self; const SZ_16K: Self; const SZ_32K: Self; const SZ_64K: Self; const SZ_128K: Self; const SZ_256K: Self; const SZ_512K: Self; const SZ_1M: Self; const SZ_2M: Self; const SZ_4M: Self; const SZ_8M: Self; const SZ_16M: Self; const SZ_32M: Self; const SZ_64M: Self; const SZ_128M: Self; const SZ_256M: Self; const SZ_512M: Self; const SZ_1G: Self; const SZ_2G: Self;
}
Expand description

Size constants for device address spaces.

Implemented for u32, u64, and usize so drivers can choose the width that matches their hardware. All SZ_* values fit in a u32, so all implementations are lossless.

§Examples

use kernel::sizes::SizeConstants;

let gpu_heap = 14 * u64::SZ_1M;
let mmio_window = u32::SZ_16M;

Required Associated Constants§

Source

const SZ_1K: Self

0x0000_0400.

Source

const SZ_2K: Self

0x0000_0800.

Source

const SZ_4K: Self

0x0000_1000.

Source

const SZ_8K: Self

0x0000_2000.

Source

const SZ_16K: Self

0x0000_4000.

Source

const SZ_32K: Self

0x0000_8000.

Source

const SZ_64K: Self

0x0001_0000.

Source

const SZ_128K: Self

0x0002_0000.

Source

const SZ_256K: Self

0x0004_0000.

Source

const SZ_512K: Self

0x0008_0000.

Source

const SZ_1M: Self

0x0010_0000.

Source

const SZ_2M: Self

0x0020_0000.

Source

const SZ_4M: Self

0x0040_0000.

Source

const SZ_8M: Self

0x0080_0000.

Source

const SZ_16M: Self

0x0100_0000.

Source

const SZ_32M: Self

0x0200_0000.

Source

const SZ_64M: Self

0x0400_0000.

Source

const SZ_128M: Self

0x0800_0000.

Source

const SZ_256M: Self

0x1000_0000.

Source

const SZ_512M: Self

0x2000_0000.

Source

const SZ_1G: Self

0x4000_0000.

Source

const SZ_2G: Self

0x8000_0000.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SizeConstants for u32

Source§

const SZ_1K: Self

Source§

const SZ_2K: Self

Source§

const SZ_4K: Self

Source§

const SZ_8K: Self

Source§

const SZ_16K: Self

Source§

const SZ_32K: Self

Source§

const SZ_64K: Self

Source§

const SZ_128K: Self

Source§

const SZ_256K: Self

Source§

const SZ_512K: Self

Source§

const SZ_1M: Self

Source§

const SZ_2M: Self

Source§

const SZ_4M: Self

Source§

const SZ_8M: Self

Source§

const SZ_16M: Self

Source§

const SZ_32M: Self

Source§

const SZ_64M: Self

Source§

const SZ_128M: Self

Source§

const SZ_256M: Self

Source§

const SZ_512M: Self

Source§

const SZ_1G: Self

Source§

const SZ_2G: Self

Source§

impl SizeConstants for u64

Source§

const SZ_1K: Self

Source§

const SZ_2K: Self

Source§

const SZ_4K: Self

Source§

const SZ_8K: Self

Source§

const SZ_16K: Self

Source§

const SZ_32K: Self

Source§

const SZ_64K: Self

Source§

const SZ_128K: Self

Source§

const SZ_256K: Self

Source§

const SZ_512K: Self

Source§

const SZ_1M: Self

Source§

const SZ_2M: Self

Source§

const SZ_4M: Self

Source§

const SZ_8M: Self

Source§

const SZ_16M: Self

Source§

const SZ_32M: Self

Source§

const SZ_64M: Self

Source§

const SZ_128M: Self

Source§

const SZ_256M: Self

Source§

const SZ_512M: Self

Source§

const SZ_1G: Self

Source§

const SZ_2G: Self

Source§

impl SizeConstants for usize

Source§

const SZ_1K: Self

Source§

const SZ_2K: Self

Source§

const SZ_4K: Self

Source§

const SZ_8K: Self

Source§

const SZ_16K: Self

Source§

const SZ_32K: Self

Source§

const SZ_64K: Self

Source§

const SZ_128K: Self

Source§

const SZ_256K: Self

Source§

const SZ_512K: Self

Source§

const SZ_1M: Self

Source§

const SZ_2M: Self

Source§

const SZ_4M: Self

Source§

const SZ_8M: Self

Source§

const SZ_16M: Self

Source§

const SZ_32M: Self

Source§

const SZ_64M: Self

Source§

const SZ_128M: Self

Source§

const SZ_256M: Self

Source§

const SZ_512M: Self

Source§

const SZ_1G: Self

Source§

const SZ_2G: Self

Implementors§