Addressing Problem with /dev/vme32d32, Sun 4/110, SunOS 4.03c

bilmes at icsi.berkeley.edu bilmes at icsi.berkeley.edu
Wed Jul 18 08:38:06 AEST 1990


I am not able to generate vme bus addresses in the range
[0x08000000,0xF8000000). I am using the mmap() system call to map a
0x10000000 area of vme address space into a user processes' virtual
memory. As soon as bit 27 is on in the address offset to paddr (what
mmap() returned), the vme bus address that gets generated becomes
0xF8xxxxxx. Bit 31-28 seems to be ignored in the mapping when the address
is less than 0xF8000000 (i.e. the vme address generated has 0 in the
highest nibble).

Here is an example of the problem:

# peek 0x08000000 0x08123456 
// vme bus address that gets generated is 0xF8123454
# peek 0x80000000 0x81234567 
// vme bus address that gets generated is 0x01234564
# peek 0x90000000 0x91234567 
// vme bus address that gets generated is 0x01234564


peek.c
----------------------------------------------------------------------
#include <sys/file.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <errno.h>
extern char *sys_errlist[];
main(argc,argv)
	int argc;
	char *argv[];
{
    int fd_vme32d32;
    unsigned offset;
    unsigned addr;
    unsigned int *vme32d32;
    if (argc < 3) exit(0);
    sscanf(argv[1],"%i",&offset);	
    sscanf(argv[2],"%i",&addr);	
    if ((fd_vme32d32 = open("/dev/vme32d32",O_RDWR)) < 0) {
	fprintf(stderr,"Error opening /dev/vme32d32 : %s\n",sys_errlist[errno]);
	exit(1);
    }
    vme32d32 = (unsigned *)
	mmap((caddr_t)0,0x10000000,PROT_READ|PROT_WRITE,MAP_SHARED,
		fd_vme32d32,(off_t)offset);
    if ((caddr_t)vme32d32 == (caddr_t)-1) {
	fprintf(stderr,"mmap vme32d32 failed : %s\n",sys_errlist[errno]);
	exit(1);
    }
    printf("Value at 0x%X is 0x%X\n",addr,
		    vme32d32[(addr-offset)/4]);
}
----------------------------------------------------------------------

The same sort of thing happens when I use lseek and read from the seeked
location. Does anyone know what is wrong? (Is it a bug in the driver or
does the 4/110 only really have 256MB of addressable memory or is it
something else?). Thanks Much.

 Jeff Bilmes        arpa: bilmes at icsi.berkeley.edu
                    uucp: ...!ucbvax!icsi!bilmes



More information about the Comp.sys.sun mailing list