Re: kobj method signature checking

2008-03-28 Thread Andriy Gapon
on 27/03/2008 20:08 John Baldwin said the following:
 On Thursday 27 March 2008 12:45:38 pm Andriy Gapon wrote:
 on 01/03/2008 10:49 Andriy Gapon said the following:
 Here's one strange thing - in your patch you accidentally have
 parameters of device_identify switched, I initially inherited that bug
 too. I got no error/warning from compiler whatsoever. It wasn't until I
 saw that device_get_unit(parent) returned garbage that I my untrained
 eye noticed the mistake.
 As this thread died off I just want to make sure that the above issue is
 not lost.
 Maybe we should modify KOBJMETHOD(NAME, FUNC) macro to somehow check
 FUNC signature/type against the expected signature/type (which is
 available as NAME##_t)?
 
 It would be nice if we could do that, yes.
 
 Maybe something like the following (a bit ugly but I couldn't think of
 anything better and syntactically correct):
 { NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) }

 This is supposed to produce the following warning if FUNC and NAME##_t
 have different types:
 warning: comparison of distinct pointer types lacks a cast

 The message is also not very descriptive.
 
 A compile warning/error would be nice though.

Then the proposed code should be good enough.
That is:
#define KOBJMETHOD(NAME, FUNC) \
{ NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) }

BTW, the expression is an obvious NOP and I think that the compiler is
required to calculate constant initializer expressions at compile time,
so binary wise there should not be any incompatibilities too.

 P.S. strangely enough for me it seems that compiler treats the following
 two declarations differently:
 int f();
 and
 int f(void);
 The warning appears for the latter when comparing with e.g. int g(int),
 but does not appear for the former.
 
 This is normal for C. :(
 


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


Re: kobj method signature checking

2008-03-28 Thread Andriy Gapon
on 28/03/2008 16:37 Andriy Gapon said the following:
 on 27/03/2008 20:08 John Baldwin said the following:
 On Thursday 27 March 2008 12:45:38 pm Andriy Gapon wrote:
 on 01/03/2008 10:49 Andriy Gapon said the following:
 Here's one strange thing - in your patch you accidentally have
 parameters of device_identify switched, I initially inherited that bug
 too. I got no error/warning from compiler whatsoever. It wasn't until I
 saw that device_get_unit(parent) returned garbage that I my untrained
 eye noticed the mistake.
 As this thread died off I just want to make sure that the above issue is
 not lost.
 Maybe we should modify KOBJMETHOD(NAME, FUNC) macro to somehow check
 FUNC signature/type against the expected signature/type (which is
 available as NAME##_t)?
 It would be nice if we could do that, yes.

 Maybe something like the following (a bit ugly but I couldn't think of
 anything better and syntactically correct):
 { NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) }

 This is supposed to produce the following warning if FUNC and NAME##_t
 have different types:
 warning: comparison of distinct pointer types lacks a cast

 The message is also not very descriptive.
 A compile warning/error would be nice though.
 
 Then the proposed code should be good enough.
 That is:
 #define KOBJMETHOD(NAME, FUNC) \
 { NAME##_desc, (kobjop_t) (FUNC != (NAME##_t *)NULL ? FUNC : NULL) }
 
 BTW, the expression is an obvious NOP and I think that the compiler is
 required to calculate constant initializer expressions at compile time,
 so binary wise there should not be any incompatibilities too.

And the demonstration of the code in work – the following is from 6.3
RELEASE kernel build (plus the above change):
/usr/src/sys/dev/acpica/acpi_pcib_acpi.c:109: warning: comparison of
distinct pointer types lacks a cast
/usr/src/sys/dev/acpica/acpi_pcib_acpi.c:110: warning: comparison of
distinct pointer types lacks a cast
*** Error code 1

This is because pcib_read_config_t is defined to have several parameters
of u_int type and acpi_pcib_read_config has int for them.
Ditto for acpi_pcib_write_config and pcib_write_config_t.

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


HELP TO INSTALL FreeBSD 7.0 ON LAPTOP ACER 5102

2008-03-28 Thread Lt Col Prashant
Dear Sir,
 I was in need of some help with FreeBSD.I've installed FreeBSD
7.0 on my LAPTOP ACER 5102. However, I have the following issues
unresolved,
  At the terminal prompt I cannot use the su command.
  I am unable to activate the services from the
administration of gnome. I also am not able to use the DVD, since it is
not detected.
  I also want to configure the ADSL Modem which is through
the ethernet card. How do I get the Bison Web Cam working. I also am not
able to use the bluetooth.
 Can you help.

Thanks

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


Using any network interface whatsoever

2008-03-28 Thread Shannon Hendrix


From mailing list archives:

I wrote some add-on bits for /etc/rc.network in 4.x that compares  
the link addresses of attached network interfaces to a list of link  
addresses, then sets ifconfig_ifN* variables accordingly before  
rc.network does anything. It provides a means of wiring IP addresses  
to physical ports in a way that gets around the problem of probe  
order. If there's interest, I'll get to work on an rcNG version.


I would be interested in seeing this.

I build custom machines for a company I work for, and one of our  
requirements is the ability to number the network ports.


End users configure our software based on which port they use, so we  
need steady numbering of the ports, even when one customer machine  
might have different cards and number of cards.


We basically want the order to be:

0-N motherboard ports
N+1 - M card ports

It sounds like your script might work, given the apparent absence of  
geographic mapping in most current systems.


Thanks for any help.

--
Where some they sell their dreams for small desires.



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


Re: HELP TO INSTALL FreeBSD 7.0 ON LAPTOP ACER 5102

2008-03-28 Thread Hans Petter Selasky
On Friday 28 March 2008, Lt Col Prashant wrote:
 Dear Sir,
  I was in need of some help with FreeBSD.I've installed FreeBSD
 7.0 on my LAPTOP ACER 5102. However, I have the following issues
 unresolved,
   At the terminal prompt I cannot use the su command.
   I am unable to activate the services from the
 administration of gnome. I also am not able to use the DVD, since it is
 not detected.
   I also want to configure the ADSL Modem which is through
 the ethernet card. How do I get the Bison Web Cam working. I also am not
 able to use the bluetooth.
  Can you help.

 Thanks

http://www.freebsd.org/doc/en/books/handbook/network-bluetooth.html

For bluetooth you need to do:

kldload netgraph
kldload ng_btsocket
kldload ng_socket
kldload ng_bluetooth
kldload ng_hci
kldload ng_ubt
/etc/rc.d/bluetooth start ubt0
/etc/rc.d/bluetooth start ubt0

hccontrol -n ubt0hci inquiry

Also see /usr/ports/comms/obexapp

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


Re: HELP TO INSTALL FreeBSD 7.0 ON LAPTOP ACER 5102

2008-03-28 Thread Tobias Fendin

Lt Col Prashant wrote:

Dear Sir,
 I was in need of some help with FreeBSD.I've installed FreeBSD
7.0 on my LAPTOP ACER 5102. However, I have the following issues
unresolved,
  At the terminal prompt I cannot use the su command.
  I am unable to activate the services from the
administration of gnome. I also am not able to use the DVD, since it is
not detected.
  I also want to configure the ADSL Modem which is through
the ethernet card. How do I get the Bison Web Cam working. I also am not
able to use the bluetooth.
 Can you help.

Thanks

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

  

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