Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6593dde authored by Paul Burton's avatar Paul Burton Committed by Ralf Baechle
Browse files

MIPS: Add accessor & bit definitions for GlobalNumber



MIPSr6 introduces a GlobalNumber register, which is required when VPs
are implemented (ie. when multi-threading is supported) but otherwise
optional. The register contains sufficient information to uniquely
identify a VP within a system using its cluster number, core number & VP
ID.

In preparation for using this register & its fields, introduce an
accessor macro for it & define its various bits with the typical style
preprocessor macros.

Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17007/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 23cb600e
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,7 @@
#define CP0_ENTRYLO0 $2
#define CP0_ENTRYLO0 $2
#define CP0_ENTRYLO1 $3
#define CP0_ENTRYLO1 $3
#define CP0_CONF $3
#define CP0_CONF $3
#define CP0_GLOBALNUMBER $3, 1
#define CP0_CONTEXT $4
#define CP0_CONTEXT $4
#define CP0_PAGEMASK $5
#define CP0_PAGEMASK $5
#define CP0_SEGCTL0 $5, 2
#define CP0_SEGCTL0 $5, 2
@@ -147,6 +148,16 @@
#define MIPS_ENTRYLO_XI		(_ULCAST_(1) << (BITS_PER_LONG - 2))
#define MIPS_ENTRYLO_XI		(_ULCAST_(1) << (BITS_PER_LONG - 2))
#define MIPS_ENTRYLO_RI		(_ULCAST_(1) << (BITS_PER_LONG - 1))
#define MIPS_ENTRYLO_RI		(_ULCAST_(1) << (BITS_PER_LONG - 1))


/*
 * MIPSr6+ GlobalNumber register definitions
 */
#define MIPS_GLOBALNUMBER_VP_SHF	0
#define MIPS_GLOBALNUMBER_VP		(_ULCAST_(0xff) << MIPS_GLOBALNUMBER_VP_SHF)
#define MIPS_GLOBALNUMBER_CORE_SHF	8
#define MIPS_GLOBALNUMBER_CORE		(_ULCAST_(0xff) << MIPS_GLOBALNUMBER_CORE_SHF)
#define MIPS_GLOBALNUMBER_CLUSTER_SHF	16
#define MIPS_GLOBALNUMBER_CLUSTER	(_ULCAST_(0xf) << MIPS_GLOBALNUMBER_CLUSTER_SHF)

/*
/*
 * Values for PageMask register
 * Values for PageMask register
 */
 */
@@ -1446,6 +1457,8 @@ do { \
#define read_c0_conf()		__read_32bit_c0_register($3, 0)
#define read_c0_conf()		__read_32bit_c0_register($3, 0)
#define write_c0_conf(val)	__write_32bit_c0_register($3, 0, val)
#define write_c0_conf(val)	__write_32bit_c0_register($3, 0, val)


#define read_c0_globalnumber()	__read_32bit_c0_register($3, 1)

#define read_c0_context()	__read_ulong_c0_register($4, 0)
#define read_c0_context()	__read_ulong_c0_register($4, 0)
#define write_c0_context(val)	__write_ulong_c0_register($4, 0, val)
#define write_c0_context(val)	__write_ulong_c0_register($4, 0, val)