summaryrefslogtreecommitdiff
path: root/mcon/U/shm_for.U
blob: 9c99f23abfe9d2cc0f0a67d7f3c79fc90711be6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
?RCS: $Id: shm_for.U 1 2006-08-24 12:32:52Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS: 
?RCS: You may redistribute only under the terms of the Artistic Licence,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic Licence; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?RCS: $Log: shm_for.U,v $
?RCS: Revision 3.0.1.1  1994/10/29  16:28:37  ram
?RCS: patch36: call ./Cppsym explicitely instead of relying on PATH
?RCS:
?RCS: Revision 3.0  1993/08/18  12:09:46  ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
?MAKE:shm_for shm_att shm_lim: Cppsym Myread ipc uname
?MAKE:	-pick add $@ %<
?S:shm_for:
?S:	This variable tells us the type of machine we're expecting the
?S:	shared memory code to run on.  The value is available to C programs
?S:	in the C_SHM_FOR manifest.
?S:.
?S:shm_att:
?S:	This variable tells us where a shared memory segment should be
?S:	attached.  Good values are HIGH, LOW, and ZERO.
?S:.
?S:shm_lim:
?S:	This variable tells us if shared memory attached HIGH should
?S:	have an upper limit.
?S:.
?X:	----------------------------------------------------------
?X: It's a potential lose to define anything beginning with SHM...
?X: At least we can think that S_ stands for "String version of ..." -- HMS
?X:	----------------------------------------------------------
?C:S_SHM_FOR ~ %<:
?C:	This symbol identifies what we chose for the target system's
?C:	default shared memory configuration parameters.
?C:.
?C:S_SHM_ATT ~ %<:
?C:	This symbol holds the default "place" to attach shared memory.
?C:	Values are "HIGH", "ZERO", and "LOW".
?C:.
?C:S_SHM_LIM ~ %<:
?C:	This symbol holds the default upper bound address limit if shared
?C:	memory is attached HIGH.  If zero, there is no upper limit.
?C:.
?H:?%<:#ifdef SERVE_SHM
?H:?%<:#define S_SHM_FOR "$shm_for"
?H:?%<:#define S_SHM_ATT "$shm_att"
?H:?%<:#define S_SHM_LIM "$shm_lim"
?H:?%<:#endif
?H:.
?W:%<:S_SHM_FOR S_SHM_ATT S_SHM_LIM
: see how to attach shared memory
echo " "
echo "Deciding how to attach shared memory..." >&4

case "$ipc" in
shm)
	shm_for='Default case'
	shm_att='HIGH'
	shm_lim='0x0'
	if ./Cppsym tower32 tower32_600; then
		echo "NCR Towers are usually normal..."
		: echo "Oh, an NCR Tower."
		: This works for the 600
		shm_for='NCR Tower 32'
		shm_att='LOW'
	else
		case "$uname" in
		*/uname)
			case "`uname -m`" in
			ACS??68*)
				echo "Oh, an Altos 3068."
				shm_for='Altos 3068:'
				shm_lim='0x800000'
				;;
				esac
				;;
		*)
			echo "Looks normal to me..."
			;;
		esac
	fi

	dflt="$shm_for"
	rp='Description of shared memory configuration?'
	. ./myread
	shm_for="$ans"

	dflt="$shm_att"
	rp='Where should shared memory be attached?'
	. ./myread
	shm_att="$ans"

	case "$shm_att" in
	HIGH)
		dflt="$shm_lim"
		rp='What is the upper address limit for shared memory?'
		. ./myread
		shm_lim="$ans"
		;;
	*)
		shm_lim=''
		;;
	esac
	;;

*)
	echo "but you aren't using shared memory so I won't bother." >&4
	shm_for='NOT CONFIGURED'
	shm_att='NONE'
	shm_lim='-1'
	;;
esac