From owner-svn-src-user@FreeBSD.ORG Fri Oct 2 11:46:01 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D3B51065692; Fri, 2 Oct 2009 11:46:01 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C6558FC29; Fri, 2 Oct 2009 11:46:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n92Bk15S000178; Fri, 2 Oct 2009 11:46:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n92Bk1XP000173; Fri, 2 Oct 2009 11:46:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910021146.n92Bk1XP000173@svn.freebsd.org> From: Rui Paulo Date: Fri, 2 Oct 2009 11:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197708 - in user/rpaulo/armpmc: arm/include dev/hwpmc X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2009 11:46:01 -0000 Author: rpaulo Date: Fri Oct 2 11:46:01 2009 New Revision: 197708 URL: http://svn.freebsd.org/changeset/base/197708 Log: Build fixes. Modified: user/rpaulo/armpmc/arm/include/pmc_mdep.h user/rpaulo/armpmc/dev/hwpmc/hwpmc_arm.c user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.c user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.h Modified: user/rpaulo/armpmc/arm/include/pmc_mdep.h ============================================================================== --- user/rpaulo/armpmc/arm/include/pmc_mdep.h Fri Oct 2 11:17:51 2009 (r197707) +++ user/rpaulo/armpmc/arm/include/pmc_mdep.h Fri Oct 2 11:46:01 2009 (r197708) @@ -1,5 +1,27 @@ /*- - * This file is in the public domain. + * Copyright (c) 2009 Rui Paulo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ @@ -7,6 +29,13 @@ #ifndef _MACHINE_PMC_MDEP_H_ #define _MACHINE_PMC_MDEP_H_ +/* + * On the ARM platform we support the following PMCs. + * + * XSCALE Intel XScale processors + */ +#include + union pmc_md_op_pmcallocate { uint64_t __pad[4]; }; Modified: user/rpaulo/armpmc/dev/hwpmc/hwpmc_arm.c ============================================================================== --- user/rpaulo/armpmc/dev/hwpmc/hwpmc_arm.c Fri Oct 2 11:17:51 2009 (r197707) +++ user/rpaulo/armpmc/dev/hwpmc/hwpmc_arm.c Fri Oct 2 11:46:01 2009 (r197708) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include struct pmc_mdep * pmc_md_initialize() @@ -46,7 +48,7 @@ void pmc_md_finalize(struct pmc_mdep *md) { if (cpu_class == CPU_CLASS_XSCALE) - return pmc_xscale_finalize(); + pmc_xscale_finalize(md); else KASSERT(0, ("[arm,%d] Unknown CPU Class 0x%x", __LINE__, cpu_class)); Modified: user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.c ============================================================================== --- user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.c Fri Oct 2 11:17:51 2009 (r197707) +++ user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.c Fri Oct 2 11:46:01 2009 (r197708) @@ -80,11 +80,37 @@ xscale_describe(int cpu, int ri, struct struct pmc_mdep * pmc_xscale_initialize() { - return NULL; + struct pmc_mdep *pmc_mdep; + + pmc_mdep = malloc(sizeof(struct pmc_mdep) + sizeof(struct pmc_classdep), + M_PMC, M_WAITOK|M_ZERO); + pmc_mdep->pmd_cputype = PMC_CPU_INTEL_XSCALE; + pmc_mdep->pmd_nclass = 1; + + pcd = &pmc_mdep->pmd_classdep[0]; + pcd->pcd_caps = XSCALE_PMC_CAPS; + pcd->pcd_num = XSCALE_NPMCS; + pcd->pcd_ri = pmc_mdep->pmd_npmc; + pcd->pcd_width = 48; /* XXX */ + + pcd->pcd_allocate_pmc = xscale_allocate_pmc; + pcd->pcd_config_pmc = xscale_config_pmc; + pcd->pcd_describe = xscale_describe; + pcd->pcd_get_config = xscale_get_config; + pcd->pcd_read_pmc = xscale_read_pmc; + pcd->pcd_release_pmc = xscale_release_pmc; + pcd->pcd_start_pmc = xscale_start_pmc; + pcd->pcd_stop_pmc = xscale_stop_pmc; + pcd->pcd_write_pmc = xscale_write_pmc; + + pmc_mdep->pmd_intr = xscale_intr; + pmc_mdep->pmd_switch_in = xscale_switch_in; + pmc_mdep->pmd_switch_out = xscale_switch_out; + + return (pmc_mdep); } void pmc_xscale_finalize(struct pmc_mdep *md) { - (void) md; } Modified: user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.h ============================================================================== --- user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.h Fri Oct 2 11:17:51 2009 (r197707) +++ user/rpaulo/armpmc/dev/hwpmc/hwpmc_xscale.h Fri Oct 2 11:46:01 2009 (r197708) @@ -37,5 +37,9 @@ PMC_CAP_WRITE | PMC_CAP_INVERT | \ PMC_CAP_QUALIFIER) - +#ifdef _KERNEL +/* MD extension for 'struct pmc' */ +struct pmc_md_xscale_pmc { +}; +#endif /* _KERNEL */ #endif /* _DEV_HWPMC_XSCALE_H_ */