Deleted Added
full compact
counter.h (252434) counter.h (302372)
1/*-
2 * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/amd64/include/counter.h 252434 2013-07-01 02:48:27Z kib $
26 * $FreeBSD: head/sys/amd64/include/counter.h 302372 2016-07-06 14:09:49Z nwhitehorn $
27 */
28
29#ifndef __MACHINE_COUNTER_H__
30#define __MACHINE_COUNTER_H__
31
32#include <sys/pcpu.h>
33
34extern struct pcpu __pcpu[1];

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

46
47static inline uint64_t
48counter_u64_fetch_inline(uint64_t *p)
49{
50 uint64_t r;
51 int i;
52
53 r = 0;
27 */
28
29#ifndef __MACHINE_COUNTER_H__
30#define __MACHINE_COUNTER_H__
31
32#include <sys/pcpu.h>
33
34extern struct pcpu __pcpu[1];

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

46
47static inline uint64_t
48counter_u64_fetch_inline(uint64_t *p)
49{
50 uint64_t r;
51 int i;
52
53 r = 0;
54 for (i = 0; i < mp_ncpus; i++)
54 CPU_FOREACH(i)
55 r += counter_u64_read_one((uint64_t *)p, i);
56
57 return (r);
58}
59
60static void
61counter_u64_zero_one_cpu(void *arg)
62{

--- 27 unchanged lines hidden ---
55 r += counter_u64_read_one((uint64_t *)p, i);
56
57 return (r);
58}
59
60static void
61counter_u64_zero_one_cpu(void *arg)
62{

--- 27 unchanged lines hidden ---