From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Michael Richards <miker(at)fastmail(dot)ca> |
Cc: | pgsql-patches(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: Hack to make postgres compile on Dec 4.0f with GCC |
Date: | 2000-06-09 17:33:00 |
Message-ID: | 200006091733.NAA19468@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
Can someone make a suggestion here?
> Hi.
>
> Here is a patch I hacked together. I didn't understand the TAS thing, and
> it appeared to be the cause of the problem. I hacked the code up by
> commenting out the assembly TAS provided and inserting the semaphore
> macros for the non-gcc alpha version. Perhaps someone with expertise in
> this area could assist in fixing the provided TAS.
>
> Here is the patch:
>
> -Michael
>
> *** include/storage/s_lock.h Tue Mar 14 23:01:08 2000
> --- include/storage/s_lock.h.bak Sat Mar 11 19:21:30 2000
> ***************
> *** 79,85 ****
> */
>
> #if defined(__alpha__)
> ! /*#define TAS(lock) tas(lock)
> #define S_UNLOCK(lock) { __asm__("mb"); *(lock) = 0; }
>
> static __inline__ int
> --- 79,85 ----
> */
>
> #if defined(__alpha__)
> ! #define TAS(lock) tas(lock)
> #define S_UNLOCK(lock) { __asm__("mb"); *(lock) = 0; }
>
> static __inline__ int
> ***************
> *** 102,118 ****
> 4: nop ": "=m"(*lock), "=r"(_res): :"0");
>
> return (int) _res;
> ! }*/
> ! /*
> ! * OSF/1 (Alpha AXP)
> ! *
> ! * Note that slock_t on the Alpha AXP is msemaphore instead of char
> ! * (see storage/ipc.h).
> ! */
> ! #define TAS(lock) (msem_lock((lock), MSEM_IF_NOWAIT) < 0)
> ! #define S_UNLOCK(lock) msem_unlock((lock), 0)
> ! #define S_INIT_LOCK(lock) msem_init((lock), MSEM_UNLOCKED)
> ! #define S_LOCK_FREE(lock) (!(lock)->msem_state)
>
> #endif /* __alpha__ */
>
> --- 102,108 ----
> 4: nop ": "=m"(*lock), "=r"(_res): :"0");
>
> return (int) _res;
> ! }
>
> #endif /* __alpha__ */
>
>
>
--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2000-06-09 17:33:28 | Re: libpq problems in CVS |
Previous Message | Bruce Momjian | 2000-06-09 17:29:26 | Re: Fix for RENAME |
From | Date | Subject | |
---|---|---|---|
Next Message | Giles Lean | 2000-06-09 20:46:23 | Re: BeOS take 2 |
Previous Message | Bruce Momjian | 2000-06-09 17:27:37 | Re: Another jdbc2 ResultSet patch |