History

Fix SED-OPAL UAPI structs to prevent 32/64 bit size differences.

This patch is a quick fixup of the user structures that will prevent the structures from being different sizes on 32 and 64 bit archs. Taking this fix will allow us to *NOT* have to do compat ioctls for the sed code.

Scott Bauer committed 9 years ago

Commit 8c87fe71 parent a98e58e1 file · +18 −17Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/sed-opal.h+18−17
@@ -48,37 +48,38 @@ enum opal_lock_state { · 47 unmodified lines
4848 };
4949
5050 struct opal_key {
51− uint8_t lr;
52− uint8_t key_len;
53− char key[OPAL_KEY_MAX];
51+ __u8 lr;
52+ __u8 key_len;
53+ __u8 __align[6];
54+ __u8 key[OPAL_KEY_MAX];
5455 };
5556
5657 struct opal_lr_act {
57− int sum;
58− uint8_t num_lrs;
59− uint8_t lr[OPAL_MAX_LRS];
6058 struct opal_key key;
59+ __u32 sum;
60+ __u8 num_lrs;
61+ __u8 lr[OPAL_MAX_LRS];
62+ __u8 align[2]; /* Align to 8 byte boundary */
6163 };
6264
6365 struct opal_session_info {
64− int sum;
65− enum opal_user who;
66+ __u32 sum;
67+ __u32 who;
6668 struct opal_key opal_key;
67− uint8_t __align[2];
6869 };
6970
7071 struct opal_user_lr_setup {
71− size_t range_start;
72− size_t range_length;
73− int RLE; /* Read Lock enabled */
74− int WLE; /* Write Lock Enabled */
72+ __u64 range_start;
73+ __u64 range_length;
74+ __u32 RLE; /* Read Lock enabled */
75+ __u32 WLE; /* Write Lock Enabled */
7576 struct opal_session_info session;
76− uint8_t __align[4];
7777 };
7878
7979 struct opal_lock_unlock {
80− enum opal_lock_state l_state;
8180 struct opal_session_info session;
81+ __u32 l_state;
82+ __u8 __align[4];
8283 };
8384
8485 struct opal_new_pw {
@@ -97,9 +98,9 @@ struct opal_new_pw { · 12 unmodified lines
9798 };
9899
99100 struct opal_mbr_data {
100− u8 enable_disable;
101101 struct opal_key key;
102− uint8_t __align[5];
102+ __u8 enable_disable;
103+ __u8 __align[7];
103104 };
104105
105106 #define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t