Wed May 27 12:15:11 2009 UTC ()
add comments on KSTACK_LOWEST_ADDR/KSTACK_SIZE.


(yamt)
diff -r1.289 -r1.290 src/sys/sys/proc.h

cvs diff -r1.289 -r1.290 src/sys/sys/proc.h (expand / switch to unified diff)

--- src/sys/sys/proc.h 2009/05/14 23:12:14 1.289
+++ src/sys/sys/proc.h 2009/05/27 12:15:11 1.290
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: proc.h,v 1.289 2009/05/14 23:12:14 yamt Exp $ */ 1/* $NetBSD: proc.h,v 1.290 2009/05/27 12:15:11 yamt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -546,26 +546,35 @@ _proclist_skipmarker(struct proc *p0) @@ -546,26 +546,35 @@ _proclist_skipmarker(struct proc *p0)
546 546
547#ifdef KSTACK_CHECK_MAGIC 547#ifdef KSTACK_CHECK_MAGIC
548void kstack_setup_magic(const struct lwp *); 548void kstack_setup_magic(const struct lwp *);
549void kstack_check_magic(const struct lwp *); 549void kstack_check_magic(const struct lwp *);
550#else 550#else
551#define kstack_setup_magic(x) 551#define kstack_setup_magic(x)
552#define kstack_check_magic(x) 552#define kstack_check_magic(x)
553#endif 553#endif
554 554
555/* 555/*
556 * kernel stack paramaters 556 * kernel stack paramaters
557 * XXX require sizeof(struct user) 557 * XXX require sizeof(struct user)
558 */ 558 */
559/* the lowest address of kernel stack */ 559/*
 560 * KSTACK_LOWEST_ADDR: return the lowest address of the lwp's kernel stack,
 561 * excluding redzone etc.
 562 *
 563 * if <machine/proc.h> provides the MD definition, it will be used.
 564 */
560#ifndef KSTACK_LOWEST_ADDR 565#ifndef KSTACK_LOWEST_ADDR
561#define KSTACK_LOWEST_ADDR(l) ((void *)ALIGN((l)->l_addr + 1)) 566#define KSTACK_LOWEST_ADDR(l) ((void *)ALIGN((l)->l_addr + 1))
562#endif 567#endif
563/* size of kernel stack */ 568/*
 569 * KSTACK_SIZE: the size kernel stack for a lwp, excluding redzone etc.
 570 *
 571 * if <machine/proc.h> provides the MD definition, it will be used.
 572 */
564#ifndef KSTACK_SIZE 573#ifndef KSTACK_SIZE
565#define KSTACK_SIZE (USPACE - ALIGN(sizeof(struct user))) 574#define KSTACK_SIZE (USPACE - ALIGN(sizeof(struct user)))
566#endif 575#endif
567 576
568extern struct emul emul_netbsd; 577extern struct emul emul_netbsd;
569 578
570#endif /* _KERNEL */ 579#endif /* _KERNEL */
571#endif /* !_SYS_PROC_H_ */ 580#endif /* !_SYS_PROC_H_ */