aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mipsregs.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/include/asm/mipsregs.h')
-rw-r--r--arch/mips/include/asm/mipsregs.h38
1 files changed, 26 insertions, 12 deletions
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 526f327475ce..32ef8bec5c85 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -184,12 +184,19 @@
184#else 184#else
185 185
186#define PM_4K 0x00000000 186#define PM_4K 0x00000000
187#define PM_8K 0x00002000
187#define PM_16K 0x00006000 188#define PM_16K 0x00006000
189#define PM_32K 0x0000e000
188#define PM_64K 0x0001e000 190#define PM_64K 0x0001e000
191#define PM_128K 0x0003e000
189#define PM_256K 0x0007e000 192#define PM_256K 0x0007e000
193#define PM_512K 0x000fe000
190#define PM_1M 0x001fe000 194#define PM_1M 0x001fe000
195#define PM_2M 0x003fe000
191#define PM_4M 0x007fe000 196#define PM_4M 0x007fe000
197#define PM_8M 0x00ffe000
192#define PM_16M 0x01ffe000 198#define PM_16M 0x01ffe000
199#define PM_32M 0x03ffe000
193#define PM_64M 0x07ffe000 200#define PM_64M 0x07ffe000
194#define PM_256M 0x1fffe000 201#define PM_256M 0x1fffe000
195#define PM_1G 0x7fffe000 202#define PM_1G 0x7fffe000
@@ -201,8 +208,12 @@
201 */ 208 */
202#ifdef CONFIG_PAGE_SIZE_4KB 209#ifdef CONFIG_PAGE_SIZE_4KB
203#define PM_DEFAULT_MASK PM_4K 210#define PM_DEFAULT_MASK PM_4K
211#elif defined(CONFIG_PAGE_SIZE_8KB)
212#define PM_DEFAULT_MASK PM_8K
204#elif defined(CONFIG_PAGE_SIZE_16KB) 213#elif defined(CONFIG_PAGE_SIZE_16KB)
205#define PM_DEFAULT_MASK PM_16K 214#define PM_DEFAULT_MASK PM_16K
215#elif defined(CONFIG_PAGE_SIZE_32KB)
216#define PM_DEFAULT_MASK PM_32K
206#elif defined(CONFIG_PAGE_SIZE_64KB) 217#elif defined(CONFIG_PAGE_SIZE_64KB)
207#define PM_DEFAULT_MASK PM_64K 218#define PM_DEFAULT_MASK PM_64K
208#else 219#else
@@ -717,8 +728,8 @@ do { \
717 ".set\tmips64\n\t" \ 728 ".set\tmips64\n\t" \
718 "dmfc0\t%M0, " #source "\n\t" \ 729 "dmfc0\t%M0, " #source "\n\t" \
719 "dsll\t%L0, %M0, 32\n\t" \ 730 "dsll\t%L0, %M0, 32\n\t" \
720 "dsrl\t%M0, %M0, 32\n\t" \ 731 "dsra\t%M0, %M0, 32\n\t" \
721 "dsrl\t%L0, %L0, 32\n\t" \ 732 "dsra\t%L0, %L0, 32\n\t" \
722 ".set\tmips0" \ 733 ".set\tmips0" \
723 : "=r" (__val)); \ 734 : "=r" (__val)); \
724 else \ 735 else \
@@ -726,8 +737,8 @@ do { \
726 ".set\tmips64\n\t" \ 737 ".set\tmips64\n\t" \
727 "dmfc0\t%M0, " #source ", " #sel "\n\t" \ 738 "dmfc0\t%M0, " #source ", " #sel "\n\t" \
728 "dsll\t%L0, %M0, 32\n\t" \ 739 "dsll\t%L0, %M0, 32\n\t" \
729 "dsrl\t%M0, %M0, 32\n\t" \ 740 "dsra\t%M0, %M0, 32\n\t" \
730 "dsrl\t%L0, %L0, 32\n\t" \ 741 "dsra\t%L0, %L0, 32\n\t" \
731 ".set\tmips0" \ 742 ".set\tmips0" \
732 : "=r" (__val)); \ 743 : "=r" (__val)); \
733 local_irq_restore(__flags); \ 744 local_irq_restore(__flags); \
@@ -1484,14 +1495,15 @@ static inline unsigned int \
1484set_c0_##name(unsigned int set) \ 1495set_c0_##name(unsigned int set) \
1485{ \ 1496{ \
1486 unsigned int res; \ 1497 unsigned int res; \
1498 unsigned int new; \
1487 unsigned int omt; \ 1499 unsigned int omt; \
1488 unsigned long flags; \ 1500 unsigned long flags; \
1489 \ 1501 \
1490 local_irq_save(flags); \ 1502 local_irq_save(flags); \
1491 omt = __dmt(); \ 1503 omt = __dmt(); \
1492 res = read_c0_##name(); \ 1504 res = read_c0_##name(); \
1493 res |= set; \ 1505 new = res | set; \
1494 write_c0_##name(res); \ 1506 write_c0_##name(new); \
1495 __emt(omt); \ 1507 __emt(omt); \
1496 local_irq_restore(flags); \ 1508 local_irq_restore(flags); \
1497 \ 1509 \
@@ -1502,14 +1514,15 @@ static inline unsigned int \
1502clear_c0_##name(unsigned int clear) \ 1514clear_c0_##name(unsigned int clear) \
1503{ \ 1515{ \
1504 unsigned int res; \ 1516 unsigned int res; \
1517 unsigned int new; \
1505 unsigned int omt; \ 1518 unsigned int omt; \
1506 unsigned long flags; \ 1519 unsigned long flags; \
1507 \ 1520 \
1508 local_irq_save(flags); \ 1521 local_irq_save(flags); \
1509 omt = __dmt(); \ 1522 omt = __dmt(); \
1510 res = read_c0_##name(); \ 1523 res = read_c0_##name(); \
1511 res &= ~clear; \ 1524 new = res & ~clear; \
1512 write_c0_##name(res); \ 1525 write_c0_##name(new); \
1513 __emt(omt); \ 1526 __emt(omt); \
1514 local_irq_restore(flags); \ 1527 local_irq_restore(flags); \
1515 \ 1528 \
@@ -1517,9 +1530,10 @@ clear_c0_##name(unsigned int clear) \
1517} \ 1530} \
1518 \ 1531 \
1519static inline unsigned int \ 1532static inline unsigned int \
1520change_c0_##name(unsigned int change, unsigned int new) \ 1533change_c0_##name(unsigned int change, unsigned int newbits) \
1521{ \ 1534{ \
1522 unsigned int res; \ 1535 unsigned int res; \
1536 unsigned int new; \
1523 unsigned int omt; \ 1537 unsigned int omt; \
1524 unsigned long flags; \ 1538 unsigned long flags; \
1525 \ 1539 \
@@ -1527,9 +1541,9 @@ change_c0_##name(unsigned int change, unsigned int new) \
1527 \ 1541 \
1528 omt = __dmt(); \ 1542 omt = __dmt(); \
1529 res = read_c0_##name(); \ 1543 res = read_c0_##name(); \
1530 res &= ~change; \ 1544 new = res & ~change; \
1531 res |= (new & change); \ 1545 new |= (newbits & change); \
1532 write_c0_##name(res); \ 1546 write_c0_##name(new); \
1533 __emt(omt); \ 1547 __emt(omt); \
1534 local_irq_restore(flags); \ 1548 local_irq_restore(flags); \
1535 \ 1549 \