limine/src/lib/blib.h

34 lines
836 B
C
Raw Normal View History

2020-01-22 05:02:12 +01:00
#ifndef __LIB__BLIB_H__
#define __LIB__BLIB_H__
#include <stddef.h>
2020-01-25 02:05:19 +01:00
#include <stdint.h>
2020-04-30 13:03:04 +02:00
int cpuid(uint32_t leaf, uint32_t subleaf,
uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
2020-04-29 16:53:05 +02:00
__attribute__((noreturn)) void panic(const char *str);
2020-04-13 08:21:25 +02:00
2020-01-25 02:05:19 +01:00
void pit_sleep(uint64_t pit_ticks);
int pit_sleep_and_quit_on_keypress(uint32_t pit_ticks);
2020-01-22 05:02:12 +01:00
2020-04-15 20:15:38 +02:00
void brewind(size_t count);
2020-03-28 04:02:26 +01:00
void *balloc(size_t count);
void *balloc_aligned(size_t count, size_t alignment);
2020-01-25 04:49:11 +01:00
#define GETCHAR_CURSOR_LEFT (-10)
#define GETCHAR_CURSOR_RIGHT (-11)
#define GETCHAR_CURSOR_UP (-12)
#define GETCHAR_CURSOR_DOWN (-13)
2020-01-22 05:02:12 +01:00
void print(const char *fmt, ...);
2020-01-25 04:49:11 +01:00
int getchar(void);
2020-01-25 03:06:56 +01:00
void gets(const char *orig_str, char *buf, size_t limit);
2020-01-22 07:13:19 +01:00
uint64_t strtoui(const char *s);
2020-01-22 05:02:12 +01:00
#define DIV_ROUNDUP(a, b) (((a) + ((b) - 1)) / (b))
typedef void *symbol[];
#endif