Reverted the __packed and __aligned change.

We should not add compiler extensions, it is not our job. We are not a
selfcontained project as kernel is so we should not introduce things
like this.

If we need to add some abstraction for this in the future to support
compilers doing these things differently then we will do that the same
way we dealt with the depricated attribute.
This commit is contained in:
Piotr Esden-Tempski 2013-06-13 10:29:21 -07:00
parent 8da7fbd71e
commit cabbd21329
7 changed files with 17 additions and 20 deletions

View File

@ -86,7 +86,4 @@
#define BIT30 (1<<30)
#define BIT31 (1<<31)
#define __packed __attribute__((packed))
#define __aligned(x) __attribute__((aligned(x)))
#endif

View File

@ -375,7 +375,7 @@ struct scb_exception_stack_frame {
uint32_t lr;
uint32_t pc;
uint32_t xpsr;
} __packed;
} __attribute__((packed));
#define SCB_GET_EXCEPTION_STACK_FRAME(f) \
do { \

View File

@ -88,7 +88,7 @@ struct usb_cdc_union_descriptor {
uint8_t bControlInterface;
uint8_t bSubordinateInterface0;
/* ... */
} __packed;
} __attribute__((packed));
/* Definitions for Abstract Control Model devices from:
@ -103,7 +103,7 @@ struct usb_cdc_call_management_descriptor {
uint8_t bDescriptorSubtype;
uint8_t bmCapabilities;
uint8_t bDataInterface;
} __packed;
} __attribute__((packed));
/* Table 4: Abstract Control Management Functional Descriptor */
struct usb_cdc_acm_descriptor {
@ -111,7 +111,7 @@ struct usb_cdc_acm_descriptor {
uint8_t bDescriptorType;
uint8_t bDescriptorSubtype;
uint8_t bmCapabilities;
} __packed;
} __attribute__((packed));
/* Table 13: Class-Specific Request Codes for PSTN subclasses */
/* ... */
@ -126,7 +126,7 @@ struct usb_cdc_line_coding {
uint8_t bCharFormat;
uint8_t bParityType;
uint8_t bDataBits;
} __packed;
} __attribute__((packed));
/* Table 30: Class-Specific Notification Codes for PSTN subclasses */
/* ... */
@ -140,7 +140,7 @@ struct usb_cdc_notification {
uint16_t wValue;
uint16_t wIndex;
uint16_t wLength;
} __packed;
} __attribute__((packed));
#endif

View File

@ -94,7 +94,7 @@ struct usb_dfu_descriptor {
uint16_t wDetachTimeout;
uint16_t wTransferSize;
uint16_t bcdDFUVersion;
} __packed;
} __attribute__((packed));
#endif

View File

@ -51,7 +51,7 @@ struct usb_hid_descriptor {
uint16_t bcdHID;
uint8_t bCountryCode;
uint8_t bNumDescriptors;
} __packed;
} __attribute__((packed));
#endif

View File

@ -59,7 +59,7 @@ struct usb_setup_data {
uint16_t wValue;
uint16_t wIndex;
uint16_t wLength;
} __packed;
} __attribute__((packed));
/* Class Definition */
#define USB_CLASS_VENDOR 0xFF
@ -131,7 +131,7 @@ struct usb_device_descriptor {
uint8_t iProduct;
uint8_t iSerialNumber;
uint8_t bNumConfigurations;
} __packed;
} __attribute__((packed));
#define USB_DT_DEVICE_SIZE sizeof(struct usb_device_descriptor)
@ -148,7 +148,7 @@ struct usb_device_qualifier_descriptor {
uint8_t bMaxPacketSize0;
uint8_t bNumConfigurations;
uint8_t bReserved;
} __packed;
} __attribute__((packed));
/* USB Standard Configuration Descriptor - Table 9-10 */
struct usb_config_descriptor {
@ -167,7 +167,7 @@ struct usb_config_descriptor {
const struct usb_iface_assoc_descriptor *iface_assoc;
const struct usb_interface_descriptor *altsetting;
} *interface;
} __packed;
} __attribute__((packed));
#define USB_DT_CONFIGURATION_SIZE 9
/* USB Configuration Descriptor bmAttributes bit definitions */
@ -194,7 +194,7 @@ struct usb_interface_descriptor {
const struct usb_endpoint_descriptor *endpoint;
const void *extra;
int extralen;
} __packed;
} __attribute__((packed));
#define USB_DT_INTERFACE_SIZE 9
/* USB Standard Endpoint Descriptor - Table 9-13 */
@ -205,7 +205,7 @@ struct usb_endpoint_descriptor {
uint8_t bmAttributes;
uint16_t wMaxPacketSize;
uint8_t bInterval;
} __packed;
} __attribute__((packed));
#define USB_DT_ENDPOINT_SIZE sizeof(struct usb_endpoint_descriptor)
/* USB Endpoint Descriptor bmAttributes bit definitions */
@ -230,7 +230,7 @@ struct usb_string_descriptor {
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t wData[];
} __packed;
} __attribute__((packed));
/* From ECN: Interface Association Descriptors, Table 9-Z */
struct usb_iface_assoc_descriptor {
@ -242,7 +242,7 @@ struct usb_iface_assoc_descriptor {
uint8_t bFunctionSubClass;
uint8_t bFunctionProtocol;
uint8_t iFunction;
} __packed;
} __attribute__((packed));
#define USB_DT_INTERFACE_ASSOCIATION_SIZE \
sizeof(struct usb_iface_assoc_descriptor)

View File

@ -69,7 +69,7 @@ struct _usbd_device {
DATA_IN, LAST_DATA_IN, STATUS_IN,
DATA_OUT, LAST_DATA_OUT, STATUS_OUT,
} state;
struct usb_setup_data req __aligned(4);
struct usb_setup_data req __attribute__((aligned(4)));
uint8_t *ctrl_buf;
uint16_t ctrl_len;
void (*complete)(usbd_device *usbd_dev,