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>
diff --git a/drivers/adc/adc_handlers.c b/drivers/adc/adc_handlers.c
index 864e2bb..954f09e 100644
--- a/drivers/adc/adc_handlers.c
+++ b/drivers/adc/adc_handlers.c
@@ -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 @@
 
 	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 @@
 	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 @@
 
 	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 @@
 	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 */
diff --git a/drivers/can/can_handlers.c b/drivers/can/can_handlers.c
index d6f0e9d..e5a4005 100644
--- a/drivers/can/can_handlers.c
+++ b/drivers/can/can_handlers.c
@@ -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 @@
 			      (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 @@
 				     (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>
diff --git a/drivers/counter/counter_handlers.c b/drivers/counter/counter_handlers.c
index 76b58f8..31e6262 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(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>
diff --git a/drivers/dma/dma_handlers.c b/drivers/dma/dma_handlers.c
index fe8bfc0..05fbeec 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 <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>
 
diff --git a/drivers/entropy/entropy_handlers.c b/drivers/entropy/entropy_handlers.c
index c027f27..98a4e00 100644
--- a/drivers/entropy/entropy_handlers.c
+++ b/drivers/entropy/entropy_handlers.c
@@ -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>
diff --git a/drivers/flash/flash_handlers.c b/drivers/flash/flash_handlers.c
index 1b76a2d..ce3c109 100644
--- a/drivers/flash/flash_handlers.c
+++ b/drivers/flash/flash_handlers.c
@@ -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
diff --git a/drivers/hwinfo/hwinfo_handlers.c b/drivers/hwinfo/hwinfo_handlers.c
index c5e1654..262626a 100644
--- a/drivers/hwinfo/hwinfo_handlers.c
+++ b/drivers/hwinfo/hwinfo_handlers.c
@@ -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>
diff --git a/drivers/i2s/i2s_handlers.c b/drivers/i2s/i2s_handlers.c
index a04faf4..70998c2 100644
--- a/drivers/i2s/i2s_handlers.c
+++ b/drivers/i2s/i2s_handlers.c
@@ -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 @@
 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 @@
 
 	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 @@
 
 	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>
diff --git a/drivers/ipm/ipm_handlers.c b/drivers/ipm/ipm_handlers.c
index d7dd311..3ce27ce 100644
--- a/drivers/ipm/ipm_handlers.c
+++ b/drivers/ipm/ipm_handlers.c
@@ -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>
diff --git a/drivers/led/led_handlers.c b/drivers/led/led_handlers.c
index 319fc2d..0b98e5d 100644
--- a/drivers/led/led_handlers.c
+++ b/drivers/led/led_handlers.c
@@ -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>
diff --git a/drivers/pwm/pwm_handlers.c b/drivers/pwm/pwm_handlers.c
index d4730fe..428fd7d 100644
--- a/drivers/pwm/pwm_handlers.c
+++ b/drivers/pwm/pwm_handlers.c
@@ -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>
diff --git a/drivers/rtc/rtc_handlers.c b/drivers/rtc/rtc_handlers.c
index 69d7a28..dcfea2e 100644
--- a/drivers/rtc/rtc_handlers.c
+++ b/drivers/rtc/rtc_handlers.c
@@ -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>
diff --git a/drivers/sensor/sensor_handlers.c b/drivers/sensor/sensor_handlers.c
index 79bb8d6..fd9a276 100644
--- a/drivers/sensor/sensor_handlers.c
+++ b/drivers/sensor/sensor_handlers.c
@@ -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>
diff --git a/drivers/spi/spi_handlers.c b/drivers/spi/spi_handlers.c
index 63fcda3..6ee7666 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 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 @@
 		}
 	}
 
-	/* 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>
diff --git a/kernel/sched.c b/kernel/sched.c
index 541ebdd..a6929c3 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -894,7 +894,7 @@
 }
 
 #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 @@
 				    (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