Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
6a48aab7
Commit
6a48aab7
authored
Nov 12, 2009
by
Kai Backman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for pre arm v6 cas. set GOARM=5 to enable.
R=rsc
https://golang.org/cl/154101
parent
c4034225
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
Makefile
src/pkg/runtime/Makefile
+3
-1
cas5.s
src/pkg/runtime/arm/cas5.s
+43
-0
cas6.s
src/pkg/runtime/arm/cas6.s
+0
-0
No files found.
src/pkg/runtime/Makefile
View file @
6a48aab7
...
...
@@ -28,9 +28,11 @@ OFILES_386=\
vlop.
$O
\
vlrt.
$O
\
GOARM
?=
6
# arm-specific object files
OFILES_arm
=
\
cas.
$O
\
cas
$(GOARM)
.
$O
\
memset.
$O
\
vlop.
$O
\
vlrt.
$O
\
...
...
src/pkg/runtime/arm/cas5.s
0 → 100644
View file @
6a48aab7
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "arm/asm.h"
// This version works on pre v6 architectures
// bool cas(int32 *val, int32 old, int32 new)
// Atomically:
// if(*val == old){
// *val = new;
// return 1;
// }else
// return 0;
TEXT cas(SB),7,$0
MOVW 0(FP), R0 // *val
MOVW 4(FP), R1 // old
MOVW 8(FP), R2 // new
MOVW $1, R3
MOVW $cas_mutex(SB), R4
l:
SWPW (R4), R3 // acquire mutex
CMP $0, R3
BNE fail0
MOVW (R0), R5
CMP R1, R5
BNE fail1
MOVW R2, (R0)
MOVW R3, (R4) // release mutex
MOVW $1, R0
RET
fail1:
MOVW R3, (R4) // release mutex
fail0:
MOVW $0, R0
RET
DATA cas_mutex(SB)/4, $0
GLOBL cas_mutex(SB), $4
src/pkg/runtime/arm/cas.s
→
src/pkg/runtime/arm/cas
6
.s
View file @
6a48aab7
File moved
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