aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/include/lib.h
blob: 400ea468db92a6623c7fa82dca520e47d1d1e264 (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
42
#ifndef LIB_H
#define LIB_H

#include <stdint.h>

int getline(char *buf, int max);

extern struct pci_device *dev_list;
extern int n_devs;

extern void pci_init(void);
extern struct pci_device *pci_find_device(int vendor, int device, int devclass,
int prog_if, int index);

void *calloc(size_t nmemb, size_t size);
void *realloc(void *ptr, size_t size);

char *strdup(const char *s);

int isspace(int c);

unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base);
unsigned long long strtoull_with_suffix(const char *cp,char **endp,unsigned int base);

unsigned int get_le32(const unsigned char *);
unsigned int get_le16(const unsigned char *);
void hexdump(const void *p, unsigned int len);

long long simple_strtoll(const char *cp,char **endp,unsigned int base);

#define LOADER_NOT_SUPPORT 0xbadf11e

struct sys_info;
int elf_load(struct sys_info *, const char *filename, const char *cmdline);

#if LINUX_LOADER
int linux_load(struct sys_info *, const char *filename, const char *cmdline);
#else
#define linux_load(x,y,z) LOADER_NOT_SUPPORT /* nop */
#endif

#endif /* LIB_H */