2 #include <syslinux/linux.h>
3 #include <syslinux/loadfile.h>
5 struct setup_data
*setup_data_init(void)
7 struct setup_data
*setup_data
;
9 setup_data
= zalloc(sizeof(*setup_data
));
13 setup_data
->prev
= setup_data
->next
= setup_data
;
17 int setup_data_add(struct setup_data
*head
, uint32_t type
,
18 const void *data
, size_t data_len
)
20 struct setup_data
*setup_data
;
22 setup_data
= zalloc(sizeof(*setup_data
));
26 setup_data
->data
= data
;
27 setup_data
->hdr
.len
= data_len
;
28 setup_data
->hdr
.type
= type
;
29 setup_data
->prev
= head
->prev
;
30 setup_data
->next
= head
;
31 head
->prev
->next
= setup_data
;
32 head
->prev
= setup_data
;
37 int setup_data_load(struct setup_data
*head
, uint32_t type
,
43 if (loadfile(filename
, &data
, &len
))
46 return setup_data_add(head
, type
, data
, len
);