Re: [HACKERS] spinlock code for ns32k (again)

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] spinlock code for ns32k (again)
Дата
Msg-id 199810021522.LAA07792@candle.pha.pa.us
обсуждение исходный текст
Ответ на spinlock code for ns32k (again)  (Jon Buller <jonb@metronet.com>)
Список pgsql-hackers
Applied.

> Here's the new diff for getting the NS32K assembly code into the
> spin-locks.  Notice that it's now inline assembler in s_lock.h,
> rather than seperate code in s_lock.c.  It also shrank a little
> bit...  Just rip out the S_LOCK() define and insert the tas() inline
> function.  Please let me know if there are any problems with it.
>
> Jon Buller
>
>
>
> Index: src/include/storage/s_lock.h
> ===================================================================
> RCS file: /usr/local/cvsroot/pgsql/src/include/storage/s_lock.h,v
> retrieving revision 1.50
> diff -r1.50 s_lock.h
> 170a171,186
> > #if defined(NEED_NS32K_TAS_ASM)
> > #define TAS(lock) tas(lock)
> >
> > static __inline__ int
> > tas(volatile slock_t *lock)
> > {
> >   register _res;
> >   __asm__("sbitb 0, %0
> >     sfsd %1"
> >     : "=m"(*lock), "=r"(_res));
> >   return (int) _res;
> > }
> >
> > #endif  /* NEED_NS32K_TAS_ASM */
> >
> >
> 214,231d229
> <
> <
> <
> < #if defined(NEED_NS32K_TAS_ASM)
> <
> < #define S_LOCK(lock)                \
> < {                        \
> <     slock_t res = 1;                \
> <     while (res) {                \
> <       __asm__("movqd 0, r0");            \
> <       __asm__("sbitd r0, %0" : "=m"(*lock));    \
> <       __asm__("sprb us, %0" : "=r" (res));    \
> <       res = ((res >> 5) & 1);            \
> <     }                        \
> < }
> <
> < #endif     /* NEED_NS32K_TAS_ASM */
> <
>
>


--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] regproc fix
Следующее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: [HACKERS] regproc fix