Changeset 9a037da9 in rtems for c/src/lib/libcpu/arm


Ignore:
Timestamp:
Jun 19, 2013, 9:20:06 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
cddb8f4
Parents:
45fecbb6
git-author:
Sebastian Huber <sebastian.huber@…> (06/19/13 09:20:06)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/20/13 08:15:10)
Message:

bsps/arm: Set vector base address if necessary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/arm/shared/include/arm-cp15.h

    r45fecbb6 r9a037da9  
    900900}
    901901
     902/* ID_PFR1, Processor Feature Register 1 */
     903
     904static inline uint32_t arm_cp15_get_processor_feature_1(void)
     905{
     906  ARM_SWITCH_REGISTERS;
     907  uint32_t val;
     908
     909  __asm__ volatile (
     910    ARM_SWITCH_TO_ARM
     911    "mrc p15, 0, %[val], c0, c1, 1\n"
     912    ARM_SWITCH_BACK
     913    : [val] "=&r" (val) ARM_SWITCH_ADDITIONAL_OUTPUT
     914  );
     915
     916  return val;
     917}
     918
     919/* VBAR, Vector Base Address Register, Security Extensions */
     920
     921static inline void *arm_cp15_get_vector_base_address(void)
     922{
     923  ARM_SWITCH_REGISTERS;
     924  void *base;
     925
     926  __asm__ volatile (
     927    ARM_SWITCH_TO_ARM
     928    "mrc p15, 0, %[base], c12, c0, 0\n"
     929    ARM_SWITCH_BACK
     930    : [base] "=&r" (base) ARM_SWITCH_ADDITIONAL_OUTPUT
     931  );
     932
     933  return base;
     934}
     935
     936static inline void arm_cp15_set_vector_base_address(void *base)
     937{
     938  ARM_SWITCH_REGISTERS;
     939
     940  __asm__ volatile (
     941    ARM_SWITCH_TO_ARM
     942    "mcr p15, 0, %[base], c12, c0, 0\n"
     943    ARM_SWITCH_BACK
     944    : ARM_SWITCH_OUTPUT
     945    : [base] "r" (base)
     946  );
     947}
     948
    902949/**
    903950 * @brief Sets the @a section_flags for the address range [@a begin, @a end).
Note: See TracChangeset for help on using the changeset viewer.