Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sdd.hp.com!hp-pcd!hpfcso!stroyan From: stroyan@hpfcso.HP.COM (Mike Stroyan) Newsgroups: comp.sys.hp Subject: Re: iomap functionality Message-ID: <7370223@hpfcso.HP.COM> Date: 2 Oct 90 19:34:27 GMT References: <789@cspi.UUCP> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 22 > I have a device on an HP-9000, 300 series, VME bus. It has memory >on it. Following the rules of the game, it has a seperate device in /dev >to get at the memory. This is a device with major number 10. So, I >open the device, and I do an ioctl(fd,IOMAPMAP,&addr); > If addr is 0, I get some memory which the iomap function inside the >driver has chosen to give me. > If addr is an address outside of my program, I get some memory >back. > However, if addr is the address of either a fortran common block or >a C global array, ie, inside my data space, I get a message about there not >being enough space to do the mapping. You misunderstand what IOMAPMAP is about. The ioctl doesn't need "memory". It needs addresses. The call sets up a mapping between virtual addresses in your process and physical addresses on the device. If you specify an addr of zero, then the system picks an address just above the top of the highest malloc'd area. If you specify a non-zero addr, then it must be the base of a range of virtual addresses that are not mapped to any physical addresses. The ioctl cannot cover up virtual addresses that have already been mapped to physical addresses. Mike Stroyan, mike_stroyan@fc.hp.com