Changeset efdfebc in mainline for kernel/generic/include
- Timestamp:
- 2012-11-06T21:03:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 338810f
- Parents:
- de73242 (diff), 94795812 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/generic/include
- Files:
-
- 5 added
- 12 edited
-
config.h (modified) (2 diffs)
-
console/prompt.h (added)
-
debug.h (modified) (1 diff)
-
interrupt.h (modified) (2 diffs)
-
ipc/ipc.h (modified) (6 diffs)
-
ipc/ipcrsc.h (modified) (1 diff)
-
ipc/irq.h (modified) (1 diff)
-
ipc/sysipc.h (modified) (1 diff)
-
ipc/sysipc_ops.h (added)
-
ipc/sysipc_priv.h (added)
-
lib/elf_load.h (modified) (1 diff)
-
macros.h (modified) (2 diffs)
-
print.h (modified) (1 diff)
-
printf/verify.h (added)
-
proc/task.h (modified) (1 diff)
-
symtab.h (modified) (1 diff)
-
symtab_lookup.h (added)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/config.h
rde73242 refdfebc 47 47 #define CONFIG_INIT_TASKS 32 48 48 #define CONFIG_TASK_NAME_BUFLEN 32 49 #define CONFIG_TASK_ARGUMENTS_BUFLEN 64 50 51 /** 52 * Maximum buffer size allowed for IPC_M_DATA_WRITE and IPC_M_DATA_READ 53 * requests. 54 */ 55 #define DATA_XFER_LIMIT (64 * 1024) 49 56 50 57 #ifndef __ASM__ … … 56 63 size_t size; 57 64 char name[CONFIG_TASK_NAME_BUFLEN]; 65 char arguments[CONFIG_TASK_ARGUMENTS_BUFLEN]; 58 66 } init_task_t; 59 67 -
kernel/generic/include/debug.h
rde73242 refdfebc 37 37 38 38 #include <panic.h> 39 #include <symtab .h>39 #include <symtab_lookup.h> 40 40 41 41 #define CALLER ((uintptr_t) __builtin_return_address(0)) -
kernel/generic/include/interrupt.h
rde73242 refdfebc 38 38 #include <arch/interrupt.h> 39 39 #include <print.h> 40 #include <stdarg.h> 40 41 #include <typedefs.h> 41 42 #include <proc/task.h> … … 58 59 extern exc_table_t exc_table[]; 59 60 61 extern void fault_from_uspace(istate_t *, const char *, ...) 62 PRINTF_ATTRIBUTE(2, 3); 60 63 extern void fault_if_from_uspace(istate_t *, const char *, ...) 61 64 PRINTF_ATTRIBUTE(2, 3); -
kernel/generic/include/ipc/ipc.h
rde73242 refdfebc 65 65 mutex_t lock; 66 66 link_t link; 67 struct task *caller; 67 68 struct answerbox *callee; 68 69 ipc_phone_state_t state; … … 72 73 typedef struct answerbox { 73 74 IRQ_SPINLOCK_DECLARE(lock); 75 76 /** Answerbox is active until it enters cleanup. */ 77 bool active; 74 78 75 79 struct task *task; 76 80 77 81 waitq_t wq; 78 79 /** Linkage for the list of task's synchronous answerboxes. */80 link_t sync_box_link;81 82 82 83 /** Phones connected to this answerbox. */ … … 109 110 110 111 typedef struct { 111 link_t link; 112 /** 113 * Task link. 114 * Valid only when the call is not forgotten. 115 * Protected by the task's active_calls_lock. 116 */ 117 link_t ta_link; 118 119 atomic_t refcnt; 120 121 /** Answerbox link. */ 122 link_t ab_link; 112 123 113 124 unsigned int flags; 125 126 /** Protects the forget member. */ 127 SPINLOCK_DECLARE(forget_lock); 128 129 /** 130 * True if the caller 'forgot' this call and donated it to the callee. 131 * Forgotten calls are discarded upon answering (the answer is not 132 * delivered) and answered calls cannot be forgotten. Forgotten calls 133 * also do not figure on the task's active call list. 134 * 135 * We keep this separate from the flags so that it is not necessary 136 * to take a lock when accessing them. 137 */ 138 bool forget; 139 140 /** True if the call is in the active list. */ 141 bool active; 114 142 115 /** Identification of the caller. */ 143 /** 144 * Identification of the caller. 145 * Valid only when the call is not forgotten. 146 */ 116 147 struct task *sender; 117 148 118 /* 119 * The caller box is different from sender->answerbox 120 * for synchronous calls. 121 */ 122 answerbox_t *callerbox; 149 /** Phone which was used to send the call. */ 150 phone_t *caller_phone; 123 151 124 152 /** Private data to internal IPC. */ … … 127 155 /** Data passed from/to userspace. */ 128 156 ipc_data_t data; 129 157 158 /** Method as it was sent in the request. */ 159 sysarg_t request_method; 160 130 161 /** Buffer for IPC_M_DATA_WRITE and IPC_M_DATA_READ. */ 131 162 uint8_t *buffer; 132 133 /*134 * The forward operation can masquerade the caller phone. For those135 * cases, we must keep it aside so that the answer is processed136 * correctly.137 */138 phone_t *caller_phone;139 163 } call_t; 140 164 … … 145 169 extern call_t *ipc_call_alloc(unsigned int); 146 170 extern void ipc_call_free(call_t *); 171 extern void ipc_call_hold(call_t *); 172 extern void ipc_call_release(call_t *); 147 173 148 174 extern int ipc_call(phone_t *, call_t *); 149 extern int ipc_call_sync(phone_t *, call_t *);150 175 extern call_t *ipc_wait_for_call(answerbox_t *, uint32_t, unsigned int); 151 176 extern int ipc_forward(call_t *, phone_t *, answerbox_t *, unsigned int); 152 177 extern void ipc_answer(answerbox_t *, call_t *); 178 extern void _ipc_answer_free_call(call_t *, bool); 153 179 154 extern void ipc_phone_init(phone_t * );155 extern voidipc_phone_connect(phone_t *, answerbox_t *);180 extern void ipc_phone_init(phone_t *, struct task *); 181 extern bool ipc_phone_connect(phone_t *, answerbox_t *); 156 182 extern int ipc_phone_hangup(phone_t *); 157 183 … … 161 187 extern void ipc_backsend_err(phone_t *, call_t *, sysarg_t); 162 188 extern void ipc_answerbox_slam_phones(answerbox_t *, bool); 163 extern void ipc_cleanup_call_list( list_t *);189 extern void ipc_cleanup_call_list(answerbox_t *, list_t *); 164 190 165 191 extern void ipc_print_task(task_id_t); -
kernel/generic/include/ipc/ipcrsc.h
rde73242 refdfebc 40 40 41 41 extern call_t *get_call(sysarg_t); 42 extern int phone_get(sysarg_t, phone_t **); 42 43 extern int phone_alloc(task_t *); 43 extern voidphone_connect(int, answerbox_t *);44 extern bool phone_connect(int, answerbox_t *); 44 45 extern void phone_dealloc(int); 45 46 -
kernel/generic/include/ipc/irq.h
rde73242 refdfebc 37 37 38 38 /** Maximum number of IPC IRQ programmed I/O ranges. */ 39 #define IRQ_MAX_RANGE_COUNT 839 #define IRQ_MAX_RANGE_COUNT 8 40 40 41 41 /** Maximum length of IPC IRQ program. */ 42 #define IRQ_MAX_PROG_SIZE 2 042 #define IRQ_MAX_PROG_SIZE 256 43 43 44 44 #include <ipc/ipc.h> -
kernel/generic/include/ipc/sysipc.h
rde73242 refdfebc 40 40 #include <typedefs.h> 41 41 42 extern sysarg_t sys_ipc_call_sync_fast(sysarg_t, sysarg_t, sysarg_t,43 sysarg_t, sysarg_t, ipc_data_t *);44 extern sysarg_t sys_ipc_call_sync_slow(sysarg_t, ipc_data_t *, ipc_data_t *);45 42 extern sysarg_t sys_ipc_call_async_fast(sysarg_t, sysarg_t, sysarg_t, 46 43 sysarg_t, sysarg_t, sysarg_t); -
kernel/generic/include/lib/elf_load.h
rde73242 refdfebc 42 42 * ELF error return codes 43 43 */ 44 #define EE_OK 0/* No error */45 #define EE_INVALID 1/* Invalid ELF image */46 #define EE_MEMORY 2/* Cannot allocate address space */47 #define EE_INCOMPATIBLE 3/* ELF image is not compatible with current architecture */48 #define EE_UNSUPPORTED 4/* Non-supported ELF (e.g. dynamic ELFs) */49 #define EE_LOADER 5/* The image is actually a program loader. */50 #define EE_IRRECOVERABLE 644 #define EE_OK 0 /* No error */ 45 #define EE_INVALID 1 /* Invalid ELF image */ 46 #define EE_MEMORY 2 /* Cannot allocate address space */ 47 #define EE_INCOMPATIBLE 3 /* ELF image is not compatible with current architecture */ 48 #define EE_UNSUPPORTED 4 /* Non-supported ELF (e.g. dynamic ELFs) */ 49 #define EE_LOADER 5 /* The image is actually a program loader. */ 50 #define EE_IRRECOVERABLE 6 /* Irrecoverable error. */ 51 51 52 52 /** 53 53 * This flags is passed when running the loader, otherwise elf_load() 54 54 * would return with a EE_LOADER error code. 55 *56 55 */ 57 56 #define ELD_F_NONE 0 -
kernel/generic/include/macros.h
rde73242 refdfebc 52 52 uint64_t sz2) 53 53 { 54 uint64_t e1 = s1 + sz1; 55 uint64_t e2 = s2 + sz2; 56 57 return ((s1 < e2) && (s2 < e1)); 54 uint64_t e1 = s1 + sz1 - 1; 55 uint64_t e2 = s2 + sz2 - 1; 56 57 /* both sizes are non-zero */ 58 if (sz1 && sz2) 59 return ((s1 <= e2) && (s2 <= e1)); 60 61 /* one size is non-zero */ 62 if (sz2) 63 return ((s1 >= s2) && (s1 <= e2)); 64 if (sz1) 65 return ((s2 >= s1) && (s2 <= e1)); 66 67 /* both are zero */ 68 return (s1 == s2); 58 69 } 59 70 … … 119 130 | ((((uint64_t) (up)) & UINT32_C(0xffffffff)) << 32)) 120 131 132 /* Test for sum overflow. */ 133 #define overflows(a, b) \ 134 ((a) + (b) < (a)) 135 136 /* Test for sum overflow into positive numbers. */ 137 #define overflows_into_positive(a, b) \ 138 (overflows((a), (b)) && ((a) + (b) > 0)) 139 121 140 /** Pseudorandom generator 122 141 * -
kernel/generic/include/print.h
rde73242 refdfebc 38 38 #include <typedefs.h> 39 39 #include <stdarg.h> 40 41 #ifndef NVERIFY_PRINTF 42 43 #define PRINTF_ATTRIBUTE(start, end) \ 44 __attribute__((format(gnu_printf, start, end))) 45 46 #else /* NVERIFY_PRINTF */ 47 48 #define PRINTF_ATTRIBUTE(start, end) 49 50 #endif /* NVERIFY_PRINTF */ 40 #include <printf/verify.h> 51 41 52 42 #define EOF (-1) -
kernel/generic/include/proc/task.h
rde73242 refdfebc 91 91 92 92 /* IPC stuff */ 93 answerbox_t answerbox; /**< Communication endpoint */ 93 94 /** Receiving communication endpoint */ 95 answerbox_t answerbox; 96 97 /** Sending communication endpoints */ 94 98 phone_t phones[IPC_MAX_PHONES]; 95 stats_ipc_t ipc_info; /**< IPC statistics */ 96 list_t sync_boxes; /**< List of synchronous answerboxes. */ 99 100 /** Spinlock protecting the active_calls list. */ 101 SPINLOCK_DECLARE(active_calls_lock); 102 103 /** 104 * List of all calls sent by this task that have not yet been 105 * answered. 106 */ 107 list_t active_calls; 108 97 109 event_t events[EVENT_TASK_END - EVENT_END]; 110 111 /** IPC statistics */ 112 stats_ipc_t ipc_info; 98 113 99 114 #ifdef CONFIG_UDEBUG -
kernel/generic/include/symtab.h
rde73242 refdfebc 36 36 #define KERN_SYMTAB_H_ 37 37 38 #include <typedefs.h> 38 #include <symtab_lookup.h> 39 #include <console/chardev.h> 39 40 40 #define MAX_SYMBOL_NAME 6441 42 struct symtab_entry {43 uint64_t address_le;44 char symbol_name[MAX_SYMBOL_NAME];45 };46 47 extern int symtab_name_lookup(uintptr_t, const char **, uintptr_t *);48 extern const char *symtab_fmt_name_lookup(uintptr_t);49 extern int symtab_addr_lookup(const char *, uintptr_t *);50 41 extern void symtab_print_search(const char *); 51 extern int symtab_compl(char *, size_t); 52 53 #ifdef CONFIG_SYMTAB 54 55 /** Symtable linked together by build process 56 * 57 */ 58 extern struct symtab_entry symbol_table[]; 59 60 #endif /* CONFIG_SYMTAB */ 42 extern int symtab_compl(char *, size_t, indev_t *); 61 43 62 44 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
