Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
7233aae5
Commit
7233aae5
authored
22 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Fix PPC s_lock operations to work correctly on multi-CPU machines.
Need 'isync' during TAS and 'sync' during S_UNLOCK.
parent
b2735fcd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/storage/lmgr/s_lock.c
+6
-1
6 additions, 1 deletion
src/backend/storage/lmgr/s_lock.c
src/include/storage/s_lock.h
+16
-1
16 additions, 1 deletion
src/include/storage/s_lock.h
with
22 additions
and
2 deletions
src/backend/storage/lmgr/s_lock.c
+
6
−
1
View file @
7233aae5
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/s_lock.c,v 1.
8
2002/0
6
/2
0 20:29:35 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/s_lock.c,v 1.
9
2002/0
9
/2
1 00:14:05 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -115,6 +115,9 @@ _success: \n\
...
@@ -115,6 +115,9 @@ _success: \n\
/* used in darwin. */
/* used in darwin. */
/* We key off __APPLE__ here because this function differs from
/* We key off __APPLE__ here because this function differs from
* the LinuxPPC implementation only in compiler syntax.
* the LinuxPPC implementation only in compiler syntax.
*
* NOTE: per the Enhanced PowerPC Architecture manual, v1.0 dated 7-May-2002,
* an isync is a sufficient synchronization barrier after a lwarx/stwcx loop.
*/
*/
static
void
static
void
tas_dummy
()
tas_dummy
()
...
@@ -134,6 +137,7 @@ tas: \n\
...
@@ -134,6 +137,7 @@ tas: \n\
fail: li r3,1
\n
\
fail: li r3,1
\n
\
blr
\n
\
blr
\n
\
success:
\n
\
success:
\n
\
isync
\n
\
li r3,0
\n
\
li r3,0
\n
\
blr
\n
\
blr
\n
\
"
);
"
);
...
@@ -158,6 +162,7 @@ tas: \n\
...
@@ -158,6 +162,7 @@ tas: \n\
fail: li 3,1
\n
\
fail: li 3,1
\n
\
blr
\n
\
blr
\n
\
success:
\n
\
success:
\n
\
isync
\n
\
li 3,0
\n
\
li 3,0
\n
\
blr
\n
\
blr
\n
\
"
);
"
);
...
...
This diff is collapsed.
Click to expand it.
src/include/storage/s_lock.h
+
16
−
1
View file @
7233aae5
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: s_lock.h,v 1.10
0
2002/09/
02 04:42:52 momjian
Exp $
* $Id: s_lock.h,v 1.10
1
2002/09/
21 00:14:05 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -217,6 +217,21 @@ tas(volatile slock_t *lock)
...
@@ -217,6 +217,21 @@ tas(volatile slock_t *lock)
#endif
/* defined(__mc68000__) && defined(__linux__) */
#endif
/* defined(__mc68000__) && defined(__linux__) */
#if defined(__ppc__) || defined(__powerpc__)
/*
* We currently use out-of-line assembler for TAS on PowerPC; see s_lock.c.
* S_UNLOCK is almost standard but requires a "sync" instruction.
*/
#define S_UNLOCK(lock) \
do \
{\
__asm__ __volatile__ (" sync \n"); \
*((volatile slock_t *) (lock)) = 0; \
} while (0)
#endif
/* defined(__ppc__) || defined(__powerpc__) */
#if defined(NEED_VAX_TAS_ASM)
#if defined(NEED_VAX_TAS_ASM)
/*
/*
* VAXen -- even multiprocessor ones
* VAXen -- even multiprocessor ones
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment