Constify stack argument for functions that don't modify it.

Reviewed by:	ed, kib, jhb
This commit is contained in:
Pawel Jakub Dawidek 2011-11-16 19:06:55 +00:00
parent 1859c4740e
commit a20358302f
3 changed files with 26 additions and 25 deletions
share/man/man9
sys

@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 24, 2009
.Dd November 16, 2011
.Dt STACK 9
.Os
.Sh NAME
@ -46,21 +46,21 @@ In the kernel configuration file:
.Ft int
.Fn stack_put "struct stack *st" "vm_offset_t pc"
.Ft void
.Fn stack_copy "struct stack *src" "struct stack dst"
.Fn stack_copy "const struct stack *src" "struct stack dst"
.Ft void
.Fn stack_zero "struct stack *st"
.Ft void
.Fn stack_print "struct stack *st"
.Fn stack_print "const struct stack *st"
.Ft void
.Fn stack_print_ddb "struct stack *st"
.Fn stack_print_ddb "const struct stack *st"
.Ft void
.Fn stack_print_short "struct stack *st"
.Fn stack_print_short "const struct stack *st"
.Ft void
.Fn stack_print_short_ddb "struct stack *st"
.Fn stack_print_short_ddb "const struct stack *st"
.Ft void
.Fn stack_sbuf_print "struct sbuf sb*" "struct stack *st"
.Fn stack_sbuf_print "struct sbuf sb*" "const struct stack *st"
.Ft void
.Fn stack_sbuf_print_ddb "struct sbuf sb*" "struct stack *st"
.Fn stack_sbuf_print_ddb "struct sbuf sb*" "const struct stack *st"
.Ft void
.Fn stack_save "struct stack *st"
.Sh DESCRIPTION

@ -77,7 +77,7 @@ stack_put(struct stack *st, vm_offset_t pc)
}
void
stack_copy(struct stack *src, struct stack *dst)
stack_copy(const struct stack *src, struct stack *dst)
{
*dst = *src;
@ -91,7 +91,7 @@ stack_zero(struct stack *st)
}
void
stack_print(struct stack *st)
stack_print(const struct stack *st)
{
char namebuf[64];
long offset;
@ -107,7 +107,7 @@ stack_print(struct stack *st)
}
void
stack_print_short(struct stack *st)
stack_print_short(const struct stack *st)
{
char namebuf[64];
long offset;
@ -127,7 +127,7 @@ stack_print_short(struct stack *st)
}
void
stack_print_ddb(struct stack *st)
stack_print_ddb(const struct stack *st)
{
const char *name;
long offset;
@ -143,7 +143,7 @@ stack_print_ddb(struct stack *st)
#ifdef DDB
void
stack_print_short_ddb(struct stack *st)
stack_print_short_ddb(const struct stack *st)
{
const char *name;
long offset;
@ -167,7 +167,7 @@ stack_print_short_ddb(struct stack *st)
* other for use in the live kernel.
*/
void
stack_sbuf_print(struct sbuf *sb, struct stack *st)
stack_sbuf_print(struct sbuf *sb, const struct stack *st)
{
char namebuf[64];
long offset;
@ -184,7 +184,7 @@ stack_sbuf_print(struct sbuf *sb, struct stack *st)
#ifdef DDB
void
stack_sbuf_print_ddb(struct sbuf *sb, struct stack *st)
stack_sbuf_print_ddb(struct sbuf *sb, const struct stack *st)
{
const char *name;
long offset;
@ -201,8 +201,8 @@ stack_sbuf_print_ddb(struct sbuf *sb, struct stack *st)
#ifdef KTR
void
stack_ktr(u_int mask, const char *file, int line, struct stack *st, u_int depth,
int cheap)
stack_ktr(u_int mask, const char *file, int line, const struct stack *st,
u_int depth, int cheap)
{
#ifdef DDB
const char *name;

@ -37,16 +37,17 @@ struct sbuf;
struct stack *stack_create(void);
void stack_destroy(struct stack *);
int stack_put(struct stack *, vm_offset_t);
void stack_copy(struct stack *, struct stack *);
void stack_copy(const struct stack *, struct stack *);
void stack_zero(struct stack *);
void stack_print(struct stack *);
void stack_print_ddb(struct stack *);
void stack_print_short(struct stack *);
void stack_print_short_ddb(struct stack *);
void stack_sbuf_print(struct sbuf *, struct stack *);
void stack_sbuf_print_ddb(struct sbuf *, struct stack *);
void stack_print(const struct stack *);
void stack_print_ddb(const struct stack *);
void stack_print_short(const struct stack *);
void stack_print_short_ddb(const struct stack *);
void stack_sbuf_print(struct sbuf *, const struct stack *);
void stack_sbuf_print_ddb(struct sbuf *, const struct stack *);
#ifdef KTR
void stack_ktr(u_int, const char *, int, struct stack *, u_int, int);
void stack_ktr(u_int, const char *, int, const struct stack *,
u_int, int);
#define CTRSTACK(m, st, depth, cheap) do { \
if (KTR_COMPILE & (m)) \
stack_ktr((m), __FILE__, __LINE__, st, depth, cheap); \