1 # Copyright
(C
) 1992-2019, 2020 Free Software Foundation
, Inc.
3 # This file is part of DejaGnu.
5 # DejaGnu is free software
: you can redistribute it and
/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation
, either version
3 of the License
, or
8 #
(at your option
) any later version.
10 # DejaGnu is distributed in the hope that it will be useful
, but
11 # WITHOUT
ANY WARRANTY
; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License
for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with DejaGnu.
If not
, see
<http
://www.gnu.org
/licenses
/>.
18 # Searches in the appropriate place
(the board_info array
) for the specified
21 proc board_info
{ machine op
args } {
25 verbose
"board_info $machine $op $args" 3
27 if {[info exists target_info
($machine
,name)]} {
28 set machine $target_info
($machine
,name)
30 if { $op eq
"exists" } {
31 if { [llength $
args] == 0 } {
32 return [info exists board_info
($machine
,name)]
34 return [info exists board_info
($machine
,[lindex $
args 0])]
37 if { [llength $
args] == 0 } {
38 verbose
"getting $machine $op" 3
39 if {[info exists board_info
($machine
,$op
)]} {
40 return $board_info
($machine
,$op
)
48 proc target_info
{ op
args } {
49 return [eval
"board_info target \"$op\" $args"]
52 proc host_info
{ op
args } {
53 return [eval
"board_info host \"$op\" $args"]
56 #
Set ENTRY to VALUE
for the current board.
58 proc set_board_info
{ entry value
} {
59 global board_info board
60 if {![info exists board_info
($board
,$entry
)]} {
61 set board_info
($board
,$entry
) $value
66 # Append VALUE to ENTRY
for the current board.
68 proc add_board_info
{ entry value
} {
69 global board_info board
70 lappend board_info
($board
,$entry
) $value
73 # Fill in ENTRY with VALUE
for the current target.
75 proc set_currtarget_info
{ entry value
} {
78 set board
[target_info
name]
80 if {![info exists board_info
($board
,$entry
)]} {
81 set board_info
($board
,$entry
) $value
85 # Unset ENTRY
for the current board being defined.
87 proc unset_board_info
{ entry
} {
88 global board_info board
90 if {[info exists board_info
($board
,$entry
)]} {
91 unset board_info
($board
,$entry
)
95 # Unset ENTRY
for the current board being defined.
97 proc unset_currtarget_info
{ entry
} {
100 set board
[target_info
name]
102 if {[info exists board_info
($board
,$entry
)]} {
103 unset board_info
($board
,$entry
)