Skip to content

Commit

Permalink
[Review] core: kernel: Add semihosting functions
Browse files Browse the repository at this point in the history
Remove unnucessary cast.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
  • Loading branch information
gagachang committed Feb 28, 2024
1 parent 5ece32d commit 4e31cb8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/kernel/semihosting.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ int semihosting_open(const char *fname, int flags)
size_t semihosting_read(int fd, void *ptr, size_t len)
{
struct semihosting_param_t arg = {
.param0 = (uintptr_t)fd,
.param0 = fd,
.param1 = (uintptr_t)ptr,
.param2 = (uintptr_t)len
.param2 = len
};

return (size_t)__do_semihosting(SEMIHOSTING_SYS_READ, (uintptr_t)&arg);
return __do_semihosting(SEMIHOSTING_SYS_READ, (uintptr_t)&arg);
}

/**
Expand All @@ -145,12 +145,12 @@ size_t semihosting_read(int fd, void *ptr, size_t len)
size_t semihosting_write(int fd, const void *ptr, size_t len)
{
struct semihosting_param_t arg = {
.param0 = (uintptr_t)fd,
.param0 = fd,
.param1 = (uintptr_t)ptr,
.param2 = (uintptr_t)len
.param2 = len
};

return (size_t)__do_semihosting(SEMIHOSTING_SYS_WRITE, (uintptr_t)&arg);
return __do_semihosting(SEMIHOSTING_SYS_WRITE, (uintptr_t)&arg);
}

/**
Expand All @@ -162,7 +162,7 @@ size_t semihosting_write(int fd, const void *ptr, size_t len)
int semihosting_close(int fd)
{
struct semihosting_param_t arg = {
.param0 = (uintptr_t)fd,
.param0 = fd,
};

return (int)__do_semihosting(SEMIHOSTING_SYS_CLOSE, (uintptr_t)&arg);
Expand Down

0 comments on commit 4e31cb8

Please sign in to comment.