Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0c91cff in mainline for kernel/arch/ppc32/src/ppc32.c


Ignore:
Timestamp:
2014-08-23T22:09:41Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
4cb938b
Parents:
c451d22
Message:

Use the actual clock-frequency when starting decrementer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ppc32/src/ppc32.c

    rc451d22 r0c91cff  
    4747#include <mm/page.h>
    4848#include <mm/km.h>
     49#include <time/clock.h>
    4950#include <abi/proc/uarg.h>
    5051#include <console/console.h>
     
    99100        interrupt_init();
    100101       
     102        ofw_tree_node_t *cpus_node;
     103        ofw_tree_node_t *cpu_node;
     104        ofw_tree_property_t *freq_prop;
     105
     106        cpus_node = ofw_tree_lookup("/cpus");
     107        if (!cpus_node)
     108                panic("Could not find cpus node.");
     109
     110        cpu_node = cpus_node->child;
     111        if (!cpu_node)
     112                panic("Could not find first cpu.");     
     113
     114        freq_prop = ofw_tree_getprop(cpu_node, "clock-frequency");
     115        if (!freq_prop)
     116                panic("Could not get frequency property.");
     117
     118        uint32_t freq;
     119        freq = *((uint32_t *) freq_prop->value);
     120
    101121        /* Start decrementer */
    102         start_decrementer();
     122        decrementer_start(freq / HZ);
    103123}
    104124
Note: See TracChangeset for help on using the changeset viewer.