]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
s390/time: move PTFF definitions
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 29 Nov 2016 17:44:23 +0000 (10:44 -0700)
committerBrad Figg <brad.figg@canonical.com>
Thu, 8 Dec 2016 18:58:06 +0000 (10:58 -0800)
BugLink: http://bugs.launchpad.net/bugs/1644505
The PTFF instruction is not a function of ETR, rename and move the
PTFF definitions from etr.h to timex.h.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
(cherry picked from commit 9dc06ccf4699db81b88a6ff45a8acefd6c278327)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
arch/s390/include/asm/etr.h
arch/s390/include/asm/timex.h

index 105f90e63a0e8da737c8ccca03bea8ebd1fafa58..63b99cc3e657dc2b0122d593d17b3a275d49bb02 100644 (file)
@@ -129,14 +129,6 @@ struct etr_irq_parm {
        unsigned int _pad2      : 18;
 } __attribute__ ((packed));
 
-/* Query TOD offset result */
-struct etr_ptff_qto {
-       unsigned long long physical_clock;
-       unsigned long long tod_offset;
-       unsigned long long logical_tod_offset;
-       unsigned long long tod_epoch_difference;
-} __attribute__ ((packed));
-
 /* Inline assembly helper functions */
 static inline int etr_setr(struct etr_eacr *ctrl)
 {
@@ -186,30 +178,6 @@ static inline int etr_steai(struct etr_aib *aib, unsigned int func)
 #define ETR_STEAI_PORT_0               0x12
 #define ETR_STEAI_PORT_1               0x13
 
-static inline int etr_ptff(void *ptff_block, unsigned int func)
-{
-       register unsigned int reg0 asm("0") = func;
-       register unsigned long reg1 asm("1") = (unsigned long) ptff_block;
-       int rc = -EOPNOTSUPP;
-
-       asm volatile(
-               "       .word   0x0104\n"
-               "       ipm     %0\n"
-               "       srl     %0,28\n"
-               : "=d" (rc), "=m" (ptff_block)
-               : "d" (reg0), "d" (reg1), "m" (ptff_block) : "cc");
-       return rc;
-}
-
-/* Function codes for the ptff instruction. */
-#define ETR_PTFF_QAF   0x00    /* query available functions */
-#define ETR_PTFF_QTO   0x01    /* query tod offset */
-#define ETR_PTFF_QSI   0x02    /* query steering information */
-#define ETR_PTFF_ATO   0x40    /* adjust tod offset */
-#define ETR_PTFF_STO   0x41    /* set tod offset */
-#define ETR_PTFF_SFS   0x42    /* set fine steering rate */
-#define ETR_PTFF_SGS   0x43    /* set gross steering rate */
-
 /* Functions needed by the machine check handler */
 int etr_switch_to_local(void);
 int etr_sync_check(void);
index dcb6312a0b918089118c7e7835610addefbe2309..920db0a2496b96e7a9f94047c56d4f2cfdfd7adb 100644 (file)
@@ -52,6 +52,39 @@ static inline void store_clock_comparator(__u64 *time)
 
 void clock_comparator_work(void);
 
+/* Function codes for the ptff instruction. */
+#define PTFF_QAF       0x00    /* query available functions */
+#define PTFF_QTO       0x01    /* query tod offset */
+#define PTFF_QSI       0x02    /* query steering information */
+#define PTFF_ATO       0x40    /* adjust tod offset */
+#define PTFF_STO       0x41    /* set tod offset */
+#define PTFF_SFS       0x42    /* set fine steering rate */
+#define PTFF_SGS       0x43    /* set gross steering rate */
+
+/* Query TOD offset result */
+struct ptff_qto {
+       unsigned long long physical_clock;
+       unsigned long long tod_offset;
+       unsigned long long logical_tod_offset;
+       unsigned long long tod_epoch_difference;
+} __packed;
+
+static inline int ptff(void *ptff_block, size_t len, unsigned int func)
+{
+       typedef struct { char _[len]; } addrtype;
+       register unsigned int reg0 asm("0") = func;
+       register unsigned long reg1 asm("1") = (unsigned long) ptff_block;
+       int rc;
+
+       asm volatile(
+               "       .word   0x0104\n"
+               "       ipm     %0\n"
+               "       srl     %0,28\n"
+               : "=d" (rc), "+m" (*(addrtype *) ptff_block)
+               : "d" (reg0), "d" (reg1) : "cc");
+       return rc;
+}
+
 static inline unsigned long long local_tick_disable(void)
 {
        unsigned long long old;