diff --git a/dev/bus/pci/include/dev/bus/pci.h b/dev/bus/pci/include/dev/bus/pci.h index 10e90d197e..0368205e31 100644 --- a/dev/bus/pci/include/dev/bus/pci.h +++ b/dev/bus/pci/include/dev/bus/pci.h @@ -36,27 +36,6 @@ typedef struct { bool valid; } pci_bar_t; -typedef struct { - uint8_t id; - uint8_t next; -} __PACKED pci_capability_t; - -typedef struct { - uint8_t bus; - uint8_t device; - uint8_t link_int_a; - uint16_t irq_int_a; - uint8_t link_int_b; - uint16_t irq_int_b; - uint8_t link_int_c; - uint16_t irq_int_c; - uint8_t link_int_d; - uint16_t irq_int_d; - uint8_t slot; - uint8_t reserved; -} __PACKED irq_routing_entry; - - // only use one of these two: // try to detect PCI based on legacy PC PCI accessor methods status_t pci_init_legacy(void); diff --git a/dev/include/hw/pci.h b/dev/include/hw/pci.h index 55b5c04dbb..5fa3f9f7aa 100644 --- a/dev/include/hw/pci.h +++ b/dev/include/hw/pci.h @@ -141,7 +141,7 @@ typedef struct { uint16_t bridge_control; } type1; // configuration for bridge devices }; -} __PACKED pci_config_t; +} pci_config_t; static_assert(sizeof(pci_config_t) == 0x40, ""); /* Class/subclass codes (incomplete) */ diff --git a/lib/partition/include/lib/partition.h b/lib/partition/include/lib/partition.h index 585a4e7ae3..69b91a343c 100644 --- a/lib/partition/include/lib/partition.h +++ b/lib/partition/include/lib/partition.h @@ -7,11 +7,15 @@ */ #pragma once +#include #include +__BEGIN_CDECLS + /* examine and try to publish partitions on a particular device at a particular offset */ int partition_publish(const char *device, off_t offset); /* remove any published subdevices on this device */ int partition_unpublish(const char *device); +__END_CDECLS diff --git a/lib/partition/partition.c b/lib/partition/partition.c index 30bad978a0..0db56c74ef 100644 --- a/lib/partition/partition.c +++ b/lib/partition/partition.c @@ -5,6 +5,8 @@ * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT */ +#include "lib/partition.h" + #include #include #include @@ -12,13 +14,13 @@ #include #include #include -#include +#include struct chs { uint8_t c; uint8_t h; uint8_t s; -} __PACKED; +}; struct mbr_part { uint8_t status; @@ -27,7 +29,8 @@ struct mbr_part { struct chs end; uint32_t lba_start; uint32_t lba_length; -} __PACKED; +}; +static_assert(sizeof(struct mbr_part) == 16, ""); static status_t validate_mbr_partition(bdev_t *dev, const struct mbr_part *part) { /* check for invalid types */ diff --git a/lib/tga/tga.c b/lib/tga/tga.c index 7b65293771..4af3e92a1c 100644 --- a/lib/tga/tga.c +++ b/lib/tga/tga.c @@ -35,6 +35,7 @@ struct tga_header { uint8_t bitsperpixel; uint8_t imagedescriptor; } __PACKED; +static_assert(sizeof(struct tga_header) == 18, ""); static void print_tga_info(const struct tga_header *header) { LTRACEF("idlength %hhd\n", header->idlength);