Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6016148c
Commit
6016148c
authored
Nov 07, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new alpha linux locking from Travis Melhiser <melhiser@viper.co.union.nc.us>
parent
06a70013
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
51 deletions
+21
-51
src/include/storage/s_lock.h
src/include/storage/s_lock.h
+21
-51
No files found.
src/include/storage/s_lock.h
View file @
6016148c
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.1
1 1997/10/30 05:24:19
momjian Exp $
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.1
2 1997/11/07 21:35:41
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -24,10 +24,6 @@
...
@@ -24,10 +24,6 @@
* ;
* ;
* }
* }
*
*
* In addition to modifying this file you will need to modify
* the appropriate ...src/include/port/...h file to define
* HAS_TEST_AND_SET for the appropriate circumstances.
*
* If this is not done, POSTGRES will default to using System V
* If this is not done, POSTGRES will default to using System V
* semaphores (and take a large performance hit -- around 40% of
* semaphores (and take a large performance hit -- around 40% of
* its time on a DS5000/240 is spent in semop(3)...).
* its time on a DS5000/240 is spent in semop(3)...).
...
@@ -232,31 +228,6 @@ tas_dummy()
...
@@ -232,31 +228,6 @@ tas_dummy()
#endif
/* sun3 */
#endif
/* sun3 */
/*
* M68000 ports under NetBSD.
*
* This version should also work on a sun3, but I can't test it.
* Conversely the sun3 version should work under NetBSD/m68k, but
* it doesn't.
*/
#if defined(__NetBSD__) && defined(__m68k__)
static
void
S_LOCK
(
char
*
lock
)
{
asm
(
"
movel a6@(8),a0
LOOP:
tas a0@
bmi LOOP
"
);
}
#define S_UNLOCK(lock) (*(lock) = 0)
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
#endif
/* M68000 && NetBSD */
/*
/*
* sparc machines
* sparc machines
*/
*/
...
@@ -342,29 +313,28 @@ tas_dummy()
...
@@ -342,29 +313,28 @@ tas_dummy()
#if defined(__alpha__) && defined(linux)
#if defined(__alpha__) && defined(linux)
#define S_LOCK(lock) do \
#define S_LOCK(lock) do { \
{ \
slock_t _res; \
slock_t _res; \
do { \
do \
__asm__(" ldq $0, %0 \n\
{ \
bne $0, already_set%= \n\
__asm__(" ldq $0, %0 \n\
ldq_l $0, %0 \n\
bne $0, already_set \n\
bne $0, already_set%= \n\
ldq_l $0, %0 \n\
or $31, 1, $0 \n\
bne $0, already_set \n\
stq_c $0, %0 \n\
or $31, 1, $0 \n\
beq $0, stqc_fail%= \n\
stq_c $0, %0 \n\
success%=: \n\
beq $0, stqc_fail \n\
bis $31, $31, %1 \n\
success: bis $31, $31, %1 \n\
mb \n\
mb \n\
jmp $31, end%= \n\
jmp $31, end \n\
stqc_fail%=: or $31, 1, $0 \n\
stqc_fail: or $31, 1, $0 \n\
already_set%=: bis $0, $0, %1 \n\
already_set: bis $0, $0, %1 \n\
end%=: nop ": "=m"(*lock), "=r"(_res): :"0"); \
end: nop ": "=m"(*lock), "=r"(_res): :"0"); \
} while (_res != 0); \
} while (_res != 0); \
} while (0)
} while (0)
#define S_UNLOCK(lock) (
__asm__("mb"), *(lock) = 0
)
#define S_UNLOCK(lock) (
{ __asm__("mb \n"); *(lock) = 0; }
)
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment