···273273#if !defined(CONFIG_MMU)274274#define virt_to_phys(address) ((unsigned long)(address))275275#define phys_to_virt(address) ((void *)(address))276276-#elif defined(CONFIG_SUPERH64)276276+#else277277#define virt_to_phys(address) (__pa(address))278278#define phys_to_virt(address) (__va(address))279279-#else280280-/*281281- * Change virtual addresses to physical addresses and vv.282282- * These are trivial on the 1:1 Linux/SuperH mapping283283- */284284-static inline unsigned long virt_to_phys(volatile void *address)285285-{286286- return PHYSADDR(address);287287-}288288-289289-static inline void *phys_to_virt(unsigned long address)290290-{291291- return (void *)P1SEGADDR(address);292292-}293279#endif294280295281/*
+37-13
include/asm-sh/page.h
···55 * Copyright (C) 1999 Niibe Yutaka66 */7788+#include <linux/const.h>99+810#ifdef __KERNEL__9111012/* PAGE_SHIFT determines the page size */···2018# error "Bogus kernel page size?"2119#endif22202323-#ifdef __ASSEMBLY__2424-#define PAGE_SIZE (1 << PAGE_SHIFT)2525-#else2626-#define PAGE_SIZE (1UL << PAGE_SHIFT)2727-#endif2828-2121+#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)2922#define PAGE_MASK (~(PAGE_SIZE-1))3023#define PTE_MASK PAGE_MASK2424+2525+/* to align the pointer to the (next) page boundary */2626+#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)31273228#if defined(CONFIG_HUGETLB_PAGE_SIZE_64K)3329#define HPAGE_SHIFT 16···104104105105#endif /* !__ASSEMBLY__ */106106107107-/* to align the pointer to the (next) page boundary */108108-#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)109109-107107+/*108108+ * __MEMORY_START and SIZE are the physical addresses and size of RAM.109109+ */110110#define __MEMORY_START CONFIG_MEMORY_START111111#define __MEMORY_SIZE CONFIG_MEMORY_SIZE112112113113+/*114114+ * PAGE_OFFSET is the virtual address of the start of kernel address115115+ * space.116116+ */113117#define PAGE_OFFSET CONFIG_PAGE_OFFSET114114-#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)115115-#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))116116-#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)117118119119+/*120120+ * Virtual to physical RAM address translation.121121+ *122122+ * In 29 bit mode, the physical offset of RAM from address 0 is visible in123123+ * the kernel virtual address space, and thus we don't have to take124124+ * this into account when translating. However in 32 bit mode this offset125125+ * is not visible (it is part of the PMB mapping) and so needs to be126126+ * added or subtracted as required.127127+ */128128+#ifdef CONFIG_32BIT129129+#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET+__MEMORY_START)130130+#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET-__MEMORY_START))131131+#else132132+#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)133133+#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))134134+#endif135135+136136+#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)118137#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)119138120120-/* PFN start number, because of __MEMORY_START */139139+/*140140+ * PFN = physical frame number (ie PFN 0 == physical address 0)141141+ * PFN_START is the PFN of the first page of RAM. By defining this we142142+ * don't have struct page entries for the portion of address space143143+ * between physical address 0 and the start of RAM.144144+ */121145#define PFN_START (__MEMORY_START >> PAGE_SHIFT)122146#define ARCH_PFN_OFFSET (PFN_START)123147#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
···11#ifndef __ASM_SH_SCATTERLIST_H22#define __ASM_SH_SCATTERLIST_H3344+#include <asm/pgtable.h>45#include <asm/types.h>5667struct scatterlist {···1413 unsigned int length;1514};16151717-#define ISA_DMA_THRESHOLD (0x1fffffff)1616+#define ISA_DMA_THRESHOLD PHYS_ADDR_MASK18171918/* These macros should be used after a pci_map_sg call has been done2019 * to get bus addresses of each of the SG entries and their lengths.