Ignore:
Timestamp:
2006-09-12T13:03:55Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6eabb6e6
Parents:
7bb6b06
Message:

sparc64 work:

  • find a CPU node and read its clock_frequency attribute
  • implement asm_delay_loop()
  • set TICK_COMPARE register according to processor frequency
  • small improvements at random places

OpenFirmware work:

  • two new functions for walking the device tree

Generic boot loader work:

  • added basic string functions

Usual pile of indentation and formatting fixes.

File:
1 edited

Legend:

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

    r7bb6b06 r9a5b556  
    3737#include <arch/asm.h>
    3838#include <arch/register.h>
     39#include <typedefs.h>
     40#include <arch/cpu.h>
     41#include <arch/boot/boot.h>
     42#include <time/clock.h>
     43#include <arch.h>
    3944#include <debug.h>
    40 #include <time/clock.h>
    41 #include <typedefs.h>
     45
     46#define TICK_RESTART_TIME       50      /* Worst case estimate. */
    4247
    4348/** Initialize tick interrupt. */
     
    4853        interrupt_register(14, "tick_int", tick_interrupt);
    4954        compare.int_dis = false;
    50         compare.tick_cmpr = TICK_DELTA;
     55        compare.tick_cmpr = bootinfo.processor.clock_frequency/HZ;
    5156        tick_compare_write(compare.value);
    5257        tick_write(0);
     
    6166{
    6267        softint_reg_t softint, clear;
     68        uint64_t next, compare, start, stop;
    6369       
    6470        softint.value = softint_read();
     
    8490         * Restart counter.
    8591         */
    86         tick_write(0);
     92        compare = CPU->arch.clock_frequency/HZ;
     93        start = tick_read();
     94        next = start - compare;
     95        while (next >= compare - TICK_RESTART_TIME) {
     96                next -= compare;
     97                CPU->missed_clock_ticks++;
     98        }
     99        stop = tick_read();
     100        tick_write(next + (stop - start));
    87101       
    88102        clock();
Note: See TracChangeset for help on using the changeset viewer.