Re: CVS commit: src/share/man/man9

2011-01-25 Thread Jukka Ruohonen
On Tue, Jan 25, 2011 at 11:46:48PM +, YAMAMOTO Takashi wrote:
> - add some random notes
> 
>  Basically, KASSERT() should be used for light-weight checks and
>  KDASSERT() should be used for heavier ones.
> 
>  Callers should not rely on the side effects of expression because,
>  depending on the kernel compile options mentioned above, expression might
>  not be evaluated at all.

I guess the newly added KDASSERTMSG() should be documented too.

- Jukka.


Re: CVS commit: src

2011-01-25 Thread Antti Kantee
On Wed Jan 26 2011 at 02:09:30 +, Mindaugas Rasiukevicius wrote:
> > + * Make a kernel mapping valid for I/O, e.g. non-cachable.
> > + * Alignment and length constraints are as-if NBPG==PAGE_SIZE.
> > + */
> > +int
> > +ioaccess(vaddr_t vaddr, paddr_t paddr, vsize_t len)
> > +{
> > +
> > +   while (len > PAGE_SIZE) {
> > +   pmap_kenter_pa(vaddr, paddr, VM_PROT_WRITE, 0);
> > +   len -= PAGE_SIZE;
> > +   vaddr += PAGE_SIZE;
> > +   paddr += PAGE_SIZE;
> > +   }
> > +
> > +   if (len) {
> > +   /* We could warn.. */
> > +   pmap_kenter_pa(vaddr, paddr, VM_PROT_WRITE, 0);
> > +   }
> > +
> > +   /* BUGBUG should use pmap_enter() instead and check results! */
> > +   return 0;
> > +}
> > +
> > +/*
> > + * Opposite to the above: just forget the mapping.
> > + */
> > +int
> > +iounaccess(vaddr_t vaddr, vsize_t len)
> > +{
> > +
> > +   pmap_kremove(vaddr, len);
> > +   return 0;
> > +}
> 
> What is this miracle, however?

IIRC that miracle is about mapping the flash which is not in kseg1.
The story included lots of details on how mapping an arbitrary physical
address was much easier on Mach ;)

The story was told last summer, though, so if you want more
clarifications, I can ask Sandro for a refresh.

I guess it could call pmap_update() to play nice, though.

-- 
älä karot toivorikkauttas, kyl rätei ja lumpui piisaa


Re: CVS commit: src/share/man/man9

2011-01-25 Thread Masao Uebayashi
Sorry, I was confused KASSERT(9) with DIAGNOSTICS.

(Don't send email before having coffee...)

On Wed, Jan 26, 2011 at 02:30:18AM +, YAMAMOTO Takashi wrote:
> hi,
> 
> > How about ABI?  KASSERT(9) should preserve ABI IMO.
> 
> sorry, i'm not sure what you mean.  can you explain?
> 
> YAMAMOTO Takashi

-- 
Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635


Re: CVS commit: src/share/man/man9

2011-01-25 Thread YAMAMOTO Takashi
hi,

> How about ABI?  KASSERT(9) should preserve ABI IMO.

sorry, i'm not sure what you mean.  can you explain?

YAMAMOTO Takashi


Re: CVS commit: src

2011-01-25 Thread Mindaugas Rasiukevicius
"Antti Kantee"  wrote:
> Add support for the Extensible MIPS ("eMIPS") platform.  The
> NetBSD/emips port runs on Xilinx and Beecube FPGA systems and the
> Giano system simulator.
> 
> eMIPS is a platform developed at Microsoft Research for researching
> reconfigurable computing.  eMIPS allows dynamic loading and scheduling
> of application-specific circuits for the purpose of accelerating
> computations based on the current workload.
> 
> NetBSD eMIPS support for NetBSD 4.x was written at Microsoft Research
> by Alessandro Forin and Neil Pittman.  Microsoft Corporation has
> donated full copyright to The NetBSD Foundation.
> 
> Platform support for eMIPS is the first part of Microsoft's
> contribution.  The second part includes the hardware accelerator
> framework and will be proposed on tech-kern soon.

Interesting!

> <...>
> cvs rdiff -u -r1.132 -r1.133 src/sys/arch/mips/mips/vm_machdep.c cvs rdiff -u 
> -r1.5 -r1.6

> +/*
> + * Make a kernel mapping valid for I/O, e.g. non-cachable.
> + * Alignment and length constraints are as-if NBPG==PAGE_SIZE.
> + */
> +int
> +ioaccess(vaddr_t vaddr, paddr_t paddr, vsize_t len)
> +{
> +
> + while (len > PAGE_SIZE) {
> + pmap_kenter_pa(vaddr, paddr, VM_PROT_WRITE, 0);
> + len -= PAGE_SIZE;
> + vaddr += PAGE_SIZE;
> + paddr += PAGE_SIZE;
> + }
> +
> + if (len) {
> + /* We could warn.. */
> + pmap_kenter_pa(vaddr, paddr, VM_PROT_WRITE, 0);
> + }
> +
> + /* BUGBUG should use pmap_enter() instead and check results! */
> + return 0;
> +}
> +
> +/*
> + * Opposite to the above: just forget the mapping.
> + */
> +int
> +iounaccess(vaddr_t vaddr, vsize_t len)
> +{
> +
> + pmap_kremove(vaddr, len);
> + return 0;
> +}

What is this miracle, however?

-- 
Mindaugas


Re: CVS commit: src/share/man/man9

2011-01-25 Thread Masao Uebayashi
How about ABI?  KASSERT(9) should preserve ABI IMO.

On Tue, Jan 25, 2011 at 11:46:48PM +, YAMAMOTO Takashi wrote:
> Module Name:  src
> Committed By: yamt
> Date: Tue Jan 25 23:46:48 UTC 2011
> 
> Modified Files:
>   src/share/man/man9: KASSERT.9
> 
> Log Message:
> - add some random notes
> 
>  Basically, KASSERT() should be used for light-weight checks and
>  KDASSERT() should be used for heavier ones.
> 
>  Callers should not rely on the side effects of expression because,
>  depending on the kernel compile options mentioned above, expression might
>  not be evaluated at all.
> 
> - Xr options(4)
> - bump date
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.9 -r1.10 src/share/man/man9/KASSERT.9
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 

> Modified files:
> 
> Index: src/share/man/man9/KASSERT.9
> diff -u src/share/man/man9/KASSERT.9:1.9 src/share/man/man9/KASSERT.9:1.10
> --- src/share/man/man9/KASSERT.9:1.9  Fri Oct 29 09:34:03 2010
> +++ src/share/man/man9/KASSERT.9  Tue Jan 25 23:46:48 2011
> @@ -1,4 +1,4 @@
> -.\" $NetBSD: KASSERT.9,v 1.9 2010/10/29 09:34:03 wiz Exp $
> +.\" $NetBSD: KASSERT.9,v 1.10 2011/01/25 23:46:48 yamt Exp $
>  .\"
>  .\" Copyright (c) 2006 Igor Sobrado
>  .\" All rights reserved.
> @@ -24,7 +24,7 @@
>  .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
> THE
>  .\" POSSIBILITY OF SUCH DAMAGE.
>  .\"
> -.Dd October 28, 2010
> +.Dd Janurary 26, 2011
>  .Dt KASSERT 9
>  .Os
>  .Sh NAME
> @@ -63,11 +63,24 @@
>  vs
>  .Dv DIAGNOSTIC ) .
>  .Pp
> +Basically,
> +.Fn KASSERT
> +should be used for light-weight checks and
> +.Fn KDASSERT
> +should be used for heavier ones.
> +.Pp
> +Callers should not rely on the side effects of
> +.Ar expression
> +because, depending on the kernel compile options mentioned above,
> +.Ar expression
> +might not be evaluated at all.
> +.Pp
>  The panic message will display the style of assertion (debugging
>  vs. diagnostic), the expression that failed and the filename, and line
>  number the failure happened on.
>  .Sh SEE ALSO
>  .Xr config 1 ,
> +.Xr options 4 ,
>  .Xr CTASSERT 9 ,
>  .Xr panic 9 ,
>  .Xr printf 9
> 

-- 
Masao Uebayashi / Tombi Inc. / Tel: +81-90-9141-4635