Browse Source

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 <andrew.j.ross@intel.com>
pull/19068/head
Andy Ross 6 years ago committed by Anas Nashif
parent
commit
075c94f6e2
  1. 13
      drivers/adc/adc_handlers.c
  2. 22
      drivers/can/can_handlers.c
  3. 17
      drivers/counter/counter_handlers.c
  4. 6
      drivers/dma/dma_handlers.c
  5. 5
      drivers/entropy/entropy_handlers.c
  6. 34
      drivers/flash/flash_handlers.c
  7. 4
      drivers/hwinfo/hwinfo_handlers.c
  8. 16
      drivers/i2s/i2s_handlers.c
  9. 15
      drivers/ipm/ipm_handlers.c
  10. 14
      drivers/led/led_handlers.c
  11. 8
      drivers/pwm/pwm_handlers.c
  12. 17
      drivers/rtc/rtc_handlers.c
  13. 18
      drivers/sensor/sensor_handlers.c
  14. 28
      drivers/spi/spi_handlers.c
  15. 4
      kernel/sched.c

13
drivers/adc/adc_handlers.c

@ -8,7 +8,8 @@ @@ -8,7 +8,8 @@
#include <syscall_handler.h>
#include <kernel.h>
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) @@ -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 <syscalls/adc_channel_setup_mrsh.c>
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, @@ -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) @@ -62,9 +65,12 @@ Z_SYSCALL_HANDLER(adc_read, dev, user_sequence)
return z_impl_adc_read((struct device *)dev, &sequence);
}
#include <syscalls/adc_read_mrsh.c>
#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) @@ -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 <syscalls/adc_read_async_mrsh.c>
#endif /* CONFIG_ADC_ASYNC */

22
drivers/can/can_handlers.c

@ -7,15 +7,21 @@ @@ -7,15 +7,21 @@
#include <syscall_handler.h>
#include <drivers/can.h>
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 <syscalls/can_configure_mrsh.c>
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) { @@ -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 <syscalls/can_send_mrsh.c>
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) { @@ -46,12 +54,12 @@ Z_SYSCALL_HANDLER(can_attach_msgq, dev, msgq, filter) {
(struct k_msgq *)msgq,
(const struct zcan_filter *) filter);
}
#include <syscalls/can_attach_msgq_mrsh.c>
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 <syscalls/can_detach_mrsh.c>

17
drivers/counter/counter_handlers.c

@ -11,7 +11,7 @@ @@ -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) @@ -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 <syscalls/counter_get_pending_int_mrsh.c>
#include <syscalls/counter_read_mrsh.c>
#include <syscalls/counter_stop_mrsh.c>
#include <syscalls/counter_start_mrsh.c>
#include <syscalls/counter_get_top_value_mrsh.c>
#include <syscalls/counter_get_max_relative_alarm_mrsh.c>
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 <syscalls/counter_get_guard_period_mrsh.c>
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 <syscalls/counter_set_guard_period_mrsh.c>

6
drivers/dma/dma_handlers.c

@ -11,15 +11,17 @@ @@ -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 <syscalls/dma_start_mrsh.c>
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 <syscalls/dma_stop_mrsh.c>

5
drivers/entropy/entropy_handlers.c

@ -7,10 +7,13 @@ @@ -7,10 +7,13 @@
#include <drivers/entropy.h>
#include <syscall_handler.h>
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 <syscalls/entropy_get_entropy_mrsh.c>

34
drivers/flash/flash_handlers.c

@ -7,51 +7,69 @@ @@ -7,51 +7,69 @@
#include <syscall_handler.h>
#include <drivers/flash.h>
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 <syscalls/flash_read_mrsh.c>
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 <syscalls/flash_write_mrsh.c>
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 <syscalls/flash_write_protection_set_mrsh.c>
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 <syscalls/flash_get_write_block_size_mrsh.c>
#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 <syscalls/flash_get_page_info_by_offs_mrsh.c>
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 <syscalls/flash_get_page_info_by_idx_mrsh.c>
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 <syscalls/flash_get_page_count_mrsh.c>
#endif

4
drivers/hwinfo/hwinfo_handlers.c

@ -7,9 +7,9 @@ @@ -7,9 +7,9 @@
#include <syscall_handler.h>
#include <drivers/hwinfo.h>
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 <syscalls/hwinfo_get_device_id_mrsh.c>

16
drivers/i2s/i2s_handlers.c

@ -9,7 +9,8 @@ @@ -9,7 +9,8 @@
#include <drivers/i2s.h>
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) @@ -39,8 +40,10 @@ Z_SYSCALL_HANDLER(i2s_configure, dev, dir, cfg_ptr)
out:
return ret;
}
#include <syscalls/i2s_configure_mrsh.c>
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) @@ -70,8 +73,10 @@ Z_SYSCALL_HANDLER(i2s_buf_read, dev, buf, size)
return ret;
}
#include <syscalls/i2s_buf_read_mrsh.c>
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) @@ -105,10 +110,13 @@ Z_SYSCALL_HANDLER(i2s_buf_write, dev, buf, size)
return ret;
}
#include <syscalls/i2s_buf_write_mrsh.c>
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 <syscalls/i2s_trigger_mrsh.c>

15
drivers/ipm/ipm_handlers.c

@ -7,28 +7,33 @@ @@ -7,28 +7,33 @@
#include <syscall_handler.h>
#include <drivers/ipm.h>
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 <syscalls/ipm_send_mrsh.c>
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 <syscalls/ipm_max_data_size_get_mrsh.c>
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 <syscalls/ipm_max_id_val_get_mrsh.c>
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 <syscalls/ipm_set_enabled_mrsh.c>

14
drivers/led/led_handlers.c

@ -7,27 +7,33 @@ @@ -7,27 +7,33 @@
#include <syscall_handler.h>
#include <drivers/led.h>
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 <syscalls/led_blink_mrsh.c>
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 <syscalls/led_set_brightness_mrsh.c>
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 <syscalls/led_on_mrsh.c>
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 <syscalls/led_off_mrsh.c>

8
drivers/pwm/pwm_handlers.c

@ -7,17 +7,21 @@ @@ -7,17 +7,21 @@
#include <syscall_handler.h>
#include <drivers/pwm.h>
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 <syscalls/pwm_pin_set_cycles_mrsh.c>
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 <syscalls/pwm_get_cycles_per_sec_mrsh.c>

17
drivers/rtc/rtc_handlers.c

@ -7,34 +7,41 @@ @@ -7,34 +7,41 @@
#include <syscall_handler.h>
#include <drivers/rtc.h>
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 <syscalls/rtc_read_mrsh.c>
#include <syscalls/rtc_enable_mrsh.c>
#include <syscalls/rtc_disable_mrsh.c>
#include <syscalls/rtc_set_alarm_mrsh.c>
#include <syscalls/rtc_get_pending_int_mrsh.c>

18
drivers/sensor/sensor_handlers.c

@ -7,30 +7,40 @@ @@ -7,30 +7,40 @@
#include <drivers/sensor.h>
#include <syscall_handler.h>
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 <syscalls/sensor_attr_set_mrsh.c>
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 <syscalls/sensor_sample_fetch_mrsh.c>
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 <syscalls/sensor_sample_fetch_chan_mrsh.c>
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 <syscalls/sensor_channel_get_mrsh.c>

28
drivers/spi/spi_handlers.c

@ -13,7 +13,7 @@ @@ -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, @@ -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) @@ -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 <syscalls/spi_transceive_mrsh.c>
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 <syscalls/spi_release_mrsh.c>

4
kernel/sched.c

@ -894,7 +894,7 @@ void z_impl_k_thread_deadline_set(k_tid_t tid, int deadline) @@ -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) @@ -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 <syscalls/k_thread_deadline_set_mrsh.c>
#endif
#endif

Loading…
Cancel
Save