Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5597
b: refs/heads/master
c: 1fcf844
h: refs/heads/master
i:
  5595: f810d2c
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Aug 3, 2005
1 parent 7e84aa8 commit fa6d93f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a68d2ebc1581a3aec57bd032651e013fa609f530
refs/heads/master: 1fcf844861eb08ee05e05dba13b5436f2f2e29ed
16 changes: 15 additions & 1 deletion trunk/arch/arm/mach-s3c2410/mach-bast.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* 28-Jun-2005 BJD Moved pm functionality out to common code
* 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s
* 25-Jul-2005 BJD Removed ASIX static mappings
* 27-Jul-2005 BJD Ensure maximum frequency of i2c bus
*/

#include <linux/kernel.h>
Expand Down Expand Up @@ -60,6 +61,7 @@
#include <asm/arch/regs-mem.h>
#include <asm/arch/regs-lcd.h>
#include <asm/arch/nand.h>
#include <asm/arch/iic.h>

#include <linux/mtd/mtd.h>
#include <linux/mtd/nand.h>
Expand Down Expand Up @@ -304,7 +306,7 @@ static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
}

static struct s3c2410_platform_nand bast_nand_info = {
.tacls = 80,
.tacls = 40,
.twrph0 = 80,
.twrph1 = 80,
.nr_sets = ARRAY_SIZE(bast_nand_sets),
Expand Down Expand Up @@ -385,6 +387,17 @@ static struct platform_device bast_sio = {
},
};

/* we have devices on the bus which cannot work much over the
* standard 100KHz i2c bus frequency
*/

static struct s3c2410_platform_i2c bast_i2c_info = {
.flags = 0,
.slave_addr = 0x10,
.bus_freq = 100*1000,
.max_freq = 130*1000,
};

/* Standard BAST devices */

static struct platform_device *bast_devices[] __initdata = {
Expand Down Expand Up @@ -431,6 +444,7 @@ void __init bast_map_io(void)
s3c24xx_uclk.parent = &s3c24xx_clkout1;

s3c_device_nand.dev.platform_data = &bast_nand_info;
s3c_device_i2c.dev.platform_data = &bast_i2c_info;

s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
s3c24xx_init_clocks(0);
Expand Down
22 changes: 5 additions & 17 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,10 @@ static inline int page_mapped(struct page *page)
* Used to decide whether a process gets delivered SIGBUS or
* just gets major/minor fault counters bumped up.
*/
#define VM_FAULT_OOM 0x00
#define VM_FAULT_SIGBUS 0x01
#define VM_FAULT_MINOR 0x02
#define VM_FAULT_MAJOR 0x03

/*
* Special case for get_user_pages.
* Must be in a distinct bit from the above VM_FAULT_ flags.
*/
#define VM_FAULT_WRITE 0x10
#define VM_FAULT_OOM (-1)
#define VM_FAULT_SIGBUS 0
#define VM_FAULT_MINOR 1
#define VM_FAULT_MAJOR 2

#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)

Expand Down Expand Up @@ -710,13 +704,7 @@ extern pte_t *FASTCALL(pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsign
extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address));
extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);

static inline int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access)
{
return __handle_mm_fault(mm, vma, address, write_access) & (~VM_FAULT_WRITE);
}

extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
extern int make_pages_present(unsigned long addr, unsigned long end);
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
Expand Down
35 changes: 8 additions & 27 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,18 +811,15 @@ static struct page *__follow_page(struct mm_struct *mm, unsigned long address,
pte = *ptep;
pte_unmap(ptep);
if (pte_present(pte)) {
if (write && !pte_write(pte))
if (write && !pte_dirty(pte))
goto out;
if (read && !pte_read(pte))
goto out;
pfn = pte_pfn(pte);
if (pfn_valid(pfn)) {
page = pfn_to_page(pfn);
if (accessed) {
if (write && !pte_dirty(pte) &&!PageDirty(page))
set_page_dirty(page);
if (accessed)
mark_page_accessed(page);
}
return page;
}
}
Expand Down Expand Up @@ -944,13 +941,10 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
}
spin_lock(&mm->page_table_lock);
do {
int write_access = write;
struct page *page;

cond_resched_lock(&mm->page_table_lock);
while (!(page = follow_page(mm, start, write_access))) {
int ret;

while (!(page = follow_page(mm, start, write))) {
/*
* Shortcut for anonymous pages. We don't want
* to force the creation of pages tables for
Expand All @@ -963,18 +957,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
break;
}
spin_unlock(&mm->page_table_lock);
ret = __handle_mm_fault(mm, vma, start, write_access);

/*
* The VM_FAULT_WRITE bit tells us that do_wp_page has
* broken COW when necessary, even if maybe_mkwrite
* decided not to set pte_write. We can thus safely do
* subsequent page lookups as if they were reads.
*/
if (ret & VM_FAULT_WRITE)
write_access = 0;

switch (ret & ~VM_FAULT_WRITE) {
switch (handle_mm_fault(mm,vma,start,write)) {
case VM_FAULT_MINOR:
tsk->min_flt++;
break;
Expand Down Expand Up @@ -1237,7 +1220,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
struct page *old_page, *new_page;
unsigned long pfn = pte_pfn(pte);
pte_t entry;
int ret;

if (unlikely(!pfn_valid(pfn))) {
/*
Expand Down Expand Up @@ -1265,7 +1247,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
lazy_mmu_prot_update(entry);
pte_unmap(page_table);
spin_unlock(&mm->page_table_lock);
return VM_FAULT_MINOR|VM_FAULT_WRITE;
return VM_FAULT_MINOR;
}
}
pte_unmap(page_table);
Expand All @@ -1292,7 +1274,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,
/*
* Re-check the pte - we dropped the lock
*/
ret = VM_FAULT_MINOR;
spin_lock(&mm->page_table_lock);
page_table = pte_offset_map(pmd, address);
if (likely(pte_same(*page_table, pte))) {
Expand All @@ -1309,13 +1290,12 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,

/* Free the old page.. */
new_page = old_page;
ret |= VM_FAULT_WRITE;
}
pte_unmap(page_table);
page_cache_release(new_page);
page_cache_release(old_page);
spin_unlock(&mm->page_table_lock);
return ret;
return VM_FAULT_MINOR;

no_new_page:
page_cache_release(old_page);
Expand Down Expand Up @@ -2007,6 +1987,7 @@ static inline int handle_pte_fault(struct mm_struct *mm,
if (write_access) {
if (!pte_write(entry))
return do_wp_page(mm, vma, address, pte, pmd, entry);

entry = pte_mkdirty(entry);
}
entry = pte_mkyoung(entry);
Expand All @@ -2021,7 +2002,7 @@ static inline int handle_pte_fault(struct mm_struct *mm,
/*
* By the time we get here, we already hold the mm semaphore
*/
int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
unsigned long address, int write_access)
{
pgd_t *pgd;
Expand Down

0 comments on commit fa6d93f

Please sign in to comment.