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
950ee183
Commit
950ee183
authored
Sep 20, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: fix NaCl
missing from last CL, sorry R=r CC=golang-dev
https://golang.org/cl/2214043
parent
33c4ff06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
mksyscall.sh
src/pkg/syscall/mksyscall.sh
+14
-3
No files found.
src/pkg/syscall/mksyscall.sh
View file @
950ee183
...
...
@@ -16,6 +16,7 @@
$cmdline
=
"mksyscall.sh "
.
join
(
' '
, @ARGV
)
;
$errors
=
0
;
$_32bit
=
""
;
$nacl
=
0
;
if
(
$ARGV
[
0] eq
"-b32"
)
{
$_32bit
=
"big-endian"
;
...
...
@@ -24,6 +25,10 @@ if($ARGV[0] eq "-b32") {
$_32bit
=
"little-endian"
;
shift
;
}
if
(
$ARGV
[
0] eq
"-nacl"
)
{
$nacl
=
1
;
shift
;
}
if
(
$ARGV
[
0]
=
~ /^-/
)
{
print STDERR
"usage: mksyscall.sh [-b32 | -l32] [file ...]
\n
"
;
...
...
@@ -89,9 +94,15 @@ while(<>) {
# Convert slice into pointer, length.
# Have to be careful not to take address of &a[0] if len == 0:
# pass nil in that case.
$text
.
=
"
\t
var _p
$n
*
$1
\n
"
;
$text
.
=
"
\t
if len(
$name
) > 0 {
\n\t\t
_p
$n
=
\&
${
name
}
[0]
\n\t
}
\n
"
;
push @args,
"uintptr(unsafe.Pointer(_p
$n
))"
,
"uintptr(len(
$name
))"
;
$text
.
=
"
\t
var _p
$n
unsafe.Pointer
\n
"
;
$text
.
=
"
\t
if len(
$name
) > 0 {
\n\t\t
_p
$n
= unsafe.Pointer(
\&
${
name
}
[0])
\n\t
}"
;
if
(
$nacl
)
{
# NaCl rejects zero length write with nil pointer,
# so use non-nil pointer.
$text
.
=
" else {
\n\t\t
_p
$n
= unsafe.Pointer(&_zero[0])
\n\t
}"
;
}
$text
.
=
"
\n
"
;
push @args,
"uintptr(_p
$n
)"
,
"uintptr(len(
$name
))"
;
$n
++
;
}
elsif
(
$type
eq
"int64"
&&
$_32bit
ne
""
)
{
if
(
$_32bit
eq
"big-endian"
)
{
...
...
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