forked from Imagelibrary/rtems
score: Use <sys/bitset.h> for Processor_mask
Implement the Processor_mask via <sys/bitset.h>. Provide _Processor_mask_To_uint32_t() to enable its use in device specific routines, e.g. interrupt affinity register in an interrupt controller. Update #3059.
This commit is contained in:
@@ -133,7 +133,10 @@ static void qoriq_clock_cleanup(void)
|
||||
qoriq_clock_handler_install(&old_isr)
|
||||
|
||||
#define Clock_driver_support_set_interrupt_affinity(online_processors) \
|
||||
qoriq_pic_set_affinities(CLOCK_INTERRUPT, online_processors[0])
|
||||
qoriq_pic_set_affinities( \
|
||||
CLOCK_INTERRUPT, \
|
||||
_Processor_mask_To_uint32_t(online_processors, 0) \
|
||||
)
|
||||
|
||||
#define Clock_driver_support_shutdown_hardware() \
|
||||
qoriq_clock_cleanup()
|
||||
|
||||
@@ -99,7 +99,8 @@ static void restart_interrupt(void *arg)
|
||||
|
||||
static void raise_restart_interrupt(void)
|
||||
{
|
||||
qoriq.pic.ipidr[RESTART_IPI_INDEX].reg = _SMP_Online_processors[0];
|
||||
qoriq.pic.ipidr[RESTART_IPI_INDEX].reg =
|
||||
_Processor_mask_To_uint32_t(&_SMP_Online_processors, 0);
|
||||
ppc_synchronize_data();
|
||||
ppc_synchronize_instructions();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ static void Clock_driver_timecounter_tick( void )
|
||||
|
||||
if ( _Per_CPU_Is_boot_processor( cpu ) ) {
|
||||
rtems_timecounter_tick();
|
||||
} else if ( _Processor_mask_Is_set( _SMP_Online_processors, cpu_index ) ) {
|
||||
} else if ( _Processor_mask_Is_set( &_SMP_Online_processors, cpu_index ) ) {
|
||||
_Watchdog_Tick( cpu );
|
||||
}
|
||||
}
|
||||
@@ -227,7 +227,7 @@ rtems_device_driver Clock_initialize(
|
||||
Clock_driver_support_install_isr( Clock_isr, Old_ticker );
|
||||
|
||||
#ifdef RTEMS_SMP
|
||||
Clock_driver_support_set_interrupt_affinity( _SMP_Online_processors );
|
||||
Clock_driver_support_set_interrupt_affinity( &_SMP_Online_processors );
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -59,7 +59,7 @@ void ambapp_dev_info(struct drvmgr_dev *, void (*print)(void *p, char *str), voi
|
||||
int ambapp_int_set_affinity(
|
||||
struct drvmgr_dev *dev,
|
||||
int index,
|
||||
Processor_mask cpus);
|
||||
const Processor_mask *cpus);
|
||||
#endif
|
||||
|
||||
struct drvmgr_bus_ops ambapp_bus_ops =
|
||||
|
||||
@@ -50,7 +50,7 @@ int ambapp_grlib_int_unmask(
|
||||
int ambapp_grlib_int_set_affinity(
|
||||
struct drvmgr_dev *dev,
|
||||
int irq,
|
||||
Processor_mask cpus);
|
||||
const Processor_mask *cpus);
|
||||
#endif
|
||||
int ambapp_grlib_get_params(
|
||||
struct drvmgr_dev *dev,
|
||||
@@ -233,7 +233,7 @@ int ambapp_grlib_int_set_affinity
|
||||
(
|
||||
struct drvmgr_dev *dev,
|
||||
int irq,
|
||||
Processor_mask cpus
|
||||
const Processor_mask *cpus
|
||||
)
|
||||
{
|
||||
uint32_t cpu_count = rtems_get_processor_count();
|
||||
|
||||
@@ -91,7 +91,7 @@ struct ambapp_ops {
|
||||
int (*int_unmask)(struct drvmgr_dev *dev, int index);
|
||||
#ifdef RTEMS_SMP
|
||||
int (*int_set_affinity)(struct drvmgr_dev *dev, int index,
|
||||
Processor_mask cpus);
|
||||
const Processor_mask *cpus);
|
||||
#endif
|
||||
int (*get_params)
|
||||
(struct drvmgr_dev *, struct drvmgr_bus_params *);
|
||||
|
||||
Reference in New Issue
Block a user