Thu Mar 20 20:45:32 2014 UTC ()
make pmc compile with amd64


(christos)
diff -r1.1 -r1.2 src/sys/arch/amd64/include/pmc.h
diff -r1.43 -r1.44 src/sys/arch/amd64/include/types.h

cvs diff -r1.1 -r1.2 src/sys/arch/amd64/include/Attic/pmc.h (expand / switch to unified diff)

--- src/sys/arch/amd64/include/Attic/pmc.h 2003/04/26 18:39:46 1.1
+++ src/sys/arch/amd64/include/Attic/pmc.h 2014/03/20 20:45:32 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pmc.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */ 1/* $NetBSD: pmc.h,v 1.2 2014/03/20 20:45:32 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 Zembu Labs, Inc. 4 * Copyright (c) 2000 Zembu Labs, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Jason R. Thorpe <thorpej@zembu.com> 7 * Author: Jason R. Thorpe <thorpej@zembu.com>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -24,20 +24,48 @@ @@ -24,20 +24,48 @@
24 * THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS 24 * THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS
25 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR- 25 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR-
26 * RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- 26 * RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS-
27 * CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35 35
36#ifdef _KERNEL 36#ifdef _KERNEL
 37/*
 38 * LEGACY PMC support
 39 */
 40struct x86_64_pmc_info_args;
37int pmc_info(struct proc *, struct x86_64_pmc_info_args *, 41int pmc_info(struct proc *, struct x86_64_pmc_info_args *,
38 register_t *); 42 register_t *);
 43struct x86_64_pmc_startstop_args;
39int pmc_startstop(struct proc *, struct x86_64_pmc_startstop_args *, 44int pmc_startstop(struct proc *, struct x86_64_pmc_startstop_args *,
40 register_t *); 45 register_t *);
 46struct x86_64_pmc_read_args;
41int pmc_read(struct proc *, struct x86_64_pmc_read_args *, 47int pmc_read(struct proc *, struct x86_64_pmc_read_args *,
42 register_t *); 48 register_t *);
 49/* END LEGACY PMC SUPPORT */
 50
 51#define pmc_md_fork(p1,p2)
 52#define pmc_get_num_counters() (0)
 53#define pmc_get_counter_type(c) (0)
 54#define pmc_save_context(p)
 55#define pmc_restore_context(p)
 56#define pmc_enable_counter(p,c)
 57#define pmc_disable_counter(p,c)
 58#define pmc_accumulate(p1,p2)
 59#define pmc_process_exit(p1)
 60#define pmc_counter_isconfigured(p,c) (0)
 61#define pmc_counter_isrunning(p,c) (0)
 62#define pmc_start_profiling(c,f) (0)
 63#define pmc_stop_profiling(c) (0)
 64#define pmc_alloc_kernel_counter(c,f) (0)
 65#define pmc_free_kernel_counter(c) (0)
 66#define pmc_configure_counter(p,c,f) (0)
 67#define pmc_get_counter_value(p,c,f,pv) (0)
 68
 69#define PMC_ENABLED(p) (0)
 70
43#endif 71#endif

cvs diff -r1.43 -r1.44 src/sys/arch/amd64/include/types.h (expand / switch to unified diff)

--- src/sys/arch/amd64/include/types.h 2013/12/01 01:05:16 1.43
+++ src/sys/arch/amd64/include/types.h 2014/03/20 20:45:32 1.44
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: types.h,v 1.43 2013/12/01 01:05:16 christos Exp $ */ 1/* $NetBSD: types.h,v 1.44 2014/03/20 20:45:32 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990 The Regents of the University of California. 4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -50,26 +50,28 @@ typedef struct label_t { @@ -50,26 +50,28 @@ typedef struct label_t {
50#if defined(_NETBSD_SOURCE) 50#if defined(_NETBSD_SOURCE)
51typedef unsigned long paddr_t; 51typedef unsigned long paddr_t;
52typedef unsigned long psize_t; 52typedef unsigned long psize_t;
53typedef unsigned long vaddr_t; 53typedef unsigned long vaddr_t;
54typedef unsigned long vsize_t; 54typedef unsigned long vsize_t;
55#define PRIxPADDR "lx" 55#define PRIxPADDR "lx"
56#define PRIxPSIZE "lx" 56#define PRIxPSIZE "lx"
57#define PRIuPSIZE "lu" 57#define PRIuPSIZE "lu"
58#define PRIxVADDR "lx" 58#define PRIxVADDR "lx"
59#define PRIxVSIZE "lx" 59#define PRIxVSIZE "lx"
60#define PRIuVSIZE "lu" 60#define PRIuVSIZE "lu"
61#endif 61#endif
62 62
 63typedef int pmc_evid_t;
 64typedef __uint64_t pmc_ctr_t;
63typedef long int register_t; 65typedef long int register_t;
64typedef int register32_t; 66typedef int register32_t;
65#define PRIxREGISTER "lx" 67#define PRIxREGISTER "lx"
66#define PRIxREGISTER32 "x" 68#define PRIxREGISTER32 "x"
67 69
68typedef volatile unsigned char __cpu_simple_lock_t; 70typedef volatile unsigned char __cpu_simple_lock_t;
69 71
70/* __cpu_simple_lock_t used to be a full word. */ 72/* __cpu_simple_lock_t used to be a full word. */
71#define __CPU_SIMPLE_LOCK_PAD 73#define __CPU_SIMPLE_LOCK_PAD
72 74
73#define __SIMPLELOCK_LOCKED 1 75#define __SIMPLELOCK_LOCKED 1
74#define __SIMPLELOCK_UNLOCKED 0 76#define __SIMPLELOCK_UNLOCKED 0
75 77