!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/arch/mips/baget/   drwxr-xr-x
Free 318.37 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     baget.c (2.82 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* $Id: baget.c,v 1.1 1999/01/17 03:49:37 ralf Exp $
 *
 * baget.c: Baget low level stuff
 *
 * Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
 *
 */
#include <stdarg.h>

#include <linux/kernel.h>
#include <linux/mm.h>
#include <asm/system.h>
#include <asm/bootinfo.h>
#include <asm/mipsregs.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>

#include <asm/baget/baget.h>

/*
 *  Following code is based on routines from 'mm/vmalloc.c'
 *  Additional parameters  ioaddr  is needed to iterate across real I/O address.
 */
static inline int alloc_area_pte(pte_t * pte, unsigned long address, 
                 unsigned long size, unsigned long ioaddr)
{
        unsigned long end;

        address &= ~PMD_MASK;
        end = address + size;
        if (end > PMD_SIZE)
                end = PMD_SIZE;
        while (address < end) {
                unsigned long page;
                if (!pte_none(*pte))
                        printk("kseg2_alloc_io: page already exists\n");
        /*
         *  For MIPS looks pretty to have transparent mapping
         *  for KSEG2 areas  -- user can't access one, and no 
         *  problems with  virtual <--> physical  translation.
         */
                page = ioaddr & PAGE_MASK;

                set_pte(pte, __pte(page | pgprot_val(PAGE_USERIO) |
                  _PAGE_GLOBAL | __READABLE | __WRITEABLE));
                address += PAGE_SIZE;
        ioaddr  += PAGE_SIZE;
                pte++;
        }
        return 0;
}

static inline int alloc_area_pmd(pmd_t * pmd, unsigned long address, 
                 unsigned long size, unsigned long ioaddr)
{
        unsigned long end;

        address &= ~PGDIR_MASK;
        end = address + size;
        if (end > PGDIR_SIZE)
                end = PGDIR_SIZE;
        while (address < end) {
                pte_t * pte = pte_alloc_kernel(pmd, address);
                if (!pte)
                        return -ENOMEM;
                if (alloc_area_pte(pte, address, end - address, ioaddr))
                        return -ENOMEM;
                address = (address + PMD_SIZE) & PMD_MASK;
        ioaddr  += PMD_SIZE;
                pmd++;
        }
        return 0;
}

int kseg2_alloc_io (unsigned long address, unsigned long size)
{
        pgd_t * dir;
        unsigned long end = address + size;

        dir = pgd_offset_k(address);
        flush_cache_all();
        while (address < end) {
                pmd_t *pmd;
                pgd_t olddir = *dir;

                pmd = pmd_alloc_kernel(dir, address);
                if (!pmd)
                        return -ENOMEM;
                if (alloc_area_pmd(pmd, address, end - address, address))
                        return -ENOMEM;
                if (pgd_val(olddir) != pgd_val(*dir))
                        set_pgdir(address, *dir);
                address = (address + PGDIR_SIZE) & PGDIR_MASK;
                dir++;
        }
        flush_tlb_all();
        return 0;
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0157 ]--