From owner-freebsd-mobile Thu Apr 6 11:38: 5 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id ACE1037BAF5 for ; Thu, 6 Apr 2000 11:37:59 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id MAA02186; Thu, 6 Apr 2000 12:37:56 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id MAA92697; Thu, 6 Apr 2000 12:37:08 -0600 (MDT) Message-Id: <200004061837.MAA92697@harmony.village.org> To: Mitsuru IWASAKI Subject: Re: Call for review: restart pccardd by SIGHUP Cc: nate@yogotech.com, freebsd-mobile@FreeBSD.ORG In-reply-to: Your message of "Fri, 07 Apr 2000 00:49:19 +0900." <200004061549.AAA14952@tasogare.imasy.or.jp> References: <200004061549.AAA14952@tasogare.imasy.or.jp> <200004061518.JAA91480@harmony.village.org> Date: Thu, 06 Apr 2000 12:37:08 -0600 From: Warner Losh Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In message <200004061549.AAA14952@tasogare.imasy.or.jp> Mitsuru IWASAKI writes: : > go sysctl. I can give you either a list of all resources in use of a : > given type in a given range, or I can act as an oracle and say "yes : > this range you want to use is already in use" or "no, that's a good : > range." I suspect that the latter would be easier than the former and : > just as useful. : : I think the former would be easier because, user specify available : range roughly, and pccardd will correct it eliminating all of : resources in use from resource pool, "Please tell me all of used : addres range from 0x240 to 0x3ff. My master said that this range is : all available but I don't think so... Oh, 0x300-0x31f is already in : use, OK, I'll desable this range for pccard, Thanks!". OK. This won't take into account device drivers that are loaded after pccardd gets into information, but will likely be enough to do the right thing. Hmmm, thinking in API terms... struct resource_usage { long base; // Base of resource to query long length; // Length of resource int type; // Type of resource u_int8_t *map; // Map of resources in use. } You'd pass the base (0x240 in your example), the length (0x1bf) and the type SYS_RES_IOPORT if that's visible to userland. map would point to an area that is at least 0x1bf bits long (or 56 bytes). Bits in this range would be set when that resource is in use. You could also get IRQs this way, which is bar far the most useful thing to do. Hmmm, come to think of it, you could use this just before allocating resources to the card too if you wanted to. It would be the most flexible way to deal :-). BTW, on the topic of IRQs, I have two questions. How would you feel about making the default behavior of the pcic device to be polling rather than using an interrupt. This is a simple change to the config file. It should help on installations. Second, I'd like make the default for the pcic to *NOT* share interrupts. You'd have to set a flag in the device to enable it. This will also help people get things setup correctly. I know that the default polling is dangarous because it increases the window of system hangs, but for system installs, this won't matter because one generally doesn't pull the plug and expect things to work :-) Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message