Home | History | Annotate | Download | only in asm
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef __ASM_SH_SYSTEM_H
     13 #define __ASM_SH_SYSTEM_H
     14 
     15 #include <linux/irqflags.h>
     16 #include <linux/compiler.h>
     17 #include <linux/linkage.h>
     18 #include <asm/types.h>
     19 #include <asm/ptrace.h>
     20 
     21 #define AT_VECTOR_SIZE_ARCH 5
     22 
     23 #define __icbi()  {   unsigned long __addr;   __addr = 0xa8000000;   __asm__ __volatile__(   "icbi   %0\n\t"   :     : "m" (__m(__addr)));  }
     24 
     25 #define mb() __asm__ __volatile__ ("synco": : :"memory")
     26 #define rmb() mb()
     27 #define wmb() __asm__ __volatile__ ("synco": : :"memory")
     28 #define ctrl_barrier() __icbi()
     29 #define read_barrier_depends() do { } while(0)
     30 
     31 #define smp_mb() barrier()
     32 #define smp_rmb() barrier()
     33 #define smp_wmb() barrier()
     34 #define smp_read_barrier_depends() do { } while(0)
     35 
     36 #define set_mb(var, value) do { (void)xchg(&var, value); } while (0)
     37 
     38 #include <asm/cmpxchg-irq.h>
     39 
     40 #define __xchg(ptr, x, size)  ({   unsigned long __xchg__res;   volatile void *__xchg_ptr = (ptr);   switch (size) {   case 4:   __xchg__res = xchg_u32(__xchg_ptr, x);   break;   case 1:   __xchg__res = xchg_u8(__xchg_ptr, x);   break;   default:   __xchg_called_with_bad_pointer();   __xchg__res = x;   break;   }     __xchg__res;  })
     41 
     42 #define xchg(ptr,x)   ((__typeof__(*(ptr)))__xchg((ptr),(unsigned long)(x), sizeof(*(ptr))))
     43 
     44 #define __HAVE_ARCH_CMPXCHG 1
     45 
     46 #define cmpxchg(ptr,o,n)   ({   __typeof__(*(ptr)) _o_ = (o);   __typeof__(*(ptr)) _n_ = (n);   (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,   (unsigned long)_n_, sizeof(*(ptr)));   })
     47 
     48 #define instruction_size(insn) (2)
     49 
     50 #define BUILD_TRAP_HANDLER(name)  asmlinkage void name##_trap_handler(unsigned long r4, unsigned long r5,   unsigned long r6, unsigned long r7,   struct pt_regs __regs)
     51 
     52 #define TRAP_HANDLER_DECL   struct pt_regs *regs = RELOC_HIDE(&__regs, 0);   unsigned int vec = regs->tra;   (void)vec;
     53 
     54 #define arch_align_stack(x) (x)
     55 
     56 struct mem_access {
     57  unsigned long (*from)(void *dst, const void *src, unsigned long cnt);
     58  unsigned long (*to)(void *dst, const void *src, unsigned long cnt);
     59 };
     60 
     61 #include "system_32.h"
     62 
     63 #endif
     64