OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [mmnommu/] [memory.c] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 *  linux/mm/memory.c
3
 *
4
 *  Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
5
 */
6
 
7
/*
8
 * uClinux revisions for NO_MM
9
 * Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
10
 *                     The Silver Hammer Group, Ltd.
11
 */
12
 
13
#include <linux/config.h>
14
#include <linux/signal.h>
15
#include <linux/sched.h>
16
#include <linux/head.h>
17
#include <linux/kernel.h>
18
#include <linux/errno.h>
19
#include <linux/string.h>
20
#include <linux/types.h>
21
#include <linux/ptrace.h>
22
#include <linux/mman.h>
23
#include <linux/mm.h>
24
#include <linux/malloc.h>
25
#include <linux/swap.h>
26
 
27
#include <asm/system.h>
28
#include <asm/segment.h>
29
#include <asm/pgtable.h>
30
#include <asm/string.h>
31
 
32
unsigned long high_memory = 0;
33
 
34
mem_map_t * mem_map = NULL;
35
 
36
/*
37
 * oom() prints a message (so that the user knows why the process died),
38
 * and gives the process an untrappable SIGKILL.
39
 */
40
void oom(struct task_struct * task)
41
{
42
        printk("\nOut of memory for %s.\n", task->comm);
43
        task->sig->action[SIGKILL-1].sa_handler = NULL;
44
        task->blocked &= ~(1<<(SIGKILL-1));
45
        send_sig(SIGKILL,task,1);
46
}
47
 
48
#ifdef DEBUG_VERIFY_AREA
49
#undef verify_area
50
int verify_area_flf(int type, const void * addr, unsigned long size, char *file, int line, char * function)
51
{
52
        int result;
53
        result = verify_area(type, addr, size);
54
        if (result)
55
                printk("%s:%d %s> verify_area(%d,%p,%ld) = %d\n",file,line, function, type, addr, size, result);
56
        return result;
57
}
58
#endif /* DEBUG_VERIFY_AREA */
59
 
60
/* FIXME:  Need to check the architecture memory map
61
 * DJD.
62
 */
63
int verify_area(int type, const void * addr, unsigned long size)
64
{
65
#ifdef CONFIG_COLDFIRE
66
        extern unsigned long _ramend;
67
        if ((unsigned long)addr > _ramend) {
68
#else
69 988 simons
        if ((unsigned long)addr > 0xf0800000) {
70 199 simons
#endif
71
                printk("Bad verify_area in process %d: %lx\n",
72
                        current->pid, (unsigned long)addr);
73
                return -EFAULT;
74
        }
75
        return 0;
76
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.