Re: finished? porting ZyDAS zb1211/zb1211b driver for FreeBSD

2007-12-19 Thread Weongyo Jeong
On Fri, Aug 17, 2007 at 09:52:26PM +0200, Nils Beyer wrote:
 Weongyo Jeong wrote:
 I just finished to port zyd(4) from NetBSD for FreeBSD and it works well 
 [...]
 A patch which is for CURRENT is available at [...]
 
 That's great to read. Is that driver also possible for 6.2-RELEASE and 
 6-STABLE?

This email is just for your information.  Recently, I tried to port
zyd(4) driver against RELENG_6 and the result, WIP version, come out
here:

http://weongyo.org/patches/zyd_RELENG_6-20071219.tar.gz

However, this version does not work properly in RELENG_6.  When you test
this, you will succeed in attaching the device and getting IP address using
dhclient(8) but you can see a lot of packet loss.

I think that this problem come from the lack of MFCs of ieee80211
framework or USB framework to RELENG_6 because this version works well
in CURRENT with small changes.

After testing more cases, I will let you know when problems on RELENG_6
are solved.

Regards,
Weongyo Jeong
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Stale mount on disconnected device: how to delete it?

2007-12-19 Thread Nikos Ntarmos
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, Dec 18, 2007 at 10:03:42PM +1030, Daniel O'Connor wrote:
 On Tue, 18 Dec 2007, Nikos Ntarmos wrote:
  Off the top of my head, what is wrong/hard with just logging a device
  failure, discarding all remaining cached operations, and unmounting
  the fs when a disk device goes missing? I understand that this is not
  a viable solution for critical filesystems, but I can see nothing
  wrong with this approach for removable devices and/or non-critical
  fs's.
 
 There was a long, long thread which discussed this earlier.
 
 It's easy to say what should be done, it's harder to submit patches
 that clean up the respective failure modes.

Point taken.

Do you have any pointers to that thread? I did a quick search in
hackers@ and current@ but failed to find anything relevant, other than
people reporting related crashes and don't do that, then-type answers.

\n\n
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.4 (FreeBSD)
Comment: Nikos Ntarmos [EMAIL PROTECTED]

iD8DBQFHaOZqm6J1ac+VFgoRAs/5AJ9sPZblF1T3MBkDP8K4ycRaFDf9KgCdH3oL
u+43/UxmFZnclQvcI4K+Xh8=
=E7ue
-END PGP SIGNATURE-
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


config(8) patch for review for src dir handling

2007-12-19 Thread Ed Maste
I've attached a patch I'd like to commit to config(8) for the way it
handles get_srcdir.  I'm asking for review since it partially reverts
some changes made in revision 1.42 of usr.sbin/config/main.c and I'd
like to make sure there are no issues there.

Right now config(8) calls realpath(../.., ... to find the src path
to write into the kernel Makefile.  I want to change this to use $PWD
with the last two path components removed, assuming it's the same dir
as ../.. .

I want to put this in because I often build from an amd(8)-mounted src
tree, and realpath produces a path using amd's special temporary mount
directory /.amd_mnt/... instead of the intended /host_mounts/... type of
path and it times out when accessed that way.  Using the logical cwd
means that the generated Makefile references /host_mounts/... and amd
knows the mount is still in use when building.

Comments?

-Ed

Index: main.c
===
RCS file: /usr/cvs/src/usr.sbin/config/main.c,v
retrieving revision 1.76
diff -p -u -r1.76 main.c
--- main.c  17 May 2007 04:53:52 -  1.76
+++ main.c  18 Dec 2007 21:02:32 -
@@ -249,9 +249,30 @@ main(int argc, char **argv)
 static void
 get_srcdir(void)
 {
+char *pwd;
 
if (realpath(../.., srcdir) == NULL)
errx(2, Unable to find root of source tree);
+
+   if ((pwd = getenv(PWD)) != NULL  *pwd == '/' 
+   (pwd = strdup(pwd))) {
+   struct stat lg, phy;
+   int i;
+   char *p;
+
+   /* remove last two path components */
+   for (i = 0; i  2; i++) {
+   if ((p = strrchr(pwd, '/')) == NULL) {
+   free(pwd);
+   return;
+   }
+   *p = '\0';
+   }
+   if (stat(pwd, lg) != -1  stat(srcdir, phy) != -1 
+lg.st_dev == phy.st_dev  lg.st_ino == phy.st_ino)
+   strlcpy(srcdir, pwd, MAXPATHLEN);
+   free(pwd);
+   }
 }
 
 static void
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


critical floating point incompatibility

2007-12-19 Thread Carl Shapiro
Developers,

There is a critical incompatibility between the floating point
environment of the 32-bit compatibility environment of AMD64 systems
and a genuine i386 system.

The default setting of the x87 floating point control word on the i386
port is 0x127F.  Among other things, this value sets the precision
control to double precision.  The default setting of the x87 floating
point control word on the AMD64 is 0x37F.  This value sets the
precision control to double-extended precision.  Since the AMD64 port
uses SSE2 instructions for single and double precision arithmetic
(thereby reserving the x87 for double-extended precision) this is a
reasonable setting.  Unfortunately, when a 32-bit binary is run under
compatibility on an AMD64 system, the floating point control word is
0x37F, not 0x127F. 32-bit binaries do not expect the floating point
environment to be in this state.  The net effect is that all but the
most trivial programs using x87 floating point arithmetic instructions
will produce different values when run on a native i386 system than
when run under compatibility on a 64-bit system!

It seems clear that the right thing to do is to set the floating point
environment to the i386 default for i386 binaries.  Is the current
behavior intended?

Carl
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Some diffs

2007-12-19 Thread M. Warner Losh
Consider the following diffs.  The first one does a tiny cleanup of
strfile's include style (no real reason other than it bugged me when I
added stdint.h).

The second one cleans up a minor problem where ${CFLAGS} isn't used
where it should be.

The next three cleanup the compilation by not assuming sys/types.h is
included or by also including stdint.h

And the last, rather long, patch converts the .y in config to a form
that more versions of yacc would grok.

Comments?

Warner

 //depot/projects/arm/src/games/fortune/strfile/strfile.c#1 - 
/Users/imp/p4/arm/src/games/fortune/strfile/strfile.c 
@@ -48,16 +48,17 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD: src/games/fortune/strfile/strfile.c,v 1.28 2005/02/17 
18:06:37 ru Exp $);
 
-# include  sys/param.h
-# include  sys/endian.h
-# include  stdio.h
-# include   stdlib.h
-# include  ctype.h
-# include   string.h
-# include   time.h
-# include   locale.h
-# include   unistd.h
-# include  strfile.h
+#include sys/param.h
+#include sys/endian.h
+#include stdint.h
+#include stdio.h
+#include stdlib.h
+#include ctype.h
+#include string.h
+#include time.h
+#include locale.h
+#include unistd.h
+#include strfile.h
 
 /*
  * This program takes a file composed of strings separated by
 //depot/projects/arm/src/lib/libmagic/Makefile#2 - 
/Users/imp/p4/arm/src/lib/libmagic/Makefile 
@@ -40,8 +40,7 @@
 CLEANFILES+=   mkmagic
 build-tools: mkmagic
 mkmagic: apprentice.c funcs.c magic.c print.c
-   ${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \
-   -I${.CURDIR} -I${CONTRDIR} -o ${.TARGET} ${.ALLSRC}
+   ${CC} -DHAVE_CONFIG_H ${CFLAGS} -o ${.TARGET} ${.ALLSRC}
 
 FILEVER!= awk '$$1 == \#define  $$2 == VERSION { print $$3; exit }' \
${.CURDIR}/config.h
 //depot/projects/arm/src/share/mk/bsd.prog.mk#4 - 
/Users/imp/p4/arm/src/share/mk/bsd.prog.mk 
@@ -110,17 +110,18 @@
 
 .if defined(PROG)
 _EXTRADEPEND:
-.if defined(LDFLAGS)  !empty(LDFLAGS:M-nostdlib)
+.if !defined(FOREIGN_BUILD)
 .if defined(DPADD)  !empty(DPADD)
echo ${PROG}: ${DPADD}  ${DEPENDFILE}
 .endif
-.else
+.if defined(LDFLAGS)  !empty(LDFLAGS:M-nostdlib)
echo ${PROG}: ${LIBC} ${DPADD}  ${DEPENDFILE}
 .if defined(PROG_CXX)
echo ${PROG}: ${LIBSTDCPLUSPLUS}  ${DEPENDFILE}
 .endif
 .endif
 .endif
+.endif
 
 .if !target(install)
 
 //depot/projects/arm/src/usr.bin/colldef/parse.y#1 - 
/Users/imp/p4/arm/src/usr.bin/colldef/parse.y 
@@ -30,6 +30,7 @@
 __FBSDID($FreeBSD: src/usr.bin/colldef/parse.y,v 1.34 2005/05/21 09:55:05 ru 
Exp $);
 
 #include arpa/inet.h
+#include sys/types.h
 #include err.h
 #include stdarg.h
 #include stdio.h
 //depot/projects/arm/src/usr.bin/colldef/scan.l#1 - 
/Users/imp/p4/arm/src/usr.bin/colldef/scan.l 
@@ -36,6 +36,7 @@
 #include unistd.h
 #include string.h
 #include sysexits.h
+#include sys/types.h
 #include common.h
 #include y.tab.h
 
 //depot/projects/arm/src/usr.bin/mklocale/ldef.h#1 - 
/Users/imp/p4/arm/src/usr.bin/mklocale/ldef.h 
@@ -38,6 +38,7 @@
  */
 
 #include sys/types.h
+#include stdint.h
 
 /*
  * This should look a LOT like a _RuneEntry
 //depot/projects/arm/src/usr.sbin/config/config.y#9 - 
/Users/imp/p4/arm/src/usr.sbin/config/config.y 
@@ -95,6 +95,12 @@
 void yyerror(const char *s);
 int yywrap(void);
 
+static void newdev(char *name);
+static void newfile(char *name);
+static void rmdev_schedule(struct device_head *dh, char *name);
+static void newopt(struct opt_head *list, char *name, char *value);
+static void rmopt_schedule(struct opt_head *list, char *name);
+
 static char *
 devopt(char *dev)
 {
@@ -122,14 +128,12 @@
|
Config_spec SEMICOLON
|
-   INCLUDE ID SEMICOLON
- = {
+   INCLUDE ID SEMICOLON {
  if (incignore == 0)
include($2, 0);
};
|
-   FILES ID SEMICOLON
- = { newfile($2); };
+   FILES ID SEMICOLON { newfile($2); };
|
SEMICOLON
|
@@ -137,16 +141,14 @@
;
 
 Config_spec:
-   ARCH Save_id
-   = {
+   ARCH Save_id {
if (machinename != NULL  !eq($2, machinename))
errx(1, %s:%d: only one machine directive is allowed,
yyfile, yyline);
machinename = $2;
machinearch = $2;
  } |
-   ARCH Save_id Save_id
-   = {
+   ARCH Save_id Save_id {
if (machinename != NULL 
!(eq($2, machinename)  eq($3, machinearch)))
errx(1, %s:%d: only one machine directive is allowed,
@@ -154,15 +156,13 @@
machinename = $2;
machinearch = $3;
  } |
-   CPU Save_id
- = {
+   CPU Save_id {
struct cputype *cp =
(struct cputype *)calloc(1, sizeof