Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 1 | /* |
| 2 | * posix-clock.c - support for dynamic clock devices |
| 3 | * |
| 4 | * Copyright (C) 2010 OMICRON electronics GmbH |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | */ |
| 20 | #include <linux/device.h> |
Paul Gortmaker | 6e5fdee | 2011-05-26 16:00:52 -0400 | [diff] [blame] | 21 | #include <linux/export.h> |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 22 | #include <linux/file.h> |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 23 | #include <linux/posix-clock.h> |
| 24 | #include <linux/slab.h> |
| 25 | #include <linux/syscalls.h> |
| 26 | #include <linux/uaccess.h> |
| 27 | |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 28 | /* |
| 29 | * Returns NULL if the posix_clock instance attached to 'fp' is old and stale. |
| 30 | */ |
| 31 | static struct posix_clock *get_posix_clock(struct file *fp) |
| 32 | { |
| 33 | struct posix_clock *clk = fp->private_data; |
| 34 | |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 35 | down_read(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 36 | |
| 37 | if (!clk->zombie) |
| 38 | return clk; |
| 39 | |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 40 | up_read(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 41 | |
| 42 | return NULL; |
| 43 | } |
| 44 | |
| 45 | static void put_posix_clock(struct posix_clock *clk) |
| 46 | { |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 47 | up_read(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | static ssize_t posix_clock_read(struct file *fp, char __user *buf, |
| 51 | size_t count, loff_t *ppos) |
| 52 | { |
| 53 | struct posix_clock *clk = get_posix_clock(fp); |
| 54 | int err = -EINVAL; |
| 55 | |
| 56 | if (!clk) |
| 57 | return -ENODEV; |
| 58 | |
| 59 | if (clk->ops.read) |
| 60 | err = clk->ops.read(clk, fp->f_flags, buf, count); |
| 61 | |
| 62 | put_posix_clock(clk); |
| 63 | |
| 64 | return err; |
| 65 | } |
| 66 | |
| 67 | static unsigned int posix_clock_poll(struct file *fp, poll_table *wait) |
| 68 | { |
| 69 | struct posix_clock *clk = get_posix_clock(fp); |
Richard Cochran | 1b9f237 | 2015-12-22 22:19:58 +0100 | [diff] [blame] | 70 | unsigned int result = 0; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 71 | |
| 72 | if (!clk) |
Richard Cochran | 1b9f237 | 2015-12-22 22:19:58 +0100 | [diff] [blame] | 73 | return POLLERR; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 74 | |
| 75 | if (clk->ops.poll) |
| 76 | result = clk->ops.poll(clk, fp, wait); |
| 77 | |
| 78 | put_posix_clock(clk); |
| 79 | |
| 80 | return result; |
| 81 | } |
| 82 | |
| 83 | static int posix_clock_fasync(int fd, struct file *fp, int on) |
| 84 | { |
| 85 | struct posix_clock *clk = get_posix_clock(fp); |
| 86 | int err = 0; |
| 87 | |
| 88 | if (!clk) |
| 89 | return -ENODEV; |
| 90 | |
| 91 | if (clk->ops.fasync) |
| 92 | err = clk->ops.fasync(clk, fd, fp, on); |
| 93 | |
| 94 | put_posix_clock(clk); |
| 95 | |
| 96 | return err; |
| 97 | } |
| 98 | |
| 99 | static int posix_clock_mmap(struct file *fp, struct vm_area_struct *vma) |
| 100 | { |
| 101 | struct posix_clock *clk = get_posix_clock(fp); |
| 102 | int err = -ENODEV; |
| 103 | |
| 104 | if (!clk) |
| 105 | return -ENODEV; |
| 106 | |
| 107 | if (clk->ops.mmap) |
| 108 | err = clk->ops.mmap(clk, vma); |
| 109 | |
| 110 | put_posix_clock(clk); |
| 111 | |
| 112 | return err; |
| 113 | } |
| 114 | |
| 115 | static long posix_clock_ioctl(struct file *fp, |
| 116 | unsigned int cmd, unsigned long arg) |
| 117 | { |
| 118 | struct posix_clock *clk = get_posix_clock(fp); |
| 119 | int err = -ENOTTY; |
| 120 | |
| 121 | if (!clk) |
| 122 | return -ENODEV; |
| 123 | |
| 124 | if (clk->ops.ioctl) |
| 125 | err = clk->ops.ioctl(clk, cmd, arg); |
| 126 | |
| 127 | put_posix_clock(clk); |
| 128 | |
| 129 | return err; |
| 130 | } |
| 131 | |
| 132 | #ifdef CONFIG_COMPAT |
| 133 | static long posix_clock_compat_ioctl(struct file *fp, |
| 134 | unsigned int cmd, unsigned long arg) |
| 135 | { |
| 136 | struct posix_clock *clk = get_posix_clock(fp); |
| 137 | int err = -ENOTTY; |
| 138 | |
| 139 | if (!clk) |
| 140 | return -ENODEV; |
| 141 | |
| 142 | if (clk->ops.ioctl) |
| 143 | err = clk->ops.ioctl(clk, cmd, arg); |
| 144 | |
| 145 | put_posix_clock(clk); |
| 146 | |
| 147 | return err; |
| 148 | } |
| 149 | #endif |
| 150 | |
| 151 | static int posix_clock_open(struct inode *inode, struct file *fp) |
| 152 | { |
| 153 | int err; |
| 154 | struct posix_clock *clk = |
| 155 | container_of(inode->i_cdev, struct posix_clock, cdev); |
| 156 | |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 157 | down_read(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 158 | |
| 159 | if (clk->zombie) { |
| 160 | err = -ENODEV; |
| 161 | goto out; |
| 162 | } |
| 163 | if (clk->ops.open) |
| 164 | err = clk->ops.open(clk, fp->f_mode); |
| 165 | else |
| 166 | err = 0; |
| 167 | |
| 168 | if (!err) { |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 169 | get_device(clk->dev); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 170 | fp->private_data = clk; |
| 171 | } |
| 172 | out: |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 173 | up_read(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 174 | return err; |
| 175 | } |
| 176 | |
| 177 | static int posix_clock_release(struct inode *inode, struct file *fp) |
| 178 | { |
| 179 | struct posix_clock *clk = fp->private_data; |
| 180 | int err = 0; |
| 181 | |
| 182 | if (clk->ops.release) |
| 183 | err = clk->ops.release(clk); |
| 184 | |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 185 | put_device(clk->dev); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 186 | |
| 187 | fp->private_data = NULL; |
| 188 | |
| 189 | return err; |
| 190 | } |
| 191 | |
| 192 | static const struct file_operations posix_clock_file_operations = { |
| 193 | .owner = THIS_MODULE, |
| 194 | .llseek = no_llseek, |
| 195 | .read = posix_clock_read, |
| 196 | .poll = posix_clock_poll, |
| 197 | .unlocked_ioctl = posix_clock_ioctl, |
| 198 | .open = posix_clock_open, |
| 199 | .release = posix_clock_release, |
| 200 | .fasync = posix_clock_fasync, |
| 201 | .mmap = posix_clock_mmap, |
| 202 | #ifdef CONFIG_COMPAT |
| 203 | .compat_ioctl = posix_clock_compat_ioctl, |
| 204 | #endif |
| 205 | }; |
| 206 | |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 207 | int posix_clock_register(struct posix_clock *clk, struct device *dev) |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 208 | { |
| 209 | int err; |
| 210 | |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 211 | init_rwsem(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 212 | |
| 213 | cdev_init(&clk->cdev, &posix_clock_file_operations); |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 214 | err = cdev_device_add(&clk->cdev, dev); |
| 215 | if (err) { |
| 216 | pr_err("%s unable to add device %d:%d\n", |
| 217 | dev_name(dev), MAJOR(dev->devt), MINOR(dev->devt)); |
| 218 | return err; |
| 219 | } |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 220 | clk->cdev.owner = clk->ops.owner; |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 221 | clk->dev = dev; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 222 | |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 223 | return 0; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 224 | } |
| 225 | EXPORT_SYMBOL_GPL(posix_clock_register); |
| 226 | |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 227 | void posix_clock_unregister(struct posix_clock *clk) |
| 228 | { |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 229 | cdev_device_del(&clk->cdev, clk->dev); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 230 | |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 231 | down_write(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 232 | clk->zombie = true; |
Richard Cochran | 1791f88 | 2011-03-30 15:24:21 +0200 | [diff] [blame] | 233 | up_write(&clk->rwsem); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 234 | |
Vladis Dronov | 89e8fc9 | 2019-12-27 03:26:27 +0100 | [diff] [blame] | 235 | put_device(clk->dev); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 236 | } |
| 237 | EXPORT_SYMBOL_GPL(posix_clock_unregister); |
| 238 | |
| 239 | struct posix_clock_desc { |
| 240 | struct file *fp; |
| 241 | struct posix_clock *clk; |
| 242 | }; |
| 243 | |
| 244 | static int get_clock_desc(const clockid_t id, struct posix_clock_desc *cd) |
| 245 | { |
| 246 | struct file *fp = fget(CLOCKID_TO_FD(id)); |
| 247 | int err = -EINVAL; |
| 248 | |
| 249 | if (!fp) |
| 250 | return err; |
| 251 | |
| 252 | if (fp->f_op->open != posix_clock_open || !fp->private_data) |
| 253 | goto out; |
| 254 | |
| 255 | cd->fp = fp; |
| 256 | cd->clk = get_posix_clock(fp); |
| 257 | |
| 258 | err = cd->clk ? 0 : -ENODEV; |
| 259 | out: |
| 260 | if (err) |
| 261 | fput(fp); |
| 262 | return err; |
| 263 | } |
| 264 | |
| 265 | static void put_clock_desc(struct posix_clock_desc *cd) |
| 266 | { |
| 267 | put_posix_clock(cd->clk); |
| 268 | fput(cd->fp); |
| 269 | } |
| 270 | |
| 271 | static int pc_clock_adjtime(clockid_t id, struct timex *tx) |
| 272 | { |
| 273 | struct posix_clock_desc cd; |
| 274 | int err; |
| 275 | |
| 276 | err = get_clock_desc(id, &cd); |
| 277 | if (err) |
| 278 | return err; |
| 279 | |
Torben Hohn | 6e6823d | 2011-03-03 18:26:14 +0100 | [diff] [blame] | 280 | if ((cd.fp->f_mode & FMODE_WRITE) == 0) { |
| 281 | err = -EACCES; |
| 282 | goto out; |
| 283 | } |
| 284 | |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 285 | if (cd.clk->ops.clock_adjtime) |
| 286 | err = cd.clk->ops.clock_adjtime(cd.clk, tx); |
| 287 | else |
| 288 | err = -EOPNOTSUPP; |
Torben Hohn | 6e6823d | 2011-03-03 18:26:14 +0100 | [diff] [blame] | 289 | out: |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 290 | put_clock_desc(&cd); |
| 291 | |
| 292 | return err; |
| 293 | } |
| 294 | |
| 295 | static int pc_clock_gettime(clockid_t id, struct timespec *ts) |
| 296 | { |
| 297 | struct posix_clock_desc cd; |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 298 | struct timespec64 ts64; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 299 | int err; |
| 300 | |
| 301 | err = get_clock_desc(id, &cd); |
| 302 | if (err) |
| 303 | return err; |
| 304 | |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 305 | if (cd.clk->ops.clock_gettime) { |
| 306 | err = cd.clk->ops.clock_gettime(cd.clk, &ts64); |
| 307 | *ts = timespec64_to_timespec(ts64); |
| 308 | } |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 309 | else |
| 310 | err = -EOPNOTSUPP; |
| 311 | |
| 312 | put_clock_desc(&cd); |
| 313 | |
| 314 | return err; |
| 315 | } |
| 316 | |
| 317 | static int pc_clock_getres(clockid_t id, struct timespec *ts) |
| 318 | { |
| 319 | struct posix_clock_desc cd; |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 320 | struct timespec64 ts64; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 321 | int err; |
| 322 | |
| 323 | err = get_clock_desc(id, &cd); |
| 324 | if (err) |
| 325 | return err; |
| 326 | |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 327 | if (cd.clk->ops.clock_getres) { |
| 328 | err = cd.clk->ops.clock_getres(cd.clk, &ts64); |
| 329 | *ts = timespec64_to_timespec(ts64); |
| 330 | } |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 331 | else |
| 332 | err = -EOPNOTSUPP; |
| 333 | |
| 334 | put_clock_desc(&cd); |
| 335 | |
| 336 | return err; |
| 337 | } |
| 338 | |
| 339 | static int pc_clock_settime(clockid_t id, const struct timespec *ts) |
| 340 | { |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 341 | struct timespec64 ts64 = timespec_to_timespec64(*ts); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 342 | struct posix_clock_desc cd; |
| 343 | int err; |
| 344 | |
| 345 | err = get_clock_desc(id, &cd); |
| 346 | if (err) |
| 347 | return err; |
| 348 | |
Torben Hohn | 6e6823d | 2011-03-03 18:26:14 +0100 | [diff] [blame] | 349 | if ((cd.fp->f_mode & FMODE_WRITE) == 0) { |
| 350 | err = -EACCES; |
| 351 | goto out; |
| 352 | } |
| 353 | |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 354 | if (cd.clk->ops.clock_settime) |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 355 | err = cd.clk->ops.clock_settime(cd.clk, &ts64); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 356 | else |
| 357 | err = -EOPNOTSUPP; |
Torben Hohn | 6e6823d | 2011-03-03 18:26:14 +0100 | [diff] [blame] | 358 | out: |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 359 | put_clock_desc(&cd); |
| 360 | |
| 361 | return err; |
| 362 | } |
| 363 | |
| 364 | static int pc_timer_create(struct k_itimer *kit) |
| 365 | { |
| 366 | clockid_t id = kit->it_clock; |
| 367 | struct posix_clock_desc cd; |
| 368 | int err; |
| 369 | |
| 370 | err = get_clock_desc(id, &cd); |
| 371 | if (err) |
| 372 | return err; |
| 373 | |
| 374 | if (cd.clk->ops.timer_create) |
| 375 | err = cd.clk->ops.timer_create(cd.clk, kit); |
| 376 | else |
| 377 | err = -EOPNOTSUPP; |
| 378 | |
| 379 | put_clock_desc(&cd); |
| 380 | |
| 381 | return err; |
| 382 | } |
| 383 | |
| 384 | static int pc_timer_delete(struct k_itimer *kit) |
| 385 | { |
| 386 | clockid_t id = kit->it_clock; |
| 387 | struct posix_clock_desc cd; |
| 388 | int err; |
| 389 | |
| 390 | err = get_clock_desc(id, &cd); |
| 391 | if (err) |
| 392 | return err; |
| 393 | |
| 394 | if (cd.clk->ops.timer_delete) |
| 395 | err = cd.clk->ops.timer_delete(cd.clk, kit); |
| 396 | else |
| 397 | err = -EOPNOTSUPP; |
| 398 | |
| 399 | put_clock_desc(&cd); |
| 400 | |
| 401 | return err; |
| 402 | } |
| 403 | |
| 404 | static void pc_timer_gettime(struct k_itimer *kit, struct itimerspec *ts) |
| 405 | { |
| 406 | clockid_t id = kit->it_clock; |
| 407 | struct posix_clock_desc cd; |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 408 | struct itimerspec64 ts64; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 409 | |
| 410 | if (get_clock_desc(id, &cd)) |
| 411 | return; |
| 412 | |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 413 | if (cd.clk->ops.timer_gettime) { |
| 414 | cd.clk->ops.timer_gettime(cd.clk, kit, &ts64); |
| 415 | *ts = itimerspec64_to_itimerspec(&ts64); |
| 416 | } |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 417 | put_clock_desc(&cd); |
| 418 | } |
| 419 | |
| 420 | static int pc_timer_settime(struct k_itimer *kit, int flags, |
| 421 | struct itimerspec *ts, struct itimerspec *old) |
| 422 | { |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 423 | struct itimerspec64 ts64 = itimerspec_to_itimerspec64(ts); |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 424 | clockid_t id = kit->it_clock; |
| 425 | struct posix_clock_desc cd; |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 426 | struct itimerspec64 old64; |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 427 | int err; |
| 428 | |
| 429 | err = get_clock_desc(id, &cd); |
| 430 | if (err) |
| 431 | return err; |
| 432 | |
Deepa Dinamani | 58e7fd9 | 2017-03-26 12:04:13 -0700 | [diff] [blame] | 433 | if (cd.clk->ops.timer_settime) { |
| 434 | err = cd.clk->ops.timer_settime(cd.clk, kit, flags, &ts64, &old64); |
| 435 | if (old) |
| 436 | *old = itimerspec64_to_itimerspec(&old64); |
| 437 | } |
Richard Cochran | 0606f42 | 2011-02-01 13:52:35 +0000 | [diff] [blame] | 438 | else |
| 439 | err = -EOPNOTSUPP; |
| 440 | |
| 441 | put_clock_desc(&cd); |
| 442 | |
| 443 | return err; |
| 444 | } |
| 445 | |
| 446 | struct k_clock clock_posix_dynamic = { |
| 447 | .clock_getres = pc_clock_getres, |
| 448 | .clock_set = pc_clock_settime, |
| 449 | .clock_get = pc_clock_gettime, |
| 450 | .clock_adj = pc_clock_adjtime, |
| 451 | .timer_create = pc_timer_create, |
| 452 | .timer_set = pc_timer_settime, |
| 453 | .timer_del = pc_timer_delete, |
| 454 | .timer_get = pc_timer_gettime, |
| 455 | }; |