Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
41da64ed
Commit
41da64ed
authored
Feb 11, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: Fix chan code for big-endian strict-alignment systems
From-SVN: r184115
parent
c3b0c721
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
libgo/runtime/chan.c
+23
-8
No files found.
libgo/runtime/chan.c
View file @
41da64ed
...
@@ -409,11 +409,20 @@ closed:
...
@@ -409,11 +409,20 @@ closed:
void
void
__go_send_small
(
ChanType
*
t
,
Hchan
*
c
,
uint64
val
)
__go_send_small
(
ChanType
*
t
,
Hchan
*
c
,
uint64
val
)
{
{
byte
b
[
sizeof
(
uint64
)];
union
{
runtime_memclr
(
b
,
sizeof
(
uint64
));
byte
b
[
sizeof
(
uint64
)];
__builtin_memcpy
(
b
,
&
val
,
t
->
__element_type
->
__size
);
uint64
v
;
runtime_chansend
(
t
,
c
,
b
,
nil
);
}
u
;
byte
*
p
;
u
.
v
=
val
;
#ifndef WORDS_BIGENDIAN
p
=
u
.
b
;
#else
p
=
u
.
b
+
sizeof
(
uint64
)
-
t
->
__element_type
->
__size
;
#endif
runtime_chansend
(
t
,
c
,
p
,
nil
);
}
}
// The compiler generates a call to __go_send_big to send a value
// The compiler generates a call to __go_send_big to send a value
...
@@ -433,9 +442,15 @@ __go_receive_small(ChanType *t, Hchan* c)
...
@@ -433,9 +442,15 @@ __go_receive_small(ChanType *t, Hchan* c)
byte
b
[
sizeof
(
uint64
)];
byte
b
[
sizeof
(
uint64
)];
uint64
v
;
uint64
v
;
}
u
;
}
u
;
byte
*
p
;
u
.
v
=
0
;
u
.
v
=
0
;
runtime_chanrecv
(
t
,
c
,
u
.
b
,
nil
,
nil
);
#ifndef WORDS_BIGENDIAN
p
=
u
.
b
;
#else
p
=
u
.
b
+
sizeof
(
uint64
)
-
t
->
__element_type
->
__size
;
#endif
runtime_chanrecv
(
t
,
c
,
p
,
nil
,
nil
);
return
u
.
v
;
return
u
.
v
;
}
}
...
@@ -654,8 +669,8 @@ newselect(int32 size, Select **selp)
...
@@ -654,8 +669,8 @@ newselect(int32 size, Select **selp)
sel
->
tcase
=
size
;
sel
->
tcase
=
size
;
sel
->
ncase
=
0
;
sel
->
ncase
=
0
;
sel
->
poll
order
=
(
void
*
)(
sel
->
scase
+
size
);
sel
->
lock
order
=
(
void
*
)(
sel
->
scase
+
size
);
sel
->
lockorder
=
(
void
*
)(
sel
->
poll
order
+
size
);
sel
->
pollorder
=
(
void
*
)(
sel
->
lock
order
+
size
);
*
selp
=
sel
;
*
selp
=
sel
;
if
(
debug
)
if
(
debug
)
...
...
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