diff options
| author | Kai Backman <kaib@golang.org> | 2009-05-26 11:18:42 -0700 |
|---|---|---|
| committer | Kai Backman <kaib@golang.org> | 2009-05-26 11:18:42 -0700 |
| commit | 79435569709b9cebcb30791b7a0994ed8471f609 (patch) | |
| tree | ab7b0d0719a3d8959a8b3db21ed8b29c7adf9592 /src/runtime/linux | |
| parent | 802e1a610425f23199885362786d56437f65ca6f (diff) | |
| download | go-79435569709b9cebcb30791b7a0994ed8471f609.tar.xz | |
Added enough arm related scaffolding to create a simple
hello.c program linking against the runtime.
R=rsc
APPROVED=rsc
DELTA=178 (175 added, 0 deleted, 3 changed)
OCL=29283
CL=29380
Diffstat (limited to 'src/runtime/linux')
| -rw-r--r-- | src/runtime/linux/arm/defs.h | 27 | ||||
| -rw-r--r-- | src/runtime/linux/arm/rt0.s | 6 | ||||
| -rw-r--r-- | src/runtime/linux/arm/signal.c | 4 | ||||
| -rw-r--r-- | src/runtime/linux/arm/sys.s | 15 | ||||
| -rw-r--r-- | src/runtime/linux/defs_arm.c | 54 |
5 files changed, 106 insertions, 0 deletions
diff --git a/src/runtime/linux/arm/defs.h b/src/runtime/linux/arm/defs.h new file mode 100644 index 0000000000..caad669895 --- /dev/null +++ b/src/runtime/linux/arm/defs.h @@ -0,0 +1,27 @@ +// godefs -carm-gcc -f -I/usr/local/google/src/linux-2.6.28/arch/arm/include -f -I/usr/local/google/src/linux-2.6.28/include defs_arm.c + +// MACHINE GENERATED - DO NOT EDIT. + +// Constants +enum { + PROT_NONE = 0, + PROT_READ = 0x1, + PROT_WRITE = 0x2, + PROT_EXEC = 0x4, + MAP_ANON = 0x20, + MAP_PRIVATE = 0x2, + SA_RESTART = 0x10000000, + SA_ONSTACK = 0x8000000, + SA_RESTORER = 0x4000000, + SA_SIGINFO = 0x4, +}; + +// Types +#pragma pack on + +typedef struct Timespec Timespec; +struct Timespec { + int32 tv_sec; + int32 tv_nsec; +}; +#pragma pack off diff --git a/src/runtime/linux/arm/rt0.s b/src/runtime/linux/arm/rt0.s new file mode 100644 index 0000000000..024547dddb --- /dev/null +++ b/src/runtime/linux/arm/rt0.s @@ -0,0 +1,6 @@ +// 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. + +TEXT _rt0_arm_linux(SB),7,$0 + B _rt0_arm(SB) diff --git a/src/runtime/linux/arm/signal.c b/src/runtime/linux/arm/signal.c new file mode 100644 index 0000000000..024018d5a4 --- /dev/null +++ b/src/runtime/linux/arm/signal.c @@ -0,0 +1,4 @@ +// 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. + diff --git a/src/runtime/linux/arm/sys.s b/src/runtime/linux/arm/sys.s new file mode 100644 index 0000000000..f5db32305b --- /dev/null +++ b/src/runtime/linux/arm/sys.s @@ -0,0 +1,15 @@ +// 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. + +// +// System calls and other sys.stuff for arm, Linux +// + +TEXT write(SB),7,$0 + MOVW 4(SP), R0 + MOVW 8(SP), R1 + MOVW 12(SP), R2 + SWI $0x00900004 // syscall write + RET + diff --git a/src/runtime/linux/defs_arm.c b/src/runtime/linux/defs_arm.c new file mode 100644 index 0000000000..eaec051549 --- /dev/null +++ b/src/runtime/linux/defs_arm.c @@ -0,0 +1,54 @@ +// 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. + +/* + * Input to godefs + godefs -carm-gcc -f -I/usr/local/google/src/linux-2.6.28/arch/arm/include -f + -I/usr/local/google/src/linux-2.6.28/include defs_arm.c >arm/defs.h + + * Another input file for ARM defs.h + */ + +#include <asm/signal.h> +#include <asm/mman.h> +#include <asm/sigcontext.h> +#include <asm/ucontext.h> + +/* +#include <sys/signal.h> +#include <sys/mman.h> +#include <ucontext.h> +*/ + +#include <time.h> + +enum { + $PROT_NONE = PROT_NONE, + $PROT_READ = PROT_READ, + $PROT_WRITE = PROT_WRITE, + $PROT_EXEC = PROT_EXEC, + + $MAP_ANON = MAP_ANONYMOUS, + $MAP_PRIVATE = MAP_PRIVATE, + + $SA_RESTART = SA_RESTART, + $SA_ONSTACK = SA_ONSTACK, + $SA_RESTORER = SA_RESTORER, + $SA_SIGINFO = SA_SIGINFO +}; + + + + +//typedef struct _fpreg $Fpreg; +//typedef struct _fpxreg $Fpxreg; +//typedef struct _xmmreg $Xmmreg; +//typedef struct _fpstate $Fpstate; +typedef struct timespec $Timespec; +//typedef struct timeval $Timeval; +// typedef struct sigaction $Sigaction; +// typedef siginfo_t $Siginfo; +// typedef struct sigaltstack $Sigaltstack; +// typedef struct sigcontext $Sigcontext; +// typedef struct ucontext $Ucontext; |
