forked from M-Labs/artiq
1
0
Fork 0

runtime: add rtio_replace syscall

This commit is contained in:
Sebastien Bourdeauducq 2014-09-11 23:14:45 +08:00
parent f0c2003778
commit 10d796e026
4 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,7 @@ _syscalls = {
"rpc": "i+:i", "rpc": "i+:i",
"gpio_set": "ii:n", "gpio_set": "ii:n",
"rtio_set": "Iii:n", "rtio_set": "Iii:n",
"rtio_replace": "Iii:n",
"rtio_sync": "i:n", "rtio_sync": "i:n",
"dds_program": "ii:n", "dds_program": "ii:n",
} }

View File

@ -17,6 +17,14 @@ void rtio_set(long long int timestamp, int channel, int value)
rtio_o_we_write(1); rtio_o_we_write(1);
} }
void rtio_replace(long long int timestamp, int channel, int value)
{
rtio_chan_sel_write(channel);
rtio_o_timestamp_write(timestamp);
rtio_o_value_write(value);
rtio_o_replace_write(1);
}
void rtio_sync(int channel) void rtio_sync(int channel)
{ {
rtio_chan_sel_write(channel); rtio_chan_sel_write(channel);

View File

@ -3,6 +3,7 @@
void rtio_init(void); void rtio_init(void);
void rtio_set(long long int timestamp, int channel, int value); void rtio_set(long long int timestamp, int channel, int value);
void rtio_replace(long long int timestamp, int channel, int value);
void rtio_sync(int channel); void rtio_sync(int channel);
#endif /* __RTIO_H */ #endif /* __RTIO_H */

View File

@ -11,6 +11,7 @@ static const struct symbol syscalls[] = {
{"rpc", rpc}, {"rpc", rpc},
{"gpio_set", gpio_set}, {"gpio_set", gpio_set},
{"rtio_set", rtio_set}, {"rtio_set", rtio_set},
{"rtio_replace", rtio_replace},
{"rtio_sync", rtio_sync}, {"rtio_sync", rtio_sync},
{"dds_program", dds_program}, {"dds_program", dds_program},
{NULL, NULL} {NULL, NULL}