summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/mksyscall.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/syscall/mksyscall.pl')
-rwxr-xr-xsrc/pkg/syscall/mksyscall.pl18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/pkg/syscall/mksyscall.pl b/src/pkg/syscall/mksyscall.pl
index df47958ea..b4ece9a54 100755
--- a/src/pkg/syscall/mksyscall.pl
+++ b/src/pkg/syscall/mksyscall.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
# 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.
@@ -27,6 +27,7 @@ my $_32bit = "";
my $plan9 = 0;
my $openbsd = 0;
my $netbsd = 0;
+my $dragonfly = 0;
my $arm = 0; # 64-bit value should use (even, odd)-pair
if($ARGV[0] eq "-b32") {
@@ -48,6 +49,10 @@ if($ARGV[0] eq "-netbsd") {
$netbsd = 1;
shift;
}
+if($ARGV[0] eq "-dragonfly") {
+ $dragonfly = 1;
+ shift;
+}
if($ARGV[0] eq "-arm") {
$arm = 1;
shift;
@@ -159,6 +164,17 @@ while(<>) {
} else {
push @args, "uintptr($name)";
}
+ } elsif($type eq "int64" && $dragonfly) {
+ if ($func !~ /^extp(read|write)/i) {
+ push @args, "0";
+ }
+ if($_32bit eq "big-endian") {
+ push @args, "uintptr($name>>32)", "uintptr($name)";
+ } elsif($_32bit eq "little-endian") {
+ push @args, "uintptr($name)", "uintptr($name>>32)";
+ } else {
+ push @args, "uintptr($name)";
+ }
} elsif($type eq "int64" && $_32bit ne "") {
if(@args % 2 && $arm) {
# arm abi specifies 64-bit argument uses