/*
* POWER Data Stream Control Register (DSCR) explicit test
*
* This test modifies the DSCR value using mtspr instruction and
* verifies the change with mfspr instruction. It uses both the
* privilege state SPR and the problem state SPR for this purpose.
*
* When using the privilege state SPR, the instructions such as
* mfspr or mtspr are priviledged and the kernel emulates them
* for us. Instructions using problem state SPR can be exuecuted
* directly without any emulation if the HW supports them. Else
* they also get emulated by the kernel.
*
* Copyright 2012, Anton Blanchard, IBM Corporation.
* Copyright 2015, Anshuman Khandual, IBM Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include "dscr.h"
int dscr_explicit(void)
{
unsigned long i, dscr = 0;
srand(getpid());
set_dscr(dscr);
for (i = 0; i < COUNT; i++) {
unsigned long cur_dscr, cur_dscr_usr;
double ret = uniform_deviate(rand());
if (ret < 0.001) {
dscr++;
if (dscr > DSCR_MAX)
dscr = 0;
set_dscr(dscr);
}
cur_dscr = get_dscr();
if (cur_dscr != dscr) {
fprintf(stderr, "Kernel DSCR should be %ld but "
"is %ld\n", dscr, cur_dscr);
return 1;
}
ret = uniform_deviate(rand());
if (ret < 0.001) {
dscr++;
if (dscr > DSCR_MAX)
dscr = 0;
set_dscr_usr(dscr);
}
cur_dscr_usr = get_dscr_usr();
if (cur_dscr_usr != dscr) {
fprintf(stderr, "User DSCR should be %ld but "
"is %ld\n", dscr, cur_dscr_usr);
return 1;
}
}
return 0;
}
int main(int argc, char *argv[])
{
return test_harness(dscr_explicit, "dscr_explicit_test");
}
t-next.git/tree/include/dt-bindings/clock?id=edc67410449c668434b183bb0f770b7bf456c750'>treecommitdiff
|
Mode | Name | Size | |
-rw-r--r-- | alphascale,asm9260.h | 2695 | logplain |
-rw-r--r-- | at91.h | 751 | logplain |
-rw-r--r-- | ath79-clk.h | 479 | logplain |
-rw-r--r-- | axis,artpec6-clkctrl.h | 1112 | logplain |
-rw-r--r-- | bcm-cygnus.h | 3135 | logplain |
-rw-r--r-- | bcm-ns2.h | 2915 | logplain |
-rw-r--r-- | bcm-nsp.h | 2148 | logplain |
-rw-r--r-- | bcm21664.h | 1984 | logplain |
-rw-r--r-- | bcm281xx.h | 2456 | logplain |
-rw-r--r-- | bcm2835-aux.h | 635 | logplain |
-rw-r--r-- | bcm2835.h | 1962 | logplain |
-rw-r--r-- | berlin2.h | 1034 | logplain |
-rw-r--r-- | berlin2q.h | 695 | logplain |
-rw-r--r-- | clps711x-clock.h | 718 | logplain |
-rw-r--r-- | efm32-cmu.h | 1112 | logplain |
-rw-r--r-- | exynos-audss-clk.h | 597 | logplain |
-rw-r--r-- | exynos3250.h | 9083 | logplain |
-rw-r--r-- | exynos4.h | 8284 | logplain |
-rw-r--r-- | exynos4415.h | 9828 | logplain |
-rw-r--r-- | exynos5250.h | 4616 | logplain |
-rw-r--r-- | exynos5260-clk.h | 14876 | logplain |
-rw-r--r-- | exynos5410.h | 1689 | logplain |
-rw-r--r-- | exynos5420.h | 6857 | logplain |
-rw-r--r-- | exynos5433.h | 45372 | logplain |
-rw-r--r-- | exynos5440.h | 1141 | logplain |
-rw-r--r-- | exynos7-clk.h | 5281 | logplain |
-rw-r--r-- | gxbb-aoclkc.h | 2866 | logplain |
-rw-r--r-- | gxbb-clkc.h | 592 | logplain |
-rw-r--r-- | hi3516cv300-clock.h | 1668 | logplain |
-rw-r--r-- | hi3519-clock.h | 1328 | logplain |
-rw-r--r-- | hi3620-clock.h | 4496 | logplain |
-rw-r--r-- | hi6220-clock.h | 4508 | logplain |
-rw-r--r-- | hip04-clock.h | 1137 | logplain |
-rw-r--r-- | histb-clock.h | 2012 | logplain |
-rw-r--r-- | hix5hd2-clock.h | 2415 | logplain |
-rw-r--r-- | imx1-clock.h | 1055 | logplain |
-rw-r--r-- | imx21-clock.h | 2461 | logplain |
-rw-r--r-- | imx27-clock.h | 3494 | logplain |
-rw-r--r-- | imx5-clock.h | 7212 | logplain |
-rw-r--r-- | imx6qdl-clock.h | 9593 | logplain |
-rw-r--r-- | imx6sl-clock.h | 5849 | logplain |
-rw-r--r-- | imx6sx-clock.h | 9099 | logplain |
-rw-r--r-- | imx6ul-clock.h | 8203 | logplain |
-rw-r--r-- | imx7d-clock.h | 15974 | logplain |
-rw-r--r-- | jz4740-cgu.h | 1028 | logplain |
-rw-r--r-- | jz4780-cgu.h | 2470 | logplain |
-rw-r--r-- | lpc18xx-ccu.h | 2134 | logplain |
-rw-r--r-- | lpc18xx-cgu.h | 1142 | logplain |
-rw-r--r-- | lpc32xx-clock.h | 1633 | logplain |
-rw-r--r-- | lsi,axm5516-clks.h | 974 | logplain |
-rw-r--r-- | marvell,mmp2.h | 2022 | logplain |
-rw-r--r-- | marvell,pxa168.h | 1654 | logplain |
-rw-r--r-- | marvell,pxa1928.h | 1535 | logplain |
-rw-r--r-- | marvell,pxa910.h | 1598 | logplain |
-rw-r--r-- | maxim,max77620.h | 632 | logplain |
-rw-r--r-- | maxim,max77686.h | 648 | logplain |
-rw-r--r-- | maxim,max77802.h | 630 | logplain |
-rw-r--r-- | meson8b-clkc.h | 523 | logplain |
-rw-r--r-- | microchip,pic32-clock.h | 1150 | logplain |
-rw-r--r-- | mpc512x-clock.h | 2236 | logplain |
-rw-r--r-- | mt2701-clk.h | 13832 | logplain |
-rw-r--r-- | mt8135-clk.h | 5641 | logplain |
-rw-r--r-- | mt8173-clk.h | 9293 | logplain |
-rw-r--r-- | oxsemi,ox810se.h | 1002 | logplain |
-rw-r--r-- | oxsemi,ox820.h | 1203 | logplain |
-rw-r--r-- | pistachio-clk.h | 4863 | logplain |
-rw-r--r-- | pxa-clock.h | 1715 | logplain |
-rw-r--r-- | qcom,gcc-apq8084.h | 12872 | logplain |
-rw-r--r-- | qcom,gcc-ipq4019.h | 5423 | logplain |
-rw-r--r-- | qcom,gcc-ipq806x.h | 8574 | logplain |
-rw-r--r-- | qcom,gcc-mdm9615.h | 9497 | logplain |
-rw-r--r-- | qcom,gcc-msm8660.h | 7932 | logplain |
-rw-r--r-- | qcom,gcc-msm8916.h | 6190 | logplain |
-rw-r--r-- | qcom,gcc-msm8960.h | 9342 | logplain |
-rw-r--r-- | qcom,gcc-msm8974.h | 12340 | logplain |
-rw-r--r-- | qcom,gcc-msm8994.h | 4858 | logplain |
-rw-r--r-- | qcom,gcc-msm8996.h | 12575 | logplain |
-rw-r--r-- | qcom,lcc-ipq806x.h | 899 | logplain |
-rw-r--r-- | qcom,lcc-mdm9615.h | 1701 | logplain |
-rw-r--r-- | qcom,lcc-msm8960.h | 1616 | logplain |
-rw-r--r-- | qcom,mmcc-apq8084.h | 5722 | logplain |
-rw-r--r-- | qcom,mmcc-msm8960.h | 4109 | logplain |
-rw-r--r-- | qcom,mmcc-msm8974.h | 5223 | logplain |
-rw-r--r-- | qcom,mmcc-msm8996.h | 9403 | logplain |
-rw-r--r-- | qcom,rpmcc.h | 2101 | logplain |
-rw-r--r-- | r7s72100-clock.h | 1218 | logplain |
-rw-r--r-- | r8a73a4-clock.h | 1596 | logplain |
-rw-r--r-- | r8a7740-clock.h | 1992 | logplain |
-rw-r--r-- | r8a7743-cpg-mssr.h | 1269 | logplain |
-rw-r--r-- | r8a7745-cpg-mssr.h | 1298 | logplain |
-rw-r--r-- | r8a7778-clock.h | 1855 | logplain |
-rw-r--r-- | r8a7779-clock.h | 1647 | logplain |
-rw-r--r-- | r8a7790-clock.h | 4367 | logplain |
-rw-r--r-- | r8a7791-clock.h | 4388 | logplain |
-rw-r--r-- | r8a7792-clock.h | 2562 | logplain |
-rw-r--r-- | r8a7793-clock.h | 4561 | logplain |
-rw-r--r-- | r8a7794-clock.h | 3679 | logplain |
-rw-r--r-- | r8a7795-cpg-mssr.h | 1890 | logplain |
-rw-r--r-- | r8a7796-cpg-mssr.h | 2066 | logplain |
-rw-r--r-- | renesas-cpg-mssr.h | 542 | logplain |
-rw-r--r-- | rk1108-cru.h | 6605 | logplain |
-rw-r--r-- | rk3036-cru.h | 4584 | logplain |
-rw-r--r-- | rk3066a-cru.h | 1068 | logplain |
-rw-r--r-- | rk3188-cru-common.h | 6105 | logplain |
-rw-r--r-- | rk3188-cru.h | 1435 | logplain |