kernel::sizes

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 = 1_024u32

Source§

const SZ_2K: Self = 2_048u32

Source§

const SZ_4K: Self = 4_096u32

Source§

const SZ_8K: Self = 8_192u32

Source§

const SZ_16K: Self = 16_384u32

Source§

const SZ_32K: Self = 32_768u32

Source§

const SZ_64K: Self = 65_536u32

Source§

const SZ_128K: Self = 131_072u32

Source§

const SZ_256K: Self = 262_144u32

Source§

const SZ_512K: Self = 524_288u32

Source§

const SZ_1M: Self = 1_048_576u32

Source§

const SZ_2M: Self = 2_097_152u32

Source§

const SZ_4M: Self = 4_194_304u32

Source§

const SZ_8M: Self = 8_388_608u32

Source§

const SZ_16M: Self = 16_777_216u32

Source§

const SZ_32M: Self = 33_554_432u32

Source§

const SZ_64M: Self = 67_108_864u32

Source§

const SZ_128M: Self = 134_217_728u32

Source§

const SZ_256M: Self = 268_435_456u32

Source§

const SZ_512M: Self = 536_870_912u32

Source§

const SZ_1G: Self = 1_073_741_824u32

Source§

const SZ_2G: Self = 2_147_483_648u32

Source§

impl SizeConstants for u64

Source§

const SZ_1K: Self = 1_024u64

Source§

const SZ_2K: Self = 2_048u64

Source§

const SZ_4K: Self = 4_096u64

Source§

const SZ_8K: Self = 8_192u64

Source§

const SZ_16K: Self = 16_384u64

Source§

const SZ_32K: Self = 32_768u64

Source§

const SZ_64K: Self = 65_536u64

Source§

const SZ_128K: Self = 131_072u64

Source§

const SZ_256K: Self = 262_144u64

Source§

const SZ_512K: Self = 524_288u64

Source§

const SZ_1M: Self = 1_048_576u64

Source§

const SZ_2M: Self = 2_097_152u64

Source§

const SZ_4M: Self = 4_194_304u64

Source§

const SZ_8M: Self = 8_388_608u64

Source§

const SZ_16M: Self = 16_777_216u64

Source§

const SZ_32M: Self = 33_554_432u64

Source§

const SZ_64M: Self = 67_108_864u64

Source§

const SZ_128M: Self = 134_217_728u64

Source§

const SZ_256M: Self = 268_435_456u64

Source§

const SZ_512M: Self = 536_870_912u64

Source§

const SZ_1G: Self = 1_073_741_824u64

Source§

const SZ_2G: Self = 2_147_483_648u64

Source§

impl SizeConstants for usize

Source§

const SZ_1K: Self = 1_024usize

Source§

const SZ_2K: Self = 2_048usize

Source§

const SZ_4K: Self = 4_096usize

Source§

const SZ_8K: Self = 8_192usize

Source§

const SZ_16K: Self = 16_384usize

Source§

const SZ_32K: Self = 32_768usize

Source§

const SZ_64K: Self = 65_536usize

Source§

const SZ_128K: Self = 131_072usize

Source§

const SZ_256K: Self = 262_144usize

Source§

const SZ_512K: Self = 524_288usize

Source§

const SZ_1M: Self = 1_048_576usize

Source§

const SZ_2M: Self = 2_097_152usize

Source§

const SZ_4M: Self = 4_194_304usize

Source§

const SZ_8M: Self = 8_388_608usize

Source§

const SZ_16M: Self = 16_777_216usize

Source§

const SZ_32M: Self = 33_554_432usize

Source§

const SZ_64M: Self = 67_108_864usize

Source§

const SZ_128M: Self = 134_217_728usize

Source§

const SZ_256M: Self = 268_435_456usize

Source§

const SZ_512M: Self = 536_870_912usize

Source§

const SZ_1G: Self = 1_073_741_824usize

Source§

const SZ_2G: Self = 2_147_483_648usize

Implementors§