Re: armv7: banana pi, Allwinner A20 board

2014-10-05 Thread Jonathan Gray
On Sat, Oct 04, 2014 at 06:26:29AM +0900, SASANO Takayoshi wrote:
 Hi,
 
  When using
  
  OpenBSD 5.6 (RAMDISK-SUNXI) #3: Sun Aug 31 18:46:49 EDT 2014
  
  could you drop into config (pass -c to boot) and try to disable echi?
 
 What shoud I do pass boot -c string to armv7 kernel?
 On i386/amd64 bootloader simply type it but armv7 uses U-Boot.
 
 Tweak uEnv.txt?

setenv bootargs sd0i:/bsd -c

Note the kernel part in the above isn't used as there isn't a second
stage bootloader as you point out.

I've put up a recently built ramdisk with the l1 pte change here:
http://jsg.id.au/openbsd/bsd.rd.SUNXI.umg



Getting a CubieBoard 2 to boot

2014-10-05 Thread Tracy
I just downloaded the latest snapshot of OpenBSD 5.6 and did the dd command to 
write the miniroot-sunxi image to a microSD card.  However, all I see during 
the boot up process is u-boot...nothing OpenBSD related at all.

I then removed the microSD card and mounted it on my OpenBSD 5.5 i386 machine 
and I can see the config files for u-boot and the boot image file for OpenBSD.

Do I need to update my u-boot on my CubieBoard 2 to a specific version for 
OpenBSD to boot up correctly?  If so, what version of u-boot do you recommend?

BTW, I just dd'd a version of Linux ARCH to the same microSD card and my 
CubieBoard 2 booted up with the composite video output showing the console 
login prompt.

Sent from my iPad



tree.h style nit-pick

2014-10-05 Thread Martin Natano
Let's make tree.h conform to style(9).

Index: tree.h
===
RCS file: /cvs/src/sys/sys/tree.h,v
retrieving revision 1.13
diff -u -r1.13 tree.h
--- tree.h  9 Jul 2011 00:19:45 -   1.13
+++ tree.h  5 Oct 2014 17:25:24 -
@@ -237,7 +237,8 @@
 /* Splay with either the minimum or the maximum element
\
  * Used to find minimum or maximum element in tree.\
  */\
-void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+void   \
+name##_SPLAY_MINMAX(struct name *head, int __comp) \
 {  \
struct type __node, *__left, *__right, *__tmp;  \
 \

cheers,
natano



Re: syslogd sigmask

2014-10-05 Thread Alexander Bluhm
Hi,

As libevent provides safe signal callbacks instead of signal handlers,
the sigprocmask(2) protection is not necessary and can be removed.

ok?

bluhm

Index: usr.sbin/syslogd/syslogd.c
===
RCS file: /cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.128
diff -u -p -r1.128 syslogd.c
--- usr.sbin/syslogd/syslogd.c  5 Oct 2014 18:14:01 -   1.128
+++ usr.sbin/syslogd/syslogd.c  5 Oct 2014 19:46:48 -
@@ -759,18 +759,12 @@ logmsg(int pri, char *msg, char *from, i
 {
struct filed *f;
int fac, msglen, prilev, i;
-   sigset_t mask, omask;
char *timestamp;
char prog[NAME_MAX+1];
 
dprintf(logmsg: pri 0%o, flags 0x%x, from %s, msg %s\n,
pri, flags, from, msg);
 
-   sigemptyset(mask);
-   sigaddset(mask, SIGALRM);
-   sigaddset(mask, SIGHUP);
-   sigprocmask(SIG_BLOCK, mask, omask);
-
/*
 * Check to see if msg looks non-standard.
 */
@@ -818,7 +812,6 @@ logmsg(int pri, char *msg, char *from, i
(void)close(f-f_file);
f-f_file = -1;
}
-   (void)sigprocmask(SIG_SETMASK, omask, NULL);
return;
}
for (f = Files; f; f = f-f_next) {
@@ -883,7 +876,6 @@ logmsg(int pri, char *msg, char *from, i
if (f-f_quick)
break;
}
-   (void)sigprocmask(SIG_SETMASK, omask, NULL);
 }
 
 void



Re: syslogd eintr

2014-10-05 Thread Alexander Bluhm
Hi,

As libevent uses sigaction(2) with SA_RESTART, the code to handle
EINTR errors can be removed.

ok?

bluhm

Index: usr.sbin/syslogd/syslogd.c
===
RCS file: /cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.128
diff -u -p -r1.128 syslogd.c
--- usr.sbin/syslogd/syslogd.c  5 Oct 2014 18:14:01 -   1.128
+++ usr.sbin/syslogd/syslogd.c  5 Oct 2014 19:34:53 -
@@ -619,7 +619,7 @@ klog_readcb(int fd, short event, void *a
if (n  0) {
linebuf[n] = '\0';
printsys(linebuf);
-   } else if (n  0  errno != EINTR) {
+   } else if (n  0) {
logerror(klog);
event_del(ev);
}
@@ -641,7 +641,7 @@ udp_readcb(int fd, short event, void *ar
cvthname((struct sockaddr *)sa, resolve, sizeof(resolve));
dprintf(cvthname res: %s\n, resolve);
printline(resolve, linebuf);
-   } else if (n  0  errno != EINTR)
+   } else if (n  0)
logerror(recvfrom udp);
 }
 
@@ -657,7 +657,7 @@ unix_readcb(int fd, short event, void *a
if (n  0) {
linebuf[n] = '\0';
printline(LocalHostName, linebuf);
-   } else if (n == -1  errno != EINTR)
+   } else if (n  0)
logerror(recvfrom unix);
 }
 
@@ -1914,8 +1914,7 @@ ctlsock_acceptcb(int fd, short event, vo
dprintf(Accepting control connection\n);
fd = accept(fd, NULL, NULL);
if (fd == -1) {
-   if (errno != EINTR  errno != EWOULDBLOCK 
-   errno != ECONNABORTED)
+   if (errno != EWOULDBLOCK  errno != ECONNABORTED)
logerror(accept ctlsock);
return;
}
@@ -1972,13 +1971,10 @@ ctlconn_readcb(int fd, short event, void
return;
}
 
- retry:
n = read(fd, (char*)ctl_cmd + ctl_cmd_bytes,
sizeof(ctl_cmd) - ctl_cmd_bytes);
switch (n) {
case -1:
-   if (errno == EINTR)
-   goto retry;
logerror(ctlconn read);
/* FALLTHROUGH */
case 0:
@@ -2101,13 +2097,10 @@ ctlconn_writecb(int fd, short event, voi
return;
}
 
- retry:
n = write(fd, ctl_reply + ctl_reply_offset,
ctl_reply_size - ctl_reply_offset);
switch (n) {
case -1:
-   if (errno == EINTR)
-   goto retry;
if (errno != EPIPE)
logerror(ctlconn write);
/* FALLTHROUGH */



Re: armv7: banana pi, Allwinner A20 board

2014-10-05 Thread SASANO Takayoshi
Hi,

 I've put up a recently built ramdisk with the l1 pte change here:
 http://jsg.id.au/openbsd/bsd.rd.SUNXI.umg

Thanks but not worked...

And, Ethernet PHY(RTL8211E) is recognized as ukphy.
I heard that the power of PHY is controlled by GPIO PH23.
(see http://www.srchack.org/article.php?story=20140501232036142
it is written in Japanese but maybe good hint)

Regards,
-- 
SASANO Takayoshi u...@mx5.nisiq.net


[case 1]
U-Boot SPL 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04)
Board: Bananapi
DRAM: 1024 MiB
CPU: 96000Hz, AXI/AHB/APB: 3/2/2
spl: not an uImage at 1600


U-Boot 2014.04-10694-g2ae8b32-dirty (Oct 01 2014 - 17:40:04) Allwinner 
Technology

CPU:   Allwinner A20 (SUN7I)
Board: Bananapi
I2C:   ready
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:serial
Out:   serial
Err:   serial
Net:   dwmac.1c5
Hit any key to stop autoboot:  0 
reading uEnv.txt
116 bytes read in 16 ms (6.8 KiB/s)
Loaded environment from uEnv.txt
Running uenvcmd ...
reading bsd.umg
7386496 bytes read in 365 ms (19.3 MiB/s)
## Booting kernel from Legacy Image at 6000 ...
   Image Name:   boot
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:7386432 Bytes = 7 MiB
   Load Address: 4080
   Entry Point:  4080
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...


OpenBSD/sunxi booting ...
arg0 0x0 arg1 0x10bb arg2 0x4100
atag core flags 0 pagesize 0 rootdev 0
atag cmdline [sd0i:/bsd;]
atag mem start 0x4000 size 0x4000
bootfile: sd0i:/bsd;
bootargs: 
memory size derived from u-boot
bootconf.mem[0].address = 4000 pages 262144/0x4000
Allocating page tables
freestart = 0x40f0c000, free_pages = 258292 (0x0003f0f4)
IRQ stack: p0x40f3a000 v0xc0f3a000
ABT stack: p0x40f3b000 v0xc0f3b000
UND stack: p0x40f3c000 v0xc0f3c000
SVC stack: p0x40f3d000 v0xc0f3d000
Creating L1 page table at 0x40f0c000
Mapping kernel
Constructing L2 page tables
undefined page pmap [ using 170664 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2014 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 5.6-current (RAMDISK-SUNXI) #0: Sun Oct  5 13:50:18 AEDT 2014
r...@armv7.jsg.id.au:/usr/src/sys/arch/armv7/compile/RAMDISK-SUNXI
real mem  = 1073741824 (1024MB)
avail mem = 1036165120 (988MB)
warning: no entropy supplied by boot loader
mainbus0 at root
cortex0 at mainbus0
ampintc0 at cortex0 nirq 160
cpu0 at mainbus0: ARM Cortex A7 rev 4 (ARMv7 core)
cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
cpu0: 32KB(32b/l,2way) I-cache, 32KB(64b/l,4way) wr-back D-cache
sunxi0 at mainbus0: A20
sxipio0 at sunxi0
sxiccmu0 at sunxi0
sxitimer0 at sunxi0: ticktimer 100hz @ 32KHz
sxitimer1 at sunxi0: stattimer 128hz @ 32KHz
sxitimer2 at sunxi0: cntrtimer @ 32KHz
sxidog0 at sunxi0
sxirtc0 at sunxi0
sxiuart0 at sunxi0: console
sxiuart1 at sunxi0
sxiuart2 at sunxi0
sxiuart3 at sunxi0
sxiuart4 at sunxi0
sxiuart5 at sunxi0
sxiuart6 at sunxi0
sxiuart7 at sunxi0
sxie0 at sunxi0, address 02:99:03:c2:d2:6e
ukphy0 at sxie0 phy 0: Generic IEEE 802.3u media interface, rev. 5: OUI 
0x000732, model 0x0011
ukphy1 at sxie0 phy 1: Generic IEEE 802.3u media interface, rev. 5: OUI 
0x000732, model 0x0011
ahci0 at sunxi0 AHCI 1.1
scsibus0 at ahci0: 32 targets
ehci0 at sunxi0
pmap_fault_fixup: va c5549000 ftype 2 s pte 7ff8f01e
panic: uvm_fault: fault on non-pageable map (0xc0e7f28c, 0xc5549000)
Stopped at  Debugger+0x4:   ldrbr15, [r15, r15, ror r15]!
panic+0x18
scp=0xc083a2e8 rlv=0xc08c2ea4 (uvm_fault+0xca8)
rsp=0xc0f3eb6c rfp=0xc0f3ec8c
uvm_fault+0xc
scp=0xc08c2208 rlv=0xc08fe258 (data_abort_handler+0x248)
rsp=0xc0f3ec90 rfp=0xc0f3ece4
r10=0xc0f3ece8 r9=0xc0f3d000 r8=0x r7=0xc0e9f764
r6=0x0002 r5=0xc0ebc7b4 r4=0xc5549000
data_abort_handler+0xc
scp=0xc08fe01c rlv=0xc08fda24 (address_exception_entry+0x50)
rsp=0xc0f3ece8 rfp=0xc0f3ed4c
r10=0xc0ebd268 r9=0x1000 r8=0x1000 r7=0x000a
r6=0x000c r5=0xc5549000 r4=0x0010
poison_mem+0xc
scp=0xc0835b04 rlv=0xc081de6c (malloc+0x2ec)
rsp=0xc0f3ed50 rfp=0xc0f3edb8
r5=0xc5549000 r4=0xc5549000
malloc+0x10
scp=0xc081db90 rlv=0xc0808a98 (ehci_init+0x184)
rsp=0xc0f3edbc rfp=0xc0f3edf4
r10=0xc5548294 r9=0xc5548000 r8=0x r7=0xc553d0c0
r6=0xc5548014 r5=0xc5548000 r4=0xc0eb9ebc
ehci_init+0x10
scp=0xc0808924 rlv=0xc0931f94 (sxiehci_attach+0x110)
rsp=0xc0f3edf8 rfp=0xc0f3ee18
r10=0x r9=0xc0f3ee5c r8=0xc0ec0290 r7=0xc553d0c0
r6=0xc5548014 r5=0xc5548000 r4=0x
sxiehci_attach+0x10
scp=0xc0931e94 rlv=0xc083092c (config_attach+0x1d4)
rsp=0xc0f3ee1c rfp=0xc0f3ee54
r6=0xc0970778 r5=0xc5548014 r4=0xc5548000
config_attach+0xc

libevent ifdef sigaction

2014-10-05 Thread Alexander Bluhm
Hi,

Can we remove the #ifdef HAVE_SIGACTION from libevent?  The only
reason to keep it, would be make merging with upstream easier.  Do
we expect any new 1.X versions from upstream?

ok?

bluhm

Index: lib/libevent/evsignal.h
===
RCS file: /data/mirror/openbsd/cvs/src/lib/libevent/evsignal.h,v
retrieving revision 1.4
diff -u -p -r1.4 evsignal.h
--- lib/libevent/evsignal.h 21 Apr 2010 20:02:40 -  1.4
+++ lib/libevent/evsignal.h 5 Oct 2014 20:21:05 -
@@ -29,8 +29,6 @@
 #ifndef _EVSIGNAL_H_
 #define _EVSIGNAL_H_
 
-typedef void (*ev_sighandler_t)(int);
-
 struct evsignal_info {
struct event ev_signal;
int ev_signal_pair[2];
@@ -38,11 +36,7 @@ struct evsignal_info {
volatile sig_atomic_t evsignal_caught;
struct event_list evsigevents[NSIG];
sig_atomic_t evsigcaught[NSIG];
-#ifdef HAVE_SIGACTION
struct sigaction **sh_old;
-#else
-   ev_sighandler_t **sh_old;
-#endif
int sh_old_max;
 };
 int evsignal_init(struct event_base *);
Index: lib/libevent/signal.c
===
RCS file: /data/mirror/openbsd/cvs/src/lib/libevent/signal.c,v
retrieving revision 1.16
diff -u -p -r1.16 signal.c
--- lib/libevent/signal.c   29 Apr 2013 00:28:23 -  1.16
+++ lib/libevent/signal.c   5 Oct 2014 20:06:03 -
@@ -140,11 +140,7 @@ int
 _evsignal_set_handler(struct event_base *base,
  int evsignal, void (*handler)(int))
 {
-#ifdef HAVE_SIGACTION
struct sigaction sa;
-#else
-   ev_sighandler_t sh;
-#endif
struct evsignal_info *sig = base-sig;
void *p;
 
@@ -177,7 +173,6 @@ _evsignal_set_handler(struct event_base 
}
 
/* save previous handler and setup new handler */
-#ifdef HAVE_SIGACTION
memset(sa, 0, sizeof(sa));
sa.sa_handler = handler;
sa.sa_flags |= SA_RESTART;
@@ -189,15 +184,6 @@ _evsignal_set_handler(struct event_base 
sig-sh_old[evsignal] = NULL;
return (-1);
}
-#else
-   if ((sh = signal(evsignal, handler)) == SIG_ERR) {
-   event_warn(signal);
-   free(sig-sh_old[evsignal]);
-   sig-sh_old[evsignal] = NULL;
-   return (-1);
-   }
-   *sig-sh_old[evsignal] = sh;
-#endif
 
return (0);
 }
@@ -240,26 +226,15 @@ _evsignal_restore_handler(struct event_b
 {
int ret = 0;
struct evsignal_info *sig = base-sig;
-#ifdef HAVE_SIGACTION
struct sigaction *sh;
-#else
-   ev_sighandler_t *sh;
-#endif
 
/* restore previous handler */
sh = sig-sh_old[evsignal];
sig-sh_old[evsignal] = NULL;
-#ifdef HAVE_SIGACTION
if (sigaction(evsignal, sh, NULL) == -1) {
event_warn(sigaction);
ret = -1;
}
-#else
-   if (signal(evsignal, *sh) == SIG_ERR) {
-   event_warn(signal);
-   ret = -1;
-   }
-#endif
free(sh);
 
return ret;
@@ -299,10 +274,6 @@ evsignal_handler(int sig)
 
evsignal_base-sig.evsigcaught[sig]++;
evsignal_base-sig.evsignal_caught = 1;
-
-#ifndef HAVE_SIGACTION
-   signal(sig, evsignal_handler);
-#endif
 
/* Wake up our notification mechanism */
send(evsignal_base-sig.ev_signal_pair[0], a, 1, 0);



Re: syslogd sigmask

2014-10-05 Thread Nicholas Marriott

ok nicm



On Sun, Oct 05, 2014 at 09:47:56PM +0200, Alexander Bluhm wrote:
 Hi,
 
 As libevent provides safe signal callbacks instead of signal handlers,
 the sigprocmask(2) protection is not necessary and can be removed.
 
 ok?
 
 bluhm
 
 Index: usr.sbin/syslogd/syslogd.c
 ===
 RCS file: /cvs/src/usr.sbin/syslogd/syslogd.c,v
 retrieving revision 1.128
 diff -u -p -r1.128 syslogd.c
 --- usr.sbin/syslogd/syslogd.c5 Oct 2014 18:14:01 -   1.128
 +++ usr.sbin/syslogd/syslogd.c5 Oct 2014 19:46:48 -
 @@ -759,18 +759,12 @@ logmsg(int pri, char *msg, char *from, i
  {
   struct filed *f;
   int fac, msglen, prilev, i;
 - sigset_t mask, omask;
   char *timestamp;
   char prog[NAME_MAX+1];
  
   dprintf(logmsg: pri 0%o, flags 0x%x, from %s, msg %s\n,
   pri, flags, from, msg);
  
 - sigemptyset(mask);
 - sigaddset(mask, SIGALRM);
 - sigaddset(mask, SIGHUP);
 - sigprocmask(SIG_BLOCK, mask, omask);
 -
   /*
* Check to see if msg looks non-standard.
*/
 @@ -818,7 +812,6 @@ logmsg(int pri, char *msg, char *from, i
   (void)close(f-f_file);
   f-f_file = -1;
   }
 - (void)sigprocmask(SIG_SETMASK, omask, NULL);
   return;
   }
   for (f = Files; f; f = f-f_next) {
 @@ -883,7 +876,6 @@ logmsg(int pri, char *msg, char *from, i
   if (f-f_quick)
   break;
   }
 - (void)sigprocmask(SIG_SETMASK, omask, NULL);
  }
  
  void
 



Re: syslogd eintr

2014-10-05 Thread Nicholas Marriott
Hi

I would be inclined to leave these - they don't cost much and people
expect to see EINTR handled.



On Sun, Oct 05, 2014 at 09:55:39PM +0200, Alexander Bluhm wrote:
 Hi,
 
 As libevent uses sigaction(2) with SA_RESTART, the code to handle
 EINTR errors can be removed.
 
 ok?
 
 bluhm
 
 Index: usr.sbin/syslogd/syslogd.c
 ===
 RCS file: /cvs/src/usr.sbin/syslogd/syslogd.c,v
 retrieving revision 1.128
 diff -u -p -r1.128 syslogd.c
 --- usr.sbin/syslogd/syslogd.c5 Oct 2014 18:14:01 -   1.128
 +++ usr.sbin/syslogd/syslogd.c5 Oct 2014 19:34:53 -
 @@ -619,7 +619,7 @@ klog_readcb(int fd, short event, void *a
   if (n  0) {
   linebuf[n] = '\0';
   printsys(linebuf);
 - } else if (n  0  errno != EINTR) {
 + } else if (n  0) {
   logerror(klog);
   event_del(ev);
   }
 @@ -641,7 +641,7 @@ udp_readcb(int fd, short event, void *ar
   cvthname((struct sockaddr *)sa, resolve, sizeof(resolve));
   dprintf(cvthname res: %s\n, resolve);
   printline(resolve, linebuf);
 - } else if (n  0  errno != EINTR)
 + } else if (n  0)
   logerror(recvfrom udp);
  }
  
 @@ -657,7 +657,7 @@ unix_readcb(int fd, short event, void *a
   if (n  0) {
   linebuf[n] = '\0';
   printline(LocalHostName, linebuf);
 - } else if (n == -1  errno != EINTR)
 + } else if (n  0)
   logerror(recvfrom unix);
  }
  
 @@ -1914,8 +1914,7 @@ ctlsock_acceptcb(int fd, short event, vo
   dprintf(Accepting control connection\n);
   fd = accept(fd, NULL, NULL);
   if (fd == -1) {
 - if (errno != EINTR  errno != EWOULDBLOCK 
 - errno != ECONNABORTED)
 + if (errno != EWOULDBLOCK  errno != ECONNABORTED)
   logerror(accept ctlsock);
   return;
   }
 @@ -1972,13 +1971,10 @@ ctlconn_readcb(int fd, short event, void
   return;
   }
  
 - retry:
   n = read(fd, (char*)ctl_cmd + ctl_cmd_bytes,
   sizeof(ctl_cmd) - ctl_cmd_bytes);
   switch (n) {
   case -1:
 - if (errno == EINTR)
 - goto retry;
   logerror(ctlconn read);
   /* FALLTHROUGH */
   case 0:
 @@ -2101,13 +2097,10 @@ ctlconn_writecb(int fd, short event, voi
   return;
   }
  
 - retry:
   n = write(fd, ctl_reply + ctl_reply_offset,
   ctl_reply_size - ctl_reply_offset);
   switch (n) {
   case -1:
 - if (errno == EINTR)
 - goto retry;
   if (errno != EPIPE)
   logerror(ctlconn write);
   /* FALLTHROUGH */
 



Re: libevent ifdef sigaction

2014-10-05 Thread Nicholas Marriott
Hi

I don't think there will be any more 1.x releases, 1.x is no longer
maintained upstream.

You can remove -DHAVE_SIGACTION from the Makefile as well.

I'm happy enough with this, but there are a lot more to remove as
well...



On Sun, Oct 05, 2014 at 10:29:38PM +0200, Alexander Bluhm wrote:
 Hi,
 
 Can we remove the #ifdef HAVE_SIGACTION from libevent?  The only
 reason to keep it, would be make merging with upstream easier.  Do
 we expect any new 1.X versions from upstream?
 
 ok?
 
 bluhm
 
 Index: lib/libevent/evsignal.h
 ===
 RCS file: /data/mirror/openbsd/cvs/src/lib/libevent/evsignal.h,v
 retrieving revision 1.4
 diff -u -p -r1.4 evsignal.h
 --- lib/libevent/evsignal.h   21 Apr 2010 20:02:40 -  1.4
 +++ lib/libevent/evsignal.h   5 Oct 2014 20:21:05 -
 @@ -29,8 +29,6 @@
  #ifndef _EVSIGNAL_H_
  #define _EVSIGNAL_H_
  
 -typedef void (*ev_sighandler_t)(int);
 -
  struct evsignal_info {
   struct event ev_signal;
   int ev_signal_pair[2];
 @@ -38,11 +36,7 @@ struct evsignal_info {
   volatile sig_atomic_t evsignal_caught;
   struct event_list evsigevents[NSIG];
   sig_atomic_t evsigcaught[NSIG];
 -#ifdef HAVE_SIGACTION
   struct sigaction **sh_old;
 -#else
 - ev_sighandler_t **sh_old;
 -#endif
   int sh_old_max;
  };
  int evsignal_init(struct event_base *);
 Index: lib/libevent/signal.c
 ===
 RCS file: /data/mirror/openbsd/cvs/src/lib/libevent/signal.c,v
 retrieving revision 1.16
 diff -u -p -r1.16 signal.c
 --- lib/libevent/signal.c 29 Apr 2013 00:28:23 -  1.16
 +++ lib/libevent/signal.c 5 Oct 2014 20:06:03 -
 @@ -140,11 +140,7 @@ int
  _evsignal_set_handler(struct event_base *base,
 int evsignal, void (*handler)(int))
  {
 -#ifdef HAVE_SIGACTION
   struct sigaction sa;
 -#else
 - ev_sighandler_t sh;
 -#endif
   struct evsignal_info *sig = base-sig;
   void *p;
  
 @@ -177,7 +173,6 @@ _evsignal_set_handler(struct event_base 
   }
  
   /* save previous handler and setup new handler */
 -#ifdef HAVE_SIGACTION
   memset(sa, 0, sizeof(sa));
   sa.sa_handler = handler;
   sa.sa_flags |= SA_RESTART;
 @@ -189,15 +184,6 @@ _evsignal_set_handler(struct event_base 
   sig-sh_old[evsignal] = NULL;
   return (-1);
   }
 -#else
 - if ((sh = signal(evsignal, handler)) == SIG_ERR) {
 - event_warn(signal);
 - free(sig-sh_old[evsignal]);
 - sig-sh_old[evsignal] = NULL;
 - return (-1);
 - }
 - *sig-sh_old[evsignal] = sh;
 -#endif
  
   return (0);
  }
 @@ -240,26 +226,15 @@ _evsignal_restore_handler(struct event_b
  {
   int ret = 0;
   struct evsignal_info *sig = base-sig;
 -#ifdef HAVE_SIGACTION
   struct sigaction *sh;
 -#else
 - ev_sighandler_t *sh;
 -#endif
  
   /* restore previous handler */
   sh = sig-sh_old[evsignal];
   sig-sh_old[evsignal] = NULL;
 -#ifdef HAVE_SIGACTION
   if (sigaction(evsignal, sh, NULL) == -1) {
   event_warn(sigaction);
   ret = -1;
   }
 -#else
 - if (signal(evsignal, *sh) == SIG_ERR) {
 - event_warn(signal);
 - ret = -1;
 - }
 -#endif
   free(sh);
  
   return ret;
 @@ -299,10 +274,6 @@ evsignal_handler(int sig)
  
   evsignal_base-sig.evsigcaught[sig]++;
   evsignal_base-sig.evsignal_caught = 1;
 -
 -#ifndef HAVE_SIGACTION
 - signal(sig, evsignal_handler);
 -#endif
  
   /* Wake up our notification mechanism */
   send(evsignal_base-sig.ev_signal_pair[0], a, 1, 0);
 



Re: armv7: banana pi, Allwinner A20 board

2014-10-05 Thread Jonathan Gray
On Mon, Oct 06, 2014 at 05:10:58AM +0900, SASANO Takayoshi wrote:
 Hi,
 
  I've put up a recently built ramdisk with the l1 pte change here:
  http://jsg.id.au/openbsd/bsd.rd.SUNXI.umg
 
 Thanks but not worked...
 
 And, Ethernet PHY(RTL8211E) is recognized as ukphy.
 I heard that the power of PHY is controlled by GPIO PH23.
 (see http://www.srchack.org/article.php?story=20140501232036142
 it is written in Japanese but maybe good hint)

The phy would be recognised as rgephy(4) if the driver
were compiled in.

The GPIO phy enable quirk aside it isn't clear if the 'gmac'
style ethernet needs a different driver to 'emac'.

The sxie(4) driver does not have a match routine it just
blindly attaches...

Did you try disabling ehci to see if that makes a difference?