search for: __asm__

Displaying 20 results from an estimated 519 matches for "__asm__".

2007 Apr 18
3
[PATCH 1/4] x86 paravirt_ops: create no_paravirt.h for native ops
...=========== --- a/include/asm-i386/irqflags.h +++ b/include/asm-i386/irqflags.h @@ -9,62 +9,12 @@ */ #ifndef _ASM_IRQFLAGS_H #define _ASM_IRQFLAGS_H +#include <asm/paravirt.h> #ifndef __ASSEMBLY__ -static inline unsigned long __raw_local_save_flags(void) -{ - unsigned long flags; - - __asm__ __volatile__( - "pushfl ; popl %0" - : "=g" (flags) - : /* no input */ - ); - - return flags; -} - #define raw_local_save_flags(flags) \ do { (flags) = __raw_local_save_flags(); } while (0) - -static inline void raw_local_irq_restore(unsigned long flags) -{ - __asm__ __vo...
2007 Apr 18
3
[PATCH 1/4] x86 paravirt_ops: create no_paravirt.h for native ops
...=========== --- a/include/asm-i386/irqflags.h +++ b/include/asm-i386/irqflags.h @@ -9,62 +9,12 @@ */ #ifndef _ASM_IRQFLAGS_H #define _ASM_IRQFLAGS_H +#include <asm/paravirt.h> #ifndef __ASSEMBLY__ -static inline unsigned long __raw_local_save_flags(void) -{ - unsigned long flags; - - __asm__ __volatile__( - "pushfl ; popl %0" - : "=g" (flags) - : /* no input */ - ); - - return flags; -} - #define raw_local_save_flags(flags) \ do { (flags) = __raw_local_save_flags(); } while (0) - -static inline void raw_local_irq_restore(unsigned long flags) -{ - __asm__ __vo...
2007 Apr 18
0
[RFC, PATCH 13/24] i386 Vmi system header
...36.000000000 -0800 @@ -9,6 +9,8 @@ #ifdef __KERNEL__ +#include <mach_system.h> + struct task_struct; /* one of the stranger aspects of C forward declarations.. */ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); @@ -83,69 +85,8 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" #define savesegment(seg, value) \ asm volatile("mov %%" #seg ",%0":"=rm" (value)) -/* - * Clear and set 'TS' bit respectively - */ -#define clts() __asm__ __volatile__ ("clts") -#define read_cr0() ({ \ -...
2007 Apr 18
0
[RFC, PATCH 13/24] i386 Vmi system header
...36.000000000 -0800 @@ -9,6 +9,8 @@ #ifdef __KERNEL__ +#include <mach_system.h> + struct task_struct; /* one of the stranger aspects of C forward declarations.. */ extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); @@ -83,69 +85,8 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" #define savesegment(seg, value) \ asm volatile("mov %%" #seg ",%0":"=rm" (value)) -/* - * Clear and set 'TS' bit respectively - */ -#define clts() __asm__ __volatile__ ("clts") -#define read_cr0() ({ \ -...
2020 Oct 28
4
Targeting old glibc
Hi, I wonder what is the right way to target an old glibc? I have a machine which is up to date (glibc 2.32 and clang+lld 10.0.1). So far I've been able to target older glibc by having a C file containing: __asm__(".symver powf,powf at GLIBC_2.2.5"); __asm__(".symver expf,expf at GLIBC_2.2.5"); __asm__(".symver exp2f,exp2f at GLIBC_2.2.5"); __asm__(".symver log2f,log2f at GLIBC_2.2.5"); __asm__(".symver logf,logf at GLIBC_2.2.5"); __asm__(".symver log,l...
2007 Apr 18
5
[PATCH] paravirt.h
...=========== --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h @@ -64,6 +64,9 @@ static inline void pack_gate(__u32 *a, _ #define DESCTYPE_DPL3 0x60 /* DPL-3 */ #define DESCTYPE_S 0x10 /* !system */ +#ifdef CONFIG_PARAVIRT +#include <asm/paravirt.h> +#else #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) @@ -98,6 +101,7 @@ static inline void write_dt_entry(void * #define write_ldt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a...
2007 Apr 18
5
[PATCH] paravirt.h
...=========== --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h @@ -64,6 +64,9 @@ static inline void pack_gate(__u32 *a, _ #define DESCTYPE_DPL3 0x60 /* DPL-3 */ #define DESCTYPE_S 0x10 /* !system */ +#ifdef CONFIG_PARAVIRT +#include <asm/paravirt.h> +#else #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) @@ -98,6 +101,7 @@ static inline void write_dt_entry(void * #define write_ldt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a...
2015 Feb 10
3
[LLVMdev] Bug in ARM Thumb inline asm?
...ks like this: ... off_t result; return syscall(SYS__llseek, fd, offset>>32, offset, &result, whence) ? -1 : result; ... Which eventually goes through this macro: static inline long __syscall5(long n, long a, long b, long c, long d, long e) { register long r7 __asm__("r7") = n; register long r0 __asm__("r0") = a; register long r1 __asm__("r1") = b; register long r2 __asm__("r2") = c; register long r3 __asm__("r3") = d; register long r4 __asm__("r4") = e;...
2007 Apr 18
2
[PATCH 1/3] Paravirtualization: Kernel Ring Cleanups
Hi all, I've been looking at finding common ground between the VMI, Xen and other paravirtualization approaches, and after some discussion, we're getting somewhere. These first two patches are the fundamentals, stolen mainly from the VMI patches: removing assumptions about the kernel running in ring 0, and macro-izing all the obvious para-virtualize-needing insns. The third patch is
2007 Apr 18
2
[PATCH 1/3] Paravirtualization: Kernel Ring Cleanups
Hi all, I've been looking at finding common ground between the VMI, Xen and other paravirtualization approaches, and after some discussion, we're getting somewhere. These first two patches are the fundamentals, stolen mainly from the VMI patches: removing assumptions about the kernel running in ring 0, and macro-izing all the obvious para-virtualize-needing insns. The third patch is
2020 Nov 11
2
Targeting old glibc
...LIBC_2.2.5 > call exp > or > .symver exp,exp@@@GLIBC_2.2.5 > call exp > > Then the undefined symbol 'exp' will be renamed to 'exp at GLIBC_2.2.5' > and get bound to the old version at link time. It will thus work with > old glibc. I have one .cpp file with: __asm__(".symver powf,powf at GLIBC_2.2.5"); __asm__(".symver expf,expf at GLIBC_2.2.5"); __asm__(".symver exp2f,exp2f at GLIBC_2.2.5"); __asm__(".symver log2f,log2f at GLIBC_2.2.5"); __asm__(".symver logf,logf at GLIBC_2.2.5"); __asm__(".symver log,l...
2020 Oct 28
2
Targeting old glibc
...ote: > >Hi, > > > >I wonder what is the right way to target an old glibc? > > > >I have a machine which is up to date (glibc 2.32 and clang+lld 10.0.1). > > > >So far I've been able to target older glibc by having a C file containing: > > > >__asm__(".symver powf,powf at GLIBC_2.2.5"); > >__asm__(".symver expf,expf at GLIBC_2.2.5"); > >__asm__(".symver exp2f,exp2f at GLIBC_2.2.5"); > >__asm__(".symver log2f,log2f at GLIBC_2.2.5"); > >__asm__(".symver logf,logf at GLIBC_2.2.5&...
2007 Apr 18
1
[PATCH 4/14] i386 / Clean up asm and volatile keywords in desc
...============ --- linux-2.6.13.orig/include/asm-i386/mach-default/mach_desc.h 2005-08-09 18:38:14.000000000 -0700 +++ linux-2.6.13/include/asm-i386/mach-default/mach_desc.h 2005-08-10 20:42:03.000000000 -0700 @@ -24,30 +24,30 @@ #ifndef __MACH_DESC_H #define __MACH_DESC_H -#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) -#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) +#define load_TR_desc() asm volatile("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) +#define load_LDT_desc() asm volatile(&q...
2007 Apr 18
1
[PATCH 4/14] i386 / Clean up asm and volatile keywords in desc
...============ --- linux-2.6.13.orig/include/asm-i386/mach-default/mach_desc.h 2005-08-09 18:38:14.000000000 -0700 +++ linux-2.6.13/include/asm-i386/mach-default/mach_desc.h 2005-08-10 20:42:03.000000000 -0700 @@ -24,30 +24,30 @@ #ifndef __MACH_DESC_H #define __MACH_DESC_H -#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) -#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) +#define load_TR_desc() asm volatile("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) +#define load_LDT_desc() asm volatile(&q...
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...ASM_MSR_H +#include <mach_msr.h> + /* * Access to machine-specific registers (available on 586 and better only) * Note: the rd* operations modify the parameters directly (without using * pointer indirection), this allows gcc to optimize better */ -#define rdmsr(msr,val1,val2) \ - __asm__ __volatile__("rdmsr" \ - : "=a" (val1), "=d" (val2) \ - : "c" (msr)) - -#define wrmsr(msr,val1,val2) \ - __asm__ __volatile__("wrmsr" \ - : /* no outputs */ \ - : "c" (msr), "a" (val1), "d" (val2)) - #d...
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...ASM_MSR_H +#include <mach_msr.h> + /* * Access to machine-specific registers (available on 586 and better only) * Note: the rd* operations modify the parameters directly (without using * pointer indirection), this allows gcc to optimize better */ -#define rdmsr(msr,val1,val2) \ - __asm__ __volatile__("rdmsr" \ - : "=a" (val1), "=d" (val2) \ - : "c" (msr)) - -#define wrmsr(msr,val1,val2) \ - __asm__ __volatile__("wrmsr" \ - : /* no outputs */ \ - : "c" (msr), "a" (val1), "d" (val2)) - #d...
2007 Apr 18
0
[PATCH 5/12] desc-cleanup
...========================== --- linux-2.6.13.orig/include/asm-i386/desc.h 2005-08-08 17:10:49.000000000 -0700 +++ linux-2.6.13/include/asm-i386/desc.h 2005-08-08 17:15:46.000000000 -0700 @@ -31,18 +31,18 @@ extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; -#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) -#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) +#define load_TR_desc() asm volatile("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) +#define load_LDT_desc() asm volatile(&q...
2007 Apr 18
0
[PATCH 5/12] desc-cleanup
...========================== --- linux-2.6.13.orig/include/asm-i386/desc.h 2005-08-08 17:10:49.000000000 -0700 +++ linux-2.6.13/include/asm-i386/desc.h 2005-08-08 17:15:46.000000000 -0700 @@ -31,18 +31,18 @@ extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; -#define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) -#define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) +#define load_TR_desc() asm volatile("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) +#define load_LDT_desc() asm volatile(&q...
2007 Apr 18
3
[RFC, PATCH 10/24] i386 Vmi descriptor changes
...g/arch/i386/kernel/traps.c 2006-03-10 12:55:09.000000000 -0800 +++ linux-2.6.16-rc5/arch/i386/kernel/traps.c 2006-03-10 16:01:06.000000000 -0800 @@ -1043,20 +1043,6 @@ void __init trap_init_f00f_bug(void) } #endif -#define _set_gate(gate_addr,type,dpl,addr,seg) \ -do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \ - "movw %4,%%dx\n\t" \ - "movl %%eax,%0\n\t" \ - "movl %%edx,%1" \ - :"=m" (*((long *) (gate_addr))), \ - "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \ - :&...
2007 Apr 18
3
[RFC, PATCH 10/24] i386 Vmi descriptor changes
...g/arch/i386/kernel/traps.c 2006-03-10 12:55:09.000000000 -0800 +++ linux-2.6.16-rc5/arch/i386/kernel/traps.c 2006-03-10 16:01:06.000000000 -0800 @@ -1043,20 +1043,6 @@ void __init trap_init_f00f_bug(void) } #endif -#define _set_gate(gate_addr,type,dpl,addr,seg) \ -do { \ - int __d0, __d1; \ - __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \ - "movw %4,%%dx\n\t" \ - "movl %%eax,%0\n\t" \ - "movl %%edx,%1" \ - :"=m" (*((long *) (gate_addr))), \ - "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \ - :&...