Changeset 1433ecda in mainline for kernel/generic
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- kernel/generic
- Files:
-
- 25 edited
-
include/adt/avl.h (modified) (2 diffs)
-
include/adt/cht.h (modified) (1 diff)
-
include/bitops.h (modified) (1 diff)
-
include/byteorder.h (modified) (1 diff)
-
include/console/chardev.h (modified) (2 diffs)
-
include/console/kconsole.h (modified) (2 diffs)
-
include/ddi/irq.h (modified) (2 diffs)
-
include/interrupt.h (modified) (1 diff)
-
include/mm/as.h (modified) (2 diffs)
-
include/panic.h (modified) (1 diff)
-
include/synch/rcu.h (modified) (1 diff)
-
include/time/timeout.h (modified) (1 diff)
-
include/userspace.h (modified) (1 diff)
-
src/console/console.c (modified) (1 diff)
-
src/cpu/cpu.c (modified) (2 diffs)
-
src/cpu/cpu_mask.c (modified) (1 diff)
-
src/debug/symtab.c (modified) (1 diff)
-
src/lib/halt.c (modified) (1 diff)
-
src/lib/str.c (modified) (1 diff)
-
src/lib/str_error.c (modified) (2 diffs)
-
src/main/version.c (modified) (1 diff)
-
src/smp/smp_call.c (modified) (2 diffs)
-
src/synch/condvar.c (modified) (2 diffs)
-
src/syscall/copy.c (modified) (2 diffs)
-
src/syscall/syscall.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/avl.h
r47b2d7e3 r1433ecda 57 57 typedef uint64_t avltree_key_t; 58 58 59 typedef bool (* avltree_walker_t)(avltree_node_t *, void *);59 typedef bool (*avltree_walker_t)(avltree_node_t *, void *); 60 60 61 61 /** AVL tree node structure. */ 62 struct avltree_node 63 { 62 struct avltree_node { 64 63 /** 65 64 * Pointer to the left descendant of this node. … … 92 91 93 92 /** AVL tree structure. */ 94 struct avltree 95 { 93 struct avltree { 96 94 /** AVL root node pointer */ 97 95 struct avltree_node *root; -
kernel/generic/include/adt/cht.h
r47b2d7e3 r1433ecda 134 134 extern bool cht_create_simple(cht_t *h, cht_ops_t *op); 135 135 extern bool cht_create(cht_t *h, size_t init_size, size_t min_size, 136 size_t max_load, bool can_block, cht_ops_t *op);136 size_t max_load, bool can_block, cht_ops_t *op); 137 137 extern void cht_destroy(cht_t *h); 138 138 extern void cht_destroy_unsafe(cht_t *h); -
kernel/generic/include/bitops.h
r47b2d7e3 r1433ecda 39 39 40 40 #ifdef __32_BITS__ 41 #define fnzb(arg) fnzb32(arg)41 #define fnzb(arg) fnzb32(arg) 42 42 #endif 43 43 44 44 #ifdef __64_BITS__ 45 #define fnzb(arg) fnzb64(arg)45 #define fnzb(arg) fnzb64(arg) 46 46 #endif 47 47 -
kernel/generic/include/byteorder.h
r47b2d7e3 r1433ecda 39 39 40 40 #if !(defined(__BE__) ^ defined(__LE__)) 41 #error The architecture must be either big-endian or little-endian.41 #error The architecture must be either big-endian or little-endian. 42 42 #endif 43 43 -
kernel/generic/include/console/chardev.h
r47b2d7e3 r1433ecda 55 55 typedef struct { 56 56 /** Read character directly from device, assume interrupts disabled. */ 57 wchar_t (* poll)(struct indev *);57 wchar_t (*poll)(struct indev *); 58 58 59 59 /** Signal out-of-band condition. */ 60 void (* signal)(struct indev *, indev_signal_t);60 void (*signal)(struct indev *, indev_signal_t); 61 61 } indev_operations_t; 62 62 … … 82 82 typedef struct { 83 83 /** Write character to output. */ 84 void (* write)(struct outdev *, wchar_t);84 void (*write)(struct outdev *, wchar_t); 85 85 86 86 /** Redraw any previously cached characters. */ 87 void (* redraw)(struct outdev *);87 void (*redraw)(struct outdev *); 88 88 89 89 /** Scroll up in the device cache. */ 90 void (* scroll_up)(struct outdev *);90 void (*scroll_up)(struct outdev *); 91 91 92 92 /** Scroll down in the device cache. */ 93 void (* scroll_down)(struct outdev *);93 void (*scroll_down)(struct outdev *); 94 94 } outdev_operations_t; 95 95 -
kernel/generic/include/console/kconsole.h
r47b2d7e3 r1433ecda 81 81 const char *description; 82 82 /** Function implementing the command. */ 83 int (* func)(cmd_arg_t *);83 int (*func)(cmd_arg_t *); 84 84 /** Number of arguments. */ 85 85 size_t argc; … … 87 87 cmd_arg_t *argv; 88 88 /** Function for printing detailed help. */ 89 void (* help)(void);89 void (*help)(void); 90 90 /** Function for enumerating hints for arguments. */ 91 91 hints_enum_func_t hints_enum; -
kernel/generic/include/ddi/irq.h
r47b2d7e3 r1433ecda 57 57 struct irq; 58 58 59 typedef void (* irq_handler_t)(struct irq *);59 typedef void (*irq_handler_t)(struct irq *); 60 60 61 61 /** Type for function used to clear the interrupt. */ 62 typedef void (* cir_t)(void *, inr_t);62 typedef void (*cir_t)(void *, inr_t); 63 63 64 64 /** IPC notification config structure. … … 114 114 irq_trigger_t trigger; 115 115 /** Claim ownership of the IRQ. */ 116 irq_ownership_t (* claim)(struct irq *);116 irq_ownership_t (*claim)(struct irq *); 117 117 /** Handler for this IRQ and device. */ 118 118 irq_handler_t handler; -
kernel/generic/include/interrupt.h
r47b2d7e3 r1433ecda 47 47 #include <arch/istate.h> 48 48 49 typedef void (* iroutine_t)(unsigned int, istate_t *);49 typedef void (*iroutine_t)(unsigned int, istate_t *); 50 50 51 51 typedef struct { -
kernel/generic/include/mm/as.h
r47b2d7e3 r1433ecda 126 126 127 127 typedef struct { 128 pte_t *(* page_table_create)(unsigned int);129 void (* page_table_destroy)(pte_t *);130 void (* page_table_lock)(as_t *, bool);131 void (* page_table_unlock)(as_t *, bool);132 bool (* page_table_locked)(as_t *);128 pte_t *(*page_table_create)(unsigned int); 129 void (*page_table_destroy)(pte_t *); 130 void (*page_table_lock)(as_t *, bool); 131 void (*page_table_unlock)(as_t *, bool); 132 bool (*page_table_locked)(as_t *); 133 133 } as_operations_t; 134 134 … … 237 237 /** Address space area backend structure. */ 238 238 typedef struct mem_backend { 239 bool (* create)(as_area_t *);240 bool (* resize)(as_area_t *, size_t);241 void (* share)(as_area_t *);242 void (* destroy)(as_area_t *);243 244 bool (* is_resizable)(as_area_t *);245 bool (* is_shareable)(as_area_t *);246 247 int (* page_fault)(as_area_t *, uintptr_t, pf_access_t);248 void (* frame_free)(as_area_t *, uintptr_t, uintptr_t);249 250 bool (* create_shared_data)(as_area_t *);251 void (* destroy_shared_data)(void *);239 bool (*create)(as_area_t *); 240 bool (*resize)(as_area_t *, size_t); 241 void (*share)(as_area_t *); 242 void (*destroy)(as_area_t *); 243 244 bool (*is_resizable)(as_area_t *); 245 bool (*is_shareable)(as_area_t *); 246 247 int (*page_fault)(as_area_t *, uintptr_t, pf_access_t); 248 void (*frame_free)(as_area_t *, uintptr_t, uintptr_t); 249 250 bool (*create_shared_data)(as_area_t *); 251 void (*destroy_shared_data)(void *); 252 252 } mem_backend_t; 253 253 -
kernel/generic/include/panic.h
r47b2d7e3 r1433ecda 65 65 66 66 extern void panic_common(panic_category_t, struct istate *, int, 67 uintptr_t, const char *, ...) __attribute__ ((noreturn))67 uintptr_t, const char *, ...) __attribute__((noreturn)) 68 68 _HELENOS_PRINTF_ATTRIBUTE(5, 6); 69 69 -
kernel/generic/include/synch/rcu.h
r47b2d7e3 r1433ecda 113 113 extern void rcu_cpu_init(void); 114 114 extern void rcu_kinit_init(void); 115 extern void rcu_thread_init(struct thread *);115 extern void rcu_thread_init(struct thread *); 116 116 extern void rcu_thread_exiting(void); 117 117 extern void rcu_after_thread_ran(void); -
kernel/generic/include/time/timeout.h
r47b2d7e3 r1433ecda 40 40 #include <stdint.h> 41 41 42 typedef void (* timeout_handler_t)(void *arg);42 typedef void (*timeout_handler_t)(void *arg); 43 43 44 44 typedef struct { -
kernel/generic/include/userspace.h
r47b2d7e3 r1433ecda 40 40 41 41 /** Switch to user-space (CPU user priviledge level) */ 42 extern void userspace(uspace_arg_t *uarg) __attribute__ ((noreturn));42 extern void userspace(uspace_arg_t *uarg) __attribute__((noreturn)); 43 43 44 44 #endif -
kernel/generic/src/console/console.c
r47b2d7e3 r1433ecda 64 64 65 65 /** Kernel log initialized */ 66 static atomic_t kio_inited = { false};66 static atomic_t kio_inited = { false }; 67 67 68 68 /** First kernel log characters */ -
kernel/generic/src/cpu/cpu.c
r47b2d7e3 r1433ecda 59 59 * 60 60 */ 61 void cpu_init(void) { 61 void cpu_init(void) 62 { 62 63 #ifdef CONFIG_SMP 63 64 if (config.cpu_active == 1) { 64 65 #endif /* CONFIG_SMP */ 65 66 66 cpus = (cpu_t *) malloc(sizeof(cpu_t) * config.cpu_count,67 cpus = (cpu_t *) malloc(sizeof(cpu_t) *config.cpu_count, 67 68 FRAME_ATOMIC); 68 69 if (!cpus) … … 70 71 71 72 /* Initialize everything */ 72 memsetb(cpus, sizeof(cpu_t) * config.cpu_count, 0);73 memsetb(cpus, sizeof(cpu_t) *config.cpu_count, 0); 73 74 74 75 size_t i; -
kernel/generic/src/cpu/cpu_mask.c
r47b2d7e3 r1433ecda 57 57 58 58 for (size_t active_word = 0; 59 (active_word + 1) * word_bit_cnt <= cpu_cnt;60 ++active_word) {59 (active_word + 1) * word_bit_cnt <= cpu_cnt; 60 ++active_word) { 61 61 /* Set all bits in the cell/word. */ 62 62 cpus->mask[active_word] = -1; -
kernel/generic/src/debug/symtab.c
r47b2d7e3 r1433ecda 202 202 203 203 /** Symtab completion enum, see kernel/generic/include/kconsole.h */ 204 const char *symtab_hints_enum(const char *input, const char **help,204 const char *symtab_hints_enum(const char *input, const char **help, 205 205 void **ctx) 206 206 { 207 207 #ifdef CONFIG_SYMTAB 208 208 size_t len = str_length(input); 209 struct symtab_entry **entry = (struct symtab_entry **)ctx;209 struct symtab_entry **entry = (struct symtab_entry **)ctx; 210 210 211 211 if (*entry == NULL) -
kernel/generic/src/lib/halt.c
r47b2d7e3 r1433ecda 44 44 45 45 /** Halt flag */ 46 atomic_t haltstate = { 0};46 atomic_t haltstate = { 0 }; 47 47 48 48 /** Halt wrapper -
kernel/generic/src/lib/str.c
r47b2d7e3 r1433ecda 115 115 /** Check the condition if wchar_t is signed */ 116 116 #ifdef __WCHAR_UNSIGNED__ 117 #define WCHAR_SIGNED_CHECK(cond) (true)117 #define WCHAR_SIGNED_CHECK(cond) (true) 118 118 #else 119 #define WCHAR_SIGNED_CHECK(cond) (cond)119 #define WCHAR_SIGNED_CHECK(cond) (cond) 120 120 #endif 121 121 -
kernel/generic/src/lib/str_error.c
r47b2d7e3 r1433ecda 47 47 #define __errno_entry(name, num, desc) #name, 48 48 49 static const char *err_name[] = {49 static const char *err_name[] = { 50 50 #include <abi/errno.in> 51 51 }; … … 54 54 #define __errno_entry(name, num, desc) "[" #name "]" desc, 55 55 56 static const char *err_desc[] = {56 static const char *err_desc[] = { 57 57 #include <abi/errno.in> 58 58 }; -
kernel/generic/src/main/version.c
r47b2d7e3 r1433ecda 44 44 45 45 #ifdef REVISION 46 static const char *revision = ", revision " STRING(REVISION);46 static const char *revision = ", revision " STRING(REVISION); 47 47 #else 48 static const char *revision = "";48 static const char *revision = ""; 49 49 #endif 50 50 51 51 #ifdef TIMESTAMP 52 static const char *timestamp = " on " STRING(TIMESTAMP);52 static const char *timestamp = " on " STRING(TIMESTAMP); 53 53 #else 54 static const char *timestamp = "";54 static const char *timestamp = ""; 55 55 #endif 56 56 -
kernel/generic/src/smp/smp_call.c
r47b2d7e3 r1433ecda 122 122 */ 123 123 void smp_call_async(unsigned int cpu_id, smp_call_func_t func, void *arg, 124 smp_call_t *call_info)124 smp_call_t *call_info) 125 125 { 126 126 /* … … 222 222 223 223 /* Walk the list manually, so that we can safely remove list items. */ 224 for (link_t * cur = calls_list.head.next, *next = cur->next;225 !list_empty(&calls_list); cur = next, next = cur->next) {224 for (link_t * cur = calls_list.head.next, *next = cur->next; 225 !list_empty(&calls_list); cur = next, next = cur->next) { 226 226 227 227 smp_call_t *call_info = list_get_instance(cur, smp_call_t, calls_link); -
kernel/generic/src/synch/condvar.c
r47b2d7e3 r1433ecda 125 125 */ 126 126 errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock, 127 uint32_t usec, int flags)127 uint32_t usec, int flags) 128 128 { 129 129 errno_t rc; … … 162 162 */ 163 163 errno_t _condvar_wait_timeout_irq_spinlock(condvar_t *cv, irq_spinlock_t *irq_lock, 164 uint32_t usec, int flags)164 uint32_t usec, int flags) 165 165 { 166 166 errno_t rc; -
kernel/generic/src/syscall/copy.c
r47b2d7e3 r1433ecda 69 69 if (!KERNEL_ADDRESS_SPACE_SHADOWED) { 70 70 if (overlaps((uintptr_t) uspace_src, size, 71 KERNEL_ADDRESS_SPACE_START,72 KERNEL_ADDRESS_SPACE_END - KERNEL_ADDRESS_SPACE_START)) {71 KERNEL_ADDRESS_SPACE_START, 72 KERNEL_ADDRESS_SPACE_END - KERNEL_ADDRESS_SPACE_START)) { 73 73 /* 74 74 * The userspace source block conflicts with kernel address space. … … 120 120 if (!KERNEL_ADDRESS_SPACE_SHADOWED) { 121 121 if (overlaps((uintptr_t) uspace_dst, size, 122 KERNEL_ADDRESS_SPACE_START,123 KERNEL_ADDRESS_SPACE_END - KERNEL_ADDRESS_SPACE_START)) {122 KERNEL_ADDRESS_SPACE_START, 123 KERNEL_ADDRESS_SPACE_END - KERNEL_ADDRESS_SPACE_START)) { 124 124 /* 125 125 * The userspace destination block conflicts with kernel address space. -
kernel/generic/src/syscall/syscall.c
r47b2d7e3 r1433ecda 88 88 } else { 89 89 log(LF_OTHER, LVL_ERROR, 90 "Task %" PRIu64 ": Unknown syscall %#" PRIxn, TASK->taskid, id);90 "Task %" PRIu64 ": Unknown syscall %#" PRIxn, TASK->taskid, id); 91 91 task_kill_self(true); 92 92 }
Note:
See TracChangeset
for help on using the changeset viewer.
