Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/mdioctl.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#define _SYS_MDIOCTL_H_ | #define _SYS_MDIOCTL_H_ | ||||
enum md_types {MD_MALLOC, MD_PRELOAD, MD_VNODE, MD_SWAP, MD_NULL}; | enum md_types {MD_MALLOC, MD_PRELOAD, MD_VNODE, MD_SWAP, MD_NULL}; | ||||
/* | /* | ||||
* Ioctl definitions for memory disk pseudo-device. | * Ioctl definitions for memory disk pseudo-device. | ||||
*/ | */ | ||||
#define MDNPAD 97 | #define MDNPAD 96 | ||||
imp: This changes the ABI on 64-bit architectures, since an int is only 32-bits there, but a pointer… | |||||
sobomaxAuthorUnsubmitted Not Done Inline ActionsI think there is alignment in play, the struct is not packed. sobomax: I think there is alignment in play, the struct is not packed. | |||||
sobomaxAuthorUnsubmitted Not Done Inline ActionsI've verified again, the sizeof(struct md_ioctl) remains 448 bytes before and after change on x64. I don't have access to any other supported 64-bit arches to verify. sobomax: I've verified again, the sizeof(struct md_ioctl) remains 448 bytes before and after change on… | |||||
struct md_ioctl { | struct md_ioctl { | ||||
unsigned md_version; /* Structure layout version */ | unsigned md_version; /* Structure layout version */ | ||||
unsigned md_unit; /* unit number */ | unsigned md_unit; /* unit number */ | ||||
enum md_types md_type ; /* type of disk */ | enum md_types md_type ; /* type of disk */ | ||||
char *md_file; /* pathname of file to mount */ | char *md_file; /* pathname of file to mount */ | ||||
off_t md_mediasize; /* size of disk in bytes */ | off_t md_mediasize; /* size of disk in bytes */ | ||||
unsigned md_sectorsize; /* sectorsize */ | unsigned md_sectorsize; /* sectorsize */ | ||||
unsigned md_options; /* options */ | unsigned md_options; /* options */ | ||||
u_int64_t md_base; /* base address */ | u_int64_t md_base; /* base address */ | ||||
int md_fwheads; /* firmware heads */ | int md_fwheads; /* firmware heads */ | ||||
int md_fwsectors; /* firmware sectors */ | int md_fwsectors; /* firmware sectors */ | ||||
char *md_label; /* label of the device */ | |||||
int md_pad[MDNPAD]; /* padding for future ideas */ | int md_pad[MDNPAD]; /* padding for future ideas */ | ||||
}; | }; | ||||
#define MD_NAME "md" | #define MD_NAME "md" | ||||
#define MDCTL_NAME "mdctl" | #define MDCTL_NAME "mdctl" | ||||
#define MDIOVERSION 0 | #define MDIOVERSION 0 | ||||
/* | /* | ||||
Show All 21 Lines |
This changes the ABI on 64-bit architectures, since an int is only 32-bits there, but a pointer is 64 so the sizeof md_ioctl grows by 4 bytes.