Revision 54866f032307063776b4eff7eadb131d47f9f9b4 authored by Linus Torvalds on 01 November 2007, 19:09:33 UTC, committed by Linus Torvalds on 01 November 2007, 19:09:33 UTC
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [IRDA] IRNET: Fix build when TCGETS2 is defined.
  [NET]: docbook fixes for netif_ functions
  [NET]: Hide the net_ns kmem cache
  [NET]: Mark the setup_net as __net_init
  [NET]: Hide the dead code in the net_namespace.c
  [NET]: Relax the reference counting of init_net_ns
  [NETNS]: Make the init/exit hooks checks outside the loop
  [NET]: Forget the zero_it argument of sk_alloc()
  [NET]: Remove bogus zero_it argument from sk_alloc
  [NET]: Make the sk_clone() lighter
  [NET]: Move some core sock setup into sk_prot_alloc
  [NET]: Auto-zero the allocated sock object
  [NET]: Cleanup the allocation/freeing of the sock object
  [NET]: Move the get_net() from sock_copy()
  [NET]: Move the sock_copy() from the header
  [TCP]: Another TAGBITS -> SACKED_ACKED|LOST conversion
  [TCP]: Process DSACKs that reside within a SACK block
2 parent s b4d367f + 49259d3
Raw File
pgalloc.h
/*
 * Copyright (C) 2004-2006 Atmel Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __ASM_AVR32_PGALLOC_H
#define __ASM_AVR32_PGALLOC_H

#include <asm/processor.h>
#include <linux/threads.h>
#include <linux/slab.h>
#include <linux/mm.h>

#define pmd_populate_kernel(mm, pmd, pte) \
	set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)))

static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
				    struct page *pte)
{
	set_pmd(pmd, __pmd(_PAGE_TABLE + page_to_phys(pte)));
}

/*
 * Allocate and free page tables
 */
static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
{
	return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL);
}

static inline void pgd_free(pgd_t *pgd)
{
	kfree(pgd);
}

static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
					  unsigned long address)
{
	pte_t *pte;

	pte = (pte_t *)get_zeroed_page(GFP_KERNEL | __GFP_REPEAT);

	return pte;
}

static inline struct page *pte_alloc_one(struct mm_struct *mm,
					 unsigned long address)
{
	struct page *pte;

	pte = alloc_page(GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO);

	return pte;
}

static inline void pte_free_kernel(pte_t *pte)
{
	free_page((unsigned long)pte);
}

static inline void pte_free(struct page *pte)
{
	__free_page(pte);
}

#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))

#define check_pgt_cache() do { } while(0)

#endif /* __ASM_AVR32_PGALLOC_H */
back to top