Ignore:
Timestamp:
May 31, 2013, 11:59:47 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
94c17af
Parents:
f2f211c5
git-author:
Sebastian Huber <sebastian.huber@…> (05/31/13 11:59:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/31/13 13:20:33)
Message:

bsps/arm: Add SMP support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/shared/include/arm-gic-irq.h

    rf2f211c5 rdb42c079  
    1616#define LIBBSP_ARM_SHARED_ARM_GIC_IRQ_H
    1717
    18 #include <rtems.h>
     18#include <bsp.h>
     19#include <bsp/arm-gic.h>
    1920
    2021#ifdef __cplusplus
     
    3839#define ARM_GIC_IRQ_SGI_15 15
    3940
     41#define ARM_GIC_DIST ((volatile gic_dist *) BSP_ARM_GIC_DIST_BASE)
     42
    4043rtems_status_code arm_gic_irq_set_priority(
    4144  rtems_vector_number vector,
     
    5457} arm_gic_irq_software_irq_target_filter;
    5558
    56 rtems_status_code arm_gic_irq_generate_software_irq(
     59static inline rtems_status_code arm_gic_irq_generate_software_irq(
    5760  rtems_vector_number vector,
    5861  arm_gic_irq_software_irq_target_filter filter,
    5962  uint8_t targets
    60 );
     63)
     64{
     65  rtems_status_code sc = RTEMS_SUCCESSFUL;
     66
     67  if (vector <= ARM_GIC_IRQ_SGI_15) {
     68    volatile gic_dist *dist = ARM_GIC_DIST;
     69
     70    dist->icdsgir = GIC_DIST_ICDSGIR_TARGET_LIST_FILTER(filter)
     71      | GIC_DIST_ICDSGIR_CPU_TARGET_LIST(targets)
     72      | GIC_DIST_ICDSGIR_SGIINTID(vector);
     73  } else {
     74    sc = RTEMS_INVALID_ID;
     75  }
     76
     77  return sc;
     78}
     79
     80static inline uint32_t arm_gic_irq_processor_count(void)
     81{
     82  volatile gic_dist *dist = ARM_GIC_DIST;
     83
     84  return GIC_DIST_ICDICTR_CPU_NUMBER_GET(dist->icdictr) + 1;
     85}
     86
     87void arm_gic_irq_initialize_secondary_cpu(void);
    6188
    6289#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.