@@ -1689,6 +1689,78 @@ static int tm_dscr_set(struct task_struct *target,
1689
1689
}
1690
1690
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
1691
1691
1692
+ #ifdef CONFIG_PPC64
1693
+ static int ppr_get (struct task_struct * target ,
1694
+ const struct user_regset * regset ,
1695
+ unsigned int pos , unsigned int count ,
1696
+ void * kbuf , void __user * ubuf )
1697
+ {
1698
+ int ret ;
1699
+
1700
+ ret = user_regset_copyout (& pos , & count , & kbuf , & ubuf ,
1701
+ & target -> thread .ppr , 0 , sizeof (u64 ));
1702
+ return ret ;
1703
+ }
1704
+
1705
+ static int ppr_set (struct task_struct * target ,
1706
+ const struct user_regset * regset ,
1707
+ unsigned int pos , unsigned int count ,
1708
+ const void * kbuf , const void __user * ubuf )
1709
+ {
1710
+ int ret ;
1711
+
1712
+ ret = user_regset_copyin (& pos , & count , & kbuf , & ubuf ,
1713
+ & target -> thread .ppr , 0 , sizeof (u64 ));
1714
+ return ret ;
1715
+ }
1716
+
1717
+ static int dscr_get (struct task_struct * target ,
1718
+ const struct user_regset * regset ,
1719
+ unsigned int pos , unsigned int count ,
1720
+ void * kbuf , void __user * ubuf )
1721
+ {
1722
+ int ret ;
1723
+
1724
+ ret = user_regset_copyout (& pos , & count , & kbuf , & ubuf ,
1725
+ & target -> thread .dscr , 0 , sizeof (u64 ));
1726
+ return ret ;
1727
+ }
1728
+ static int dscr_set (struct task_struct * target ,
1729
+ const struct user_regset * regset ,
1730
+ unsigned int pos , unsigned int count ,
1731
+ const void * kbuf , const void __user * ubuf )
1732
+ {
1733
+ int ret ;
1734
+
1735
+ ret = user_regset_copyin (& pos , & count , & kbuf , & ubuf ,
1736
+ & target -> thread .dscr , 0 , sizeof (u64 ));
1737
+ return ret ;
1738
+ }
1739
+ #endif
1740
+ #ifdef CONFIG_PPC_BOOK3S_64
1741
+ static int tar_get (struct task_struct * target ,
1742
+ const struct user_regset * regset ,
1743
+ unsigned int pos , unsigned int count ,
1744
+ void * kbuf , void __user * ubuf )
1745
+ {
1746
+ int ret ;
1747
+
1748
+ ret = user_regset_copyout (& pos , & count , & kbuf , & ubuf ,
1749
+ & target -> thread .tar , 0 , sizeof (u64 ));
1750
+ return ret ;
1751
+ }
1752
+ static int tar_set (struct task_struct * target ,
1753
+ const struct user_regset * regset ,
1754
+ unsigned int pos , unsigned int count ,
1755
+ const void * kbuf , const void __user * ubuf )
1756
+ {
1757
+ int ret ;
1758
+
1759
+ ret = user_regset_copyin (& pos , & count , & kbuf , & ubuf ,
1760
+ & target -> thread .tar , 0 , sizeof (u64 ));
1761
+ return ret ;
1762
+ }
1763
+ #endif
1692
1764
/*
1693
1765
* These are our native regset flavors.
1694
1766
*/
@@ -1714,6 +1786,13 @@ enum powerpc_regset {
1714
1786
REGSET_TM_CPPR , /* TM checkpointed PPR register */
1715
1787
REGSET_TM_CDSCR , /* TM checkpointed DSCR register */
1716
1788
#endif
1789
+ #ifdef CONFIG_PPC64
1790
+ REGSET_PPR , /* PPR register */
1791
+ REGSET_DSCR , /* DSCR register */
1792
+ #endif
1793
+ #ifdef CONFIG_PPC_BOOK3S_64
1794
+ REGSET_TAR , /* TAR register */
1795
+ #endif
1717
1796
};
1718
1797
1719
1798
static const struct user_regset native_regsets [] = {
@@ -1790,6 +1869,25 @@ static const struct user_regset native_regsets[] = {
1790
1869
.active = tm_dscr_active , .get = tm_dscr_get , .set = tm_dscr_set
1791
1870
},
1792
1871
#endif
1872
+ #ifdef CONFIG_PPC64
1873
+ [REGSET_PPR ] = {
1874
+ .core_note_type = NT_PPC_PPR , .n = 1 ,
1875
+ .size = sizeof (u64 ), .align = sizeof (u64 ),
1876
+ .get = ppr_get , .set = ppr_set
1877
+ },
1878
+ [REGSET_DSCR ] = {
1879
+ .core_note_type = NT_PPC_DSCR , .n = 1 ,
1880
+ .size = sizeof (u64 ), .align = sizeof (u64 ),
1881
+ .get = dscr_get , .set = dscr_set
1882
+ },
1883
+ #endif
1884
+ #ifdef CONFIG_PPC_BOOK3S_64
1885
+ [REGSET_TAR ] = {
1886
+ .core_note_type = NT_PPC_TAR , .n = 1 ,
1887
+ .size = sizeof (u64 ), .align = sizeof (u64 ),
1888
+ .get = tar_get , .set = tar_set
1889
+ },
1890
+ #endif
1793
1891
};
1794
1892
1795
1893
static const struct user_regset_view user_ppc_native_view = {
@@ -2057,6 +2155,25 @@ static const struct user_regset compat_regsets[] = {
2057
2155
.active = tm_dscr_active , .get = tm_dscr_get , .set = tm_dscr_set
2058
2156
},
2059
2157
#endif
2158
+ #ifdef CONFIG_PPC64
2159
+ [REGSET_PPR ] = {
2160
+ .core_note_type = NT_PPC_PPR , .n = 1 ,
2161
+ .size = sizeof (u64 ), .align = sizeof (u64 ),
2162
+ .get = ppr_get , .set = ppr_set
2163
+ },
2164
+ [REGSET_DSCR ] = {
2165
+ .core_note_type = NT_PPC_DSCR , .n = 1 ,
2166
+ .size = sizeof (u64 ), .align = sizeof (u64 ),
2167
+ .get = dscr_get , .set = dscr_set
2168
+ },
2169
+ #endif
2170
+ #ifdef CONFIG_PPC_BOOK3S_64
2171
+ [REGSET_TAR ] = {
2172
+ .core_note_type = NT_PPC_TAR , .n = 1 ,
2173
+ .size = sizeof (u64 ), .align = sizeof (u64 ),
2174
+ .get = tar_get , .set = tar_set
2175
+ },
2176
+ #endif
2060
2177
};
2061
2178
2062
2179
static const struct user_regset_view user_ppc_compat_view = {
0 commit comments