Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
b9b5f9c3
Commit
b9b5f9c3
authored
Mar 21, 2012
by
Grzegorz Daniluk
Committed by
Alessandro Rubini
Mar 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: add some io functions
parent
2ad8a9f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
2 deletions
+43
-2
spec-io.c
arch-spec/spec-io.c
+43
-2
No files found.
arch-spec/spec-io.c
View file @
b9b5f9c3
...
...
@@ -5,6 +5,8 @@
#include <hw/wb_uart.h>
#include "spec.h"
const
Integer32
PP_ADJ_FREQ_MAX
=
512000
;
//GGDD value ?
void
pp_puts
(
const
char
*
s
)
{
spec_puts
(
s
);
...
...
@@ -29,9 +31,10 @@ void *pp_memcpy(void *dest, const void *src, int count)
return
dest
;
}
void
pp_get_tstamp
(
uint32_t
*
sptr
)
void
pp_get_tstamp
(
TimeInternal
*
t
)
//
uint32_t *sptr)
{
*
sptr
=
htonl
(
spec_time
());
//*sptr = htonl(spec_time());
t
->
seconds
=
htonl
(
spec_time
());
}
/* What follows has no prefix because it's only used by arch code */
...
...
@@ -45,6 +48,11 @@ char *strcpy(char *dest, const char *src)
return
tmp
;
}
void
*
pp_memset
(
void
*
s
,
int
c
,
int
count
)
{
return
memset
(
s
,
c
,
count
);
}
void
*
memset
(
void
*
s
,
int
c
,
int
count
)
{
/* from u-boot-1.1.2 */
...
...
@@ -66,3 +74,36 @@ void *memcpy(void *dest, const void *src, int count)
return
dest
;
}
int
pp_memcmp
(
const
void
*
s1
,
const
void
*
s2
,
int
count
)
{
unsigned
char
*
u1
=
(
unsigned
char
*
)
s1
;
unsigned
char
*
u2
=
(
unsigned
char
*
)
s2
;
while
(
count
--
!=
0
)
{
if
(
*
u1
!=
*
u2
)
return
(
*
u1
<
*
u2
)
?
-
1
:
+
1
;
u1
++
;
u2
++
;
}
return
0
;
}
int32_t
spec_set_tstamp
(
TimeInternal
*
t
)
{
//GGDD
return
0
;
}
int
spec_adj_freq
(
Integer32
adj
)
{
//GGDD
return
0
;
}
int
pp_adj_freq
(
Integer32
adj
)
__attribute__
((
alias
(
"spec_adj_freq"
)));
int32_t
pp_set_tstamp
(
TimeInternal
*
t
)
__attribute__
((
alias
(
"spec_set_tstamp"
)));
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