Commit 66a01f11 authored by Aaron Sierra's avatar Aaron Sierra Committed by Greg Kroah-Hartman

vme_user: Update API to work in mixed environments

This patch updates the vme_master and vme_slave structures to use
types with well defined size and to prevent the compiler from
inserting padding (between enable and vme_addr for one).

The original vme_master and vme_slave structs would be different
sizes and have different layouts depending on whether they were built
for a 32-bit or 64-bit system.

On x86 it is possible to have a 32-bit userspace and a 64-bit kernel.
In this type of environment, the userspace and kernel vme_user APIs
would disagree and prevent ioctls from executing (based on ioctl
signatures from _IOR and _IOW).
Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Acked-by: default avatarMartyn Welch <martyn.welch@ge.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c326cc02
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
* VMEbus Master Window Configuration Structure * VMEbus Master Window Configuration Structure
*/ */
struct vme_master { struct vme_master {
int enable; /* State of Window */ u32 enable; /* State of Window */
unsigned long long vme_addr; /* Starting Address on the VMEbus */ u64 vme_addr; /* Starting Address on the VMEbus */
unsigned long long size; /* Window Size */ u64 size; /* Window Size */
u32 aspace; /* Address Space */ u32 aspace; /* Address Space */
u32 cycle; /* Cycle properties */ u32 cycle; /* Cycle properties */
u32 dwidth; /* Maximum Data Width */ u32 dwidth; /* Maximum Data Width */
...@@ -18,7 +18,7 @@ struct vme_master { ...@@ -18,7 +18,7 @@ struct vme_master {
int prefetchsize; /* Prefetch Read Size (Cache Lines) */ int prefetchsize; /* Prefetch Read Size (Cache Lines) */
char wrpostenable; /* Write Post State */ char wrpostenable; /* Write Post State */
#endif #endif
}; } __packed;
/* /*
...@@ -31,9 +31,9 @@ struct vme_master { ...@@ -31,9 +31,9 @@ struct vme_master {
/* VMEbus Slave Window Configuration Structure */ /* VMEbus Slave Window Configuration Structure */
struct vme_slave { struct vme_slave {
int enable; /* State of Window */ u32 enable; /* State of Window */
unsigned long long vme_addr; /* Starting Address on the VMEbus */ u64 vme_addr; /* Starting Address on the VMEbus */
unsigned long long size; /* Window Size */ u64 size; /* Window Size */
u32 aspace; /* Address Space */ u32 aspace; /* Address Space */
u32 cycle; /* Cycle properties */ u32 cycle; /* Cycle properties */
#if 0 #if 0
...@@ -41,7 +41,7 @@ struct vme_slave { ...@@ -41,7 +41,7 @@ struct vme_slave {
char rmwlock; /* Lock PCI during RMW Cycles */ char rmwlock; /* Lock PCI during RMW Cycles */
char data64bitcapable; /* non-VMEbus capable of 64-bit Data */ char data64bitcapable; /* non-VMEbus capable of 64-bit Data */
#endif #endif
}; } __packed;
struct vme_irq_id { struct vme_irq_id {
__u8 level; __u8 level;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment