diff options
author | David Woodhouse <dwmw2@infradead.org> | 2008-09-16 19:23:28 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2008-10-13 11:05:06 -0400 |
commit | d945b697d0eea5a811ec299c5f1a25889bb0242b (patch) | |
tree | e9f902122c05a174eac04464b145bd7a69f261dc /include/linux/mod_devicetable.h | |
parent | 9d5a9e74655b9d04d0ec9c8e47801163b7b74211 (diff) |
Automatic MODULE_ALIAS() for DMI match tables.
This makes modpost handle MODULE_DEVICE_TABLE(dmi, xxxx).
I had to change the string pointers in the match table to char arrays,
and picked a size of 79 bytes almost at random -- do we need to make it
bigger than that? I was a bit concerned about the 'bloat' this
introduces into the match tables, but they should all be __initdata so
it shouldn't matter too much.
(Actually, modpost does go through the relocations and look at most of
them; it wouldn't be impossible to make it handle string pointers -- but
doesn't seem to be worth the effort, since they're __initdata).
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mod_devicetable.h')
-rw-r--r-- | include/linux/mod_devicetable.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index c4db5827963d..3481a7d5bc0a 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -388,5 +388,52 @@ struct i2c_device_id { | |||
388 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | 388 | __attribute__((aligned(sizeof(kernel_ulong_t)))); |
389 | }; | 389 | }; |
390 | 390 | ||
391 | /* dmi */ | ||
392 | enum dmi_field { | ||
393 | DMI_NONE, | ||
394 | DMI_BIOS_VENDOR, | ||
395 | DMI_BIOS_VERSION, | ||
396 | DMI_BIOS_DATE, | ||
397 | DMI_SYS_VENDOR, | ||
398 | DMI_PRODUCT_NAME, | ||
399 | DMI_PRODUCT_VERSION, | ||
400 | DMI_PRODUCT_SERIAL, | ||
401 | DMI_PRODUCT_UUID, | ||
402 | DMI_BOARD_VENDOR, | ||
403 | DMI_BOARD_NAME, | ||
404 | DMI_BOARD_VERSION, | ||
405 | DMI_BOARD_SERIAL, | ||
406 | DMI_BOARD_ASSET_TAG, | ||
407 | DMI_CHASSIS_VENDOR, | ||
408 | DMI_CHASSIS_TYPE, | ||
409 | DMI_CHASSIS_VERSION, | ||
410 | DMI_CHASSIS_SERIAL, | ||
411 | DMI_CHASSIS_ASSET_TAG, | ||
412 | DMI_STRING_MAX, | ||
413 | }; | ||
414 | |||
415 | struct dmi_strmatch { | ||
416 | unsigned char slot; | ||
417 | char substr[79]; | ||
418 | }; | ||
419 | |||
420 | #ifndef __KERNEL__ | ||
421 | struct dmi_system_id { | ||
422 | kernel_ulong_t callback; | ||
423 | kernel_ulong_t ident; | ||
424 | struct dmi_strmatch matches[4]; | ||
425 | kernel_ulong_t driver_data | ||
426 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
427 | }; | ||
428 | #else | ||
429 | struct dmi_system_id { | ||
430 | int (*callback)(const struct dmi_system_id *); | ||
431 | const char *ident; | ||
432 | struct dmi_strmatch matches[4]; | ||
433 | void *driver_data; | ||
434 | }; | ||
435 | #endif | ||
436 | |||
437 | #define DMI_MATCH(a, b) { a, b } | ||
391 | 438 | ||
392 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 439 | #endif /* LINUX_MOD_DEVICETABLE_H */ |