starnix_types/arch.rs
1// Copyright 2024 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use starnix_uapi::user_address::ArchSpecific;
6
7#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
8pub enum ArchWidth {
9 #[default]
10 Arch64,
11 #[cfg(target_arch = "aarch64")]
12 Arch32,
13}
14
15impl ArchSpecific for ArchWidth {
16 fn is_arch32(&self) -> bool {
17 cfg_if::cfg_if! {
18 if #[cfg(target_arch = "aarch64")] {
19 self == &Self::Arch32
20 } else {
21 false
22 }
23 }
24 }
25}