From 075c94f6e2fce8af7620bf86c8cadd9c3a8c1b09 Mon Sep 17 00:00:00 2001 From: Andy Ross Date: Tue, 13 Aug 2019 11:34:34 -0700 Subject: [PATCH] kernel: Port remaining syscalls to new API These calls are not accessible in CI test, nor do they get built on common platforms (in at least one case I found a typo which proved the code was truly unused). These changes are blind, so live in a separate commit. But the nature of the port is mechanical, all other syscalls in the system work fine, and any errors should be easily corrected. Signed-off-by: Andy Ross --- drivers/adc/adc_handlers.c | 13 +++++++++--- drivers/can/can_handlers.c | 22 +++++++++++++------ drivers/counter/counter_handlers.c | 17 ++++++++++++--- drivers/dma/dma_handlers.c | 6 ++++-- drivers/entropy/entropy_handlers.c | 5 ++++- drivers/flash/flash_handlers.c | 34 +++++++++++++++++++++++------- drivers/hwinfo/hwinfo_handlers.c | 4 ++-- drivers/i2s/i2s_handlers.c | 16 ++++++++++---- drivers/ipm/ipm_handlers.c | 15 ++++++++----- drivers/led/led_handlers.c | 14 ++++++++---- drivers/pwm/pwm_handlers.c | 8 +++++-- drivers/rtc/rtc_handlers.c | 17 ++++++++++----- drivers/sensor/sensor_handlers.c | 18 ++++++++++++---- drivers/spi/spi_handlers.c | 28 ++++++++++++------------ kernel/sched.c | 4 ++-- 15 files changed, 154 insertions(+), 67 deletions(-) diff --git a/drivers/adc/adc_handlers.c b/drivers/adc/adc_handlers.c index 864e2bb6cea..954f09e7f40 100644 --- a/drivers/adc/adc_handlers.c +++ b/drivers/adc/adc_handlers.c @@ -8,7 +8,8 @@ #include #include -Z_SYSCALL_HANDLER(adc_channel_setup, dev, user_channel_cfg) +static inline int z_vrfy_adc_channel_setup(struct device *dev, + const struct adc_channel_cfg *user_channel_cfg) { struct adc_channel_cfg channel_cfg; @@ -19,6 +20,7 @@ Z_SYSCALL_HANDLER(adc_channel_setup, dev, user_channel_cfg) return z_impl_adc_channel_setup((struct device *)dev, &channel_cfg); } +#include static bool copy_sequence(struct adc_sequence *dst, struct adc_sequence_options *options, @@ -45,8 +47,9 @@ static bool copy_sequence(struct adc_sequence *dst, return true; } +static inline int z_vrfy_adc_read(struct device *dev, + const struct adc_sequence *user_sequence) -Z_SYSCALL_HANDLER(adc_read, dev, user_sequence) { struct adc_sequence sequence; struct adc_sequence_options options; @@ -62,9 +65,12 @@ Z_SYSCALL_HANDLER(adc_read, dev, user_sequence) return z_impl_adc_read((struct device *)dev, &sequence); } +#include #ifdef CONFIG_ADC_ASYNC -Z_SYSCALL_HANDLER(adc_read_async, dev, user_sequence, async) +static inline int z_vrfy_adc_read_async(struct device *dev, + const struct adc_sequence *user_sequence, + struct k_poll_signal *async) { struct adc_sequence sequence; struct adc_sequence_options options; @@ -82,4 +88,5 @@ Z_SYSCALL_HANDLER(adc_read_async, dev, user_sequence, async) return z_impl_adc_read_async((struct device *)dev, &sequence, (struct k_poll_signal *)async); } +#include #endif /* CONFIG_ADC_ASYNC */ diff --git a/drivers/can/can_handlers.c b/drivers/can/can_handlers.c index d6f0e9d9651..e5a40051be0 100644 --- a/drivers/can/can_handlers.c +++ b/drivers/can/can_handlers.c @@ -7,15 +7,21 @@ #include #include -Z_SYSCALL_HANDLER(can_configure, dev, mode, bitrate) { +static inline int z_vrfy_can_configure(struct device *dev, enum can_mode mode, + u32_t bitrate) { Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, configure)); return z_impl_can_configure((struct device *)dev, (enum can_mode)mode, (u32_t)bitrate); } +#include -Z_SYSCALL_HANDLER(can_send, dev, msg, timeout, callback_isr, callback_arg) { +static inline int z_vrfy_can_send(struct device *dev, + const struct zcan_frame *msg, + s32_t timeout, + can_tx_callback_t callback_isr, + void *callback_arg) { Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, send)); @@ -33,9 +39,11 @@ Z_SYSCALL_HANDLER(can_send, dev, msg, timeout, callback_isr, callback_arg) { (s32_t)timeout, (can_tx_callback_t) callback_isr, (void *)callback_arg); } +#include -Z_SYSCALL_HANDLER(can_attach_msgq, dev, msgq, filter) { - +static inline int z_vrfy_can_attach_msgq(struct device *dev, + struct k_msgq *msgq, + const struct zcan_filter *filter) { Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN)); Z_OOPS(Z_SYSCALL_MEMORY_READ((struct zcan_filter *)filter, @@ -46,12 +54,12 @@ Z_SYSCALL_HANDLER(can_attach_msgq, dev, msgq, filter) { (struct k_msgq *)msgq, (const struct zcan_filter *) filter); } +#include -Z_SYSCALL_HANDLER(can_detach, dev, filter_id) { +static inline void z_vrfy_can_detach(struct device *dev, int filter_id) Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, detach)); z_impl_can_detach((struct device *)dev, (int)filter_id); - - return 0; } +#include diff --git a/drivers/counter/counter_handlers.c b/drivers/counter/counter_handlers.c index 76b58f82731..31e62628dd6 100644 --- a/drivers/counter/counter_handlers.c +++ b/drivers/counter/counter_handlers.c @@ -11,7 +11,7 @@ * instance and return an integral value */ #define COUNTER_HANDLER(name) \ - Z_SYSCALL_HANDLER(counter_ ## name, dev) \ + static inline int z_vrfy_counter_##name(struct devince *dev) \ { \ Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, name)); \ return z_impl_counter_ ## name((struct device *)dev); \ @@ -24,15 +24,26 @@ COUNTER_HANDLER(start) COUNTER_HANDLER(get_top_value) COUNTER_HANDLER(get_max_relative_alarm) -Z_SYSCALL_HANDLER(counter_get_guard_period, dev, flags) +#include +#include +#include +#include +#include +#include + +static inline u32_t z_vrfy_counter_get_guard_period(struct device *dev, + u32_t flags) { Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_guard_period)); return z_impl_counter_get_guard_period((struct device *)dev, flags); } +#include -Z_SYSCALL_HANDLER(counter_set_guard_period, dev, ticks, flags) +static inline int z_vrfy_counter_set_guard_period(struct device *dev, + u32_t ticks, u32_t flags) { Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, set_guard_period)); return z_impl_counter_set_guard_period((struct device *)dev, ticks, flags); } +#include diff --git a/drivers/dma/dma_handlers.c b/drivers/dma/dma_handlers.c index fe8bfc0278d..05fbeeca608 100644 --- a/drivers/dma/dma_handlers.c +++ b/drivers/dma/dma_handlers.c @@ -11,15 +11,17 @@ * the validity of the channel ID and returning -errno if it's bogus */ -Z_SYSCALL_HANDLER(dma_start, dev, channel) +static inline int z_vrfy_dma_start(struct device *dev, u32_t channel) { Z_OOPS(Z_SYSCALL_DRIVER_DMA(dev, start)); return z_impl_dma_start((struct device *)dev, channel); } +#include -Z_SYSCALL_HANDLER(dma_stop, dev, channel) +static inline int z_vrfy_dma_stop(struct device *dev, u32_t channel) { Z_OOPS(Z_SYSCALL_DRIVER_DMA(dev, stop)); return z_impl_dma_stop((struct device *)dev, channel); } +#include diff --git a/drivers/entropy/entropy_handlers.c b/drivers/entropy/entropy_handlers.c index c027f27fad1..98a4e001f2f 100644 --- a/drivers/entropy/entropy_handlers.c +++ b/drivers/entropy/entropy_handlers.c @@ -7,10 +7,13 @@ #include #include -Z_SYSCALL_HANDLER(entropy_get_entropy, dev, buffer, len) +static inline int z_vrfy_entropy_get_entropy(struct device *dev, + u8_t *buffer, + u16_t len) { Z_OOPS(Z_SYSCALL_DRIVER_ENTROPY(dev, get_entropy)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, len)); return z_impl_entropy_get_entropy((struct device *)dev, (u8_t *)buffer, len); } +#include diff --git a/drivers/flash/flash_handlers.c b/drivers/flash/flash_handlers.c index 1b76a2d92b0..ce3c109837f 100644 --- a/drivers/flash/flash_handlers.c +++ b/drivers/flash/flash_handlers.c @@ -7,51 +7,69 @@ #include #include -Z_SYSCALL_HANDLER(flash_read, dev, offset, data, len) +static inline int z_vrfy_flash_read(struct device *dev, off_t offset, + void *data, size_t len) { Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, read)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, len)); return z_impl_flash_read((struct device *)dev, offset, (void *)data, len); } +#include -Z_SYSCALL_HANDLER(flash_write, dev, offset, data, len) +static inline int z_vrfy_flash_write(struct device *dev, off_t offset, + const void *data, size_t len) { Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, write)); Z_OOPS(Z_SYSCALL_MEMORY_READ(data, len)); return z_impl_flash_write((struct device *)dev, offset, (const void *)data, len); } +#include -Z_SYSCALL_HANDLER(flash_write_protection_set, dev, enable) +static inline int z_vrfy_flash_write_protection_set(struct device *dev, + bool enable) { Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, write_protection)); return z_impl_flash_write_protection_set((struct device *)dev, enable); } +#include -Z_SYSCALL_HANDLER1_SIMPLE(flash_get_write_block_size, K_OBJ_DRIVER_FLASH, - struct device *); +static inline size_t z_vrfy_flash_get_write_block_size(struct device *dev) +{ + Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_FLASH)); + return z_impl_flash_get_write_block_size(dev); +} +#include #ifdef CONFIG_FLASH_PAGE_LAYOUT -Z_SYSCALL_HANDLER(flash_get_page_info_by_offs, dev, offs, info) +static inline int z_vrfy_flash_get_page_info_by_offs(struct device *dev, + off_t offs, + struct flash_pages_info *info) { Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, page_layout)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info))); return z_impl_flash_get_page_info_by_offs((struct device *)dev, offs, (struct flash_pages_info *)info); } +#include -Z_SYSCALL_HANDLER(flash_get_page_info_by_idx, dev, idx, info) +static inline int z_vrfy_flash_get_page_info_by_idx(struct device *dev, + u32_t idx, + struct flash_pages_info *info) { Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, page_layout)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info))); return z_impl_flash_get_page_info_by_idx((struct device *)dev, idx, (struct flash_pages_info *)info); } +#include -Z_SYSCALL_HANDLER(flash_get_page_count, dev) +static inline size_t z_vrfy_flash_get_page_count(struct device *dev); { Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, page_layout)); return z_impl_flash_get_page_count((struct device *)dev); } +#include + #endif diff --git a/drivers/hwinfo/hwinfo_handlers.c b/drivers/hwinfo/hwinfo_handlers.c index c5e165444fc..262626a1464 100644 --- a/drivers/hwinfo/hwinfo_handlers.c +++ b/drivers/hwinfo/hwinfo_handlers.c @@ -7,9 +7,9 @@ #include #include -Z_SYSCALL_HANDLER(hwinfo_get_device_id, buffer, length) { - +ssize_t z_vrfy_hwinfo_get_device_id(u8_t *buffer, size_t length) { Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, length)); return z_impl_hwinfo_get_device_id((u8_t *)buffer, (size_t)length); } +#include diff --git a/drivers/i2s/i2s_handlers.c b/drivers/i2s/i2s_handlers.c index a04faf42928..70998c2f173 100644 --- a/drivers/i2s/i2s_handlers.c +++ b/drivers/i2s/i2s_handlers.c @@ -9,7 +9,8 @@ #include -Z_SYSCALL_HANDLER(i2s_configure, dev, dir, cfg_ptr) +static inline int z_vrfy_i2s_configure(struct device *dev, enum i2s_dir dir, + struct i2s_config *cfg_ptr) { struct i2s_config config; int ret = -EINVAL; @@ -39,8 +40,10 @@ Z_SYSCALL_HANDLER(i2s_configure, dev, dir, cfg_ptr) out: return ret; } +#include -Z_SYSCALL_HANDLER(i2s_buf_read, dev, buf, size) +static inline int z_vrfy_i2s_buf_read(struct device *dev, + void *buf, size_t *size); { void *mem_block; size_t data_size; @@ -70,8 +73,10 @@ Z_SYSCALL_HANDLER(i2s_buf_read, dev, buf, size) return ret; } +#include -Z_SYSCALL_HANDLER(i2s_buf_write, dev, buf, size) +static inline int z_vrfy_i2s_buf_write(struct device *dev, + void *buf, size_t size) { int ret; struct i2s_config *tx_cfg; @@ -105,10 +110,13 @@ Z_SYSCALL_HANDLER(i2s_buf_write, dev, buf, size) return ret; } +#include -Z_SYSCALL_HANDLER(i2s_trigger, dev, dir, cmd) +static inline int z_vrfy_i2s_trigger(struct device *dev, enum i2s_dir dir, + enum i2s_trigger_cmd cmd) { Z_OOPS(Z_SYSCALL_DRIVER_I2S(dev, trigger)); return z_impl_i2s_trigger((struct device *)dev, dir, cmd); } +#include diff --git a/drivers/ipm/ipm_handlers.c b/drivers/ipm/ipm_handlers.c index d7dd3117d39..3ce27ce079b 100644 --- a/drivers/ipm/ipm_handlers.c +++ b/drivers/ipm/ipm_handlers.c @@ -7,28 +7,33 @@ #include #include -Z_SYSCALL_HANDLER(ipm_send, dev, wait, id, data, size) +static inline int z_vrfy_ipm_send(struct device *dev, int wait, u32_t id, + const void *data, int size) { Z_OOPS(Z_SYSCALL_DRIVER_IPM(dev, send)); Z_OOPS(Z_SYSCALL_MEMORY_READ(data, size)); return z_impl_ipm_send((struct device *)dev, wait, id, (const void *)data, size); } +#include -Z_SYSCALL_HANDLER(ipm_max_data_size_get, dev) +static inline int z_vrfy_ipm_max_data_size_get(struct device *dev) { Z_OOPS(Z_SYSCALL_DRIVER_IPM(dev, max_data_size_get)); return z_impl_max_data_size_get((struct device *)dev); } +#include -Z_SYSCALL_HANDLER(ipm_max_id_val_get, dev) +static inline u32_t z_vrfy_ipm_max_id_val_get(struct device *dev) { Z_OOPS(Z_SYSCALL_DRIVER_IPM(dev, max_id_val_get)); - return z_impl_max_id_val_get((struct device *)dev); + return z_impl_ipm_max_id_val_get((struct device *)dev); } +#include -Z_SYSCALL_HANDLER(ipm_set_enabled, dev, enable) +static inline int z_vrfy_ipm_set_enabled(struct device *dev, int enable) { Z_OOPS(Z_SYSCALL_DRIVER_IPM(dev, set_enabled)); return z_impl_ipm_set_enabled((struct device *)dev, enable); } +#include diff --git a/drivers/led/led_handlers.c b/drivers/led/led_handlers.c index 319fc2d500f..0b98e5df121 100644 --- a/drivers/led/led_handlers.c +++ b/drivers/led/led_handlers.c @@ -7,27 +7,33 @@ #include #include -Z_SYSCALL_HANDLER(led_blink, dev, led, delay_on, delay_off) +static inline int z_vrfy_led_blink(struct device *dev, u32_t led, + u32_t delay_on, u32_t delay_off) { Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, blink)); return z_impl_led_blink((struct device *)dev, led, delay_on, delay_off); } +#include -Z_SYSCALL_HANDLER(led_set_brightness, dev, led, value) +static inline int z_vrfy_led_set_brightness(struct device *dev, u32_t led, + u8_t value) { Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, set_brightness)); return z_impl_led_set_brightness((struct device *)dev, led, value); } +#include -Z_SYSCALL_HANDLER(led_on, dev, led) +static inline int z_vrfy_led_on(struct device *dev, u32_t led) { Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, on)); return z_impl_led_on((struct device *)dev, led); } +#include -Z_SYSCALL_HANDLER(led_off, dev, led) +static inline int z_vrfy_led_off(struct device *dev, u32_t led) { Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, off)); return z_impl_led_off((struct device *)dev, led); } +#include diff --git a/drivers/pwm/pwm_handlers.c b/drivers/pwm/pwm_handlers.c index d4730fe99a1..428fd7d9dc5 100644 --- a/drivers/pwm/pwm_handlers.c +++ b/drivers/pwm/pwm_handlers.c @@ -7,17 +7,21 @@ #include #include -Z_SYSCALL_HANDLER(pwm_pin_set_cycles, dev, pwm, period, pulse) +static inline int z_vrfy_pwm_pin_set_cycles(struct device *dev, u32_t pwm, + u32_t period, u32_t pulse) { Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, pin_set)); return z_impl_pwm_pin_set_cycles((struct device *)dev, pwm, period, pulse); } +#include -Z_SYSCALL_HANDLER(pwm_get_cycles_per_sec, dev, pwm, cycles) +static inline int z_vrfy_pwm_get_cycles_per_sec(struct device *dev, u32_t pwm, + u64_t *cycles) { Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(u64_t))); return z_impl_pwm_get_cycles_per_sec((struct device *)dev, pwm, (u64_t *)cycles); } +#include diff --git a/drivers/rtc/rtc_handlers.c b/drivers/rtc/rtc_handlers.c index 69d7a2842d8..dcfea2ea05c 100644 --- a/drivers/rtc/rtc_handlers.c +++ b/drivers/rtc/rtc_handlers.c @@ -7,34 +7,41 @@ #include #include -Z_SYSCALL_HANDLER(rtc_read, dev) +static inline u32_t z_vrfy_rtc_read(struct device *dev) { Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, read)); return z_impl_rtc_read((struct device *)dev); } -Z_SYSCALL_HANDLER(rtc_enable, dev) +static inline void z_vrfy_rtc_enable(struct device *dev) { Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, enable)); z_impl_rtc_enable((struct device *)dev); return 0; } -Z_SYSCALL_HANDLER(rtc_disable, dev) +static inline void z_vrfy_rtc_disable(struct device *dev) { Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, disable)); z_impl_rtc_disable((struct device *)dev); return 0; } -Z_SYSCALL_HANDLER(rtc_set_alarm, dev, alarm_val) +static inline int z_vrfy_rtc_set_alarm(struct device *dev, + const u32_t alarm_val) { Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, set_alarm)); return z_impl_rtc_set_alarm((struct device *)dev, alarm_val); } -Z_SYSCALL_HANDLER(rtc_get_pending_int, dev) +static inline int z_vrfy_rtc_get_pending_int(struct device *dev) { Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, get_pending_int)); return z_impl_rtc_get_pending_int((struct device *)dev); } + +#include +#include +#include +#include +#include diff --git a/drivers/sensor/sensor_handlers.c b/drivers/sensor/sensor_handlers.c index 79bb8d6cc5f..fd9a276df7e 100644 --- a/drivers/sensor/sensor_handlers.c +++ b/drivers/sensor/sensor_handlers.c @@ -7,30 +7,40 @@ #include #include -Z_SYSCALL_HANDLER(sensor_attr_set, dev, chan, attr, val) +static inline int z_vrfy_sensor_attr_set(struct device *dev, + enum sensor_channel chan, + enum sensor_attribute attr, + const struct sensor_value *val) { Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, attr_set)); Z_OOPS(Z_SYSCALL_MEMORY_READ(val, sizeof(struct sensor_value))); return z_impl_sensor_attr_set((struct device *)dev, chan, attr, (const struct sensor_value *)val); } +#include -Z_SYSCALL_HANDLER(sensor_sample_fetch, dev) +static inline int z_vrfy_sensor_sample_fetch(struct device *dev) { Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, sample_fetch)); return z_impl_sensor_sample_fetch((struct device *)dev); } +#include -Z_SYSCALL_HANDLER(sensor_sample_fetch_chan, dev, type) +static inline int z_vrfy_sensor_sample_fetch_chan(struct device *dev, + enum sensor_channel type) { Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, sample_fetch)); return z_impl_sensor_sample_fetch_chan((struct device *)dev, type); } +#include -Z_SYSCALL_HANDLER(sensor_channel_get, dev, chan, val) +static inline int z_vrfy_sensor_channel_get(struct device *dev, + enum sensor_channel chan, + struct sensor_value *val) { Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, channel_get)); Z_OOPS(Z_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value))); return z_impl_sensor_channel_get((struct device *)dev, chan, (struct sensor_value *)val); } +#include diff --git a/drivers/spi/spi_handlers.c b/drivers/spi/spi_handlers.c index 63fcda356de..6ee76668cb5 100644 --- a/drivers/spi/spi_handlers.c +++ b/drivers/spi/spi_handlers.c @@ -13,7 +13,7 @@ */ static void copy_and_check(struct spi_buf_set *bufs, struct spi_buf *buf_copy, - int writable, void *ssf) + int writable) { size_t i; @@ -53,22 +53,23 @@ static void copy_and_check(struct spi_buf_set *bufs, static u32_t copy_bufs_and_transceive(struct device *dev, const struct spi_config *config, struct spi_buf_set *tx_bufs, - struct spi_buf_set *rx_bufs, - void *ssf) + struct spi_buf_set *rx_bufs) { struct spi_buf tx_buf_copy[tx_bufs->count ? tx_bufs->count : 1]; struct spi_buf rx_buf_copy[rx_bufs->count ? rx_bufs->count : 1]; - copy_and_check(tx_bufs, tx_buf_copy, 0, ssf); - copy_and_check(rx_bufs, rx_buf_copy, 1, ssf); + copy_and_check(tx_bufs, tx_buf_copy, 0); + copy_and_check(rx_bufs, rx_buf_copy, 1); return z_impl_spi_transceive((struct device *)dev, config, tx_bufs, rx_bufs); } -Z_SYSCALL_HANDLER(spi_transceive, dev, config_p, tx_bufs, rx_bufs) +static inline int z_vrfy_spi_transceive(struct device *dev, + const struct spi_config *config, + const struct spi_buf_set *tx_bufs, + const struct spi_buf_set *rx_bufs) { - const struct spi_config *config = (const struct spi_config *)config_p; struct spi_buf_set tx_bufs_copy; struct spi_buf_set rx_bufs_copy; struct spi_config config_copy; @@ -110,21 +111,18 @@ Z_SYSCALL_HANDLER(spi_transceive, dev, config_p, tx_bufs, rx_bufs) } } - /* ssf is implicit system call stack frame parameter, used by - * _SYSCALL_* APIs when something goes wrong. - */ return copy_bufs_and_transceive((struct device *)dev, &config_copy, &tx_bufs_copy, - &rx_bufs_copy, - ssf); + &rx_bufs_copy); } +#include -Z_SYSCALL_HANDLER(spi_release, dev, config_p) +static inline int z_vrfy_spi_release(struct device *dev, + const struct spi_config *config) { - const struct spi_config *config = (const struct spi_config *)config_p; - Z_OOPS(Z_SYSCALL_MEMORY_READ(config, sizeof(*config))); Z_OOPS(Z_SYSCALL_DRIVER_SPI(dev, release)); return z_impl_spi_release((struct device *)dev, config); } +#include diff --git a/kernel/sched.c b/kernel/sched.c index 541ebdd80a0..a6929c36fc9 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -894,7 +894,7 @@ void z_impl_k_thread_deadline_set(k_tid_t tid, int deadline) } #ifdef CONFIG_USERSPACE -Z_SYSCALL_HANDLER(k_thread_deadline_set, thread_p, deadline) +static inline void z_vrfy_k_thread_deadline_set(k_tid_t tid, int deadline) { struct k_thread *thread = (struct k_thread *)thread_p; @@ -904,8 +904,8 @@ Z_SYSCALL_HANDLER(k_thread_deadline_set, thread_p, deadline) (int)deadline)); z_impl_k_thread_deadline_set((k_tid_t)thread, deadline); - return 0; } +#include #endif #endif