File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 88
88
#define INSN_MATCH_C_FSWSP 0xe002
89
89
#define INSN_MASK_C_FSWSP 0xe003
90
90
91
+ #define INSN_MATCH_C_LHU 0x8400
92
+ #define INSN_MASK_C_LHU 0xfc43
93
+ #define INSN_MATCH_C_LH 0x8440
94
+ #define INSN_MASK_C_LH 0xfc43
95
+ #define INSN_MATCH_C_SH 0x8c00
96
+ #define INSN_MASK_C_SH 0xfc43
97
+
91
98
#define INSN_LEN (insn ) ((((insn) & 0x3) < 0x3) ? 2 : 4)
92
99
93
100
#if defined(CONFIG_64BIT )
@@ -431,6 +438,13 @@ static int handle_scalar_misaligned_load(struct pt_regs *regs)
431
438
fp = 1 ;
432
439
len = 4 ;
433
440
#endif
441
+ } else if ((insn & INSN_MASK_C_LHU ) == INSN_MATCH_C_LHU ) {
442
+ len = 2 ;
443
+ insn = RVC_RS2S (insn ) << SH_RD ;
444
+ } else if ((insn & INSN_MASK_C_LH ) == INSN_MATCH_C_LH ) {
445
+ len = 2 ;
446
+ shift = 8 * (sizeof (ulong ) - len );
447
+ insn = RVC_RS2S (insn ) << SH_RD ;
434
448
} else {
435
449
regs -> epc = epc ;
436
450
return -1 ;
@@ -530,6 +544,9 @@ static int handle_scalar_misaligned_store(struct pt_regs *regs)
530
544
len = 4 ;
531
545
val .data_ulong = GET_F32_RS2C (insn , regs );
532
546
#endif
547
+ } else if ((insn & INSN_MASK_C_SH ) == INSN_MATCH_C_SH ) {
548
+ len = 2 ;
549
+ val .data_ulong = GET_RS2S (insn , regs );
533
550
} else {
534
551
regs -> epc = epc ;
535
552
return -1 ;
You can’t perform that action at this time.
0 commit comments