Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
1f782376
Commit
1f782376
authored
Nov 20, 2002
by
William Lee Irwin III
Committed by
Arnaldo Carvalho de Melo
Nov 20, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sched: privatizes the sibling inlines to sched.c, the sole caller of them.
parent
3d427517
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
54 deletions
+48
-54
include/linux/sched.h
include/linux/sched.h
+0
-54
kernel/sched.c
kernel/sched.c
+18
-0
kernel/signal.c
kernel/signal.c
+30
-0
No files found.
include/linux/sched.h
View file @
1f782376
...
...
@@ -524,36 +524,6 @@ extern int kill_proc(pid_t, int, int);
extern
int
do_sigaction
(
int
,
const
struct
k_sigaction
*
,
struct
k_sigaction
*
);
extern
int
do_sigaltstack
(
const
stack_t
*
,
stack_t
*
,
unsigned
long
);
/*
* Re-calculate pending state from the set of locally pending
* signals, globally pending signals, and blocked signals.
*/
static
inline
int
has_pending_signals
(
sigset_t
*
signal
,
sigset_t
*
blocked
)
{
unsigned
long
ready
;
long
i
;
switch
(
_NSIG_WORDS
)
{
default:
for
(
i
=
_NSIG_WORDS
,
ready
=
0
;
--
i
>=
0
;)
ready
|=
signal
->
sig
[
i
]
&~
blocked
->
sig
[
i
];
break
;
case
4
:
ready
=
signal
->
sig
[
3
]
&~
blocked
->
sig
[
3
];
ready
|=
signal
->
sig
[
2
]
&~
blocked
->
sig
[
2
];
ready
|=
signal
->
sig
[
1
]
&~
blocked
->
sig
[
1
];
ready
|=
signal
->
sig
[
0
]
&~
blocked
->
sig
[
0
];
break
;
case
2
:
ready
=
signal
->
sig
[
1
]
&~
blocked
->
sig
[
1
];
ready
|=
signal
->
sig
[
0
]
&~
blocked
->
sig
[
0
];
break
;
case
1
:
ready
=
signal
->
sig
[
0
]
&~
blocked
->
sig
[
0
];
}
return
ready
!=
0
;
}
/* True if we are on the alternate signal stack. */
static
inline
int
on_sig_stack
(
unsigned
long
sp
)
...
...
@@ -639,30 +609,6 @@ extern void kick_if_running(task_t * p);
add_parent(p, (p)->parent); \
} while (0)
static
inline
struct
task_struct
*
eldest_child
(
struct
task_struct
*
p
)
{
if
(
list_empty
(
&
p
->
children
))
return
NULL
;
return
list_entry
(
p
->
children
.
next
,
struct
task_struct
,
sibling
);
}
static
inline
struct
task_struct
*
youngest_child
(
struct
task_struct
*
p
)
{
if
(
list_empty
(
&
p
->
children
))
return
NULL
;
return
list_entry
(
p
->
children
.
prev
,
struct
task_struct
,
sibling
);
}
static
inline
struct
task_struct
*
older_sibling
(
struct
task_struct
*
p
)
{
if
(
p
->
sibling
.
prev
==&
p
->
parent
->
children
)
return
NULL
;
return
list_entry
(
p
->
sibling
.
prev
,
struct
task_struct
,
sibling
);
}
static
inline
struct
task_struct
*
younger_sibling
(
struct
task_struct
*
p
)
{
if
(
p
->
sibling
.
next
==&
p
->
parent
->
children
)
return
NULL
;
return
list_entry
(
p
->
sibling
.
next
,
struct
task_struct
,
sibling
);
}
#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks)
#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks)
...
...
kernel/sched.c
View file @
1f782376
...
...
@@ -1837,6 +1837,24 @@ asmlinkage long sys_sched_rr_get_interval(pid_t pid, struct timespec *interval)
return
retval
;
}
static
inline
struct
task_struct
*
eldest_child
(
struct
task_struct
*
p
)
{
if
(
list_empty
(
&
p
->
children
))
return
NULL
;
return
list_entry
(
p
->
children
.
next
,
struct
task_struct
,
sibling
);
}
static
inline
struct
task_struct
*
older_sibling
(
struct
task_struct
*
p
)
{
if
(
p
->
sibling
.
prev
==&
p
->
parent
->
children
)
return
NULL
;
return
list_entry
(
p
->
sibling
.
prev
,
struct
task_struct
,
sibling
);
}
static
inline
struct
task_struct
*
younger_sibling
(
struct
task_struct
*
p
)
{
if
(
p
->
sibling
.
next
==&
p
->
parent
->
children
)
return
NULL
;
return
list_entry
(
p
->
sibling
.
next
,
struct
task_struct
,
sibling
);
}
static
void
show_task
(
task_t
*
p
)
{
unsigned
long
free
=
0
;
...
...
kernel/signal.c
View file @
1f782376
...
...
@@ -160,6 +160,36 @@ int max_queued_signals = 1024;
static
int
__send_sig_info
(
int
sig
,
struct
siginfo
*
info
,
struct
task_struct
*
p
);
/*
* Re-calculate pending state from the set of locally pending
* signals, globally pending signals, and blocked signals.
*/
static
inline
int
has_pending_signals
(
sigset_t
*
signal
,
sigset_t
*
blocked
)
{
unsigned
long
ready
;
long
i
;
switch
(
_NSIG_WORDS
)
{
default:
for
(
i
=
_NSIG_WORDS
,
ready
=
0
;
--
i
>=
0
;)
ready
|=
signal
->
sig
[
i
]
&~
blocked
->
sig
[
i
];
break
;
case
4
:
ready
=
signal
->
sig
[
3
]
&~
blocked
->
sig
[
3
];
ready
|=
signal
->
sig
[
2
]
&~
blocked
->
sig
[
2
];
ready
|=
signal
->
sig
[
1
]
&~
blocked
->
sig
[
1
];
ready
|=
signal
->
sig
[
0
]
&~
blocked
->
sig
[
0
];
break
;
case
2
:
ready
=
signal
->
sig
[
1
]
&~
blocked
->
sig
[
1
];
ready
|=
signal
->
sig
[
0
]
&~
blocked
->
sig
[
0
];
break
;
case
1
:
ready
=
signal
->
sig
[
0
]
&~
blocked
->
sig
[
0
];
}
return
ready
!=
0
;
}
#define PENDING(p,b) has_pending_signals(&(p)->signal, (b))
void
recalc_sigpending_tsk
(
struct
task_struct
*
t
)
...
...
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