forked from waninkoko/es-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyscalls.h
More file actions
72 lines (67 loc) · 2.89 KB
/
syscalls.h
File metadata and controls
72 lines (67 loc) · 2.89 KB
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
/*
* ES plugin for Custom IOS.
*
* Copyright (C) 2010 Waninkoko.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _IOS_SYSCALLS_H_
#define _IOS_SYSCALLS_H_
#include "ipc.h"
#include "types.h"
/* IOS syscalls */
s32 os_thread_create(u32 (*entry)(void *arg), void *arg, void *stack, u32 stacksize, u32 priority, s32 autostart);
void os_thread_set_priority(u32 priority);
s32 os_thread_get_priority(void);
s32 os_get_thread_id(void);
s32 os_get_parent_thread_id(void);
s32 os_thread_continue(s32 id);
s32 os_thread_stop(s32 id);
s32 os_message_queue_create(void *ptr, u32 id);
s32 os_message_queue_receive(s32 queue, u32 *message, u32 flags);
s32 os_message_queue_send(s32 queue, u32 message, s32 flags);
s32 os_message_queue_now(s32 queue, u32 message, s32 flags);
s32 os_heap_create(void *ptr, s32 size);
s32 os_heap_destroy(s32 heap);
void *os_heap_alloc(s32 heap, u32 size);
void *os_heap_alloc_aligned(s32 heap, s32 size, s32 align);
void os_heap_free(s32 heap, void *ptr);
s32 os_device_register(const char *devicename, s32 queuehandle);
void os_message_queue_ack(void *message, s32 result);
void os_sync_before_read(void *ptr, s32 size);
void os_sync_after_write(void *ptr, s32 size);
void os_syscall_50(u32 unknown);
s32 os_open(const char *device, s32 mode);
s32 os_close(s32 fd);
s32 os_read(s32 fd, void *d, s32 len);
s32 os_write(s32 fd, void *s, s32 len);
s32 os_seek(s32 fd, s32 offset, s32 mode);
s32 os_ioctlv(s32 fd, s32 request, s32 bytes_in, s32 bytes_out, ioctlv *vector);
s32 os_ioctl(s32 fd, s32 request, void *in, s32 bytes_in, void *out, s32 bytes_out);
s32 os_create_timer(s32 time_us, s32 repeat_time_us, s32 message_queue, s32 message);
s32 os_destroy_timer(s32 time_id);
s32 os_stop_timer(s32 timer_id);
s32 os_restart_timer(s32 timer_id, s32 time_us);
s32 os_timer_now(s32 time_id);
s32 os_register_event_handler(s32 device, s32 queue, s32 message);
s32 os_unregister_event_handler(s32 device);
s32 os_software_IRQ(s32 dev);
s32 os_ios_boot(const char *path, u32 flag, u32 version);
s32 os_set_version(u32 version);
s32 os_get_version(void);
void os_get_key(s32 keyid, void *out);
void *os_virt_to_phys(void *ptr);
/* ARM syscalls */
void write(const char *str);
#endif