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
c52bb3e1
Commit
c52bb3e1
authored
Feb 11, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial: arch-bare-i386/: checkpatch fixes
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
7255f628
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
145 additions
and
139 deletions
+145
-139
bare-i386.h
arch-bare-i386/bare-i386.h
+69
-66
bare-io.c
arch-bare-i386/bare-io.c
+11
-11
bare-socket.c
arch-bare-i386/bare-socket.c
+20
-21
bare-startup.c
arch-bare-i386/bare-startup.c
+1
-1
bare-timer.c
arch-bare-i386/bare-timer.c
+6
-6
syscalls.c
arch-bare-i386/syscalls.c
+4
-3
syscalls.h
arch-bare-i386/syscalls.h
+34
-31
No files found.
arch-bare-i386/bare-i386.h
View file @
c52bb3e1
...
...
@@ -84,8 +84,7 @@ struct bare_sockaddr_ll {
/* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
#define SOL_IP 0
/* #define SOL_ICMP 1 No-no-no! Due to Linux :-) we cannot use
SOL_ICMP=1 */
/* #define SOL_ICMP 1 No-no-no! We cannot use SOL_ICMP=1 */
#define SOL_TCP 6
#define SOL_UDP 17
#define SOL_IPV6 41
...
...
@@ -195,6 +194,7 @@ struct bare_timeval {
#define ADJ_STATUS 0x0010
/* clock status */
#define ADJ_TIMECONST 0x0020
/* pll time constant */
#define ADJ_TAI 0x0080
/* set TAI offset */
#define ADJ_SETOFFSET 0x0100
/* add 'time' to current time */
#define ADJ_MICRO 0x1000
/* select microsecond resolution */
#define ADJ_NANO 0x2000
/* select nanosecond resolution */
#define ADJ_TICK 0x4000
/* tick value */
...
...
@@ -209,6 +209,9 @@ struct bare_timeval {
#define MOD_ESTERROR ADJ_ESTERROR
#define MOD_STATUS ADJ_STATUS
#define MOD_TIMECONST ADJ_TIMECONST
#define MOD_TAI ADJ_TAI
#define MOD_MICRO ADJ_MICRO
#define MOD_NANO ADJ_NANO
struct
bare_timex
{
unsigned
int
modes
;
/* mode selector */
...
...
@@ -222,7 +225,7 @@ struct bare_timex {
long
tolerance
;
/* clock frequency tolerance (ppm)
* (read only)
*/
struct
bare_timeval
time
;
/* (read only
) */
struct
bare_timeval
time
;
/* (RO, except for ADJ_SETOFFSET
) */
long
tick
;
/* (modified) usecs between clock ticks */
long
ppsfreq
;
/* pps frequency (scaled ppm) (ro) */
...
...
arch-bare-i386/bare-io.c
View file @
c52bb3e1
...
...
@@ -71,7 +71,7 @@ int pp_memcmp(const void *cs, const void *ct, int count)
const
unsigned
char
*
su1
,
*
su2
;
int
res
=
0
;
for
(
su1
=
cs
,
su2
=
ct
;
0
<
count
;
++
su1
,
++
su2
,
count
--
)
for
(
su1
=
cs
,
su2
=
ct
;
0
<
count
;
++
su1
,
++
su2
,
count
--
)
if
((
res
=
*
su1
-
*
su2
)
!=
0
)
break
;
return
res
;
...
...
arch-bare-i386/bare-socket.c
View file @
c52bb3e1
...
...
@@ -28,11 +28,10 @@ int bare_send_packet(struct pp_instance *ppi, void *pkt, int len,
hdr
=
PROTO_HDR
(
pkt
);
hdr
->
h_proto
=
htons
(
ETH_P_1588
);
if
(
OPTS
(
ppi
)
->
gptp_mode
)
{
if
(
OPTS
(
ppi
)
->
gptp_mode
)
memcpy
(
hdr
->
h_dest
,
PP_PEER_MACADDRESS
,
6
);
}
else
{
else
memcpy
(
hdr
->
h_dest
,
PP_MCAST_MACADDRESS
,
6
);
}
/* raw socket implementation always uses gen socket */
memcpy
(
hdr
->
h_source
,
NP
(
ppi
)
->
ch
[
PP_NP_GEN
].
addr
,
6
);
...
...
arch-bare-i386/bare-startup.c
View file @
c52bb3e1
arch-bare-i386/bare-timer.c
View file @
c52bb3e1
...
...
@@ -9,7 +9,7 @@ int bare_timer_init(struct pp_instance *ppi)
{
uint32_t
i
;
for
(
i
=
0
;
i
<
PP_TIMER_ARRAY_SIZE
;
i
++
)
for
(
i
=
0
;
i
<
PP_TIMER_ARRAY_SIZE
;
i
++
)
ppi
->
timers
[
i
]
=
&
bare_timers
[
i
];
return
0
;
...
...
@@ -27,7 +27,7 @@ int bare_timer_start(uint32_t interval_ms, struct pp_timer *tm)
int
bare_timer_stop
(
struct
pp_timer
*
tm
)
{
tm
->
interval_ms
=
0
;
tm
->
interval_ms
=
0
;
tm
->
start
=
0
;
return
0
;
...
...
@@ -39,7 +39,7 @@ int bare_timer_expired(struct pp_timer *tm)
uint64_t
now_ms
;
if
(
tm
->
start
==
0
)
{
PP_PRINTF
(
"%
p Warning: bare_timer_expired: timer not started
\n
"
,
tm
);
PP_PRINTF
(
"%
s: Warning: timer %p not started
\n
"
,
__func__
,
tm
);
return
0
;
}
...
...
arch-bare-i386/syscalls.c
View file @
c52bb3e1
...
...
@@ -24,8 +24,8 @@ _syscall1(int, time, void *, tz)
_syscall3
(
int
,
ioctl
,
int
,
fd
,
int
,
cmd
,
void
*
,
arg
)
_syscall1
(
int
,
select
,
struct
sel_arg_struct
*
,
as
)
static
_syscall2
(
int
,
socketcall
,
int
,
call
,
unsigned
long
*
,
args
)
_syscall2
(
int
,
gettimeofday
,
void
*
,
tv
,
void
*
,
z
);
_syscall2
(
int
,
settimeofday
,
void
*
,
tv
,
void
*
,
z
);
_syscall2
(
int
,
gettimeofday
,
void
*
,
tv
,
void
*
,
z
);
_syscall2
(
int
,
settimeofday
,
void
*
,
tv
,
void
*
,
z
);
_syscall1
(
int
,
adjtimex
,
void
*
,
tv
);
_syscall2
(
int
,
clock_gettime
,
int
,
clock
,
void
*
,
t
);
_syscall1
(
int
,
close
,
int
,
fd
);
...
...
@@ -140,7 +140,8 @@ int sys_shutdown(int fd, int flags)
return
socketcall
(
SYS_SHUTDOWN
,
args
);
}
int
sys_setsockopt
(
int
fd
,
int
level
,
int
optname
,
const
void
*
optval
,
int
optlen
)
int
sys_setsockopt
(
int
fd
,
int
level
,
int
optname
,
const
void
*
optval
,
int
optlen
)
{
args
[
0
]
=
fd
;
args
[
1
]
=
level
;
...
...
arch-bare-i386/syscalls.h
View file @
c52bb3e1
...
...
@@ -17,80 +17,83 @@ do { \
} while (0)
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall0(type,name) \
#define _syscall0(type,
name) \
type name(void) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name)); \
__syscall_return(type,__res); \
__syscall_return(type,
__res); \
}
#define _syscall1(type,
name,type1,
arg1) \
#define _syscall1(type,
name, type1,
arg1) \
type name(type1 arg1) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),"b" ((long)(arg1))); \
__syscall_return(type,__res); \
: "0" (__NR_##name),
"b" ((long)(arg1))); \
__syscall_return(type,
__res); \
}
#define _syscall2(type,
name,type1,arg1,type2,
arg2) \
type name(type1 arg1,type2 arg2) \
#define _syscall2(type,
name, type1, arg1, type2,
arg2) \
type name(type1 arg1,
type2 arg2) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2))); \
__syscall_return(type,__res); \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2))); \
__syscall_return(type,
__res); \
}
#define _syscall3(type,
name,type1,arg1,type2,arg2,type3,
arg3) \
type name(type1 arg1,
type2 arg2,
type3 arg3) \
#define _syscall3(type,
name, type1, arg1, type2, arg2, type3,
arg3) \
type name(type1 arg1,
type2 arg2,
type3 arg3) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
"d" ((long)(arg3))); \
__syscall_return(type,__res); \
__syscall_return(type,
__res); \
}
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
#define _syscall4(type, name, type1, arg1, type2, arg2, type3, arg3, \
type4, arg4) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
"d" ((long)(arg3)),"S" ((long)(arg4))); \
__syscall_return(type,__res); \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
"d" ((long)(arg3)),
"S" ((long)(arg4))); \
__syscall_return(type,
__res); \
}
#define _syscall5(type,
name,type1,arg1,type2,arg2,type3,arg3,type4,arg4
, \
type5,
arg5) \
type name
(type1 arg1,type2 arg2,type3 arg3,type4 arg4,
type5 arg5) \
#define _syscall5(type,
name, type1, arg1, type2, arg2, type3, arg3
, \
type4, arg4, type5,
arg5) \
type name
(type1 arg1, type2 arg2, type3 arg3, type4 arg4,
type5 arg5) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
: "=a" (__res) \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
"d" ((long)(arg3)),
"S" ((long)(arg4)),
"D" ((long)(arg5))); \
__syscall_return(type,__res); \
: "0" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
"d" ((long)(arg3)),
"S" ((long)(arg4)),
"D" ((long)(arg5))); \
__syscall_return(type,
__res); \
}
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5,type6,arg6) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
#define _syscall6(type, name, type1, arg1, type2, arg2, type3, arg3, \
type4, arg4, type5, arg5, type6, arg6) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, \
type6 arg6) \
{ \
long __res; \
__asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; int $0x80 ; pop %%ebp" \
__asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; " \
"movl %1,%%eax ; int $0x80 ; pop %%ebp" \
: "=a" (__res) \
: "i" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
"d" ((long)(arg3)),
"S" ((long)(arg4)),
"D" ((long)(arg5)), \
: "i" (__NR_##name),
"b" ((long)(arg1)),
"c" ((long)(arg2)), \
"d" ((long)(arg3)),
"S" ((long)(arg4)),
"D" ((long)(arg5)), \
"0" ((long)(arg6))); \
__syscall_return(type,__res); \
__syscall_return(type,
__res); \
}
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