diff --git a/components/patina_acpi/Cargo.toml b/components/patina_acpi/Cargo.toml index 16cc63dac9..fb98c81ead 100644 --- a/components/patina_acpi/Cargo.toml +++ b/components/patina_acpi/Cargo.toml @@ -21,7 +21,7 @@ patina_test = { workspace = true } [dev-dependencies] mockall = { workspace = true } -patina = { workspace = true, features = ["mockall"] } +patina = { workspace = true, features = ["alloc", "mockall"] } [features] mockall = ["dep:mockall", "std"] diff --git a/components/patina_adv_logger/Cargo.toml b/components/patina_adv_logger/Cargo.toml index d316c1d6f6..92195e6e99 100644 --- a/components/patina_adv_logger/Cargo.toml +++ b/components/patina_adv_logger/Cargo.toml @@ -17,7 +17,7 @@ required-features = ['std'] [dependencies] log = { workspace = true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } patina_test = { workspace = true } spin = { workspace = true } zerocopy = { workspace = true } diff --git a/components/patina_mm/Cargo.toml b/components/patina_mm/Cargo.toml index c96505aa35..e5149fd783 100644 --- a/components/patina_mm/Cargo.toml +++ b/components/patina_mm/Cargo.toml @@ -14,7 +14,7 @@ workspace = true cfg-if = { workspace = true } log = { workspace = true } mockall = { workspace = true, optional = true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } zerocopy = { workspace = true } zerocopy-derive = { workspace = true } diff --git a/components/patina_performance/Cargo.toml b/components/patina_performance/Cargo.toml index 200ecc6516..96d01e3f19 100644 --- a/components/patina_performance/Cargo.toml +++ b/components/patina_performance/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] log = { workspace = true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } patina_mm = { workspace = true } zerocopy = { workspace = true } zerocopy-derive = { workspace = true } diff --git a/components/patina_samples/Cargo.toml b/components/patina_samples/Cargo.toml index 43f650d201..fed7e58ee2 100644 --- a/components/patina_samples/Cargo.toml +++ b/components/patina_samples/Cargo.toml @@ -12,7 +12,7 @@ workspace = true [dependencies] log = { workspace = true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } patina_macro = { workspace = true } patina_smbios = { workspace = true } diff --git a/components/patina_smbios/Cargo.toml b/components/patina_smbios/Cargo.toml index 3d5411e64a..795bccac40 100644 --- a/components/patina_smbios/Cargo.toml +++ b/components/patina_smbios/Cargo.toml @@ -10,7 +10,7 @@ description = "System Management BIOS (SMBIOS) support for Patina UEFI component [dependencies] log = { workspace = true } mockall = { workspace = true, optional = true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } patina_macro = { workspace = true } zerocopy = { workspace = true } zerocopy-derive = { workspace = true } diff --git a/components/patina_test/Cargo.toml b/components/patina_test/Cargo.toml index df2e6aeeed..91d825f08a 100644 --- a/components/patina_test/Cargo.toml +++ b/components/patina_test/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] linkme = { workspace = true } log = { workspace = true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } patina_macro = { workspace = true } spin = { workspace = true } diff --git a/core/patina_debugger/Cargo.toml b/core/patina_debugger/Cargo.toml index f5a87067b7..e38c3e17a4 100644 --- a/core/patina_debugger/Cargo.toml +++ b/core/patina_debugger/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] cfg-if = { workspace = true } gdbstub = { workspace = true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } patina_internal_cpu = { workspace = true } log = { workspace = true } spin = { workspace = true } @@ -28,7 +28,6 @@ serial_test = { workspace = true } patina_mtrr = { workspace = true } [features] -default = [] alloc = [] # All non-std features to test in CI ci_features = ["alloc"] diff --git a/core/patina_internal_core/Cargo.toml b/core/patina_internal_core/Cargo.toml index cfc0de462b..d447139287 100644 --- a/core/patina_internal_core/Cargo.toml +++ b/core/patina_internal_core/Cargo.toml @@ -13,14 +13,13 @@ workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["alloc"] alloc = [] # All non-std features to test in CI ci_features = ["alloc"] [dependencies] log = { workspace=true } -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } uuid = { workspace = true } [dev-dependencies] diff --git a/core/patina_internal_cpu/Cargo.toml b/core/patina_internal_cpu/Cargo.toml index 45daa39874..4745a4e443 100644 --- a/core/patina_internal_cpu/Cargo.toml +++ b/core/patina_internal_cpu/Cargo.toml @@ -15,7 +15,7 @@ features = ["std"] [dependencies] log = { workspace = true } -patina = { workspace = true, features = ["core"] } +patina = { workspace = true, features = ["alloc", "core"] } spin = { workspace = true, features = ["rwlock"] } patina_paging = { workspace = true } cfg-if = { workspace = true } @@ -32,7 +32,6 @@ mockall = { workspace = true } serial_test = { workspace = true } [features] -default = [] std = [] # All non-std features to test in CI ci_features = [] diff --git a/patina_dxe_core/Cargo.toml b/patina_dxe_core/Cargo.toml index b47c54a39d..91a7ff85c0 100644 --- a/patina_dxe_core/Cargo.toml +++ b/patina_dxe_core/Cargo.toml @@ -22,9 +22,9 @@ scroll = { workspace = true, features = ["derive"] } spin = { workspace = true } corosensei = { workspace = true } uuid = { workspace = true } -patina = { workspace = true, features = ["core"] } +patina = { workspace = true, features = ["alloc", "core"] } patina_ffs = { workspace = true } -patina_internal_core = { workspace = true } +patina_internal_core = { workspace = true, features = ["alloc"] } patina_internal_cpu = { workspace = true } patina_debugger = { workspace = true, features = ["alloc"] } patina_test = { workspace = true } @@ -35,9 +35,9 @@ patina_test = { workspace = true } # local to the workspace should be added via `path` instead of `workspace = true` so that that it does not fail to # compile due to the dev-dependency not being published yet. patina_samples = { path = "../components/patina_samples" } -patina = { path = "../sdk/patina", features = ["core", "mockall"] } +patina = { path = "../sdk/patina", features = ["alloc", "core", "mockall"] } patina_ffs_extractors = { path = "../sdk/patina_ffs_extractors" } -patina_internal_core = { path = "../core/patina_internal_core" } +patina_internal_core = { path = "../core/patina_internal_core", features = ["alloc"] } env_logger = { workspace = true } mockall = { workspace = true } serial_test = { workspace = true } @@ -48,7 +48,6 @@ zerocopy-derive = { workspace = true } arm-gic = { workspace = true } [features] -default = [] std = ["patina/std"] compatibility_mode_allowed = [] v1_resource_descriptor_support = [] diff --git a/sdk/patina/Cargo.toml b/sdk/patina/Cargo.toml index 0c16bb9f09..beb77fadbd 100644 --- a/sdk/patina/Cargo.toml +++ b/sdk/patina/Cargo.toml @@ -87,7 +87,6 @@ std = ['alloc'] alloc = ["dep:goblin", "dep:fixedbitset"] mockall = ["dep:mockall", "std"] global_allocator = [] -default = ['alloc'] serde = ["alloc", "dep:serde", "serde/alloc", "dep:serde_json"] serde-with-yaml = ["serde", "dep:serde_yaml"] diff --git a/sdk/patina/src/base/c_ptr.rs b/sdk/patina/src/base/c_ptr.rs index bdb672937b..5feccc12de 100644 --- a/sdk/patina/src/base/c_ptr.rs +++ b/sdk/patina/src/base/c_ptr.rs @@ -172,6 +172,7 @@ unsafe impl<'a, T> CMutRef<'a> for &'a mut T {} // Box #[cfg(any(test, feature = "alloc"))] // SAFETY: Memory layout and mutability are respected for these types. +#[cfg(any(test, feature = "alloc"))] unsafe impl CPtr<'_> for Box { type Type = T; @@ -181,12 +182,15 @@ unsafe impl CPtr<'_> for Box { } #[cfg(any(test, feature = "alloc"))] // SAFETY: Memory layout and mutability are respected for these types. +#[cfg(any(test, feature = "alloc"))] unsafe impl CRef<'_> for Box {} #[cfg(any(test, feature = "alloc"))] // SAFETY: Memory layout and mutability are respected for these types. +#[cfg(any(test, feature = "alloc"))] unsafe impl CMutPtr<'_> for Box {} #[cfg(any(test, feature = "alloc"))] // SAFETY: Memory layout and mutability are respected for these types. +#[cfg(any(test, feature = "alloc"))] unsafe impl CMutRef<'_> for Box {} // () diff --git a/sdk/patina_ffs/Cargo.toml b/sdk/patina_ffs/Cargo.toml index 8a1e12d9fe..98b77dc4d8 100644 --- a/sdk/patina_ffs/Cargo.toml +++ b/sdk/patina_ffs/Cargo.toml @@ -11,7 +11,7 @@ description = "Support for Firmware File System as described in the UEFI Platfor workspace = true [dependencies] -patina = {workspace = true} +patina = {workspace = true, features = ["alloc"]} log = {workspace = true} [dev-dependencies] diff --git a/sdk/patina_ffs_extractors/Cargo.toml b/sdk/patina_ffs_extractors/Cargo.toml index 32096c3d10..86699bf280 100644 --- a/sdk/patina_ffs_extractors/Cargo.toml +++ b/sdk/patina_ffs_extractors/Cargo.toml @@ -11,7 +11,7 @@ description = "UEFI section extractor implementations." workspace = true [dependencies] -patina = { workspace = true } +patina = { workspace = true, features = ["alloc"] } patina_ffs = { workspace = true } brotli-decompressor = { workspace = true, optional = true } alloc-no-stdlib = { workspace = true, optional = true } diff --git a/sdk/patina_macro/Cargo.toml b/sdk/patina_macro/Cargo.toml index 2f74b6a310..6fa8272cb7 100644 --- a/sdk/patina_macro/Cargo.toml +++ b/sdk/patina_macro/Cargo.toml @@ -24,11 +24,10 @@ proc-macro2 = { workspace = true } # cargo-release, however they are still used when verifying the package is compileable. Any dev-dependency that is # local to the workspace should be added via `path` instead of `workspace = true` so that that it does not fail to # compile due to the dev-dependency not being published yet. -patina = { path="../../sdk/patina" } +patina = { path="../../sdk/patina", features = ["alloc"] } [features] -default = [] # Opting in to the `enable_patina_tests` feature requires registering at least one test # with the `#[patina_test]` attribute. Otherwise, a linker crash or failure will # occur!