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 87
87
#define INSN_MATCH_C_FSWSP 0xe002
88
88
#define INSN_MASK_C_FSWSP 0xe003
89
89
90
+ #define INSN_MATCH_C_LHU 0x8400
91
+ #define INSN_MASK_C_LHU 0xfc43
92
+ #define INSN_MATCH_C_LH 0x8440
93
+ #define INSN_MASK_C_LH 0xfc43
94
+ #define INSN_MATCH_C_SH 0x8c00
95
+ #define INSN_MASK_C_SH 0xfc43
96
+
90
97
#define INSN_LEN (insn ) ((((insn) & 0x3) < 0x3) ? 2 : 4)
91
98
92
99
#if defined(CONFIG_64BIT )
@@ -405,6 +412,13 @@ int handle_misaligned_load(struct pt_regs *regs)
405
412
fp = 1 ;
406
413
len = 4 ;
407
414
#endif
415
+ } else if ((insn & INSN_MASK_C_LHU ) == INSN_MATCH_C_LHU ) {
416
+ len = 2 ;
417
+ insn = RVC_RS2S (insn ) << SH_RD ;
418
+ } else if ((insn & INSN_MASK_C_LH ) == INSN_MATCH_C_LH ) {
419
+ len = 2 ;
420
+ shift = 8 * (sizeof (ulong ) - len );
421
+ insn = RVC_RS2S (insn ) << SH_RD ;
408
422
} else {
409
423
regs -> epc = epc ;
410
424
return -1 ;
@@ -504,6 +518,9 @@ int handle_misaligned_store(struct pt_regs *regs)
504
518
len = 4 ;
505
519
val .data_ulong = GET_F32_RS2C (insn , regs );
506
520
#endif
521
+ } else if ((insn & INSN_MASK_C_SH ) == INSN_MATCH_C_SH ) {
522
+ len = 2 ;
523
+ val .data_ulong = GET_RS2S (insn , regs );
507
524
} else {
508
525
regs -> epc = epc ;
509
526
return -1 ;
You can’t perform that action at this time.
0 commit comments