Thu Oct 10 13:45:14 2019 UTC ()
Add KASAN instrumentation on ucas and ufetch.


(maxv)
diff -r1.15 -r1.16 src/sys/kern/subr_asan.c
diff -r1.286 -r1.287 src/sys/sys/systm.h

cvs diff -r1.15 -r1.16 src/sys/kern/subr_asan.c (expand / switch to unified diff)

--- src/sys/kern/subr_asan.c 2019/10/04 06:27:42 1.15
+++ src/sys/kern/subr_asan.c 2019/10/10 13:45:14 1.16
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: subr_asan.c,v 1.15 2019/10/04 06:27:42 maxv Exp $ */ 1/* $NetBSD: subr_asan.c,v 1.16 2019/10/10 13:45:14 maxv Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2018-2019 The NetBSD Foundation, Inc. 4 * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Maxime Villard. 8 * by Maxime Villard.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.15 2019/10/04 06:27:42 maxv Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.16 2019/10/10 13:45:14 maxv Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/kernel.h> 37#include <sys/kernel.h>
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/conf.h> 39#include <sys/conf.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/types.h> 41#include <sys/types.h>
42#include <sys/asan.h> 42#include <sys/asan.h>
43 43
44#include <uvm/uvm.h> 44#include <uvm/uvm.h>
45 45
46#ifdef KASAN_PANIC 46#ifdef KASAN_PANIC
@@ -549,26 +549,129 @@ kasan_copyinstr(const void *uaddr, void  @@ -549,26 +549,129 @@ kasan_copyinstr(const void *uaddr, void
549 kasan_shadow_check((unsigned long)kaddr, len, true, __RET_ADDR); 549 kasan_shadow_check((unsigned long)kaddr, len, true, __RET_ADDR);
550 return copyinstr(uaddr, kaddr, len, done); 550 return copyinstr(uaddr, kaddr, len, done);
551} 551}
552 552
553int 553int
554kasan_copyoutstr(const void *kaddr, void *uaddr, size_t len, size_t *done) 554kasan_copyoutstr(const void *kaddr, void *uaddr, size_t len, size_t *done)
555{ 555{
556 kasan_shadow_check((unsigned long)kaddr, len, false, __RET_ADDR); 556 kasan_shadow_check((unsigned long)kaddr, len, false, __RET_ADDR);
557 return copyoutstr(kaddr, uaddr, len, done); 557 return copyoutstr(kaddr, uaddr, len, done);
558} 558}
559 559
560/* -------------------------------------------------------------------------- */ 560/* -------------------------------------------------------------------------- */
561 561
 562#undef _ucas_32
 563#undef _ucas_32_mp
 564#undef _ucas_64
 565#undef _ucas_64_mp
 566#undef _ufetch_8
 567#undef _ufetch_16
 568#undef _ufetch_32
 569#undef _ufetch_64
 570
 571int _ucas_32(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
 572int kasan__ucas_32(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
 573int
 574kasan__ucas_32(volatile uint32_t *uaddr, uint32_t old, uint32_t new,
 575 uint32_t *ret)
 576{
 577 kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
 578 __RET_ADDR);
 579 return _ucas_32(uaddr, old, new, ret);
 580}
 581
 582#ifdef __HAVE_UCAS_MP
 583int _ucas_32_mp(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
 584int kasan__ucas_32_mp(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
 585int
 586kasan__ucas_32_mp(volatile uint32_t *uaddr, uint32_t old, uint32_t new,
 587 uint32_t *ret)
 588{
 589 kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
 590 __RET_ADDR);
 591 return _ucas_32_mp(uaddr, old, new, ret);
 592}
 593#endif
 594
 595#ifdef _LP64
 596int _ucas_64(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
 597int kasan__ucas_64(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
 598int
 599kasan__ucas_64(volatile uint64_t *uaddr, uint64_t old, uint64_t new,
 600 uint64_t *ret)
 601{
 602 kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
 603 __RET_ADDR);
 604 return _ucas_64(uaddr, old, new, ret);
 605}
 606
 607#ifdef __HAVE_UCAS_MP
 608int _ucas_64_mp(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
 609int kasan__ucas_64_mp(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
 610int
 611kasan__ucas_64_mp(volatile uint64_t *uaddr, uint64_t old, uint64_t new,
 612 uint64_t *ret)
 613{
 614 kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
 615 __RET_ADDR);
 616 return _ucas_64_mp(uaddr, old, new, ret);
 617}
 618#endif
 619#endif
 620
 621int _ufetch_8(const uint8_t *, uint8_t *);
 622int kasan__ufetch_8(const uint8_t *, uint8_t *);
 623int
 624kasan__ufetch_8(const uint8_t *uaddr, uint8_t *valp)
 625{
 626 kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
 627 __RET_ADDR);
 628 return _ufetch_8(uaddr, valp);
 629}
 630
 631int _ufetch_16(const uint16_t *, uint16_t *);
 632int kasan__ufetch_16(const uint16_t *, uint16_t *);
 633int
 634kasan__ufetch_16(const uint16_t *uaddr, uint16_t *valp)
 635{
 636 kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
 637 __RET_ADDR);
 638 return _ufetch_16(uaddr, valp);
 639}
 640
 641int _ufetch_32(const uint32_t *, uint32_t *);
 642int kasan__ufetch_32(const uint32_t *, uint32_t *);
 643int
 644kasan__ufetch_32(const uint32_t *uaddr, uint32_t *valp)
 645{
 646 kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
 647 __RET_ADDR);
 648 return _ufetch_32(uaddr, valp);
 649}
 650
 651#ifdef _LP64
 652int _ufetch_64(const uint64_t *, uint64_t *);
 653int kasan__ufetch_64(const uint64_t *, uint64_t *);
 654int
 655kasan__ufetch_64(const uint64_t *uaddr, uint64_t *valp)
 656{
 657 kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
 658 __RET_ADDR);
 659 return _ufetch_64(uaddr, valp);
 660}
 661#endif
 662
 663/* -------------------------------------------------------------------------- */
 664
562#undef atomic_add_32 665#undef atomic_add_32
563#undef atomic_add_int 666#undef atomic_add_int
564#undef atomic_add_long 667#undef atomic_add_long
565#undef atomic_add_ptr 668#undef atomic_add_ptr
566#undef atomic_add_64 669#undef atomic_add_64
567#undef atomic_add_32_nv 670#undef atomic_add_32_nv
568#undef atomic_add_int_nv 671#undef atomic_add_int_nv
569#undef atomic_add_long_nv 672#undef atomic_add_long_nv
570#undef atomic_add_ptr_nv 673#undef atomic_add_ptr_nv
571#undef atomic_add_64_nv 674#undef atomic_add_64_nv
572#undef atomic_and_32 675#undef atomic_and_32
573#undef atomic_and_uint 676#undef atomic_and_uint
574#undef atomic_and_ulong 677#undef atomic_and_ulong

cvs diff -r1.286 -r1.287 src/sys/sys/systm.h (expand / switch to unified diff)

--- src/sys/sys/systm.h 2019/07/23 17:39:36 1.286
+++ src/sys/sys/systm.h 2019/10/10 13:45:14 1.287
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: systm.h,v 1.286 2019/07/23 17:39:36 rin Exp $ */ 1/* $NetBSD: systm.h,v 1.287 2019/10/10 13:45:14 maxv Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1982, 1988, 1991, 1993 4 * Copyright (c) 1982, 1988, 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc. 6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed 7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph 8 * to the University of California by American Telephone and Telegraph
9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10 * the permission of UNIX System Laboratories, Inc. 10 * the permission of UNIX System Laboratories, Inc.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -33,26 +33,27 @@ @@ -33,26 +33,27 @@
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * @(#)systm.h 8.7 (Berkeley) 3/29/95 36 * @(#)systm.h 8.7 (Berkeley) 3/29/95
37 */ 37 */
38 38
39#ifndef _SYS_SYSTM_H_ 39#ifndef _SYS_SYSTM_H_
40#define _SYS_SYSTM_H_ 40#define _SYS_SYSTM_H_
41 41
42#if defined(_KERNEL_OPT) 42#if defined(_KERNEL_OPT)
43#include "opt_ddb.h" 43#include "opt_ddb.h"
44#include "opt_multiprocessor.h" 44#include "opt_multiprocessor.h"
45#include "opt_gprof.h" 45#include "opt_gprof.h"
 46#include "opt_kasan.h"
46#include "opt_kleak.h" 47#include "opt_kleak.h"
47#include "opt_wsdisplay_compat.h" 48#include "opt_wsdisplay_compat.h"
48#endif 49#endif
49#if !defined(_KERNEL) && !defined(_STANDALONE) 50#if !defined(_KERNEL) && !defined(_STANDALONE)
50#include <stdbool.h> 51#include <stdbool.h>
51#endif 52#endif
52 53
53#include <machine/endian.h> 54#include <machine/endian.h>
54 55
55#include <sys/types.h> 56#include <sys/types.h>
56#include <sys/stdarg.h> 57#include <sys/stdarg.h>
57 58
58#include <sys/device_if.h> 59#include <sys/device_if.h>
@@ -309,94 +310,122 @@ void kleak_fill_stack(void); @@ -309,94 +310,122 @@ void kleak_fill_stack(void);
309typedef int (*copyin_t)(const void *, void *, size_t); 310typedef int (*copyin_t)(const void *, void *, size_t);
310typedef int (*copyout_t)(const void *, void *, size_t); 311typedef int (*copyout_t)(const void *, void *, size_t);
311#endif 312#endif
312 313
313int copyin_proc(struct proc *, const void *, void *, size_t); 314int copyin_proc(struct proc *, const void *, void *, size_t);
314int copyout_proc(struct proc *, const void *, void *, size_t); 315int copyout_proc(struct proc *, const void *, void *, size_t);
315int copyin_pid(pid_t, const void *, void *, size_t); 316int copyin_pid(pid_t, const void *, void *, size_t);
316int copyin_vmspace(struct vmspace *, const void *, void *, size_t); 317int copyin_vmspace(struct vmspace *, const void *, void *, size_t);
317int copyout_vmspace(struct vmspace *, const void *, void *, size_t); 318int copyout_vmspace(struct vmspace *, const void *, void *, size_t);
318 319
319int ioctl_copyin(int ioctlflags, const void *src, void *dst, size_t len); 320int ioctl_copyin(int ioctlflags, const void *src, void *dst, size_t len);
320int ioctl_copyout(int ioctlflags, const void *src, void *dst, size_t len); 321int ioctl_copyout(int ioctlflags, const void *src, void *dst, size_t len);
321 322
322int ucas_32(volatile uint32_t *uaddr, uint32_t old, uint32_t new, 323int ucas_32(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
323 uint32_t *ret); 
324#ifdef _LP64 324#ifdef _LP64
325int ucas_64(volatile uint64_t *uaddr, uint64_t old, uint64_t new, 325int ucas_64(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
326 uint64_t *ret); 326#endif
327#endif /* _LP64 */ 
328 
329int ucas_ptr(volatile void *, void *, void *, void *); 327int ucas_ptr(volatile void *, void *, void *, void *);
330int ucas_int(volatile unsigned int *, unsigned int, unsigned int, 328int ucas_int(volatile unsigned int *, unsigned int, unsigned int,
331 unsigned int *); 329 unsigned int *);
 330int ufetch_8(const uint8_t *, uint8_t *);
 331int ufetch_16(const uint16_t *, uint16_t *);
 332int ufetch_32(const uint32_t *, uint32_t *);
 333#ifdef _LP64
 334int ufetch_64(const uint64_t *, uint64_t *);
 335#endif
 336int ufetch_char(const unsigned char *, unsigned char *);
 337int ufetch_short(const unsigned short *, unsigned short *);
 338int ufetch_int(const unsigned int *, unsigned int *);
 339int ufetch_long(const unsigned long *, unsigned long *);
 340int ufetch_ptr(const void **, void **);
 341int ustore_8(uint8_t *, uint8_t);
 342int ustore_16(uint16_t *, uint16_t);
 343int ustore_32(uint32_t *, uint32_t);
 344#ifdef _LP64
 345int ustore_64(uint64_t *, uint64_t);
 346#endif
 347int ustore_char(unsigned char *, unsigned char);
 348int ustore_short(unsigned short *, unsigned short);
 349int ustore_int(unsigned int *, unsigned int);
 350int ustore_long(unsigned long *, unsigned long);
 351int ustore_ptr(void **, void *);
332 352
333#ifdef __UCAS_PRIVATE 353#ifdef __UCAS_PRIVATE
334int _ucas_32(volatile uint32_t *uaddr, uint32_t old, uint32_t new, 354
335 uint32_t *ret); 355#if defined(KASAN)
 356int kasan__ucas_32(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
336#ifdef __HAVE_UCAS_MP 357#ifdef __HAVE_UCAS_MP
337int _ucas_32_mp(volatile uint32_t *uaddr, uint32_t old, uint32_t new, 358int kasan__ucas_32_mp(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
338 uint32_t *ret); 
339#endif /* __HAVE_UCAS_MP */ 359#endif /* __HAVE_UCAS_MP */
340#ifdef _LP64 360#ifdef _LP64
341int _ucas_64(volatile uint64_t *uaddr, uint64_t old, uint64_t new, 361int kasan__ucas_64(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
342 uint64_t *ret); 
343#ifdef __HAVE_UCAS_MP 362#ifdef __HAVE_UCAS_MP
344int _ucas_64_mp(volatile uint64_t *uaddr, uint64_t old, uint64_t new, 363int kasan__ucas_64_mp(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
345 uint64_t *ret); 
346#endif /* __HAVE_UCAS_MP */ 364#endif /* __HAVE_UCAS_MP */
347#endif /* _LP64 */ 365#endif /* _LP64 */
 366#define _ucas_32 kasan__ucas_32
 367#define _ucas_32_mp kasan__ucas_32_mp
 368#define _ucas_64 kasan__ucas_64
 369#define _ucas_64_mp kasan__ucas_64_mp
 370#else
 371int _ucas_32(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
 372#ifdef __HAVE_UCAS_MP
 373int _ucas_32_mp(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
 374#endif /* __HAVE_UCAS_MP */
 375#ifdef _LP64
 376int _ucas_64(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
 377#ifdef __HAVE_UCAS_MP
 378int _ucas_64_mp(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
 379#endif /* __HAVE_UCAS_MP */
 380#endif /* _LP64 */
 381#endif
 382
348#endif /* __UCAS_PRIVATE */ 383#endif /* __UCAS_PRIVATE */
349 384
350int ufetch_8(const uint8_t *uaddr, uint8_t *valp); 385#ifdef __UFETCHSTORE_PRIVATE
351int ufetch_16(const uint16_t *uaddr, uint16_t *valp); 386
352int ufetch_32(const uint32_t *uaddr, uint32_t *valp); 387#if defined(KASAN)
 388int kasan__ufetch_8(const uint8_t *, uint8_t *);
 389int kasan__ufetch_16(const uint16_t *, uint16_t *);
 390int kasan__ufetch_32(const uint32_t *, uint32_t *);
353#ifdef _LP64 391#ifdef _LP64
354int ufetch_64(const uint64_t *uaddr, uint64_t *valp); 392int kasan__ufetch_64(const uint64_t *, uint64_t *);
355#endif 393#endif
356 394int _ustore_8(uint8_t *, uint8_t);
357int ufetch_char(const unsigned char *uaddr, unsigned char *valp); 395int _ustore_16(uint16_t *, uint16_t);
358int ufetch_short(const unsigned short *uaddr, unsigned short *valp); 396int _ustore_32(uint32_t *, uint32_t);
359int ufetch_int(const unsigned int *uaddr, unsigned int *valp); 
360int ufetch_long(const unsigned long *uaddr, unsigned long *valp); 
361int ufetch_ptr(const void **uaddr, void **valp); 
362 
363int ustore_8(uint8_t *uaddr, uint8_t val); 
364int ustore_16(uint16_t *uaddr, uint16_t val); 
365int ustore_32(uint32_t *uaddr, uint32_t val); 
366#ifdef _LP64 397#ifdef _LP64
367int ustore_64(uint64_t *uaddr, uint64_t val); 398int _ustore_64(uint64_t *, uint64_t);
368#endif 399#endif
369 400#define _ufetch_8 kasan__ufetch_8
370int ustore_char(unsigned char *uaddr, unsigned char val); 401#define _ufetch_16 kasan__ufetch_16
371int ustore_short(unsigned short *uaddr, unsigned short val); 402#define _ufetch_32 kasan__ufetch_32
372int ustore_int(unsigned int *uaddr, unsigned int val); 403#define _ufetch_64 kasan__ufetch_64
373int ustore_long(unsigned long *uaddr, unsigned long val); 404#else
374int ustore_ptr(void **uaddr, void *val); 405int _ufetch_8(const uint8_t *, uint8_t *);
375 406int _ufetch_16(const uint16_t *, uint16_t *);
376#ifdef __UFETCHSTORE_PRIVATE 407int _ufetch_32(const uint32_t *, uint32_t *);
377int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); 
378int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); 
379int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); 
380#ifdef _LP64 408#ifdef _LP64
381int _ufetch_64(const uint64_t *uaddr, uint64_t *valp); 409int _ufetch_64(const uint64_t *, uint64_t *);
382#endif 410#endif
383 411int _ustore_8(uint8_t *, uint8_t);
384int _ustore_8(uint8_t *uaddr, uint8_t val); 412int _ustore_16(uint16_t *, uint16_t);
385int _ustore_16(uint16_t *uaddr, uint16_t val); 413int _ustore_32(uint32_t *, uint32_t);
386int _ustore_32(uint32_t *uaddr, uint32_t val); 
387#ifdef _LP64 414#ifdef _LP64
388int _ustore_64(uint64_t *uaddr, uint64_t val); 415int _ustore_64(uint64_t *, uint64_t);
 416#endif
389#endif 417#endif
 418
390#endif /* __UFETCHSTORE_PRIVATE */ 419#endif /* __UFETCHSTORE_PRIVATE */
391 420
392void hardclock(struct clockframe *); 421void hardclock(struct clockframe *);
393void softclock(void *); 422void softclock(void *);
394void statclock(struct clockframe *); 423void statclock(struct clockframe *);
395 424
396#ifdef NTP 425#ifdef NTP
397void ntp_init(void); 426void ntp_init(void);
398#ifdef PPS_SYNC 427#ifdef PPS_SYNC
399struct timespec; 428struct timespec;
400void hardpps(struct timespec *, long); 429void hardpps(struct timespec *, long);
401#endif /* PPS_SYNC */ 430#endif /* PPS_SYNC */
402#else 431#else