20 #include "pedigreecSyscallNumbers.h" 22 #include "pedigree-c-syscall.h" 24 #include "pedigree/kernel/compiler.h" 25 #include "pedigree/kernel/processor/types.h" 39 pedigree_get_mount(
char *mount_buf,
char *info_buf,
size_t n);
44 pedigree_input_install_callback(
void *p, uint32_t type, uintptr_t param);
59 pedigree_module_get_depending(
char *name,
char *buf,
size_t bufsz);
62 pedigree_config_getcolname(
size_t resultIdx,
size_t n,
char *buf,
size_t bufsz);
65 size_t resultIdx,
size_t row,
size_t n,
char *buf,
size_t bufsz);
68 size_t resultIdx,
size_t row,
const char *col,
char *buf,
size_t bufsz);
71 pedigree_config_getnum_n(
size_t resultIdx,
size_t row,
size_t n);
74 pedigree_config_getnum_s(
size_t resultIdx,
size_t row,
const char *col);
77 pedigree_config_getbool_n(
size_t resultIdx,
size_t row,
size_t n);
80 pedigree_config_getbool_s(
size_t resultIdx,
size_t row,
const char *col);
93 pedigree_config_get_error_message(
size_t resultIdx,
char *buf,
int buflen);
105 EXPORTED_PUBLIC int pedigree_gfx_create_buffer(
void *p,
void **b,
void *args);
114 void *p, uint32_t x, uint32_t y, uint32_t colour, uint32_t fmt);
129 pedigree_gfx_fbinfo(
void *p,
size_t *w,
size_t *h, uint32_t *fmt,
size_t *bypp);
132 pedigree_gfx_setpalette(
void *p, uint32_t *data,
size_t entries);
135 void *malloc(
size_t);
136 size_t strlen(
const char *);
138 int pedigree_load_keymap(
char *buf,
size_t sz)
140 return syscall2(PEDIGREE_LOAD_KEYMAP, (
long) buf, (
long) sz);
143 void pedigree_reboot()
145 syscall0(PEDIGREE_REBOOT);
148 void pedigree_haltfs()
150 syscall0(PEDIGREE_HALTFS);
153 int pedigree_get_mount(
char *mount_buf,
char *info_buf,
size_t n)
155 return syscall3(PEDIGREE_GET_MOUNT, (
long) mount_buf, (
long) info_buf, n);
158 void *pedigree_sys_request_mem(
size_t len)
160 uintptr_t result = syscall1(PEDIGREE_SYS_REQUEST_MEM, (
long) len);
161 return (
void *) result;
164 void pedigree_input_install_callback(
void *p, uint32_t type, uintptr_t param)
166 syscall3(PEDIGREE_INPUT_INSTALL_CALLBACK, (
long) p, type, param);
169 void pedigree_input_remove_callback(
void *p)
171 syscall1(PEDIGREE_INPUT_REMOVE_CALLBACK, (
long) p);
174 void pedigree_input_inhibit_events(
int inhibit)
176 syscall1(PEDIGREE_INPUT_INHIBIT_EVENTS, inhibit);
179 void pedigree_event_return()
181 syscall0(PEDIGREE_EVENT_RETURN);
184 void pedigree_module_load(
char *file)
186 syscall1(PEDIGREE_MODULE_LOAD, (
long) file);
189 void pedigree_module_unload(
char *name)
191 syscall1(PEDIGREE_MODULE_UNLOAD, (
long) name);
194 int pedigree_module_is_loaded(
char *name)
196 return syscall1(PEDIGREE_MODULE_IS_LOADED, (
long) name);
199 int pedigree_module_get_depending(
char *name,
char *buf,
size_t bufsz)
202 PEDIGREE_MODULE_GET_DEPENDING, (
long) name, (
long) buf, bufsz);
205 void pedigree_config_getcolname(
206 size_t resultIdx,
size_t n,
char *buf,
size_t bufsz)
208 syscall4(PEDIGREE_CONFIG_GETCOLNAME, resultIdx, n, (
long) buf, bufsz);
211 void pedigree_config_getstr_n(
212 size_t resultIdx,
size_t row,
size_t n,
char *buf,
size_t bufsz)
214 syscall5(PEDIGREE_CONFIG_GETSTR_N, resultIdx, row, n, (
long) buf, bufsz);
216 void pedigree_config_getstr_s(
217 size_t resultIdx,
size_t row,
const char *col,
char *buf,
size_t bufsz)
220 PEDIGREE_CONFIG_GETSTR_S, resultIdx, row, (
long) col, (
long) buf,
224 int pedigree_config_getnum_n(
size_t resultIdx,
size_t row,
size_t n)
226 return syscall3(PEDIGREE_CONFIG_GETNUM_N, row, resultIdx, n);
228 int pedigree_config_getnum_s(
size_t resultIdx,
size_t row,
const char *col)
230 return syscall3(PEDIGREE_CONFIG_GETNUM_S, row, resultIdx, (
long) col);
233 int pedigree_config_getbool_n(
size_t resultIdx,
size_t row,
size_t n)
235 return syscall3(PEDIGREE_CONFIG_GETBOOL_N, resultIdx, row, n);
237 int pedigree_config_getbool_s(
size_t resultIdx,
size_t row,
const char *col)
239 return syscall3(PEDIGREE_CONFIG_GETBOOL_S, resultIdx, row, (
long) col);
242 int pedigree_config_query(
const char *query)
244 return syscall1(PEDIGREE_CONFIG_QUERY, (
long) query);
247 void pedigree_config_freeresult(
size_t resultIdx)
249 syscall1(PEDIGREE_CONFIG_FREERESULT, resultIdx);
252 int pedigree_config_numcols(
size_t resultIdx)
254 return syscall1(PEDIGREE_CONFIG_NUMCOLS, resultIdx);
257 int pedigree_config_numrows(
size_t resultIdx)
259 return syscall1(PEDIGREE_CONFIG_NUMROWS, resultIdx);
262 int pedigree_config_was_successful(
size_t resultIdx)
264 return syscall1(PEDIGREE_CONFIG_WAS_SUCCESSFUL, resultIdx);
267 void pedigree_config_get_error_message(
size_t resultIdx,
char *buf,
int bufsz)
269 syscall3(PEDIGREE_CONFIG_GET_ERROR_MESSAGE, resultIdx, (
long) buf, bufsz);
272 char *pedigree_config_escape_string(
const char *str)
275 char *bufferStart = (
char *) malloc(strlen(str) * 2 + 1);
276 char *buffer = bufferStart;
292 bufferStart = realloc(bufferStart, strlen(bufferStart) + 1);
298 int pedigree_login(uid_t uid,
const char *password)
300 return (
long) syscall2(PEDIGREE_LOGIN, uid, (
long) password);
303 int pedigree_gfx_get_provider(
void *p)
305 return syscall1(PEDIGREE_GFX_GET_PROVIDER, (
long) p);
308 int pedigree_gfx_get_curr_mode(
void *p,
void *sm)
310 return syscall2(PEDIGREE_GFX_GET_CURR_MODE, (
long) p, (
long) sm);
313 uintptr_t pedigree_gfx_get_raw_buffer(
void *p)
315 return (uintptr_t) syscall1(PEDIGREE_GFX_GET_RAW_BUFFER, (
long) p);
318 int pedigree_gfx_create_buffer(
void *p,
void **b,
void *args)
321 PEDIGREE_GFX_CREATE_BUFFER, (
long) p, (
long) b, (
long) args);
324 int pedigree_gfx_destroy_buffer(
void *p,
void *b)
326 return syscall2(PEDIGREE_GFX_DESTROY_BUFFER, (
long) p, (
long) b);
329 void pedigree_gfx_redraw(
void *p,
void *args)
331 syscall2(PEDIGREE_GFX_REDRAW, (
long) p, (
long) args);
334 void pedigree_gfx_blit(
void *p,
void *args)
336 syscall2(PEDIGREE_GFX_BLIT, (
long) p, (
long) args);
339 void pedigree_gfx_set_pixel(
340 void *p, uint32_t x, uint32_t y, uint32_t colour, uint32_t fmt)
342 syscall5(PEDIGREE_GFX_SET_PIXEL, (
long) p, x, y, colour, fmt);
345 void pedigree_gfx_rect(
void *p,
void *args)
347 syscall2(PEDIGREE_GFX_RECT, (
long) p, (
long) args);
350 void pedigree_gfx_copy(
void *p,
void *args)
352 syscall2(PEDIGREE_GFX_COPY, (
long) p, (
long) args);
355 void pedigree_gfx_line(
void *p,
void *args)
357 syscall2(PEDIGREE_GFX_LINE, (
long) p, (
long) args);
360 void pedigree_gfx_draw(
void *p,
void *args)
362 syscall2(PEDIGREE_GFX_DRAW, (
long) p, (
long) args);
365 int pedigree_gfx_create_fbuffer(
void *p,
void *args)
367 return syscall2(PEDIGREE_GFX_CREATE_FBUFFER, (
long) p, (
long) args);
370 void pedigree_gfx_delete_fbuffer(
void *p)
372 syscall1(PEDIGREE_GFX_DELETE_FBUFFER, (
long) p);
375 void pedigree_gfx_fbinfo(
376 void *p,
size_t *w,
size_t *h, uint32_t *fmt,
size_t *bypp)
379 PEDIGREE_GFX_FBINFO, (
long) p, (
long) w, (
long) h, (
long) fmt,
383 void pedigree_gfx_setpalette(
void *p, uint32_t *data,
size_t entries)
385 syscall3(PEDIGREE_GFX_SETPALETTE, (
long) p, (
long) data, (
long) entries);