diff --git a/arch/riscv64/core/swap.S b/arch/riscv64/core/swap.S
index b321aed..ba6f7f7 100644
--- a/arch/riscv64/core/swap.S
+++ b/arch/riscv64/core/swap.S
@@ -128,11 +128,11 @@ _IsrWrapper:
 	beqz a0,_IsrExit_ending         # _get_next_ready_thread() == 0 goto ending
 
 	## Do not reschedule coop threads (threads that have negative prio)
-	ld s1, _thread_offset_to_prio(a0)
+	lw s1, _thread_offset_to_prio(a0)
 	blt  s1,zero,_IsrExit_ending
 
 	## Do not reschedule if scheduler is locked
-	ld s1, _thread_offset_to_sched_locked(a0)
+	lw s1, _thread_offset_to_sched_locked(a0)
 	bne s1,zero,_IsrExit_ending
 
 	## Call into the kernel to see if a scheduling decision is necessary
diff --git a/arch/riscv64/core/swap_macros.h b/arch/riscv64/core/swap_macros.h
index f520918..95a4fb3 100644
--- a/arch/riscv64/core/swap_macros.h
+++ b/arch/riscv64/core/swap_macros.h
@@ -19,16 +19,13 @@
 #ifndef _SWAP_MACROS__H_
 #define _SWAP_MACROS__H_
 
-#define tNANO_FIBER_OFFSET   0
-#define tNANO_TASK_OFFSET    8
 #define tNANO_CURRENT_OFFSET 16
 
 #define _kernel_offset_to_irq_stack    8
 #define _kernel_offset_to_current      16
 
-#define _timeout_sizeof                48 
-#define _thread_offset_to_prio         24
-#define _thread_offset_to_sched_locked 32
+#define _thread_offset_to_prio         20
+#define _thread_offset_to_sched_locked 24
 #define _thread_offset_to_callee_saved 96  //_thread_base_sizeof+caller_saved
 
 #define _callee_saved_offset_to_key        256  //(32*sizeof(uint64_t))

Add patch file for zephyr 1.6.0 to support gcc 7.1 toolchain. In new gcc-versions was changed typeof(int) from 8 to 4 bytes like for x86 so this patch corrects structure offsets used in assembler
[+] Add patch file for zephyr 1.6.0 to support gcc 7.1 toolchain. In new gcc-versions was changed typeof(int) from 8 to 4 bytes like for x86 so this patch corrects structure offsets used in assembler
