T119: implement syscall and monitor interface to debug_print_capabilities
[barrelfish] / kernel / include / syscall.h
1 /**
2  * \file
3  * \brief Arch-generic system calls implementation.
4  */
5
6 /*
7  * Copyright (c) 2007, 2008, 2009, 2010, 2012, ETH Zurich.
8  * All rights reserved.
9  *
10  * This file is distributed under the terms in the attached LICENSE file.
11  * If you do not find this file, copies can be found by writing to:
12  * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
13  */
14
15 #ifndef KERNEL_SYSCALL_H
16 #define KERNEL_SYSCALL_H
17
18 #include <kernel.h>
19 #include <barrelfish_kpi/cpu.h>
20 #include <barrelfish_kpi/dispatcher_shared_target.h>
21 #include <barrelfish_kpi/types.h>
22 #include <capabilities.h>
23
24 errval_t sys_print(const char *str, size_t length);
25 struct sysret sys_yield(capaddr_t target);
26 struct sysret sys_suspend(bool halt);
27 struct sysret
28 sys_dispatcher_setup(struct capability *to, capaddr_t cptr, int depth,
29                      capaddr_t vptr, capaddr_t dptr, bool run, capaddr_t odptr);
30 struct sysret
31 sys_dispatcher_properties(struct capability *to,
32                           enum task_type type, unsigned long deadline,
33                           unsigned long wcet, unsigned long period,
34                           unsigned long release, unsigned short weight);
35 struct sysret
36 sys_retype(struct capability *root, capaddr_t source_cptr, enum objtype type,
37            uint8_t objbits, capaddr_t dest_cnode_cptr, cslot_t dest_slot,
38            uint8_t dest_vbits, bool from_monitor);
39 struct sysret sys_create(struct capability *root, enum objtype type,
40                          uint8_t objbits, capaddr_t dest_cnode_cptr,
41                          cslot_t dest_slot, int dest_vbits);
42 struct sysret
43 sys_map(struct capability *ptable, cslot_t slot, capaddr_t source_cptr,
44         int source_vbits, uintptr_t flags, uintptr_t offset,
45         uintptr_t pte_count);
46 struct sysret
47 sys_copy_or_mint(struct capability *root, capaddr_t destcn_cptr, cslot_t dest_slot,
48                  capaddr_t source_cptr, int destcn_vbits, int source_vbits,
49                  uintptr_t param1, uintptr_t param2, bool mint);
50 struct sysret sys_delete(struct capability *root, capaddr_t cptr, uint8_t bits);
51 struct sysret sys_revoke(struct capability *root, capaddr_t cptr, uint8_t bits);
52 struct sysret sys_get_state(struct capability *root, capaddr_t cptr, uint8_t bits);
53 struct sysret
54 sys_dispatcher_setup_guest (struct capability *to,
55                             capaddr_t epp, capaddr_t vnodep,
56                             capaddr_t vmcbp, capaddr_t ctrlp);
57 struct sysret sys_trace_setup(struct capability *cap, capaddr_t cptr);
58 struct sysret sys_idcap_identify(struct capability *cap, idcap_id_t *id);
59 struct sysret sys_monitor_spawn_core(coreid_t core_id, enum cpu_type cpu_type,
60                                      genvaddr_t entry);
61
62 struct sysret sys_kernel_add_kcb(struct kcb* new_kcb);
63 struct sysret sys_kernel_remove_kcb(struct kcb* kcb_addr);
64 struct sysret sys_kernel_suspend_kcb_sched(bool toggle);
65 struct sysret sys_handle_kcb_identify(struct capability* to);
66 struct sysret sys_get_absolute_time(void);
67
68 /*
69  * Monitor syscalls
70  */
71
72 struct sysret sys_monitor_register(capaddr_t ep_caddr);
73 struct sysret sys_monitor_domain_id(capaddr_t cptr, domainid_t domain_id);
74 struct sysret sys_monitor_remote_relations(capaddr_t root_addr, uint8_t root_bits,
75                                            capaddr_t cptr, uint8_t bits,
76                                            uint8_t relations, uint8_t mask);
77 struct sysret sys_monitor_identify_cap(struct capability *root,
78                                        capaddr_t cptr, uint8_t bits,
79                                        struct capability *retbuf);
80 struct sysret sys_monitor_nullify_cap(capaddr_t cptr, uint8_t bits);
81 struct sysret sys_get_cap_owner(capaddr_t root_addr, uint8_t root_bits,
82                                 capaddr_t cptr, uint8_t bits);
83 struct sysret sys_set_cap_owner(capaddr_t root_addr, uint8_t root_bits,
84                                 capaddr_t cptr, uint8_t bits, coreid_t owner);
85 struct sysret sys_cap_has_relations(capaddr_t caddr, uint8_t vbits, uint8_t mask);
86 struct sysret sys_lock_cap(capaddr_t root_addr, uint8_t root_bits,
87                            capaddr_t cptr, uint8_t bits);
88 struct sysret sys_unlock_cap(capaddr_t root_addr, uint8_t root_bits,
89                              capaddr_t cptr, uint8_t bits);
90 struct sysret sys_monitor_copy_existing(struct capability *src,
91                                         capaddr_t cnode_cptr,
92                                         uint8_t cnode_vbits,
93                                         cslot_t slot);
94
95 /*
96  * Monitor syscalls for delete & revoke
97  */
98
99 struct sysret sys_monitor_delete_last(capaddr_t root_addr, uint8_t root_bits,
100                                       capaddr_t target_addr, uint8_t target_bits,
101                                       capaddr_t ret_cn_addr, uint8_t ret_cn_bits,
102                                       cslot_t ret_slot);
103 struct sysret sys_monitor_delete_foreigns(capaddr_t cptr, uint8_t bits);
104 struct sysret sys_monitor_revoke_mark_tgt(capaddr_t root_addr,
105                                           uint8_t root_bits,
106                                           capaddr_t target_addr,
107                                           uint8_t target_bits);
108 struct sysret sys_monitor_revoke_mark_rels(struct capability *base);
109 struct sysret sys_monitor_delete_step(capaddr_t ret_cn_addr,
110                                       uint8_t ret_cn_bits,
111                                       cslot_t ret_slot);
112 struct sysret sys_monitor_clear_step(capaddr_t ret_cn_addr,
113                                      uint8_t ret_cn_bits,
114                                      cslot_t ret_slot);
115
116 /*
117  * System calls for debug output.
118  */
119 struct sysret
120 sys_debug_print_capabilities(void);
121
122 #endif