Subject: sizeof(struct vmspace) varies
To: None <tech-kern@NetBSD.ORG>
From: Gordon W. Ross <>
List: tech-kern
Date: 05/08/1997 17:42:58
Hello all,

I have been trying to make libkvm compile to the same binary on all
m68k ports (partly so we can share /usr on all m68k ports) and I've
run into a snag: sizeof(struct vmspace) varies per machine.

The problem is that kvm_proc.c uses "struct kinfo_proc" which
contains a "struct vmspace" which contains a "struct pmap" and
that last structure varies in size across (m68k) machines.

So, I'm looking for guidance on how to deal with this.  Some
possibilities I've thought of are:  (in no particular order)

* Contrive to make "struct pmap" the same size on all m68k
* Change "struct vmspace" so vm_pmap is a zero-length array
  of "struct pmap" things, with the actual storage allocation
  done with MD information about the size...
* Change "struct vmspace" to remove vm_pmap entirely
  (Some XXX marks in the code appear to indicate this
   may have been desired, but the change would affect
   almost every port, i.e. in locore.s ...)

Any suggestions?