#ifndef _LIBPAYLOAD_H
#define _LIBPAYLOAD_H
-#include <autoconf.h>
#include <stddef.h>
#include <arch/types.h>
#include <arch/io.h>
#include <sysinfo.h>
#include <stdarg.h>
#include <lar.h>
+#include <pci.h>
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define LITTLE_ENDIAN 1234
#define BIG_ENDIAN 4321
-#ifdef CONFIG_TARGET_I386
-#define BYTE_ORDER LITTLE_ENDIAN
-#else
-#define BYTE_ORDER BIG_ENDIAN
-#endif
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#define RAND_MAX 0x7fffffff
+/* Payload information parameters - these are used to pass information
+ * to the entity loading the payload
+ * Usage: PAYLOAD_INFO(key, value)
+ * Example: PAYLOAD_INFO(name, "CoreInfo!")
+ */
+
+#define _pstruct(key) __pinfo_ ##key
+#define PAYLOAD_INFO(key, value) \
+static const char _pstruct(key)[] \
+ __attribute__((__used__)) \
+ __attribute__((section(".note.pinfo"),unused)) = #key "=" value
+
/* Some NVRAM byte definitions */
#define NVRAM_RTC_SECONDS 0
#define NVRAM_RTC_MINUTES 2
int serial_havechar(void);
int serial_getchar(void);
+void serial_clear(void);
+void serial_start_bold(void);
+void serial_end_bold(void);
+void serial_set_cursor(int y, int x);
+
/* drivers/speaker.c */
void speaker_enable(u16 freq);
void speaker_disable(void);
void *calloc(size_t nmemb, size_t size);
void *realloc(void *ptr, size_t size);
+/* libc/exec.c */
+int exec(long addr, int argc, char **argv);
+
/* libc/lib.c */
int bcd2dec(int b);
int dec2bcd(int d);
void *memset(void *s, int c, size_t n);
void *memcpy(void *dst, const void *src, size_t n);
void *memmove(void *dst, const void *src, size_t n);
-int memcmp(const char *s1, const char *s2, size_t len);
+int memcmp(const void *s1, const void *s2, size_t len);
/* libc/printf.c */
int snprintf(char *str, size_t size, const char *fmt, ...);
void rewindlar(struct LAR *lar);
int larstat(struct LAR *lar, const char *path, struct larstat *buf);
void *larfptr(struct LAR *lar, const char *filename);
+int lfverify(struct LAR *lar, const char *filename);
struct LFILE * lfopen(struct LAR *lar, const char *filename);
int lfread(void *ptr, size_t size, size_t nmemb, struct LFILE *stream);