Re: [PATCH] Fix USB panics

2004-09-09 Thread Peter Pentchev
On Wed, Sep 08, 2004 at 11:37:07AM -0600, M. Warner Losh wrote:
 Peter,
 
 thanks again for the excellent anaylsis of the problem.  I introduced
 this when I cleaned up the load a driver will now cause usb to attach
 a device case.  You are correct as far as I can tell and can test.
 Here's the patch that I've come up with.  Does it work for you?

Yes, this patch works just fine.  I assume you will commit it without
the printf and indentation chunks, though? :)

Thanks again!

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
because I didn't think of a good beginning of it.


pgpVspZeFNrWW.pgp
Description: PGP signature


Runtime loading

2004-09-09 Thread db
Hi all

In my C++ program I need to load some files/classes at runtime, so that users 
can add plugins without recompilling my program. What functions should I 
use? I'm using FreeBSD 5.3-beta2 btw.

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


Re: Runtime loading

2004-09-09 Thread Maxime Henrion
db wrote:
 Hi all
 
 In my C++ program I need to load some files/classes at runtime, so that users 
 can add plugins without recompilling my program. What functions should I 
 use? I'm using FreeBSD 5.3-beta2 btw.

I'm not sure about C++, though I guess you could use the same functions as
in C.  If that's true, then you should use the dlopen() family of functions.
They are quite portable, since you'll find the same functions under all the
*BSD, Linux and Solaris.  Be aware that with Linux and Solaris, those
functions are located in libdl, while they are found in libc on the *BSD
systems.

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


Re: Runtime loading

2004-09-09 Thread db
On Thursday 09 September 2004 16:36, you wrote:

  In my C++ program I need to load some files/classes at runtime, so that
  users can add plugins without recompilling my program. What functions
  should I use? I'm using FreeBSD 5.3-beta2 btw.

 I'm not sure about C++, though I guess you could use the same functions as
 in C.  If that's true, then you should use the dlopen() family of
 functions. They are quite portable, since you'll find the same functions
 under all the *BSD, Linux and Solaris.  Be aware that with Linux and
 Solaris, those functions are located in libdl, while they are found in libc
 on the *BSD systems.

Ok, thanks :-)

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


Re: Runtime loading

2004-09-09 Thread Robert Dormer
glib provides a facility for this, and should be even more platform portable


On Thu, 9 Sep 2004 16:42:34 +0200, db [EMAIL PROTECTED] wrote:
 On Thursday 09 September 2004 16:36, you wrote:
 
   In my C++ program I need to load some files/classes at runtime, so that
   users can add plugins without recompilling my program. What functions
   should I use? I'm using FreeBSD 5.3-beta2 btw.
 
  I'm not sure about C++, though I guess you could use the same functions as
  in C.  If that's true, then you should use the dlopen() family of
  functions. They are quite portable, since you'll find the same functions
  under all the *BSD, Linux and Solaris.  Be aware that with Linux and
  Solaris, those functions are located in libdl, while they are found in libc
  on the *BSD systems.
 
 Ok, thanks :-)
 
 br
 db
 
 
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]

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


Re: Runtime loading

2004-09-09 Thread db
On Thursday 09 September 2004 16:43, Robert Dormer wrote:
 glib provides a facility for this, and should be even more platform
 portable

Yes I know, but this is for security/lockdown, so I want it to compile/run 
using that is in FreeBSD's base system. I'll try to think about portability 
when writing the code, so that linux/solaris users can use lockdown with 
minor modifications.

It is the keywords read from the configuration file I want to load at runtime, 
so that users can write their own keywords and make it easier for me to 
extend lockdown.

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


Re: pthread_mutex_trylock and glib-2

2004-09-09 Thread Coleman Kane
Yeah, I had the same problem. Fixed it by not building with debug
code, but I noticed there was chatter about it.


On Wed, 8 Sep 2004 18:57:09 -0400, Brian Fundakowski Feldman
[EMAIL PROTECTED] wrote:
 
 
 On Tue, Sep 07, 2004 at 06:27:14PM -0700, Pascal Hofstee wrote:
  On Mon, 6 Sep 2004 15:12:08 -0700, Pascal Hofstee [EMAIL PROTECTED] wrote:
   After a few hours of digging through both the glib-2 as well as the
   beep-media-player sources i finally managed to figure out why
   beep-media-player apprently crashes on startup when using libpthread,
   but not when using libc_r.
  
   i filed a bugreport against this problem on bugzilla.gnome.org ... in
   the hope to get some feedback from glib-developers ...
  
   http://bugzilla.gnome.org/show_bug.cgi?id=152009
  
   The problem is with the actual return value of pthread_mutex_trylock
   returning EDEADLK instead of EBUSY.
  
   from what i have been able to glance from this previous discussion
   regarding this particular subject
   (http://lists.freebsd.org/pipermail/freebsd-threads/2004-January/001539.html)
  
   pthread_mutex_trylock should behave identical to pthread_mutex_lock
   except return immediately in case of a blocking mutex, which would
   suggest EDEADLK as a possible return value.
  
   This Seems to be the current implementation of both libpthread as well
   as libthr ... with libc_r being the sole exception.
  
   The pthread_mutex_trylock manpage however does not reflect this actual
   implementation and only mentions EBUSY and EINVAL.
  
   I was wondering assuming the implementation is actually correct if
   this could be rectified in the pthread_mutex_trylock manpage ... and
   if my assumption is wrong if the implementation could be changed to
   reflect the manpage.
  
   In the former case i will have to bug the glib-devs to change the
   implementation of their pthread_mutex_trylock wrapper ... to also
   check for EDEADLK.
 
  I am hereby including an updated
  /usr/ports/devel/glib20/files/patch-gthread_gthread-posix.c
 
  that includes the additional check for EDEADLK besides EBUSY in glib's
  g_mutex_trylock_posix_impl function.
 
  With this fix applied to my installation of glib beep-media-player now
  works as expected with libpthread, and this is very likely to resolve
  similar behaviour with other ports that try to use glib's threading
  functions.
 
  I CC-ed glib20 port-maintainer ([EMAIL PROTECTED]) in the hope this
  (or appropriate alternative) fix makes it in time for 5.3-RELEASE.
 
 FWIW, I had to fix a similar problem in mozilla/NSPR's codebase to make
 the build with debugging code turned on work.  Well, I guess it was really
 the same problem.
 
 --
 Brian Fundakowski Feldman   \'[ FreeBSD ]''\
[EMAIL PROTECTED]   \  The Power to Serve! \
  Opinions expressed are my own.   \,,\
 
 
 ___
 [EMAIL PROTECTED] mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
 To unsubscribe, send any mail to [EMAIL PROTECTED]

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


Re: pthread_mutex_trylock and glib-2

2004-09-09 Thread Pascal Hofstee
Ok ..  Got some bugzilla notifications ...and apparently this issue
has been targetted for glib-2.4.7 with keywords portability.
So i assume we'll most likely have to include my provided patch for
the glib20 port until 2.4.7 comes out and an appropriate fix will
probably have been included by then.

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


Re: [PATCH] Fix USB panics

2004-09-09 Thread M. Warner Losh
Hopefully the recently committed changes will fix this problem.
Thanks again for your testing, your useful analysis and preliminary
patches.

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


Fw: Linux /proc returns invalid flags

2004-09-09 Thread Steven Hartland
The following is the output on a P4 Xeon
cat /usr/compat/linux/proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model   : 16
stepping: 7
flags   : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 b19 b21 mmxext mmx fxsr xmm b26 b27 b28 
b29 3dnow
cpu MHz : 2545.58
bogomips: 2545.58

The flags seem totally messed up, theres no SSE but there iss 3dnow.
   Steve 



This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 

In the event of misdirection, illegible or incomplete transmission please telephone 
(023) 8024 3137
or return the E.mail to [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


header file related question

2004-09-09 Thread vxp
hi,

i realize it's most likely a stupid question, but try not to be too hard
on me please - i'm trying to learn :)

i'm experimenting with the kernel's source, and i'm not quite sure how to
find what all the header files are that i need, for the stuff i'd like to
do.. how do i track down what header files i need to #include in my stuff?

for instance, i'm trying to modify icmp_input() (found in
/sys/netinet/ip_icmp.c) and load the new function via a kernel module.

so, i copied all the #include's from /sys/netinet/ip_icmp.c and only have
the icmp_input() function (unmodified right now, from the form i found
it), the header files from the original ip_icmp, and a main() that
simply returns 0. doesn't want to compile, with errors about header files
such as:
---
In file included from icmp.c:37:
/usr/include/netinet/in_var.h:50: error: field `ia_ifa' has incomplete
type
In file included from /usr/include/netinet/in_var.h:238,
 from icmp.c:37:
/usr/include/netinet6/in6_var.h:103: error: field `ia_ifa' has incomplete
type
---
i realize that it's most likely because i didn't #include something else i
need..  but how come /sys/netinet/ip_icmp.c compiles, then?  because this
file is basically that, with all functions but icmp_input removed, and a
main() that does nothing..

so.. sorry for the long post.
but please tell me how do i find out what header files i need ? :)

thanks.

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