cpufunc.h (908e277230ef1a80589f85687f5b422b0e863e79) cpufunc.h (652ae7b11485d9f991ea66a56aa79d4dd9cd1103)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2003 Peter Wemm.
5 * Copyright (c) 1993 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 342 unchanged lines hidden (view full) ---

351{
352 uint32_t low, high;
353
354 __asm __volatile("rdtsc" : "=a" (low), "=d" (high));
355 return (low | ((uint64_t)high << 32));
356}
357
358static __inline uint64_t
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2003 Peter Wemm.
5 * Copyright (c) 1993 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 342 unchanged lines hidden (view full) ---

351{
352 uint32_t low, high;
353
354 __asm __volatile("rdtsc" : "=a" (low), "=d" (high));
355 return (low | ((uint64_t)high << 32));
356}
357
358static __inline uint64_t
359rdtsc_ordered_lfence(void)
360{
361 lfence();
362 return (rdtsc());
363}
364
365static __inline uint64_t
366rdtsc_ordered_mfence(void)
367{
368 mfence();
369 return (rdtsc());
370}
371
372static __inline uint64_t
359rdtscp(void)
360{
361 uint32_t low, high;
362
363 __asm __volatile("rdtscp" : "=a" (low), "=d" (high) : : "ecx");
364 return (low | ((uint64_t)high << 32));
365}
366

--- 661 unchanged lines hidden ---
373rdtscp(void)
374{
375 uint32_t low, high;
376
377 __asm __volatile("rdtscp" : "=a" (low), "=d" (high) : : "ecx");
378 return (low | ((uint64_t)high << 32));
379}
380

--- 661 unchanged lines hidden ---