From 50b56394307f76afe5ed1fac885e6d792d432c58 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 15 Dec 2014 11:05:43 +0100 Subject: arm: semihosting: staticize internal functions 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 Cc: AKASHI Takahiro Cc: Mark Hambleton Cc: Tom Rini Acked-by: Steve Rae Signed-off-by: Linus Walleij --- arch/arm/lib/semihosting.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'arch/arm/lib') diff --git a/arch/arm/lib/semihosting.c b/arch/arm/lib/semihosting.c index cb5dc26..92bbabe 100644 --- a/arch/arm/lib/semihosting.c +++ b/arch/arm/lib/semihosting.c @@ -23,6 +23,11 @@ #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; -- cgit v1.1