]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: semihosting: staticize internal functions
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Dec 2014 10:05:43 +0000 (11:05 +0100)
committerTom Rini <trini@ti.com>
Mon, 29 Dec 2014 12:44:06 +0000 (07:44 -0500)
The semihosting code exposes internal file handle handling
functions to read(), open(), close() and get the length of
a certain file handle.

However the code using it is only interested in either
reading and entire named file into memory or getting the
file length of a file referred by name. No file handles
are used.

Thus make the file handle code internal to this file by
removing these functions from the semihosting header file
and staticize them.

This gives us some freedom to rearrange the semihosting
code without affecting the external interface.

Cc: Darwin Rambo <drambo@broadcom.com>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Mark Hambleton <mark.hambleton@arm.com>
Cc: Tom Rini <trini@ti.com>
Acked-by: Steve Rae <srae@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/include/asm/semihosting.h
arch/arm/lib/semihosting.c

index 74111dc359d1a6e06758c6ed08729c54ed402ac1..e59b44ed60685b555fe4f5afb181508315424704 100644 (file)
  * code for more information.
  */
 int smh_load(const char *fname, void *memp, int avail, int verbose);
-int smh_read(int fd, void *memp, int len);
-int smh_open(const char *fname, char *modestr);
-int smh_close(int fd);
-int smh_len_fd(int fd);
 int smh_len(const char *fname);
 
 #endif /* __SEMIHOSTING_H__ */
index cb5dc26ac3fa283ab58c27c2876cddedc94b0efc..92bbabe158fe7b11fe9a97949a16da44b3bdd072 100644 (file)
 #define MODE_READ      0x0
 #define MODE_READBIN   0x1
 
+static int smh_read(int fd, void *memp, int len);
+static int smh_open(const char *fname, char *modestr);
+static int smh_close(int fd);
+static int smh_len_fd(int fd);
+
 /*
  * Call the handler
  */
@@ -96,7 +101,7 @@ int smh_load(const char *fname, void *memp, int avail, int verbose)
 /*
  * Read 'len' bytes of file into 'memp'. Returns 0 on success, else failure
  */
-int smh_read(int fd, void *memp, int len)
+static int smh_read(int fd, void *memp, int len)
 {
        int ret;
        struct smh_read_s {
@@ -131,7 +136,7 @@ int smh_read(int fd, void *memp, int len)
  * Open a file on the host. Mode is "r" or "rb" currently. Returns a file
  * descriptor or -1 on error.
  */
-int smh_open(const char *fname, char *modestr)
+static int smh_open(const char *fname, char *modestr)
 {
        int ret, fd, mode;
        struct smh_open_s {
@@ -171,7 +176,7 @@ int smh_open(const char *fname, char *modestr)
 /*
  * Close the file using the file descriptor
  */
-int smh_close(int fd)
+static int smh_close(int fd)
 {
        int ret;
        long fdlong;
@@ -189,7 +194,7 @@ int smh_close(int fd)
 /*
  * Get the file length from the file descriptor
  */
-int smh_len_fd(int fd)
+static int smh_len_fd(int fd)
 {
        int ret;
        long fdlong;