2006-06-02 10:36:31 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2005 by Dominic Rath *
|
|
|
|
* Dominic.Rath@gmx.de *
|
|
|
|
* *
|
2009-07-17 19:54:25 +00:00
|
|
|
* Copyright (C) 2007,2008 Øyvind Harboe *
|
2008-10-07 18:04:14 +00:00
|
|
|
* oyvind.harboe@zylin.com *
|
|
|
|
* *
|
2006-06-02 10:36:31 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This 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 program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
***************************************************************************/
|
2012-02-05 12:03:04 +00:00
|
|
|
|
2006-06-02 10:36:31 +00:00
|
|
|
#ifndef REGISTER_H
|
|
|
|
#define REGISTER_H
|
|
|
|
|
2009-11-13 18:11:13 +00:00
|
|
|
struct target;
|
2006-06-02 10:36:31 +00:00
|
|
|
|
2012-02-05 12:03:04 +00:00
|
|
|
struct reg {
|
2010-12-29 21:07:21 +00:00
|
|
|
const char *name;
|
2009-05-06 23:25:27 +00:00
|
|
|
void *value;
|
2009-11-22 18:20:14 +00:00
|
|
|
bool dirty;
|
|
|
|
bool valid;
|
2009-06-18 07:09:35 +00:00
|
|
|
uint32_t size;
|
2006-06-02 10:36:31 +00:00
|
|
|
void *arch_info;
|
2009-11-17 17:06:45 +00:00
|
|
|
const struct reg_arch_type *type;
|
2009-11-13 17:55:49 +00:00
|
|
|
};
|
2006-06-02 10:36:31 +00:00
|
|
|
|
2012-02-05 12:03:04 +00:00
|
|
|
struct reg_cache {
|
2010-12-29 21:07:21 +00:00
|
|
|
const char *name;
|
2009-11-13 16:44:08 +00:00
|
|
|
struct reg_cache *next;
|
2009-11-13 17:55:49 +00:00
|
|
|
struct reg *reg_list;
|
2009-11-20 03:02:10 +00:00
|
|
|
unsigned num_regs;
|
2009-11-13 16:44:08 +00:00
|
|
|
};
|
2006-06-02 10:36:31 +00:00
|
|
|
|
2012-02-05 12:03:04 +00:00
|
|
|
struct reg_arch_type {
|
2009-11-13 17:55:49 +00:00
|
|
|
int (*get)(struct reg *reg);
|
|
|
|
int (*set)(struct reg *reg, uint8_t *buf);
|
2009-11-13 16:44:18 +00:00
|
|
|
};
|
2006-06-02 10:36:31 +00:00
|
|
|
|
2012-02-05 12:03:04 +00:00
|
|
|
struct reg *register_get_by_name(struct reg_cache *first,
|
2009-11-10 12:27:15 +00:00
|
|
|
const char *name, bool search_all);
|
2012-02-05 12:03:04 +00:00
|
|
|
struct reg_cache **register_get_last_cache_p(struct reg_cache **first);
|
2009-11-20 03:02:10 +00:00
|
|
|
void register_cache_invalidate(struct reg_cache *cache);
|
2009-11-09 12:22:23 +00:00
|
|
|
|
2009-11-13 17:55:49 +00:00
|
|
|
void register_init_dummy(struct reg *reg);
|
2006-06-02 10:36:31 +00:00
|
|
|
|
|
|
|
#endif /* REGISTER_H */
|