]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/powerpc/kernel/process.c
sched/headers: Prepare for new header dependencies before moving code to <linux/sched...
[mirror_ubuntu-bionic-kernel.git] / arch / powerpc / kernel / process.c
index 5dd056df0baaec576431adb4cbe8ab370d8f44c1..76f58b87dcb224d080f80ad61acb02c86317721d 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <linux/errno.h>
 #include <linux/sched.h>
+#include <linux/sched/debug.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
@@ -730,6 +731,28 @@ static inline int __set_dabr(unsigned long dabr, unsigned long dabrx)
                mtspr(SPRN_DABRX, dabrx);
        return 0;
 }
+#elif defined(CONFIG_PPC_8xx)
+static inline int __set_dabr(unsigned long dabr, unsigned long dabrx)
+{
+       unsigned long addr = dabr & ~HW_BRK_TYPE_DABR;
+       unsigned long lctrl1 = 0x90000000; /* compare type: equal on E & F */
+       unsigned long lctrl2 = 0x8e000002; /* watchpoint 1 on cmp E | F */
+
+       if ((dabr & HW_BRK_TYPE_RDWR) == HW_BRK_TYPE_READ)
+               lctrl1 |= 0xa0000;
+       else if ((dabr & HW_BRK_TYPE_RDWR) == HW_BRK_TYPE_WRITE)
+               lctrl1 |= 0xf0000;
+       else if ((dabr & HW_BRK_TYPE_RDWR) == 0)
+               lctrl2 = 0;
+
+       mtspr(SPRN_LCTRL2, 0);
+       mtspr(SPRN_CMPE, addr);
+       mtspr(SPRN_CMPF, addr + 4);
+       mtspr(SPRN_LCTRL1, lctrl1);
+       mtspr(SPRN_LCTRL2, lctrl2);
+
+       return 0;
+}
 #else
 static inline int __set_dabr(unsigned long dabr, unsigned long dabrx)
 {