Get rid of the pmap7 header now that we merged it into the pmap one.

--- arch/arm/include/pmap7.h
+++ arch/arm/include/pmap7.h
@@ -1,716 +0,0 @@
-/*	$OpenBSD: pmap7.h,v 1.2 2013/05/09 20:07:26 patrick Exp $	*/
-/*	$NetBSD: pmap.h,v 1.76 2003/09/06 09:10:46 rearnsha Exp $	*/
-
-/*
- * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Jason R. Thorpe & Steve C. Woodford for Wasabi Systems, Inc.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed for the NetBSD Project by
- *	Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- *    or promote products derived from this software without specific prior
- *    written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
- * 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.
- */
-
-/*
- * Copyright (c) 1994,1995 Mark Brinicombe.
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by Mark Brinicombe
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * 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.
- */
-
-#ifndef	_ARM_PMAP_H_
-#define	_ARM_PMAP_H_
-
-#ifdef _KERNEL
-
-#include <arm/cpuconf.h>
-#include <arm/pte.h>
-#ifndef _LOCORE
-#include <arm/cpufunc.h>
-#endif
-
-/*
- * a pmap describes a processes' 4GB virtual address space.  this
- * virtual address space can be broken up into 4096 1MB regions which
- * are described by L1 PTEs in the L1 table.
- *
- * There is a line drawn at KERNEL_BASE.  Everything below that line
- * changes when the VM context is switched.  Everything above that line
- * is the same no matter which VM context is running.  This is achieved
- * by making the L1 PTEs for those slots above KERNEL_BASE reference
- * kernel L2 tables.
- *
- * The basic layout of the virtual address space thus looks like this:
- *
- *	0xffffffff
- *	.
- *	.
- *	.
- *	KERNEL_BASE
- *	--------------------
- *	.
- *	.
- *	.
- *	0x00000000
- */
-
-/*
- * The number of L2 descriptor tables which can be tracked by an l2_dtable.
- * A bucket size of 16 provides for 16MB of contiguous virtual address
- * space per l2_dtable. Most processes will, therefore, require only two or
- * three of these to map their whole working set.
- */
-#define	L2_BUCKET_LOG2	4
-#define	L2_BUCKET_SIZE	(1 << L2_BUCKET_LOG2)
-
-/*
- * Given the above "L2-descriptors-per-l2_dtable" constant, the number
- * of l2_dtable structures required to track all possible page descriptors
- * mappable by an L1 translation table is given by the following constants:
- */
-#define	L2_LOG2		((32 - L1_S_SHIFT) - L2_BUCKET_LOG2)
-#define	L2_SIZE		(1 << L2_LOG2)
-
-#ifndef _LOCORE
-
-struct l1_ttable;
-struct l2_dtable;
-
-/*
- * Track cache/tlb occupancy using the following structure
- */
-union pmap_cache_state {
-	struct {
-		union {
-			u_int8_t csu_cache_b[2];
-			u_int16_t csu_cache;
-		} cs_cache_u;
-
-		union {
-			u_int8_t csu_tlb_b[2];
-			u_int16_t csu_tlb;
-		} cs_tlb_u;
-	} cs_s;
-	u_int32_t cs_all;
-};
-#define	cs_cache_id	cs_s.cs_cache_u.csu_cache_b[0]
-#define	cs_cache_d	cs_s.cs_cache_u.csu_cache_b[1]
-#define	cs_cache	cs_s.cs_cache_u.csu_cache
-#define	cs_tlb_id	cs_s.cs_tlb_u.csu_tlb_b[0]
-#define	cs_tlb_d	cs_s.cs_tlb_u.csu_tlb_b[1]
-#define	cs_tlb		cs_s.cs_tlb_u.csu_tlb
-
-/*
- * Assigned to cs_all to force cacheops to work for a particular pmap
- */
-#define	PMAP_CACHE_STATE_ALL	0xffffffffu
-
-/*
- * This structure is used by machine-dependent code to describe
- * static mappings of devices, created at bootstrap time.
- */
-struct pmap_devmap {
-	vaddr_t		pd_va;		/* virtual address */
-	paddr_t		pd_pa;		/* physical address */
-	psize_t		pd_size;	/* size of region */
-	vm_prot_t	pd_prot;	/* protection code */
-	int		pd_cache;	/* cache attributes */
-};
-
-/*
- * The pmap structure itself
- */
-struct pmap {
-	u_int8_t		pm_domain;
-	boolean_t		pm_remove_all;
-	struct l1_ttable	*pm_l1;
-	union pmap_cache_state	pm_cstate;
-	u_int			pm_refs;
-	simple_lock_data_t	pm_lock;
-	struct l2_dtable	*pm_l2[L2_SIZE];
-	struct pmap_statistics	pm_stats;
-};
-
-typedef struct pmap *pmap_t;
-
-/*
- * Physical / virtual address structure. In a number of places (particularly
- * during bootstrapping) we need to keep track of the physical and virtual
- * addresses of various pages
- */
-typedef struct pv_addr {
-	SLIST_ENTRY(pv_addr) pv_list;
-	paddr_t pv_pa;
-	vaddr_t pv_va;
-} pv_addr_t;
-
-/*
- * Determine various modes for PTEs (user vs. kernel, cacheable
- * vs. non-cacheable).
- */
-#define	PTE_KERNEL	0
-#define	PTE_USER	1
-#define	PTE_NOCACHE	0
-#define	PTE_CACHE	1
-#define	PTE_PAGETABLE	2
-
-/*
- * Flags that indicate attributes of pages or mappings of pages.
- *
- * The PVF_MOD and PVF_REF flags are stored in the mdpage for each
- * page.  PVF_WIRED, PVF_WRITE, and PVF_NC are kept in individual
- * pv_entry's for each page.  They live in the same "namespace" so
- * that we can clear multiple attributes at a time.
- *
- * Note the "non-cacheable" flag generally means the page has
- * multiple mappings in a given address space.
- */
-#define	PVF_MOD		0x01		/* page is modified */
-#define	PVF_REF		0x02		/* page is referenced */
-#define	PVF_WIRED	0x04		/* mapping is wired */
-#define	PVF_WRITE	0x08		/* mapping is writable */
-#define	PVF_EXEC	0x10		/* mapping is executable */
-#define	PVF_UNC		0x20		/* mapping is 'user' non-cacheable */
-#define	PVF_KNC		0x40		/* mapping is 'kernel' non-cacheable */
-#define	PVF_NC		(PVF_UNC|PVF_KNC)
-
-/*
- * Commonly referenced structures
- */
-extern struct pmap	kernel_pmap_store;
-extern int		pmap_debug_level; /* Only exists if PMAP_DEBUG */
-
-/*
- * Macros that we need to export
- */
-#define pmap_kernel()			(&kernel_pmap_store)
-#define	pmap_resident_count(pmap)	((pmap)->pm_stats.resident_count)
-#define	pmap_wired_count(pmap)		((pmap)->pm_stats.wired_count)
-
-#define	pmap_is_modified(pg)	\
-	(((pg)->mdpage.pvh_attrs & PVF_MOD) != 0)
-#define	pmap_is_referenced(pg)	\
-	(((pg)->mdpage.pvh_attrs & PVF_REF) != 0)
-
-#define	pmap_deactivate(p)		do { /* nothing */ } while (0)
-#define	pmap_copy(dp, sp, da, l, sa)	do { /* nothing */ } while (0)
-
-#define pmap_unuse_final(p)		do { /* nothing */ } while (0)
-#define	pmap_remove_holes(map)		do { /* nothing */ } while (0)
-
-/*
- * Functions that we need to export
- */
-void	pmap_remove_all(pmap_t);
-void	pmap_uncache_page(paddr_t, vaddr_t);
-
-#define PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
-
-/* Functions we use internally. */
-void	pmap_bootstrap(pd_entry_t *, vaddr_t, vaddr_t);
-
-int	pmap_fault_fixup(pmap_t, vaddr_t, vm_prot_t, int);
-boolean_t pmap_get_pde_pte(pmap_t, vaddr_t, pd_entry_t **, pt_entry_t **);
-boolean_t pmap_get_pde(pmap_t, vaddr_t, pd_entry_t **);
-void	pmap_set_pcb_pagedir(pmap_t, struct pcb *);
-
-void	pmap_debug(int);
-void	pmap_postinit(void);
-
-void	vector_page_setprot(int);
-
-/* XXX */
-void pmap_kenter_cache(vaddr_t va, paddr_t pa, vm_prot_t prot, int cacheable);
-
-const struct pmap_devmap *pmap_devmap_find_pa(paddr_t, psize_t);
-const struct pmap_devmap *pmap_devmap_find_va(vaddr_t, vsize_t);
-
-/* Bootstrapping routines. */
-void	pmap_map_section(vaddr_t, vaddr_t, paddr_t, int, int);
-void	pmap_map_entry(vaddr_t, vaddr_t, paddr_t, int, int);
-vsize_t	pmap_map_chunk(vaddr_t, vaddr_t, paddr_t, vsize_t, int, int);
-void	pmap_link_l2pt(vaddr_t, vaddr_t, pv_addr_t *);
-void	pmap_devmap_bootstrap(vaddr_t, const struct pmap_devmap *);
-void	pmap_devmap_register(const struct pmap_devmap *);
-
-/*
- * Special page zero routine for use by the idle loop (no cache cleans).
- */
-boolean_t	pmap_pageidlezero(struct vm_page *);
-#define PMAP_PAGEIDLEZERO(pg)	pmap_pageidlezero((pg))
-
-/*
- * The current top of kernel VM
- */
-extern vaddr_t	pmap_curmaxkvaddr;
-
-/*
- * Useful macros and constants
- */
-
-/* Virtual address to page table entry */
-static __inline pt_entry_t *
-vtopte(vaddr_t va)
-{
-	pd_entry_t *pdep;
-	pt_entry_t *ptep;
-
-	if (pmap_get_pde_pte(pmap_kernel(), va, &pdep, &ptep) == FALSE)
-		return (NULL);
-	return (ptep);
-}
-
-/*
- * The new pmap ensures that page-tables are always mapping Write-Thru.
- * Thus, on some platforms we can run fast and loose and avoid syncing PTEs
- * on every change.
- *
- * Unfortunately, not all CPUs have a write-through cache mode.  So we
- * define PMAP_NEEDS_PTE_SYNC for C code to conditionally do PTE syncs,
- * and if there is the chance for PTE syncs to be needed, we define
- * PMAP_INCLUDE_PTE_SYNC so e.g. assembly code can include (and run)
- * the code.
- */
-extern int pmap_needs_pte_sync;
-
-#define	PMAP_NEEDS_PTE_SYNC	pmap_needs_pte_sync
-#define	PMAP_INCLUDE_PTE_SYNC
-
-#define	PTE_SYNC(pte)							\
-do {									\
-	if (PMAP_NEEDS_PTE_SYNC) {					\
-		paddr_t pa;						\
-		cpu_drain_writebuf();					\
-		cpu_dcache_wb_range((vaddr_t)(pte), sizeof(pt_entry_t));\
-		if (cpu_sdcache_enabled()) { 				\
-		(void)pmap_extract(pmap_kernel(), (vaddr_t)(pte), &pa);	\
-		cpu_sdcache_wb_range((vaddr_t)(pte), (paddr_t)(pa),	\
-		    sizeof(pt_entry_t));				\
-		};							\
-		cpu_drain_writebuf();					\
-	}								\
-} while (/*CONSTCOND*/0)
-
-#define	PTE_SYNC_RANGE(pte, cnt)					\
-do {									\
-	if (PMAP_NEEDS_PTE_SYNC) {					\
-		paddr_t pa;						\
-		cpu_drain_writebuf();					\
-		cpu_dcache_wb_range((vaddr_t)(pte),			\
-		    (cnt) << 2); /* * sizeof(pt_entry_t) */		\
-		if (cpu_sdcache_enabled()) { 				\
-		(void)pmap_extract(pmap_kernel(), (vaddr_t)(pte), &pa);\
-		cpu_sdcache_wb_range((vaddr_t)(pte), (paddr_t)(pa),	\
-		    (cnt) << 2); /* * sizeof(pt_entry_t) */		\
-		};							\
-		cpu_drain_writebuf();					\
-	}								\
-} while (/*CONSTCOND*/0)
-
-#define	l1pte_valid(pde)	(((pde) & L1_TYPE_MASK) != L1_TYPE_INV)
-#define	l1pte_section_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_S)
-#define	l1pte_page_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_C)
-#define	l1pte_fpage_p(pde)	(((pde) & L1_TYPE_MASK) == L1_TYPE_F)
-
-#define l2pte_index(v)		(((v) & L2_ADDR_BITS) >> L2_S_SHIFT)
-#define	l2pte_valid(pte)	(((pte) & L2_TYPE_MASK) != L2_TYPE_INV)
-#define	l2pte_pa(pte)		((pte) & L2_S_FRAME)
-#define l2pte_minidata(pte)	(((pte) & \
-				 (L2_B | L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X)))\
-				 == (L2_C | L2_XSCALE_T_TEX(TEX_XSCALE_X)))
-
-/* L1 and L2 page table macros */
-#define pmap_pde_v(pde)		l1pte_valid(*(pde))
-#define pmap_pde_section(pde)	l1pte_section_p(*(pde))
-#define pmap_pde_page(pde)	l1pte_page_p(*(pde))
-#define pmap_pde_fpage(pde)	l1pte_fpage_p(*(pde))
-
-/* Size of the kernel part of the L1 page table */
-#define KERNEL_PD_SIZE	\
-	(L1_TABLE_SIZE - (KERNEL_BASE >> L1_S_SHIFT) * sizeof(pd_entry_t))
-
-/************************* ARM MMU configuration *****************************/
-
-#if (ARM_MMU_GENERIC + ARM_MMU_SA1 + ARM_MMU_V7) != 0
-void	pmap_copy_page_generic(struct vm_page *, struct vm_page *);
-void	pmap_zero_page_generic(struct vm_page *);
-
-void	pmap_pte_init_generic(void);
-#if defined(CPU_ARM8)
-void	pmap_pte_init_arm8(void);
-#endif
-#if defined(CPU_ARM9)
-void	pmap_pte_init_arm9(void);
-#endif /* CPU_ARM9 */
-#if defined(CPU_ARM10)
-void	pmap_pte_init_arm10(void);
-#endif /* CPU_ARM10 */
-#if defined(CPU_ARM11)
-void	pmap_pte_init_arm11(void);
-#endif /* CPU_ARM11 */
-#if defined(CPU_ARMv7)
-void	pmap_pte_init_armv7(void);
-#endif /* CPU_ARMv7 */
-#endif /* (ARM_MMU_GENERIC + ARM_MMU_SA1 + ARM_MMU_V7) != 0 */
-
-#if ARM_MMU_SA1 == 1
-void	pmap_pte_init_sa1(void);
-#endif /* ARM_MMU_SA1 == 1 */
-
-#if ARM_MMU_V7 == 1
-void	pmap_pte_init_v7(void);
-#endif /* ARM_MMU_V7 == 1 */
-
-#if ARM_MMU_XSCALE == 1
-void	pmap_copy_page_xscale(struct vm_page *, struct vm_page *);
-void	pmap_zero_page_xscale(struct vm_page *);
-
-void	pmap_pte_init_xscale(void);
-
-void	xscale_setup_minidata(vaddr_t, vaddr_t, paddr_t);
-
-#define	PMAP_UAREA(va)		pmap_uarea(va)
-void	pmap_uarea(vaddr_t);
-#endif /* ARM_MMU_XSCALE == 1 */
-
-extern pt_entry_t		pte_l1_s_cache_mode;
-extern pt_entry_t		pte_l1_s_cache_mask;
-
-extern pt_entry_t		pte_l2_l_cache_mode;
-extern pt_entry_t		pte_l2_l_cache_mask;
-
-extern pt_entry_t		pte_l2_s_cache_mode;
-extern pt_entry_t		pte_l2_s_cache_mask;
-
-extern pt_entry_t		pte_l1_s_cache_mode_pt;
-extern pt_entry_t		pte_l2_l_cache_mode_pt;
-extern pt_entry_t		pte_l2_s_cache_mode_pt;
-
-extern pt_entry_t		pte_l1_s_coherent;
-extern pt_entry_t		pte_l2_l_coherent;
-extern pt_entry_t		pte_l2_s_coherent;
-
-extern pt_entry_t		pte_l2_s_prot_ur;
-extern pt_entry_t		pte_l2_s_prot_uw;
-extern pt_entry_t		pte_l2_s_prot_kr;
-extern pt_entry_t		pte_l2_s_prot_kw;
-extern pt_entry_t		pte_l2_s_prot_mask;
-
-extern pt_entry_t		pte_l1_s_proto;
-extern pt_entry_t		pte_l1_c_proto;
-extern pt_entry_t		pte_l2_s_proto;
-
-extern void (*pmap_copy_page_func)(struct vm_page *, struct vm_page *);
-extern void (*pmap_zero_page_func)(struct vm_page *);
-
-#endif /* !_LOCORE */
-
-/*****************************************************************************/
-
-/*
- * Definitions for MMU domains
- */
-#define	PMAP_DOMAINS		15	/* 15 'user' domains (0-14) */
-#define	PMAP_DOMAIN_KERNEL	15	/* The kernel uses domain #15 */
-#define	PMAP_DOMAIN_USER_V7	0	/* V7 Userland uses a single domain */
-
-/*
- * These macros define the various bit masks in the PTE.
- *
- * We use these macros since we use different bits on different processor
- * models.
- */
-#define	L1_S_PROT_U		(L1_S_AP(AP_U))
-#define	L1_S_PROT_W		(L1_S_AP(AP_W))
-#define	L1_S_PROT_MASK		(L1_S_PROT_U|L1_S_PROT_W)
-
-#define	L1_S_CACHE_MASK_generic	(L1_S_B|L1_S_C)
-#define	L1_S_CACHE_MASK_xscale	(L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X))
-#define	L1_S_CACHE_MASK_v7	(L1_S_B|L1_S_C|L1_S_V7_TEX_MASK)
-
-#define	L1_S_COHERENT_generic	(L1_S_B|L1_S_C)
-#define	L1_S_COHERENT_xscale	(L1_S_B|L1_S_C|L1_S_XSCALE_TEX(TEX_XSCALE_X))
-#define	L1_S_COHERENT_v7	(L1_S_C|L1_S_V7_TEX_MASK)
-
-#define	L2_L_PROT_KR		(L2_AP(0))
-#define	L2_L_PROT_UR		(L2_AP(AP_U))
-#define	L2_L_PROT_KW		(L2_AP(AP_W))
-#define	L2_L_PROT_UW		(L2_AP(AP_U|AP_W))
-#define	L2_L_PROT_MASK		(L2_AP(AP_U|AP_W))
-
-#define	L2_L_CACHE_MASK_generic	(L2_B|L2_C)
-#define	L2_L_CACHE_MASK_xscale	(L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X))
-#define	L2_L_CACHE_MASK_v7	(L2_B|L2_C|L2_V7_L_TEX_MASK)
-
-#define	L2_L_COHERENT_generic	(L2_B|L2_C)
-#define	L2_L_COHERENT_xscale	(L2_B|L2_C|L2_XSCALE_L_TEX(TEX_XSCALE_X))
-#define	L2_L_COHERENT_v7	(L2_C|L2_V7_L_TEX_MASK)
-
-#define	L2_S_PROT_UR_generic	(L2_AP(AP_U))
-#define	L2_S_PROT_UW_generic	(L2_AP(AP_U|AP_W))
-#define	L2_S_PROT_KR_generic	(L2_AP(0))
-#define	L2_S_PROT_KW_generic	(L2_AP(AP_W))
-#define	L2_S_PROT_MASK_generic	(L2_AP(AP_U|AP_W))
-
-#define	L2_S_PROT_UR_xscale	(L2_AP0(AP_U))
-#define	L2_S_PROT_UW_xscale	(L2_AP0(AP_U|AP_W))
-#define	L2_S_PROT_KR_xscale	(L2_AP0(0))
-#define	L2_S_PROT_KW_xscale	(L2_AP0(AP_W))
-#define	L2_S_PROT_MASK_xscale	(L2_AP0(AP_U|AP_W))
-
-#define	L2_S_PROT_UR_v7		(L2_V7_AP(AP_KRWUR))
-#define	L2_S_PROT_UW_v7		(L2_V7_AP(AP_KRWURW))
-#define	L2_S_PROT_KR_v7		(L2_V7_AP(AP_V7_KR))
-#define	L2_S_PROT_KW_v7		(L2_V7_AP(AP_KRW))
-#define	L2_S_PROT_MASK_v7	(L2_V7_AP(0x07) | L2_V7_S_XN)
-
-#define	L2_S_CACHE_MASK_generic	(L2_B|L2_C)
-#define	L2_S_CACHE_MASK_xscale	(L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X))
-#define	L2_S_CACHE_MASK_v7	(L2_B|L2_C|L2_V7_S_TEX_MASK)
-
-#define	L2_S_COHERENT_generic	(L2_B|L2_C)
-#define	L2_S_COHERENT_xscale	(L2_B|L2_C|L2_XSCALE_T_TEX(TEX_XSCALE_X))
-#define	L2_S_COHERENT_v7	(L2_C|L2_V7_S_TEX_MASK)
-
-#define	L1_S_PROTO_generic	(L1_TYPE_S | L1_S_IMP)
-#define	L1_S_PROTO_xscale	(L1_TYPE_S)
-#define	L1_S_PROTO_v7		(L1_TYPE_S)
-
-#define	L1_C_PROTO_generic	(L1_TYPE_C | L1_C_IMP2)
-#define	L1_C_PROTO_xscale	(L1_TYPE_C)
-#define	L1_C_PROTO_v7		(L1_TYPE_C)
-
-#define	L2_L_PROTO		(L2_TYPE_L)
-
-#define	L2_S_PROTO_generic	(L2_TYPE_S)
-#define	L2_S_PROTO_xscale	(L2_TYPE_XSCALE_XS)
-#define	L2_S_PROTO_v7		(L2_TYPE_S)
-
-/*
- * User-visible names for the ones that vary with MMU class.
- */
-
-#if ARM_NMMUS > 1
-/* More than one MMU class configured; use variables. */
-#define	L2_S_PROT_UR		pte_l2_s_prot_ur
-#define	L2_S_PROT_UW		pte_l2_s_prot_uw
-#define	L2_S_PROT_KR		pte_l2_s_prot_kr
-#define	L2_S_PROT_KW		pte_l2_s_prot_kw
-#define	L2_S_PROT_MASK		pte_l2_s_prot_mask
-
-#define	L1_S_CACHE_MASK		pte_l1_s_cache_mask
-#define	L2_L_CACHE_MASK		pte_l2_l_cache_mask
-#define	L2_S_CACHE_MASK		pte_l2_s_cache_mask
-
-#define	L1_S_COHERENT		pte_l1_s_coherent
-#define	L2_L_COHERENT		pte_l2_l_coherent
-#define	L2_S_COHERENT		pte_l2_s_coherent
-
-#define	L1_S_PROTO		pte_l1_s_proto
-#define	L1_C_PROTO		pte_l1_c_proto
-#define	L2_S_PROTO		pte_l2_s_proto
-
-#define	pmap_copy_page(s, d)	(*pmap_copy_page_func)((s), (d))
-#define	pmap_zero_page(d)	(*pmap_zero_page_func)((d))
-#elif (ARM_MMU_GENERIC + ARM_MMU_SA1) != 0
-#define	L2_S_PROT_UR		L2_S_PROT_UR_generic
-#define	L2_S_PROT_UW		L2_S_PROT_UW_generic
-#define	L2_S_PROT_KR		L2_S_PROT_KR_generic
-#define	L2_S_PROT_KW		L2_S_PROT_KW_generic
-#define	L2_S_PROT_MASK		L2_S_PROT_MASK_generic
-
-#define	L1_S_CACHE_MASK		L1_S_CACHE_MASK_generic
-#define	L2_L_CACHE_MASK		L2_L_CACHE_MASK_generic
-#define	L2_S_CACHE_MASK		L2_S_CACHE_MASK_generic
-
-#define	L1_S_COHERENT		L1_S_COHERENT_generic
-#define	L2_L_COHERENT		L2_L_COHERENT_generic
-#define	L2_S_COHERENT		L2_S_COHERENT_generic
-
-#define	L1_S_PROTO		L1_S_PROTO_generic
-#define	L1_C_PROTO		L1_C_PROTO_generic
-#define	L2_S_PROTO		L2_S_PROTO_generic
-
-#define	pmap_copy_page(s, d)	pmap_copy_page_generic((s), (d))
-#define	pmap_zero_page(d)	pmap_zero_page_generic((d))
-#elif ARM_MMU_XSCALE == 1
-#define	L2_S_PROT_UR		L2_S_PROT_UR_xscale
-#define	L2_S_PROT_UW		L2_S_PROT_UW_xscale
-#define	L2_S_PROT_KR		L2_S_PROT_KR_xscale
-#define	L2_S_PROT_KW		L2_S_PROT_KW_xscale
-#define	L2_S_PROT_MASK		L2_S_PROT_MASK_xscale
-
-#define	L1_S_CACHE_MASK		L1_S_CACHE_MASK_xscale
-#define	L2_L_CACHE_MASK		L2_L_CACHE_MASK_xscale
-#define	L2_S_CACHE_MASK		L2_S_CACHE_MASK_xscale
-
-#define	L1_S_COHERENT		L1_S_COHERENT_xscale
-#define	L2_L_COHERENT		L2_L_COHERENT_xscale
-#define	L2_S_COHERENT		L2_S_COHERENT_xscale
-
-#define	L1_S_PROTO		L1_S_PROTO_xscale
-#define	L1_C_PROTO		L1_C_PROTO_xscale
-#define	L2_S_PROTO		L2_S_PROTO_xscale
-
-#define	pmap_copy_page(s, d)	pmap_copy_page_xscale((s), (d))
-#define	pmap_zero_page(d)	pmap_zero_page_xscale((d))
-#elif ARM_MMU_V7 == 1
-#define	L2_S_PROT_UR		L2_S_PROT_UR_v7
-#define	L2_S_PROT_UW		L2_S_PROT_UW_v7
-#define	L2_S_PROT_KR		L2_S_PROT_KR_v7
-#define	L2_S_PROT_KW		L2_S_PROT_KW_v7
-#define	L2_S_PROT_MASK		L2_S_PROT_MASK_v7
-
-#define	L1_S_CACHE_MASK		L1_S_CACHE_MASK_v7
-#define	L2_L_CACHE_MASK		L2_L_CACHE_MASK_v7
-#define	L2_S_CACHE_MASK		L2_S_CACHE_MASK_v7
-
-#define	L1_S_COHERENT		L1_S_COHERENT_v7
-#define	L2_L_COHERENT		L2_L_COHERENT_v7
-#define	L2_S_COHERENT		L2_S_COHERENT_v7
-
-#define	L1_S_PROTO		L1_S_PROTO_v7
-#define	L1_C_PROTO		L1_C_PROTO_v7
-#define	L2_S_PROTO		L2_S_PROTO_v7
-
-#define	pmap_copy_page(s, d)	pmap_copy_page_v7((s), (d))
-#define	pmap_zero_page(d)	pmap_zero_page_v7((d))
-#endif /* ARM_NMMUS > 1 */
-
-/*
- * These macros return various bits based on kernel/user and protection.
- * Note that the compiler will usually fold these at compile time.
- */
-#define	L1_S_PROT(ku, pr)	((((ku) == PTE_USER) ? L1_S_PROT_U : 0) | \
-				 (((pr) & VM_PROT_WRITE) ? L1_S_PROT_W : 0))
-
-#ifndef _LOCORE
-static __inline pt_entry_t
-L2_L_PROT(int ku, vm_prot_t pr)
-{
-	pt_entry_t pte;
-
-	if (ku == PTE_USER)
-		pte = (pr & VM_PROT_WRITE) ? L2_L_PROT_UW : L2_L_PROT_UR;
-	else
-		pte = (pr & VM_PROT_WRITE) ? L2_L_PROT_KW : L2_L_PROT_KR;
-	/*
-	 * If we set the XN bit, the abort handlers or the vector page
-	 * might be marked as such. Needs Debugging.
-	 */
-	/*
-	if ((pr & VM_PROT_EXECUTE) == 0)
-		pte |= L2_V7_L_XN;
-	*/
-
-	return pte;
-}
-static __inline pt_entry_t
-L2_S_PROT(int ku, vm_prot_t pr)
-{
-	pt_entry_t pte;
-
-	if (ku == PTE_USER)
-		pte = (pr & VM_PROT_WRITE) ? L2_S_PROT_UW : L2_S_PROT_UR;
-	else
-		pte =(pr & VM_PROT_WRITE) ? L2_S_PROT_KW : L2_S_PROT_KR;
-	/*
-	 * If we set the XN bit, the abort handlers or the vector page
-	 * might be marked as such. Needs Debugging.
-	 */
-	/*
-	if ((pr & VM_PROT_EXECUTE) == 0)
-		pte |= L2_V7_S_XN;
-	*/
-
-	return pte;
-}
-
-static __inline boolean_t
-l2pte_is_writeable(pt_entry_t pte, struct pmap *pm)
-{
-	/* XXX use of L2_V7_S_XN */
-	return (pte & L2_S_PROT_MASK & ~L2_V7_S_XN) ==
-	    L2_S_PROT(pm == pmap_kernel() ? PTE_KERNEL : PTE_USER,
-	              VM_PROT_WRITE);
-}
-#endif
-
-/*
- * Macros to test if a mapping is mappable with an L1 Section mapping
- * or an L2 Large Page mapping.
- */
-#define	L1_S_MAPPABLE_P(va, pa, size)					\
-	((((va) | (pa)) & L1_S_OFFSET) == 0 && (size) >= L1_S_SIZE)
-
-#define	L2_L_MAPPABLE_P(va, pa, size)					\
-	((((va) | (pa)) & L2_L_OFFSET) == 0 && (size) >= L2_L_SIZE)
-
-#ifndef _LOCORE
-/* pmap_prefer bits for VIPT ARMv7 */
-#define PMAP_PREFER(fo, ap)	pmap_prefer((fo), (ap))
-vaddr_t	pmap_prefer(vaddr_t, vaddr_t);
-
-extern uint32_t pmap_alias_dist;
-extern uint32_t pmap_alias_bits;
-
-/* pmap prefer alias alignment. */
-#define PMAP_PREFER_ALIGN()	(pmap_alias_dist)
-/* pmap prefer offset withing alignment. */
-#define PMAP_PREFER_OFFSET(of)						\
-    (PMAP_PREFER_ALIGN() == 0 ? 0 : ((of) & (PMAP_PREFER_ALIGN() - 1)))
-
-
-#endif /* _LOCORE */
-
-#endif /* _KERNEL */
-
-#endif	/* _ARM_PMAP_H_ */


ARM: 6190/1: Remove dummy loads from the original relocation address

Reading back the upper and lower values in the R_ARM_THM_CALL and
R_ARM_THM_JUMP24 case was introduced by a previous commit but they are
not needed.

Signed-off-by: Catalin Marinas <15ce75b290ebaf27c3f9fd73ab848685ed3d8261@arm.com>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>


ARM: imx: provide gpt device specific irq functions

It splits irq enable/disable/acknowledge operations into device specific
functions as the hooks in imx_gpt_data, so that we can save the use of
timer_is_xxx() and cpu_is_xxx() checking in these irq functions.

Signed-off-by: Shawn Guo <912cf7eb7d8018e2943586ae6657d21fd4e38239@linaro.org>


[ARM] 3123/1: Sharp SL-6000x: Add IRDA, MMC, UDC and keyboard device

Patch from Dirk Opfer

This patch adds MMC, IRDA and UDC support to the Sharp SL-6000x device. Also it adds a platform device for the keyboard driver.

Signed-off-by: Dirk Opfer
Signed-off-by: Richard Purdie <a03894c799ea916bd571ce8f12ed88f6fb3400f7@rpsys.net>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/mach-pxa/tosa.c
+++ arch/arm/mach-pxa/tosa.c
@@ -111,16 +111,128 @@
 },
 };

+/*
+ * USB Device Controller
+ */
+static void tosa_udc_command(int cmd)
+{
+	switch(cmd)	{
+		case PXA2XX_UDC_CMD_CONNECT:
+			set_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
+			break;
+		case PXA2XX_UDC_CMD_DISCONNECT:
+			reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
+			break;
+	}
+}
+
+static int tosa_udc_is_connected(void)
+{
+	return ((GPLR(TOSA_GPIO_USB_IN) & GPIO_bit(TOSA_GPIO_USB_IN)) == 0);
+}
+
+
+static struct pxa2xx_udc_mach_info udc_info __initdata = {
+	.udc_command		= tosa_udc_command,
+	.udc_is_connected	= tosa_udc_is_connected,
+};
+
+/*
+ * MMC/SD Device
+ */
+static struct pxamci_platform_data tosa_mci_platform_data;
+
+static int tosa_mci_init(struct device *dev, irqreturn_t (*tosa_detect_int)(int, void *, struct pt_regs *), void *data)
+{
+	int err;
+
+	/* setup GPIO for PXA25x MMC controller */
+	pxa_gpio_mode(GPIO6_MMCCLK_MD);
+	pxa_gpio_mode(GPIO8_MMCCS0_MD);
+	pxa_gpio_mode(TOSA_GPIO_nSD_DETECT | GPIO_IN);
+
+	tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
+
+	err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, SA_INTERRUPT,
+				"MMC/SD card detect", data);
+	if (err) {
+		printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
+		return -1;
+	}
+
+	set_irq_type(TOSA_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
+
+	return 0;
+}
+
+static void tosa_mci_setpower(struct device *dev, unsigned int vdd)
+{
+	struct pxamci_platform_data* p_d = dev->platform_data;
+
+	if (( 1 << vdd) & p_d->ocr_mask) {
+		set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
+	} else {
+		reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON);
+	}
+}
+
+static int tosa_mci_get_ro(struct device *dev)
+{
+	return (read_scoop_reg(&tosascoop_device.dev, SCOOP_GPWR)&TOSA_SCOOP_SD_WP);
+}
+
+static void tosa_mci_exit(struct device *dev, void *data)
+{
+	free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
+}
+
+static struct pxamci_platform_data tosa_mci_platform_data = {
+	.ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
+	.init           = tosa_mci_init,
+	.get_ro		= tosa_mci_get_ro,
+	.setpower       = tosa_mci_setpower,
+	.exit           = tosa_mci_exit,
+};
+
+/*
+ * Irda
+ */
+static void tosa_irda_transceiver_mode(struct device *dev, int mode)
+{
+	if (mode & IR_OFF) {
+		reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
+		pxa_gpio_mode(GPIO47_STTXD|GPIO_DFLT_LOW);
+		pxa_gpio_mode(GPIO47_STTXD|GPIO_OUT);
+	} else {
+		pxa_gpio_mode(GPIO47_STTXD_MD);
+		set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN);
+	}
+}
+
+static struct pxaficp_platform_data tosa_ficp_platform_data = {
+	.transceiver_cap  = IR_SIRMODE | IR_OFF,
+	.transceiver_mode = tosa_irda_transceiver_mode,
+};
+
+/*
+ * Tosa Keyboard
+ */
+static struct platform_device tosakbd_device = {
+	.name		= "tosa-keyboard",
+	.id		= -1,
+};

 static struct platform_device *devices[] __initdata = {
 	&tosascoop_device,
 	&tosascoop_jc_device,
+	&tosakbd_device,
 };

 static void __init tosa_init(void)
 {
 	pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
 	pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
+	pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN);

 	/* setup sleep mode values */
 	PWER  = 0x00000002;
@@ -131,9 +243,12 @@
 	PGSR2 = 0x00014000;
 	PCFR |= PCFR_OPDE;

-	// enable batt_fault
+	/* enable batt_fault */
 	PMCR = 0x01;

+	pxa_set_mci_info(&tosa_mci_platform_data);
+	pxa_set_udc_info(&udc_info);
+	pxa_set_ficp_info(&tosa_ficp_platform_data);
 	platform_add_devices(devices, ARRAY_SIZE(devices));

 	scoop_num = 2;


ARM: l2c: add warnings for stuff modifying aux_ctrl register values

Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>


ARM: 7400/1: vfp: clear fpscr length and stride bits on entry to sig handler

The ARM PCS mandates that the length and stride bits of the fpscr are
cleared on entry to and return from a public interface. Although signal
handlers run asynchronously with respect to the interrupted function,
the handler itself expects to run as though it has been called like a
normal function.

This patch updates the state mirroring the VFP hardware before entry to
a signal handler so that it adheres to the PCS. Furthermore, we disable
VFP to ensure that we trap on any floating point operation performed by
the signal handler and synchronise the hardware appropriately. A check
is inserted after the signal handler to avoid redundant flushing if VFP
was not used.

Reported-by: Peter Maydell <313afa09ce093b19ae1dd74f57c1ebd94508584c@linaro.org>
Signed-off-by: Will Deacon <b913f13ef92ac157955c954ccaaff7be065faba4@arm.com>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/vfp/vfpmodule.c
+++ arch/arm/vfp/vfpmodule.c
@@ -564,6 +564,21 @@

 	if (err)
 		return -EFAULT;
+
+	/* Ensure that VFP is disabled. */
+	vfp_flush_hwstate(thread);
+
+	/*
+	 * As per the PCS, clear the length and stride bits for function
+	 * entry.
+	 */
+	hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK);
+
+	/*
+	 * Disable VFP in the hwstate so that we can detect if it gets
+	 * used.
+	 */
+	hwstate->fpexc &= ~FPEXC_EN;
 	return 0;
 }

@@ -576,7 +591,12 @@
 	unsigned long fpexc;
 	int err = 0;

-	vfp_flush_hwstate(thread);
+	/*
+	 * If VFP has been used, then disable it to avoid corrupting
+	 * the new thread state.
+	 */
+	if (hwstate->fpexc & FPEXC_EN)
+		vfp_flush_hwstate(thread);

 	/*
 	 * Copy the floating point registers. There can be unused


cache_align is not used

cache_align is not used

--- arch/hppa/include/pmap.h
+++ arch/hppa/include/pmap.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: pmap.h,v 1.15 2001/12/04 23:22:42 art Exp $	*/
+/*	$OpenBSD: pmap.h,v 1.16 2002/01/10 01:23:08 mickey Exp $	*/

 /*
  * Copyright (c) 1998,1999 Michael Shalayeff
@@ -150,9 +150,6 @@
 #define KERNEL_DATA_PROT (TLB_AR_KRW | (KERNEL_ACCESS_ID << 1))

 #ifdef _KERNEL
-#define cache_align(x)	(((x) + dcache_line_mask) & ~(dcache_line_mask))
-extern int dcache_line_mask;
-
 extern void gateway_page __P((void));

 #define	PMAP_STEAL_MEMORY	/* we have some memory to steal */


Document a non-obvious aspect of identifycpu() use on i386

--- arch/i386/i386/machdep.c
+++ arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: machdep.c,v 1.565 2015/02/06 05:17:48 mlarkin Exp $	*/
+/*	$OpenBSD: machdep.c,v 1.566 2015/02/07 03:29:27 guenther Exp $	*/
 /*	$NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $	*/

 /*-
@@ -1666,6 +1666,14 @@
  * information; however, the chance of multi-vendor SMP actually
  * ever *working* is sufficiently low that it's probably safe to assume
  * all processors are of the same vendor.
+ *
+ * Note that identifycpu() is called twice for the primary CPU: the first
+ * is very early (right after the "OpenBSD X.Y" line) with the CPUF_PRIMARY
+ * flag *not* set, then again later in the config sequence with CPUF_PRIMARY
+ * set.  Thus, the tests here for ((ci->ci_flags & CPUF_PRIMARY) == 0) are
+ * actually saying "do this on the first call for each CPU".  Don't change
+ * them to use CPU_IS_PRIMARY() because then they would be done on both
+ * calls in the SP build.
  */

 void


ar7: add fixed PHY support for the two on-board cpmac

This patch adds fixed PHY support for the two on-chip
cpmac Ethernet adapters.

Signed-off-by: Florian Fainelli <73262ad0334ab37227b2f7a0205f51db1e606681@openwrt.org>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- arch/mips/ar7/platform.c
+++ arch/mips/ar7/platform.c
@@ -33,6 +33,8 @@
 #include <linux/leds.h>
 #include <linux/string.h>
 #include <linux/etherdevice.h>
+#include <linux/phy.h>
+#include <linux/phy_fixed.h>

 #include <asm/addrspace.h>
 #include <asm/mach-ar7/ar7.h>
@@ -207,6 +209,12 @@

 static struct physmap_flash_data physmap_flash_data = {
 	.width = 2,
+};
+
+static struct fixed_phy_status fixed_phy_status __initdata = {
+	.link = 1,
+	.speed = 100,
+	.duplex = 1,
 };

 static struct plat_cpmac_data cpmac_low_data = {
@@ -530,6 +538,9 @@
 	}

 	if (ar7_has_high_cpmac()) {
+		res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status);
+		if (res && res != -ENODEV)
+			return res;
 		cpmac_get_mac(1, cpmac_high_data.dev_addr);
 		res = platform_device_register(&cpmac_high);
 		if (res)
@@ -538,6 +549,10 @@
 		cpmac_low_data.phy_mask = 0xffffffff;
 	}

+	res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status);
+	if (res && res != -ENODEV)
+		return res;
+
 	cpmac_get_mac(0, cpmac_low_data.dev_addr);
 	res = platform_device_register(&cpmac_low);
 	if (res)


MIPS: AR7: Replace mac address parsing

MIPS: AR7: Replace mac address parsing

Replace sscanf() with mac_pton().

[92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org: Resolved conflict.]

Signed-off-by: Daniel Walter <00834c187f77910918b70534e2fb1dd066a04d4b@google.com>
Cc: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org
Cc: 2578944098299abf708b08eff6fcf60565553586@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7151/
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>


parisc: fix dino/gsc interrupts

parisc: fix dino/gsc interrupts

The essential problem we're currently having is that dino (and gsc) is a
cascaded CPU interrupt.  Under the old __do_IRQ() handler, our CPU
interrupts basically did an ack followed by an end.  In the new scheme,
we replaced them with level handlers which do a mask, an ack and then an
unmask (but no end).  Instead, with the renaming of end to eoi, we
actually want to call the percpu flow handlers, because they actually
have all the characteristics we want.

This patch does the conversion and gets my C360 booting again.

Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>
Signed-off-by: Kyle McMartin <3c25b01657254677d3e1a8fd1f0742c5d489bd39@mcmartin.ca>

--- arch/parisc/kernel/irq.c
+++ arch/parisc/kernel/irq.c
@@ -392,7 +392,7 @@
 	int i;
 	for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) {
 		set_irq_chip_and_handler(i, &cpu_interrupt_type,
-			handle_level_irq);
+					 handle_percpu_irq);
 	}

 	set_irq_handler(TIMER_IRQ, handle_percpu_irq);


powerpc: Fix xmon dl command for new printk implementation

Since the printk internals were reworked the xmon 'dl' command which
dumps the content of __log_buf has stopped working.

It is now a structured buffer, so just dumping it doesn't really work.

Use the helpers added for kgdb to print out the content.

Signed-off-by: Michael Ellerman <17b9e1c64588c7fa6419b4d29dc1f4426279ba01@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>

--- arch/powerpc/xmon/xmon.c
+++ arch/powerpc/xmon/xmon.c
@@ -17,6 +17,7 @@
 #include <linux/reboot.h>
 #include <linux/delay.h>
 #include <linux/kallsyms.h>
+#include <linux/kmsg_dump.h>
 #include <linux/cpumask.h>
 #include <linux/export.h>
 #include <linux/sysrq.h>
@@ -2148,40 +2149,23 @@
 void
 dump_log_buf(void)
 {
-        const unsigned long size = 128;
-        unsigned long end, addr;
-        unsigned char buf[size + 1];
-
-        addr = 0;
-        buf[size] = '\0';
+	struct kmsg_dumper dumper = { .active = 1 };
+	unsigned char buf[128];
+	size_t len;

         if (setjmp(bus_error_jmp) != 0) {
-                printf("Unable to lookup symbol __log_buf!\n");
+		printf("Error dumping printk buffer!\n");
                 return;
         }

         catch_memory_errors = 1;
         sync();
-        addr = kallsyms_lookup_name("__log_buf");
-
-        if (! addr)
-                printf("Symbol __log_buf not found!\n");
-        else {
-                end = addr + (1 << CONFIG_LOG_BUF_SHIFT);
-                while (addr < end) {
-                        if (! mread(addr, buf, size)) {
-                                printf("Can't read memory at address 0x%lx\n", addr);
-                                break;
-                        }
-
-                        printf("%s", buf);
-
-                        if (strlen(buf) < size)
-                                break;
-
-                        addr += size;
-                }
-        }
+
+	kmsg_dump_rewind_nolock(&dumper);
+	while (kmsg_dump_get_line_nolock(&dumper, false, buf, sizeof(buf), &len)) {
+		buf[len] = '\0';
+		printf("%s", buf);
+	}

         sync();
         /* wait a little while to see if we get a machine check */


s390/cacheinfo: don't use smp_processor_id() in preemptible context

show_cacheinfo() needs to access the cacheinfo structure of any online
cpu. This was done with using smp_processor_id() as in index while in
preemtible context.
This means the cpu could be offline and the data be gone when it would
be accessed.
Better use any online cpu address and protect the data by get_online_cpus()
and put_online_cpus().

Signed-off-by: Heiko Carstens <8dcf0f69152f32f23184f83357a3731522e56b9c@de.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>


KVM: s390: code cleanup to use common vcpu slab cache

cleanup of arch specific code to use common code provided vcpu slab cache
instead of kzalloc() provided memory

Signed-off-by: Michael Mueller <a37db52a77a2139163eb019527c9d9ac319173fe@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <49712f635b03c16d7f4c43df70e49ec8c565813d@de.ibm.com>
Signed-off-by: Cornelia Huck <94980dd689360e06f79e918bf71ea5fed7a2bc63@de.ibm.com>
Signed-off-by: Paolo Bonzini <69d3ebcf5ee4e7f05a50dc23cd96655b730804b4@redhat.com>

--- arch/s390/kvm/kvm-s390.c
+++ arch/s390/kvm/kvm-s390.c
@@ -278,7 +278,7 @@

 	free_page((unsigned long)(vcpu->arch.sie_block));
 	kvm_vcpu_uninit(vcpu);
-	kfree(vcpu);
+	kmem_cache_free(kvm_vcpu_cache, vcpu);
 }

 static void kvm_free_vcpus(struct kvm *kvm)
@@ -408,7 +408,7 @@

 	rc = -ENOMEM;

-	vcpu = kzalloc(sizeof(struct kvm_vcpu), GFP_KERNEL);
+	vcpu = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
 	if (!vcpu)
 		goto out;

@@ -453,7 +453,7 @@
 out_free_sie_block:
 	free_page((unsigned long)(vcpu->arch.sie_block));
 out_free_cpu:
-	kfree(vcpu);
+	kmem_cache_free(kvm_vcpu_cache, vcpu);
 out:
 	return ERR_PTR(rc);
 }


sparc: remove @return doc for void functions

For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <d94e04d205b5962d7873a139ef298b03c1717f72@intel.com>

--- arch/sparc/core/prep_c.c
+++ arch/sparc/core/prep_c.c
@@ -12,12 +12,9 @@
 #include <kernel_internal.h>

 /**
- *
  * @brief Prepare to and run C code
  *
  * This routine prepares for the execution of and runs C code.
- *
- * @return N/A
  */

 void _PrepC(void)


[SPARC32]: pcic.c needs asm/irq_regs.h

[SPARC32]: pcic.c needs asm/irq_regs.h

Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- arch/sparc/kernel/pcic.c
+++ arch/sparc/kernel/pcic.c
@@ -34,6 +34,7 @@
 #include <asm/pcic.h>
 #include <asm/timer.h>
 #include <asm/uaccess.h>
+#include <asm/irq_regs.h>

 unsigned int pcic_pin_to_irq(unsigned int pin, char *name);


ftrace: Use breakpoint method to update ftrace caller

On boot up and module load, it is fine to modify the code directly,
without the use of breakpoints. This is because boot up modification
is done before SMP is initialized, thus the modification is serial,
and module load is done before the module executes.

But after that we must use a SMP safe method to modify running code.
Otherwise, if we are running the function tracer and update its
function (by starting off the stack tracer, or perf tracing)
the change of the function called by the ftrace trampoline is done
directly. If this is being executed on another CPU, that CPU may
take a GPF and crash the kernel.

The breakpoint method is used to change the nops at all the functions, but
the change of the ftrace callback handler itself was still using a
direct modification. If tracing was enabled and the function callback
was changed then another CPU could fault if it was currently calling
the original callback. This modification must use the breakpoint method
too.

Note, the direct method is still used for boot up and module load.

Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>

--- arch/x86/kernel/ftrace.c
+++ arch/x86/kernel/ftrace.c
@@ -100,7 +100,7 @@
 }

 static int
-ftrace_modify_code(unsigned long ip, unsigned const char *old_code,
+ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code,
 		   unsigned const char *new_code)
 {
 	unsigned char replaced[MCOUNT_INSN_SIZE];
@@ -141,7 +141,20 @@
 	old = ftrace_call_replace(ip, addr);
 	new = ftrace_nop_replace();

-	return ftrace_modify_code(rec->ip, old, new);
+	/*
+	 * On boot up, and when modules are loaded, the MCOUNT_ADDR
+	 * is converted to a nop, and will never become MCOUNT_ADDR
+	 * again. This code is either running before SMP (on boot up)
+	 * or before the code will ever be executed (module load).
+	 * We do not want to use the breakpoint version in this case,
+	 * just modify the code directly.
+	 */
+	if (addr == MCOUNT_ADDR)
+		return ftrace_modify_code_direct(rec->ip, old, new);
+
+	/* Normal cases use add_brk_on_nop */
+	WARN_ONCE(1, "invalid use of ftrace_make_nop");
+	return -EINVAL;
 }

 int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
@@ -152,20 +165,8 @@
 	old = ftrace_nop_replace();
 	new = ftrace_call_replace(ip, addr);

-	return ftrace_modify_code(rec->ip, old, new);
-}
-
-int ftrace_update_ftrace_func(ftrace_func_t func)
-{
-	unsigned long ip = (unsigned long)(&ftrace_call);
-	unsigned char old[MCOUNT_INSN_SIZE], *new;
-	int ret;
-
-	memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
-	new = ftrace_call_replace(ip, (unsigned long)func);
-	ret = ftrace_modify_code(ip, old, new);
-
-	return ret;
+	/* Should only be called when module is loaded */
+	return ftrace_modify_code_direct(rec->ip, old, new);
 }

 /*
@@ -201,6 +202,29 @@
  */
 atomic_t modifying_ftrace_code __read_mostly;

+static int
+ftrace_modify_code(unsigned long ip, unsigned const char *old_code,
+		   unsigned const char *new_code);
+
+int ftrace_update_ftrace_func(ftrace_func_t func)
+{
+	unsigned long ip = (unsigned long)(&ftrace_call);
+	unsigned char old[MCOUNT_INSN_SIZE], *new;
+	int ret;
+
+	memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
+	new = ftrace_call_replace(ip, (unsigned long)func);
+
+	/* See comment above by declaration of modifying_ftrace_code */
+	atomic_inc(&modifying_ftrace_code);
+
+	ret = ftrace_modify_code(ip, old, new);
+
+	atomic_dec(&modifying_ftrace_code);
+
+	return ret;
+}
+
 /*
  * A breakpoint was added to the code address we are about to
  * modify, and this is the handle that will just skip over it.
@@ -520,6 +544,38 @@
 	}
 }

+static int
+ftrace_modify_code(unsigned long ip, unsigned const char *old_code,
+		   unsigned const char *new_code)
+{
+	int ret;
+
+	ret = add_break(ip, old_code);
+	if (ret)
+		goto out;
+
+	run_sync();
+
+	ret = add_update_code(ip, new_code);
+	if (ret)
+		goto fail_update;
+
+	run_sync();
+
+	ret = ftrace_write(ip, new_code, 1);
+	if (ret) {
+		ret = -EPERM;
+		goto out;
+	}
+	run_sync();
+ out:
+	return ret;
+
+ fail_update:
+	probe_kernel_write((void *)ip, &old_code[0], 1);
+	goto out;
+}
+
 void arch_ftrace_update_code(int command)
 {
 	/* See comment above by declaration of modifying_ftrace_code */


i386: fix asm constraint in do_IRQ()

i386: fix asm constraint in do_IRQ()

Two prior changes resulted in the "ecx" clobber being lost.

Signed-off-by: Jan Beulich <01de09643e0ae62e116f8bd77de435799874b456@novell.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>


x86: work around io allocation overlap of HT links

normally BIOSes assign io/mmio range to different HT links without
overlapping, even same node same link should get non overlapping
entries.

but Rafael L. Wysocki's buggy BIOS creates a link with overlapping
entries for mmio and io:

  node 0 link 0: io port [1000, ffffff]
  node 0 link 0: mmio [e0000000, efffffff]
  node 0 link 0: mmio [a0000, bffff]
  node 0 link 0: mmio [80000000, ffffffff]

try to merge them and we will get:

  bus: [00, ff] on node 0 link 0
  bus: 00 index 0 io port: [0, ffff]
  bus: 00 index 1 mmio: [80000000, fcffffffff]
  bus: 00 index 2 mmio: [a0000, bffff]

so later we will reduce the chance to assign used resource to
unassigned device.

Reported-by: "Rafael J. Wysocki" <a11f87183a953ab11f50fbafff689c5a7fa3506c@sisk.pl>
Signed-off-by: Yinghai Lu <086d370ab7099a37fc1e7d4667336777772c5d99@gmail.com>
Tested-by: "Rafael J. Wysocki" <a11f87183a953ab11f50fbafff689c5a7fa3506c@sisk.pl>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- arch/x86/pci/k8-bus_64.c
+++ arch/x86/pci/k8-bus_64.c
@@ -112,17 +112,25 @@
 	for (j = 0; j < RANGE_NUM; j++) {
 		if (!range[j].end)
 			continue;
-		if (start == range[j].start && end < range[j].end) {
-			range[j].start = end + 1;
-			break;
-		} else if (start == range[j].start && end == range[j].end) {
+
+		if (start <= range[j].start && end >= range[j].end) {
 			range[j].start = 0;
 			range[j].end = 0;
-			break;
-		} else if (start > range[j].start && end == range[j].end) {
+			continue;
+		}
+
+		if (start <= range[j].start && end < range[j].end && range[j].start < end + 1) {
+			range[j].start = end + 1;
+			continue;
+		}
+
+
+		if (start > range[j].start && end >= range[j].end && range[j].end > start - 1) {
 			range[j].end = start - 1;
-			break;
-		} else if (start > range[j].start && end < range[j].end) {
+			continue;
+		}
+
+		if (start > range[j].start && end < range[j].end) {
 			/* find the new spare */
 			for (i = 0; i < RANGE_NUM; i++) {
 				if (range[i].end == 0)
@@ -135,7 +143,7 @@
 				printk(KERN_ERR "run of slot in ranges\n");
 			}
 			range[j].end = start - 1;
-			break;
+			continue;
 		}
 	}
 }
@@ -151,16 +159,24 @@

 	/* try to merge it with old one */
 	for (i = 0; i < info->res_num; i++) {
+		size_t final_start, final_end;
+		size_t common_start, common_end;
+
 		res = &info->res[i];
 		if (res->flags != flags)
 			continue;
-		if (res->end + 1 == start) {
-			res->end = end;
-			return;
-		} else if (end + 1 == res->start) {
-			res->start = start;
-			return;
-		}
+
+		common_start = max((size_t)res->start, start);
+		common_end = min((size_t)res->end, end);
+		if (common_start > common_end + 1)
+			continue;
+
+		final_start = min((size_t)res->start, start);
+		final_end = max((size_t)res->end, end);
+
+		res->start = final_start;
+		res->end = final_end;
+		return;
 	}

 addit:
@@ -336,7 +352,11 @@
 		info = &pci_root_info[j];
 		printk(KERN_DEBUG "node %d link %d: io port [%llx, %llx]\n",
 		       node, link, (u64)start, (u64)end);
-		update_res(info, start, end, IORESOURCE_IO, 0);
+
+		/* kernel only handle 16 bit only */
+		if (end > 0xffff)
+			end = 0xffff;
+		update_res(info, start, end, IORESOURCE_IO, 1);
 		update_range(range, start, end);
 	}
 	/* add left over io port range to def node/link, [0, 0xffff] */
@@ -444,7 +464,7 @@
 			}
 		}

-		update_res(info, start, end, IORESOURCE_MEM, 0);
+		update_res(info, start, end, IORESOURCE_MEM, 1);
 		update_range(range, start, end);
 		printk(KERN_CONT "\n");
 	}


Updated serialization info

Updated serialization info

--- src/Utils/Serialization.h
+++ src/Utils/Serialization.h
@@ -147,7 +147,8 @@
 			cereal::make_nvp("toruses", b.toruses),
 			cereal::make_nvp("meshes", b.meshes),
 			cereal::make_nvp("instances", b.instances),
-			cereal::make_nvp("csgs", b.csgs));
+			cereal::make_nvp("csgs", b.csgs),
+			cereal::make_nvp("blinnBlobs", b.blinnBlobs));
 	}

 	// ---------------------------------------------
@@ -226,7 +227,8 @@
 			cereal::make_nvp("materialId", b.materialId),
 			cereal::make_nvp("invisible", b.invisible),
 			cereal::make_nvp("position", b.position),
-			cereal::make_nvp("radius", b.radius));
+			cereal::make_nvp("radius", b.radius),
+			cereal::make_nvp("uvMapType", b.uvMapType));
 	}

 	template<class Archive>
@@ -309,6 +311,16 @@
 			cereal::make_nvp("operation", b.operation),
 			cereal::make_nvp("leftPrimitiveId", b.leftPrimitiveId),
 			cereal::make_nvp("rightPrimitiveId", b.rightPrimitiveId));
+	}
+
+	template<class Archive>
+	void serialize(Archive& a, BlinnBlob& b)
+	{
+		a(cereal::make_nvp("id", b.id),
+			cereal::make_nvp("materialId", b.materialId),
+			cereal::make_nvp("invisible", b.invisible),
+			cereal::make_nvp("blobs", b.blobs),
+			cereal::make_nvp("solverIterations", b.solverIterations));
 	}

 	// ---------------------------------------------
@@ -536,7 +548,7 @@
 	}

 	// ---------------------------------------------
-	// BVHBUILDINFO
+	// MISC
 	// ---------------------------------------------

 	template<class Archive>
@@ -549,14 +561,19 @@
 			cereal::make_nvp("axisSplit", b.axisSplit));
 	}

-	// ---------------------------------------------
-	// OBJ SCENE
-	// ---------------------------------------------
-
 	template<class Archive>
 	void serialize(Archive& a, ObjScene& b)
 	{
 		a(cereal::make_nvp("filePath", b.filePath),
 			cereal::make_nvp("scale", b.scale));
 	}
+
+	template<class Archive>
+	void serialize(Archive& a, BlinnBlobDescription& b)
+	{
+		a(cereal::make_nvp("id", b.position),
+			cereal::make_nvp("materialId", b.radius),
+			cereal::make_nvp("invisible", b.blobbiness),
+			cereal::make_nvp("operation", b.isNegative));
+	}
 }


advanced_assert.h: using _ASSERT() on Windows

--- assert/advanced_assert.h
+++ assert/advanced_assert.h
@@ -36,8 +36,8 @@
 };

 #ifdef _WIN32
-#include <assert.h>
-#define assert_without_abort(x) assert(x)
+#include <crtdbg.h>
+#define assert_without_abort(x) _ASSERT(x)
 #else
 #include "../debugger/debugger_is_attached.h"
 #include <signal.h>


Added one file associated with check in in r1192.
Review URL: http://webrtc-codereview.appspot.com/320012

git-svn-id: 917f5d3ca488f358c4d40eaec14422cf392ccec9@1194 4adac7df-926f-26a2-2b94-8c16560cd09d

--- src/modules/audio_coding/codecs/iSAC/fix/source/lpc_masking_model.c
+++ src/modules/audio_coding/codecs/iSAC/fix/source/lpc_masking_model.c
@@ -460,7 +460,8 @@
 }

-
+// Declare a function pointer.
+AutocorrFix WebRtcIsacfix_AutocorrFix;

 void WebRtcIsacfix_GetLpcCoef(WebRtc_Word16 *inLoQ0,
                               WebRtc_Word16 *inHiQ0,


davinci: DM644x EVM: register MUSB device earlier

The MUSB driver doesn't see its platform device on DM644x EVM board anymore
since commit 73b089b052a69020b953312a624a6e1eb5b81fab (usb: musb: split davinci
to its own platform_driver) because the new probe is called as subsys_initcall()
now, and the device is registered later than that by the board code.  Move the
registration to davinci_evm_init() -- it's safe to do so because the MUSB core
device still gets initialized as fs_initcall() -- which is late enough for the
I2C GPIO expander (which controls VBUS) to be initialized.

Signed-off-by: Sergei Shtylyov <38a867ea26f35d3eeb42270f1bc7b9d1d135e6a2@ru.mvista.com>
Acked-by: Felipe Balbi <94dddeeef08b001e003cce128ddc162a4e2c6cd2@ti.com>
Tested-by: Sekhar Nori <946cfb81282bb55c59f600e7ee3d3b2c6973f7a3@ti.com>
Signed-off-by: Kevin Hilman <f9849b02abe18c1ece6bd40346458ed53f49d31b@ti.com>

--- arch/arm/mach-davinci/board-dm644x-evm.c
+++ arch/arm/mach-davinci/board-dm644x-evm.c
@@ -440,11 +440,6 @@
 	gpio_request(gpio + 7, "nCF_SEL");
 	gpio_direction_output(gpio + 7, 1);

-	/* irlml6401 switches over 1A, in under 8 msec;
-	 * now it can be managed by nDRV_VBUS ...
-	 */
-	davinci_setup_usb(1000, 8);
-
 	return 0;
 }

@@ -705,6 +700,9 @@
 	davinci_serial_init(&uart_config);
 	dm644x_init_asp(&dm644x_evm_snd_data);

+	/* irlml6401 switches over 1A, in under 8 msec */
+	davinci_setup_usb(1000, 8);
+
 	soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID;
 	/* Register the fixup for PHY on DaVinci */
 	phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,


msm: msm_bus: send correct value to bw division function

While calculating bw for existing client request
sometimes it can go to negative if client unregisters
or send request with lesser ab/ib values. Bus driver
will divide bandwidth if interleaving enabled.

Added a macro wrapper to handle negative bw values
since the division utility function can't handle
negative values

CRs-Fixed: 521940
Change-Id: Ic3a216b8efb535593fe02ad3228d71808d2e0f98
Signed-off-by: Alok Chauhan <a781eab460d0b8de6413720f3ae4346867408d60@codeaurora.org>

--- arch/arm/mach-msm/msm_bus/msm_bus_core.h
+++ arch/arm/mach-msm/msm_bus/msm_bus_core.h
@@ -36,7 +36,8 @@
 	(((slv >= MSM_BUS_SLAVE_FIRST) && (slv <= MSM_BUS_SLAVE_LAST)) ? 1 : 0)

 #define INTERLEAVED_BW(fab_pdata, bw, ports) \
-	((fab_pdata->il_flag) ? msm_bus_div64((ports), (bw)) : (bw))
+	((fab_pdata->il_flag) ? ((bw < 0) \
+	? -msm_bus_div64((ports), (-bw)) : msm_bus_div64((ports), (bw))) : (bw))
 #define INTERLEAVED_VAL(fab_pdata, n) \
 	((fab_pdata->il_flag) ? (n) : 1)


ARM: S5PC100: Clenaup map.h file

ARM: S5PC100: Clenaup map.h file

Signed-off-by: Kukjin Kim <3fc711f4e08bc570a586748633ff7c76d0e1e253@samsung.com>

--- arch/arm/mach-s5pc100/include/mach/map.h
+++ arch/arm/mach-s5pc100/include/mach/map.h
@@ -1,4 +1,7 @@
 /* linux/arch/arm/mach-s5pc100/include/mach/map.h
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com/
  *
  * Copyright 2009 Samsung Electronics Co.
  *	Byungho Min <bhmin@samsung.com>
@@ -16,145 +19,115 @@
 #include <plat/map-base.h>
 #include <plat/map-s5p.h>

-/*
- * map-base.h has already defined virtual memory address
- * S3C_VA_IRQ		S3C_ADDR(0x00000000)	irq controller(s)
- * S3C_VA_SYS		S3C_ADDR(0x00100000)	system control
- * S3C_VA_MEM		S3C_ADDR(0x00200000)	system control (not used)
- * S3C_VA_TIMER		S3C_ADDR(0x00300000)	timer block
- * S3C_VA_WATCHDOG	S3C_ADDR(0x00400000)	watchdog
- * S3C_VA_UART		S3C_ADDR(0x01000000)	UART
- *
- * S5PC100 specific virtual memory address can be defined here
- * S5PC1XX_VA_GPIO	S3C_ADDR(0x00500000)	GPIO
- *
- */
+#define S5PC100_PA_SDRAM		0x20000000

-#define S5PC100_PA_ONENAND_BUF	(0xB0000000)
-#define S5PC100_SZ_ONENAND_BUF	(SZ_256M - SZ_32M)
+#define S5PC100_PA_ONENAND		0xE7100000
+#define S5PC100_PA_ONENAND_BUF		0xB0000000

-/* Chip ID */
+#define S5PC100_PA_CHIPID		0xE0000000

-#define S5PC100_PA_CHIPID	(0xE0000000)
-#define S5P_PA_CHIPID		S5PC100_PA_CHIPID
+#define S5PC100_PA_SYSCON		0xE0100000

-#define S5PC100_PA_SYSCON	(0xE0100000)
-#define S5P_PA_SYSCON		S5PC100_PA_SYSCON
+#define S5PC100_PA_OTHERS		0xE0200000

-#define S5PC100_PA_OTHERS	(0xE0200000)
-#define S5PC100_VA_OTHERS	(S3C_VA_SYS + 0x10000)
+#define S5PC100_PA_GPIO			0xE0300000

-#define S5PC100_PA_GPIO		(0xE0300000)
-#define S5PC1XX_VA_GPIO		S3C_ADDR(0x00500000)
+#define S5PC100_PA_VIC0			0xE4000000
+#define S5PC100_PA_VIC1			0xE4100000
+#define S5PC100_PA_VIC2			0xE4200000

-/* Interrupt */
-#define S5PC100_PA_VIC0		(0xE4000000)
-#define S5PC100_PA_VIC1		(0xE4100000)
-#define S5PC100_PA_VIC2		(0xE4200000)
-#define S5PC100_VA_VIC		S3C_VA_IRQ
-#define S5PC100_VA_VIC_OFFSET	0x10000
-#define S5PC1XX_VA_VIC(x)	(S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET))
+#define S5PC100_PA_SROMC		0xE7000000

-#define S5PC100_PA_SROMC	(0xE7000000)
-#define S5P_PA_SROMC		S5PC100_PA_SROMC
+#define S5PC100_PA_CFCON		0xE7800000

-#define S5PC100_PA_ONENAND	(0xE7100000)
+#define S5PC100_PA_MDMA			0xE8100000
+#define S5PC100_PA_PDMA0		0xE9000000
+#define S5PC100_PA_PDMA1		0xE9200000

-#define S5PC100_PA_CFCON	(0xE7800000)
+#define S5PC100_PA_TIMER		0xEA000000
+#define S5PC100_PA_SYSTIMER		0xEA100000
+#define S5PC100_PA_WATCHDOG		0xEA200000
+#define S5PC100_PA_RTC			0xEA300000

-/* DMA */
-#define S5PC100_PA_MDMA		(0xE8100000)
-#define S5PC100_PA_PDMA0	(0xE9000000)
-#define S5PC100_PA_PDMA1	(0xE9200000)
+#define S5PC100_PA_UART			0xEC000000

-/* Timer */
-#define S5PC100_PA_TIMER	(0xEA000000)
-#define S5P_PA_TIMER		S5PC100_PA_TIMER
+#define S5PC100_PA_IIC0			0xEC100000
+#define S5PC100_PA_IIC1			0xEC200000

-#define S5PC100_PA_SYSTIMER	(0xEA100000)
+#define S5PC100_PA_SPI0			0xEC300000
+#define S5PC100_PA_SPI1			0xEC400000
+#define S5PC100_PA_SPI2			0xEC500000

-#define S5PC100_PA_WATCHDOG	(0xEA200000)
-#define S5PC100_PA_RTC		(0xEA300000)
+#define S5PC100_PA_USB_HSOTG		0xED200000
+#define S5PC100_PA_USB_HSPHY		0xED300000

-#define S5PC100_PA_UART		(0xEC000000)
+#define S5PC100_PA_HSMMC(x)		(0xED800000 + ((x) * 0x100000))

-#define S5P_PA_UART0		(S5PC100_PA_UART + 0x0)
-#define S5P_PA_UART1		(S5PC100_PA_UART + 0x400)
-#define S5P_PA_UART2		(S5PC100_PA_UART + 0x800)
-#define S5P_PA_UART3		(S5PC100_PA_UART + 0xC00)
-#define S5P_SZ_UART		SZ_256
+#define S5PC100_PA_FB			0xEE000000

-#define S5PC100_PA_IIC0		(0xEC100000)
-#define S5PC100_PA_IIC1		(0xEC200000)
+#define S5PC100_PA_FIMC0		0xEE200000
+#define S5PC100_PA_FIMC1		0xEE300000
+#define S5PC100_PA_FIMC2		0xEE400000

-/* SPI */
-#define S5PC100_PA_SPI0		0xEC300000
-#define S5PC100_PA_SPI1		0xEC400000
-#define S5PC100_PA_SPI2		0xEC500000
+#define S5PC100_PA_I2S0			0xF2000000
+#define S5PC100_PA_I2S1			0xF2100000
+#define S5PC100_PA_I2S2			0xF2200000

-/* USB HS OTG */
-#define S5PC100_PA_USB_HSOTG	(0xED200000)
-#define S5PC100_PA_USB_HSPHY	(0xED300000)
+#define S5PC100_PA_AC97			0xF2300000

-#define S5PC100_PA_FB		(0xEE000000)
+#define S5PC100_PA_PCM0			0xF2400000
+#define S5PC100_PA_PCM1			0xF2500000

-#define S5PC100_PA_FIMC0	(0xEE200000)
-#define S5PC100_PA_FIMC1	(0xEE300000)
-#define S5PC100_PA_FIMC2	(0xEE400000)
+#define S5PC100_PA_SPDIF		0xF2600000

-#define S5PC100_PA_I2S0		(0xF2000000)
-#define S5PC100_PA_I2S1		(0xF2100000)
-#define S5PC100_PA_I2S2		(0xF2200000)
+#define S5PC100_PA_TSADC		0xF3000000

-#define S5PC100_PA_AC97		0xF2300000
+#define S5PC100_PA_KEYPAD		0xF3100000

-/* PCM */
-#define S5PC100_PA_PCM0		0xF2400000
-#define S5PC100_PA_PCM1		0xF2500000
+/* Compatibiltiy Defines */

-#define S5PC100_PA_SPDIF	0xF2600000
+#define S3C_PA_FB			S5PC100_PA_FB
+#define S3C_PA_HSMMC0			S5PC100_PA_HSMMC(0)
+#define S3C_PA_HSMMC1			S5PC100_PA_HSMMC(1)
+#define S3C_PA_HSMMC2			S5PC100_PA_HSMMC(2)
+#define S3C_PA_IIC			S5PC100_PA_IIC0
+#define S3C_PA_IIC1			S5PC100_PA_IIC1
+#define S3C_PA_KEYPAD			S5PC100_PA_KEYPAD
+#define S3C_PA_ONENAND			S5PC100_PA_ONENAND
+#define S3C_PA_ONENAND_BUF		S5PC100_PA_ONENAND_BUF
+#define S3C_PA_RTC			S5PC100_PA_RTC
+#define S3C_PA_TSADC			S5PC100_PA_TSADC
+#define S3C_PA_USB_HSOTG		S5PC100_PA_USB_HSOTG
+#define S3C_PA_USB_HSPHY		S5PC100_PA_USB_HSPHY
+#define S3C_PA_WDT			S5PC100_PA_WATCHDOG

-#define S5PC100_PA_TSADC	(0xF3000000)
+#define S5P_PA_CHIPID			S5PC100_PA_CHIPID
+#define S5P_PA_FIMC0			S5PC100_PA_FIMC0
+#define S5P_PA_FIMC1			S5PC100_PA_FIMC1
+#define S5P_PA_FIMC2			S5PC100_PA_FIMC2
+#define S5P_PA_SDRAM			S5PC100_PA_SDRAM
+#define S5P_PA_SROMC			S5PC100_PA_SROMC
+#define S5P_PA_SYSCON			S5PC100_PA_SYSCON
+#define S5P_PA_TIMER			S5PC100_PA_TIMER

-/* KEYPAD */
-#define S5PC100_PA_KEYPAD	(0xF3100000)
+#define SAMSUNG_PA_ADC			S5PC100_PA_TSADC
+#define SAMSUNG_PA_CFCON		S5PC100_PA_CFCON
+#define SAMSUNG_PA_KEYPAD		S5PC100_PA_KEYPAD

-#define S5PC100_PA_HSMMC(x)	(0xED800000 + ((x) * 0x100000))
+#define S5PC100_VA_OTHERS		(S3C_VA_SYS + 0x10000)

-#define S5PC100_PA_SDRAM	(0x20000000)
-#define S5P_PA_SDRAM		S5PC100_PA_SDRAM
+#define S3C_SZ_ONENAND_BUF		(SZ_256M - SZ_32M)

-/* compatibiltiy defines. */
-#define S3C_PA_UART		S5PC100_PA_UART
-#define S3C_PA_IIC		S5PC100_PA_IIC0
-#define S3C_PA_IIC1		S5PC100_PA_IIC1
-#define S3C_PA_FB		S5PC100_PA_FB
-#define S3C_PA_G2D		S5PC100_PA_G2D
-#define S3C_PA_G3D		S5PC100_PA_G3D
-#define S3C_PA_JPEG		S5PC100_PA_JPEG
-#define S3C_PA_ROTATOR		S5PC100_PA_ROTATOR
-#define S5P_VA_VIC0		S5PC1XX_VA_VIC(0)
-#define S5P_VA_VIC1		S5PC1XX_VA_VIC(1)
-#define S5P_VA_VIC2		S5PC1XX_VA_VIC(2)
-#define S3C_PA_USB_HSOTG	S5PC100_PA_USB_HSOTG
-#define S3C_PA_USB_HSPHY	S5PC100_PA_USB_HSPHY
-#define S3C_PA_HSMMC0		S5PC100_PA_HSMMC(0)
-#define S3C_PA_HSMMC1		S5PC100_PA_HSMMC(1)
-#define S3C_PA_HSMMC2		S5PC100_PA_HSMMC(2)
-#define S3C_PA_KEYPAD		S5PC100_PA_KEYPAD
-#define S3C_PA_WDT		S5PC100_PA_WATCHDOG
-#define S3C_PA_TSADC		S5PC100_PA_TSADC
-#define S3C_PA_ONENAND		S5PC100_PA_ONENAND
-#define S3C_PA_ONENAND_BUF	S5PC100_PA_ONENAND_BUF
-#define S3C_SZ_ONENAND_BUF	S5PC100_SZ_ONENAND_BUF
-#define S3C_PA_RTC		S5PC100_PA_RTC
+/* UART */

-#define SAMSUNG_PA_ADC		S5PC100_PA_TSADC
-#define SAMSUNG_PA_CFCON	S5PC100_PA_CFCON
-#define SAMSUNG_PA_KEYPAD	S5PC100_PA_KEYPAD
+#define S3C_PA_UART			S5PC100_PA_UART

-#define S5P_PA_FIMC0		S5PC100_PA_FIMC0
-#define S5P_PA_FIMC1		S5PC100_PA_FIMC1
-#define S5P_PA_FIMC2		S5PC100_PA_FIMC2
+#define S5P_PA_UART(x)			(S3C_PA_UART + ((x) * S3C_UART_OFFSET))
+#define S5P_PA_UART0			S5P_PA_UART(0)
+#define S5P_PA_UART1			S5P_PA_UART(1)
+#define S5P_PA_UART2			S5P_PA_UART(2)
+#define S5P_PA_UART3			S5P_PA_UART(3)

-#endif /* __ASM_ARCH_C100_MAP_H */
+#define S5P_SZ_UART			SZ_256
+
+#endif /* __ASM_ARCH_MAP_H */


ARM: io: remove IO_SPACE_LIMIT from platforms without PCI/ISA

Nothing should be using PCI/ISA IO on these platforms, so their
IO_SPACE_LIMIT definitions are irrelevent.

Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/mach-vexpress/include/mach/io.h
+++ arch/arm/mach-vexpress/include/mach/io.h
@@ -20,8 +20,6 @@
 #ifndef __ASM_ARM_ARCH_IO_H
 #define __ASM_ARM_ARCH_IO_H

-#define IO_SPACE_LIMIT 0xffffffff
-
 #define __io(a)		__typesafe_io(a)
 #define __mem_pci(a)	(a)


Bug 433791: removed watcomfx from CVS. Patch by Serge Gautherie <sgautherie.bz@free.fr>.  r=wtc.


Fixed compiler warnings on win32

Fixed compiler warnings on win32

--- src/motion_example_async.c
+++ src/motion_example_async.c
@@ -51,8 +51,10 @@

 #define TIMEOUT_MAX 1000

-#if defined __GLIBC__ && __GLIBC_PREREQ(2, 4)
+#if defined __GLIBC__
+#if __GLIBC_PREREQ(2, 4)
 #define HAS_PPOLL
+#endif
 #endif

 #ifdef _WIN32


throw exception for zero size file

throw exception for zero size file

--- fincore.c
+++ fincore.c
@@ -21,6 +21,12 @@
 		PyErr_SetFromErrno(PyExc_IOError);
 		return NULL;
 	}
+
+    // cannot mmap a zero size file
+    if ( file_stat.st_size == 0 ) {
+        PyErr_SetFromErrno(PyExc_IOError);
+        return NULL;
+    }

 	file_mmap = mmap((void *)0, file_stat.st_size, PROT_NONE, MAP_SHARED, fd, 0);


pas de segment fault mais jai de besoin dune interface input/output simultaneous dans cli

--- backend/src/grouter/tcp.c
+++ backend/src/grouter/tcp.c
@@ -16,6 +16,7 @@

 void set_state(int);
+void timer_handler();

 /** state variables, only one active connection so there not in a struct
  * our version of the TCB from the rfc
@@ -64,8 +65,9 @@
 	struct timespec sndtm;	// time at which the packet is send
 	struct timespec rcvtm;	//time at which the ack was received

+	int ack;
+
 	int snd_head;
-	int last_sent;
 	uchar snd_buf[BUFSIZE];

 } tcb;
@@ -121,7 +123,23 @@
         tcb.rtt.tv_nsec = 0;
 	tcb.stt.tv_sec = 0;
         tcb.stt.tv_nsec = 0;
+
+	tcb.ack = 0;

+	tcb.event.sigev_notify = SIGEV_THREAD;
+   	tcb.event.sigev_notify_function = timer_handler;
+    	tcb.event.sigev_notify_attributes = NULL;
+
+	int status = timer_create(CLOCK_REALTIME, &tcb.event, &tcb.timer);
+        if (status < 0) {
+               return;
+        }
+	tcb.itime.it_value.tv_sec = 0;
+   	tcb.itime.it_value.tv_nsec = 0;
+   	tcb.itime.it_interval.tv_sec = 0;
+   	tcb.itime.it_interval.tv_nsec = 0;
+
+   	timer_settime(tcb.timer, 0, &tcb.itime, NULL);
 }

 void init_tcp()
@@ -159,19 +177,21 @@

 // gets the length of the unacknowledgement space
 long get_una_size(){
+	long last_sent = seq_to_off(tcb.snd_nxt, tcb.iss);
 	long una = seq_to_off(tcb.snd_una, tcb.iss);
-	long length= (tcb.last_sent - una);
-	if(una > tcb.last_sent){
-		length = ((tcb.last_sent + BUFSIZE - una)% BUFSIZE);
+	long length= (last_sent - una);
+	if(una > last_sent){
+		length = ((last_sent + BUFSIZE - una)% BUFSIZE);
 	}
 	return length;
 }

 // gets the length of the unsent space
 long get_unsent_size(){
-	long available = tcb.snd_head - tcb.last_sent;
-	if(tcb.last_sent > tcb.snd_head){
-		available = ((tcb.snd_head + BUFSIZE - tcb.last_sent)% BUFSIZE);
+	long last_sent = seq_to_off(tcb.snd_nxt, tcb.iss);
+	long available = tcb.snd_head - last_sent;
+	if(last_sent > tcb.snd_head){
+		available = ((tcb.snd_head + BUFSIZE - last_sent)% BUFSIZE);
 	}
 	return available;
 }
@@ -225,18 +245,17 @@
 /** Same as above buf copies unsent data into buf, returns count of bytes copied. **/
 int copy_unsent(uchar *buf, int len)
 {
+	long last_sent = seq_to_off(tcb.snd_nxt, tcb.iss);
 	long available = get_unsent_size();
 	if(available > (DEFAULT_MTU - sizeof(ip_packet_t) - TCP_HEADER_SIZE)){
 		available = DEFAULT_MTU - sizeof(ip_packet_t) - TCP_HEADER_SIZE;
 	}

 	if (available < len) {
-		memcpy(buf, tcb.snd_buf + seq_to_off(tcb.snd_nxt, tcb.iss), available);
-		tcb.last_sent = (available + tcb.last_sent) % BUFSIZE;
+		memcpy(buf, tcb.snd_buf + last_sent, available);
 		return available;
 	} else {
-		memcpy(buf, tcb.snd_buf + seq_to_off(tcb.snd_nxt, tcb.iss), len);
-		tcb.last_sent = (len + tcb.last_sent) % BUFSIZE;
+		memcpy(buf, tcb.snd_buf + last_sent, len);
 		return len;
 	}
 }
@@ -363,8 +382,6 @@
 	memcpy(tcb.remote_ip, dest_ip, 4);
 	tcb.remote_port = dest_port;
 	tcb.type = ACTIVE;
-	tcb.snd_head = 0;
-	tcb.last_sent = 0;

 	// send a SYN packet
 	// calloc gives zeroed out mem
@@ -382,6 +399,7 @@
 	tcb.iss = sequence_gen();
 	tcb.snd_una = tcb.iss;
 	tcb.snd_nxt = tcb.iss + 1;
+	tcb.snd_head = seq_to_off(tcb.snd_nxt, tcb.iss);

 	uchar tmpbuf[4];
 	getsrcaddr(gpkt, dest_ip);
@@ -424,7 +442,7 @@
 		hdr->flags = RST;
 	} else {
 		hdr->ack = htonl(ntohl(hdr->seq) + ntohs(ip->ip_pkt_len) - ip->ip_hdr_len * 4 - hdr->data_off * 4);
-		hdr->seq = 0;
+		hdr->seq = 0;
 		hdr->flags = RST | ACK;
 	}

@@ -459,11 +477,10 @@
 	tmp_port = hdr->src;
 	hdr->src = hdr->dst;
 	hdr->dst = tmp_port;
-
 	hdr->ack = htonl(tcb.recv_nxt);
 	hdr->seq = htonl(tcb.iss);
 	hdr->data_off = 5;
-	hdr->win = htons(tcb.recv_win);
+	hdr->win = htons(tcb.recv_win);
 	hdr->urg = 0;
 	hdr->checksum = 0;
 	hdr->reserved = 0;
@@ -579,15 +596,13 @@
 	if (hdr->flags & SYN) {

 		tcb.recv_nxt = ntohl(hdr->seq) + 1;
-		tcb.irs = ntohl(hdr->seq);
-
-		tcb.snd_head = 0;
-		tcb.last_sent = 0;
+		tcb.irs = ntohl(hdr->seq);

 		tcb.iss = sequence_gen();
 		tcb.snd_nxt = tcb.iss + 1;
 		tcb.snd_una = tcb.iss;
 		tcb.snd_win = ntohs(hdr->win);
+		tcb.snd_head = tcb.iss + 1;

 		uchar tmp[4];
 		COPY_IP(tcb.remote_ip, gNtohl(tmp, ip->ip_src));
@@ -685,6 +700,10 @@
 				printf("error: insufficient resources\n");
 				return 0;
 			}
+		}
+		// don't send anything if the previous ack isn't received
+		if(tcb.snd_una != tcb.snd_nxt){
+			return 0;
 		}

 		gpacket_t *gpkt = (gpacket_t *) calloc(1, sizeof(gpacket_t));
@@ -732,14 +751,14 @@

 		IPOutgoingPacket(gpkt, gNtohl(tmpbuf, ip->ip_dst), hdr->data_off * 4 + size, 1, TCP_PROTOCOL);

-		tcb.snd_nxt += len;
+		tcb.snd_nxt += size;

 		tcb.timer_una = tcb.snd_una;
 		start_timewait_timer(-1);
 	}

 	else {
-		printf("error: connection closing");
+		printf("error: connection closing\n");
 		return 0;
 	}

@@ -749,6 +768,7 @@

 // it is a simple resend
 int tcp_resend(){
+	printf("TCP_RESEND\n");
 	gpacket_t *gpkt = (gpacket_t *) calloc(1, sizeof(gpacket_t));

 	if (gpkt == NULL) {
@@ -852,40 +872,29 @@

 void timer_handler(){
 	if(tcb.exit < 0){
-		if(tcb.snd_una > tcb.timer_una){// we have receive the ack
-			tcb.timer_una = tcb.snd_una;
-			timer_delete(tcb.timer);
-			tcb.retran = 0;
-			return;
-		} else {
+		if(tcb.snd_una < tcb.timer_una){
 			if(tcb.retran == MAXDATARETRANSMISSIONS){
 				tcb.retran = 0;
-				verbose(2, "[tcp_retransmission]:: Connection INACCESSIBLE");
+				verbose(1, "[tcp_retransmission]:: Connection INACCESSIBLE");
 				tcp_close();
 				return;
 			} else {
+				timer_delete(tcb.timer);
+				printf("Time to resend\n");
 				tcp_resend();
 			}
 		}
 	} else {
-		timer_delete(tcb.timer);
+		printf("Time to do something to quit\n");
 		return;
 	}

 }

 // time in seconds, if time < 0, it is for the retransmission
+//time == 0 it stops timer
 int start_timewait_timer(int time)
-{
-	tcb.event.sigev_notify = SIGEV_THREAD;
-   	tcb.event.sigev_notify_function = timer_handler;
-    	tcb.event.sigev_notify_attributes = NULL;
-
-	int status = timer_create(CLOCK_REALTIME, &tcb.event, &tcb.timer);
-        if (status < 0) {
-               return -1;
-        }
-
+{
 	if(time < 0){ // use STT
 		tcb.itime.it_value.tv_sec = BETA*tcb.stt.tv_sec;
    		tcb.itime.it_value.tv_nsec = BETA*tcb.stt.tv_nsec;
@@ -929,9 +938,8 @@
 			tcb.snd_wl1 = seq;
 			tcb.snd_wl2 = ack;
 		}
-		//check if the timer
-		if(tcb.snd_una == tcb.timer_una){
-			timer_delete(tcb.timer);
+		//check if the timer is still alive
+		if(tcb.snd_una > tcb.timer_una){
 			tcb.timer_una = tcb.snd_una;
 			tcb.retran = 0;
 		}
@@ -972,7 +980,12 @@

 	if ( (read_state() == ESTABLISHED) || (read_state() == CLOSE_WAIT || (read_state() == FIN_WAIT2)) )
 	{
-		proceed = process_ack(gpkt);
+		//if(tcb.ack != 0){
+			proceed = process_ack(gpkt);
+		//	tcb.ack = 1;
+		//} else {
+		//	tcb.ack = 0;
+		//}
 	}

 	else if ( read_state() ==  FIN_WAIT1 )


Bluetooth: controller: Allow devices not in resolving list

Whenever not using the whitelist the resolving list is traversed to
verify that the device is allowed depending on its current privacy mode.
In the case where the device is not found by address in the resolving
list, allow the request to go through, since we are then dealing with an
unknown devices and the resolving list restrictions do not apply.

Signed-off-by: Carles Cufi <853081dc8dca4fe6a7e3c984752718b5db36e060@nordicsemi.no>

--- subsys/bluetooth/controller/ll_sw/ll_filter.c
+++ subsys/bluetooth/controller/ll_sw/ll_filter.c
@@ -421,7 +421,7 @@
 		}
 	}

-	return false;
+	return true;
 }

 bool ctrl_rl_enabled(void)


Use precalculated variable

Use precalculated variable

git-svn-id: bb0627f6f70d46b61088c62c6186faa4b96a9496@8216 91ce42f0-d328-0410-95d8-f526ca767f89

--- bacula/src/dird/migrate.c
+++ bacula/src/dird/migrate.c
@@ -1164,10 +1164,10 @@
          /* Copy JobLog to new JobId */
          Mmsg(query, "INSERT INTO Log (JobId, Time, LogText ) "
                       "SELECT %s, Time, LogText FROM Log WHERE JobId=%s",
-              edit_uint64(mig_jcr->jr.JobId, ec7), old_jobid);
+              new_jobid, old_jobid);
          db_sql_query(mig_jcr->db, query.c_str(), NULL, NULL);
          Mmsg(query, "UPDATE Job SET Type='%c' WHERE JobId=%s",
-              (char)JT_JOB_COPY, ec7);
+              (char)JT_JOB_COPY, new_jobid);
          db_sql_query(mig_jcr->db, query.c_str(), NULL, NULL);
       }


net/ieee802154: Fix net mgmt request to get core settings

Obviously s/SET/GET

Change-Id: Iab4fa82ee6c53cb53806bf131655605a21125c3b
Signed-off-by: Tomasz Bursztyka <ba81a3a719836727e6857ae83462b9f52ec41006@linux.intel.com>

--- subsys/net/ip/l2/ieee802154/ieee802154_mgmt.c
+++ subsys/net/ip/l2/ieee802154/ieee802154_mgmt.c
@@ -442,7 +442,7 @@
 	struct ieee802154_context *ctx = net_if_l2_data(iface);
 	uint16_t *value;

-	if (mgmt_request != NET_REQUEST_IEEE802154_SET_EXT_ADDR &&
+	if (mgmt_request != NET_REQUEST_IEEE802154_GET_EXT_ADDR &&
 	    (len != sizeof(uint16_t) || !data)) {
 		return -EINVAL;
 	}


drm/nvc0-/gr: extend one of the magic calculations for >4 GPCs

Signed-off-by: Ben Skeggs <d9f27fb07c1e9f131223ad827fa5179f3846c30b@redhat.com>

--- drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
+++ drivers/gpu/drm/nouveau/core/engine/graph/ctxnvc0.c
@@ -1014,13 +1014,14 @@
 void
 nvc0_grctx_generate_r406800(struct nvc0_graph_priv *priv)
 {
-	u32 tpc_mask = 0, tpc_set = 0;
-	u8  tpcnr[GPC_MAX], a, b;
-	int gpc, tpc, i;
+	u64 tpc_mask = 0, tpc_set = 0;
+	u8  tpcnr[GPC_MAX];
+	int gpc, tpc;
+	int i, a, b;

 	memcpy(tpcnr, priv->tpc_nr, sizeof(priv->tpc_nr));
 	for (gpc = 0; gpc < priv->gpc_nr; gpc++)
-		tpc_mask |= ((1 << priv->tpc_nr[gpc]) - 1) << (gpc * 8);
+		tpc_mask |= ((1ULL << priv->tpc_nr[gpc]) - 1) << (gpc * 8);

 	for (i = 0, gpc = -1, b = -1; i < 32; i++) {
 		a = (i * (priv->tpc_total - 1)) / 32;
@@ -1034,8 +1035,12 @@
 			tpc_set |= 1 << ((gpc * 8) + tpc);
 		}

-		nv_wr32(priv, 0x406800 + (i * 0x20), tpc_set);
-		nv_wr32(priv, 0x406c00 + (i * 0x20), tpc_set ^ tpc_mask);
+		nv_wr32(priv, 0x406800 + (i * 0x20), lower_32_bits(tpc_set));
+		nv_wr32(priv, 0x406c00 + (i * 0x20), lower_32_bits(tpc_set ^ tpc_mask));
+		if (priv->gpc_nr > 4) {
+			nv_wr32(priv, 0x406804 + (i * 0x20), upper_32_bits(tpc_set));
+			nv_wr32(priv, 0x406c04 + (i * 0x20), upper_32_bits(tpc_set ^ tpc_mask));
+		}
 	}
 }


Replace ASSERT in block.c with fail Job

Replace ASSERT in block.c with fail Job

--- bacula/src/stored/block.c
+++ bacula/src/stored/block.c
@@ -418,25 +418,31 @@
    if (job_canceled(jcr)) {
       return false;
    }
+
    ASSERT(block->binbuf == ((uint32_t) (block->bufp - block->buf)));
-   ASSERT(dev->is_open());
+
+   wlen = block->binbuf;
+   if (wlen <= WRITE_BLKHDR_LENGTH) {  /* Does block have data in it? */
+      Dmsg0(100, "return write_block_to_dev no data to write\n");
+      return true;
+   }

    /* dump_block(block, "before write"); */
    if (dev->at_weot()) {
       Dmsg0(100, "return write_block_to_dev with ST_WEOT\n");
       dev->dev_errno = ENOSPC;
-      Jmsg0(jcr, M_FATAL, 0,  _("Cannot write block. Device at EOM.\n"));
+      Jmsg1(jcr, M_FATAL, 0,  _("Cannot write block. Device at EOM. dev=%s\n"), dev->print_name());
       return false;
    }
    if (!dev->can_append()) {
       dev->dev_errno = EIO;
-      Jmsg(jcr, M_FATAL, 0, _("Attempt to write on read-only Volume.\n"));
-      return false;
-   }
-   wlen = block->binbuf;
-   if (wlen <= WRITE_BLKHDR_LENGTH) {  /* Does block have data in it? */
-      Dmsg0(100, "return write_block_to_dev no data to write\n");
-      return true;
+      Jmsg1(jcr, M_FATAL, 0, _("Attempt to write on read-only Volume. dev=%s\n"), dev->print_name());
+      return false;
+   }
+
+   if (!dev->is_open()) {
+      Jmsg1(jcr, M_FATAL, 0, _("Attempt to write on closed device=%s\n"), dev->print_name());
+      return false;
    }
    /*
     * Clear to the end of the buffer if it is not full,


stmmac: avoid ipq806x constant overflow warning

Building dwmac-ipq806x on a 64-bit architecture produces a harmless
warning from gcc:

stmmac/dwmac-ipq806x.c: In function 'ipq806x_gmac_probe':
include/linux/bitops.h:6:19: warning: overflow in implicit constant conversion [-Woverflow]
  val = QSGMII_PHY_CDR_EN |
stmmac/dwmac-ipq806x.c:333:8: note: in expansion of macro 'QSGMII_PHY_CDR_EN'
 #define QSGMII_PHY_CDR_EN   BIT(0)
 #define BIT(nr)   (1UL << (nr))

This is a result of the type conversion rules in C, when we take the
logical OR of multiple different types. In particular, we have
and unsigned long

	QSGMII_PHY_CDR_EN == BIT(0) == (1ul << 0) == 0x0000000000000001ul

and a signed int

	0xC << QSGMII_PHY_TX_DRV_AMP_OFFSET == 0xc0000000

which together gives a signed long value

	0xffffffffc0000001l

and when this is passed into a function that takes an unsigned int type,
gcc warns about the signed overflow and the loss of the upper 32-bits that
are all ones.

This patch adds 'ul' type modifiers to the literal numbers passed in
here, so now the expression remains an 'unsigned long' with the upper
bits all zero, and that avoids the signed overflow and the warning.

Signed-off-by: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Fixes: b1c17215d718 ("stmmac: add ipq806x glue layer")
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


Possible fix for FreeBSD three-pool regress failure

--- bacula/src/stored/mount.c
+++ bacula/src/stored/mount.c
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution

-   Copyright (C) 2002-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2010 Free Software Foundation Europe e.V.

    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -32,7 +32,6 @@
  *
  *   Kern Sibbald, August MMII
  *
- *   Version $Id$
  */

 #include "bacula.h"                   /* pull in global headers */
@@ -72,7 +71,6 @@
 {
    int retry = 0;
    bool ask = false, recycle, autochanger;
-   bool do_find = true;
    int mode;
    DCR *dcr = this;

@@ -108,21 +106,16 @@
    }
    recycle = false;

-   if (retry >= 2) {
-      do_find = false;
-   }
-
    if (dev->must_unload()) {
       ask = true;                     /* ask operator to mount tape */
-      do_find = true;                 /* re-find a volume after unload */
    }
    unlock_volumes();
    do_unload();
    do_swapping(true /*is_writing*/);
    do_load(true /*is_writing*/);
+
    lock_volumes();
-
-   if (do_find && !find_a_volume()) {
+   if (!find_a_volume()) {
       goto no_lock_bail_out;
    }

@@ -151,7 +144,6 @@
       autochanger = false;
       VolCatInfo.Slot = 0;
       ask = retry >= 2;
-      do_find = true;           /* do find_a_volume if we retry */
    }
    lock_volumes();
    Dmsg1(150, "autoload_dev returns %d\n", autochanger);


staging: ft1000: duplicate code replaced with call to request_code_segment

function scram_dnldr, in ft1000_download.c, is very long and consists
mainly of nested switch statements inside a while loop. Some code in one
of the inner switch cases was almost identical to the code in the
previously extracted function request_code_segment. The duplicated code
was replaced with a call to request_code_segment, and
request_code_segment was slightly modified to work in both cases.

A new parameter was added to request_code_segment, a bool to distinguish
which case it was replacing. The name of an existing parameter (now
called endpoint) was changed to reflect the fact that it will be passed
in from more than one place. Several lines from the case containing the
duplicated code were moved to request_code_segment, and a test was added
to determine if these lines or a line from the original function should
be run.

Finally, an unused variable (tempword) was removed from scram_dnldr.

Signed-off-by: Kelley Nielsen <b1812792f11d87f3fc7e0b08453d666b751bb296@gmail.com>
Reviewed-by: Peter P Waskiewicz Jr <019ca817bcedb2fce0c539efa1b71c24f7a6c1c1@intel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/ft1000/ft1000-usb/ft1000_download.c
+++ drivers/staging/ft1000/ft1000-usb/ft1000_download.c
@@ -576,7 +576,7 @@
 }

 static u16 request_code_segment(struct ft1000_usb *ft1000dev, u16 **s_file,
-		 u8 **c_file, const u8 *boot_end)
+		 u8 **c_file, const u8 *endpoint, bool boot_case)
 {
 	long word_length;
 	u16 status;
@@ -589,7 +589,7 @@
 		DEBUG("FT1000:download:Download error: Max length exceeded\n");
 		return STATUS_FAILURE;
 	}
-	if ((word_length * 2 + (long)c_file) > (long)boot_end) {
+	if ((word_length * 2 + (long)c_file) > (long)endpoint) {
 		/* Error, beyond boot code range.*/
 		DEBUG("FT1000:download:Download error: Requested len=%d exceeds BOOT code boundary.\n", (int)word_length);
 		return STATUS_FAILURE;
@@ -597,9 +597,18 @@
 	if (word_length & 0x1)
 		word_length++;
 	word_length = word_length / 2;
-	status = write_blk(ft1000dev, s_file, c_file, word_length);
-	/*DEBUG("write_blk returned %d\n", status); */
-
+
+	if (boot_case) {
+		status = write_blk(ft1000dev, s_file, c_file, word_length);
+		/*DEBUG("write_blk returned %d\n", status); */
+	} else {
+		write_blk_fifo(ft1000dev, s_file, c_file, word_length);
+		if (ft1000dev->usbboot == 0)
+			ft1000dev->usbboot++;
+		if (ft1000dev->usbboot == 1)
+			ft1000_write_dpram16(ft1000dev,
+					DWNLD_MAG1_PS_HDR_LOC, 0, 0);
+	}
 	return status;
 }

@@ -615,7 +624,6 @@
 	long word_length;
 	u16 request;
 	u16 temp;
-	u16 tempword;

 	struct dsp_file_hdr *file_hdr;
 	struct dsp_image_info *dsp_img_info = NULL;
@@ -703,7 +711,8 @@
 				case REQUEST_CODE_SEGMENT:
 					status = request_code_segment(ft1000dev,
 							&s_file, &c_file,
-							(const u8 *)boot_end);
+							(const u8 *)boot_end,
+							true);
 				break;
 				default:
 					DEBUG
@@ -805,45 +814,10 @@
 						break;
 					}

-					word_length =
-					    get_request_value(ft1000dev);
-					//DEBUG("FT1000:download:word_length = %d\n", (int)word_length);
-					if (word_length > MAX_LENGTH) {
-						DEBUG
-						    ("FT1000:download:Download error: Max length exceeded\n");
-						status = STATUS_FAILURE;
-						break;
-					}
-					if ((word_length * 2 + c_file) >
-					    code_end) {
-						/*
-						 * Error, beyond boot code range.
-						 */
-						DEBUG
-						    ("FT1000:download:Download error: Requested len=%d exceeds DSP code boundary.\n",
-						     (int)word_length);
-						status = STATUS_FAILURE;
-						break;
-					}
-					/*
-					 * Position ASIC DPRAM auto-increment pointer.
-					 */
-					dpram = (u16) DWNLD_MAG1_PS_HDR_LOC;
-					if (word_length & 0x1)
-						word_length++;
-					word_length = word_length / 2;
-
-					write_blk_fifo(ft1000dev, &s_file,
-						       &c_file, word_length);
-					if (ft1000dev->usbboot == 0)
-						ft1000dev->usbboot++;
-					if (ft1000dev->usbboot == 1) {
-						tempword = 0;
-						ft1000_write_dpram16(ft1000dev,
-								     DWNLD_MAG1_PS_HDR_LOC,
-								     tempword,
-								     0);
-					}
+					status = request_code_segment(ft1000dev,
+							&s_file, &c_file,
+							(const u8 *)code_end,
+							false);

 					break;


rtpstats: fix assertion 'denom > 0' failed

gst_util_uint64_scale_int takes a gint as denom parameter
whereas ctx->clock_rate is a guint32.

It happens when gst_rtp_packet_rate_ctx_reset set clock_rate
to -1.

So just define clock_rate as gint like it is done in rtpsource.h

https://bugzilla.gnome.org/show_bug.cgi?id=784250

--- gst/rtpmanager/rtpstats.h
+++ gst/rtpmanager/rtpstats.h
@@ -207,7 +207,7 @@
  */
 typedef struct {
   gboolean probed;
-  guint32 clock_rate;
+  gint clock_rate;
   guint16 last_seqnum;
   guint64 last_ts;
   guint32 avg_packet_rate;


multiudpsink: check the right size when warning about too large udp packets

What matters is the total size, not the size of any of the
individual memory chunks that make up the packet.

--- gst/udp/gstmultiudpsink.c
+++ gst/udp/gstmultiudpsink.c
@@ -468,11 +468,6 @@
     mem = gst_buffer_get_memory (buffer, i);
     gst_memory_map (mem, &map[i], GST_MAP_READ);

-    if (map[i].size > UDP_MAX_SIZE) {
-      GST_WARNING ("Attempting to send a UDP packet larger than maximum "
-          "size (%" G_GSIZE_FORMAT " > %d)", map[i].size, UDP_MAX_SIZE);
-    }
-
     vec[i].buffer = map[i].data;
     vec[i].size = map[i].size;

@@ -485,6 +480,11 @@
    * fast as UDP never blocks */
   g_mutex_lock (&sink->client_lock);
   GST_LOG_OBJECT (bsink, "about to send %" G_GSIZE_FORMAT " bytes", size);
+
+  if (size > UDP_MAX_SIZE) {
+    GST_WARNING_OBJECT (bsink, "Attempting to send a UDP packet larger than "
+        "maximum size (%" G_GSIZE_FORMAT " > %d)", size, UDP_MAX_SIZE);
+  }

   no_clients = 0;
   num = 0;


Allow ODBC3 override attributes to be be set from ODBC2 apps like PHP

git-svn-id: 7b48d109ff117d089af9bc84fe72187a5ba7fd9b@106 ab163d8d-7830-4be3-ba5a-e01213c9a3c2

--- DriverManager/__attribute.c
+++ DriverManager/__attribute.c
@@ -1170,6 +1170,33 @@
                             as -> value );
                 }
             }
+
+            /*
+             * Fall back, the attribute may be ODBC 3 only
+             */
+
+            if ( ret == SQL_ERROR ) {
+
+                if ( CHECK_SQLSETSTMTATTR( connection ))
+                {
+                    if ( as -> is_int_type )
+                    {
+                        ret = SQLSETSTMTATTR( connection,
+                                statement -> driver_stmt,
+                                as -> attribute,
+                                as -> int_value,
+                                0 );
+                    }
+                    else
+                    {
+                        ret = SQLSETSTMTATTR( connection,
+                                statement -> driver_stmt,
+                                as -> attribute,
+                                as -> value,
+                                strlen( as -> value ));
+                    }
+                }
+            }
         }
         if ( log_info.log_flag )
         {


instr0 gets compiled only once

instr0 gets compiled only once

--- Engine/csound_orc_compile.c
+++ Engine/csound_orc_compile.c
@@ -1121,7 +1121,7 @@
 //      }
 //    }

-    // if(csound->instr0 == NULL) /* create instr0 */
+     if(csound->instr0 == NULL) /* create instr0 */
        csound->instr0 = create_instrument0(csound, root, engineState);
     prvinstxt = prvinstxt->nxtinstxt = csound->instr0;
     insert_instrtxt(csound, csound->instr0, 0, engineState);


commented out lgexist

commented out lgexist

--- Engine/csound_orc_compile.c
+++ Engine/csound_orc_compile.c
@@ -292,7 +292,7 @@
       /* IV - Oct 31 2002 */
       tfound_m = ST(typemask_tabl)[(unsigned char) tfound];
       if (!(tfound_m & (ARGTYP_c|ARGTYP_p)) && !ST(lgprevdef) && *s != '"') {
-        synterr(csound, Str("input arg '%s' used before defined"), s);
+        synterr(csound, Str("input arg '%s' used before defined\n"), s);
       }
       csound->DebugMsg(csound, "%s(%d): treqd: %c, tfound %c\n", __FILE__, __LINE__,treqd, tfound);
       csound->DebugMsg(csound, "treqd %c, tfound %c", treqd, tfound);
@@ -1753,7 +1753,8 @@
       return('p');                              /* pnum */
     if (c == '"')
       return('S');                              /* quoted String */
-      ST(lgprevdef) = lgexist(csound, s);       /* (lgprev) */
+    /* VL: commented out to prevent segfaults */
+    /*  ST(lgprevdef) = lgexist(csound, s);  */       /* (lgprev) */
     if (strcmp(s,"sr") == 0    || strcmp(s,"kr") == 0 ||
         strcmp(s,"0dbfs") == 0 || strcmp(s,"nchnls_i") == 0 ||
         strcmp(s,"ksmps") == 0 || strcmp(s,"nchnls") == 0)


removed unused forward declaration

removed unused forward declaration

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@1634 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/include/wx/extension/report/listitem.h
+++ trunk/extension/include/wx/extension/report/listitem.h
@@ -15,8 +15,6 @@
 #include <wx/extension/listview.h>
 #include <wx/extension/statistics.h>
 #include <wx/extension/textfile.h> // for wxExRCS
-
-class wxExListViewWithFrame;

 /// Offers a list item associated with a file on an wxExListView.
 /// The item is coloured according to


desktop-integration: check owner of bus name

It avoids calling D-Bus methods when the bus name
"org.gnome.SessionManager" does not exist.

Silences:
GSpice-WARNING **: Error calling 'org.gnome.SessionManager.Inhibit': GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

--- gtk/desktop-integration.c
+++ gtk/desktop-integration.c
@@ -67,6 +67,7 @@
     gboolean success = TRUE;

 #if defined(USE_GDBUS)
+    gchar *name_owner = NULL;
     priv->gnome_session_proxy =
         g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SESSION,
                                       G_DBUS_PROXY_FLAGS_NONE,
@@ -76,6 +77,12 @@
                                       "org.gnome.SessionManager",
                                       NULL,
                                       &error);
+    if (!error &&
+        (name_owner = g_dbus_proxy_get_name_owner(priv->gnome_session_proxy)) == NULL) {
+        g_clear_object(&priv->gnome_session_proxy);
+        success = FALSE;
+    }
+    g_free(name_owner);
 #else
     success = FALSE;
 #endif


Show all mime handlers in app chooser widget

--- gtk/gtkappchooserwidget.c
+++ gtk/gtkappchooserwidget.c
@@ -534,10 +534,7 @@

       if (!g_app_info_supports_uris (app) &&
           !g_app_info_supports_files (app))
-        continue;
-
-      if (!g_app_info_should_show (app))
-        continue;
+        continue;

       if (g_list_find_custom (exclude_apps, app,
                               (GCompareFunc) compare_apps_func))


Added GtkCellRendererText::max-width-chars property

Added a property to limit the minimum/natural size request
of a text cell renderer.

--- gtk/gtkcellrenderertext.c
+++ gtk/gtkcellrenderertext.c
@@ -83,6 +83,7 @@
   PROP_ATTRIBUTES,
   PROP_SINGLE_PARAGRAPH_MODE,
   PROP_WIDTH_CHARS,
+  PROP_MAX_WIDTH_CHARS,
   PROP_WRAP_WIDTH,
   PROP_ALIGN,

@@ -155,6 +156,7 @@
   gint rise;
   gint fixed_height_rows;
   gint width_chars;
+  gint max_width_chars;
   gint wrap_width;

   guint strikethrough     : 1;
@@ -200,6 +202,7 @@
   priv->font = pango_font_description_new ();

   priv->width_chars = -1;
+  priv->max_width_chars = -1;
   priv->wrap_width = -1;
   priv->wrap_mode = PANGO_WRAP_CHAR;
   priv->align = PANGO_ALIGN_LEFT;
@@ -461,6 +464,31 @@
                                    g_param_spec_int ("width-chars",
                                                      P_("Width In Characters"),
                                                      P_("The desired width of the label, in characters"),
+                                                     -1,
+                                                     G_MAXINT,
+                                                     -1,
+                                                     GTK_PARAM_READWRITE));
+
+
+  /**
+   * GtkCellRendererText:max-width-chars:
+   *
+   * The desired maximum width of the cell, in characters. If this property
+   * is set to -1, the width will be calculated automatically.
+   *
+   * For cell renderers that ellipsize or wrap text; this property
+   * controls the maximum reported width of the cell. The
+   * cell should not receive any greater allocation unless it is
+   * set to expand in its #GtkCellLayout and all of the cell's siblings
+   * have received their natural width.
+   *
+   * Since: 3.0
+   **/
+  g_object_class_install_property (object_class,
+                                   PROP_MAX_WIDTH_CHARS,
+                                   g_param_spec_int ("max-width-chars",
+                                                     P_("Maximum Width In Characters"),
+                                                     P_("The maximum width of the cell, in characters"),
                                                      -1,
                                                      G_MAXINT,
                                                      -1,
@@ -525,6 +553,8 @@
 						      PANGO_ALIGN_LEFT,
 						      GTK_PARAM_READWRITE));

+
+
   /* Style props are set or not */

 #define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (object_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE))
@@ -837,6 +867,10 @@

     case PROP_WIDTH_CHARS:
       g_value_set_int (value, priv->width_chars);
+      break;
+
+    case PROP_MAX_WIDTH_CHARS:
+      g_value_set_int (value, priv->max_width_chars);
       break;

     case PROP_BACKGROUND:
@@ -1287,6 +1321,10 @@
       priv->width_chars = g_value_get_int (value);
       break;

+    case PROP_MAX_WIDTH_CHARS:
+      priv->max_width_chars = g_value_get_int (value);
+      break;
+
     case PROP_ALIGN:
       priv->align = g_value_get_enum (value);
       priv->align_set = TRUE;
@@ -2001,7 +2039,7 @@
   PangoFontMetrics           *metrics;
   PangoRectangle              rect;
   gint char_width, digit_width, char_pixels, text_width, ellipsize_chars, guess_width, xpad;
-  gint min_width;
+  gint min_width, nat_width;

   /* "width-chars" Hard-coded minimum width:
    *    - minimum size should be MAX (width-chars, strlen ("..."));
@@ -2055,17 +2093,28 @@
   else
     min_width = xpad * 2 + rect.x + guess_width;

+  if (priv->width_chars > 0)
+    nat_width = xpad * 2 +
+      MAX ((PANGO_PIXELS (char_width) * priv->width_chars), PANGO_PIXELS (text_width));
+  else
+    nat_width = xpad * 2 + PANGO_PIXELS (text_width);
+
+  nat_width = MAX (nat_width, min_width);
+
+  if (priv->max_width_chars > 0)
+    {
+      gint max_width = xpad * 2 + PANGO_PIXELS (char_width) * priv->max_width_chars;
+
+      min_width = MIN (min_width, max_width);
+      nat_width = MIN (nat_width, max_width);
+    }
+
   if (minimum_size)
     *minimum_size = min_width;

   if (natural_size)
-    {
-      /* Control the max wrap width here possibly (add max-width-chars ?) */
-      *natural_size = xpad * 2 +
-	MAX ((PANGO_PIXELS (char_width) * priv->width_chars), PANGO_PIXELS (text_width));
-
-      *natural_size = MAX (*natural_size, min_width);
-    }
+    *natural_size = nat_width;
+
 }

 static void


doc corrections

doc corrections

--- lib/include/fx/easing/EasingBase.h
+++ lib/include/fx/easing/EasingBase.h
@@ -27,27 +27,27 @@

         /**
          * Ease a transition in
-         * @param[in] time_ The time to do the transition.
+         * @param[in] time The time to do the transition.
          */

         virtual float easeIn(float time) const=0;

         /**
          * Ease a transition out.
-         * @param[in] time_ The time to do the transition.
+         * @param[in] time The time to do the transition.
          */

         virtual float easeOut(float time) const=0;

         /**
          * Ease a transition in and out.
-         * @param[in] time_ The time to do the transition.
+         * @param[in] time The time to do the transition.
          */

         virtual float easeInOut(float time) const=0;

         void setDuration(float duration);
-        void setTotalChangeInPosition(float totalChangeInPosition_);
+        void setTotalChangeInPosition(float totalChangeInPosition);
     };
   }
 }


styleproperty: 3rd hotfix for a 3-line patch

I really should not write code sometimes...

Copy/paste error this time.

--- gtk/gtkcssstyleproperty.c
+++ gtk/gtkcssstyleproperty.c
@@ -466,7 +466,7 @@
   /* XXX: Someone needs to fix that legacy */
   if ((_gtk_css_value_holds (property->initial_value, GDK_TYPE_RGBA) ||
        _gtk_css_value_holds (property->initial_value, GDK_TYPE_COLOR)) &&
-      type == GTK_TYPE_GRADIENT)
+      type == GTK_TYPE_SYMBOLIC_COLOR)
     return TRUE;
   if (_gtk_css_value_holds (property->initial_value, CAIRO_GOBJECT_TYPE_PATTERN) &&
       type == GTK_TYPE_GRADIENT)


filechooserentry: Allow NULL as base folder again

This was removed previously, but is necessary to support the case where
no base folder is in use, which should cause an error. This can be
experienced in save mode in the recent files list.

https://bugzilla.gnome.org/show_bug.cgi?id=663573

--- gtk/gtkfilechooserentry.c
+++ gtk/gtkfilechooserentry.c
@@ -171,7 +171,6 @@
   GtkCellRenderer *cell;

   chooser_entry->local_only = TRUE;
-  chooser_entry->base_folder = g_file_new_for_path (g_get_home_dir ());

   g_object_set (chooser_entry, "truncate-multiline", TRUE, NULL);

@@ -214,7 +213,8 @@
 {
   GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (object);

-  g_object_unref (chooser_entry->base_folder);
+  if (chooser_entry->base_folder)
+    g_object_unref (chooser_entry->base_folder);

   if (chooser_entry->current_folder_file)
     g_object_unref (chooser_entry->current_folder_file);
@@ -304,8 +304,10 @@

   if (str[0] == '~' || g_path_is_absolute (str) || has_uri_scheme (str))
     file = g_file_parse_name (str);
+  else if (chooser_entry->base_folder != NULL)
+    file = g_file_resolve_relative_path (chooser_entry->base_folder, str);
   else
-    file = g_file_resolve_relative_path (chooser_entry->base_folder, str);
+    file = NULL;

   return file;
 }
@@ -317,6 +319,9 @@
   GFile *file, *parent;

   file = gtk_file_chooser_get_file_for_text (chooser_entry, text);
+
+  if (file == NULL)
+    return NULL;

   if (text[0] == 0 || text[strlen (text) - 1] == G_DIR_SEPARATOR)
     return file;
@@ -713,16 +718,16 @@
 _gtk_file_chooser_entry_set_base_folder (GtkFileChooserEntry *chooser_entry,
 					 GFile               *file)
 {
+  g_return_if_fail (GTK_IS_FILE_CHOOSER_ENTRY (chooser_entry));
+  g_return_if_fail (file == NULL || G_IS_FILE (file));
+
+  if (chooser_entry->base_folder == file ||
+      (file != NULL && chooser_entry->base_folder != NULL
+       && g_file_equal (chooser_entry->base_folder, file)))
+    return;
+
   if (file)
     g_object_ref (file);
-  else
-    file = g_file_new_for_path (g_get_home_dir ());
-
-  if (g_file_equal (chooser_entry->base_folder, file))
-    {
-      g_object_unref (file);
-      return;
-    }

   if (chooser_entry->base_folder)
     g_object_unref (chooser_entry->base_folder);