X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Fregister.c;h=8bffe482f742642c614054c565eb6664f6e23228;hb=6d1d58a1fc3dfd60e9cac89460b5a6e438d11efa;hp=1a8f6ddd3a038ce49cfdd08ca13a85c46cc82065;hpb=7fd9ba22ba2faefc2b6cadeb7c26c23981458339;p=openocd.git diff --git a/src/target/register.c b/src/target/register.c index 1a8f6ddd3a..8bffe482f7 100644 --- a/src/target/register.c +++ b/src/target/register.c @@ -2,6 +2,9 @@ * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * * * + * Copyright (C) 2007,2008 Øyvind Harboe * + * oyvind.harboe@zylin.com * + * * * 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 * @@ -22,12 +25,8 @@ #endif #include "register.h" - #include "log.h" -#include "command.h" -#include -#include reg_arch_type_t *reg_arch_types = NULL; @@ -66,7 +65,7 @@ reg_cache_t** register_get_last_cache_p(reg_cache_t **first) return cache_p; } -int register_reg_arch_type(int (*get)(reg_t *reg), int (*set)(reg_t *reg, u8 *buf)) +int register_reg_arch_type(int (*get)(reg_t *reg), int (*set)(reg_t *reg, uint8_t *buf)) { reg_arch_type_t** arch_type_p = ®_arch_types; int id = 0; @@ -103,3 +102,25 @@ reg_arch_type_t* register_get_arch_type(int id) exit(-1); return NULL; } + +static int register_get_dummy_core_reg(reg_t *reg) +{ + return ERROR_OK; +} + +static int register_set_dummy_core_reg(reg_t *reg, uint8_t *buf) +{ + reg->dirty = 1; + reg->valid = 1; + + return ERROR_OK; +} + +void register_init_dummy(reg_t *reg) +{ + static int dummy_arch_type = -1; + if (dummy_arch_type == -1 ) + dummy_arch_type = register_reg_arch_type(register_get_dummy_core_reg, register_set_dummy_core_reg); + + reg->arch_type = dummy_arch_type; +}