Annotation of sys/arch/hppa/include/atomic.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: atomic.h,v 1.3 2007/04/26 20:52:48 miod Exp $ */
! 2:
! 3: /* Public Domain */
! 4:
! 5: #ifndef __HPPA_ATOMIC_H__
! 6: #define __HPPA_ATOMIC_H__
! 7:
! 8: #if defined(_KERNEL)
! 9:
! 10: static __inline void
! 11: atomic_setbits_int(__volatile unsigned int *uip, unsigned int v)
! 12: {
! 13: register_t eiem;
! 14:
! 15: __asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
! 16: __asm __volatile("mtctl %r0, %cr15");
! 17: *uip |= v;
! 18: __asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
! 19: }
! 20:
! 21: static __inline void
! 22: atomic_clearbits_int(__volatile unsigned int *uip, unsigned int v)
! 23: {
! 24: register_t eiem;
! 25:
! 26: __asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
! 27: __asm __volatile("mtctl %r0, %cr15");
! 28: *uip &= ~v;
! 29: __asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
! 30: }
! 31:
! 32: static __inline void
! 33: atomic_setbits_long(__volatile unsigned long *uip, unsigned long v)
! 34: {
! 35: register_t eiem;
! 36:
! 37: __asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
! 38: __asm __volatile("mtctl %r0, %cr15");
! 39: *uip |= v;
! 40: __asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
! 41: }
! 42:
! 43: static __inline void
! 44: atomic_clearbits_long(__volatile unsigned long *uip, unsigned long v)
! 45: {
! 46: register_t eiem;
! 47:
! 48: __asm __volatile("mfctl %%cr15, %0": "=r" (eiem));
! 49: __asm __volatile("mtctl %r0, %cr15");
! 50: *uip &= ~v;
! 51: __asm __volatile("mtctl %0, %%cr15":: "r" (eiem));
! 52: }
! 53:
! 54: #endif /* defined(_KERNEL) */
! 55: #endif /* __HPPA_ATOMIC_H__ */
CVSweb