Commit d617a16f authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.12pre2

parent 1b8b0760
......@@ -111,7 +111,7 @@ FILESYSTEMS =fs/filesystems.a
NETWORKS =net/network.a
DRIVERS =drivers/block/block.a \
drivers/char/char.a \
drivers/misc/misc.a
drivers/parport/parport.a
LIBS =$(TOPDIR)/lib/lib.a
SUBDIRS =kernel drivers mm fs net ipc lib
......
......@@ -188,7 +188,7 @@ tristate 'Kernel support for a.out (ECOFF) binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
tristate 'Kernel support for Linux/Intel ELF binaries' CONFIG_BINFMT_EM86
source drivers/misc/Config.in
source drivers/parpor/Config.in
endmenu
source drivers/pnp/Config.in
......
......@@ -297,10 +297,10 @@ setup_arch(char **cmdline_p, unsigned long * memory_start_p, unsigned long * mem
setup_processor();
init_task.mm->start_code = TASK_SIZE;
init_task.mm->end_code = TASK_SIZE + (unsigned long) &_etext;
init_task.mm->end_data = TASK_SIZE + (unsigned long) &_edata;
init_task.mm->brk = TASK_SIZE + (unsigned long) &_end;
init_mm.start_code = TASK_SIZE;
init_mm.end_code = TASK_SIZE + (unsigned long) &_etext;
init_mm.end_data = TASK_SIZE + (unsigned long) &_edata;
init_mm.brk = TASK_SIZE + (unsigned long) &_end;
/*
* Add your machine dependencies here
......
......@@ -106,7 +106,7 @@ static void do_page_fault(unsigned long addr, int mode, struct pt_regs *regs)
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
if (in_interrupt() || mm == &init_mm)
if (in_interrupt() || !mm)
goto no_context;
down(&mm->mmap_sem);
......
......@@ -92,7 +92,7 @@ tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
source drivers/misc/Config.in
source drivers/parport/Config.in
bool 'Advanced Power Management BIOS support' CONFIG_APM
if [ "$CONFIG_APM" = "y" ]; then
......
......@@ -313,10 +313,10 @@ __initfunc(void setup_arch(char **cmdline_p,
if (!MOUNT_ROOT_RDONLY)
root_mountflags &= ~MS_RDONLY;
memory_start = (unsigned long) &_end;
init_task.mm->start_code = PAGE_OFFSET;
init_task.mm->end_code = (unsigned long) &_etext;
init_task.mm->end_data = (unsigned long) &_edata;
init_task.mm->brk = (unsigned long) &_end;
init_mm.start_code = PAGE_OFFSET;
init_mm.end_code = (unsigned long) &_etext;
init_mm.end_data = (unsigned long) &_edata;
init_mm.brk = (unsigned long) &_end;
/* Save unparsed command line copy for /proc/cmdline */
memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
......@@ -354,7 +354,7 @@ __initfunc(void setup_arch(char **cmdline_p,
*to = '\0';
*cmdline_p = command_line;
#define VMALLOC_RESERVE (64 << 20) /* 64MB for vmalloc */
#define VMALLOC_RESERVE (128 << 20) /* 128MB for vmalloc and initrd */
#define MAXMEM ((unsigned long)(-PAGE_OFFSET-VMALLOC_RESERVE))
if (memory_end > MAXMEM)
......
......@@ -283,8 +283,8 @@ asmlinkage void math_emulate(long arg)
FPU_EIP = FPU_ORIG_EIP; /* Point to current FPU instruction. */
RE_ENTRANT_CHECK_OFF;
current->tss.trap_no = 16;
current->tss.error_code = 0;
current->thread.trap_no = 16;
current->thread.error_code = 0;
send_sig(SIGFPE, current, 1);
return;
}
......@@ -662,8 +662,8 @@ static int valid_prefix(u_char *Byte, u_char **fpu_eip,
void math_abort(struct info * info, unsigned int signal)
{
FPU_EIP = FPU_ORIG_EIP;
current->tss.trap_no = 16;
current->tss.error_code = 0;
current->thread.trap_no = 16;
current->thread.error_code = 0;
send_sig(signal,current,1);
RE_ENTRANT_CHECK_OFF;
__asm__("movl %0,%%esp ; ret": :"g" (((long) info)-4));
......
......@@ -33,7 +33,7 @@
#define SEG_EXPAND_DOWN(s) (((s).b & ((1 << 11) | (1 << 10))) \
== (1 << 10))
#define I387 (current->tss.i387)
#define I387 (current->thread.i387)
#define FPU_info (I387.soft.info)
#define FPU_CS (*(unsigned short *) &(FPU_info->___cs))
......
......@@ -805,7 +805,7 @@ static void unswap_process(struct mm_struct * mm, unsigned long entry,
/*
* Go through process' page directory.
*/
if (!mm || mm == &init_mm)
if (!mm)
return;
for (vma = mm->mmap; vma; vma = vma->vm_next) {
pgd_t * pgd = pgd_offset(mm, vma->vm_start);
......
......@@ -43,7 +43,7 @@ static struct fs_struct init_fs = INIT_FS;
static struct file * init_fd_array[NR_OPEN] = { NULL, };
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS;
struct mm_struct init_mm = INIT_MM;
struct mm_struct init_mm = INIT_MM(init_mm);
union task_union init_task_union
__attribute__((section("init_task"), aligned(2*PAGE_SIZE)))
......
......@@ -213,10 +213,10 @@ __initfunc(void setup_arch(char **cmdline_p, unsigned long * memory_start_p,
asm __volatile__ ("frestore %0" : : "m" (zero));
}
init_task.mm->start_code = PAGE_OFFSET;
init_task.mm->end_code = (unsigned long) &_etext;
init_task.mm->end_data = (unsigned long) &_edata;
init_task.mm->brk = (unsigned long) &_end;
init_mm.start_code = PAGE_OFFSET;
init_mm.end_code = (unsigned long) &_etext;
init_mm.end_data = (unsigned long) &_edata;
init_mm.brk = (unsigned long) &_end;
*cmdline_p = m68k_command_line;
memcpy(saved_command_line, *cmdline_p, CL_SIZE);
......
......@@ -49,7 +49,7 @@ asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
if (in_interrupt() || mm == &init_mm)
if (in_interrupt() || !mm)
goto no_context;
down(&mm->mmap_sem);
......
......@@ -93,7 +93,7 @@ bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
bool 'Sysctl support' CONFIG_SYSCTL
if [ "$CONFIG_SGI" != "y" -a "$CONFIG_DECSTATION" != "y" -a "$CONFIG_BAGET_MIPS" != "y" ]; then
source drivers/misc/Config.in
source drivers/parport/Config.in
fi
endmenu
......
......@@ -55,7 +55,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
if (in_interrupt() || mm == &init_mm)
if (in_interrupt() || !mm)
goto no_context;
#if 0
printk("[%s:%d:%08lx:%ld:%08lx]\n", current->comm, current->pid,
......
......@@ -66,7 +66,7 @@ define_bool CONFIG_BINFMT_ELF y
define_bool CONFIG_KERNEL_ELF y
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
source drivers/misc/Config.in
source drivers/parport/Config.in
bool 'Support for VGA Console' CONFIG_VGA_CONSOLE
bool 'Support for frame buffer devices' CONFIG_FB
......
......@@ -345,7 +345,7 @@ void kernel_set_cachemode( unsigned long address, unsigned long size,
{
pte_t *pte;
pte = my_find_pte(init_task.mm, address);
pte = my_find_pte(&init_mm, address);
if ( !pte )
{
printk("pte NULL in kernel_set_cachemode()\n");
......@@ -354,7 +354,7 @@ void kernel_set_cachemode( unsigned long address, unsigned long size,
pte_val (*pte) &= mask;
pte_val (*pte) |= flags;
flush_tlb_page(find_vma(init_task.mm,address),address);
flush_tlb_page(find_vma(&init_mm,address),address);
address += PAGE_SIZE;
}
......
......@@ -227,7 +227,7 @@ void zero_paged(void)
/*
* Make the page no cache so we don't blow our cache with 0's
*/
pte = find_pte(init_task.mm, pageptr);
pte = find_pte(&init_mm, pageptr);
if ( !pte )
{
printk("pte NULL in zero_paged()\n");
......@@ -235,7 +235,7 @@ void zero_paged(void)
}
pte_uncache(*pte);
flush_tlb_page(find_vma(init_task.mm,pageptr),pageptr);
flush_tlb_page(find_vma(&init_mm,pageptr),pageptr);
/*
* Important here to not take time away from real processes.
*/
......@@ -260,7 +260,7 @@ void zero_paged(void)
/* turn cache on for this page */
pte_cache(*pte);
flush_tlb_page(find_vma(init_task.mm,pageptr),pageptr);
flush_tlb_page(find_vma(&init_mm,pageptr),pageptr);
/* atomically add this page to the list */
asm ( "101:lwarx %0,0,%1\n" /* reserve zero_cache */
" stw %0,0(%2)\n" /* update *pageptr */
......
......@@ -527,10 +527,10 @@ __initfunc(void setup_arch(char **cmdline_p,
/* reboot on panic */
panic_timeout = 180;
init_task.mm->start_code = PAGE_OFFSET;
init_task.mm->end_code = (unsigned long) _etext;
init_task.mm->end_data = (unsigned long) _edata;
init_task.mm->brk = (unsigned long) klimit;
init_mm.start_code = PAGE_OFFSET;
init_mm.end_code = (unsigned long) _etext;
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = (unsigned long) klimit;
/* Save unparsed command line copy for /proc/cmdline */
strcpy(saved_command_line, cmd_line);
......
......@@ -403,7 +403,7 @@ void __init smp_callin(void)
#if 0
current->mm->mmap->vm_page_prot = PAGE_SHARED;
current->mm->mmap->vm_start = PAGE_OFFSET;
current->mm->mmap->vm_end = init_task.mm->mmap->vm_end;
current->mm->mmap->vm_end = init_mm.mmap->vm_end;
#endif
cpu_callin_map[current->processor] = 1;
while(!smp_commenced)
......
......@@ -82,7 +82,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
return;
}
#endif
if (in_interrupt()) {
if (in_interrupt() || !mm) {
static int complained;
if (complained < 20) {
++complained;
......
......@@ -444,11 +444,11 @@ unsigned long iopa(unsigned long addr)
#endif /* CONFIG_APUS */
#endif /* CONFIG_8xx */
/* Do we have a page table? */
if (init_task.mm->pgd == NULL)
if (init_mm.pgd == NULL)
return 0;
/* Use upper 10 bits of addr to index the first level map */
pd = (pmd_t *) (init_task.mm->pgd + (addr >> PGDIR_SHIFT));
pd = (pmd_t *) (init_mm.pgd + (addr >> PGDIR_SHIFT));
if (pmd_none(*pd))
return 0;
......
......@@ -295,7 +295,7 @@ static inline unsigned long apmmu_hwprobe(unsigned long vaddr)
static inline void apmmu_uncache_page(unsigned long addr)
{
pgd_t *pgdp = apmmu_pgd_offset(init_task.mm, addr);
pgd_t *pgdp = apmmu_pgd_offset(&init_mm, addr);
pmd_t *pmdp;
pte_t *ptep;
......@@ -316,7 +316,7 @@ static inline void apmmu_uncache_page(unsigned long addr)
static inline void apmmu_recache_page(unsigned long addr)
{
pgd_t *pgdp = apmmu_pgd_offset(init_task.mm, addr);
pgd_t *pgdp = apmmu_pgd_offset(&init_mm, addr);
pmd_t *pmdp;
pte_t *ptep;
......@@ -782,7 +782,7 @@ __initfunc(static inline void apmmu_allocate_ptable_skeleton(unsigned long start
pte_t *ptep;
while(start < end) {
pgdp = apmmu_pgd_offset(init_task.mm, start);
pgdp = apmmu_pgd_offset(&init_mm, start);
if(apmmu_pgd_none(*pgdp)) {
pmdp = sparc_init_alloc(&mempool, APMMU_PMD_TABLE_SIZE);
apmmu_early_pgd_set(pgdp, pmdp);
......@@ -804,7 +804,7 @@ __initfunc(static void make_page(unsigned virt_page, unsigned phys_page, unsigne
pte_t *ptep;
unsigned start = virt_page<<12;
pgdp = apmmu_pgd_offset(init_task.mm, start);
pgdp = apmmu_pgd_offset(&init_mm, start);
if(apmmu_pgd_none(*pgdp)) {
pmdp = sparc_init_alloc(&mempool, APMMU_PMD_TABLE_SIZE);
apmmu_early_pgd_set(pgdp, pmdp);
......@@ -824,7 +824,7 @@ __initfunc(static void make_large_page(unsigned virt_page, unsigned phys_page, u
pgd_t *pgdp;
unsigned start = virt_page<<12;
pgdp = apmmu_pgd_offset(init_task.mm, start);
pgdp = apmmu_pgd_offset(&init_mm, start);
*pgdp = __pgd((phys_page<<8) | prot);
}
......@@ -907,7 +907,7 @@ __initfunc(static void map_kernel(void))
make_large_page((KERNBASE+phys)>>12,
(phys>>12),
APMMU_CACHE|APMMU_PRIV|APMMU_VALID);
init_task.mm->mmap->vm_start = page_offset = KERNBASE;
init_mm.mmap->vm_start = page_offset = KERNBASE;
stack_top = page_offset - PAGE_SIZE;
}
......
......@@ -489,10 +489,10 @@ __initfunc(void setup_arch(char **cmdline_p,
/* Due to stack alignment restrictions and assumptions... */
init_task.mm->mmap->vm_page_prot = PAGE_SHARED;
init_task.mm->mmap->vm_start = KERNBASE;
init_task.mm->mmap->vm_end = *memory_end_p;
init_task.mm->context = (unsigned long) NO_CONTEXT;
init_mm.mmap->vm_page_prot = PAGE_SHARED;
init_mm.mmap->vm_start = KERNBASE;
init_mm.mmap->vm_end = *memory_end_p;
init_mm.context = (unsigned long) NO_CONTEXT;
init_task.tss.kregs = &fake_swapper_regs;
if (serial_console)
......
......@@ -131,7 +131,7 @@ __initfunc(void smp4d_callin(void))
current->mm->mmap->vm_page_prot = PAGE_SHARED;
current->mm->mmap->vm_start = PAGE_OFFSET;
current->mm->mmap->vm_end = init_task.mm->mmap->vm_end;
current->mm->mmap->vm_end = init_mm.mmap->vm_end;
local_flush_cache_all();
local_flush_tlb_all();
......
......@@ -109,7 +109,7 @@ __initfunc(void smp4m_callin(void))
: "memory" /* paranoid */);
current->mm->mmap->vm_page_prot = PAGE_SHARED;
current->mm->mmap->vm_start = PAGE_OFFSET;
current->mm->mmap->vm_end = init_task.mm->mmap->vm_end;
current->mm->mmap->vm_end = init_mm.mmap->vm_end;
while(!smp_commenced)
barrier();
......
......@@ -205,7 +205,7 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write,
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
if (in_interrupt() || mm == &init_mm)
if (in_interrupt() || !mm)
goto do_kernel_fault;
down(&mm->mmap_sem);
......
......@@ -846,7 +846,7 @@ void srmmu_mapioaddr(unsigned long physaddr, unsigned long virt_addr, int bus_ty
unsigned long tmp;
physaddr &= PAGE_MASK;
pgdp = srmmu_pgd_offset(init_task.mm, virt_addr);
pgdp = srmmu_pgd_offset(&init_mm, virt_addr);
pmdp = pmd_offset(pgdp, virt_addr);
ptep = pte_offset(pmdp, virt_addr);
tmp = (physaddr >> 4) | SRMMU_ET_PTE;
......@@ -871,7 +871,7 @@ void srmmu_unmapioaddr(unsigned long virt_addr)
pmd_t *pmdp;
pte_t *ptep;
pgdp = srmmu_pgd_offset(init_task.mm, virt_addr);
pgdp = srmmu_pgd_offset(&init_mm, virt_addr);
pmdp = pmd_offset(pgdp, virt_addr);
ptep = pte_offset(pmdp, virt_addr);
......@@ -1476,7 +1476,7 @@ static inline void srmmu_allocate_ptable_skeleton(unsigned long start, unsigned
pte_t *ptep;
while(start < end) {
pgdp = srmmu_pgd_offset(init_task.mm, start);
pgdp = srmmu_pgd_offset(&init_mm, start);
if(srmmu_pgd_none(*pgdp)) {
pmdp = sparc_init_alloc(&mempool, SRMMU_PMD_TABLE_SIZE);
srmmu_early_pgd_set(pgdp, pmdp);
......@@ -1526,7 +1526,7 @@ __initfunc(void srmmu_inherit_prom_mappings(unsigned long start,unsigned long en
what = 2;
}
pgdp = srmmu_pgd_offset(init_task.mm, start);
pgdp = srmmu_pgd_offset(&init_mm, start);
if(what == 2) {
*pgdp = __pgd(prompte);
start += SRMMU_PGDIR_SIZE;
......@@ -1626,7 +1626,7 @@ __initfunc(void srmmu_end_memory(unsigned long memory_size, unsigned long *end_m
/* Create a third-level SRMMU 16MB page mapping. */
__initfunc(static void do_large_mapping(unsigned long vaddr, unsigned long phys_base))
{
pgd_t *pgdp = srmmu_pgd_offset(init_task.mm, vaddr);
pgd_t *pgdp = srmmu_pgd_offset(&init_mm, vaddr);
unsigned long big_pte;
MKTRACE(("dlm[v<%08lx>-->p<%08lx>]", vaddr, phys_base));
......@@ -1840,7 +1840,7 @@ static inline void map_kernel(void)
}
}
MKTRACE(("success\n"));
init_task.mm->mmap->vm_start = page_offset = low_base;
init_mm.mmap->vm_start = page_offset = low_base;
stack_top = page_offset - PAGE_SIZE;
BTFIXUPSET_SETHI(page_offset, low_base);
BTFIXUPSET_SETHI(stack_top, page_offset - PAGE_SIZE);
......
......@@ -1560,7 +1560,7 @@ __initfunc(static unsigned long sun4c_init_lock_areas(unsigned long start_mem))
memset((void *) start_mem, 0, bitmap_size);
start_mem += bitmap_size;
sun4c_kstack_vma.vm_mm = init_task.mm;
sun4c_kstack_vma.vm_mm = &init_mm;
sun4c_kstack_vma.vm_start = sun4c_taskstack_start;
sun4c_kstack_vma.vm_end = sun4c_taskstack_end;
sun4c_kstack_vma.vm_page_prot = PAGE_SHARED;
......
......@@ -68,7 +68,7 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
fi
if [ "$CONFIG_PCI" = "y" ]; then
source drivers/misc/Config.in
source drivers/parport/Config.in
dep_tristate ' Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT
tristate 'SUNW,envctrl support' CONFIG_ENVCTRL
fi
......
......@@ -531,10 +531,10 @@ __initfunc(void setup_arch(char **cmdline_p,
#endif
/* Due to stack alignment restrictions and assumptions... */
init_task.mm->mmap->vm_page_prot = PAGE_SHARED;
init_task.mm->mmap->vm_start = PAGE_OFFSET;
init_task.mm->mmap->vm_end = *memory_end_p;
init_task.mm->context = (unsigned long) NO_CONTEXT;
init_mm.mmap->vm_page_prot = PAGE_SHARED;
init_mm.mmap->vm_start = PAGE_OFFSET;
init_mm.mmap->vm_end = *memory_end_p;
init_mm.context = (unsigned long) NO_CONTEXT;
init_task.tss.kregs = &fake_swapper_regs;
#ifdef CONFIG_IP_PNP
......
......@@ -154,7 +154,7 @@ asmlinkage void do_sparc64_fault(struct pt_regs *regs, unsigned long address, in
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
if (in_interrupt() || mm == &init_mm)
if (in_interrupt() || !mm)
goto do_kernel_fault;
down(&mm->mmap_sem);
......
......@@ -7,7 +7,7 @@
#
# Note 2! The CFLAGS definitions are now in the main makefile.
SUB_DIRS := block char net misc sound
SUB_DIRS := block char net parport sound
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS) pci sgi scsi sbus cdrom isdn pnp i2o \
macintosh video dio zorro fc4 usb \
......
......@@ -11,7 +11,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* A /dev/parportxy device node represents an arbitrary device ('y')
* A /dev/parportx device node represents an arbitrary device
* on port 'x'. The following operations are possible:
*
* open do nothing, set up default IEEE 1284 protocol to be COMPAT
......
......@@ -16,18 +16,17 @@ SUB_DIRS :=
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS)
L_TARGET := misc.a
L_TARGET := parport.a
MX_OBJS :=
LX_OBJS :=
MI_OBJS :=
MIX_OBJS :=
ifeq ($(CONFIG_PARPORT),y)
L_OBJS += parport_share.o parport_ieee1284.o parport_ieee1284_ops.o \
parport_procfs.o
L_OBJS += share.o ieee1284.o ieee1284_ops.o procfs.o
ifeq ($(CONFIG_PARPORT_1284),y)
L_OBJS += parport_daisy.o parport_probe.o
L_OBJS += daisy.o probe.o
endif
ifeq ($(CONFIG_PARPORT_PC),y)
......@@ -65,17 +64,17 @@ ifeq ($(CONFIG_PARPORT),y)
M_OBJS += parport_atari.o
endif
endif
LX_OBJS += parport_init.o
LX_OBJS += init.o
else
ifeq ($(CONFIG_PARPORT),m)
MI_OBJS += parport_share.o parport_ieee1284.o parport_ieee1284_ops.o
MI_OBJS += share.o ieee1284.o ieee1284_ops.o
ifeq ($(CONFIG_PARPORT_1284),y)
MI_OBJS += parport_daisy.o parport_probe.o
MI_OBJS += daisy.o probe.o
endif
ifneq ($(CONFIG_PROC_FS),n)
MI_OBJS += parport_procfs.o
MI_OBJS += procfs.o
endif
MIX_OBJS += parport_init.o
MIX_OBJS += init.o
M_OBJS += parport.o
endif
ifeq ($(CONFIG_PARPORT_PC),m)
......
......@@ -743,10 +743,11 @@ static inline char * task_mem(struct task_struct *p, char *buffer)
struct mm_struct * mm = p->mm;
if (mm) {
struct vm_area_struct * vma = mm->mmap;
struct vm_area_struct * vma;
unsigned long data = 0, stack = 0;
unsigned long exec = 0, lib = 0;
down(&mm->mmap_sem);
for (vma = mm->mmap; vma; vma = vma->vm_next) {
unsigned long len = (vma->vm_end - vma->vm_start) >> 10;
if (!vma->vm_file) {
......@@ -763,7 +764,7 @@ static inline char * task_mem(struct task_struct *p, char *buffer)
continue;
lib += len;
}
}
}
buffer += sprintf(buffer,
"VmSize:\t%8lu kB\n"
"VmLck:\t%8lu kB\n"
......@@ -777,6 +778,7 @@ static inline char * task_mem(struct task_struct *p, char *buffer)
mm->rss << (PAGE_SHIFT-10),
data - stack, stack,
exec - lib, lib);
up(&mm->mmap_sem);
}
return buffer;
}
......
......@@ -104,15 +104,18 @@ static struct dentry * proc_follow_link(struct dentry *dentry,
struct vm_area_struct * vma;
if (!p->mm)
goto out_unlock;
down(&p->mm->mmap_sem);
vma = p->mm->mmap;
while (vma) {
if ((vma->vm_flags & VM_EXECUTABLE) &&
vma->vm_file) {
result = vma->vm_file->f_dentry;
up(&p->mm->mmap_sem);
goto out_dget;
}
vma = vma->vm_next;
}
up(&p->mm->mmap_sem);
goto out_unlock;
}
default:
......
......@@ -17,6 +17,10 @@
* potential and subtle race discovered by Ulrich Schmid
* in down_interruptible(). Since I started to play here I
* also implemented the `trylock' semaphore operation.
* 1999-07-02 Artur Skawina <skawina@geocities.com>
* Optimized "0(ecx)" -> "(ecx)" (the assembler does not
* do this). Changed calling sequences from push/jmp to
* traditional call/ret.
*
* If you would like to see an analysis of this implementation, please
* ftp to gcom.com and download the file
......@@ -112,12 +116,12 @@ extern inline void down(struct semaphore * sem)
#ifdef __SMP__
"lock ; "
#endif
"decl 0(%0)\n\t"
"decl (%0)\n\t" /* --sem->count */
"js 2f\n"
"1:\n"
".section .text.lock,\"ax\"\n"
"2:\tpushl $1b\n\t"
"jmp __down_failed\n"
"2:\tcall __down_failed\n\t"
"jmp 1b\n"
".previous"
:/* no outputs */
:"c" (sem)
......@@ -137,13 +141,13 @@ extern inline int down_interruptible(struct semaphore * sem)
#ifdef __SMP__
"lock ; "
#endif
"decl 0(%1)\n\t"
"decl (%1)\n\t" /* --sem->count */
"js 2f\n\t"
"xorl %0,%0\n"
"1:\n"
".section .text.lock,\"ax\"\n"
"2:\tpushl $1b\n\t"
"jmp __down_failed_interruptible\n"
"2:\tcall __down_failed_interruptible\n\t"
"jmp 1b\n"
".previous"
:"=a" (result)
:"c" (sem)
......@@ -164,13 +168,13 @@ extern inline int down_trylock(struct semaphore * sem)
#ifdef __SMP__
"lock ; "
#endif
"decl 0(%1)\n\t"
"decl (%1)\n\t" /* --sem->count */
"js 2f\n\t"
"xorl %0,%0\n"
"1:\n"
".section .text.lock,\"ax\"\n"
"2:\tpushl $1b\n\t"
"jmp __down_failed_trylock\n"
"2:\tcall __down_failed_trylock\n\t"
"jmp 1b\n"
".previous"
:"=a" (result)
:"c" (sem)
......@@ -194,12 +198,12 @@ extern inline void up(struct semaphore * sem)
#ifdef __SMP__
"lock ; "
#endif
"incl 0(%0)\n\t"
"incl (%0)\n\t" /* ++sem->count */
"jle 2f\n"
"1:\n"
".section .text.lock,\"ax\"\n"
"2:\tpushl $1b\n\t"
"jmp __up_wakeup\n"
"2:\tcall __up_wakeup\n\t"
"jmp 1b\n"
".previous"
:/* no outputs */
:"c" (sem)
......
......@@ -156,7 +156,9 @@ int vsprintf(char *buf, const char *fmt, va_list args)
int precision; /* min. # of digits for integers; max
number of chars for from string */
int qualifier; /* 'h', 'l', or 'L' for integer fields */
/* 'z' support added 23/7/1999 S.H. */
for (str=buf ; *fmt ; ++fmt) {
if (*fmt != '%') {
*str++ = *fmt;
......@@ -206,7 +208,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
/* get the conversion qualifier */
qualifier = -1;
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L') {
if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='z') {
qualifier = *fmt;
++fmt;
}
......@@ -255,6 +257,9 @@ int vsprintf(char *buf, const char *fmt, va_list args)
if (qualifier == 'l') {
long * ip = va_arg(args, long *);
*ip = (str - buf);
} else if (qualifier == 'z') {
size_t * ip = va_arg(args, size_t *);
*ip = (str - buf);
} else {
int * ip = va_arg(args, int *);
*ip = (str - buf);
......@@ -292,6 +297,8 @@ int vsprintf(char *buf, const char *fmt, va_list args)
}
if (qualifier == 'l')
num = va_arg(args, unsigned long);
else if (qualifier == 'z')
num = va_arg(args, size_t);
else if (qualifier == 'h') {
num = (unsigned short) va_arg(args, int);
if (flags & SIGN)
......
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