Re: help:Makefile template for device drivers with multiple directories
On Friday 09 June 2006 04:16, [EMAIL PROTECTED] wrote: > My problem seems to be very special. My driver module is a single one, but > I want to build only one object for each directory (such as osd.o: osd/*.c; > engine.o: engine/*.c; cam.o:cam/*.c). And my driver module (such as > Shasta.ko) is constructed only by osd.o, engine.o and cam.o. I need to do > this because we want each component (engine, cam, and osd) more > independent. Otherwise, I have to consider the issues such as naming > conflicts and so on. Is it possible to do so under FreeBSD? > You mean object naming conflicts or symbol naming conflicts? If you have symbol naming conflicts, then you have to rename the functions/procedures. Else it won't be possible to link the module. If you have object naming conflicts, then I think you either have to rename the file names, or make a customized Makefile. It is the same in the FreeBSD kernel. All object files have different names. Maybe something similar to the following will do: SRCS+= osd.o engine.o osd.o: ${CC} -o osd.o ${.CURDIR}/osd/*".c" engine.o: ${CC} -o engine.o ${.CURDIR}/engine/*".c" --HPS ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
How to disable a src.conf on command-line
Hi list ! I wonder what's the trick to enable (resp. disable) a feature that has been switched with a WITH_FOO/WITHOUT_FOO knob in src.conf(5) or make.conf(5). I can't find one myself because bsd.own.mk only check if the knob is defined, it doesn't care of its value. Furthermore it is an error to define both WITH_FOO and WITHOUT_FOO. My thought on this is WITH_FOO/WITHOUT_FOO knob are to be used for software inclusion/exclusion in the base system, but not to enable/disable compilation flags, since you can't disable it without editing src.conf(5). (My concern is about activation of stack-smashing protection compiler options. I'd like the user to be able to use -DWITHOUT_SSP to compile something, even if he has WITH_SSP=YES in src.conf(5). Should I turn the name of this options into ENABLE_SSP and pull it out the bsd.own.mk magic ?) Thank you.i Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: working with PCI config registers (extensively)
on 09/06/2006 08:35 M. Warner Losh said the following: > In message: <[EMAIL PROTECTED]> > Andriy Gapon <[EMAIL PROTECTED]> writes: > : > : I am writing a driver for some PCI hardware that does not have any IO > : ports or IO memory (and thus does not have any useful BARs), but rather > : it is controlled and communicated with by writes and reads of certain > : vendor-specific PCI configuration registers. [snip] > The PCI bus will write to the standard TYPE 0 headers of a device on > the pci bus to manage it. All other configuration registers are the > responsibility of the driver. The driver can also access the > registers that the pci bus manages, but care must be taken. Sounds > like there'd be no conflict for you. Warner, thank you. There is another peculiarity in my driver - it actually works with PCI configuration space of a HW device that is "owned" by other driver/bus, hostb actually. That is, I discover my device using pci_find_bsf(). But I think that there should be no problem as the registers that my driver uses should be of no interest to hostb. P.S. here is more information and link to the source code of my driver: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=188288+0+current/freebsd-acpi -- 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: How to disable a src.conf on command-line
In message: <[EMAIL PROTECTED]> Jeremie Le Hen <[EMAIL PROTECTED]> writes: : (My concern is about activation of stack-smashing protection compiler : options. I'd like the user to be able to use -DWITHOUT_SSP to : compile something, even if he has WITH_SSP=YES in src.conf(5). : Should I turn the name of this options into ENABLE_SSP and pull it : out the bsd.own.mk magic ?) First, there's the trick: make -V MK_FOO if you are unsure of the results. For make options that default to enabled, turning them off in one place (command line or src.conf) will turn them off. Likewise for on. So if you make WITH_SSP off by default, then having WITH_SSP in the src.conf can't be overridden. If you have it on by default, having WITHOUT_SSP in the src.conf file can't be overriden. this appears to be an unintended flaw with the with/without stuff. I'm not sure the right way to compensate. Finally, please don't invent another way to configure the system. Many code reviewers will not like you much for doing that, since we've recently worked hard to make them all regular. If you need to do something the current scheme doesn't allow, we need to expand the current scheme somehow. Warner ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
in-flight timer(s) recalibration
In-flight timer(s) recalibration - is it a good idea ? How to do it ? This question comes from the following: in 6.1 we use LAPIC timer even on UP systems; in scenarios where FSB frequency can be changed on the fly (this is not hypothetical) that results in bad time-keeping as LAPIC timer frequency is derived from FSB frequency. I'd like to be able to do something like what lapic_setup_clock() does, but through a proper interface and probably at smaller cost (I mean 2 second DELAY). I think that my need is pretty much LAPIC-timer centered because TSC should not be used in my case anyway and i8254 is mutually exclusive with LAPIC (at present, I think) and it is not affected by FSB frequency (is it?). BTW, maybe I will talk utter nonsense now, but is it possible to self-tune timer interrupt frequency by checking time elapsed between interrupts using the best available (or currently selected) timecounter ? -- 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: How to disable a src.conf on command-line
M. Warner Losh wrote: So if you make WITH_SSP off by default, then having WITH_SSP in the src.conf can't be overridden. If you have it on by default, having WITHOUT_SSP in the src.conf file can't be overriden. this appears to be an unintended flaw with the with/without stuff. I'm not sure the right way to compensate. I can't speak for the "right" way, but if you specify the variable in src.conf/make.conf with ?= instead of =, you can override it on the command-line: # grep KERNCONF /etc/make.conf KERNCONF?=TTPWEB # make -V KERNCONF TTPWEB # env KERNCONF=SOMETHING_ELSE make -V KERNCONF SOMETHING_ELSE -- Darren Pilgrim ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to disable a src.conf on command-line
In message: <[EMAIL PROTECTED]> Darren Pilgrim <[EMAIL PROTECTED]> writes: : M. Warner Losh wrote: : > So if you make WITH_SSP off by default, then having WITH_SSP in the : > src.conf can't be overridden. If you have it on by default, having : > WITHOUT_SSP in the src.conf file can't be overriden. this appears to : > be an unintended flaw with the with/without stuff. I'm not sure the : > right way to compensate. : : I can't speak for the "right" way, but if you specify the variable in : src.conf/make.conf with ?= instead of =, you can override it on the : command-line: : : # grep KERNCONF /etc/make.conf : KERNCONF?=TTPWEB : # make -V KERNCONF : TTPWEB : # env KERNCONF=SOMETHING_ELSE make -V KERNCONF : SOMETHING_ELSE ?= doesn't mesh well with WITH/WITHOUT because then it will always be defined, thus defeating its purpose. Warner ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to disable a src.conf on command-line
M. Warner Losh wrote: In message: <[EMAIL PROTECTED]> Darren Pilgrim <[EMAIL PROTECTED]> writes: : M. Warner Losh wrote: : > So if you make WITH_SSP off by default, then having WITH_SSP in the : > src.conf can't be overridden. If you have it on by default, having : > WITHOUT_SSP in the src.conf file can't be overriden. this appears to : > be an unintended flaw with the with/without stuff. I'm not sure the : > right way to compensate. : : I can't speak for the "right" way, but if you specify the variable in : src.conf/make.conf with ?= instead of =, you can override it on the : command-line: : : # grep KERNCONF /etc/make.conf : KERNCONF?=TTPWEB : # make -V KERNCONF : TTPWEB : # env KERNCONF=SOMETHING_ELSE make -V KERNCONF : SOMETHING_ELSE ?= doesn't mesh well with WITH/WITHOUT because then it will always be defined, thus defeating its purpose. Use .ifndef to define WITH/WITHOUT iff its counterpart is undef: .ifndef WITHOUT_FOO WITH_FOO=def .endif -- Darren Pilgrim ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"