-
Notifications
You must be signed in to change notification settings - Fork 11
/
syspage.h
86 lines (48 loc) · 1.57 KB
/
syspage.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* Phoenix-RTOS
*
* Operating system loader
*
* Syspage
*
* Copyright 2020-2021 Phoenix Systems
* Authors: Hubert Buczynski, Gerard Swiderski
*
* This file is part of Phoenix-RTOS.
*
* %LICENSE%
*/
#ifndef SYSPAGE_H_
#define SYSPAGE_H_
#include <hal/hal.h>
enum { flagSyspageExec = 0x01, flagSyspageNoCopy = 0x02 };
typedef struct {
unsigned short width;
unsigned short height;
unsigned short bpp;
unsigned short pitch;
unsigned long framebuffer; /* addr_t */
} __attribute__((packed)) graphmode_t;
/* General functions */
extern void syspage_init(void);
extern void *syspage_alloc(size_t size);
extern void syspage_kernelPAddrAdd(addr_t address);
/* Map's functions */
extern int syspage_mapAdd(const char *name, addr_t start, addr_t end, const char *attr);
extern int syspage_mapAttrResolve(const char *name, unsigned int *attr);
extern int syspage_mapNameResolve(const char *name, u8 *id);
extern int syspage_mapRangeResolve(const char *name, addr_t *start, addr_t *end);
extern unsigned int syspage_mapRangeCheck(addr_t start, addr_t end, unsigned int *attrOut);
extern const char *syspage_mapName(u8 id);
extern void syspage_mapShow(void);
extern mapent_t *syspage_entryAdd(const char *mapName, addr_t start, size_t size, unsigned int align);
/* Program's functions */
extern syspage_prog_t *syspage_progAdd(const char *argv, u32 flags);
extern void syspage_progShow(void);
/* Console */
extern void syspage_consoleSet(unsigned int id);
#if HAS_GRAPHICS
/* Graphics mode */
extern void syspage_graphmodeSet(graphmode_t graphmode);
#endif
#endif