s_lock.h line 178

Started by Andreas Zeugswetterabout 27 years ago4 messages
#1Andreas Zeugswetter
andreas.zeugswetter@telecom.at

Needs continuation character for portability:

*** s_lock.h.ori	Tue Oct 13 14:21:55 1998
--- s_lock.h	Tue Oct 27 18:03:57 
1998
***************
*** 175,181 ****
  tas(volatile slock_t *lock)
  {
   register _res;
!   __asm__("sbitb 0, %0
  	sfsd %1"
  	: "=m"(*lock), 
"=r"(_res));
    return (int) _res; 
--- 175,181 ----
  tas(volatile 
slock_t *lock)
  {
    register _res;
!   __asm__("sbitb 0, %0 \
  	sfsd 
%1"
  	: "=m"(*lock), "=r"(_res));
    return (int) _res; 
#2Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Andreas Zeugswetter (#1)
Re: [HACKERS] s_lock.h line 178

Applied by hand. Moved %1 up to the proper line.

Needs continuation character for portability:
slock_t *lock)
{
register _res;
! __asm__("sbitb 0, %0 \
sfsd
%1"
: "=m"(*lock), "=r"(_res));
return (int) _res;

-- 
  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
#3Andreas Zeugswetter
andreas.zeugswetter@telecom.at
In reply to: Bruce Momjian (#2)
Re: [HACKERS] s_lock.h line 178

Except that now causes an illegal instruction fault, since the
assembler thinks the second instruction is some of the args to
the first. Will '\n\' work instead of '\' as I modified the
patch below?

Yes, sorry, therefore only this will work.

*** s_lock.h.ori	Tue Oct 13 14:21:55 1998
--- s_lock.h	Tue Oct 27 18:03:57 
1998
***************
*** 175,181 ****
  tas(volatile slock_t *lock)
  {
   register _res;
!   __asm__("sbitb 0, %0
  	sfsd %1"
  	: "=m"(*lock), 
"=r"(_res));
    return (int) _res; 
--- 175,181 ----
  tas(volatile 
slock_t *lock)
  {
    register _res;
!   __asm__("sbitb 0, %0 \n\
  	sfsd %1"
  	: "=m"(*lock), "=r"(_res));
    return (int) _res; 
#4Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Andreas Zeugswetter (#3)
Re: [HACKERS] s_lock.h line 178

Applied manually. Patch was wrapped.

Except that now causes an illegal instruction fault, since the
assembler thinks the second instruction is some of the args to
the first. Will '\n\' work instead of '\' as I modified the
patch below?

Yes, sorry, therefore only this will work.

*** s_lock.h.ori	Tue Oct 13 14:21:55 1998
--- s_lock.h	Tue Oct 27 18:03:57 
1998
***************
*** 175,181 ****
tas(volatile slock_t *lock)
{

register _res;
! __asm__("sbitb 0, %0
sfsd %1"
: "=m"(*lock),
"=r"(_res));

^^^^^^^^^^^^^^^^^^^^^^^^^^

return (int) _res; 
--- 175,181 ----
tas(volatile 
slock_t *lock)
{
register _res;
!   __asm__("sbitb 0, %0 \n\
sfsd %1"
: "=m"(*lock), "=r"(_res));
return (int) _res; 
-- 
  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