x86: unify struct desc_ptr
[profile/ivi/kernel-adaptation-intel-automotive.git] / include / asm-x86 / paravirt.h
index f59d370..0333fb6 100644 (file)
@@ -20,7 +20,7 @@
 
 struct page;
 struct thread_struct;
-struct Xgt_desc_struct;
+struct desc_ptr;
 struct tss_struct;
 struct mm_struct;
 struct desc_struct;
@@ -88,10 +88,10 @@ struct pv_cpu_ops {
 
        /* Segment descriptor handling */
        void (*load_tr_desc)(void);
-       void (*load_gdt)(const struct Xgt_desc_struct *);
-       void (*load_idt)(const struct Xgt_desc_struct *);
-       void (*store_gdt)(struct Xgt_desc_struct *);
-       void (*store_idt)(struct Xgt_desc_struct *);
+       void (*load_gdt)(const struct desc_ptr *);
+       void (*load_idt)(const struct desc_ptr *);
+       void (*store_gdt)(struct desc_ptr *);
+       void (*store_idt)(struct desc_ptr *);
        void (*set_ldt)(const void *desc, unsigned entries);
        unsigned long (*store_tr)(void);
        void (*load_tls)(struct thread_struct *t, unsigned int cpu);
@@ -101,7 +101,7 @@ struct pv_cpu_ops {
                                int entrynum, u32 low, u32 high);
        void (*write_idt_entry)(struct desc_struct *,
                                int entrynum, u32 low, u32 high);
-       void (*load_esp0)(struct tss_struct *tss, struct thread_struct *t);
+       void (*load_sp0)(struct tss_struct *tss, struct thread_struct *t);
 
        void (*set_iopl_mask)(unsigned mask);
 
@@ -115,13 +115,13 @@ struct pv_cpu_ops {
        /* MSR, PMC and TSR operations.
           err = 0/-EFAULT.  wrmsr returns 0/-EFAULT. */
        u64 (*read_msr)(unsigned int msr, int *err);
-       int (*write_msr)(unsigned int msr, u64 val);
+       int (*write_msr)(unsigned int msr, unsigned low, unsigned high);
 
        u64 (*read_tsc)(void);
-       u64 (*read_pmc)(void);
+       u64 (*read_pmc)(int counter);
 
        /* These two are jmp to, not actually called. */
-       void (*irq_enable_sysexit)(void);
+       void (*irq_enable_syscall_ret)(void);
        void (*iret)(void);
 
        struct pv_lazy_ops lazy_mode;
@@ -150,9 +150,9 @@ struct pv_apic_ops {
         * Direct APIC operations, principally for VMI.  Ideally
         * these shouldn't be in this interface.
         */
-       void (*apic_write)(unsigned long reg, unsigned long v);
-       void (*apic_write_atomic)(unsigned long reg, unsigned long v);
-       unsigned long (*apic_read)(unsigned long reg);
+       void (*apic_write)(unsigned long reg, u32 v);
+       void (*apic_write_atomic)(unsigned long reg, u32 v);
+       u32 (*apic_read)(unsigned long reg);
        void (*setup_boot_clock)(void);
        void (*setup_secondary_clock)(void);
 
@@ -449,10 +449,10 @@ static inline int paravirt_enabled(void)
        return pv_info.paravirt_enabled;
 }
 
-static inline void load_esp0(struct tss_struct *tss,
+static inline void load_sp0(struct tss_struct *tss,
                             struct thread_struct *thread)
 {
-       PVOP_VCALL2(pv_cpu_ops.load_esp0, tss, thread);
+       PVOP_VCALL2(pv_cpu_ops.load_sp0, tss, thread);
 }
 
 #define ARCH_SETUP                     pv_init_ops.arch_setup();
@@ -630,11 +630,11 @@ static inline void load_TR_desc(void)
 {
        PVOP_VCALL0(pv_cpu_ops.load_tr_desc);
 }
-static inline void load_gdt(const struct Xgt_desc_struct *dtr)
+static inline void load_gdt(const struct desc_ptr *dtr)
 {
        PVOP_VCALL1(pv_cpu_ops.load_gdt, dtr);
 }
-static inline void load_idt(const struct Xgt_desc_struct *dtr)
+static inline void load_idt(const struct desc_ptr *dtr)
 {
        PVOP_VCALL1(pv_cpu_ops.load_idt, dtr);
 }
@@ -642,11 +642,11 @@ static inline void set_ldt(const void *addr, unsigned entries)
 {
        PVOP_VCALL2(pv_cpu_ops.set_ldt, addr, entries);
 }
-static inline void store_gdt(struct Xgt_desc_struct *dtr)
+static inline void store_gdt(struct desc_ptr *dtr)
 {
        PVOP_VCALL1(pv_cpu_ops.store_gdt, dtr);
 }
-static inline void store_idt(struct Xgt_desc_struct *dtr)
+static inline void store_idt(struct desc_ptr *dtr)
 {
        PVOP_VCALL1(pv_cpu_ops.store_idt, dtr);
 }
@@ -690,17 +690,17 @@ static inline void slow_down_io(void) {
 /*
  * Basic functions accessing APICs.
  */
-static inline void apic_write(unsigned long reg, unsigned long v)
+static inline void apic_write(unsigned long reg, u32 v)
 {
        PVOP_VCALL2(pv_apic_ops.apic_write, reg, v);
 }
 
-static inline void apic_write_atomic(unsigned long reg, unsigned long v)
+static inline void apic_write_atomic(unsigned long reg, u32 v)
 {
        PVOP_VCALL2(pv_apic_ops.apic_write_atomic, reg, v);
 }
 
-static inline unsigned long apic_read(unsigned long reg)
+static inline u32 apic_read(unsigned long reg)
 {
        return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg);
 }
@@ -1138,9 +1138,10 @@ static inline unsigned long __raw_local_irq_save(void)
                  call *%cs:pv_irq_ops+PV_IRQ_irq_enable;               \
                  popl %edx; popl %ecx; popl %eax)
 
-#define ENABLE_INTERRUPTS_SYSEXIT                                             \
-       PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_irq_enable_sysexit), CLBR_NONE,\
-                 jmp *%cs:pv_cpu_ops+PV_CPU_irq_enable_sysexit)
+#define ENABLE_INTERRUPTS_SYSCALL_RET                                  \
+       PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_irq_enable_syscall_ret),\
+                 CLBR_NONE,                                            \
+                 jmp *%cs:pv_cpu_ops+PV_CPU_irq_enable_syscall_ret)
 
 #define GET_CR0_INTO_EAX                       \
        push %ecx; push %edx;                   \