mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
a1af347448
In order for ASID macro to be used as expression passed to inline asm as 'r' operand it needs to give 32 bit unsigned result, not unsigned 64bit expression. Otherwise when 64bit ASID is passed to inline assembler statement as 'r' operand (32bit) compiler behavior is not well specified. For example when __flush_tlb_mm function compiled in big endian case, and ASID is passed to tlb_op macro directly, 0 will be passed as 'mcr 15, 0, r4, cr8, cr3, {2}' argument in r4, unless ASID macro changed to produce 32 bit result. Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
38 lines
647 B
C
38 lines
647 B
C
#ifndef __ARM_MMU_H
|
|
#define __ARM_MMU_H
|
|
|
|
#ifdef CONFIG_MMU
|
|
|
|
typedef struct {
|
|
#ifdef CONFIG_CPU_HAS_ASID
|
|
atomic64_t id;
|
|
#else
|
|
int switch_pending;
|
|
#endif
|
|
unsigned int vmalloc_seq;
|
|
unsigned long sigpage;
|
|
} mm_context_t;
|
|
|
|
#ifdef CONFIG_CPU_HAS_ASID
|
|
#define ASID_BITS 8
|
|
#define ASID_MASK ((~0ULL) << ASID_BITS)
|
|
#define ASID(mm) ((unsigned int)((mm)->context.id.counter & ~ASID_MASK))
|
|
#else
|
|
#define ASID(mm) (0)
|
|
#endif
|
|
|
|
#else
|
|
|
|
/*
|
|
* From nommu.h:
|
|
* Copyright (C) 2002, David McCullough <davidm@snapgear.com>
|
|
* modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
|
|
*/
|
|
typedef struct {
|
|
unsigned long end_brk;
|
|
} mm_context_t;
|
|
|
|
#endif
|
|
|
|
#endif
|