@@ -200,21 +200,6 @@ static void inmem_write(char c)
memcons.out_pos = cpu_to_be32(opos);
}
-static size_t inmem_read(char *buf, size_t req)
-{
- size_t read = 0;
- char *ibuf = (char *)be64_to_cpu(memcons.ibuf_phys);
-
- while (req && be32_to_cpu(memcons.in_prod) != be32_to_cpu(memcons.in_cons)) {
- *(buf++) = ibuf[be32_to_cpu(memcons.in_cons)];
- lwsync();
- memcons.in_cons = cpu_to_be32((be32_to_cpu(memcons.in_cons) + 1) % INMEM_CON_IN_LEN);
- req--;
- read++;
- }
- return read;
-}
-
static void write_char(char c)
{
inmem_write(c);
@@ -252,6 +237,21 @@ ssize_t write(int fd __unused, const void *buf, size_t count)
return console_write(true, buf, count);
}
+static size_t inmem_read(char *buf, size_t req)
+{
+ size_t read = 0;
+ char *ibuf = (char *)be64_to_cpu(memcons.ibuf_phys);
+
+ while (req && be32_to_cpu(memcons.in_prod) != be32_to_cpu(memcons.in_cons)) {
+ *(buf++) = ibuf[be32_to_cpu(memcons.in_cons)];
+ lwsync();
+ memcons.in_cons = cpu_to_be32((be32_to_cpu(memcons.in_cons) + 1) % INMEM_CON_IN_LEN);
+ req--;
+ read++;
+ }
+ return read;
+}
+
ssize_t read(int fd __unused, void *buf, size_t req_count)
{
bool need_unlock = lock_recursive(&con_lock);
This is just to clean up the diffs in the following patches. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- core/console.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)