Changeset 1433ecda in mainline for kernel/arch/sparc64/src


Ignore:
Timestamp:
2018-04-04T15:42:37Z (7 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/arch/sparc64/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/cpu/sun4u/cpu.c

    r47b2d7e3 r1433ecda  
    9999                        int f;
    100100                        f = find_cpu_frequency(
    101                                 ofw_tree_find_child(node, "cpu@0"));
     101                            ofw_tree_find_child(node, "cpu@0"));
    102102                        if (f != -1)
    103103                                clock_frequency = (uint32_t) f;
    104104                        f = find_cpu_frequency(
    105                                 ofw_tree_find_child(node, "cpu@1"));
     105                            ofw_tree_find_child(node, "cpu@1"));
    106106                        if (f != -1)
    107107                                clock_frequency = (uint32_t) f;
     
    140140                break;
    141141        case MANUF_SUN:
    142                 manuf = "Sun";
     142                manuf = "Sun";
    143143                break;
    144144        default:
     
    184184
    185185        printf("cpu%d: manuf=%s, impl=%s, mask=%d (%d MHz)\n", m->id, manuf,
    186                 impl, m->arch.ver.mask, m->arch.clock_frequency / 1000000);
     186            impl, m->arch.ver.mask, m->arch.clock_frequency / 1000000);
    187187}
    188188
  • kernel/arch/sparc64/src/cpu/sun4v/cpu.c

    r47b2d7e3 r1433ecda  
    6666                        uint64_t clock_frequency = 0;
    6767                        md_get_integer_property(node, "clock-frequency",
    68                                 &clock_frequency);
     68                            &clock_frequency);
    6969                        CPU->arch.clock_frequency = clock_frequency;
    7070                        break;
  • kernel/arch/sparc64/src/debug/stacktrace.c

    r47b2d7e3 r1433ecda  
    9898}
    9999
    100 bool uspace_return_address_get(stack_trace_context_t *ctx , uintptr_t *ra)
     100bool uspace_return_address_get(stack_trace_context_t *ctx, uintptr_t *ra)
    101101{
    102102        return false;
  • kernel/arch/sparc64/src/drivers/niagara.c

    r47b2d7e3 r1433ecda  
    8282 * buffer definition follows.
    8383 */
    84 static volatile niagara_output_buffer_t __attribute__ ((aligned(PAGE_SIZE)))
     84static volatile niagara_output_buffer_t __attribute__((aligned(PAGE_SIZE)))
    8585    output_buffer;
    8686
     
    9090 * Analogous to the output_buffer, see the previous definition.
    9191 */
    92 static volatile niagara_input_buffer_t __attribute__ ((aligned(PAGE_SIZE)))
     92static volatile niagara_input_buffer_t __attribute__((aligned(PAGE_SIZE)))
    9393    input_buffer;
    9494
     
    9696
    9797/** Write a single character to the standard output. */
    98 static inline void do_putchar(const char c) {
     98static inline void do_putchar(const char c)
     99{
    99100        /* Repeat until the buffer is non-full */
    100         while (__hypercall_fast1(CONS_PUTCHAR, c) == HV_EWOULDBLOCK);
     101        while (__hypercall_fast1(CONS_PUTCHAR, c) == HV_EWOULDBLOCK)
     102                ;
    101103}
    102104
     
    160162 *
    161163 */
    162 static void kniagarapoll(void *arg) {
     164static void kniagarapoll(void *arg)
     165{
    163166        while (true) {
    164167                niagara_poll();
     
    213216            PAGE_SIZE);
    214217        sysinfo_set_item_val("niagara.inbuf.datasize", NULL,
    215            INPUT_BUFFER_SIZE);
     218            INPUT_BUFFER_SIZE);
    216219
    217220        outbuf_parea.pbase = (uintptr_t) (KA2PA(&output_buffer));
  • kernel/arch/sparc64/src/drivers/tick.c

    r47b2d7e3 r1433ecda  
    5454        compare.int_dis = false;
    5555        compare.tick_cmpr = tick_counter_read() +
    56                 CPU->arch.clock_frequency / HZ;
     56            CPU->arch.clock_frequency / HZ;
    5757        CPU->arch.next_tick_cmpr = compare.tick_cmpr;
    5858        tick_compare_write(compare.value);
  • kernel/arch/sparc64/src/mm/sun4v/tlb.c

    r47b2d7e3 r1433ecda  
    103103        "unaligned access",
    104104        "invalid page size"
    105         };
     105};
    106106
    107107/** Array of MMU fault status areas. */
     
    146146        if (locked) {
    147147                __hypercall_fast4(
    148                         MMU_MAP_PERM_ADDR, page, 0, data.value, MMU_FLAG_DTLB);
     148                    MMU_MAP_PERM_ADDR, page, 0, data.value, MMU_FLAG_DTLB);
    149149        } else {
    150150                __hypercall_hyperfast(
    151                         page, ASID_KERNEL, data.value, MMU_FLAG_DTLB, 0,
    152                         MMU_MAP_ADDR);
     151                    page, ASID_KERNEL, data.value, MMU_FLAG_DTLB, 0,
     152                    MMU_MAP_ADDR);
    153153        }
    154154}
     
    180180
    181181        __hypercall_hyperfast(
    182                 t->page, t->as->asid, data.value, MMU_FLAG_DTLB, 0, MMU_MAP_ADDR);
     182            t->page, t->as->asid, data.value, MMU_FLAG_DTLB, 0, MMU_MAP_ADDR);
    183183}
    184184
     
    205205
    206206        __hypercall_hyperfast(
    207                 t->page, t->as->asid, data.value, MMU_FLAG_ITLB, 0, MMU_MAP_ADDR);
     207            t->page, t->as->asid, data.value, MMU_FLAG_ITLB, 0, MMU_MAP_ADDR);
    208208}
    209209
     
    349349
    350350        printf("condition which caused the fault: %s\n",
    351                 fault_types[mmu_fsas[myid].dft]);
     351            fault_types[mmu_fsas[myid].dft]);
    352352}
    353353
     
    356356{
    357357        uint64_t errno =  __hypercall_fast3(MMU_DEMAP_ALL, 0, 0,
    358                 MMU_FLAG_DTLB | MMU_FLAG_ITLB);
     358            MMU_FLAG_DTLB | MMU_FLAG_ITLB);
    359359        if (errno != HV_EOK)
    360360                panic("Error code = %" PRIu64 ".\n", errno);
     
    372372
    373373        __hypercall_fast4(MMU_DEMAP_CTX, 0, 0, asid,
    374                 MMU_FLAG_ITLB | MMU_FLAG_DTLB);
     374            MMU_FLAG_ITLB | MMU_FLAG_DTLB);
    375375
    376376        nucleus_leave();
  • kernel/arch/sparc64/src/proc/thread.c

    r47b2d7e3 r1433ecda  
    6464void thread_create_arch(thread_t *t)
    6565{
    66         if ((t->uspace) && (!t->arch.uspace_window_buffer))
    67                 {
     66        if ((t->uspace) && (!t->arch.uspace_window_buffer)) {
    6867                /*
    6968                 * The thread needs userspace window buffer and the object
  • kernel/arch/sparc64/src/smp/sun4u/ipi.c

    r47b2d7e3 r1433ecda  
    5959 * @param func value the first data item of the vector will be set to
    6060 */
    61 static inline void set_intr_w_data(void (* func)(void))
     61static inline void set_intr_w_data(void (*func)(void))
    6262{
    6363#if defined (US)
     
    8787 * @param func Function to be invoked.
    8888 */
    89 static void cross_call(int mid, void (* func)(void))
     89static void cross_call(int mid, void (*func)(void))
    9090{
    9191        uint64_t status;
     
    148148        unsigned int i;
    149149
    150         void (* func)(void);
     150        void (*func)(void);
    151151
    152152        switch (ipi) {
  • kernel/arch/sparc64/src/smp/sun4u/smp.c

    r47b2d7e3 r1433ecda  
    121121                node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu");
    122122                for (i = 0; node;
    123                      node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++)
     123                    node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++)
    124124                        wakeup_cpu(node);
    125125        } else if (is_us_iv()) {
  • kernel/arch/sparc64/src/smp/sun4v/ipi.c

    r47b2d7e3 r1433ecda  
    4545
    4646static uint64_t data[MAX_NUM_STRANDS][IPI_MESSAGE_SIZE]
    47         __attribute__ ((aligned (64)));
     47    __attribute__((aligned(64)));
    4848
    4949static uint16_t ipi_cpu_list[MAX_NUM_STRANDS][MAX_NUM_STRANDS];
     
    6060 */
    6161uint64_t ipi_brodcast_to(void (*func)(void), uint16_t cpu_list[MAX_NUM_STRANDS],
    62                 uint64_t list_size) {
     62    uint64_t list_size)
     63{
    6364
    6465        data[CPU->arch.id][0] = (uint64_t) func;
     
    7071
    7172        return __hypercall_fast3(CPU_MONDO_SEND, list_size,
    72                 KA2PA(ipi_cpu_list[CPU->arch.id]), KA2PA(data[CPU->arch.id]));
     73            KA2PA(ipi_cpu_list[CPU->arch.id]), KA2PA(data[CPU->arch.id]));
    7374}
    7475
     
    8182 * @return              error code returned by the CPU_MONDO_SEND hypercall
    8283 */
    83 uint64_t ipi_unicast_to(void (*func)(void), uint16_t cpu_id) {
     84uint64_t ipi_unicast_to(void (*func)(void), uint16_t cpu_id)
     85{
    8486        ipi_cpu_list[CPU->arch.id][0] = cpu_id;
    8587        return ipi_brodcast_to(func, ipi_cpu_list[CPU->arch.id], 1);
     
    9597void ipi_broadcast_arch(int ipi)
    9698{
    97         void (* func)(void);
     99        void (*func)(void);
    98100
    99101        switch (ipi) {
  • kernel/arch/sparc64/src/smp/sun4v/smp.c

    r47b2d7e3 r1433ecda  
    8888 * stored to the proposed_nrdy variable of the cpu_arch_t struture.
    8989 */
    90 bool calculate_optimal_nrdy(exec_unit_t *exec_unit) {
     90bool calculate_optimal_nrdy(exec_unit_t *exec_unit)
     91{
    9192
    9293        /* calculate the number of threads the core will steal */
     
    103104        for (k = 0; k < exec_unit->strand_count; k++) {
    104105                exec_units->cpus[k]->arch.proposed_nrdy =
    105                         atomic_get(&(exec_unit->cpus[k]->nrdy));
     106                    atomic_get(&(exec_unit->cpus[k]->nrdy));
    106107        }
    107108
     
    112113                unsigned int least_busy = 0;
    113114                unsigned int least_busy_nrdy =
    114                         exec_unit->cpus[0]->arch.proposed_nrdy;
     115                    exec_unit->cpus[0]->arch.proposed_nrdy;
    115116
    116117                /* for each stolen thread, give it to the least busy CPU */
    117118                for (k = 0; k < exec_unit->strand_count; k++) {
    118                         if (exec_unit->cpus[k]->arch.proposed_nrdy
    119                                         < least_busy_nrdy) {
     119                        if (exec_unit->cpus[k]->arch.proposed_nrdy < least_busy_nrdy) {
    120120                                least_busy = k;
    121121                                least_busy_nrdy =
    122                                         exec_unit->cpus[k]->arch.proposed_nrdy;
     122                                    exec_unit->cpus[k]->arch.proposed_nrdy;
    123123                        }
    124124                }
     
    247247                        exec_units[i].strand_count++;
    248248                        max_core_strands =
    249                                 exec_units[i].strand_count > max_core_strands ?
    250                                 exec_units[i].strand_count : max_core_strands;
     249                            exec_units[i].strand_count > max_core_strands ?
     250                            exec_units[i].strand_count : max_core_strands;
    251251
    252252                /* detecting execution unit failed */
  • kernel/arch/sparc64/src/sun4u/sparc64.c

    r47b2d7e3 r1433ecda  
    169169
    170170        /* Not reached */
    171         while (1);
     171        while (1)
     172                ;
    172173}
    173174
     
    175176{
    176177        // TODO
    177         while (1);
     178        while (1)
     179                ;
    178180}
    179181
  • kernel/arch/sparc64/src/sun4v/sparc64.c

    r47b2d7e3 r1433ecda  
    167167
    168168        /* Not reached */
    169         while (1);
     169        while (1)
     170                ;
    170171}
    171172
     
    173174{
    174175        // TODO
    175         while (1);
     176        while (1)
     177                ;
    176178}
    177179
  • kernel/arch/sparc64/src/trap/sun4v/interrupt.c

    r47b2d7e3 r1433ecda  
    7474 */
    7575uint64_t cpu_mondo_queues[MAX_NUM_STRANDS][CPU_MONDO_QUEUE_SIZE]
    76         __attribute__((aligned(
    77         CPU_MONDO_QUEUE_SIZE * sizeof(uint64_t))));
     76    __attribute__((aligned(CPU_MONDO_QUEUE_SIZE * sizeof(uint64_t))));
    7877
    7978/**
     
    8382{
    8483        if (__hypercall_fast3(
    85                 CPU_QCONF,
    86                 CPU_MONDO_QUEUE_ID,
    87                 KA2PA(cpu_mondo_queues[CPU->id]),
    88                 CPU_MONDO_NENTRIES) != HV_EOK)
    89                         panic("Initializing mondo queue failed on CPU %" PRIu64 ".\n",
    90                             CPU->arch.id);
     84            CPU_QCONF,
     85            CPU_MONDO_QUEUE_ID,
     86            KA2PA(cpu_mondo_queues[CPU->id]),
     87            CPU_MONDO_NENTRIES) != HV_EOK)
     88                panic("Initializing mondo queue failed on CPU %" PRIu64 ".\n",
     89                    CPU->arch.id);
    9190}
    9291
Note: See TracChangeset for help on using the changeset viewer.