rename sgi's power(4) to nmi(4)

2010-04-01 Thread Jasper Lievisse Adriaanse
hi,

the attached diff renames sgi's power(4) driver to nmi(4). that name
makes actually a lot more sense.

i'll commit the manpage bits separately.

ok?

-- 
Stay Hungry. Stay Foolish.


Index: share/man/man4/man4.sgi/Makefile
===
RCS file: /cvs/src/share/man/man4/man4.sgi/Makefile,v
retrieving revision 1.20
diff -p -u -p -u -r1.20 Makefile
--- share/man/man4/man4.sgi/Makefile8 Mar 2010 01:47:00 -   1.20
+++ share/man/man4/man4.sgi/Makefile29 Mar 2010 21:39:39 -
@@ -2,7 +2,7 @@
 
 MAN=   dsrtc.4 gbe.4 iec.4 impact.4 intro.4 ioc.4 iockbc.4 iof.4 \
macebus.4 mavb.4 mec.4 mkbc.4 odyssey.4 \
-   owmac.4 owserial.4 power.4 xbow.4 xbridge.4 xheart.4
+   owmac.4 owserial.4 nmi.4 xbow.4 xbridge.4 xheart.4
 MLINKS=macebus.4 macepcibr.4 \
xbridge.4 xbpci.4
 
Index: share/man/man4/man4.sgi/nmi.4
===
RCS file: share/man/man4/man4.sgi/nmi.4
diff -N share/man/man4/man4.sgi/nmi.4
--- /dev/null   1 Jan 1970 00:00:00 -
+++ share/man/man4/man4.sgi/nmi.4   29 Mar 2010 21:39:39 -
@@ -0,0 +1,57 @@
+.\ $OpenBSD$
+.\
+.\ Copyright (c) 2007,2010 Jasper Lievisse Adriaanse jas...@openbsd.org
+.\ All rights reserved.
+.\
+.\ Permission to use, copy, modify, and distribute this software for any
+.\ purpose with or without fee is hereby granted, provided that the above
+.\ copyright notice and this permission notice appear in all copies.
+.\
+.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\
+.Dd $Mdocdate$
+.Dt NMI 4 sgi
+.Os
+.Sh NAME
+.Nm nmi
+.Nd non-meaningful interrupt
+.Sh SYNOPSIS
+.Cd nmi0 at macebus0 Pq O2
+.Cd nmi0 at mainbus0 Pq Octane
+.Sh DESCRIPTION
+The SGI O2 and Octane machines are equiped with a button that generates
+a non-meaningfull interrupt (NMI) when pressed.
+The
+.Nm
+driver catches that interrupt.
+If the
+.Va machdep.kbdreset
+.Xr sysctl 8
+is set to 1,
+.Nm
+will then signal
+.Xr init 8
+to do a clean
+.Xr shutdown 8 .
+.Sh SEE ALSO
+.Xr intro 4 ,
+.Xr macebus 4 ,
+.Xr init 8 ,
+.Xr rc.shutdown 8 ,
+.Xr sysctl 8
+.Sh HISTORY
+Support for the
+.Nm
+driver first appeared in
+.Ox 4.8 .
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An Jasper Lievisse Adriaanse Aq jas...@openbsd.org .
Index: share/man/man4/man4.sgi/power.4
===
RCS file: share/man/man4/man4.sgi/power.4
diff -N share/man/man4/man4.sgi/power.4
--- share/man/man4/man4.sgi/power.4 26 Oct 2009 18:38:09 -  1.3
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,57 +0,0 @@
-.\ $OpenBSD: power.4,v 1.3 2009/10/26 18:38:09 miod Exp $
-.\
-.\ Copyright (c) 2007 Jasper Lievisse Adriaanse jas...@openbsd.org
-.\ All rights reserved.
-.\
-.\ Permission to use, copy, modify, and distribute this software for any
-.\ purpose with or without fee is hereby granted, provided that the above
-.\ copyright notice and this permission notice appear in all copies.
-.\
-.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\
-.Dd $Mdocdate: October 26 2009 $
-.Dt POWER 4 sgi
-.Os
-.Sh NAME
-.Nm power
-.Nd power button
-.Sh SYNOPSIS
-.Cd power0 at macebus0 Pq O2
-.Cd power0 at mainbus0 Pq Octane
-.Sh DESCRIPTION
-The SGI O2 and Octane machines generate an interrupt when the power button
-on the front panel is pressed.
-The
-.Nm
-driver catches that interrupt.
-If the
-.Va machdep.kbdreset
-.Xr sysctl 8
-is set to 1,
-.Nm
-will then signal
-.Xr init 8
-to do a clean
-.Xr shutdown 8 .
-.Sh SEE ALSO
-.Xr intro 4 ,
-.Xr macebus 4 ,
-.Xr init 8 ,
-.Xr rc.shutdown 8 ,
-.Xr sysctl 8
-.Sh HISTORY
-Support for the
-.Nm
-driver first appeared in
-.Ox 4.3 .
-.Sh AUTHORS
-The
-.Nm
-driver was written by
-.An Jasper Lievisse Adriaanse Aq jas...@openbsd.org .
Index: sys/arch/sgi/conf/GENERIC-IP30
===
RCS file: /cvs/src/sys/arch/sgi/conf/GENERIC-IP30,v
retrieving revision 1.28
diff -p -u -p -u -r1.28 GENERIC-IP30
--- sys/arch/sgi/conf/GENERIC-IP30  

Re: rename sgi's power(4) to nmi(4)

2010-04-01 Thread Mark Kettenis
 Date: Thu, 1 Apr 2010 09:32:03 +0200
 From: Jasper Lievisse Adriaanse jas...@humppa.nl
 
 hi,
 
 the attached diff renames sgi's power(4) driver to nmi(4). that name
 makes actually a lot more sense.

Please explain!  The interrupt handler registered by this driver does
a psignal(initproc, SIGUSR2), which powers down the machine.  Drivers
that do this are called power(4) on other hardware platforms as well.



Школа секретаря: как стать профессионаломcn

2010-04-01 Thread O5-O7 апреля
05 - 07 P0P?QP5P;Q 2010 P3. (3 P4P=Q)

P(PPPP  P!PPP PPPP P/:  PPP  P!PPPP,
PP PP$PP!P!PPPPPPP

#

PQQQP4P=P5P2P=QP9 P?QP0P:QP8QP5QP:P8P9 P:QQQ P4P;Q
QP5P:QP5QP0QP5P9, P?PPPQ   P=P8P:PP2 QQP:PP2PP4P8QP5P;P5P9,
PQP8Q-PP5P=P5P4P6P5QPP2 P8 QPQQQP4P=P8P:PP2
P0P4PP8P=P8QQQP0QP8P2P=QQ PQP4P5P;PP2 P:PPP?P0P=P8P8.

PQ P?QPQP5QQP8PP=P0P;QP=PP3P QQPP2P=Q QP5P:QP5QP0QQ P2P
PP=PP3PP P7P0P2P8QP8Q P?QP5QQP8P6 P:PPP?P0P=P8P8.
PQP?PP;QP7QQ P2 QP2PP5P9 QP0P1PQP5
P?QPQP5QQP8PP=P0P;QP=P-P=P5PP1QPP4P8PQP5 P=P0P2QP:P8 P8
QPP5P=P8Q, QP5P:QP5QP0QQ QP?PQPP1QQP2QP5Q QPP7P4P0P=P8Q
P4P5P;PP2PP9 P8 P:PPQPQQP=PP9 P0QPPQQP5QQ P2 PQP8QP5 P8
P?QP8P5PP=PP9.
PP;Q QP5QP5P=P8Q P:PP=P:QP5QP=QQ P7P0P4P0Q, QQPQQ  P8Q
P?P5QP5P4 P:P0P6P4QP QP0P1PQP=P8P:PP PQP8QP0, PQ
PQP3P0P=P8P7PP2P0P;P8 QP8P:P; QP5PP8P=P0QPP2, PP1Q
P5P4P8P=P8P2
P;PP:P0P;QP=QP5 QP5PQ P2 QQQQP4P=P5P2P=QQ P?QPP3QP0PPQ
PP1QQP5P=P8Q.
PQQQ P?QPQPP4P8Q P2 P8P=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8PP=P=QQ QPQP, P8Q P?QP5P8PQQ P5QQP2P0 P8
P=P5P4PQQP0QP:P8. PQP0P2P8P;P0 P8 P?QP8P7P=P0P:P8
QPQPP8QPP2P0P=P8Q P4P5P;. PPPP5P=P:P;P0QQQQ P4P5P;: P2P8P4Q,
P=P0P7P=P0QP5P=P8P5, QP0P7QP0P1PQP:P0, QQQQP:QQQP0,
P8QP?PP;QP7PP2P0P=P8P5 P2 

apmd performance mode patch

2010-04-01 Thread Pawlowski Marcin Piotr
Hi,
I've just found that when using apmd with automatic performance mode
without battery connected, performance is set to minimum. I often
detach my battery when using AC for a long time. It's easier for me to
have highest performance when AC without battery and 'apm -H'.

I'm proposing patch that will do aditional check if there's battery and
if it's absent increase performance up to 100%. This is simple solution
which I'm using and I think that it's good extention for automatic
performance mode.

Cheers,
pmp
Index: apmd.c
===
RCS file: /cvs/src/usr.sbin/apmd/apmd.c,v
retrieving revision 1.55
diff -u -r1.55 apmd.c
--- apmd.c  30 Mar 2010 17:42:05 -  1.55
+++ apmd.c  1 Apr 2010 15:15:04 -
@@ -320,9 +320,11 @@
case PERF_AUTO:
/*
 * force setperf towards the max if we are connected to AC
-* power and have a battery life greater than 15%
+* power and have a battery life greater than 15% or
+* battery is absent
 */
-   if (pinfo-ac_state == APM_AC_ON  pinfo-battery_life  15)
+   if (pinfo-ac_state == APM_AC_ON  pinfo-battery_life  15
+   || pinfo-battery_state == APM_BATTERY_ABSENT)
forcehi = 1;
break;
case PERF_COOL:



testers needed for auich(4)

2010-04-01 Thread Christopher Zimmermann
Hi, 

here's a patch for auich(4). It fixes some issues with SIS 7012 
and possibly others. But since it relies on correct behaviour of 
the hardware at some places it needs some testing. Especially try 
to run something like:

aucat -l; play test.wav

right after booting and before anything else is played or 
recorded.

the typical output would be:

auich0: ac97 link rate calibration took 83337 us
sts=7dch,celv,lvbci civ=0 auich0: after calibration and reset
sts=1dch civ=0 auich0: measured ac97 link rate at 47997 Hz,
will use 48000 Hz auich_trigger_output(ed99000, eda7600, 11776,
0x80271e20, 0x8015dc00, 0x8015dd90)
sts=1dch auich_trigger_pipe: qptr=0
auich_trigger_input(eda9000, edb7600, 11776, 0x80272010,
0x8015dc00, 0x8015ddb8) sts=1dch
auich_trigger_pipe: qptr=0 auich0: halt_input auich0: halt_output

Important is the value of sts. dch means DMA halted - one 
should not set AUICH_RR before this bit is set.
In auich_calibrate() I wait for any of the three bits 
dch,celv,lvbci to be set.
If something goes wrong here you will see:
auich0: ac97 link rate timed out %d us sts=%b civ=%d\n

If something goes wrong in halt_pipe you will see:
auich_halt_pipe: halt took %d cycles


please send me your dmesg if anything goes wrong or if you chip 
does set the sts flags in another way.

A short summary of the changes:

- According to specification AUICH_RR may only be set after DMA 
  is halted (AUICH_DCH is 0 in AUICH_STS). To accomplish this I 
revived auich_halt_pipe();
- auich_calibrate() did not clear interrupt and event bits in 
  AUICH_STS. Do that now. Further it did watch the CIV index 
counter to see when all samples are processed. I changed it to 
watch AUICH_STS instead and set LVI=CIV. therefore it won't 
change the CIV counter.
- my last patch introduced a small bug in auich_trigger_pipe() I 
  fixed that.


Cheers,

Christopher Zimmermann


Index: sys/dev/pci/auich.c
===
RCS file: /cvs/src/sys/dev/pci/auich.c,v
retrieving revision 1.81
diff -u -p -r1.81 auich.c
--- sys/dev/pci/auich.c 30 Mar 2010 09:38:07 -  1.81
+++ sys/dev/pci/auich.c 31 Mar 2010 12:30:28 -
@@ -26,7 +26,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* #define AUICH_DEBUG */
+#defineAUICH_DEBUG
 /*
  * AC'97 audio found on Intel 810/815/820/440MX chipsets.
  * http://developer.intel.com/design/chipsets/datashts/290655.htm
@@ -75,7 +75,7 @@
 #defineAUICH_BCIS  0x08/* r- buf cmplt int sts; wr ack 
*/
 #defineAUICH_LVBCI 0x04/* r- last valid bci, wr ack */
 #defineAUICH_CELV  0x02/* current equals last valid */
-#defineAUICH_DCH   0x01/* dma halted */
+#defineAUICH_DCH   0x01/* dma halted */
 #defineAUICH_ISTS_BITS 
\020\01dch\02celv\03lvbci\04bcis\05fifoe
 #defineAUICH_PICB  0x08/* 16 bits */
 #defineAUICH_PIV   0x0a/* 5 bits prefetched index 
value */
@@ -232,7 +232,8 @@ struct auich_softc {
 
 #ifdef AUICH_DEBUG
 #defineDPRINTF(l,x)do { if (auich_debug  (l)) printf x; } while(0)
-int auich_debug = 0xfffe;
+/*int auich_debug = 0xfffe;*/
+int auich_debug = 0x0002;
 #defineAUICH_DEBUG_CODECIO 0x0001
 #defineAUICH_DEBUG_DMA 0x0002
 #defineAUICH_DEBUG_INTR0x0004
@@ -1174,14 +1175,22 @@ void
 auich_halt_pipe(struct auich_softc *sc, int pipe)
 {
int i;
-   uint32_t status;
+   uint32_t sts;
 
bus_space_write_1(sc-iot, sc-aud_ioh, pipe + AUICH_CTRL, 0);
-   for (i = 0; i  100; i++) {
-   status = bus_space_read_4(sc-iot, sc-aud_ioh, pipe + 
AUICH_STS);
-   if (status  AUICH_DCH)
-   break;
-   DELAY(1);
+
+   /* wait for DMA halted and clear interrupt / event bits if needed */
+   for (i = 0; i  1000; i++) {
+   sts = bus_space_read_2(sc-iot, sc-aud_ioh, pipe + sc-sc_sts_reg);
+
+   if (sts  (AUICH_CELV | AUICH_LVBCI | AUICH_BCIS | AUICH_FIFOE))
+   bus_space_write_2(sc-iot, sc-aud_ioh, pipe + sc-sc_sts_reg,
+   AUICH_CELV | AUICH_LVBCI | AUICH_BCIS | AUICH_FIFOE);
+
+   if (sts  AUICH_DCH)
+   break;
+
+   DELAY(100);
}
bus_space_write_1(sc-iot, sc-aud_ioh, pipe + AUICH_CTRL, AUICH_RR);
 
@@ -1199,7 +1208,8 @@ auich_halt_output(v)
 
DPRINTF(AUICH_DEBUG_DMA, (%s: halt_output\n, sc-sc_dev.dv_xname));
 
-   bus_space_write_1(sc-iot, sc-aud_ioh, AUICH_PCMO + AUICH_CTRL, 
AUICH_RR);
+   auich_halt_pipe(sc, AUICH_PCMO);
+
sc-pcmo.intr = NULL;
 
return 0;
@@ -1216,8 +1226,9 @@ auich_halt_input(v)
 
/* XXX halt both unless known otherwise */
 
-   bus_space_write_1(sc-iot, sc-aud_ioh, AUICH_PCMI + AUICH_CTRL, 
AUICH_RR);
-   

Re: uvm_map improvements

2010-04-01 Thread Toni Mueller
Hi,

On Fri, 26.02.2010 at 00:31:35 -0700, Theo de Raadt dera...@cvs.openbsd.org 
wrote:
 space when it is under high contention.  But there is a massively
 understated benefit that comes from filling the address space with
 unallocated gaps.  The gaps, though only on a page boundary, are
 finding a lot of bugs.  LOTS OF THEM.  It is also crashing security
 sensitive programs before they come under control.  Unfortunately the
 finding finding a middle ground in the VM system is a complex problem.

stupid idea, perhaps, but would it be possible to recycle the idea of
having some sort of canaries at the end of *each* page, thus disposing
of the need to have guard pages? Or would that be too costly?

 right next to each other.  Every day, I will prefer an application
 that crashes often (so that it can be fixed, or discarded) over one
 that is encouraged by libc to cause random and late-detected
 corruption.

+100


Kind regards,
--Toni++



Re: uvm_map improvements

2010-04-01 Thread Bob Beck
 stupid idea, perhaps, but would it be possible to recycle the idea of
 having some sort of canaries at the end of *each* page, thus disposing
 of the need to have guard pages? Or would that be too costly?

Oh sure, that'll work Ok, I'll just ensure when your file gets written
out it has a 64 byte canarie replacing whatever was in it every 4K of
the file.   You won't miss that data much.



Re: uvm_map improvements

2010-04-01 Thread Otto Moerbeek
On Thu, Apr 01, 2010 at 09:56:19AM -0600, Bob Beck wrote:

  stupid idea, perhaps, but would it be possible to recycle the idea of
  having some sort of canaries at the end of *each* page, thus disposing
  of the need to have guard pages? Or would that be too costly?
 
 Oh sure, that'll work Ok, I'll just ensure when your file gets written
 out it has a 64 byte canarie replacing whatever was in it every 4K of
 the file.   You won't miss that data much.

Also, canaries need active checks to see if they are alive. 

Accessing unmapped pages just kill you instantly, smoothly and without
fuzz.  All hail memory management hardware! 

-Otto



Re: uvm_map improvements

2010-04-01 Thread Bob Beck
 All hail memory management hardware!

All hail a quick and honorable death. None of this surviving without
honor in our kernel. We want to die quckly.



Otkrijte tipične znake prevare

2010-04-01 Thread E-topshop
If you have trouble seeing this mail, click here.

Top Shop

Top E-revija: 47, 1. april 2010.
Najbolja praktiD
na rešenja i saveti za bolji Eivot

PoD
etna | Budi fit | Lepota | Zdrav Eivot

DomaDinstvo | Zabava i deca | Quelle | Knjige

Top Shop

HIT TV proizvodi!

Ab Tronic X2 - Pojas za stomak

Ab Tronic X2

H2O mop ultra - univerzalni paroD
istaD


H2O mop ultra

Cardio twister - Kardio steper

Kardio steper

Sweet Dream Pillow - jastuk od ...

Sweet Dream Pillow

FlavorWave Turbo Oven - turbo ...

FlavorWave Turbo Oven

Proverite da li Vas vara

Sumnjate u vernost partnera? Proverite koji su tipiD
ni znaci muške
prevare...

9 saveta za stvarno bolji seks

Imate odliD
an odnos sa partnerom, ali seks Å¡kripi? Otkrivamo kako da
podmaEete stvari!

Istina o najveDoj porno zvezdi

ProD
itajte zašto je lik jedne porno zvezde izloEen u muzeju voštanih
figura?

Vreme je za rekreaciju

Sada je pravo vreme da mislite o svom izgledu. Leto je na pragu,
otkrivanje nam ne gine!

Proverite da li Vas vara

Proverite da li Vas vara

Dini Vam se da se ponaša D
udno u poslednje vreme, a ne znate kako da
doprete do partnera? Pribojavate se da ima još nekog pored Vas? Uhvatili
ste ga/je u laEi? Proverite da li postoji neko treDi... [Više
informacija]

Table Mate

100 najbrEih kupaca od zeke dobijaju na poklon Top Shop podlogu za miša!

Mamma's Cookie Cutters - Kalupi za kolaD
iDe

Back Magic - rekvizit za istezanje leDa

Speed Slicer - kuhinjski secko

Mamma s Cookie Cutters - Kalupi ...

Back Magic - rekvizit za istezanje ...

Speed Slicer - kuhinjski secko

Sami ili sa svojim detetom pravite najkreativnije kolaD
iDe sa 30-delnim
setom!

Rekvizit za istezanje leDa - poboljšava elastiD
nost kiD
me i poveDava
opseg pokreta.

NOVO! PraktiD
ni set za bezbedno i kreativno seD
enje svih vrsta
namirnica.

Cena: 2.690 RSD
[Više informacija]

Cena: 2.490 RSD
[Više informacija]

Cena: 2.590 RSD
[Više informacija]

9 jednostavnih saveta za stvarno ...

9 saveta za stvarno bolji seks

Imate stalnog partnera, sve je sasvim ok izmeDu Vas, ali za seks
jednostavno nema vremena... Kada ste poslednji put imali strastan susret
u, recimo, kupatilu ili kuhinji? Ne seDate se ni sami? Ovo je D
lanak za
vas! [Više informacija]

Vreme je super figuru i opuštanje

Air Sofa Bed - sofa na naduvavanje

Push Up Bars - rekvizit za sklekove

Variolux Massager - MasaEer sa kaiševima

Air Sofa Bed - multinamenski leEaj ...

Cross Training Push Up Bars - ...

Variolux Massager - MasaEer sa ...

Elegantna sofa, udobna za spavanje, zgodna i za opuštanje. Za stan ili
vikendicu!

RuD
ke obloEene sunDerom omoguDavaju mnogo efikasnije izvoDenje
sklekova.

MasaEer prilagodljiv svima, sa 6 razliD
itih kaiševa i podešavanjem
brzine rada.

Cena: 7.490 RSD
[Više informacija]

Cena: 1.490 RSD
[Više informacija]

Cena: 14.990 RSD
[Više informacija]

Istina o najveDoj porno zvezdi ...

Istina o najveDoj porno zvezdi

Da li ste znali da je DEena DEemson imala ozbiljan problem sa drogom?
Saznajte više o privatnom Eivotu i karijeri najveDe porno zvezde svih
vremena. Da li ste znali koji je njen put do vrha? [Više informacija]

Super izgled uz malo truda

In Styler - aparat za stilizovanje kose

Orbitrek Elite - sobni trenaEer

Quelle - Košulja Oinksee

In Styler - aparat za stilizovanje ...

Orbitrek Elite - sobni trenaEer

Košulja Oinksee

30%

Izgledajte svaki dan kao da ste upravo izašli od frizera! Prelepa frizura
kod kuDe!

Mali, tih i kompaktan sobni trenaEer koji udvostruD
uje efekte
veEbanja.

Naglašava struk. Ima umetak u struku i na rukavima. POPUST 30%

Cena: 6.490 RSD
[Više informacija]

Cena: 19.990 RSD
[Više informacija]

Cena: 1.323 RSD
[Više informacija]

Vreme je za rekreaciju

Vreme je za rekreaciju

ProleDe je tu i prostor za veEbanje se polako popunjava, jer svi Eele
da izgledaju super za leto. Ne volite da veEbate? Razumemo Vas!
Otkrivamo Vam super naD
ine za motivaciju kako bi vam bilo lakše. [Više
informacija]

Efikasno, paktiD
no, ekonomiD
no!

3 Minute Legs - fitnes za noge

Akvafor bokal za preD
išDavanje vode

Tuby - Dozer za ceDenje tuba

3 Minute Legs - fitnes za noge

Akvafor bokal za preD
išDavanje ...

Tuby - Dozer za ceDenje tuba

50%

E=elite mršavije, zategnute i oblikovane noge bez mnogo napora? - Evo
rešenja!

Sa Aquafor bokalom moEete uvek imati sveEe, D
iste i kvalitetne vode u
kuDi.

Dozer za ceDenje tuba Å¡tedi i do 15% sadrEaja tube. Od sada D
ak 50%
jeftiniji!

Cena: 4.990 RSD
[Više informacija]

Cena: 2.490 RSD
[Više informacija]

Cena: 1.245 RSD
[Više informacija]

Ovu elektronsku poštu primate, ukoliko ste svojevoljno ostavili svoju
e-mail adresu na nekom od sajtova Top Shop-a, uD
estvovali u našoj poklon
igri ili nagradnom kvizu ili se prijavili za e-D
asopis Top Shop-a ili
nekog od nasih brendova.

Ponude date u ovom e-mailu vaEe iskljuD
ivo za porudEbine upuDene
putem Interneta ili broja telefona 021 489 26 60.

Ukoliko ne Eelite više da primate naše 

cleanup grep options

2010-04-01 Thread Ted Unangst
There are 3 sets of options in the greposphere.  Some are defined by 
posix.  Some are extensions defined by gnu.  And then there's a few others 
that show up in our grep.

This diff removes some of the entries in the last set.  For the most part, 
our grep tries to be compatible with the defacto gnu standard for grep, 
but there's no need to blaze our own trail.

These options relate to symlink handling, for which gnu grep has no 
equivalent, and for which I'd say the answer is, if you care, you use 
find.  That's what find is for.



Index: grep.1
===
RCS file: /home/tedu/cvs/src/usr.bin/grep/grep.1,v
retrieving revision 1.36
diff -u -r1.36 grep.1
--- grep.1  8 Feb 2009 17:15:10 -   1.36
+++ grep.1  2 Apr 2010 02:14:18 -
@@ -38,7 +38,7 @@
 .Sh SYNOPSIS
 .Nm grep
 .Bk -words
-.Op Fl abcEFGHhIiLlnoPqRSsUVvwxZ
+.Op Fl abcEFGhIiLlnqRsUVvwxZ
 .Op Fl A Ar num
 .Op Fl B Ar num
 .Op Fl C Ns Op Ar num
@@ -183,12 +183,6 @@
 .Nm grep
 to behave as traditional
 .Nm grep ) .
-.It Fl H
-If
-.Fl R
-is specified, follow symbolic links only if they were explicitly listed
-on the command line.
-The default is not to follow symbolic links.
 .It Fl h
 Never print filename headers
 .Pq i.e. filenames
@@ -229,13 +223,6 @@
 .Fl q
 is
 specified.
-.It Fl o
-Always print filename headers with output lines.
-.It Fl P
-If
-.Fl R
-is specified, no symbolic links are followed.
-This is the default.
 .It Fl q
 Quiet mode:
 suppress normal output.
@@ -244,11 +231,6 @@
 making searches potentially less expensive.
 .It Fl R
 Recursively search subdirectories listed.
-.It Fl S
-If
-.Fl R
-is specified, all symbolic links are followed.
-The default is not to follow symbolic links.
 .It Fl s
 Silent mode.
 Nonexistent and unreadable files are ignored
@@ -367,7 +349,7 @@
 specification.
 .Pp
 The flags
-.Op Fl AaBbCGHhILoPRSUVwZ
+.Op Fl AaBbCGhILRUVwZ
 are extensions to that specification, and the behaviour of the
 .Fl f
 flag when used with an empty pattern file is left undefined.
Index: grep.c
===
RCS file: /home/tedu/cvs/src/usr.bin/grep/grep.c,v
retrieving revision 1.39
diff -u -r1.39 grep.c
--- grep.c  2 Sep 2007 15:19:32 -   1.39
+++ grep.c  2 Apr 2010 02:18:11 -
@@ -62,11 +62,8 @@
 int Eflag; /* -E: interpret pattern as extended regexp */
 int Fflag; /* -F: interpret pattern as list of fixed strings */
 int Gflag; /* -G: interpret pattern as basic regexp */
-int Hflag; /* -H: if -R, follow explicitly listed symlinks */
 int Lflag; /* -L: only show names of files with no matches */
-int Pflag; /* -P: if -R, no symlinks are followed */
 int Rflag; /* -R: recursively search directory trees */
-int Sflag; /* -S: if -R, follow all symlinks */
 #ifndef NOZ
 int Zflag; /* -Z: decompress input before processing */
 #endif
@@ -76,7 +73,6 @@
 int iflag; /* -i: ignore case */
 int lflag; /* -l: only show names of files with matches */
 int nflag; /* -n: show line numbers in front of matching lines */
-int oflag; /* -o: always print file name */
 int qflag; /* -q: quiet mode (don't output anything) */
 int sflag; /* -s: silent mode (ignore errors) */
 int vflag; /* -v: only show non-matching lines */
@@ -110,9 +106,9 @@
 {
fprintf(stderr,
 #ifdef NOZ
-   usage: %s [-abcEFGHhIiLlnoPqRSsUVvwx] [-A num] [-B num] 
[-C[num]]\n
+   usage: %s [-abcEFGhIiLlnqRsUVvwx] [-A num] [-B num] [-C[num]]\n
 #else
-   usage: %s [-abcEFGHhIiLlnoPqRSsUVvwxZ] [-A num] [-B num] 
[-C[num]]\n
+   usage: %s [-abcEFGhIiLlnqRsUVvwxZ] [-A num] [-B num] [-C[num]]\n
 #endif
\t[-e pattern] [-f file] [--binary-files=value] 
[--context[=num]]\n
\t[--line-buffered] [pattern] [file ...]\n, __progname);
@@ -120,9 +116,9 @@
 }
 
 #ifdef NOZ
-static char *optstr = 0123456789A:B:CEFGHILPSRUVabce:f:hilnoqrsuvwxy;
+static char *optstr = 0123456789A:B:CEFGILRUVabce:f:hilnqrsuvwxy;
 #else
-static char *optstr = 0123456789A:B:CEFGHILPSRUVZabce:f:hilnoqrsuvwxy;
+static char *optstr = 0123456789A:B:CEFGILRUVZabce:f:hilnqrsuvwxy;
 #endif
 
 struct option long_options[] =
@@ -317,9 +313,6 @@
Eflag = Fflag = 0;
Gflag++;
break;
-   case 'H':
-   Hflag++;
-   break;
case 'I':
binbehave = BIN_FILE_SKIP;
break;
@@ -327,16 +320,9 @@
lflag = 0;
Lflag = qflag = 1;
break;
-   case 'P':
-   Pflag++;
-   break;
-   case 'S':
-   Sflag++;
-

proc.h and dev/pci

2010-04-01 Thread Ted Unangst
What does sys/proc.h have to do with dev/pci?  The answer should probably 
be not much, but in reality is closer to quite a bit.

As part of the ongoing rthreads work, I'm making some changes to internal 
fields of struct proc.  These fields are only accessed by files under 
kern.  Why then, I wondered, did minor changes require the entire kernel 
to be recompiled.  Because everything includes sys/proc.h!

Some code is after tsleep and wakeup.  Other code is after one of proc.h's 
tagalong includes, like timeout.h.  But no reason to drag all of proc.h in 
for such things.

Following diff moves tsleep and wakeup into param.h (not sure of a better 
place to put them, but it seems reasonable), and converts a sample few pci 
drivers to a proc.h free existence.

This has two benefits.  First, all kernel compiles get faster, as they 
have less text to process for many files.  Second, it makes development 
faster by reducing the set of dependencies for a recompile.

Index: dev/pci/ips.c
===
RCS file: /home/tedu/cvs/src/sys/dev/pci/ips.c,v
retrieving revision 1.95
diff -u -r1.95 ips.c
--- dev/pci/ips.c   23 Mar 2010 01:57:20 -  1.95
+++ dev/pci/ips.c   2 Apr 2010 03:31:18 -
@@ -29,7 +29,6 @@
 #include sys/ioctl.h
 #include sys/kernel.h
 #include sys/malloc.h
-#include sys/proc.h
 #include sys/sensors.h
 #include sys/timeout.h
 #include sys/queue.h
Index: dev/pci/mpii.c
===
RCS file: /home/tedu/cvs/src/sys/dev/pci/mpii.c,v
retrieving revision 1.12
diff -u -r1.12 mpii.c
--- dev/pci/mpii.c  23 Mar 2010 01:57:20 -  1.12
+++ dev/pci/mpii.c  2 Apr 2010 03:32:35 -
@@ -25,7 +25,6 @@
 #include sys/buf.h
 #include sys/device.h
 #include sys/ioctl.h
-#include sys/proc.h
 #include sys/malloc.h
 #include sys/kernel.h
 #include sys/rwlock.h
Index: dev/pci/nofn.c
===
RCS file: /home/tedu/cvs/src/sys/dev/pci/nofn.c,v
retrieving revision 1.16
diff -u -r1.16 nofn.c
--- dev/pci/nofn.c  22 May 2008 19:23:04 -  1.16
+++ dev/pci/nofn.c  2 Apr 2010 03:34:33 -
@@ -37,13 +37,13 @@
 
 #include sys/param.h
 #include sys/systm.h
-#include sys/proc.h
 #include sys/errno.h
 #include sys/malloc.h
 #include sys/kernel.h
 #include sys/mbuf.h
 #include sys/device.h
 #include sys/queue.h
+#include sys/timeout.h
 
 #include crypto/cryptodev.h
 #include crypto/cryptosoft.h
Index: dev/pci/ppb.c
===
RCS file: /home/tedu/cvs/src/sys/dev/pci/ppb.c,v
retrieving revision 1.40
diff -u -r1.40 ppb.c
--- dev/pci/ppb.c   27 Dec 2009 20:03:52 -  1.40
+++ dev/pci/ppb.c   2 Apr 2010 03:34:44 -
@@ -35,7 +35,7 @@
 #include sys/systm.h
 #include sys/kernel.h
 #include sys/device.h
-#include sys/proc.h
+#include sys/timeout.h
 #include sys/workq.h
 
 #include dev/pci/pcireg.h
Index: dev/pci/safe.c
===
RCS file: /home/tedu/cvs/src/sys/dev/pci/safe.c,v
retrieving revision 1.27
diff -u -r1.27 safe.c
--- dev/pci/safe.c  10 Jan 2010 12:43:07 -  1.27
+++ dev/pci/safe.c  2 Apr 2010 03:33:43 -
@@ -36,7 +36,6 @@
  */
 #include sys/param.h
 #include sys/systm.h
-#include sys/proc.h
 #include sys/errno.h
 #include sys/malloc.h
 #include sys/kernel.h
Index: dev/pci/yds.c
===
RCS file: /home/tedu/cvs/src/sys/dev/pci/yds.c,v
retrieving revision 1.32
diff -u -r1.32 yds.c
--- dev/pci/yds.c   29 Mar 2009 21:53:53 -  1.32
+++ dev/pci/yds.c   2 Apr 2010 03:31:32 -
@@ -45,7 +45,6 @@
 #include sys/fcntl.h
 #include sys/malloc.h
 #include sys/device.h
-#include sys/proc.h
 #include sys/queue.h
 #include sys/fcntl.h
 
Index: sys/param.h
===
RCS file: /home/tedu/cvs/src/sys/sys/param.h,v
retrieving revision 1.86
diff -u -r1.86 param.h
--- sys/param.h 17 Feb 2010 21:46:43 -  1.86
+++ sys/param.h 2 Apr 2010 03:31:07 -
@@ -85,6 +85,23 @@
 #include sys/resource.h
 #include sys/ucred.h
 #include sys/uio.h
+struct sleep_state;
+struct mutex;
+void   sleep_setup(struct sleep_state *, const volatile void *, int,
+   const char *);
+void   sleep_setup_timeout(struct sleep_state *, int);
+void   sleep_setup_signal(struct sleep_state *, int);
+void   sleep_finish(struct sleep_state *, int);
+intsleep_finish_timeout(struct sleep_state *);
+intsleep_finish_signal(struct sleep_state *);
+void   sleep_queue_init(void);
+
+voidwakeup_n(const volatile void *, int);
+voidwakeup(const volatile void *);
+#define wakeup_one(c) wakeup_n((c), 1)
+inttsleep(const volatile void *, int, const char *, int);
+intmsleep(const volatile void *, struct mutex *, int,  const char*, int);
+
 #endif
 
 /* Signals. */
Index: 

Re: proc.h and dev/pci

2010-04-01 Thread Philip Guenther
On Thu, Apr 1, 2010 at 8:43 PM, Ted Unangst ted.unan...@gmail.com wrote:
 As part of the ongoing rthreads work, I'm making some changes to internal
 fields of struct proc.  These fields are only accessed by files under
 kern.  Why then, I wondered, did minor changes require the entire kernel
 to be recompiled.  Because everything includes sys/proc.h!

 Some code is after tsleep and wakeup.  Other code is after one of proc.h's
 tagalong includes, like timeout.h.  But no reason to drag all of proc.h in
 for such things.

 Following diff moves tsleep and wakeup into param.h (not sure of a better
 place to put them, but it seems reasonable), and converts a sample few pci
 drivers to a proc.h free existence.

Yes!  Yes yes yes yes!

Two thoughts:
1) struct sleep_state and the sleep_* functions can remain in sys/proc.h, as
   everything using those needs sys/proc.h already

2) putting real functions into sys/param.h seems odd.  sys/systm.h perhaps?
   (If you already considered it then consider this bikeshedding.)


Philip Guenther