feat: aarch64 port - Raspberry Pi 4/400 SD boot (SDHCI, ext2 root + first-boot grow), USB hubs, PCI INTx routing, SMP, DMA fences
This commit is contained in:
1 parent
8c09ccef66
commit
808e1d66fd
66 files changed
+3690
-196
No files matched your search
@@ -312,6 +312,11 @@ namespace montauk::abi {
|
||||
static constexpr uint64_t SYS_WIN_DRAG_FORMATS = 206; // (serial, TransferFormatInfo*, max) -> count
|
||||
static constexpr uint64_t SYS_WIN_DRAG_GET_DATA = 207; // (serial, mime, buf, max, uint32_t* len) -> status
|
||||
|
||||
/* Storage.hpp -- grow a mounted volume (and its MBR partition) to fill the
|
||||
free space after it. apply=0 only reports; apply=1 does one bounded slice
|
||||
and returns 1 while more remains, 0 once done. CAP_STORAGE_ADMIN. */
|
||||
static constexpr uint64_t SYS_FS_GROW = 208; // (drive, FsGrowStatus*, apply) -> 1 / 0 / status
|
||||
|
||||
/* Kernel-owned process capabilities. User identities may namespace
|
||||
per-user resources, but never participate in authorization decisions. */
|
||||
static constexpr uint64_t CAP_PROCESS_ADMIN = 1ULL << 0;
|
||||
@@ -838,7 +843,7 @@ namespace montauk::abi {
|
||||
|
||||
struct DiskInfo {
|
||||
uint8_t port; // block device index
|
||||
uint8_t type; // 0=none, 1=SATA, 2=SATAPI, 3=NVMe, 4=USB mass storage
|
||||
uint8_t type; // 0=none, 1=SATA, 2=SATAPI, 3=NVMe, 4=USB mass storage, 5=SD card
|
||||
uint8_t sataGen; // SATA gen (1/2/3)
|
||||
uint8_t _pad0;
|
||||
uint64_t sectorCount; // Total user-addressable sectors
|
||||
@@ -920,6 +925,14 @@ namespace montauk::abi {
|
||||
char label[32]; // volume label
|
||||
};
|
||||
|
||||
struct FsGrowStatus {
|
||||
uint64_t fsBytes; // filesystem size now
|
||||
uint64_t partBytes; // partition size now
|
||||
uint64_t targetBytes; // filesystem size once grown; == fsBytes if it cannot grow
|
||||
uint32_t stepsDone; // progress of the grow, out of stepsTotal
|
||||
uint32_t stepsTotal;
|
||||
};
|
||||
|
||||
// Bluetooth scan result (returned by SYS_BTSCAN)
|
||||
struct BtScanResult {
|
||||
uint8_t bdAddr[6];
|
||||
|
||||
@@ -231,6 +231,7 @@ extern "C" {
|
||||
#define MTK_SYS_WIN_DRAG_BEGIN 205
|
||||
#define MTK_SYS_WIN_DRAG_FORMATS 206
|
||||
#define MTK_SYS_WIN_DRAG_GET_DATA 207
|
||||
#define MTK_SYS_FS_GROW 208
|
||||
/* @SYSCALLS-END */
|
||||
|
||||
/* Syscall status codes (montauk/statuscodes.h for C++). */
|
||||
|
||||
@@ -654,6 +654,14 @@ namespace montauk {
|
||||
inline int fs_sync() {
|
||||
return (int)syscall0(montauk::abi::SYS_FS_SYNC);
|
||||
}
|
||||
// Grow mounted volume `drive` (and its MBR partition) to fill the free
|
||||
// space after it. apply=false only fills `status`; apply=true does one
|
||||
// slice of the work and returns 1 while more remains, 0 when finished,
|
||||
// or a negative status.
|
||||
inline int fs_grow(int drive, montauk::abi::FsGrowStatus* status, bool apply) {
|
||||
return (int)syscall3(montauk::abi::SYS_FS_GROW, (uint64_t)drive,
|
||||
(uint64_t)status, apply ? 1 : 0);
|
||||
}
|
||||
inline int fs_format(const montauk::abi::FsFormatParams* params) {
|
||||
return (int)syscall1(montauk::abi::SYS_FSFORMAT, (uint64_t)params);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user