pad ssb structures to allow ARM cross-compilation

svn path=/dists/trunk/linux-2.6/; revision=10662
This commit is contained in:
Martin Michlmayr 2008-02-26 10:21:13 +00:00
parent 8b658d96fa
commit 0de5714fbd
3 changed files with 42 additions and 0 deletions

2
debian/changelog vendored
View File

@ -35,6 +35,8 @@ iinux-2.6 (2.6.25~rc3-1~experimental.1) UNRELEASED; urgency=low
* [arm/armel] Add a kernel for Orion based devices, such as the QNAP
TS-109/TS-209.
* [arm/armel] Unset CRYPTO_DEV_HIFN_795X since it causes a build failure.
* [arm] Pad the SSB structure so crossing-compiling a kernel for ARM
won't fail because of sanity checks; patch from Gordon Farquharson.
[ Daniel Baumann ]
* Added patch from unionfs upstream to export release_open_intent symbol.

View File

@ -0,0 +1,39 @@
Align the members of the SSB device structure to a 32 bit boundary so
that the b43 driver can be built for arm using a cross compiler. This
alignment is required so that the test in scripts/mod/file2alias.c
that checks that the size of the device ID type against the size of
the section in the object file succeeds (see comment and
http://lkml.org/lkml/2008/2/18/481 for explanation).
This fixes:
MODPOST 972 modules
FATAL: drivers/net/wireless/b43/b43: sizeof(struct ssb_device_id)=6 is not a modulo of the size of section __mod_ssb_device_table=64.
Fix definition of struct ssb_device_id in mod_devicetable.h
make[5]: *** [__modpost] Error 1
make[4]: *** [modules] Error 2
Signed-off-by: Gordon Farquharson <gordonfarquharson@gmail.com>
---
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 139d49d..208d49a 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -351,7 +351,13 @@ struct sdio_device_id {
struct ssb_device_id {
__u16 vendor;
__u16 coreid;
- __u8 revision;
+ /* Explicit padding to support a broken sanity check in file2alias.c.
+ * The check compares the size of the structure in the kernel
+ * object file to the size of the structure reported in userspace for
+ * the system on which the kernel is compiled. The check breaks on
+ * cross-compilation, and the padding is a workaround for this. */
+ __u8 revision
+ __attribute__((aligned(sizeof(__u32))));
};
#define SSB_DEVICE(_vendor, _coreid, _revision) \
{ .vendor = _vendor, .coreid = _coreid, .revision = _revision, }

View File

@ -30,3 +30,4 @@
+ bugfix/arm/disable-r6040.patch
+ features/all/at76.patch
+ bugfix/arm/ignore-invalid-memtags.patch
+ bugfix/arm/pad-ssb-structure.patch