Index: share/man/man7/arch.7 =================================================================== --- share/man/man7/arch.7 +++ share/man/man7/arch.7 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2017 +.Dd May 4, 2017 .Dt ARCH 7 .Os .Sh NAME @@ -35,9 +35,72 @@ .Sh DESCRIPTION Differences between CPU architectures and platforms supported by .Fx . -.Pp +.Ss Introduction If not explicitly mentioned, sizes are in bytes. +.Pp +FreeBSD uses flat address space for program execution, where +pointers have the same binary representation as +.Vt long +variables, +.Vt uintptr_t +and +.Vt size_t +types are synonyms for +.Vt unsigned long . +.Pp +On some architectures (sparc64), kernel uses separate address space. +On other architectures, kernel address space is shared with user +address space, kernel is located at highest addresses. +.Pp +On each architecture, stack of the main thread starts near highest +user address and grows down. .Ss Type sizes +On each architecture, FreeBSD uses some variant of ELF (see +.Xr elf 5 ) +.Sy Application Binary Interface +(ABI) for the machine processor. +All supported ABIs can be divided into two groups: +.Bl -tag -width "Dv ILP32" +.It Dv ILP32 +.Vt int , +.Vt long , +.Vt void * +types machine representations all have 4-byte size. +.It Dv LP64 +.Vt int +type machine representation uses 4 bytes, +while +.Vt long +and +.Vt void * +are 8 bytes. +.El +Compilers define +.Dv _LP64 +symbol when compiling for an +.Dv LP64 +ABI. +.Pp +Some machines support more that one FreeBSD ABI, +typically these are 64-bit machines, where +.Dq native +.Dv LP64 +execution environment is accompanied by the +.Dq legacy +.Dv ILP32 +environment, which was historical 32-bit predecessor for 64-bit evolution. +Examples are: +.Bl -column -offset indent "powerpc64" "and powerpc" +.It Sy LP64 Ta ILP32 counterparts +.It Dv amd64 Ta Dv i386 +.It Dv powerpc64 Ta Dv powerpc +.It Dv mips64* Ta Dv mips* +.El +.Dv arm64 +currently does not support execution of +.Dv armv6 +binaries. +.Pp On all supported architectures: .Bl -column -offset -indent "long long" "Size" .It Sy Type Ta Sy Size