Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / sam / system / blaze / include / ui_cmd_struct.h
/*
* ========== Copyright Header Begin ==========================================
*
* OpenSPARC T2 Processor File: ui_cmd_struct.h
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
*
* The above named program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License version 2 as published by the Free Software Foundation.
*
* The above named program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this work; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
* ========== Copyright Header End ============================================
*/
/*
* Copyright (C) 1996, Sun Microsystems, Inc.
*/
/*
* ui_cmd_struct.h - Definitions for command lists and command entries.
*/
#ident "@(#)1.11 07/09/26 SMI ui_cmd_struct.h"
#ifndef _UI_CMD_STRUCT_H_
#define _UI_CMD_STRUCT_H_
#include <thread.h>
#include "blaze-data.h"
#include "sim_cmd_struct.h"
/* Create a type for pointers to layer command functions. */
typedef int (*ui_cmdfn_t)(
char* linep,
SimCmd* curr_event_msg
);
/* For layer commands. */
typedef struct ui_cmd_entry {
const char* cmd; /* not used when on a LIST */
const char* short_helpstr; /* string that explains syntax */
const char* long_helpstr; /* string that explains command */
ui_cmdfn_t func;
} ui_cmd_entry;
typedef struct UI_alias {
char* name;
char* value;
struct UI_alias* next;
} UI_alias_t;
//////////////////////////////////////////////
typedef struct ui_cmd_t
{
const char* name;
const char* help;
#define FUI_STRING 0x1
#define FUI_INVALID 0x2
#define FUI_SILENT 0x4
#define FUI_ALIAS 0x8
uint32_t flags;
ui_cmd_exe_handler cmd_exe_func;
ui_cmd_help_handler cmd_help_func;
struct ui_cmd_t *next;
int32_t alias_argc;
const char** alias_argv;
} Ui_cmd;
//////////////////////////////////////////////
typedef struct ui_blcmd {
char *cmd_str;
int cmd_len;
int fd;
struct ui_blcmd *next;
} Ui_blcmd;
typedef List1Node<Ui_blcmd> Ui_blcmdNode;
//////////////////////////////////////////////
typedef struct ui_misc_t {
mutex_t file_lock;
cond_t file_cond;
cond_t proceed_cond;
mutex_t proceed_lock;
cond_t side_cmd_cond; // These 2 primitives drive the "independent" UI
mutex_t side_cmd_lock; // cycle and source of UI commands
bool_t volatile file_go;
bool_t volatile side_go;
bool_t volatile side_done;
char *rcfile;
FILE *fp;
int redirect_fd;
bool_t volatile file_first_time;
struct ui_blcmd *blcmd;
Ui_blcmdNode *pnode;
Ui_blcmdNode *free_list;
struct ui_blcmd *stop_list;
mutex_t stop_lock;
mutex_t free_lock;
bool_t volatile ultimate_stop;
} Ui_misc;
#endif // UI_CMD_STRUCT_H_