Changeset 102 for trunk/hal/x86_64


Ignore:
Timestamp:
Jun 29, 2017, 4:55:50 PM (8 years ago)
Author:
max@…
Message:

update the new hal_get_cycles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_special.c

    r101 r102  
    2525#include <hal_register.h>
    2626#include <hal_internal.h>
     27
     28#include <core.h>
     29#include <thread.h>
    2730
    2831struct thread_s;
     
    7376}
    7477
    75 uint32_t hal_get_cycles()
     78uint64_t hal_get_cycles()
    7679{
    77         return (uint32_t)rdtsc(); // XXX will be fixed soon
     80        uint64_t cycles;
     81        core_t *core = CURRENT_THREAD->core;
     82
     83        /*
     84         * Put the value of the TSC everywhere
     85         */
     86        cycles = rdtsc();
     87        core->time_stamp = cycles;
     88        core->cycles = cycles;
     89
     90        return cycles;
    7891}
    7992
    80 struct thread_s * hal_get_current_thread()
     93struct thread_s *hal_get_current_thread()
    8194{
    8295        return curcpu()->ci_thr;
Note: See TracChangeset for help on using the changeset viewer.