2019-08-07 22:39:54 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <drivers/ps2.h>
|
|
|
|
#include <syscall_handler.h>
|
|
|
|
|
|
|
|
Z_SYSCALL_HANDLER(ps2_config, dev, callback_isr)
|
|
|
|
{
|
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, config));
|
|
|
|
Z_OOPS(Z_SYSCALL_VERIFY_MSG(callback_isr == 0,
|
|
|
|
"callback not be set from user mode"));
|
2020-07-14 23:02:00 +08:00
|
|
|
return z_impl_ps2_config((const struct device *)dev, callback_isr);
|
2019-08-07 22:39:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Z_SYSCALL_HANDLER(ps2_write, dev, value)
|
|
|
|
{
|
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, write));
|
2020-07-14 23:02:00 +08:00
|
|
|
return z_impl_ps2_write((const struct device *)dev, value);
|
2019-08-07 22:39:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Z_SYSCALL_HANDLER(ps2_read, dev, value)
|
|
|
|
{
|
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, read));
|
2020-05-28 00:26:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t)));
|
2020-07-14 23:02:00 +08:00
|
|
|
return z_impl_ps2_read((const struct device *)dev, (uint32_t *)value);
|
2019-08-07 22:39:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Z_SYSCALL_HANDLER(ps2_enable_callback)
|
|
|
|
{
|
2020-05-01 02:33:38 +08:00
|
|
|
return z_impl_ps2_enable_callback((const struct device *)dev);
|
2019-08-07 22:39:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Z_SYSCALL_HANDLER(ps2_disable_callback, dev)
|
|
|
|
{
|
2020-07-14 23:02:00 +08:00
|
|
|
return z_impl_ps2_disable_callback((const struct device *)dev);
|
2019-08-07 22:39:54 +08:00
|
|
|
}
|