Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375201
b: refs/heads/master
c: f6b06d9
h: refs/heads/master
i:
  375199: f8b31db
v: v3
  • Loading branch information
Steven J. Hill authored and Ralf Baechle committed May 8, 2013
1 parent 165b9ba commit 28ff33d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d532f3d26716a39dfd4b88d687bd344fbe77e390
refs/heads/master: f6b06d9361a008afb93b97fb3683a6e92d69d0f4
34 changes: 32 additions & 2 deletions trunk/arch/mips/mm/tlbex.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,32 @@ static int check_for_high_segbits __cpuinitdata;
static void __cpuinit insn_fixup(unsigned int **start, unsigned int **stop,
unsigned int i_const)
{
unsigned int **p, *ip;
unsigned int **p;

for (p = start; p < stop; p++) {
#ifndef CONFIG_CPU_MICROMIPS
unsigned int *ip;

ip = *p;
*ip = (*ip & 0xffff0000) | i_const;
#else
unsigned short *ip;

ip = ((unsigned short *)((unsigned int)*p - 1));
if ((*ip & 0xf000) == 0x4000) {
*ip &= 0xfff1;
*ip |= (i_const << 1);
} else if ((*ip & 0xf000) == 0x6000) {
*ip &= 0xfff1;
*ip |= ((i_const >> 2) << 1);
} else {
ip++;
*ip = i_const;
}
#endif
local_flush_icache_range((unsigned long)ip,
(unsigned long)ip + sizeof(*ip));
}
local_flush_icache_range((unsigned long)*p, (unsigned long)((*p) + 1));
}

#define asid_insn_fixup(section, const) \
Expand All @@ -335,13 +354,24 @@ static void __cpuinit setup_asid(unsigned int inc, unsigned int mask,
extern asmlinkage void handle_ri_rdhwr_vivt(void);
unsigned long *vivt_exc;

#ifdef CONFIG_CPU_MICROMIPS
/*
* Worst case optimised microMIPS addiu instructions support
* only a 3-bit immediate value.
*/
if(inc > 7)
panic("Invalid ASID increment value!");
#endif
asid_insn_fixup(__asid_inc, inc);
asid_insn_fixup(__asid_mask, mask);
asid_insn_fixup(__asid_version_mask, version_mask);
asid_insn_fixup(__asid_first_version, first_version);

/* Patch up the 'handle_ri_rdhwr_vivt' handler. */
vivt_exc = (unsigned long *) &handle_ri_rdhwr_vivt;
#ifdef CONFIG_CPU_MICROMIPS
vivt_exc = (unsigned long *)((unsigned long) vivt_exc - 1);
#endif
vivt_exc++;
*vivt_exc = (*vivt_exc & ~mask) | mask;

Expand Down

0 comments on commit 28ff33d

Please sign in to comment.