/* * 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Copyright (C) IBM Corp. 2005 * * Authors: Hollis Blanchard */ #ifndef _ASM_FLUSHTLB_H_ #define _ASM_FLUSHTLB_H_ #include #include #include /* The current time as shown by the virtual TLB clock. */ extern u32 tlbflush_clock; #define tlbflush_current_time() tlbflush_clock /* Time at which each CPU's TLB was last flushed. */ DECLARE_PER_CPU(u32, tlbflush_time); static inline int NEED_FLUSH(u32 cpu_stamp, u32 lastuse_stamp) { return 0; } /* * Filter the given set of CPUs, removing those that definitely flushed their * TLB since @page_timestamp. */ #define tlbflush_filter(mask, page_timestamp) \ do { \ unsigned int cpu; \ for_each_cpu_mask ( cpu, mask ) \ if ( !NEED_FLUSH(per_cpu(tlbflush_time, cpu), page_timestamp) ) \ cpu_clear(cpu, mask); \ } while ( 0 ) static inline void tlbiel(unsigned long eaddr) { #if 0 asm volatile("tlbiel %0" : : "r"(eaddr) : "memory"); #else asm volatile(".long 0x7c000224 | (%0 << 11)" : : "r"(eaddr) : "memory"); #endif } /* Lots of paranoia in flush_tlb_*; could probably be relaxed later. */ static inline void local_flush_tlb_one(unsigned long eaddr) { asm volatile("ptesync" : : : "memory"); tlbiel(eaddr); asm volatile("eieio; tlbsync" : : : "memory"); } static inline void local_flush_tlb(void) { ulong rb; int i; asm volatile("ptesync" : : : "memory"); for (i = 0; i < 256; i++) { rb = i; rb <<= 12; tlbiel(rb); } asm volatile("eieio": : : "memory"); } #ifndef CONFIG_SMP #define flush_tlb_mask(_mask) local_flush_tlb() #define flush_tlb_one_mask(_mask,_addr) local_flush_tlb_one(_addr) #else extern void __flush_tlb_mask(cpumask_t mask, unsigned long addr); #define FLUSH_ALL_ADDRS (~0UL) #define flush_tlb_mask(_mask) __flush_tlb_mask(_mask,FLUSH_ALL_ADDRS) #define flush_tlb_one_mask(_mask,_addr) __flush_tlb_mask(_mask,_addr) #endif /* CONFIG_SMP */ /* * Filter the given set of CPUs, returning only those that may not have * flushed their TLBs since @page_timestamp. */ static inline unsigned long tlbflush_filter_cpuset( unsigned long cpuset, u32 page_timestamp) { return 0; } #endif enwrt/upstream/tree/tools/patch-image?id=986af9e64ebdfd2fc6edaece79f14bc3e0b04b95'>patch-image/Makefile
blob: 6f2900b96ce06e9cc46125c4304a820a04a4d540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# 
# Copyright (C) 2007-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

PKG_NAME:=patch-image

include $(INCLUDE_DIR)/host-build.mk

define Host/Compile
	$(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/patch-cmdline src/patch-cmdline.c
	$(HOSTCC) $(HOST_CFLAGS) -include endian.h -o $(HOST_BUILD_DIR)/patch-dtb src/patch-dtb.c
endef

define Host/Install
	$(CP) $(HOST_BUILD_DIR)/patch-cmdline $(STAGING_DIR_HOST)/bin/
	$(CP) $(HOST_BUILD_DIR)/patch-dtb $(STAGING_DIR_HOST)/bin/
endef

define Host/Clean
	rm -f $(STAGING_DIR_HOST)/bin/patch-cmdline
	rm -f $(STAGING_DIR_HOST)/bin/patch-dtb
endef

$(eval $(call HostBuild))