Browse Source

multiboot2: bitflags v1.0 -> v2.0

Philipp Schuster 1 year ago
parent
commit
9eb9f23952
4 changed files with 12 additions and 2 deletions
  1. 1 1
      Cargo.lock
  2. 1 1
      multiboot2/Cargo.toml
  3. 2 0
      multiboot2/src/elf_sections.rs
  4. 8 0
      multiboot2/src/vbe_info.rs

+ 1 - 1
Cargo.lock

@@ -53,7 +53,7 @@ dependencies = [
 name = "multiboot2"
 version = "0.15.1"
 dependencies = [
- "bitflags 1.3.2",
+ "bitflags 2.3.2",
  "derive_more",
  "log",
  "ptr_meta",

+ 1 - 1
multiboot2/Cargo.toml

@@ -40,7 +40,7 @@ builder = ["alloc"]
 unstable = []
 
 [dependencies]
-bitflags = "1"
+bitflags = "2"
 derive_more = { version = "0.99", default-features = false, features = ["display"] }
 log = { version = "0.4", default-features = false }
 uefi-raw = { version = "0.2.0", default-features = false }

+ 2 - 0
multiboot2/src/elf_sections.rs

@@ -409,6 +409,8 @@ pub enum ElfSectionType {
 
 bitflags! {
     /// ELF Section bitflags.
+    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
+    #[repr(transparent)]
     pub struct ElfSectionFlags: u64 {
         /// The section contains data that should be writable during program execution.
         const WRITABLE = 0x1;

+ 8 - 0
multiboot2/src/vbe_info.rs

@@ -247,6 +247,8 @@ pub struct VBEField {
 
 bitflags! {
     /// The Capabilities field indicates the support of specific features in the graphics environment.
+    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
+    #[repr(transparent)]
     pub struct VBECapabilities: u32 {
         /// Can the DAC be switched between 6 and 8 bit modes.
         const SWITCHABLE_DAC = 0x1;
@@ -263,6 +265,8 @@ bitflags! {
 
 bitflags! {
     /// A Mode attributes bitfield.
+    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
+    #[repr(transparent)]
     pub struct VBEModeAttributes: u16 {
         /// Mode supported by hardware configuration.
         const SUPPORTED = 0x1;
@@ -294,6 +298,8 @@ bitflags! {
 bitflags! {
     /// The WindowAttributes describe the characteristics of the CPU windowing
     /// scheme such as whether the windows exist and are read/writeable, as follows:
+    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
+    #[repr(transparent)]
     pub struct VBEWindowAttributes: u8 {
         /// Relocatable window(s) supported?
         const RELOCATABLE = 0x1;
@@ -317,6 +323,8 @@ bitflags! {
     /// (it is assumed all color ramp data is 8 bits per primary).
     /// Bit D1 specifies whether the bits in the Rsvd field of the direct color
     /// pixel can be used by the application or are reserved, and thus unusable.
+    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord)]
+    #[repr(transparent)]
     pub struct VBEDirectColorAttributes: u8 {
         /// Color ramp is fixed when cleared and programmable when set.
         const PROGRAMMABLE = 0x1;