{"id":29675760,"url":"https://github.com/oxidecomputer/amd-apcb","last_synced_at":"2025-07-22T23:38:36.892Z","repository":{"id":173900711,"uuid":"373232824","full_name":"oxidecomputer/amd-apcb","owner":"oxidecomputer","description":"AMD Generic Encapsulated Software Architecture Platform Security Processor Configuration Block manipulation library","archived":false,"fork":false,"pushed_at":"2025-07-17T18:03:06.000Z","size":362,"stargazers_count":16,"open_issues_count":19,"forks_count":3,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-07-17T21:49:06.796Z","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":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oxidecomputer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2021-06-02T16:20:42.000Z","updated_at":"2025-05-22T17:21:20.000Z","dependencies_parsed_at":"2024-05-15T15:26:41.402Z","dependency_job_id":"d84b77f3-eeac-46a2-90ab-98d51b6b7f17","html_url":"https://github.com/oxidecomputer/amd-apcb","commit_stats":null,"previous_names":["oxidecomputer/amd-apcb"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/oxidecomputer/amd-apcb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Famd-apcb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Famd-apcb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Famd-apcb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Famd-apcb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxidecomputer","download_url":"https://codeload.github.com/oxidecomputer/amd-apcb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Famd-apcb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266591232,"owners_count":23953082,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-07-22T23:38:27.068Z","updated_at":"2025-07-22T23:38:36.876Z","avatar_url":"https://github.com/oxidecomputer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Purpose\n\nThis crate allows you to manipulate APCB (AGESA PSP Configuration Blob),\ndirectly in an image (u8 slice).\n\n# Usage\n\n## Full-featured usage\n\nAdd\n\n    amd-apcb = { path = \"../amd-apcb\", features = [\"serde\", \"schemars\"] }\n\nto the `[dependencies]` block in your `Cargo.toml`.\n\nThis way, you get JSON serialization and JSON schema support.\nThat means when you have an `Apcb` instance in variable `apcb`, you can\ndo `serde_json::to_string_pretty(\u0026apcb)` to get matching JSON out.\nLikewise, you can also deserialize from JSON into a new Apcb instance\n(using `serde_json::from_str`, for example).\n\nEnabling these features slightly changes the signature of some functions (like\n`Apcb::load`) to take copy-on-write buffers (in order to allow\ndeserialization).\n\nIn order to load an existing blob, do this:\n\n    let mut apcb = Apcb::load(std::borrow::Cow::Borrowed(\u0026mut buffer[..]),\n                              \u0026ApcbIoOptions::default())?\n\nFor details, see the generated documentation.\n\n## Minimal usage\n\nAdd\n\n    amd-apcb = { path = \"../amd-apcb\", default_features = false, features = [] }\n\nto the `[dependencies]` block in your `Cargo.toml`.\n\nThis gives you a minimal interface without serialization support. It's\nintended for embedded use.\n\nIn order to load an existing blob, do this:\n\n    let mut apcb = Apcb::load(\u0026mut buffer[..], \u0026ApcbIoOptions::default())?\n\nThere are (about four) groups in the blob. Inside each group there is a\nvariable number of entries. There are a few different entry types for\ndifferent purposes.\n\nYou can use\n\n    apcb.groups()? // or apcb.groups_mut()?\n\nto iterate over the groups.\n\nAlternatively, you can use\n\n    apcb.group(GroupId::xxx)? // or apcb.group_mut(GroupId::xxx)?\n\nto immediately get a specific group (a useful example for `xxx` is `Memory`).\n\nWhen you have a group in variable `group`, you can use\n\n    group.entries() // or group.entries_mut()\n\nto iterate over the entries of that group. Alternatively, you can use\n\n    group.entry_compatible(EntryId::xxx, instance_id, BoardInstances::yyy)\n\nin order to get an entry compatible with the given instance and boards.\n\nAlternatively, you can use\n\n    group.entry_exact(EntryId::xxx, instance_id, BoardInstances::yyy)\n\nin order to get an entry that is exactly specified for the given instance and\nboards.\n\nWhen you have an entry in variable `entry`, you can use\n\n    entry.body_as_struct::\u003cX\u003e()\n\nin order to interpret the entry as the given struct `X`. A useful example for\n`X` is `ErrorOutControl116`.\n\nIn order to interpret the entry as an array of a given struct `X`, you can do:\n\n    entry.body_as_struct_array::\u003cX\u003e()\n\nIn order to interpret the entry as an array of differently-sized records\n(collected into the enum `X`), you can do:\n\n    entry.body_as_struct_sequence:\u003cX\u003e()\n\nBut on a modern AMD platform, the most useful entries are token entries:\n\nIn order to get an interface to the the token entries in a user-friendly form,\nyou can use:\n\n    let tokens = apcb.tokens(instance_id, BoardInstances::new())?\n\nIt's then possible to use a lot of different getters and setters (one each\nper token) in order to access the respective token. For example, you can do\n`tokens.abl_serial_baud_rate()` to get the baud rate for the serial port\nand/or `tokens.set_abl_serial_baud_rate(BaudRate::_9600Baud)` in order to\nset the baud rate for the serial port.\n\nFor more dynamic access, you can do `tokens.get(entry_id, token_id)` directly,\nwhere `entry_id: u16` and `token_id: u32`.\n\nFor details, see the generated documentation.\n\n# Testing\n\nRun\n\n    cargo xtask test\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidecomputer%2Famd-apcb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxidecomputer%2Famd-apcb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidecomputer%2Famd-apcb/lists"}