From patchwork Thu Apr 18 02:13:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 237391 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B0F1E2C017F for ; Thu, 18 Apr 2013 12:14:37 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D0C934A2A6; Thu, 18 Apr 2013 04:14:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WrxPjrEdFoej; Thu, 18 Apr 2013 04:14:35 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E2124A2BE; Thu, 18 Apr 2013 04:14:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 670334A2BE for ; Thu, 18 Apr 2013 04:14:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wFnIEBA0Fl1c for ; Thu, 18 Apr 2013 04:14:31 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ye0-f201.google.com (mail-ye0-f201.google.com [209.85.213.201]) by theia.denx.de (Postfix) with ESMTPS id 9D67C4A2A6 for ; Thu, 18 Apr 2013 04:14:28 +0200 (CEST) Received: by mail-ye0-f201.google.com with SMTP id m2so235965yen.4 for ; Wed, 17 Apr 2013 19:14:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=pEnb7ufoSh0ngx/FugvovMdnZ5ScAkoTUE75THxcBHE=; b=OcigHI2UdCwqP01zkVbtiVT5/UVcPz1WD5RhuXljblW9Q8X4kxmsD5MqQ6uUqlT1CU 4ddvhr3ci214dkNludJzOG/KWrc/FOJG+ymOaQPf94f+3ZcRKHH/pe0mY+bAzM2NwWNa 9wbHNgdppcXGpWF7jSh8M1midciC2fnvyOg3tNIJBvoCDdMv5Z4WR4Y/rNQzVIZvuC/Y 3+f6s6ihWnfUR9snwwhffwNsex9p4D8aiEk6L9RTzQIUzOWPD8zVGeHyWIU6kKQZERnw OalIiU8BgmKV71ir0udona/E8oVjpRChkjUiD/nRHpxnylpQK0bJUwQSeQGSzCO6GuKx FyRA== X-Received: by 10.236.79.106 with SMTP id h70mr4548975yhe.38.1366251267606; Wed, 17 Apr 2013 19:14:27 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id g7si2109251yhf.0.2013.04.17.19.14.27 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 17 Apr 2013 19:14:27 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 3F75E32B08D; Wed, 17 Apr 2013 19:14:11 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id D947616088E; Wed, 17 Apr 2013 19:14:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 17 Apr 2013 19:13:38 -0700 Message-Id: <1366251228-19884-10-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1366251228-19884-1-git-send-email-sjg@chromium.org> References: <1366251228-19884-1-git-send-email-sjg@chromium.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkIbgENElr3fh8mp+KEzsDA3aakY9qdIN3NB/hmpqgY9o9tOvb2up254RGcVDNlwz6klpXIGlmB355HU9/+nqeNLoMnuK1R3vFfJFAyzjwGx4E9rVYsrVuwb/C7219LKJhRtcex1t6B8I0pIYVWj8hINzGYWeXODzCEG48p1b2WgavpZm10nFkRdIo69gF69XOlvflw Cc: Graeme Russ , u-boot-review@google.com Subject: [U-Boot] [PATCH 09/19] x86: Remove ISR timer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This is no longer used since we prefer the more accurate TSC timer, so remove the dead code. Signed-off-by: Simon Glass Acked-by: Graeme Russ --- arch/x86/lib/Makefile | 1 - arch/x86/lib/timer.c | 118 -------------------------------------------------- 2 files changed, 119 deletions(-) delete mode 100644 arch/x86/lib/timer.c diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 0bc8c2f..c614479 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -36,7 +36,6 @@ COBJS-$(CONFIG_PCI) += pci_type1.o COBJS-y += relocate.o COBJS-y += physmem.o COBJS-y += string.o -COBJS-$(CONFIG_SYS_X86_ISR_TIMER) += timer.o COBJS-$(CONFIG_SYS_X86_TSC_TIMER) += tsc_timer.o COBJS-$(CONFIG_VIDEO_VGA) += video.o COBJS-$(CONFIG_CMD_ZBOOT) += zimage.o diff --git a/arch/x86/lib/timer.c b/arch/x86/lib/timer.c deleted file mode 100644 index fb11bfe..0000000 --- a/arch/x86/lib/timer.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * (C) Copyright 2008,2009 - * Graeme Russ, - * - * (C) Copyright 2002 - * Daniel Engström, Omicron Ceti AB, - * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - */ - -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -struct timer_isr_function { - struct timer_isr_function *next; - timer_fnc_t *isr_func; -}; - -static struct timer_isr_function *first_timer_isr; -static unsigned long system_ticks; - -/* - * register_timer_isr() allows multiple architecture and board specific - * functions to be called every millisecond. Keep the execution time of - * each function as low as possible - */ -int register_timer_isr(timer_fnc_t *isr_func) -{ - struct timer_isr_function *new_func; - struct timer_isr_function *temp; - int flag; - - new_func = malloc(sizeof(struct timer_isr_function)); - - if (new_func == NULL) - return 1; - - new_func->isr_func = isr_func; - new_func->next = NULL; - - /* - * Don't allow timer interrupts while the - * linked list is being modified - */ - flag = disable_interrupts(); - - if (first_timer_isr == NULL) { - first_timer_isr = new_func; - } else { - temp = first_timer_isr; - while (temp->next != NULL) - temp = temp->next; - temp->next = new_func; - } - - if (flag) - enable_interrupts(); - - return 0; -} - -/* - * timer_isr() MUST be the registered interrupt handler for - */ -void timer_isr(void *unused) -{ - struct timer_isr_function *temp = first_timer_isr; - - system_ticks++; - - /* Execute each registered function */ - while (temp != NULL) { - temp->isr_func(); - temp = temp->next; - } -} - -ulong get_timer(ulong base) -{ - return system_ticks - base; -} - -void timer_set_tsc_base(uint64_t new_base) -{ - gd->arch.tsc_base = new_base; -} - -uint64_t timer_get_tsc(void) -{ - uint64_t time_now; - - time_now = rdtsc(); - if (!gd->arch.tsc_base) - gd->arch.tsc_base = time_now; - - return time_now - gd->arch.tsc_base; -}