!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/arc/   drwxr-xr-x
Free 318.36 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:     memory.c (3.21 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * memory.c: PROM library functions for acquiring/using memory descriptors
 *           given to us from the ARCS firmware.
 *
 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
 */
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
#include <linux/swap.h>

#include <asm/sgialib.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/bootinfo.h>

#undef DEBUG

struct linux_mdesc * __init
ArcGetMemoryDescriptor(struct linux_mdesc *Current)
{
    return romvec->get_mdesc(Current);
}

#ifdef DEBUG /* convenient for debugging */
static char *arcs_mtypes[8] = {
    "Exception Block",
    "ARCS Romvec Page",
    "Free/Contig RAM",
    "Generic Free RAM",
    "Bad Memory",
    "Standalone Program Pages",
    "ARCS Temp Storage Area",
    "ARCS Permanent Storage Area"
};

static char *arc_mtypes[8] = {
    "Exception Block",
    "SystemParameterBlock",
    "FreeMemory",
    "Bad Memory",
    "LoadedProgram",
    "FirmwareTemporary",
    "FirmwarePermanent",
    "FreeContiguous"
};
#define mtypes(a) (prom_flags & PROM_FLAG_ARCS) ? arcs_mtypes[a.arcs] : arc_mtypes[a.arc]
#endif

static inline int memtype_classify_arcs (union linux_memtypes type)
{
    switch (type.arcs) {
    case arcs_fcontig:
    case arcs_free:
        return BOOT_MEM_RAM;
    case arcs_atmp:
        return BOOT_MEM_ROM_DATA;
    case arcs_eblock:
    case arcs_rvpage:
    case arcs_bmem:
    case arcs_prog:
    case arcs_aperm:
        return BOOT_MEM_RESERVED;
    default:
        BUG();
    }
    while(1);                /* Nuke warning.  */
}

static inline int memtype_classify_arc (union linux_memtypes type)
{
    switch (type.arc) {
    case arc_free:
    case arc_fcontig:
        return BOOT_MEM_RAM;
    case arc_atmp:
        return BOOT_MEM_ROM_DATA;
    case arc_eblock:
    case arc_rvpage:
    case arc_bmem:
    case arc_prog:
    case arc_aperm:
        return BOOT_MEM_RESERVED;
    default:
        BUG();
    }
    while(1);                /* Nuke warning.  */
}

static int __init prom_memtype_classify (union linux_memtypes type)
{
    if (prom_flags & PROM_FLAG_ARCS)    /* SGI is ``different'' ...  */
        return memtype_classify_arcs(type);

    return memtype_classify_arc(type);
}

void __init prom_meminit(void)
{
    struct linux_mdesc *p;

#ifdef DEBUG
    int i = 0;

    prom_printf("ARCS MEMORY DESCRIPTOR dump:\n");
    p = ArcGetMemoryDescriptor(PROM_NULL_MDESC);
    while(p) {
        prom_printf("[%d,%p]: base<%08lx> pages<%08lx> type<%s>\n",
                i, p, p->base, p->pages, mtypes(p->type));
        p = ArcGetMemoryDescriptor(p);
        i++;
    }
#endif

    p = PROM_NULL_MDESC;
    while ((p = ArcGetMemoryDescriptor(p))) {
        unsigned long base, size;
        long type;

        base = p->base << PAGE_SHIFT;
        size = p->pages << PAGE_SHIFT;
        type = prom_memtype_classify(p->type);

        add_memory_region(base, size, type);
    }
}

void __init
prom_free_prom_memory (void)
{
    unsigned long freed = 0;
    unsigned long addr;
    int i;

    for (i = 0; i < boot_mem_map.nr_map; i++) {
        if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
            continue;

        addr = boot_mem_map.map[i].addr;
        while (addr < boot_mem_map.map[i].addr
                  + boot_mem_map.map[i].size) {
            ClearPageReserved(virt_to_page(__va(addr)));
            set_page_count(virt_to_page(__va(addr)), 1);
            free_page((unsigned long)__va(addr));
            addr += PAGE_SIZE;
            freed += PAGE_SIZE;
        }
    }
    printk("Freeing prom memory: %ldkb freed\n", freed >> 10);
}

:: 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.0218 ]--