From patchwork Tue Apr 21 04:21:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 462978 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 B5875140142 for ; Tue, 21 Apr 2015 14:21:59 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=l/YIQuK7; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C44B1A7440; Tue, 21 Apr 2015 06:21:57 +0200 (CEST) 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 ci-8c22DCx33; Tue, 21 Apr 2015 06:21:57 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1FF48A7423; Tue, 21 Apr 2015 06:21:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4272FA7423 for ; Tue, 21 Apr 2015 06:21:54 +0200 (CEST) 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 ClTt5Y-N6fBu for ; Tue, 21 Apr 2015 06:21:54 +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-qk0-f176.google.com (mail-qk0-f176.google.com [209.85.220.176]) by theia.denx.de (Postfix) with ESMTPS id AB387A7422 for ; Tue, 21 Apr 2015 06:21:49 +0200 (CEST) Received: by qkhg7 with SMTP id g7so203751796qkh.2 for ; Mon, 20 Apr 2015 21:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:mime-version:content-type; bh=siNWNJ8ZzJodph/XNFtPhcCBdl8hFwvYLgkIqu5Z31I=; b=l/YIQuK7QERL8krVp62fdjWlYkQ/tJfN3FeRu4dSYdK6riFq7f6078PJb1dvcdaPfg rYmbfVip6gB7sm7d+15+yyGH5GV4CLxpop/klblo3D9+Skxn3UG42kvWvdabIxALFcN6 EWLW3LedO8iNvA42VfLQmHB+rE8SL7KMJy/jY+u06UsORarVNYu9oFiEBXpMLPEs6e5A Dj8XpzWcP+LvX6HvzK9ZN7KwLEz8TKghjLXt4eJskuGeOBwMwQ8kFK4Yu8oIilNuXbsr UJ45+I1MW1nCWseobvU4BrokXjthL5DQee13fHnSAhCjRNxolCul9wC8hNch4aLWUiGZ O+lg== X-Received: by 10.140.237.72 with SMTP id i69mr21202596qhc.35.1429590108506; Mon, 20 Apr 2015 21:21:48 -0700 (PDT) Received: from mail.hotmail.com (blu004-wss1s4.hotmail.com. [134.170.2.219]) by mx.google.com with ESMTPSA id q34sm603403qkq.4.2015.04.20.21.21.47 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Apr 2015 21:21:48 -0700 (PDT) Received: from BLU436-SMTP255 ([134.170.2.215]) by BLU004-WSS1S4.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 20 Apr 2015 21:21:47 -0700 X-TMN: [00xHPjz4focnH8q4r3FyBsB88XRbvJXo] Message-ID: From: Bin Meng To: Simon Glass , U-Boot Mailing List Date: Tue, 21 Apr 2015 12:21:35 +0800 X-Mailer: git-send-email 1.8.2.1 X-OriginalArrivalTime: 21 Apr 2015 04:21:45.0708 (UTC) FILETIME=[AD7EDAC0:01D07BEA] MIME-Version: 1.0 Subject: [U-Boot] [PATCH 1/2] x86: Clean up arch/x86/include/asm/e820.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" There are lots of unused codes defined in e820.h, clean it up. Signed-off-by: Bin Meng Acked-by: Simon Glass --- arch/x86/include/asm/e820.h | 133 +------------------------------------------- 1 file changed, 2 insertions(+), 131 deletions(-) diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h index d155ce9..21bc633 100644 --- a/arch/x86/include/asm/e820.h +++ b/arch/x86/include/asm/e820.h @@ -1,43 +1,7 @@ #ifndef _ASM_X86_E820_H #define _ASM_X86_E820_H -#define E820MAP 0x2d0 /* our map */ -#define E820MAX 128 /* number of entries in E820MAP */ -/* - * Legacy E820 BIOS limits us to 128 (E820MAX) nodes due to the - * constrained space in the zeropage. If we have more nodes than - * that, and if we've booted off EFI firmware, then the EFI tables - * passed us from the EFI firmware can list more nodes. Size our - * internal memory map tables to have room for these additional - * nodes, based on up to three entries per node for which the - * kernel was built: MAX_NUMNODES == (1 << CONFIG_NODES_SHIFT), - * plus E820MAX, allowing space for the possible duplicate E820 - * entries that might need room in the same arrays, prior to the - * call to sanitize_e820_map() to remove duplicates. The allowance - * of three memory map entries per node is "enough" entries for - * the initial hardware platform motivating this mechanism to make - * use of additional EFI map entries. Future platforms may want - * to allow more than three entries per node or otherwise refine - * this size. - */ - -/* - * Odd: 'make headers_check' complains about numa.h if I try - * to collapse the next two #ifdef lines to a single line: - * #if defined(__KERNEL__) && defined(CONFIG_EFI) - */ -#ifdef __KERNEL__ -#ifdef CONFIG_EFI -#include -#define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES) -#else /* ! CONFIG_EFI */ -#define E820_X_MAX E820MAX -#endif -#else /* ! __KERNEL__ */ -#define E820_X_MAX E820MAX -#endif - -#define E820NR 0x1e8 /* # entries in E820MAP */ +#define E820MAX 128 /* number of entries in E820MAP */ #define E820_RAM 1 #define E820_RESERVED 2 @@ -45,111 +9,18 @@ #define E820_NVS 4 #define E820_UNUSABLE 5 -/* reserved RAM used by kernel itself */ -#define E820_RESERVED_KERN 128 - #ifndef __ASSEMBLY__ #include + struct e820entry { __u64 addr; /* start of memory segment */ __u64 size; /* size of memory segment */ __u32 type; /* type of memory segment */ } __attribute__((packed)); -struct e820map { - __u32 nr_map; - struct e820entry map[E820_X_MAX]; -}; - #define ISA_START_ADDRESS 0xa0000 #define ISA_END_ADDRESS 0x100000 -#define BIOS_BEGIN 0x000a0000 -#define BIOS_END 0x00100000 - -#ifdef __KERNEL__ -/* see comment in arch/x86/kernel/e820.c */ -extern struct e820map e820; -extern struct e820map e820_saved; - -extern unsigned long pci_mem_start; -extern int e820_any_mapped(u64 start, u64 end, unsigned type); -extern int e820_all_mapped(u64 start, u64 end, unsigned type); -extern void e820_add_region(u64 start, u64 size, int type); -extern void e820_print_map(char *who); -extern int -sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map); -extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, - unsigned new_type); -extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, - int checktype); -extern void update_e820(void); -extern void e820_setup_gap(void); -extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize, - unsigned long start_addr, unsigned long long end_addr); -struct setup_data; -extern void parse_e820_ext(struct setup_data *data, unsigned long pa_data); - -#if defined(CONFIG_X86_64) || \ - (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION)) -extern void e820_mark_nosave_regions(unsigned long limit_pfn); -#else -static inline void e820_mark_nosave_regions(unsigned long limit_pfn) -{ -} -#endif - -#ifdef CONFIG_MEMTEST -extern void early_memtest(unsigned long start, unsigned long end); -#else -static inline void early_memtest(unsigned long start, unsigned long end) -{ -} -#endif - -extern unsigned long end_user_pfn; - -extern u64 find_e820_area(u64 start, u64 end, u64 size, u64 align); -extern u64 find_e820_area_size(u64 start, u64 *sizep, u64 align); -extern void reserve_early(u64 start, u64 end, char *name); -extern void reserve_early_overlap_ok(u64 start, u64 end, char *name); -extern void free_early(u64 start, u64 end); -extern void early_res_to_bootmem(u64 start, u64 end); -extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align); - -extern unsigned long e820_end_of_ram_pfn(void); -extern unsigned long e820_end_of_low_ram_pfn(void); -extern int e820_find_active_region(const struct e820entry *ei, - unsigned long start_pfn, - unsigned long last_pfn, - unsigned long *ei_startpfn, - unsigned long *ei_endpfn); -extern void e820_register_active_regions(int nid, unsigned long start_pfn, - unsigned long end_pfn); -extern u64 e820_hole_size(u64 start, u64 end); -extern void finish_e820_parsing(void); -extern void e820_reserve_resources(void); -extern void e820_reserve_resources_late(void); -extern void setup_memory_map(void); -extern char *default_machine_specific_memory_setup(void); - -/* - * Returns true iff the specified range [s,e) is completely contained inside - * the ISA region. - */ -/* -static inline bool is_ISA_range(u64 s, u64 e) -{ - return s >= ISA_START_ADDRESS && e <= ISA_END_ADDRESS; -} -*/ -#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ -#ifdef __KERNEL__ -/* #include */ - -#define HIGH_MEMORY (1024*1024) -#endif /* __KERNEL__ */ - #endif /* _ASM_X86_E820_H */