Re: CVS commit: src/sys/arch/arm/include

2012-09-24 Thread Masanobu SAITOH

(2012/09/01 8:56), Matt Thomas wrote:

Module Name:src
Committed By:   matt
Date:   Fri Aug 31 23:56:15 UTC 2012

Modified Files:
src/sys/arch/arm/include: mutex.h

Log Message:
Move the __cpu_simple_lock to the last byte so it's easier to read in dumps


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/include/mutex.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


 This change makes panic on big endian.

--
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


Re: CVS commit: src/sys/arch/arm/include

2012-09-24 Thread Ryo Shimizu

(2012/09/01 8:56), Matt Thomas wrote:
 Module Name: src
 Committed By:matt
 Date:Fri Aug 31 23:56:15 UTC 2012

 Modified Files:
  src/sys/arch/arm/include: mutex.h

 Log Message:
 Move the __cpu_simple_lock to the last byte so it's easier to read in dumps


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/include/mutex.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

  This change makes panic on big endian.

to fix, apply below patch.

I think mtxs_dummy should be mtxs_type
because it is used as kmutex_type_t in sys/kern/kern_mutex.c

cvs -q diff -u mutex.h
Index: mutex.h
===
RCS file: /cvsroot/src/sys/arch/arm/include/mutex.h,v
retrieving revision 1.12
diff -u -r1.12 mutex.h
--- mutex.h 31 Aug 2012 23:56:15 -  1.12
+++ mutex.h 24 Sep 2012 08:37:30 -
@@ -61,10 +61,17 @@
 
/* Spin mutex */
struct {
-   volatile uint8_tmtxs_dummy;
+#if _BYTE_ORDER == BIG_ENDIAN
+   __cpu_simple_lock_t mtxs_lock;
+   volatile uint8_tmtxs_unused;
+   ipl_cookie_tmtxs_ipl;
+   volatile uint8_tmtxs_dummy;
+#else
+   volatile uint8_tmtxs_dummy;
ipl_cookie_tmtxs_ipl;
volatile uint8_tmtxs_unused;
__cpu_simple_lock_t mtxs_lock;
+#endif
} s;
} u;
 };


Re: CVS commit: src/sys/arch/evbarm/iq80310

2012-09-24 Thread Izumi Tsutsui
I wrote:

 chs@ wrote:
 
  On Mon, Sep 17, 2012 at 03:40:12AM +0900, Izumi Tsutsui wrote:
   chs@ wrote:
   
Module Name:src
Committed By:   chs
Date:   Tue Aug 14 15:46:21 UTC 2012

Modified Files:
src/sys/arch/evbarm/iq80310: iq80310_intr.c

Log Message:
move evcnt_attach_dynamic() calls later to avoid assertions.
   
   
   - what happens if intr_establish function is called more than once
 against the same irq?
   
   - shouldn't disestablish function have evcnt_detach()?
   
   - isn't it better to defer intr_init() calls after evcnt_init(),
 rather than calling evcnt_attach_dynamic() in intr_establish() ?
   
   
   It looks many other arm intr_init functions
   (arm/ep93xx/ep93xx_intr.c, arm/xscale/ixp425_intr.c etc)
   have the same problem, though.
   (on the other hand marvell variants don't have evcnt at all)
  :
  are you suggesting to undo my change and instead move the call to
  iq80310_intr_init() from initarm() to somewhere else?  if so, where?
  
  or are you suggesting to move the calls to evcnt_attach_dynamic()
  from iq80310_intr_init() to a separate function which could be called
  later?  if so, where would be a good place to call that other function?
 
 The former is okay because interrupts won't be enabled before
 at least cpu_configure(9) and I moved such initializations
 into cpu_configure(9) on several mips and m68k ports.
 
 But on evbarm cpu_configure(9) is shared among all boards
 so we need some hook to handle it? Or call it mainbus_attach()?
 Or just disable intr evcnt(9) for now?

Now I notice that matt@ already fixed some boards using the latter one
(split out evcnt_attach_dynamic() int a separate function and call it
 from board dependent mainbus_attach) so following it would be consistent.

http://mail-index.NetBSD.org/source-changes/2012/02/12/msg031698.html
http://www.nerv.org/~ryo/netbsd/netbsd/?q=id:20120212T163102Z.cef48d9fbe70f5c792f90fc3a83a35e9ec1d6880
http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/arch/arm/xscale/i80321_icu.c.diff?r1=1.22r2=1.23f=h
http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/arch/evbarm/hdl_g/i80321_mainbus.c.diff?r1=1.2r2=1.3f=h

---
Izumi Tsutsui