Changeset 1433ecda in mainline for kernel/generic


Ignore:
Timestamp:
2018-04-04T15:42:37Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c4e1cc
Parents:
47b2d7e3
Message:

Fix cstyle: make ccheck-fix and commit only files where all the changes are good.

Location:
kernel/generic
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/avl.h

    r47b2d7e3 r1433ecda  
    5757typedef uint64_t avltree_key_t;
    5858
    59 typedef bool (* avltree_walker_t)(avltree_node_t *, void *);
     59typedef bool (*avltree_walker_t)(avltree_node_t *, void *);
    6060
    6161/** AVL tree node structure. */
    62 struct avltree_node
    63 {
     62struct avltree_node {
    6463        /**
    6564         * Pointer to the left descendant of this node.
     
    9291
    9392/** AVL tree structure. */
    94 struct avltree
    95 {
     93struct avltree {
    9694        /** AVL root node pointer */
    9795        struct avltree_node *root;
  • kernel/generic/include/adt/cht.h

    r47b2d7e3 r1433ecda  
    134134extern bool cht_create_simple(cht_t *h, cht_ops_t *op);
    135135extern 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);
    137137extern void cht_destroy(cht_t *h);
    138138extern void cht_destroy_unsafe(cht_t *h);
  • kernel/generic/include/bitops.h

    r47b2d7e3 r1433ecda  
    3939
    4040#ifdef __32_BITS__
    41         #define fnzb(arg)  fnzb32(arg)
     41#define fnzb(arg)  fnzb32(arg)
    4242#endif
    4343
    4444#ifdef __64_BITS__
    45         #define fnzb(arg)  fnzb64(arg)
     45#define fnzb(arg)  fnzb64(arg)
    4646#endif
    4747
  • kernel/generic/include/byteorder.h

    r47b2d7e3 r1433ecda  
    3939
    4040#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.
    4242#endif
    4343
  • kernel/generic/include/console/chardev.h

    r47b2d7e3 r1433ecda  
    5555typedef struct {
    5656        /** Read character directly from device, assume interrupts disabled. */
    57         wchar_t (* poll)(struct indev *);
     57        wchar_t (*poll)(struct indev *);
    5858
    5959        /** Signal out-of-band condition. */
    60         void (* signal)(struct indev *, indev_signal_t);
     60        void (*signal)(struct indev *, indev_signal_t);
    6161} indev_operations_t;
    6262
     
    8282typedef struct {
    8383        /** Write character to output. */
    84         void (* write)(struct outdev *, wchar_t);
     84        void (*write)(struct outdev *, wchar_t);
    8585
    8686        /** Redraw any previously cached characters. */
    87         void (* redraw)(struct outdev *);
     87        void (*redraw)(struct outdev *);
    8888
    8989        /** Scroll up in the device cache. */
    90         void (* scroll_up)(struct outdev *);
     90        void (*scroll_up)(struct outdev *);
    9191
    9292        /** Scroll down in the device cache. */
    93         void (* scroll_down)(struct outdev *);
     93        void (*scroll_down)(struct outdev *);
    9494} outdev_operations_t;
    9595
  • kernel/generic/include/console/kconsole.h

    r47b2d7e3 r1433ecda  
    8181        const char *description;
    8282        /** Function implementing the command. */
    83         int (* func)(cmd_arg_t *);
     83        int (*func)(cmd_arg_t *);
    8484        /** Number of arguments. */
    8585        size_t argc;
     
    8787        cmd_arg_t *argv;
    8888        /** Function for printing detailed help. */
    89         void (* help)(void);
     89        void (*help)(void);
    9090        /** Function for enumerating hints for arguments. */
    9191        hints_enum_func_t hints_enum;
  • kernel/generic/include/ddi/irq.h

    r47b2d7e3 r1433ecda  
    5757struct irq;
    5858
    59 typedef void (* irq_handler_t)(struct irq *);
     59typedef void (*irq_handler_t)(struct irq *);
    6060
    6161/** Type for function used to clear the interrupt. */
    62 typedef void (* cir_t)(void *, inr_t);
     62typedef void (*cir_t)(void *, inr_t);
    6363
    6464/** IPC notification config structure.
     
    114114        irq_trigger_t trigger;
    115115        /** Claim ownership of the IRQ. */
    116         irq_ownership_t (* claim)(struct irq *);
     116        irq_ownership_t (*claim)(struct irq *);
    117117        /** Handler for this IRQ and device. */
    118118        irq_handler_t handler;
  • kernel/generic/include/interrupt.h

    r47b2d7e3 r1433ecda  
    4747#include <arch/istate.h>
    4848
    49 typedef void (* iroutine_t)(unsigned int, istate_t *);
     49typedef void (*iroutine_t)(unsigned int, istate_t *);
    5050
    5151typedef struct {
  • kernel/generic/include/mm/as.h

    r47b2d7e3 r1433ecda  
    126126
    127127typedef 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 *);
    133133} as_operations_t;
    134134
     
    237237/** Address space area backend structure. */
    238238typedef 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 *);
    252252} mem_backend_t;
    253253
  • kernel/generic/include/panic.h

    r47b2d7e3 r1433ecda  
    6565
    6666extern void panic_common(panic_category_t, struct istate *, int,
    67     uintptr_t, const char *, ...) __attribute__ ((noreturn))
     67    uintptr_t, const char *, ...) __attribute__((noreturn))
    6868    _HELENOS_PRINTF_ATTRIBUTE(5, 6);
    6969
  • kernel/generic/include/synch/rcu.h

    r47b2d7e3 r1433ecda  
    113113extern void rcu_cpu_init(void);
    114114extern void rcu_kinit_init(void);
    115 extern void rcu_thread_init(struct thread*);
     115extern void rcu_thread_init(struct thread *);
    116116extern void rcu_thread_exiting(void);
    117117extern void rcu_after_thread_ran(void);
  • kernel/generic/include/time/timeout.h

    r47b2d7e3 r1433ecda  
    4040#include <stdint.h>
    4141
    42 typedef void (* timeout_handler_t)(void *arg);
     42typedef void (*timeout_handler_t)(void *arg);
    4343
    4444typedef struct {
  • kernel/generic/include/userspace.h

    r47b2d7e3 r1433ecda  
    4040
    4141/** Switch to user-space (CPU user priviledge level) */
    42 extern void userspace(uspace_arg_t *uarg) __attribute__ ((noreturn));
     42extern void userspace(uspace_arg_t *uarg) __attribute__((noreturn));
    4343
    4444#endif
  • kernel/generic/src/console/console.c

    r47b2d7e3 r1433ecda  
    6464
    6565/** Kernel log initialized */
    66 static atomic_t kio_inited = {false};
     66static atomic_t kio_inited = { false };
    6767
    6868/** First kernel log characters */
  • kernel/generic/src/cpu/cpu.c

    r47b2d7e3 r1433ecda  
    5959 *
    6060 */
    61 void cpu_init(void) {
     61void cpu_init(void)
     62{
    6263#ifdef CONFIG_SMP
    6364        if (config.cpu_active == 1) {
    6465#endif /* CONFIG_SMP */
    6566
    66                 cpus = (cpu_t *) malloc(sizeof(cpu_t) * config.cpu_count,
     67                cpus = (cpu_t *) malloc(sizeof(cpu_t) *config.cpu_count,
    6768                    FRAME_ATOMIC);
    6869                if (!cpus)
     
    7071
    7172                /* Initialize everything */
    72                 memsetb(cpus, sizeof(cpu_t) * config.cpu_count, 0);
     73                memsetb(cpus, sizeof(cpu_t) *config.cpu_count, 0);
    7374
    7475                size_t i;
  • kernel/generic/src/cpu/cpu_mask.c

    r47b2d7e3 r1433ecda  
    5757
    5858        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) {
    6161                /* Set all bits in the cell/word. */
    6262                cpus->mask[active_word] = -1;
  • kernel/generic/src/debug/symtab.c

    r47b2d7e3 r1433ecda  
    202202
    203203/** Symtab completion enum, see kernel/generic/include/kconsole.h */
    204 const char* symtab_hints_enum(const char *input, const char **help,
     204const char *symtab_hints_enum(const char *input, const char **help,
    205205    void **ctx)
    206206{
    207207#ifdef CONFIG_SYMTAB
    208208        size_t len = str_length(input);
    209         struct symtab_entry **entry = (struct symtab_entry**)ctx;
     209        struct symtab_entry **entry = (struct symtab_entry **)ctx;
    210210
    211211        if (*entry == NULL)
  • kernel/generic/src/lib/halt.c

    r47b2d7e3 r1433ecda  
    4444
    4545/** Halt flag */
    46 atomic_t haltstate = {0};
     46atomic_t haltstate = { 0 };
    4747
    4848/** Halt wrapper
  • kernel/generic/src/lib/str.c

    r47b2d7e3 r1433ecda  
    115115/** Check the condition if wchar_t is signed */
    116116#ifdef __WCHAR_UNSIGNED__
    117         #define WCHAR_SIGNED_CHECK(cond)  (true)
     117#define WCHAR_SIGNED_CHECK(cond)  (true)
    118118#else
    119         #define WCHAR_SIGNED_CHECK(cond)  (cond)
     119#define WCHAR_SIGNED_CHECK(cond)  (cond)
    120120#endif
    121121
  • kernel/generic/src/lib/str_error.c

    r47b2d7e3 r1433ecda  
    4747#define __errno_entry(name, num, desc) #name,
    4848
    49 static const char* err_name[] = {
     49static const char *err_name[] = {
    5050#include <abi/errno.in>
    5151};
     
    5454#define __errno_entry(name, num, desc) "[" #name "]" desc,
    5555
    56 static const char* err_desc[] = {
     56static const char *err_desc[] = {
    5757#include <abi/errno.in>
    5858};
  • kernel/generic/src/main/version.c

    r47b2d7e3 r1433ecda  
    4444
    4545#ifdef REVISION
    46         static const char *revision = ", revision " STRING(REVISION);
     46static const char *revision = ", revision " STRING(REVISION);
    4747#else
    48         static const char *revision = "";
     48static const char *revision = "";
    4949#endif
    5050
    5151#ifdef TIMESTAMP
    52         static const char *timestamp = " on " STRING(TIMESTAMP);
     52static const char *timestamp = " on " STRING(TIMESTAMP);
    5353#else
    54         static const char *timestamp = "";
     54static const char *timestamp = "";
    5555#endif
    5656
  • kernel/generic/src/smp/smp_call.c

    r47b2d7e3 r1433ecda  
    122122 */
    123123void 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)
    125125{
    126126        /*
     
    222222
    223223        /* 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) {
    226226
    227227                smp_call_t *call_info = list_get_instance(cur, smp_call_t, calls_link);
  • kernel/generic/src/synch/condvar.c

    r47b2d7e3 r1433ecda  
    125125 */
    126126errno_t _condvar_wait_timeout_spinlock_impl(condvar_t *cv, spinlock_t *lock,
    127         uint32_t usec, int flags)
     127    uint32_t usec, int flags)
    128128{
    129129        errno_t rc;
     
    162162 */
    163163errno_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)
    165165{
    166166        errno_t rc;
  • kernel/generic/src/syscall/copy.c

    r47b2d7e3 r1433ecda  
    6969        if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
    7070                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)) {
    7373                        /*
    7474                         * The userspace source block conflicts with kernel address space.
     
    120120        if (!KERNEL_ADDRESS_SPACE_SHADOWED) {
    121121                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)) {
    124124                        /*
    125125                         * The userspace destination block conflicts with kernel address space.
  • kernel/generic/src/syscall/syscall.c

    r47b2d7e3 r1433ecda  
    8888        } else {
    8989                log(LF_OTHER, LVL_ERROR,
    90                     "Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id);
     90                    "Task %" PRIu64 ": Unknown syscall %#" PRIxn, TASK->taskid, id);
    9191                task_kill_self(true);
    9292        }
Note: See TracChangeset for help on using the changeset viewer.