smbios.h (6d67af5f8e66218ab0b3d927837fe00903c2feac) | smbios.h (f689cb23b2782d0d0f586bcfabbad68f728ed1df) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 1997 Michael Smith 5 * Copyright (c) 1998 Jonathan Lemon 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 42 unchanged lines hidden (view full) --- 51 uint8_t entry_point_revision; 52 uint8_t formatted_area[5]; 53 uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ 54 uint8_t intermediate_checksum; 55 uint16_t structure_table_length; 56 uint32_t structure_table_address; 57 uint16_t number_structures; 58 uint8_t BCD_revision; | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 1997 Michael Smith 5 * Copyright (c) 1998 Jonathan Lemon 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 42 unchanged lines hidden (view full) --- 51 uint8_t entry_point_revision; 52 uint8_t formatted_area[5]; 53 uint8_t intermediate_anchor_string[5]; /* '_DMI_' */ 54 uint8_t intermediate_checksum; 55 uint16_t structure_table_length; 56 uint32_t structure_table_address; 57 uint16_t number_structures; 58 uint8_t BCD_revision; |
59}; | 59} __packed; |
60 61struct smbios_structure_header { 62 uint8_t type; 63 uint8_t length; 64 uint16_t handle; | 60 61struct smbios_structure_header { 62 uint8_t type; 63 uint8_t length; 64 uint16_t handle; |
65}; | 65} __packed; |
66 | 66 |
67typedef void (*smbios_callback_t)(struct smbios_structure_header *, void *); 68 69static inline void 70smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) 71{ 72 struct smbios_structure_header *s; 73 74 while (entries--) { 75 s = (struct smbios_structure_header *)p; 76 cb(s, arg); 77 78 /* 79 * Look for a double-nul after the end of the 80 * formatted area of this structure. 81 */ 82 p += s->length; 83 while (!(p[0] == 0 && p[1] == 0)) 84 p++; 85 86 /* 87 * Skip over the double-nul to the start of the next 88 * structure. 89 */ 90 p += 2; 91 } 92} 93 |
|
67#endif /* _SMBIOS_H_ */ | 94#endif /* _SMBIOS_H_ */ |