Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / system / blaze / include / ui_cmd_struct.h
CommitLineData
920dae64
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: ui_cmd_struct.h
5* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
6* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
7*
8* The above named program is free software; you can redistribute it and/or
9* modify it under the terms of the GNU General Public
10* License version 2 as published by the Free Software Foundation.
11*
12* The above named program is distributed in the hope that it will be
13* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15* General Public License for more details.
16*
17* You should have received a copy of the GNU General Public
18* License along with this work; if not, write to the Free Software
19* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20*
21* ========== Copyright Header End ============================================
22*/
23/*
24 * Copyright (C) 1996, Sun Microsystems, Inc.
25 */
26
27/*
28 * ui_cmd_struct.h - Definitions for command lists and command entries.
29 */
30
31#ident "@(#)1.11 07/09/26 SMI ui_cmd_struct.h"
32
33#ifndef _UI_CMD_STRUCT_H_
34
35#define _UI_CMD_STRUCT_H_
36
37#include <thread.h>
38
39#include "blaze-data.h"
40#include "sim_cmd_struct.h"
41
42/* Create a type for pointers to layer command functions. */
43typedef int (*ui_cmdfn_t)(
44 char* linep,
45 SimCmd* curr_event_msg
46);
47
48/* For layer commands. */
49typedef struct ui_cmd_entry {
50 const char* cmd; /* not used when on a LIST */
51 const char* short_helpstr; /* string that explains syntax */
52 const char* long_helpstr; /* string that explains command */
53 ui_cmdfn_t func;
54
55} ui_cmd_entry;
56
57typedef struct UI_alias {
58 char* name;
59 char* value;
60 struct UI_alias* next;
61} UI_alias_t;
62
63//////////////////////////////////////////////
64
65typedef struct ui_cmd_t
66{
67 const char* name;
68 const char* help;
69
70#define FUI_STRING 0x1
71#define FUI_INVALID 0x2
72#define FUI_SILENT 0x4
73#define FUI_ALIAS 0x8
74
75 uint32_t flags;
76
77 ui_cmd_exe_handler cmd_exe_func;
78 ui_cmd_help_handler cmd_help_func;
79 struct ui_cmd_t *next;
80 int32_t alias_argc;
81 const char** alias_argv;
82
83} Ui_cmd;
84
85//////////////////////////////////////////////
86
87typedef struct ui_blcmd {
88
89 char *cmd_str;
90 int cmd_len;
91 int fd;
92 struct ui_blcmd *next;
93
94} Ui_blcmd;
95
96typedef List1Node<Ui_blcmd> Ui_blcmdNode;
97
98//////////////////////////////////////////////
99
100typedef struct ui_misc_t {
101
102 mutex_t file_lock;
103 cond_t file_cond;
104 cond_t proceed_cond;
105 mutex_t proceed_lock;
106 cond_t side_cmd_cond; // These 2 primitives drive the "independent" UI
107 mutex_t side_cmd_lock; // cycle and source of UI commands
108 bool_t volatile file_go;
109 bool_t volatile side_go;
110 bool_t volatile side_done;
111 char *rcfile;
112 FILE *fp;
113 int redirect_fd;
114
115 bool_t volatile file_first_time;
116
117 struct ui_blcmd *blcmd;
118 Ui_blcmdNode *pnode;
119 Ui_blcmdNode *free_list;
120
121 struct ui_blcmd *stop_list;
122
123 mutex_t stop_lock;
124 mutex_t free_lock;
125
126 bool_t volatile ultimate_stop;
127
128} Ui_misc;
129
130
131#endif // UI_CMD_STRUCT_H_
132
133
134
135
136
137