hive2.tcl
1.7 KB
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
#
# Copyright (C) 1996-1998 by the Board of Trustees
# of Leland Stanford Junior University.
#
# This file is part of the SimOS distribution.
# See LICENSE file for terms of the license.
# hive2.tcl -- this code should be in hive.tcl but a bug
# in the alpha tcl compiler requires that it be in another file.
#
# Specifically, the alpha compiler translates names to bindings
# when it firsts reads the file but neglects to invalidate the bindings
# when the rename occurs. Therefore using 'annotation' after
# the rename in hive.tcl gets the wrong function.
if {$PARAM(HIVE.NumCells) > 1} {
proc loadImageHelper {namep start len} {
global kernelNames
# NOTE:
# Hive thinks the kernels are named u0, u1, etc. so we're
# translating here to what the user wishes the kernels to
# be named.
#
set hiveName [symbol read "kernel::(char*)$namep"]
regsub {[^0-9]} $hiveName {} hiveIndex
set kernName [lindex $kernelNames $hiveIndex]
if {$kernName == ""} {
console "error: bad kernel $hiveName in loadImageHelper\n"
exit
}
return [hive loadimage $kernName $start $len]
}
annotation set pc kernel::SimosLoadImage:LoadImageDoit {
# a0 - pointer to image name
# a1 - pointer to start address of range
# a2 - length of range (max. image size)
set v0 [loadImageHelper $a0 $a1 $a2]
}
annotation set pc kernel::SimosLaunchSlave:LaunchSlaveDoit {
# a0 - CPU number of first CPU in slave cell
# a1 - image entry address
# a2 - argv pointer
# a3 - environ pointer (or 0)
set v0 [hive launchslave $a0 $a1 $a2 $a3]
}
annotation set pc kernel::SimosResetCPUs:ResetCPUsDoit {
# a0 - CPU number of first CPU to reset
# a1 - last CPU to reset
set v0 [hive resetcpus $a0 $a1]
}
}