Ignore:
Timestamp:
2009-11-06T16:59:40Z (14 years ago)
Author:
Pavel Rimsky <pavel@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74cbac7d
Parents:
66e08d02
Message:

TLB & CPU init implemented, now the code reaches creation of the first thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/drivers/tick.c

    r66e08d02 rb4655da  
    5454        interrupt_register(14, "tick_int", tick_interrupt);
    5555        compare.int_dis = false;
    56         compare.tick_cmpr = CPU->arch.clock_frequency / HZ;
     56        compare.tick_cmpr = tick_counter_read() +
     57                CPU->arch.clock_frequency / HZ;
    5758        CPU->arch.next_tick_cmpr = compare.tick_cmpr;
    5859        tick_compare_write(compare.value);
    59         tick_write(0);
    6060
    61 #if defined (US3)
     61#if defined (US3) || defined (SUN4V)
    6262        /* disable STICK interrupts and clear any pending ones */
    6363        tick_compare_reg_t stick_compare;
     
    111111         * overflow only in 146 years.
    112112         */
    113         drift = tick_read() - CPU->arch.next_tick_cmpr;
     113        drift = tick_counter_read() - CPU->arch.next_tick_cmpr;
    114114        while (drift > CPU->arch.clock_frequency / HZ) {
    115115                drift -= CPU->arch.clock_frequency / HZ;
    116116                CPU->missed_clock_ticks++;
    117117        }
    118         CPU->arch.next_tick_cmpr = tick_read() +
     118        CPU->arch.next_tick_cmpr = tick_counter_read() +
    119119            (CPU->arch.clock_frequency / HZ) - drift;
    120120        tick_compare_write(CPU->arch.next_tick_cmpr);
Note: See TracChangeset for help on using the changeset viewer.