From owner-freebsd-mobile Mon Jun 19 4:30:55 2000 Delivered-To: freebsd-mobile@freebsd.org Received: from lavender.sanpei.org (ppp169.dialup.st.keio.ac.jp [131.113.27.169]) by hub.freebsd.org (Postfix) with ESMTP id 36CB537BCA1 for ; Mon, 19 Jun 2000 04:30:49 -0700 (PDT) (envelope-from sanpei@sanpei.org) Received: (from sanpei@localhost) by lavender.sanpei.org (8.9.3/3.7W) id UAA13391; Mon, 19 Jun 2000 20:30:47 +0900 (JST) Message-Id: <200006191130.UAA13391@lavender.sanpei.org> Subject: resource_usage API {Re: Call for review: restart pccardd by SIGHUP} To: freebsd-mobile@FreeBSD.ORG Cc: Warner Losh In-Reply-To: Your message of "Thu, 06 Apr 2000 12:37:08 -0600" References: <200004061837.MAA92697@harmony.village.org> X-Mailer: Mew version 1.70 on Emacs 19.34.1 / Mule 2.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 19 Jun 2000 20:30:46 +0900 From: MIHIRA Sanpei Yoshiro Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Does someone write any code about below thing, resource_usage API. PAO3 has sysctl_machdep_checkio in sys/i386/isa/isa.c. And /usr/sbin/pccardd uses that io port usage information for PC-Card (pccardd automatically assign free io port to PC-Card). In latest 4-stable/5-current, we need set free io space in /etc/pccard.conf with some NOTE-PC. # PAO3 also has sysctl_machdep_checkmem. Now, I read 5-current kernel source code....(But I don't have enough skill about newbus..) http://docs.freebsd.org/cgi/getmsg.cgi?fetch=201239+0+archive/2000/freebsd-mobile/20000409.freebsd-mobile >: 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 :-). --- MIHIRA Sanpei Yoshiro Yokohama, Japan. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-mobile" in the body of the message