Commit ba00f557 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Import 1.1.36

parent f48455d2
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 35
SUBLEVEL = 36
all: Version zImage
......
......@@ -629,6 +629,27 @@ static void csi_K(int currcons, int vpar)
need_wrap = 0;
}
static void csi_X(int currcons, int vpar)
{
long count;
long start;
if (!vpar)
vpar++;
start=pos;
count=(vpar > video_num_columns-x) ? (video_num_columns-x) : vpar;
__asm__("cld\n\t"
"rep\n\t"
"stosw\n\t"
: /* no output */
:"c" (count),
"D" (start),"a" (video_erase_char)
:"cx","di");
need_wrap = 0;
}
/*
* I hope this works. The monochrome part is untested.
*/
......@@ -1347,6 +1368,9 @@ static int con_write(struct tty_struct * tty, int from_user,
case 'u':
restore_cur(currcons);
continue;
case 'X':
csi_X(currcons, par[0]);
continue;
case '@':
csi_at(currcons,par[0]);
continue;
......
......@@ -83,34 +83,18 @@ static int write_mem(struct inode * inode, struct file * file,char * buf, int co
return count;
}
static int mmap_mem(struct inode * inode, struct file * file,
unsigned long addr, size_t len, int prot, unsigned long off)
static int mmap_mem(struct inode * inode, struct file * file, struct vm_area_struct * vma)
{
struct vm_area_struct * mpnt;
if (off & 0xfff || off + len < off)
if (vma->vm_offset & ~PAGE_MASK)
return -ENXIO;
if (x86 > 3 && off >= high_memory)
prot |= PAGE_PCD;
if (remap_page_range(addr, off, len, prot))
if (x86 > 3 && vma->vm_offset >= high_memory)
vma->vm_page_prot |= PAGE_PCD;
if (remap_page_range(vma->vm_start, vma->vm_offset, vma->vm_end - vma->vm_start, vma->vm_page_prot))
return -EAGAIN;
/* try to create a dummy vmm-structure so that the rest of the kernel knows we are here */
mpnt = (struct vm_area_struct * ) kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
if (!mpnt)
return 0;
mpnt->vm_task = current;
mpnt->vm_start = addr;
mpnt->vm_end = addr + len;
mpnt->vm_page_prot = prot;
mpnt->vm_flags = 0;
mpnt->vm_share = NULL;
mpnt->vm_inode = inode;
vma->vm_inode = inode;
inode->i_count++;
mpnt->vm_offset = off;
mpnt->vm_ops = NULL;
insert_vm_struct(current, mpnt);
merge_segments(current->mm->mmap, NULL, NULL);
insert_vm_struct(current, vma);
merge_segments(current->mm->mmap);
return 0;
}
......@@ -177,34 +161,14 @@ static int read_zero(struct inode * node,struct file * file,char * buf,int count
return count;
}
static int mmap_zero(struct inode * inode, struct file * file,
unsigned long addr, size_t len, int prot, unsigned long off)
static int mmap_zero(struct inode * inode, struct file * file, struct vm_area_struct * vma)
{
struct vm_area_struct *mpnt;
if (prot & PAGE_RW)
if (vma->vm_page_prot & PAGE_RW)
return -EINVAL;
if (zeromap_page_range(addr, len, prot))
if (zeromap_page_range(vma->vm_start, vma->vm_end - vma->vm_start, vma->vm_page_prot))
return -EAGAIN;
/*
* try to create a dummy vmm-structure so that the
* rest of the kernel knows we are here
*/
mpnt = (struct vm_area_struct *)kmalloc(sizeof(*mpnt), GFP_KERNEL);
if (!mpnt)
return 0;
mpnt->vm_task = current;
mpnt->vm_start = addr;
mpnt->vm_end = addr + len;
mpnt->vm_page_prot = prot;
mpnt->vm_flags = 0;
mpnt->vm_share = NULL;
mpnt->vm_inode = NULL;
mpnt->vm_offset = off;
mpnt->vm_ops = NULL;
insert_vm_struct(current, mpnt);
merge_segments(current->mm->mmap, ignoff_mergep, inode);
insert_vm_struct(current, vma);
merge_segments(current->mm->mmap);
return 0;
}
......
static char *version =
"de600.c: $Revision: 1.39 $, Bjorn Ekwall (bj0rn@blox.se)\n";
"de600.c: $Revision: 1.40 $, Bjorn Ekwall (bj0rn@blox.se)\n";
/*
* de600.c
*
......@@ -76,8 +76,10 @@ static char *version =
* Tricks TCP to announce a small max window (max 2 fast packets please :-)
*
* Comment away at your own risk!
*
* Update: Use the more general per-device maxwindow parameter instead.
*/
#define FAKE_SMALL_MAX
#undef FAKE_SMALL_MAX
/* use 0 for production, 1 for verification, >2 for debug */
#ifdef DE600_DEBUG
......@@ -106,8 +108,10 @@ unsigned int de600_debug = DE600_DEBUG;
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#endif
#ifdef FAKE_SMALL_MAX
static unsigned long de600_rspace(struct sock *sk);
......
/*
* de620.c $Revision: 1.30 $ BETA
* de620.c $Revision: 1.31 $ BETA
*
*
* Linux driver for the D-Link DE-620 Ethernet pocket adapter.
......@@ -39,7 +39,7 @@
*
*****************************************************************************/
static char *version =
"de620.c: $Revision: 1.30 $, Bjorn Ekwall <bj0rn@blox.se>\n";
"de620.c: $Revision: 1.31 $, Bjorn Ekwall <bj0rn@blox.se>\n";
/***********************************************************************
*
......@@ -119,8 +119,10 @@ static char *version =
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#endif
/* Constant definitions for the DE-620 registers, commands and bits */
#include "de620.h"
......
......@@ -794,7 +794,7 @@ sb_dsp_init (long mem_start, struct address_info *hw_config)
mixer_type = sb_mixer_init (sbc_major);
#endif
#ifndef EXCLUDE_YM8312
#ifndef EXCLUDE_YM3812
if (sbc_major > 3 ||
(sbc_major == 3 && INB (0x388) == 0x00)) /* Should be 0x06 if not OPL-3 */
......
......@@ -322,11 +322,12 @@ unsigned long * create_tables(char * p,int argc,int envc,int ibcs)
mpnt->vm_start = PAGE_MASK & (unsigned long) p;
mpnt->vm_end = TASK_SIZE;
mpnt->vm_page_prot = PAGE_PRIVATE|PAGE_DIRTY;
mpnt->vm_flags = VM_GROWSDOWN;
mpnt->vm_flags = VM_STACK_FLAGS;
mpnt->vm_share = NULL;
mpnt->vm_inode = NULL;
mpnt->vm_offset = 0;
mpnt->vm_ops = NULL;
mpnt->vm_offset = 0;
mpnt->vm_inode = NULL;
mpnt->vm_pte = 0;
insert_vm_struct(current, mpnt);
}
sp = (unsigned long *) (0xfffffffc & (unsigned long) p);
......@@ -525,10 +526,6 @@ void flush_old_exec(struct linux_binprm * bprm)
current->comm[i] = '\0';
if (current->shm)
shm_exit();
if (current->executable) {
iput(current->executable);
current->executable = NULL;
}
/* Release all of the old mmap stuff. */
mpnt = current->mm->mmap;
......@@ -821,7 +818,6 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
(current->mm->start_code = N_TXTADDR(ex)))));
current->mm->rss = 0;
current->mm->mmap = NULL;
current->executable = NULL; /* for OMAGIC files */
current->suid = current->euid = bprm->e_uid;
current->sgid = current->egid = bprm->e_gid;
if (N_MAGIC(ex) == OMAGIC) {
......@@ -851,7 +847,8 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
if (ex.a_text) {
error = do_mmap(file, N_TXTADDR(ex), ex.a_text,
PROT_READ | PROT_EXEC,
MAP_FIXED | MAP_SHARED, fd_offset);
MAP_FIXED | MAP_SHARED | MAP_DENYWRITE,
fd_offset);
if (error != N_TXTADDR(ex)) {
sys_close(fd);
......@@ -862,14 +859,13 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
error = do_mmap(file, N_TXTADDR(ex) + ex.a_text, ex.a_data,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE, fd_offset + ex.a_text);
MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE,
fd_offset + ex.a_text);
sys_close(fd);
if (error != N_TXTADDR(ex) + ex.a_text) {
send_sig(SIGSEGV, current, 0);
return -EINVAL;
}
current->executable = bprm->inode;
bprm->inode->i_count++;
}
beyond_if:
if (current->exec_domain && current->exec_domain->use_count)
......@@ -939,7 +935,8 @@ static int load_aout_library(int fd)
/* Now use mmap to map the library into memory. */
error = do_mmap(file, start_addr, ex.a_text + ex.a_data,
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_FIXED | MAP_PRIVATE,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE,
N_TXTOFF(ex));
if (error != start_addr)
return error;
......
......@@ -81,19 +81,11 @@ struct vm_operations_struct msdos_file_mmap = {
* This is used for a general mmap of an msdos file
* Returns 0 if ok, or a negative error code if not.
*/
int msdos_mmap(
struct inode * inode,
struct file * file,
unsigned long addr,
size_t len,
int prot,
unsigned long off)
int msdos_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)
{
struct vm_area_struct * mpnt;
if (prot & PAGE_RW) /* only PAGE_COW or read-only supported now */
if (vma->vm_page_prot & PAGE_RW) /* only PAGE_COW or read-only supported now */
return -EINVAL;
if (off & (inode->i_sb->s_blocksize - 1))
if (vma->vm_offset & (inode->i_sb->s_blocksize - 1))
return -EINVAL;
if (!inode->i_sb || !S_ISREG(inode->i_mode))
return -EACCES;
......@@ -102,22 +94,12 @@ int msdos_mmap(
inode->i_dirt = 1;
}
mpnt = (struct vm_area_struct * ) kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
if (!mpnt)
return -ENOMEM;
unmap_page_range(addr, len);
mpnt->vm_task = current;
mpnt->vm_start = addr;
mpnt->vm_end = addr + len;
mpnt->vm_page_prot = prot;
mpnt->vm_share = NULL;
mpnt->vm_inode = inode;
unmap_page_range(vma->vm_start, vma->vm_end - vma->vm_start);
vma->vm_inode = inode;
inode->i_count++;
mpnt->vm_offset = off;
mpnt->vm_ops = &msdos_file_mmap;
insert_vm_struct (current,mpnt);
merge_segments (current->mm->mmap,NULL,NULL);
vma->vm_ops = &msdos_file_mmap;
insert_vm_struct(current, vma);
merge_segments(current->mm->mmap);
return 0;
}
......@@ -353,14 +353,12 @@ int open_namei(const char * pathname, int flag, int mode,
struct vm_area_struct * mpnt;
if (!*p)
continue;
if (inode == (*p)->executable) {
iput(inode);
return -ETXTBSY;
}
for(mpnt = (*p)->mm->mmap; mpnt; mpnt = mpnt->vm_next) {
if (inode != mpnt->vm_inode)
continue;
if (mpnt->vm_page_prot & PAGE_RW)
continue;
if (inode == mpnt->vm_inode) {
if (mpnt->vm_flags & VM_DENYWRITE) {
iput(inode);
return -ETXTBSY;
}
......
......@@ -21,8 +21,7 @@
static int nfs_file_read(struct inode *, struct file *, char *, int);
static int nfs_file_write(struct inode *, struct file *, char *, int);
static int nfs_fsync(struct inode *, struct file *);
extern int nfs_mmap(struct inode * inode, struct file * file,
unsigned long addr, size_t len, int prot, unsigned long off);
extern int nfs_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
static struct file_operations nfs_file_operations = {
NULL, /* lseek - default */
......
......@@ -85,14 +85,9 @@ struct vm_operations_struct nfs_file_mmap = {
/* This is used for a general mmap of a nfs file */
int nfs_mmap(struct inode * inode, struct file * file,
unsigned long addr, size_t len, int prot, unsigned long off)
int nfs_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)
{
struct vm_area_struct * mpnt;
if (prot & PAGE_RW) /* only PAGE_COW or read-only supported now */
return -EINVAL;
if (off & (inode->i_sb->s_blocksize - 1))
if (vma->vm_page_prot & PAGE_RW) /* only PAGE_COW or read-only supported now */
return -EINVAL;
if (!inode->i_sb || !S_ISREG(inode->i_mode))
return -EACCES;
......@@ -101,22 +96,11 @@ int nfs_mmap(struct inode * inode, struct file * file,
inode->i_dirt = 1;
}
mpnt = (struct vm_area_struct * ) kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
if (!mpnt)
return -ENOMEM;
unmap_page_range(addr, len);
mpnt->vm_task = current;
mpnt->vm_start = addr;
mpnt->vm_end = addr + len;
mpnt->vm_page_prot = prot;
mpnt->vm_flags = 0;
mpnt->vm_share = NULL;
mpnt->vm_inode = inode;
unmap_page_range(vma->vm_start, vma->vm_end - vma->vm_start);
vma->vm_inode = inode;
inode->i_count++;
mpnt->vm_offset = off;
mpnt->vm_ops = &nfs_file_mmap;
insert_vm_struct(current, mpnt);
merge_segments(current->mm->mmap, NULL, NULL);
vma->vm_ops = &nfs_file_mmap;
insert_vm_struct(current, vma);
merge_segments(current->mm->mmap);
return 0;
}
......@@ -410,32 +410,17 @@ static int get_maps(int pid, char *buf)
for(map = (*p)->mm->mmap; map != NULL; map = map->vm_next) {
char str[7], *cp = str;
int prot = map->vm_page_prot;
int perms, flags;
int flags;
int end = sz + 80; /* Length of line */
dev_t dev;
unsigned long ino;
/*
* This tries to get an "rwxsp" string out of silly
* intel page permissions. The vm_area_struct should
* probably have the original mmap args preserved.
*/
flags = perms = 0;
if ((prot & PAGE_READONLY) == PAGE_READONLY)
perms |= PROT_READ | PROT_EXEC;
if (prot & (PAGE_COW|PAGE_RW)) {
perms |= PROT_WRITE | PROT_READ;
flags = prot & PAGE_COW ? MAP_PRIVATE : MAP_SHARED;
}
flags = map->vm_flags;
*cp++ = perms & PROT_READ ? 'r' : '-';
*cp++ = perms & PROT_WRITE ? 'w' : '-';
*cp++ = perms & PROT_EXEC ? 'x' : '-';
*cp++ = flags & MAP_SHARED ? 's' : '-';
*cp++ = flags & MAP_PRIVATE ? 'p' : '-';
*cp++ = flags & VM_READ ? 'r' : '-';
*cp++ = flags & VM_WRITE ? 'w' : '-';
*cp++ = flags & VM_EXEC ? 'x' : '-';
*cp++ = flags & VM_SHARED ? 's' : 'p';
*cp++ = 0;
if (end >= PAGE_SIZE) {
......
......@@ -71,9 +71,17 @@ static int proc_follow_link(struct inode * dir, struct inode * inode,
case 5:
inode = p->fs->root;
break;
case 6:
inode = p->executable;
case 6: {
struct vm_area_struct * vma = p->mm->mmap;
while (vma) {
if (vma->vm_flags & VM_DENYWRITE) {
inode = vma->vm_inode;
break;
}
vma = vma->vm_next;
}
break;
}
default:
switch (ino >> 8) {
case 1:
......
......@@ -292,7 +292,7 @@ struct file_operations {
int (*readdir) (struct inode *, struct file *, struct dirent *, int);
int (*select) (struct inode *, struct file *, int, select_table *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
int (*mmap) (struct inode *, struct file *, unsigned long, size_t, int, unsigned long);
int (*mmap) (struct inode *, struct file *, struct vm_area_struct *);
int (*open) (struct inode *, struct file *);
void (*release) (struct inode *, struct file *);
int (*fsync) (struct inode *, struct file *);
......@@ -464,7 +464,7 @@ extern int read_ahead[];
extern int char_write(struct inode *, struct file *, char *, int);
extern int block_write(struct inode *, struct file *, char *, int);
extern int generic_mmap(struct inode *, struct file *, unsigned long, size_t, int, unsigned long);
extern int generic_mmap(struct inode *, struct file *, struct vm_area_struct *);
extern int block_fsync(struct inode *, struct file *);
extern int file_fsync(struct inode *, struct file *);
......
......@@ -34,17 +34,31 @@ struct vm_area_struct {
unsigned short vm_flags;
struct vm_area_struct * vm_next; /* linked list */
struct vm_area_struct * vm_share; /* linked list */
struct inode * vm_inode;
unsigned long vm_offset;
struct vm_operations_struct * vm_ops;
unsigned long vm_offset;
struct inode * vm_inode;
unsigned long vm_pte; /* shared mem */
};
/*
* vm_flags..
*/
#define VM_GROWSDOWN 0x01
#define VM_GROWSUP 0x02
#define VM_SHM 0x04
#define VM_READ 0x0001 /* currently active flags */
#define VM_WRITE 0x0002
#define VM_EXEC 0x0004
#define VM_SHARED 0x0008
#define VM_MAYREAD 0x0010 /* limits for mprotect() etc */
#define VM_MAYWRITE 0x0020
#define VM_MAYEXEC 0x0040
#define VM_MAYSHARE 0x0080
#define VM_GROWSDOWN 0x0100 /* general info on the segment */
#define VM_GROWSUP 0x0200
#define VM_SHM 0x0400
#define VM_DENYWRITE 0x0800 /* ETXTBSY on write attempts.. */
#define VM_STACK_FLAGS 0x0177
/*
* These are the virtual MM functions - opening of an area, closing it (needed to
......@@ -178,12 +192,8 @@ extern void rw_swap_page(int rw, unsigned long nr, char * buf);
/* mmap.c */
extern int do_mmap(struct file * file, unsigned long addr, unsigned long len,
unsigned long prot, unsigned long flags, unsigned long off);
typedef int (*map_mergep_fnp)(const struct vm_area_struct *,
const struct vm_area_struct *, void *);
extern void merge_segments(struct vm_area_struct *, map_mergep_fnp, void *);
extern void merge_segments(struct vm_area_struct *);
extern void insert_vm_struct(struct task_struct *, struct vm_area_struct *);
extern int ignoff_mergep(const struct vm_area_struct *,
const struct vm_area_struct *, void *);
extern int do_munmap(unsigned long, size_t);
#define read_swap_page(nr,buf) \
......
......@@ -12,4 +12,7 @@
#define MAP_FIXED 0x10 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x20 /* don't use a file */
#define MAP_GROWSDOWN 0x0400 /* stack-like segment */
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
#endif /* _LINUX_MMAN_H */
......@@ -192,8 +192,7 @@ extern struct inode_operations msdos_file_inode_operations_no_bmap;
extern void msdos_truncate(struct inode *inode);
/* mmap.c */
extern int msdos_mmap (struct inode *, struct file *, unsigned long, size_t
,int , unsigned long);
extern int msdos_mmap(struct inode *, struct file *, struct vm_area_struct *);
#endif /* __KERNEL__ */
......
......@@ -112,8 +112,7 @@ extern struct inode_operations nfs_symlink_inode_operations;
/* linux/fs/nfs/mmap.c */
extern int nfs_mmap(struct inode * inode, struct file * file,
unsigned long addr, size_t len, int prot, unsigned long off);
extern int nfs_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
#endif /* __KERNEL__ */
......
......@@ -289,7 +289,7 @@ struct task_struct {
/* file system info */
int link_count;
struct tty_struct *tty; /* NULL if no tty */
struct inode * executable;
/* shm stuff */
struct shm_desc *shm;
struct sem_undo *semun;
/* ldt for this task - used by Wine. If NULL, default_ldt is used */
......@@ -343,7 +343,7 @@ struct task_struct {
/* math */ 0, \
/* comm */ "swapper", \
/* vm86_info */ NULL, 0, 0, 0, 0, \
/* fs info */ 0,NULL,NULL, \
/* fs info */ 0,NULL, \
/* ipc */ NULL, NULL, \
/* ldt */ NULL, \
/* tss */ INIT_TSS, \
......
......@@ -80,4 +80,10 @@ struct timer_list {
extern void add_timer(struct timer_list * timer);
extern int del_timer(struct timer_list * timer);
extern inline void init_timer(struct timer_list * timer)
{
timer->next = NULL;
timer->prev = NULL;
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment