Changeset bc731313 in rtems


Ignore:
Timestamp:
Aug 13, 2018, 10:55:34 AM (16 months ago)
Author:
Amaan Cheval <amaan.cheval@…>
Branches:
master
Children:
adbd7e7
Parents:
6869321
git-author:
Amaan Cheval <amaan.cheval@…> (08/13/18 10:55:34)
git-committer:
Joel Sherrill <joel@…> (08/13/18 15:48:20)
Message:

bsps/x86_64: Add APIC timer based clock driver

The APIC timer is calibrated by running the i8254 PIT for a fraction of a
second (determined by PIT_CALIBRATE_DIVIDER) and counting how many times the
APIC counter has ticked. The calibration can be run multiple times (determined
by APIC_TIMER_NUM_CALIBRATIONS) and averaged out.

Updates #2898.

Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • bsps/x86_64/amd64/headers.am

    r6869321 rbc731313  
    22
    33include_HEADERS =
     4include_HEADERS += ../../../../../../bsps/x86_64/amd64/include/apic.h
    45include_HEADERS += ../../../../../../bsps/x86_64/amd64/include/bsp.h
    56include_HEADERS += include/bspopts.h
     7include_HEADERS += ../../../../../../bsps/x86_64/amd64/include/clock.h
     8include_HEADERS += ../../../../../../bsps/x86_64/amd64/include/pic.h
    69include_HEADERS += ../../../../../../bsps/x86_64/amd64/include/start.h
    710include_HEADERS += ../../../../../../bsps/x86_64/amd64/include/tm27.h
  • c/src/lib/libbsp/x86_64/amd64/Makefile.am

    r6869321 rbc731313  
    2828librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
    2929librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
     30# interrupts
     31librtemsbsp_a_SOURCES += ../../../../../../bsps/x86_64/amd64/interrupts/pic.c
    3032librtemsbsp_a_SOURCES += ../../../../../../bsps/x86_64/amd64/interrupts/idt.c
    3133librtemsbsp_a_SOURCES += ../../../../../../bsps/x86_64/amd64/interrupts/isr_handler.S
    3234librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default-handler.c
    3335# clock
    34 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/clock/clock-simidle.c
     36librtemsbsp_a_SOURCES += ../../../../../../bsps/x86_64/amd64/clock/clock.c
    3537# console
    3638librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios-init.c
  • cpukit/score/cpu/x86_64/include/rtems/score/cpu_asm.h

    r6869321 rbc731313  
    6868}
    6969
     70RTEMS_INLINE_ROUTINE uint64_t rdmsr(uint32_t msr)
     71{
     72  uint32_t low, high;
     73  __asm__ volatile ( "rdmsr" :
     74                     "=a" (low), "=d" (high) :
     75                     "c" (msr) );
     76   return low | (uint64_t) high << 32;
     77}
     78
     79RTEMS_INLINE_ROUTINE void wrmsr(uint32_t msr, uint32_t low, uint32_t high)
     80{
     81  __asm__ volatile ( "wrmsr" : :
     82                     "a" (low), "d" (high), "c" (msr) );
     83}
     84
    7085RTEMS_INLINE_ROUTINE void amd64_enable_interrupts(void)
    7186{
     
    7792  __asm__ volatile ( "cli" );
    7893}
     94
     95RTEMS_INLINE_ROUTINE void stub_io_wait(void)
     96{
     97  /* XXX: This likely won't be required on any modern boards, but this function
     98   * exists so it's easier to find all the places it may be used.
     99   */
     100}
     101
    79102#endif /* !ASM */
    80103
Note: See TracChangeset for help on using the changeset viewer.