Merge branch 'torvalds/master'
[firefly-linux-kernel-4.4.55.git] / arch / microblaze / kernel / kgdb.c
index 8adc924431008a546114588115cd328f6a7b90f5..6366f69d118ecd1af77d8910023ed92afaf7329b 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/io.h>
 #include <asm/cacheflush.h>
 #include <asm/asm-offsets.h>
+#include <asm/kgdb.h>
 #include <asm/pvr.h>
 
 #define GDB_REG                0
 #define GDB_RTLBHI     56
 
 /* keep pvr separately because it is unchangeble */
-struct pvr_s pvr;
+static struct pvr_s pvr;
 
 void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
 {
-       int i;
+       unsigned int i;
        unsigned long *pt_regb = (unsigned long *)regs;
        int temp;
+
        /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */
        for (i = 0; i < (sizeof(struct pt_regs) / 4) - 1; i++)
                gdb_regs[i] = pt_regb[i];
@@ -67,7 +69,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
 
 void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
 {
-       int i;
+       unsigned int i;
        unsigned long *pt_regb = (unsigned long *)regs;
 
        /* pt_regs and gdb_regs have the same 37 values.
@@ -77,7 +79,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
                pt_regb[i] = gdb_regs[i];
 }
 
-void microblaze_kgdb_break(struct pt_regs *regs)
+asmlinkage void microblaze_kgdb_break(struct pt_regs *regs)
 {
        if (kgdb_handle_exception(1, SIGTRAP, 0, regs) != 0)
                return;
@@ -91,7 +93,7 @@ void microblaze_kgdb_break(struct pt_regs *regs)
 /* untested */
 void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
 {
-       int i;
+       unsigned int i;
        unsigned long *pt_regb = (unsigned long *)(p->thread.regs);
 
        /* registers r0 - r31, pc, msr, ear, esr, fsr + do not save pt_mode */
@@ -141,7 +143,7 @@ void kgdb_arch_exit(void)
 /*
  * Global data
  */
-const struct kgdb_arch arch_kgdb_ops = {
+struct kgdb_arch arch_kgdb_ops = {
 #ifdef __MICROBLAZEEL__
        .gdb_bpt_instr = {0x18, 0x00, 0x0c, 0xba}, /* brki r16, 0x18 */
 #else