Commit 59fe8d99 authored by Tom 'spot' Callaway's avatar Tom 'spot' Callaway Committed by Linus Torvalds

[PATCH] A BTFIXUP'd fix for pte_read()

This adds BTFIXUPs needed for sparc32.
Signed-off-by: default avatarTom 'spot' Callaway <tcallawa@redhat.com>
Acked-by: default avatarWilliam Irwin <wli@holomorphy.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e9e98434
......@@ -2197,6 +2197,7 @@ void __init ld_mmu_srmmu(void)
BTFIXUPSET_CALL(free_pgd_fast, srmmu_free_pgd_fast, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(get_pgd_fast, srmmu_get_pgd_fast, BTFIXUPCALL_NORM);
BTFIXUPSET_HALF(pte_readi, SRMMU_NOREAD);
BTFIXUPSET_HALF(pte_writei, SRMMU_WRITE);
BTFIXUPSET_HALF(pte_dirtyi, SRMMU_DIRTY);
BTFIXUPSET_HALF(pte_youngi, SRMMU_REF);
......
......@@ -2225,6 +2225,7 @@ void __init ld_mmu_sun4c(void)
BTFIXUPSET_CALL(free_pgd_fast, sun4c_free_pgd_fast, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(get_pgd_fast, sun4c_get_pgd_fast, BTFIXUPCALL_NORM);
BTFIXUPSET_HALF(pte_readi, _SUN4C_PAGE_READ);
BTFIXUPSET_HALF(pte_writei, _SUN4C_PAGE_WRITE);
BTFIXUPSET_HALF(pte_dirtyi, _SUN4C_PAGE_MODIFIED);
BTFIXUPSET_HALF(pte_youngi, _SUN4C_PAGE_ACCESSED);
......
......@@ -186,10 +186,31 @@ BTFIXUPDEF_CALL(void, pgd_clear, pgd_t *)
* The following only work if pte_present() is true.
* Undefined behaviour if not..
*/
BTFIXUPDEF_HALF(pte_readi)
BTFIXUPDEF_HALF(pte_writei)
BTFIXUPDEF_HALF(pte_dirtyi)
BTFIXUPDEF_HALF(pte_youngi)
extern int pte_read(pte_t pte) __attribute_const__;
extern __inline__ int pte_read(pte_t pte)
{
switch (sparc_cpu_model){
case sun4:
case sun4c:
return pte_val(pte) & BTFIXUP_HALF(pte_readi);
case sun4d:
case sun4e:
case sun4m:
return !(pte_val(pte) & BTFIXUP_HALF(pte_readi));
/* pacify gcc warnings */
case sun4u:
case sun_unknown:
case ap1000:
default:
return 0;
}
}
extern int pte_write(pte_t pte) __attribute_const__;
extern __inline__ int pte_write(pte_t pte)
{
......
......@@ -73,6 +73,7 @@
#define SRMMU_CACHE 0x80
#define SRMMU_DIRTY 0x40
#define SRMMU_REF 0x20
#define SRMMU_NOREAD 0x10
#define SRMMU_EXEC 0x08
#define SRMMU_WRITE 0x04
#define SRMMU_VALID 0x02 /* SRMMU_ET_PTE */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment