Skip to content

Commit

Permalink
auxdisplay: Fix handlers file
Browse files Browse the repository at this point in the history
Fixes usermode access issues with the auxdisplay driver.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
  • Loading branch information
nordicjm authored and cfriedt committed Aug 30, 2023
1 parent f0c10d0 commit 28ba836
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions drivers/auxdisplay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/drivers/auxdisplay.h)

zephyr_library()
zephyr_library_sources_ifdef(CONFIG_USERSPACE auxdisplay_handlers.c)
zephyr_library_sources_ifdef(CONFIG_AUXDISPLAY_HD44780 auxdisplay_hd44780.c)
zephyr_library_sources_ifdef(CONFIG_AUXDISPLAY_ITRON auxdisplay_itron.c)
zephyr_library_sources_ifdef(CONFIG_AUXDISPLAY_JHD1313 auxdisplay_jhd1313.c)
Expand Down
18 changes: 9 additions & 9 deletions drivers/auxdisplay/auxdisplay_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static inline int z_vrfy_auxdisplay_position_blinking_set_enabled(const struct d
#include <syscalls/auxdisplay_position_blinking_set_enabled_mrsh.c>

static inline int z_vrfy_auxdisplay_cursor_shift_set(const struct device *dev, uint8_t direction,
bool display_shift);
bool display_shift)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_cursor_shift_set(dev, direction, display_shift);
Expand Down Expand Up @@ -78,13 +78,13 @@ static inline int z_vrfy_auxdisplay_display_position_get(const struct device *de
}
#include <syscalls/auxdisplay_display_position_get_mrsh.c>

static inline int z_vrfy_auxdisplay_capabilities_get_api(const struct device *dev,
static inline int z_vrfy_auxdisplay_capabilities_get(const struct device *dev,
struct auxdisplay_capabilities *capabilities)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_capabilities_get_api(dev, capabilities);
return z_impl_auxdisplay_capabilities_get(dev, capabilities);
}
#include <syscalls/auxdisplay_capabilities_get_api_mrsh.c>
#include <syscalls/auxdisplay_capabilities_get_mrsh.c>

static inline int z_vrfy_auxdisplay_clear(const struct device *dev)
{
Expand All @@ -105,17 +105,17 @@ static inline int z_vrfy_auxdisplay_brightness_set(const struct device *dev,
uint8_t brightness)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_backlight_get(dev, backlight);
return z_impl_auxdisplay_brightness_set(dev, brightness);
}
#include <syscalls/auxdisplay_brightness_set_mrsh.c>

static inline int z_vrfy_auxdisplay_brightness_set(const struct device *dev,
uint8_t brightness)
static inline int z_vrfy_auxdisplay_backlight_get(const struct device *dev,
uint8_t *backlight)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_backlight_get(dev, backlight);
}
#include <syscalls/auxdisplay_brightness_set_mrsh.c>
#include <syscalls/auxdisplay_backlight_get_mrsh.c>

static inline int z_vrfy_auxdisplay_backlight_set(const struct device *dev,
uint8_t backlight)
Expand All @@ -125,7 +125,7 @@ static inline int z_vrfy_auxdisplay_backlight_set(const struct device *dev,
}
#include <syscalls/auxdisplay_backlight_set_mrsh.c>

static inline bool z_vrfy_auxdisplay_is_busy(const struct device *dev)
static inline int z_vrfy_auxdisplay_is_busy(const struct device *dev)
{
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
return z_impl_auxdisplay_is_busy(dev);
Expand Down
2 changes: 1 addition & 1 deletion include/zephyr/drivers/auxdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ typedef int (*auxdisplay_write_t)(const struct device *dev, const uint8_t *data,
typedef int (*auxdisplay_custom_command_t)(const struct device *dev,
struct auxdisplay_custom_data *command);

struct auxdisplay_driver_api {
__subsystem struct auxdisplay_driver_api {
auxdisplay_display_on_t display_on;
auxdisplay_display_off_t display_off;
auxdisplay_cursor_set_enabled_t cursor_set_enabled;
Expand Down

0 comments on commit 28ba836

Please sign in to comment.