Re: macppc: GPIO & macobio(4) cleanup

2011-05-12 Thread Martin Pieuchot
On 26/04/11(Tue) 18:22, Martin Pieuchot wrote:
> On macppc there are many way to get the gpio addresses of the devices 
> through the openfirmware.
> 
> Depending of the model you can read that address directly (property
> AAPL,address), read an offset (in reg) sometimes relative to the gpio
> controllers address sometimes relative to the base address of the I/O
> bus. And sometimes the address/offset is not even read but hardcoded in
> the drivers.
> 
> The following diff is a first step to unify this and exposes 4 methods,
> 3 of which already existed, to manage gpios with an offset from the I/O
> bus base address.

I didn't get any comment on this independently from the DFS diff. Any
thought?

> Index: dev/i2s.c
> ===
> RCS file: /cvs/src/sys/arch/macppc/dev/i2s.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 i2s.c
> --- dev/i2s.c 15 Jul 2010 03:43:11 -  1.18
> +++ dev/i2s.c 26 Apr 2011 12:15:37 -
> @@ -46,6 +46,7 @@
>  
>  #include 
>  #include 
> +#include 
>  
>  #ifdef I2S_DEBUG
>  # define DPRINTF(x) printf x 
> @@ -78,10 +79,6 @@ void i2s_init(struct i2s_softc *, int);
>  int i2s_intr(void *);
>  int i2s_iintr(void *);
>  
> -/* XXX */
> -void keylargo_fcr_enable(int, u_int32_t);
> -void keylargo_fcr_disable(int, u_int32_t);
> -
>  struct cfdriver i2s_cd = {
>   NULL, "i2s", DV_DULL
>  };
> @@ -95,25 +92,6 @@ static int headphone_detect_active;
>  static u_char *lineout_detect;
>  static int lineout_detect_active;
>  
> -/* GPIO bits */
> -#define GPIO_OUTSEL  0xf0/* Output select */
> - /*  0x00GPIO bit0 is output
> - 0x10media-bay power
> - 0x20reserved
> - 0x30MPIC */
> -
> -#define GPIO_ALTOE   0x08/* Alternate output enable */
> - /*  0x00Use DDR
> - 0x08Use output select */
> -
> -#define GPIO_DDR 0x04/* Data direction */
> -#define GPIO_DDR_OUTPUT  0x04/* Output */
> -#define GPIO_DDR_INPUT   0x00/* Input */
> -
> -#define GPIO_LEVEL   0x02/* Pin level (RO) */
> -
> -#define  GPIO_DATA   0x01/* Data */
> -
>  void
>  i2s_attach(struct device *parent, struct i2s_softc *sc, struct confargs *ca)
>  {
> @@ -951,7 +929,7 @@ i2s_set_rate(sc, rate)
>   /* Clear CLKSTOPPEND */
>   out32rb(sc->sc_reg + I2S_INT, I2S_INT_CLKSTOPPEND);
>  
> - keylargo_fcr_disable(I2SClockOffset, I2S0CLKEN);
> + macobio_disable(I2SClockOffset, I2S0CLKEN);
>  
>   /* Wait until clock is stopped */
>   for (timo = 50; timo > 0; timo--) {
> @@ -967,7 +945,7 @@ done:
>   in32rb(sc->sc_reg + I2S_FORMAT), reg));
>   out32rb(sc->sc_reg + I2S_FORMAT, reg);
>  
> - keylargo_fcr_enable(I2SClockOffset, I2S0CLKEN);
> + macobio_enable(I2SClockOffset, I2S0CLKEN);
>  
>   sc->sc_rate = rate;
>  
> Index: dev/xlights.c
> ===
> RCS file: /cvs/src/sys/arch/macppc/dev/xlights.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 xlights.c
> --- dev/xlights.c 30 Sep 2008 04:54:00 -  1.4
> +++ dev/xlights.c 26 Apr 2011 12:15:37 -
> @@ -27,6 +27,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  struct xlights_softc {
>   struct device   sc_dev;
> @@ -55,8 +56,6 @@ void xlights_startdma(struct xlights_sof
>  void xlights_deferred(void *);
>  void xlights_theosDOT(void *);
>  void xlights_timeout(void *);
> -extern void keylargo_fcr_enable(int, u_int32_t);
> -extern void keylargo_fcr_disable(int, u_int32_t);
>  
>  struct cfattach xlights_ca = {
>   sizeof(struct xlights_softc), xlights_match,
> Index: pci/macobio.c
> ===
> RCS file: /cvs/src/sys/arch/macppc/pci/macobio.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 macobio.c
> --- pci/macobio.c 22 Aug 2009 02:54:50 -  1.18
> +++ pci/macobio.c 26 Apr 2011 12:15:37 -
> @@ -45,6 +45,7 @@
>  
>  #include 
>  #include 
> +#include 
>  
>  void macobio_attach(struct device *, struct device *, void *);
>  int macobio_match(struct device *, void *, void *);
> @@ -257,12 +258,8 @@ mac_intr_disestablish(void *lcp, void *a
>   (*mac_intr_disestablish_func)(lcp, arg);
>  }
>  
> -void keylargo_fcr_enable(int offset, u_int32_t bits);
> -void keylargo_fcr_disable(int offset, u_int32_t bits);
> -u_int32_t keylargo_fcr_read(int offset);
> -
>  void
> -keylargo_fcr_enable(int offset, u_int32_t bits)
> +macobio_enable(int offset, u_int32_t bits)
>  {
>   struct macobio_softc *sc = macobio_cd.cd_devs[0];
>   if (sc->obiomem == 0)
> @@ -272,7 +269,7 @@ keylargo_fcr_enable(int offset, u_int32_
>   out32rb(sc->obiomem + offset, bits);
>  }
>  void
> -keylargo_fcr_disable(int offset, u_int32_t bits)
> +macobio_disable(int offset, u_int32_t bits)
>  {
>   struct macobio_softc *sc = mac

Re: adb(4)/pm_direct.c cleanup

2011-05-12 Thread Martin Pieuchot
On 03/05/11(Tue) 23:17, Jasper Lievisse Adriaanse wrote:
> On Tue, May 03, 2011 at 08:11:52AM +0530, Martin Pieuchot wrote:
> > On macppc, the pm_* methods are always attached to a PMU (or PMU99), so
> > no need to check for hardware.
> > 
> > Tested here with a powerbook6,5.
> > 
> > Ok?
> This appears to be working fine on my PowerBook4,1 (ibook g3), will do more
> testing tomorrow if needed. There's no dmesg change.

I don't think more test are necessarily needed, it's a really simple
cleaning diff. Anyone wants to ok this, so I can continue cleaning the
adb/cuda/pmu stuff ?

Martin



Assistenza al contezioso bancario - Assistenza alle aziende in crisi - Finanziamenti per privati e imprese.

2011-05-12 Thread Agenzia
Fineuropa finanziamenti ordinari e agevolati

agevolazioni e assistenza alle aziende in crisi

servizi al contezioso bancario

http://fineuropa18.x10.mx/index.html



Re: Optionally ignore "host/network is down" errors for ping(8)

2011-05-12 Thread Todd T. Fries
Utilities which go into the install media should not be grown without
cause, or at the very least, growth wrapped with #ifndef SMALL.

I think if you want some messages quieted, maybe you should look up
some standard unix utilities.

ping host 2>&1 | awk '/is down/{next}{print}'

Penned by Vadim Zhukov on 20110512 17:54.19, we have:
| Hello all.
| 
| Following diff adds new option to ping(8), making it not output
| messages "host is down" and "network is down". Very useful when you're
| monitoring/fixing routing problems, with ping started in one window, and
| you already know that no packets mean problems, and error messages just
| spam your window. Works for me for a long time.
| 
| Mnemonic for -W is "Wait until this shit comes up". :)
| 
| If this goes in, I'll do the same for ping6(8).
| 
| -- 
|   Best wishes,
| Vadim Zhukov
| 
| A: Because it messes up the order in which people normally read text.
| Q: Why is top-posting such a bad thing?
| A: Top-posting.
| Q: What is the most annoying thing in e-mail?
| 
| 
| Index: ping.8
| ===
| RCS file: /cvs/src/sbin/ping/ping.8,v
| retrieving revision 1.45
| diff -u -p -r1.45 ping.8
| --- ping.83 Jul 2010 04:44:51 -   1.45
| +++ ping.812 May 2011 22:46:41 -
| @@ -39,7 +39,7 @@
|  .Sh SYNOPSIS
|  .Nm ping
|  .Bk -words
| -.Op Fl DdEefLnqRrv
| +.Op Fl DdEefLnqRrvW
|  .Op Fl c Ar count
|  .Op Fl I Ar ifaddr
|  .Op Fl i Ar wait
| @@ -192,6 +192,13 @@ Verbose output.
|  ICMP packets other than
|  .Dv ECHO_REPLY
|  that are received are listed.
| +.It Fl W
| +Do not print
| +.Dq Host is down
| +or
| +.Dq Network is down
| +error messages.
| +Mnemonic: Wait until it come up.
|  .It Fl w Ar maxwait
|  Specifies the maximum number of seconds to wait for responses
|  after the last request has been sent.
| Index: ping.c
| ===
| RCS file: /cvs/src/sbin/ping/ping.c,v
| retrieving revision 1.88
| diff -u -p -r1.88 ping.c
| --- ping.c3 Jul 2010 04:44:51 -   1.88
| +++ ping.c12 May 2011 22:46:41 -
| @@ -108,6 +108,7 @@ int options;
|  #define  F_SO_JUMBO  0x1000
|  #define  F_AUD_RECV  0x2000
|  #define  F_AUD_MISS  0x4000
| +#define  F_NODOWN0x8000
|  
|  /* multicast options */
|  int moptions;
| @@ -201,7 +202,7 @@ main(int argc, char *argv[])
|   preload = 0;
|   datap = &outpack[8 + sizeof(struct tvi)];
|   while ((ch = getopt(argc, argv,
| - "DEI:LRS:c:defi:jl:np:qrs:T:t:V:vw:")) != -1)
| + "c:DdEefI:i:jL:l:np:qRrS:s:T:t:V:vWw:")) != -1)
|   switch(ch) {
|   case 'c':
|   npackets = (unsigned long)strtonum(optarg, 0,
| @@ -319,6 +320,9 @@ main(int argc, char *argv[])
|   case 'v':
|   options |= F_VERBOSE;
|   break;
| + case 'W':
| + options |= F_NODOWN;
| + break;
|   case 'w':
|   maxwait = (unsigned int)strtonum(optarg, 1, INT_MAX,
|   &errstr);
| @@ -653,11 +657,15 @@ pinger(void)
|   sizeof(whereto));
|  
|   if (i < 0 || i != cc)  {
| - if (i < 0)
| - perror("ping: sendto");
| - snprintf(buf, sizeof buf, "ping: wrote %s %d chars, ret=%d\n",
| - hostname, cc, i);
| - write(STDOUT_FILENO, buf, strlen(buf));
| + if (i >= 0 || (errno != ENETDOWN && errno != EHOSTDOWN) ||
| + (options & F_NODOWN) != F_NODOWN) {
| + if (i < 0)
| + perror("ping: sendto");
| + snprintf(buf, sizeof buf,
| + "ping: wrote %s %d chars, ret=%d\n",
| + hostname, cc, i);
| + write(STDOUT_FILENO, buf, strlen(buf));
| + }
|   }
|   if (!(options & F_QUIET) && options & F_FLOOD)
|   (void)write(STDOUT_FILENO, &DOT, 1);
| @@ -1363,7 +1371,7 @@ void
|  usage(void)
|  {
|   (void)fprintf(stderr,
| - "usage: ping [-DdEefLnqRrv] [-c count] [-I ifaddr] [-i wait]\n"
| + "usage: ping [-DdEefLnqRrWv] [-c count] [-I ifaddr] [-i wait]\n"
|   "\t[-l preload] [-p pattern] [-s packetsize] [-T tos] [-t ttl]\n"
|   "\t[-V rtable] [-w maxwait] host\n");
|   exit(1);

-- 
Todd Fries .. t...@fries.net

 _
| \  1.636.410.0632 (voice)
| Free Daemon Consulting, LLC   

redux automated installation tool: alpha version available for testing

2011-05-12 Thread Nick Bender
Get the distribution at http://hiqu.biz/redux.

This has been lightly tested with 4.8 and 4.9 - some things will
not to work :-)

Comments/bugs/suggestions/pleas for help should be directed to
the redux Google Group at:

http://groups.google.com/group/obsd-redux

-N

Here is the Readme file:

Welcome to redux, an OpenBSD automated installation framework.

redux enhances the standard OpenBSD installation procedure by
enabling the following functionality:

1. Record all choices made during an installation.
2. Enable an automated installation using recorded choices.
3. Allow interactive revision of a previously recorded
   installation session.
4. Provide support for network based fully automated
   installation using only tools provided by OpenBSD.

redux is ditributed as a Makefile, a set of patches to the
standard installation scripts and a small number of additional
installation scripts. Building the entire source tree is not
required as redux uses an existing ditribution as the starting
point. By default it assumes that the OpenBSD source tree is
loaded in /usr/src and that the installation CD is mounted on
/mnt (see the top of the makefile to adjust these locations).
The output of the make process is a modified installation
ramdisk which can be booted using pxeboot which has been
enhanced with additional features.

An effort has been made to minimize the changes to the default
scripts to minimize ongoing maintenance as the base system
evolves. redux has been tested on i386 and amd64 and may be
usable on other architectures.



NELEM() -> nitems() in sys/i386/i386/est.c and bin/ksh/

2011-05-12 Thread Vadim Zhukov
Hello all.

This diff removes NELEM() definitions in favour of nitems(). Not sure
about bin/ksh/ part, but sys/i386/i386/est.c is obviously a leftover.

There are more NELEM() items in tree, but they belong to foreign stuff
and therefore should not be touched, as far as I understand.

-- 
  Best wishes,
Vadim Zhukov

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


Index: sys/arch/i386/i386/est.c
===
RCS file: /cvs/src/sys/arch/i386/i386/est.c,v
retrieving revision 1.36
diff -u -p -r1.36 est.c
--- sys/arch/i386/i386/est.c5 Jul 2010 22:47:41 -   1.36
+++ sys/arch/i386/i386/est.c12 May 2011 23:03:48 -
@@ -862,10 +862,8 @@ struct fqlist {
struct est_op *table;
 };
 
-#define NELEM(x) (sizeof(x) / sizeof((x)[0]))
-
 #define ENTRY(ven, bus_clk, tab) \
-   { CPUVENDOR_##ven, bus_clk == BUS133 ? 1 : 0, NELEM(tab), tab }
+   { CPUVENDOR_##ven, bus_clk == BUS133 ? 1 : 0, nitems(tab), tab }
 
 #define BUS_CLK(fqp) ((fqp)->bus_clk ? BUS133 : BUS100)
 
@@ -1082,7 +1080,7 @@ est_init(const char *cpu_device, int ven
/*
 * Find an entry which matches (vendor, bus_clock, idhi, idlo)
 */
-   for (i = 0; i < NELEM(est_cpus); i++) {
+   for (i = 0; i < nitems(est_cpus); i++) {
fql = &est_cpus[i];
if (vendor == fql->vendor && bus_clock == BUS_CLK(fql)
&& idhi == fql->table[0].ctrl
Index: bin/ksh/c_ulimit.c
===
RCS file: /cvs/src/bin/ksh/c_ulimit.c,v
retrieving revision 1.17
diff -u -p -r1.17 c_ulimit.c
--- bin/ksh/c_ulimit.c  21 Mar 2008 12:51:19 -  1.17
+++ bin/ksh/c_ulimit.c  12 May 2011 23:03:48 -
@@ -53,7 +53,7 @@ c_ulimit(char **wp)
 #endif /* RLIMIT_VMEM */
{ (char *) 0 }
};
-   static char options[4 + NELEM(limits) * 2];
+   static char options[4 + nitems(limits) * 2];
int how = SOFT | HARD;
const struct limits *l;
int optc, all = 0;
Index: bin/ksh/edit.c
===
RCS file: /cvs/src/bin/ksh/edit.c,v
retrieving revision 1.34
diff -u -p -r1.34 edit.c
--- bin/ksh/edit.c  20 May 2010 01:13:07 -  1.34
+++ bin/ksh/edit.c  12 May 2011 23:03:48 -
@@ -223,7 +223,7 @@ set_editmode(const char *ed)
 
if ((rcp = strrchr(ed, '/')))
ed = ++rcp;
-   for (i = 0; i < NELEM(edit_flags); i++)
+   for (i = 0; i < nitems(edit_flags); i++)
if (strstr(ed, options[(int) edit_flags[i]].name)) {
change_flag(edit_flags[i], OF_SPECIAL, 1);
return;
Index: bin/ksh/emacs.c
===
RCS file: /cvs/src/bin/ksh/emacs.c,v
retrieving revision 1.43
diff -u -p -r1.43 emacs.c
--- bin/ksh/emacs.c 14 Mar 2011 21:20:01 -  1.43
+++ bin/ksh/emacs.c 12 May 2011 23:03:49 -
@@ -1312,7 +1312,7 @@ x_bind( const char *a1, const char *a2,
 
/* List function names */
if (list) {
-   for (f = 0; f < NELEM(x_ftab); f++)
+   for (f = 0; f < nitems(x_ftab); f++)
if (x_ftab[f].xf_name &&
!(x_ftab[f].xf_flags & XF_NOBIND))
shprintf("%s\n", x_ftab[f].xf_name);
@@ -1352,11 +1352,11 @@ x_bind( const char *a1, const char *a2,
if (*a2 == 0)
f = XFUNC_insert;
else if (!macro) {
-   for (f = 0; f < NELEM(x_ftab); f++)
+   for (f = 0; f < nitems(x_ftab); f++)
if (x_ftab[f].xf_name &&
strcmp(x_ftab[f].xf_name, a2) == 0)
break;
-   if (f == NELEM(x_ftab) || x_ftab[f].xf_flags & XF_NOBIND) {
+   if (f == nitems(x_ftab) || x_ftab[f].xf_flags & XF_NOBIND) {
bi_errorf("%s: no such function", a2);
return 1;
}
@@ -1402,7 +1402,7 @@ x_init_emacs(void)
for (i = 1; i < X_NTABS; i++)
for (j = 0; j < X_TABSZ; j++)
x_tab[i][j] = XFUNC_error;
-   for (i = 0; i < NELEM(x_defbindings); i++)
+   for (i = 0; i < nitems(x_defbindings); i++)
x_tab[(unsigned char)x_defbindings[i].xdb_tab]
[x_defbindings[i].xdb_char]
= x_defbindings[i].xdb_func;
 
Index: bin/ksh/jobs.c
===
RCS file: /cvs/src/bin/ksh/jobs.c,v
retrieving revision 1.39
diff -u -p -r1.39 jobs.c
--- bin/ksh/jobs.c  13 Dec 2009 04:36:48 -  1.39
+++ bin/

Optionally ignore "host/network is down" errors for ping(8)

2011-05-12 Thread Vadim Zhukov
Hello all.

Following diff adds new option to ping(8), making it not output
messages "host is down" and "network is down". Very useful when you're
monitoring/fixing routing problems, with ping started in one window, and
you already know that no packets mean problems, and error messages just
spam your window. Works for me for a long time.

Mnemonic for -W is "Wait until this shit comes up". :)

If this goes in, I'll do the same for ping6(8).

-- 
  Best wishes,
Vadim Zhukov

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


Index: ping.8
===
RCS file: /cvs/src/sbin/ping/ping.8,v
retrieving revision 1.45
diff -u -p -r1.45 ping.8
--- ping.8  3 Jul 2010 04:44:51 -   1.45
+++ ping.8  12 May 2011 22:46:41 -
@@ -39,7 +39,7 @@
 .Sh SYNOPSIS
 .Nm ping
 .Bk -words
-.Op Fl DdEefLnqRrv
+.Op Fl DdEefLnqRrvW
 .Op Fl c Ar count
 .Op Fl I Ar ifaddr
 .Op Fl i Ar wait
@@ -192,6 +192,13 @@ Verbose output.
 ICMP packets other than
 .Dv ECHO_REPLY
 that are received are listed.
+.It Fl W
+Do not print
+.Dq Host is down
+or
+.Dq Network is down
+error messages.
+Mnemonic: Wait until it come up.
 .It Fl w Ar maxwait
 Specifies the maximum number of seconds to wait for responses
 after the last request has been sent.
Index: ping.c
===
RCS file: /cvs/src/sbin/ping/ping.c,v
retrieving revision 1.88
diff -u -p -r1.88 ping.c
--- ping.c  3 Jul 2010 04:44:51 -   1.88
+++ ping.c  12 May 2011 22:46:41 -
@@ -108,6 +108,7 @@ int options;
 #defineF_SO_JUMBO  0x1000
 #defineF_AUD_RECV  0x2000
 #defineF_AUD_MISS  0x4000
+#defineF_NODOWN0x8000
 
 /* multicast options */
 int moptions;
@@ -201,7 +202,7 @@ main(int argc, char *argv[])
preload = 0;
datap = &outpack[8 + sizeof(struct tvi)];
while ((ch = getopt(argc, argv,
-   "DEI:LRS:c:defi:jl:np:qrs:T:t:V:vw:")) != -1)
+   "c:DdEefI:i:jL:l:np:qRrS:s:T:t:V:vWw:")) != -1)
switch(ch) {
case 'c':
npackets = (unsigned long)strtonum(optarg, 0,
@@ -319,6 +320,9 @@ main(int argc, char *argv[])
case 'v':
options |= F_VERBOSE;
break;
+   case 'W':
+   options |= F_NODOWN;
+   break;
case 'w':
maxwait = (unsigned int)strtonum(optarg, 1, INT_MAX,
&errstr);
@@ -653,11 +657,15 @@ pinger(void)
sizeof(whereto));
 
if (i < 0 || i != cc)  {
-   if (i < 0)
-   perror("ping: sendto");
-   snprintf(buf, sizeof buf, "ping: wrote %s %d chars, ret=%d\n",
-   hostname, cc, i);
-   write(STDOUT_FILENO, buf, strlen(buf));
+   if (i >= 0 || (errno != ENETDOWN && errno != EHOSTDOWN) ||
+   (options & F_NODOWN) != F_NODOWN) {
+   if (i < 0)
+   perror("ping: sendto");
+   snprintf(buf, sizeof buf,
+   "ping: wrote %s %d chars, ret=%d\n",
+   hostname, cc, i);
+   write(STDOUT_FILENO, buf, strlen(buf));
+   }
}
if (!(options & F_QUIET) && options & F_FLOOD)
(void)write(STDOUT_FILENO, &DOT, 1);
@@ -1363,7 +1371,7 @@ void
 usage(void)
 {
(void)fprintf(stderr,
-   "usage: ping [-DdEefLnqRrv] [-c count] [-I ifaddr] [-i wait]\n"
+   "usage: ping [-DdEefLnqRrWv] [-c count] [-I ifaddr] [-i wait]\n"
"\t[-l preload] [-p pattern] [-s packetsize] [-T tos] [-t ttl]\n"
"\t[-V rtable] [-w maxwait] host\n");
exit(1);



Re: Support for size multipliers in newfs/mount_mfs

2011-05-12 Thread Vadim Zhukov
On 2 May 2011 c. 16:05:08 David Coppa wrote:
> PING.

Sorry for so looog delaaay. :(

> On Thu, Apr 21, 2011 at 2:03 PM, Otto Moerbeek  wrote:
> > I think there a bug, see inline.

Yep. I also fixed extern declaration in mkfs.c.

(lint prints out many-many lines of warnings for mkfs.c, and it surely
needs love, but this is, of course, completely another case...)

--
  Best wishes,
Vadim Zhukov

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


Index: mkfs.c
===
RCS file: /cvs/src/sbin/newfs/mkfs.c,v
retrieving revision 1.74
diff -u -p -r1.74 mkfs.c
--- mkfs.c  21 Mar 2010 09:13:30 -  1.74
+++ mkfs.c  12 May 2011 22:04:36 -
@@ -87,7 +87,7 @@ extern intmfs;/* run as the memory ba
 extern int Nflag;  /* run mkfs without writing file system */
 extern int Oflag;  /* format as an 4.3BSD file system */
 extern daddr64_t fssize;   /* file system size */
-extern int sectorsize; /* bytes/sector */
+extern long long   sectorsize; /* bytes/sector */
 extern int fsize;  /* fragment size */
 extern int bsize;  /* block size */
 extern int maxfrgspercg;   /* maximum fragments per cylinder group */
@@ -404,8 +404,8 @@ mkfs(struct partition *pp, char *fsys, i
lastminfpg = roundup(sblock.fs_iblkno +
sblock.fs_ipg / INOPF(&sblock), sblock.fs_frag);
if (sblock.fs_size < lastminfpg)
-   errx(28, "file system size %jd < minimum size of %d",
-   (intmax_t)sblock.fs_size, lastminfpg);
+   errx(28, "file system size %jd < minimum size of %d "
+   "sectors", (intmax_t)sblock.fs_size, lastminfpg);

if (sblock.fs_size % sblock.fs_fpg >= lastminfpg ||
sblock.fs_size % sblock.fs_fpg == 0)
Index: newfs.8
===
RCS file: /cvs/src/sbin/newfs/newfs.8,v
retrieving revision 1.69
diff -u -p -r1.69 newfs.8
--- newfs.8 31 Mar 2011 11:17:58 -  1.69
+++ newfs.8 12 May 2011 22:04:36 -
@@ -218,6 +218,13 @@ With this option,
 will not print extraneous information like superblock backups.
 .It Fl S Ar sector-size
 The size of a sector in bytes (almost always 512).
+Alternatively
+.Ar sector-size
+may instead use a multiplier, as documented in
+.Xr scan_scaled 3 .
+.Ar sector-size
+should be 512 or a multiple of it because the kernel operates
+512\-byte blocks internally.
 A sector is the smallest addressable unit on the physical device.
 Changing this is useful only when using
 .Nm
@@ -227,14 +234,19 @@ created (for example on a write-once dis
 Note that changing this
 from its default will make it impossible for
 .Xr fsck 8
-to find the alternate superblocks if the standard superblock is
-lost.
+to find the alternate superblocks automatically if the standard
+superblock is lost.
 .It Fl s Ar size
-The size of the file system in sectors.
-This value is multiplied by the number of 512\-byte blocks in a sector
-to yield the size of the file system in 512\-byte blocks, which is the value
-used by the kernel.
-The maximum size of an FFS file system is 2,147,483,647 (2^31 \- 1) of these
+The size of the file system in sectors (see
+.Fl S ) .
+Alternatively
+.Ar size
+may instead use a multiplier, as documented in
+.Xr scan_scaled 3 ,
+to specify size in bytes; in this case
+.Ar size
+is rounded up to the next sector boundary.
+The maximum size of an FFS file system is 2,147,483,647 (2^31 \- 1) of
 512\-byte blocks, slightly less than 1 TB.
 FFS2 file systems can be as large as 64 PB.
 Note however that for
Index: newfs.c
===
RCS file: /cvs/src/sbin/newfs/newfs.c,v
retrieving revision 1.89
diff -u -p -r1.89 newfs.c
--- newfs.c 26 Apr 2011 14:02:14 -  1.89
+++ newfs.c 12 May 2011 22:04:36 -
@@ -114,7 +114,7 @@ int mfs;/* run as the memory based fi
 intNflag;  /* run without writing file system */
 intOflag = 1;  /* 0 = 4.3BSD ffs, 1 = 4.4BSD ffs, 2 = ffs2 */
 daddr64_t  fssize; /* file system size */
-intsectorsize; /* bytes/sector */
+long long  sectorsize; /* bytes/sector */
 intfsize = 0;  /* fragment size */
 intbsize = 0;  /* block size */
 intmaxfrgspercg = INT_MAX; /* maximum fragments per cylinder group */
@@ -169,6 +169,8 @@ main(int argc, char *argv[])
char **saveargv = argv;
int ffsflag = 1;
const char *errstr;
+   long long fssize_input = 0;
+   int fssize_usebytes = 0;

if (strstr(__progname, "mfs"))
m

Curso.Cómo tomar decisiones basadas en costos y precios. El punto de equilibrio

2011-05-12 Thread Interaula . Formación para el Futuro
Si no puede ver correctamente este newsletter, Pulse aqui

Si no puede visualizar este mail haga click aqu i
INTERAULA -
Formacisn para el Futuro CURSOS
ON-LINE

Csmo tomar decisiones basadas en costos y precios. El punto de equilibrio

[IMAGE]

Cuando las decisiones involucran precios y costos no hay herramienta mas
adecuada ni mas simple que el punto de equilibrio.

Sus principios son de uso necesario para la planificacisn y el control de
ingresos y costos, y son validos para toda clase de actividad: comercial,
industrial, de servicios, del ambito pzblico o privado, con o sin fin de
lucro; sin importar su tamaqo.
En este curso aprendera los principios para dominar esta herramienta.
Objetivos del Curso Docentes del Curso Precio
del Curso [IMAGE]
Consultar por este Curso Certificacisn del Curso Comentarios de Alumnos

[IMAGE]

[IMAGE]

[IMAGE]

NO LO DUDES MAS Y PROFESIONALMZATE

Nosotros te damos las herramientas

ESTUDIA DESDE TU CASA. NOSOTROS TE ACOMPAQAMOS.
NO IMPORTA TU EDAD NI ESTUDIOS PREVIOS.
ACCESO LAS 24 HORAS.

Inicio del Curso.

Docente

Certificacisn

04/11/2011
06/06/2011

Castillsn Jorge Alberto

Interface-online Argentnina S.A.
Siglo XXI Consultores de Formacisn S.L.

Consultas: Consultar por este Curso

Interaula en Facebook
Seguir a
interaula en Twitter

Newslwtter - Interaula Formacisn para el futuro. .

Si no quiere recibir mas informacisn, haga click aqum para desuscribirse

Para desuscribirse haga click aqui

.



Re: Fan mode management in acpithinkpad(4)

2011-05-12 Thread Marco Peereboom
On Thu, May 12, 2011 at 03:32:56PM +0200, Christopher Zimmermann wrote:
> On 05/12/11 14:37, Vadim Zhukov wrote:
> >Hello all.
> >
> >Here is a patch that allows for me to work on other things. :) Basically,
> >it makes OS choose fan mode instead of firmware. Main feature here is
> >enabling of "disengadged" mode when temperature goes critical, picking
> >80C as a "red line". Now I can fully load CPU on my X201i -
> >say, "make -j 4" - and it still works instead of being powering off by
> >acpitz(4).
> >
> >All information was taken from Linux's thinkpad_acpi.c:
> >http://lxr.free-electrons.com/source/drivers/platform/x86/thinkpad_acpi.c
> >(look at "2f" register).
> >
> >I also fixed a few style nits here and there.
> >
> 
> That's a nice approach you are taking here. Switching to disengaged
> only when cpu gets too hot and letting firmware handle fan
> autoregulation otherwise. When I find the time I, maybe I will
> finish my patch to allow fan regulation from userspace, but then
> certeinly keep your approach as failsafe.

User space will not be allowed to play.  I don't have a stinkpad so I
can't test this but I do encourage people to play with this diff and
report to the list.

> 
> 
> Christopher



Re: Fan mode management in acpithinkpad(4)

2011-05-12 Thread Christopher Zimmermann

On 05/12/11 14:37, Vadim Zhukov wrote:

Hello all.

Here is a patch that allows for me to work on other things. :) Basically,
it makes OS choose fan mode instead of firmware. Main feature here is
enabling of "disengadged" mode when temperature goes critical, picking
80C as a "red line". Now I can fully load CPU on my X201i -
say, "make -j 4" - and it still works instead of being powering off by
acpitz(4).

All information was taken from Linux's thinkpad_acpi.c:
http://lxr.free-electrons.com/source/drivers/platform/x86/thinkpad_acpi.c
(look at "2f" register).

I also fixed a few style nits here and there.



That's a nice approach you are taking here. Switching to disengaged only 
when cpu gets too hot and letting firmware handle fan autoregulation 
otherwise. When I find the time I, maybe I will finish my patch to allow 
fan regulation from userspace, but then certeinly keep your approach as 
failsafe.



Christopher



Fan mode management in acpithinkpad(4)

2011-05-12 Thread Vadim Zhukov
Hello all.

Here is a patch that allows for me to work on other things. :) Basically,
it makes OS choose fan mode instead of firmware. Main feature here is
enabling of "disengadged" mode when temperature goes critical, picking
80C as a "red line". Now I can fully load CPU on my X201i -
say, "make -j 4" - and it still works instead of being powering off by
acpitz(4).

All information was taken from Linux's thinkpad_acpi.c:
http://lxr.free-electrons.com/source/drivers/platform/x86/thinkpad_acpi.c
(look at "2f" register).

I also fixed a few style nits here and there.

-- 
  Best wishes,
Vadim Zhukov

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?


Index: acpithinkpad.c
===
RCS file: /cvs/src/sys/dev/acpi/acpithinkpad.c,v
retrieving revision 1.26
diff -u -p -r1.26 acpithinkpad.c
--- acpithinkpad.c  27 Apr 2011 20:55:42 -  1.26
+++ acpithinkpad.c  12 May 2011 12:09:49 -
@@ -71,11 +71,21 @@
 #defineTHINKPAD_POWER_CHANGED  0x6030
 #defineTHINKPAD_SWITCH_WIRELESS0x7000
 
-#define THINKPAD_NSENSORS 9
-#define THINKPAD_NTEMPSENSORS 8
+#define THINKPAD_NSENSORS  10
+#define THINKPAD_NTEMPSENSORS   8
+
+#define THINKPAD_SENSOR_FANRPM (THINKPAD_NTEMPSENSORS + 0)
+#define THINKPAD_SENSOR_FANMODE(THINKPAD_NTEMPSENSORS + 1)
 
 #define THINKPAD_ECOFFSET_FANLO0x84
 #define THINKPAD_ECOFFSET_FANHI0x85
+#define THINKPAD_ECOFFSET_FANMODE  0x2f
+
+#define THINKPAD_FANMODE_MODEMASK  0x3f
+#define THINKPAD_FANMODE_MIN   0x00
+#define THINKPAD_FANMODE_MAX   0x07
+#define THINKPAD_FANMODE_AUTO  0x80
+#define THINKPAD_FANMODE_DISENGADGED   0x40
 
 struct acpithinkpad_softc {
struct devicesc_dev;
@@ -103,8 +113,9 @@ int thinkpad_volume_mute(struct acpithin
 intthinkpad_brightness_up(struct acpithinkpad_softc *);
 intthinkpad_brightness_down(struct acpithinkpad_softc *);
 
-voidthinkpad_sensor_attach(struct acpithinkpad_softc *sc);
+voidthinkpad_sensor_attach(struct acpithinkpad_softc *);
 voidthinkpad_sensor_refresh(void *);
+u_int8_t   thinkpad_choose_fan_mode(int64_t, char const **);
 
 struct cfattach acpithinkpad_ca = {
sizeof(struct acpithinkpad_softc), thinkpad_match, thinkpad_attach
@@ -156,8 +167,12 @@ thinkpad_sensor_attach(struct acpithinkp
}
 
/* Add fan probe */
-   sc->sc_sens[i].type = SENSOR_FANRPM;
-   sensor_attach(&sc->sc_sensdev, &sc->sc_sens[i]);
+   sc->sc_sens[THINKPAD_SENSOR_FANRPM].type = SENSOR_FANRPM;
+   sensor_attach(&sc->sc_sensdev, &sc->sc_sens[THINKPAD_SENSOR_FANRPM]);
+
+   /* Add fan mode indicator */
+   sc->sc_sens[THINKPAD_SENSOR_FANMODE].type = SENSOR_INTEGER;
+   sensor_attach(&sc->sc_sensdev, &sc->sc_sens[THINKPAD_SENSOR_FANMODE]);
 
sensordev_install(&sc->sc_sensdev);
 }
@@ -166,9 +181,10 @@ void
 thinkpad_sensor_refresh(void *arg)
 {
struct acpithinkpad_softc *sc = arg;
-   u_int8_t lo, hi, i;
-   int64_t tmp;
+   u_int8_t lo, hi, i, mode;
+   int64_t tmp, maxtmp = -127;
char sname[5];
+   const char *desc;
 
/* Refresh sensor readings */
for (i=0; isc_sens[i].value = (tmp * 100) + 27315;
if (tmp > 127 || tmp < -127)
sc->sc_sens[i].flags = SENSOR_FINVALID;
+   else if (tmp > maxtmp &&
+  (sc->sc_sens[i].flags & SENSOR_FINVALID) != SENSOR_FINVALID)
+   maxtmp = tmp;
}
 
/* Read fan RPM */
acpiec_read(sc->sc_ec, THINKPAD_ECOFFSET_FANLO, 1, &lo);
acpiec_read(sc->sc_ec, THINKPAD_ECOFFSET_FANHI, 1, &hi);
-   sc->sc_sens[i].value = ((hi << 8L) + lo);
+   sc->sc_sens[THINKPAD_SENSOR_FANRPM].value = ((hi << 8L) + lo);
+
+   /* Update fan mode based on max temperature seen */
+   mode = thinkpad_choose_fan_mode(maxtmp, &desc);
+   acpiec_write(sc->sc_ec, THINKPAD_ECOFFSET_FANMODE, 1, &mode);
+   sc->sc_sens[THINKPAD_SENSOR_FANMODE].value = mode;
+   snprintf(sc->sc_sens[THINKPAD_SENSOR_FANMODE].desc,
+   sizeof(sc->sc_sens[THINKPAD_SENSOR_FANMODE]),
+   "fan mode: %s", desc);
+}
+
+/* Almost randomly choosed values */
+#define THINKPAD_TEMP_NORMAL_MIN   25
+#define THINKPAD_TEMP_NORMAL_MAX   45
+#define THINKPAD_TEMP_OUCH 80
+
+u_int8_t
+thinkpad_choose_fan_mode(int64_t temp, char const **desc) {
+   u_int8_t mode;
+
+   if (temp > THINKPAD_TEMP_OUCH) {
+   /* It's better if cooler will be destroyed than CPU */
+   mode = THINKPAD_FANMODE_DISENGADGED;
+   *desc = "disengadged";
+   } else if (temp > THINKPAD_TEMP_NORMAL_MAX) {
+   mode = THINKPAD_FANMODE_MAX;
+   *desc = "m

Silvio Rodriguez / Pablo Milanés - Discografía y Pendrive de Regalo

2011-05-12 Thread Discos MP3 - Solo de Oferta
SilvioRodriguez  Dias   
  Y Flores p   Te  Doy una Cancion! h  
Cuando  Digo Futuro  s  al  
   Final De Este Viaje  Mujeres c  Rabo 
De Nube V V   Silvio  Rodriguez Y
Pablo Milanes En Argentina  Unicornio s s   Tríptico 
I a o  Tríptico  II a
o  Tríptico  III a o  Causas 
Y Azares s s  Arboles s s   Oh  
   Melancolia os s   Silvio 
Rodriguez  En Chile o   Canciones  Urgentes
V  Autobiografico  s  Silvio a   Mano  a
Mano o  Rodriguez  s  Domiguez  Descartes   Mariposas  Expedicion   Cita
 Con Angeles  Erase 
Que Se Era  PabloMilanés Filin   
  2 y 3 o  a   Blanco   
  y Negro aAntologia  vol.1 a   
aIdentidad a   Plegaria o  Pablo  Milanes
Canta a Nicolas  La  Vida No Vale Nada o  
Canto  De La Abuela  oo ooFilin a   
aComo  un Campo de Maiz  Aniversario o 
Despertar a   Buenos  Dias America oEl
Guerrero  oo  ooComienzo y final de una Verde Mañana   Acto de
Fè a a   a Canta a Jose Marti a  o  Origenes a  l   Proposiciones o 
o   Años  II k o o Años
III o oa Ao Vivo No Brasili a ONo me Pidas o o   Canta  
   a La resistencia Popular Chilena;   Querido  
   Pablo o   Trovadores oFilin 4 Y Filin 5 oCanta
Boleros En Tropicana a   Evolucion o  Igual 
Que Ayer  Si  Yo Volviera a Nacer  Vengo
 Naciendo   Live
 From New York City  Pablo  Querido  Regalo 
Mas  Alla De Todo  Lineas   
  Paralelas



Re: adduser(8) - adduser.conf quotations

2011-05-12 Thread Alexander Hall
On 05/12/11 10:21, Mark Lumsden wrote:
> On Thu, May 12, 2011 at 09:06:44AM +0200, Alexander Hall wrote:
>> On 05/12/11 07:30, Mark Lumsden wrote:
>>> Hopefully one day adduser(8), will have "use warnings;" added to it.
>>
>> Looking at it, I'd rather see it shot in the head and buried.
>>
>> Well, maybe warnings and strict will in time force someone* to tidy it up.
>>
>> Also, I bet just about every 'local' in there should rather be 'my'.
>>
> 
> I'm pretty sure when I first started using OpenBSD (3.4), I added my first
> user via adduser. Since then, when the need arises I just fire up adduser
> and it does what it says on the tin. Apart from being caught out by that 
> damned "send message to user" and answering "yes" a dozen times, I've 
> never had a problem.

Well, I use it too, and find it userful, for non-automated user creation
(staff etc). It was just the code that looked like a minor mess. :-)

> There are mixed emotions about adduser, and when you look at the code you
> understand why. I think I will try and clean it up a bit though. If there
> are no objections.

If the userfulness remains and the code looks fine we all win. :-)

/Alexander

> 
> And thanks for the ok.
> 
> -mark



Re: adduser(8) - adduser.conf quotations

2011-05-12 Thread Mark Lumsden
On Thu, May 12, 2011 at 09:06:44AM +0200, Alexander Hall wrote:
> On 05/12/11 07:30, Mark Lumsden wrote:
> > Hopefully one day adduser(8), will have "use warnings;" added to it.
> 
> Looking at it, I'd rather see it shot in the head and buried.
> 
> Well, maybe warnings and strict will in time force someone* to tidy it up.
> 
> Also, I bet just about every 'local' in there should rather be 'my'.
> 

I'm pretty sure when I first started using OpenBSD (3.4), I added my first
user via adduser. Since then, when the need arises I just fire up adduser
and it does what it says on the tin. Apart from being caught out by that 
damned "send message to user" and answering "yes" a dozen times, I've 
never had a problem.

There are mixed emotions about adduser, and when you look at the code you
understand why. I think I will try and clean it up a bit though. If there
are no objections.

And thanks for the ok.

-mark