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
9f5264f2
Commit
9f5264f2
authored
Jan 27, 2010
by
Kai Backman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small embedded target for arm.
R=rsc CC=golang-dev
https://golang.org/cl/193104
parent
cb58ed75
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
129 additions
and
0 deletions
+129
-0
README
src/pkg/runtime/embedded/README
+4
-0
defs.h
src/pkg/runtime/embedded/arm/defs.h
+1
-0
rt0.s
src/pkg/runtime/embedded/arm/rt0.s
+1
-0
signal.c
src/pkg/runtime/embedded/arm/signal.c
+1
-0
sys.s
src/pkg/runtime/embedded/arm/sys.s
+1
-0
mem.c
src/pkg/runtime/embedded/mem.c
+40
-0
os.h
src/pkg/runtime/embedded/os.h
+1
-0
thread.c
src/pkg/runtime/embedded/thread.c
+80
-0
No files found.
src/pkg/runtime/embedded/README
0 → 100644
View file @
9f5264f2
small embedded target for arm
define the c function write to make debug output work
src/pkg/runtime/embedded/arm/defs.h
0 → 100644
View file @
9f5264f2
// nothing to see here
src/pkg/runtime/embedded/arm/rt0.s
0 → 100644
View file @
9f5264f2
// nothing to see here
src/pkg/runtime/embedded/arm/signal.c
0 → 100644
View file @
9f5264f2
// nothing to see here
src/pkg/runtime/embedded/arm/sys.s
0 → 100644
View file @
9f5264f2
// nothing to see here
src/pkg/runtime/embedded/mem.c
0 → 100644
View file @
9f5264f2
// Copyright 2010 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 "runtime.h"
#include "malloc.h"
// Assume there's an arbitrary amount of memory starting at "end".
void
*
SysAlloc
(
uintptr
ask
)
{
static
byte
*
p
;
extern
byte
end
[];
byte
*
q
;
if
(
p
==
nil
)
{
p
=
end
;
p
+=
7
&
-
(
uintptr
)
p
;
}
ask
+=
7
&
-
ask
;
q
=
p
;
p
+=
ask
;
·
memclr
(
q
,
ask
);
return
q
;
}
void
SysFree
(
void
*
v
,
uintptr
n
)
{
USED
(
v
,
n
);
}
void
SysUnused
(
void
*
v
,
uintptr
n
)
{
USED
(
v
,
n
);
}
src/pkg/runtime/embedded/os.h
0 → 100644
View file @
9f5264f2
// nothing to see here
src/pkg/runtime/embedded/thread.c
0 → 100644
View file @
9f5264f2
// Copyright 2010 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 "runtime.h"
int8
*
goos
=
"embedded"
;
void
minit
(
void
)
{
}
void
osinit
(
void
)
{
}
void
initsig
(
void
)
{
}
void
exit
(
int32
)
{
for
(;;);
}
// single processor, no interrupts,
// so no need for real concurrency or atomicity
void
newosproc
(
M
*
m
,
G
*
g
,
void
*
stk
,
void
(
*
fn
)(
void
))
{
USED
(
m
,
g
,
stk
,
fn
);
throw
(
"newosproc"
);
}
void
lock
(
Lock
*
l
)
{
if
(
m
->
locks
<
0
)
throw
(
"lock count"
);
m
->
locks
++
;
if
(
l
->
key
!=
0
)
throw
(
"deadlock"
);
l
->
key
=
1
;
}
void
unlock
(
Lock
*
l
)
{
m
->
locks
--
;
if
(
m
->
locks
<
0
)
throw
(
"lock count"
);
if
(
l
->
key
!=
1
)
throw
(
"unlock of unlocked lock"
);
l
->
key
=
0
;
}
void
noteclear
(
Note
*
n
)
{
n
->
lock
.
key
=
0
;
}
void
notewakeup
(
Note
*
n
)
{
n
->
lock
.
key
=
1
;
}
void
notesleep
(
Note
*
n
)
{
if
(
n
->
lock
.
key
!=
1
)
throw
(
"notesleep"
);
}
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