aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/nmipksize.x
blob: 8ccd8297f3f13661ddd507d3bec514e5d5e7a9f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<mach.h>

# NMIPKSIZE -- Determine the size in SPP chars of the array required to store
# nelems of type nmi_type in NMI packed form.  The nmi_type codes are defined
# in nmi.h; we assume here that the integer codes are the sizes of the NMI
# types in bits.

int procedure nmipksize (nelems, nmi_type)

int	nelems			#I number of NMI elements of type nmi_type
int	nmi_type		#I <nmi.h> type code (=8,16,32,-32,-64)

begin
	return ((nelems * abs(nmi_type) / NBITS_BYTE + SZB_CHAR-1) / SZB_CHAR)
end