Changeset c0699467 in mainline for kernel/generic
- Timestamp:
- 2011-08-09T18:08:23Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b538ca5c
- Parents:
- 3666d386
- Location:
- kernel/generic
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ddi/ddi.h
r3666d386 rc0699467 36 36 #define KERN_DDI_H_ 37 37 38 #include <ddi/ddi_arg.h>39 38 #include <typedefs.h> 39 #include <abi/ddi/arg.h> 40 40 #include <proc/task.h> 41 41 #include <adt/list.h> -
kernel/generic/include/ddi/irq.h
r3666d386 rc0699467 33 33 */ 34 34 35 #ifndef KERN_IRQ_H_ 36 #define KERN_IRQ_H_ 37 38 #ifdef KERNEL 35 #ifndef KERN_DDI_IRQ_H_ 36 #define KERN_DDI_IRQ_H_ 39 37 40 38 #include <typedefs.h> 39 #include <abi/ddi/irq.h> 41 40 #include <adt/list.h> 42 41 #include <adt/hash_table.h> … … 44 43 #include <proc/task.h> 45 44 #include <ipc/ipc.h> 46 47 #endif /* KERNEL */48 49 typedef enum {50 /** Read 1 byte from the I/O space. */51 CMD_PIO_READ_8 = 1,52 /** Read 2 bytes from the I/O space. */53 CMD_PIO_READ_16,54 /** Read 4 bytes from the I/O space. */55 CMD_PIO_READ_32,56 57 /** Write 1 byte to the I/O space. */58 CMD_PIO_WRITE_8,59 /** Write 2 bytes to the I/O space. */60 CMD_PIO_WRITE_16,61 /** Write 4 bytes to the I/O space. */62 CMD_PIO_WRITE_32,63 64 /**65 * Write 1 byte from the source argument66 * to the I/O space.67 */68 CMD_PIO_WRITE_A_8,69 /**70 * Write 2 bytes from the source argument71 * to the I/O space.72 */73 CMD_PIO_WRITE_A_16,74 /**75 * Write 4 bytes from the source argument76 * to the I/O space.77 */78 CMD_PIO_WRITE_A_32,79 80 /** Read 1 byte from the memory space. */81 CMD_MEM_READ_8,82 /** Read 2 bytes from the memory space. */83 CMD_MEM_READ_16,84 /** Read 4 bytes from the memory space. */85 CMD_MEM_READ_32,86 87 /** Write 1 byte to the memory space. */88 CMD_MEM_WRITE_8,89 /** Write 2 bytes to the memory space. */90 CMD_MEM_WRITE_16,91 /** Write 4 bytes to the memory space. */92 CMD_MEM_WRITE_32,93 94 /** Write 1 byte from the source argument to the memory space. */95 CMD_MEM_WRITE_A_8,96 /** Write 2 bytes from the source argument to the memory space. */97 CMD_MEM_WRITE_A_16,98 /** Write 4 bytes from the source argument to the memory space. */99 CMD_MEM_WRITE_A_32,100 101 /**102 * Perform a bit masking on the source argument103 * and store the result into the destination argument.104 */105 CMD_BTEST,106 107 /**108 * Predicate the execution of the following109 * N commands by the boolean value of the source110 * argument.111 */112 CMD_PREDICATE,113 114 /** Accept the interrupt. */115 CMD_ACCEPT,116 117 /** Decline the interrupt. */118 CMD_DECLINE,119 CMD_LAST120 } irq_cmd_type;121 122 typedef struct {123 irq_cmd_type cmd;124 void *addr;125 uint32_t value;126 uintptr_t srcarg;127 uintptr_t dstarg;128 } irq_cmd_t;129 130 typedef struct {131 size_t cmdcount;132 irq_cmd_t *cmds;133 } irq_code_t;134 135 #ifdef KERNEL136 45 137 46 typedef enum { … … 146 55 147 56 struct irq; 57 148 58 typedef void (* irq_handler_t)(struct irq *); 149 59 … … 224 134 /** Notification configuration structure. */ 225 135 ipc_notif_cfg_t notif_cfg; 226 136 227 137 as_t *driver_as; 228 138 } irq_t; … … 238 148 extern irq_t *irq_dispatch_and_lock(inr_t); 239 149 240 #endif /* KERNEL */241 242 150 #endif 243 151 -
kernel/generic/include/errno.h
r3666d386 rc0699467 27 27 */ 28 28 29 /** @addtogroup generic 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 36 36 #define KERN_ERRNO_H_ 37 37 38 /* 1-255 are kernel error codes, 256-512 are user error codes */ 39 40 #define EOK 0 /* No error */ 41 #define ENOENT -1 /* No such entry */ 42 #define ENOMEM -2 /* Not enough memory */ 43 #define ELIMIT -3 /* Limit exceeded */ 44 #define EREFUSED -4 /* Connection refused */ 45 #define EFORWARD -5 /* Forward error */ 46 #define EPERM -6 /* Permission denied */ 47 #define EHANGUP -7 /* Answerbox closed connection, call 48 * sys_ipc_hangup() to close the connection. 49 * Used by answerbox to close the connection. 50 */ 51 #define EPARTY -8 /* The other party encountered an error when 52 * receiving the call. 53 */ 54 #define EEXISTS -9 /* Entry already exists */ 55 #define EBADMEM -10 /* Bad memory pointer */ 56 #define ENOTSUP -11 /* Not supported */ 57 #define EADDRNOTAVAIL -12 /* Address not available. */ 58 #define ETIMEOUT -13 /* Timeout expired */ 59 #define EINVAL -14 /* Invalid value */ 60 #define EBUSY -15 /* Resource is busy */ 61 #define EOVERFLOW -16 /* The result does not fit its size. */ 62 #define EINTR -17 /* Operation was interrupted. */ 38 #include <abi/errno.h> 63 39 64 40 #endif -
kernel/generic/include/ipc/event.h
r3666d386 rc0699467 36 36 #define KERN_EVENT_H_ 37 37 38 #include < ipc/event_types.h>38 #include <abi/ipc/event.h> 39 39 #include <typedefs.h> 40 40 #include <synch/spinlock.h> -
kernel/generic/include/ipc/ipc.h
r3666d386 rc0699467 36 36 #define KERN_IPC_H_ 37 37 38 /** Length of data being transfered with IPC call 39 * 40 * The uspace may not be able to utilize full length 41 * 42 */ 43 #define IPC_CALL_LEN 6 44 45 /** Maximum active async calls per phone */ 46 #define IPC_MAX_ASYNC_CALLS 4 47 48 /* Flags for calls */ 49 50 /** This is answer to a call */ 51 #define IPC_CALL_ANSWERED (1 << 0) 52 53 /** Answer will not be passed to userspace, will be discarded */ 54 #define IPC_CALL_DISCARD_ANSWER (1 << 1) 55 56 /** Call was forwarded */ 57 #define IPC_CALL_FORWARDED (1 << 2) 58 59 /** Identify connect_me_to answer */ 60 #define IPC_CALL_CONN_ME_TO (1 << 3) 61 62 /** Interrupt notification */ 63 #define IPC_CALL_NOTIF (1 << 4) 64 65 66 /** Bits used in call hashes. 67 * 68 * The addresses are aligned at least to 4 that is why we can use the 2 least 69 * significant bits of the call address. 70 * 71 */ 72 73 /** Type of this call is 'answer' */ 74 #define IPC_CALLID_ANSWERED 1 75 76 /** Type of this call is 'notification' */ 77 #define IPC_CALLID_NOTIFICATION 2 78 79 /* Return values from sys_ipc_call_async(). */ 80 #define IPC_CALLRET_FATAL -1 81 #define IPC_CALLRET_TEMPORARY -2 82 83 84 /* Macros for manipulating calling data */ 85 #define IPC_SET_RETVAL(data, retval) ((data).args[0] = (retval)) 86 #define IPC_SET_IMETHOD(data, val) ((data).args[0] = (val)) 87 #define IPC_SET_ARG1(data, val) ((data).args[1] = (val)) 88 #define IPC_SET_ARG2(data, val) ((data).args[2] = (val)) 89 #define IPC_SET_ARG3(data, val) ((data).args[3] = (val)) 90 #define IPC_SET_ARG4(data, val) ((data).args[4] = (val)) 91 #define IPC_SET_ARG5(data, val) ((data).args[5] = (val)) 92 93 #define IPC_GET_IMETHOD(data) ((data).args[0]) 94 #define IPC_GET_RETVAL(data) ((data).args[0]) 95 96 #define IPC_GET_ARG1(data) ((data).args[1]) 97 #define IPC_GET_ARG2(data) ((data).args[2]) 98 #define IPC_GET_ARG3(data) ((data).args[3]) 99 #define IPC_GET_ARG4(data) ((data).args[4]) 100 #define IPC_GET_ARG5(data) ((data).args[5]) 101 102 /* Forwarding flags. */ 103 #define IPC_FF_NONE 0 104 105 /** 106 * The call will be routed as though it was initially sent via the phone used to 107 * forward it. This feature is intended to support the situation in which the 108 * forwarded call needs to be handled by the same connection fibril as any other 109 * calls that were initially sent by the forwarder to the same destination. This 110 * flag has no imapct on routing replies. 111 * 112 */ 113 #define IPC_FF_ROUTE_FROM_ME (1 << 0) 114 115 /* Data transfer flags. */ 116 #define IPC_XF_NONE 0 117 118 /** Restrict the transfer size if necessary. */ 119 #define IPC_XF_RESTRICT (1 << 0) 120 121 /** User-defined IPC methods */ 122 #define IPC_FIRST_USER_METHOD 1024 123 124 #ifdef KERNEL 125 126 #define IPC_MAX_PHONES 32 127 38 #include <abi/ipc/ipc.h> 128 39 #include <synch/spinlock.h> 129 40 #include <synch/mutex.h> 130 41 #include <synch/waitq.h> 42 43 #define IPC_MAX_PHONES 32 131 44 132 45 struct answerbox; … … 247 160 extern void ipc_print_task(task_id_t); 248 161 249 #endif /* KERNEL */250 251 162 #endif 252 163 -
kernel/generic/include/lib/elf.h
r3666d386 rc0699467 36 36 #define KERN_ELF_H_ 37 37 38 #include <typedefs.h> 39 #include <abi/elf.h> 38 40 #include <arch/elf.h> 39 #include <typedefs.h>40 41 /**42 * current ELF version43 */44 #define EV_CURRENT 145 46 /**47 * ELF types48 */49 #define ET_NONE 0 /* No type */50 #define ET_REL 1 /* Relocatable file */51 #define ET_EXEC 2 /* Executable */52 #define ET_DYN 3 /* Shared object */53 #define ET_CORE 4 /* Core */54 #define ET_LOPROC 0xff00 /* Processor specific */55 #define ET_HIPROC 0xffff /* Processor specific */56 57 /**58 * ELF machine types59 */60 #define EM_NO 0 /* No machine */61 #define EM_SPARC 2 /* SPARC */62 #define EM_386 3 /* i386 */63 #define EM_MIPS 8 /* MIPS RS3000 */64 #define EM_MIPS_RS3_LE 10 /* MIPS RS3000 LE */65 #define EM_PPC 20 /* PPC32 */66 #define EM_PPC64 21 /* PPC64 */67 #define EM_ARM 40 /* ARM */68 #define EM_SPARCV9 43 /* SPARC64 */69 #define EM_IA_64 50 /* IA-64 */70 #define EM_X86_64 62 /* AMD64/EMT64 */71 72 /**73 * ELF identification indexes74 */75 #define EI_MAG0 076 #define EI_MAG1 177 #define EI_MAG2 278 #define EI_MAG3 379 #define EI_CLASS 4 /* File class */80 #define EI_DATA 5 /* Data encoding */81 #define EI_VERSION 6 /* File version */82 #define EI_OSABI 783 #define EI_ABIVERSION 884 #define EI_PAD 9 /* Start of padding bytes */85 #define EI_NIDENT 16 /* ELF identification table size */86 87 /**88 * ELF magic number89 */90 #define ELFMAG0 0x7f91 #define ELFMAG1 'E'92 #define ELFMAG2 'L'93 #define ELFMAG3 'F'94 95 /**96 * ELF file classes97 */98 #define ELFCLASSNONE 099 #define ELFCLASS32 1100 #define ELFCLASS64 2101 102 /**103 * ELF data encoding types104 */105 #define ELFDATANONE 0106 #define ELFDATA2LSB 1 /* Least significant byte first (little endian) */107 #define ELFDATA2MSB 2 /* Most signigicant byte first (big endian) */108 109 /**110 * ELF section types111 */112 #define SHT_NULL 0113 #define SHT_PROGBITS 1114 #define SHT_SYMTAB 2115 #define SHT_STRTAB 3116 #define SHT_RELA 4117 #define SHT_HASH 5118 #define SHT_DYNAMIC 6119 #define SHT_NOTE 7120 #define SHT_NOBITS 8121 #define SHT_REL 9122 #define SHT_SHLIB 10123 #define SHT_DYNSYM 11124 #define SHT_LOOS 0x60000000125 #define SHT_HIOS 0x6fffffff126 #define SHT_LOPROC 0x70000000127 #define SHT_HIPROC 0x7fffffff128 #define SHT_LOUSER 0x80000000129 #define SHT_HIUSER 0xffffffff130 131 /**132 * ELF section flags133 */134 #define SHF_WRITE 0x1135 #define SHF_ALLOC 0x2136 #define SHF_EXECINSTR 0x4137 #define SHF_TLS 0x400138 #define SHF_MASKPROC 0xf0000000139 140 /** Macros for decomposing elf_symbol.st_info into binging and type */141 #define ELF_ST_BIND(i) ((i) >> 4)142 #define ELF_ST_TYPE(i) ((i) & 0x0f)143 #define ELF_ST_INFO(b, t) (((b) << 4) + ((t) & 0x0f))144 145 /**146 * Symbol binding147 */148 #define STB_LOCAL 0149 #define STB_GLOBAL 1150 #define STB_WEAK 2151 #define STB_LOPROC 13152 #define STB_HIPROC 15153 154 /**155 * Symbol types156 */157 #define STT_NOTYPE 0158 #define STT_OBJECT 1159 #define STT_FUNC 2160 #define STT_SECTION 3161 #define STT_FILE 4162 #define STT_LOPROC 13163 #define STT_HIPROC 15164 165 /**166 * Program segment types167 */168 #define PT_NULL 0169 #define PT_LOAD 1170 #define PT_DYNAMIC 2171 #define PT_INTERP 3172 #define PT_NOTE 4173 #define PT_SHLIB 5174 #define PT_PHDR 6175 #define PT_LOPROC 0x70000000176 #define PT_HIPROC 0x7fffffff177 178 /**179 * Program segment attributes.180 */181 #define PF_X 1182 #define PF_W 2183 #define PF_R 4184 185 /**186 * ELF data types187 *188 * These types are found to be identical in both 32-bit and 64-bit189 * ELF object file specifications. They are the only types used190 * in ELF header.191 */192 typedef uint64_t elf_xword;193 typedef int64_t elf_sxword;194 typedef uint32_t elf_word;195 typedef int32_t elf_sword;196 typedef uint16_t elf_half;197 198 /**199 * 32-bit ELF data types.200 *201 * These types are specific for 32-bit format.202 */203 typedef uint32_t elf32_addr;204 typedef uint32_t elf32_off;205 206 /**207 * 64-bit ELF data types.208 *209 * These types are specific for 64-bit format.210 */211 typedef uint64_t elf64_addr;212 typedef uint64_t elf64_off;213 214 /** ELF header */215 struct elf32_header {216 uint8_t e_ident[EI_NIDENT];217 elf_half e_type;218 elf_half e_machine;219 elf_word e_version;220 elf32_addr e_entry;221 elf32_off e_phoff;222 elf32_off e_shoff;223 elf_word e_flags;224 elf_half e_ehsize;225 elf_half e_phentsize;226 elf_half e_phnum;227 elf_half e_shentsize;228 elf_half e_shnum;229 elf_half e_shstrndx;230 };231 232 struct elf64_header {233 uint8_t e_ident[EI_NIDENT];234 elf_half e_type;235 elf_half e_machine;236 elf_word e_version;237 elf64_addr e_entry;238 elf64_off e_phoff;239 elf64_off e_shoff;240 elf_word e_flags;241 elf_half e_ehsize;242 elf_half e_phentsize;243 elf_half e_phnum;244 elf_half e_shentsize;245 elf_half e_shnum;246 elf_half e_shstrndx;247 };248 249 /**250 * ELF segment header.251 * Segments headers are also known as program headers.252 */253 struct elf32_segment_header {254 elf_word p_type;255 elf32_off p_offset;256 elf32_addr p_vaddr;257 elf32_addr p_paddr;258 elf_word p_filesz;259 elf_word p_memsz;260 elf_word p_flags;261 elf_word p_align;262 };263 264 struct elf64_segment_header {265 elf_word p_type;266 elf_word p_flags;267 elf64_off p_offset;268 elf64_addr p_vaddr;269 elf64_addr p_paddr;270 elf_xword p_filesz;271 elf_xword p_memsz;272 elf_xword p_align;273 };274 275 /**276 * ELF section header277 */278 struct elf32_section_header {279 elf_word sh_name;280 elf_word sh_type;281 elf_word sh_flags;282 elf32_addr sh_addr;283 elf32_off sh_offset;284 elf_word sh_size;285 elf_word sh_link;286 elf_word sh_info;287 elf_word sh_addralign;288 elf_word sh_entsize;289 };290 291 struct elf64_section_header {292 elf_word sh_name;293 elf_word sh_type;294 elf_xword sh_flags;295 elf64_addr sh_addr;296 elf64_off sh_offset;297 elf_xword sh_size;298 elf_word sh_link;299 elf_word sh_info;300 elf_xword sh_addralign;301 elf_xword sh_entsize;302 };303 304 /**305 * ELF symbol table entry306 */307 struct elf32_symbol {308 elf_word st_name;309 elf32_addr st_value;310 elf_word st_size;311 uint8_t st_info;312 uint8_t st_other;313 elf_half st_shndx;314 };315 316 struct elf64_symbol {317 elf_word st_name;318 uint8_t st_info;319 uint8_t st_other;320 elf_half st_shndx;321 elf64_addr st_value;322 elf_xword st_size;323 };324 325 /*326 * ELF note segment entry327 */328 struct elf32_note {329 elf_word namesz;330 elf_word descsz;331 elf_word type;332 };333 334 /*335 * NOTE: namesz, descsz and type should be 64-bits wide (elf_xword)336 * per the 64-bit ELF spec. The Linux kernel however screws up and337 * defines them as Elf64_Word, which is 32-bits wide(!). We are trying338 * to make our core files compatible with Linux GDB target so we copy339 * the blunder here.340 */341 struct elf64_note {342 elf_word namesz;343 elf_word descsz;344 elf_word type;345 };346 347 #ifdef __32_BITS__348 typedef struct elf32_header elf_header_t;349 typedef struct elf32_segment_header elf_segment_header_t;350 typedef struct elf32_section_header elf_section_header_t;351 typedef struct elf32_symbol elf_symbol_t;352 typedef struct elf32_note elf_note_t;353 #endif354 355 #ifdef __64_BITS__356 typedef struct elf64_header elf_header_t;357 typedef struct elf64_segment_header elf_segment_header_t;358 typedef struct elf64_section_header elf_section_header_t;359 typedef struct elf64_symbol elf_symbol_t;360 typedef struct elf64_note elf_note_t;361 #endif362 41 363 42 /** Interpreter string used to recognize the program loader */ -
kernel/generic/include/mm/as.h
r3666d386 rc0699467 36 36 #define KERN_AS_H_ 37 37 38 #ifdef KERNEL 39 #include <typedefs.h> 40 #else 41 #include <sys/types.h> 42 #endif 43 44 /** Address space area flags. */ 45 #define AS_AREA_READ 1 46 #define AS_AREA_WRITE 2 47 #define AS_AREA_EXEC 4 48 #define AS_AREA_CACHEABLE 8 49 50 /** Address space area info exported to userspace. */ 51 typedef struct { 52 /** Starting address */ 53 uintptr_t start_addr; 54 55 /** Area size */ 56 size_t size; 57 58 /** Area flags */ 59 unsigned int flags; 60 } as_area_info_t; 61 62 #ifdef KERNEL 63 38 #include <typedefs.h> 39 #include <abi/mm/as.h> 64 40 #include <arch/mm/page.h> 65 41 #include <arch/mm/as.h> … … 318 294 extern void as_print(as_t *); 319 295 320 #endif /* KERNEL */321 322 296 #endif 323 297 -
kernel/generic/include/proc/task.h
r3666d386 rc0699467 55 55 #include <ipc/kbox.h> 56 56 #include <mm/as.h> 57 #include < sysinfo/abi.h>57 #include <abi/sysinfo.h> 58 58 59 59 struct thread; -
kernel/generic/include/proc/thread.h
r3666d386 rc0699467 45 45 #include <arch/cpu.h> 46 46 #include <mm/tlb.h> 47 #include < proc/uarg.h>47 #include <abi/proc/uarg.h> 48 48 #include <udebug/udebug.h> 49 #include < sysinfo/abi.h>49 #include <abi/sysinfo.h> 50 50 51 51 #define THREAD_NAME_BUFLEN 20 -
kernel/generic/include/synch/condvar.h
r3666d386 rc0699467 39 39 #include <synch/waitq.h> 40 40 #include <synch/mutex.h> 41 #include < synch/synch.h>41 #include <abi/synch.h> 42 42 43 43 typedef struct { -
kernel/generic/include/synch/mutex.h
r3666d386 rc0699467 38 38 #include <typedefs.h> 39 39 #include <synch/semaphore.h> 40 #include < synch/synch.h>40 #include <abi/synch.h> 41 41 42 42 typedef enum { -
kernel/generic/include/synch/semaphore.h
r3666d386 rc0699467 38 38 #include <typedefs.h> 39 39 #include <synch/waitq.h> 40 #include < synch/synch.h>40 #include <abi/synch.h> 41 41 42 42 typedef struct { -
kernel/generic/include/synch/waitq.h
r3666d386 rc0699467 38 38 #include <typedefs.h> 39 39 #include <synch/spinlock.h> 40 #include < synch/synch.h>40 #include <abi/synch.h> 41 41 #include <adt/list.h> 42 42 -
kernel/generic/include/syscall/syscall.h
r3666d386 rc0699467 36 36 #define KERN_SYSCALL_H_ 37 37 38 typedef enum {39 SYS_KLOG = 0,40 SYS_TLS_SET = 1, /* Hardcoded for AMD64, IA-32 (fibril.S in uspace) */41 42 SYS_THREAD_CREATE,43 SYS_THREAD_EXIT,44 SYS_THREAD_GET_ID,45 SYS_THREAD_USLEEP,46 SYS_THREAD_UDELAY,47 48 SYS_TASK_GET_ID,49 SYS_TASK_SET_NAME,50 SYS_TASK_KILL,51 SYS_TASK_EXIT,52 SYS_PROGRAM_SPAWN_LOADER,53 54 SYS_FUTEX_SLEEP,55 SYS_FUTEX_WAKEUP,56 SYS_SMC_COHERENCE,57 58 SYS_AS_AREA_CREATE,59 SYS_AS_AREA_RESIZE,60 SYS_AS_AREA_CHANGE_FLAGS,61 SYS_AS_AREA_DESTROY,62 SYS_AS_GET_UNMAPPED_AREA,63 64 SYS_PAGE_FIND_MAPPING,65 66 SYS_IPC_CALL_SYNC_FAST,67 SYS_IPC_CALL_SYNC_SLOW,68 SYS_IPC_CALL_ASYNC_FAST,69 SYS_IPC_CALL_ASYNC_SLOW,70 SYS_IPC_ANSWER_FAST,71 SYS_IPC_ANSWER_SLOW,72 SYS_IPC_FORWARD_FAST,73 SYS_IPC_FORWARD_SLOW,74 SYS_IPC_WAIT,75 SYS_IPC_POKE,76 SYS_IPC_HANGUP,77 SYS_IPC_CONNECT_KBOX,78 79 SYS_EVENT_SUBSCRIBE,80 SYS_EVENT_UNMASK,81 82 SYS_CAP_GRANT,83 SYS_CAP_REVOKE,84 85 SYS_DEVICE_ASSIGN_DEVNO,86 SYS_PHYSMEM_MAP,87 SYS_IOSPACE_ENABLE,88 SYS_REGISTER_IRQ,89 SYS_UNREGISTER_IRQ,90 91 SYS_SYSINFO_GET_TAG,92 SYS_SYSINFO_GET_VALUE,93 SYS_SYSINFO_GET_DATA_SIZE,94 SYS_SYSINFO_GET_DATA,95 96 SYS_DEBUG_ACTIVATE_CONSOLE,97 98 SYSCALL_END99 } syscall_t;100 101 #ifdef KERNEL102 103 38 #include <typedefs.h> 39 #include <abi/syscall.h> 104 40 105 41 typedef sysarg_t (*syshandler_t)(sysarg_t, sysarg_t, sysarg_t, sysarg_t, … … 113 49 #endif 114 50 115 #endif116 117 51 /** @} 118 52 */ -
kernel/generic/include/udebug/udebug.h
r3666d386 rc0699467 36 36 #define KERN_UDEBUG_H_ 37 37 38 #define UDEBUG_EVMASK(event) (1 << ((event) - 1)) 39 40 typedef enum { /* udebug_method_t */ 41 42 /** Start debugging the recipient. 43 * 44 * Causes all threads in the receiving task to stop. When they 45 * are all stoped, an answer with retval 0 is generated. 46 * 47 */ 48 UDEBUG_M_BEGIN = 1, 49 50 /** Finish debugging the recipient. 51 * 52 * Answers all pending GO and GUARD messages. 53 * 54 */ 55 UDEBUG_M_END, 56 57 /** Set which events should be captured. */ 58 UDEBUG_M_SET_EVMASK, 59 60 /** Make sure the debugged task is still there. 61 * 62 * This message is answered when the debugged task dies 63 * or the debugging session ends. 64 * 65 */ 66 UDEBUG_M_GUARD, 67 68 /** Run a thread until a debugging event occurs. 69 * 70 * This message is answered when the thread stops 71 * in a debugging event. 72 * 73 * - ARG2 - id of the thread to run 74 * 75 */ 76 UDEBUG_M_GO, 77 78 /** Stop a thread being debugged. 79 * 80 * Creates a special STOP event in the thread, causing 81 * it to answer a pending GO message (if any). 82 * 83 */ 84 UDEBUG_M_STOP, 85 86 /** Read arguments of a syscall. 87 * 88 * - ARG2 - thread identification 89 * - ARG3 - destination address in the caller's address space 90 * 91 */ 92 UDEBUG_M_ARGS_READ, 93 94 /** Read thread's userspace register state (istate_t). 95 * 96 * - ARG2 - thread identification 97 * - ARG3 - destination address in the caller's address space 98 * 99 * or, on error, retval will be 100 * - ENOENT - thread does not exist 101 * - EBUSY - register state not available 102 */ 103 UDEBUG_M_REGS_READ, 104 105 /** Read the list of the debugged tasks's threads. 106 * 107 * - ARG2 - destination address in the caller's address space 108 * - ARG3 - size of receiving buffer in bytes 109 * 110 * The kernel fills the buffer with a series of sysarg_t values 111 * (thread ids). On answer, the kernel will set: 112 * 113 * - ARG2 - number of bytes that were actually copied 114 * - ARG3 - number of bytes of the complete data 115 * 116 */ 117 UDEBUG_M_THREAD_READ, 118 119 /** Read the name of the debugged task. 120 * 121 * - ARG2 - destination address in the caller's address space 122 * - ARG3 - size of receiving buffer in bytes 123 * 124 * The kernel fills the buffer with a non-terminated string. 125 * 126 * - ARG2 - number of bytes that were actually copied 127 * - ARG3 - number of bytes of the complete data 128 * 129 */ 130 UDEBUG_M_NAME_READ, 131 132 /** Read the list of the debugged task's address space areas. 133 * 134 * - ARG2 - destination address in the caller's address space 135 * - ARG3 - size of receiving buffer in bytes 136 * 137 * The kernel fills the buffer with a series of as_area_info_t structures. 138 * Upon answer, the kernel will set: 139 * 140 * - ARG2 - number of bytes that were actually copied 141 * - ARG3 - number of bytes of the complete data 142 * 143 */ 144 UDEBUG_M_AREAS_READ, 145 146 /** Read the debugged tasks's memory. 147 * 148 * - ARG2 - destination address in the caller's address space 149 * - ARG3 - source address in the recipient's address space 150 * - ARG4 - size of receiving buffer in bytes 151 * 152 */ 153 UDEBUG_M_MEM_READ 154 } udebug_method_t; 155 156 typedef enum { 157 UDEBUG_EVENT_FINISHED = 1, /**< Debuging session has finished */ 158 UDEBUG_EVENT_STOP, /**< Stopped on DEBUG_STOP request */ 159 UDEBUG_EVENT_SYSCALL_B, /**< Before beginning syscall execution */ 160 UDEBUG_EVENT_SYSCALL_E, /**< After finishing syscall execution */ 161 UDEBUG_EVENT_THREAD_B, /**< The task created a new thread */ 162 UDEBUG_EVENT_THREAD_E /**< A thread exited */ 163 } udebug_event_t; 164 165 typedef enum { 166 UDEBUG_EM_FINISHED = UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED), 167 UDEBUG_EM_STOP = UDEBUG_EVMASK(UDEBUG_EVENT_STOP), 168 UDEBUG_EM_SYSCALL_B = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B), 169 UDEBUG_EM_SYSCALL_E = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E), 170 UDEBUG_EM_THREAD_B = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B), 171 UDEBUG_EM_THREAD_E = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E), 172 UDEBUG_EM_ALL = 173 (UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED) | 174 UDEBUG_EVMASK(UDEBUG_EVENT_STOP) | 175 UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B) | 176 UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E) | 177 UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B) | 178 UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E)) 179 } udebug_evmask_t; 180 181 #ifdef KERNEL 182 38 #include <abi/udebug.h> 183 39 #include <ipc/ipc.h> 184 40 #include <synch/mutex.h> … … 251 107 #endif 252 108 253 #endif254 255 109 /** @} 256 110 */ -
kernel/generic/src/ddi/ddi.c
r3666d386 rc0699467 41 41 42 42 #include <ddi/ddi.h> 43 #include <ddi/ddi_arg.h>44 43 #include <proc/task.h> 45 44 #include <security/cap.h> -
kernel/generic/src/ipc/event.c
r3666d386 rc0699467 36 36 37 37 #include <ipc/event.h> 38 #include <ipc/event_types.h>39 38 #include <mm/slab.h> 40 39 #include <typedefs.h> -
kernel/generic/src/ipc/ipc.c
r3666d386 rc0699467 38 38 */ 39 39 40 #include <synch/synch.h>41 40 #include <synch/spinlock.h> 42 41 #include <synch/mutex.h> 43 42 #include <synch/waitq.h> 44 #include <synch/synch.h>45 43 #include <ipc/ipc.h> 46 #include < ipc/ipc_methods.h>44 #include <abi/ipc/methods.h> 47 45 #include <ipc/kbox.h> 48 46 #include <ipc/event.h> -
kernel/generic/src/ipc/kbox.c
r3666d386 rc0699467 33 33 */ 34 34 35 #include <synch/synch.h>36 35 #include <synch/spinlock.h> 37 36 #include <synch/mutex.h> 38 37 #include <ipc/ipc.h> 39 #include < ipc/ipc_methods.h>38 #include <abi/ipc/methods.h> 40 39 #include <ipc/ipcrsc.h> 41 40 #include <arch.h> -
kernel/generic/src/ipc/sysipc.c
r3666d386 rc0699467 40 40 #include <debug.h> 41 41 #include <ipc/ipc.h> 42 #include < ipc/ipc_methods.h>42 #include <abi/ipc/methods.h> 43 43 #include <ipc/sysipc.h> 44 44 #include <ipc/irq.h> -
kernel/generic/src/proc/program.c
r3666d386 rc0699467 40 40 #include <proc/thread.h> 41 41 #include <proc/task.h> 42 #include <proc/uarg.h>43 42 #include <mm/as.h> 44 43 #include <mm/slab.h> -
kernel/generic/src/proc/thread.c
r3666d386 rc0699467 39 39 #include <proc/thread.h> 40 40 #include <proc/task.h> 41 #include <proc/uarg.h>42 41 #include <mm/frame.h> 43 42 #include <mm/page.h> … … 45 44 #include <arch/cycle.h> 46 45 #include <arch.h> 47 #include <synch/synch.h>48 46 #include <synch/spinlock.h> 49 47 #include <synch/waitq.h> -
kernel/generic/src/synch/condvar.c
r3666d386 rc0699467 39 39 #include <synch/mutex.h> 40 40 #include <synch/waitq.h> 41 #include <synch/synch.h>42 41 #include <arch.h> 43 42 -
kernel/generic/src/synch/futex.c
r3666d386 rc0699467 39 39 #include <synch/mutex.h> 40 40 #include <synch/spinlock.h> 41 #include <synch/synch.h>42 41 #include <mm/frame.h> 43 42 #include <mm/page.h> -
kernel/generic/src/synch/mutex.c
r3666d386 rc0699467 38 38 #include <synch/mutex.h> 39 39 #include <synch/semaphore.h> 40 #include <synch/synch.h>41 40 #include <debug.h> 42 41 #include <arch.h> -
kernel/generic/src/synch/semaphore.c
r3666d386 rc0699467 39 39 #include <synch/waitq.h> 40 40 #include <synch/spinlock.h> 41 #include <synch/synch.h>42 41 #include <arch/asm.h> 43 42 #include <arch.h> -
kernel/generic/src/synch/waitq.c
r3666d386 rc0699467 45 45 46 46 #include <synch/waitq.h> 47 #include <synch/synch.h>48 47 #include <synch/spinlock.h> 49 48 #include <proc/thread.h> -
kernel/generic/src/sysinfo/stats.c
r3666d386 rc0699467 35 35 36 36 #include <typedefs.h> 37 #include < sysinfo/abi.h>37 #include <abi/sysinfo.h> 38 38 #include <sysinfo/stats.h> 39 39 #include <sysinfo/sysinfo.h>
Note:
See TracChangeset
for help on using the changeset viewer.