Skip to main content

arch_rs_tests/
arch_rs_tests.rs

1// Copyright 2026 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
5#![no_std]
6
7#[unsafe(no_mangle)]
8pub extern "C" fn rust_arch_rs_tests_interrupt_ops() -> bool {
9    let initially_disabled = arch_rs::ints_disabled();
10    if initially_disabled {
11        return false;
12    }
13    arch_rs::disable_ints();
14    if !arch_rs::ints_disabled() {
15        return false;
16    }
17    arch_rs::enable_ints();
18    if arch_rs::ints_disabled() {
19        return false;
20    }
21    true
22}
23
24#[unsafe(no_mangle)]
25pub extern "C" fn rust_arch_rs_tests_curr_cpu_num() -> u32 {
26    arch_rs::curr_cpu_num()
27}
28
29#[unsafe(no_mangle)]
30pub extern "C" fn rust_arch_rs_tests_max_num_cpus() -> u32 {
31    arch_rs::max_num_cpus()
32}