blob: 5aa8e3f9dcc8a82189af51382f9ee2ffbd6178e7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#ifndef PLATFORM_H
#define PLATFORM_H
#include <types/types.h>
struct platform {
const char *name;
bool (*probe)(struct platform *, void *);
int (*load_config)(struct platform *, struct config *);
int (*save_config)(struct platform *, struct config *);
void (*pre_boot)(struct platform *,
const struct config *);
int (*get_sysinfo)(struct platform *, struct system_info *);
uint16_t dhcp_arch_id;
void *platform_data;
};
int platform_init(void *ctx);
int platform_fini(void);
const struct platform *platform_get(void);
int platform_get_sysinfo(struct system_info *info);
void platform_pre_boot(void);
/* configuration interface */
const struct config *config_get(void);
int config_set(struct config *config);
void config_set_autoboot(bool autoboot_enabled);
/* for use by the platform-specific storage code */
void config_set_defaults(struct config *config);
#define __platform_ptrname(_n) __platform_ ## _n
#define _platform_ptrname(_n) __platform_ptrname(_n)
#define register_platform(p) \
static __attribute__((section("platforms"))) \
__attribute__((used)) \
struct platform * _platform_ptrname(__COUNTER__) = &p;
#endif /* PLATFORM_H */
|