{"id":20446291,"url":"https://github.com/rust-embedded/aarch64-cpu","last_synced_at":"2025-05-16T03:05:15.937Z","repository":{"id":62798021,"uuid":"562583916","full_name":"rust-embedded/aarch64-cpu","owner":"rust-embedded","description":"Low level access to processors using the AArch64 execution state.","archived":false,"fork":false,"pushed_at":"2024-11-14T17:24:52.000Z","size":334,"stargazers_count":82,"open_issues_count":2,"forks_count":27,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-13T15:07:27.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-embedded.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-06T19:39:33.000Z","updated_at":"2025-05-10T07:02:40.000Z","dependencies_parsed_at":"2024-02-20T22:27:35.580Z","dependency_job_id":"d1356ee0-cfe6-426b-85a9-a5cd57bca930","html_url":"https://github.com/rust-embedded/aarch64-cpu","commit_stats":{"total_commits":145,"total_committers":22,"mean_commits":6.590909090909091,"dds":0.4620689655172414,"last_synced_commit":"9306aff9ad71738bfef5a50e393bb5e009ad2b2e"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Faarch64-cpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Faarch64-cpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Faarch64-cpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded%2Faarch64-cpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-embedded","download_url":"https://codeload.github.com/rust-embedded/aarch64-cpu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:18:54.925Z","updated_at":"2025-05-16T03:05:10.913Z","avatar_url":"https://github.com/rust-embedded.png","language":"Rust","readme":"[![crates.io](https://img.shields.io/crates/d/aarch64-cpu.svg)](https://crates.io/crates/aarch64-cpu)\n[![crates.io](https://img.shields.io/crates/v/aarch64-cpu.svg)](https://crates.io/crates/aarch64-cpu)\n\n# aarch64-cpu\n\nLow level access to processors using the AArch64 execution state.\n\nThis project is developed and maintained by the [Cortex-A team][team].\n\n## [Documentation](https://docs.rs/aarch64-cpu)\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on current stable Rust.\nIt might compile with older versions but that may change in any new patch release.\n\n## Usage\n\nPlease note that for using this crate's [register definitions](src/registers) (as provided by\n`aarch64_cpu::registers::*`), you need to also import\n`aarch64_cpu::registers::{Readable, Writeable}`.\n\n### Example\n\nCheck out https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials for usage examples. Listed\nbelow is a snippet of `rust-raspberrypi-OS-tutorials`'s early boot code.\n\n```rust\nuse aarch64_cpu::{asm, registers::*};\n\n// Some parts omitted for brevity.\n\nunsafe fn prepare_el2_to_el1_transition(\n    virt_boot_core_stack_end_exclusive_addr: u64,\n    virt_kernel_init_addr: u64,\n) {\n    // Enable timer counter registers for EL1.\n    CNTHCTL_EL2.write(CNTHCTL_EL2::EL1PCEN::SET + CNTHCTL_EL2::EL1PCTEN::SET);\n\n    // No offset for reading the counters.\n    CNTVOFF_EL2.set(0);\n\n    // Set EL1 execution state to AArch64.\n    HCR_EL2.write(HCR_EL2::RW::EL1IsAarch64);\n\n    // Set up a simulated exception return.\n    SPSR_EL2.write(\n        SPSR_EL2::D::Masked\n            + SPSR_EL2::A::Masked\n            + SPSR_EL2::I::Masked\n            + SPSR_EL2::F::Masked\n            + SPSR_EL2::M::EL1h,\n    );\n}\n```\n\n## Disclaimer\n\nDescriptive comments in the source files are taken from the\n[ARM Architecture Reference Manual ARMv8, for ARMv8-A architecture profile](https://documentation-service.arm.com/static/62ff43b0e95b0a633aff8a64?token=).\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  http://www.apache.org/licenses/LICENSE-2.0)\n- MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the\nwork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n\n## Code of Conduct\n\nContribution to this crate is organized under the terms of the [Rust Code of\nConduct][CoC], the maintainer of this crate, the [Cortex-A team][team], promises\nto intervene to uphold that code of conduct.\n\n[CoC]: CODE_OF_CONDUCT.md\n[team]: https://github.com/rust-embedded/wg#the-cortex-a-team\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Faarch64-cpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-embedded%2Faarch64-cpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded%2Faarch64-cpu/lists"}