Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189775
b: refs/heads/master
c: 58b9e22
h: refs/heads/master
i:
  189773: d2800e5
  189771: 855e2ed
  189767: cf2f148
  189759: 2bb8732
v: v3
  • Loading branch information
David Daney authored and Ralf Baechle committed Apr 12, 2010
1 parent 1013c57 commit 9566d2d
Show file tree
Hide file tree
Showing 3 changed files with 19 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: 847253b9483f713b3797877034e0940fd45ce375
refs/heads/master: 58b9e2239fa63c7c470acb4a77e9da17e6a6fa4f
1 change: 1 addition & 0 deletions trunk/arch/mips/include/asm/uasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Ip_0(_tlbwr);
Ip_u3u1u2(_xor);
Ip_u2u1u3(_xori);
Ip_u2u1msbu3(_dins);
Ip_u1(_syscall);

/* Handle labels. */
struct uasm_label {
Expand Down
19 changes: 17 additions & 2 deletions trunk/arch/mips/mm/uasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ enum fields {
BIMM = 0x040,
JIMM = 0x080,
FUNC = 0x100,
SET = 0x200
SET = 0x200,
SCIMM = 0x400
};

#define OP_MASK 0x3f
Expand All @@ -52,6 +53,8 @@ enum fields {
#define FUNC_SH 0
#define SET_MASK 0x7
#define SET_SH 0
#define SCIMM_MASK 0xfffff
#define SCIMM_SH 6

enum opcode {
insn_invalid,
Expand All @@ -64,7 +67,7 @@ enum opcode {
insn_mtc0, insn_ori, insn_pref, insn_rfe, insn_sc, insn_scd,
insn_sd, insn_sll, insn_sra, insn_srl, insn_rotr, insn_subu, insn_sw,
insn_tlbp, insn_tlbr, insn_tlbwi, insn_tlbwr, insn_xor, insn_xori,
insn_dins
insn_dins, insn_syscall
};

struct insn {
Expand Down Expand Up @@ -136,6 +139,7 @@ static struct insn insn_table[] __cpuinitdata = {
{ insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD },
{ insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM },
{ insn_dins, M(spec3_op, 0, 0, 0, 0, dins_op), RS | RT | RD | RE },
{ insn_syscall, M(spec_op, 0, 0, 0, 0, syscall_op), SCIMM},
{ insn_invalid, 0, 0 }
};

Expand Down Expand Up @@ -208,6 +212,14 @@ static inline __cpuinit u32 build_jimm(u32 arg)
return (arg >> 2) & JIMM_MASK;
}

static inline __cpuinit u32 build_scimm(u32 arg)
{
if (arg & ~SCIMM_MASK)
printk(KERN_WARNING "Micro-assembler field overflow\n");

return (arg & SCIMM_MASK) << SCIMM_SH;
}

static inline __cpuinit u32 build_func(u32 arg)
{
if (arg & ~FUNC_MASK)
Expand Down Expand Up @@ -266,6 +278,8 @@ static void __cpuinit build_insn(u32 **buf, enum opcode opc, ...)
op |= build_func(va_arg(ap, u32));
if (ip->fields & SET)
op |= build_set(va_arg(ap, u32));
if (ip->fields & SCIMM)
op |= build_scimm(va_arg(ap, u32));
va_end(ap);

**buf = op;
Expand Down Expand Up @@ -391,6 +405,7 @@ I_0(_tlbwr)
I_u3u1u2(_xor)
I_u2u1u3(_xori)
I_u2u1msbu3(_dins);
I_u1(_syscall);

/* Handle labels. */
void __cpuinit uasm_build_label(struct uasm_label **lab, u32 *addr, int lid)
Expand Down

0 comments on commit 9566d2d

Please sign in to comment.