* 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 *
#endif
#include "register.h"
-
#include "log.h"
-#include "command.h"
-#include <string.h>
-#include <stdlib.h>
reg_arch_type_t *reg_arch_types = NULL;
-reg_t* register_get_by_name(reg_cache_t *first, char *name, int search_all)
+reg_t* register_get_by_name(reg_cache_t *first,
+ const char *name, bool search_all)
{
int i;
reg_cache_t *cache = 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;
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;
+}