mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
irqchip: irq-mips-gic: Provide function to map GIC user section
The GIC provides a "user-mode visible" section containing a mirror of the counter registers which can be mapped into user memory. This will be used by the VDSO time function implementations, so provide a function to map it in. When the GIC is not enabled in Kconfig a dummy inline version of this function is provided, along with "#define gic_present 0", so that we don't have to litter the VDSO code with ifdefs. [[email protected]: - Move mapping code to arch/mips/kernel/vdso.c and use a resource type to get the GIC usermode information - Avoid renaming function arguments and use __gic_base_addr to hold the base GIC address prior to ioremap.] [[email protected]: Fix up gic_get_usm_range() to compile and make inline again.] Signed-off-by: Alex Smith <[email protected]> Signed-off-by: Markos Chandras <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Jason Cooper <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Alex Smith <[email protected]> Cc: Markos Chandras <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: http://patchwork.linux-mips.org/patch/11281/ Signed-off-by: Ralf Baechle <[email protected]>
This commit is contained in:
parent
ebb5e78cc6
commit
c0a9f72c15
2 changed files with 31 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ struct gic_pcpu_mask {
|
|||
DECLARE_BITMAP(pcpu_mask, GIC_MAX_INTRS);
|
||||
};
|
||||
|
||||
static unsigned long __gic_base_addr;
|
||||
static void __iomem *gic_base;
|
||||
static struct gic_pcpu_mask pcpu_masks[NR_CPUS];
|
||||
static DEFINE_SPINLOCK(gic_lock);
|
||||
|
|
@ -301,6 +302,17 @@ int gic_get_c0_fdc_int(void)
|
|||
GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_FDC));
|
||||
}
|
||||
|
||||
int gic_get_usm_range(struct resource *gic_usm_res)
|
||||
{
|
||||
if (!gic_present)
|
||||
return -1;
|
||||
|
||||
gic_usm_res->start = __gic_base_addr + USM_VISIBLE_SECTION_OFS;
|
||||
gic_usm_res->end = gic_usm_res->start + (USM_VISIBLE_SECTION_SIZE - 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gic_handle_shared_int(bool chained)
|
||||
{
|
||||
unsigned int i, intr, virq, gic_reg_step = mips_cm_is64 ? 8 : 4;
|
||||
|
|
@ -798,6 +810,8 @@ static void __init __gic_init(unsigned long gic_base_addr,
|
|||
{
|
||||
unsigned int gicconfig;
|
||||
|
||||
__gic_base_addr = gic_base_addr;
|
||||
|
||||
gic_base = ioremap_nocache(gic_base_addr, gic_addrspace_size);
|
||||
|
||||
gicconfig = gic_read(GIC_REG(SHARED, GIC_SH_CONFIG));
|
||||
|
|
|
|||
Loading…
Reference in a new issue