The Pedigree Project  0.1
pedigree-syscalls.h
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef PEDIGREE_SYSCALLS_H
21 #define PEDIGREE_SYSCALLS_H
22 
23 #include "pedigree/kernel/compiler.h"
24 
25 #ifndef PEDIGREE_SYSCALLS_LIBC
26 
27 #ifdef PEDIGREEC_WITHIN_KERNEL
28 
29 #include "pedigree/kernel/processor/types.h"
30 
31 #if 1
32 #define P_NOTICE(x) \
33  NOTICE( \
34  "[" \
35  << Dec \
36  << Processor::information().getCurrentThread()->getParent()->getId() \
37  << "]\t" << Hex << x)
38 #else
39 #define P_NOTICE(x)
40 #endif
41 
42 #endif
43 
44 #endif
45 
48 void pedigree_config_init();
49 
50 void pedigree_config_getcolname(
51  size_t resultIdx, size_t n, char *buf, size_t bufsz);
52 #ifndef __cplusplus
53 void pedigree_config_getstr_n(
54  size_t resultIdx, size_t row, size_t n, char *buf, size_t bufsz);
55 void pedigree_config_getstr_s(
56  size_t resultIdx, size_t row, const char *col, char *buf, size_t bufsz);
57 int pedigree_config_getnum_n(size_t resultIdx, size_t row, size_t n);
58 int pedigree_config_getnum_s(size_t resultIdx, size_t row, const char *col);
59 int pedigree_config_getbool_n(size_t resultIdx, size_t row, size_t n);
60 int pedigree_config_getbool_s(size_t resultIdx, size_t row, const char *col);
61 #else
62 void pedigree_config_getstr(
63  size_t resultIdx, size_t row, size_t n, char *buf, size_t bufsz);
64 void pedigree_config_getstr(
65  size_t resultIdx, size_t row, const char *col, char *buf, size_t bufsz);
66 int pedigree_config_getnum(size_t resultIdx, size_t row, size_t n);
67 int pedigree_config_getnum(size_t resultIdx, size_t row, const char *col);
68 int pedigree_config_getbool(size_t resultIdx, size_t row, size_t n);
69 int pedigree_config_getbool(size_t resultIdx, size_t row, const char *col);
70 #endif
71 
72 int pedigree_config_query(const char *query);
73 void pedigree_config_freeresult(size_t resultIdx);
74 int pedigree_config_numcols(size_t resultIdx);
75 int pedigree_config_numrows(size_t resultIdx);
76 
77 int pedigree_config_was_successful(size_t resultIdx);
78 void pedigree_config_get_error_message(size_t resultIdx, char *buf, int buflen);
79 
82 int pedigree_login(int uid, const char *password);
83 
84 int pedigree_reboot();
85 
86 void pedigree_module_load(char *file);
87 void pedigree_module_unload(char *name);
88 int pedigree_module_is_loaded(char *name);
89 int pedigree_module_get_depending(char *name, char *buf, size_t bufsz);
90 
91 int pedigree_get_mount(char *mount_buf, char *info_buf, size_t n);
92 
93 void *pedigree_sys_request_mem(size_t len);
94 
95 void pedigree_haltfs();
96 
99 #ifdef __cplusplus
100 extern "C" {
101 #endif
102 
103 void pedigree_input_install_callback(void *p, uint32_t type, uintptr_t param);
104 void pedigree_input_remove_callback(void *p);
105 int pedigree_load_keymap(uint32_t *buffer, size_t len);
106 void pedigree_input_inhibit_events(int inhibit);
107 
108 void pedigree_event_return() NORETURN;
109 
110 int pedigree_gfx_get_provider(void *p);
111 int pedigree_gfx_get_curr_mode(void *p, void *sm);
112 uintptr_t pedigree_gfx_get_raw_buffer(void *p);
113 int pedigree_gfx_create_buffer(void *p, void **b, void *args);
114 int pedigree_gfx_destroy_buffer(void *p, void *b);
115 int pedigree_gfx_convert_pixel(
116  void *p, uint32_t *in, uint32_t *out, uint32_t infmt, uint32_t outfmt);
117 void pedigree_gfx_redraw(void *p, void *args);
118 void pedigree_gfx_blit(void *p, void *args);
119 void pedigree_gfx_set_pixel(
120  void *p, uint32_t x, uint32_t y, uint32_t colour, uint32_t fmt);
121 void pedigree_gfx_rect(void *p, void *args);
122 void pedigree_gfx_copy(void *p, void *args);
123 void pedigree_gfx_line(void *p, void *args);
124 void pedigree_gfx_draw(void *p, void *args);
125 
126 int pedigree_gfx_create_fbuffer(void *p, void *args);
127 void pedigree_gfx_delete_fbuffer(void *p);
128 
129 void pedigree_gfx_fbinfo(
130  void *p, size_t *w, size_t *h, uint32_t *fmt, size_t *bypp);
131 void pedigree_gfx_setpalette(void *p, uint32_t *data, size_t entries);
132 
133 #ifdef __cplusplus
134 }; // extern "C"
135 #endif
136 
137 #endif