summaryrefslogtreecommitdiff
path: root/src/flash/nor/imp.h
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-12-03 17:14:07 -0800
committerZachary T Welch <zw@superlucidity.net>2009-12-04 03:34:33 -0800
commitc65d94f7d0e0c511794ea1f42ddf01e66f97e236 (patch)
tree5e827fb66fb6b67ea505b9b34d614cc67d4956c2 /src/flash/nor/imp.h
parent3cb0b56005059314c8d09d2f8574042a4352dab4 (diff)
downloadopenocd+libswd-c65d94f7d0e0c511794ea1f42ddf01e66f97e236.tar.gz
openocd+libswd-c65d94f7d0e0c511794ea1f42ddf01e66f97e236.tar.bz2
openocd+libswd-c65d94f7d0e0c511794ea1f42ddf01e66f97e236.tar.xz
openocd+libswd-c65d94f7d0e0c511794ea1f42ddf01e66f97e236.zip
add flash/nor/core.[ch]
The newly moved flash TCL routines access the internals of the module too much. Fix the layering issues by adding new core NOR flash APIs: <flash/nor/core.h>: - flash_driver_find_by_name() - self-descriptive <flash/nor/imp.h>: - flash_bank_add() - encapsulates adding banks to bank list - flash_bank_list() - encapsulates retreiving bank list This allows the externs in flash/nor/imp.h to be removed, and these mechanisms may now be re-used by other flash module code.
Diffstat (limited to 'src/flash/nor/imp.h')
-rw-r--r--src/flash/nor/imp.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/flash/nor/imp.h b/src/flash/nor/imp.h
index 29d7f7eb..23ac476e 100644
--- a/src/flash/nor/imp.h
+++ b/src/flash/nor/imp.h
@@ -19,9 +19,18 @@
#ifndef FLASH_NOR_IMP_H
#define FLASH_NOR_IMP_H
-#include <flash/flash.h>
+// this is an internal header
+#include "core.h"
-extern struct flash_driver *flash_drivers[];
-extern struct flash_bank *flash_banks;
+/**
+ * Adds a new NOR bank to the global list of banks.
+ * @params bank The bank that should be added.
+ */
+void flash_bank_add(struct flash_bank *bank);
+
+/**
+ * @return The first bank in the global list.
+ */
+struct flash_bank *flash_bank_list(void);
#endif // FLASH_NOR_IMP_H