!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/drivers/mtd/chips/   drwxr-xr-x
Free 318.33 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     map_ram.c (3.05 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * Common code to handle map devices which are simple RAM
 * (C) 2000 Red Hat. GPL'd.
 * $Id: map_ram.c,v 1.14 2001/10/02 15:05:12 dwmw2 Exp $
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <asm/io.h>
#include <asm/byteorder.h>
#include <linux/errno.h>
#include <linux/slab.h>

#include <linux/mtd/map.h>


static int mapram_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int mapram_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
static int mapram_erase (struct mtd_info *, struct erase_info *);
static void mapram_nop (struct mtd_info *);
static struct mtd_info *map_ram_probe(struct map_info *map);


static struct mtd_chip_driver mapram_chipdrv = {
    probe: map_ram_probe,
    name: "map_ram",
    module: THIS_MODULE
};

static struct mtd_info *map_ram_probe(struct map_info *map)
{
    struct mtd_info *mtd;

    /* Check the first byte is RAM */
#if 0
    map->write8(map, 0x55, 0);
    if (map->read8(map, 0) != 0x55)
        return NULL;

    map->write8(map, 0xAA, 0);
    if (map->read8(map, 0) != 0xAA)
        return NULL;

    /* Check the last byte is RAM */
    map->write8(map, 0x55, map->size-1);
    if (map->read8(map, map->size-1) != 0x55)
        return NULL;

    map->write8(map, 0xAA, map->size-1);
    if (map->read8(map, map->size-1) != 0xAA)
        return NULL;
#endif
    /* OK. It seems to be RAM. */

    mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
    if (!mtd)
        return NULL;

    memset(mtd, 0, sizeof(*mtd));

    map->fldrv = &mapram_chipdrv;
    mtd->priv = map;
    mtd->name = map->name;
    mtd->type = MTD_RAM;
    mtd->size = map->size;
    mtd->erase = mapram_erase;
    mtd->read = mapram_read;
    mtd->write = mapram_write;
    mtd->sync = mapram_nop;
    mtd->flags = MTD_CAP_RAM | MTD_VOLATILE;

    mtd->erasesize = PAGE_SIZE;
     while(mtd->size & (mtd->erasesize - 1))
        mtd->erasesize >>= 1;

    MOD_INC_USE_COUNT;
    return mtd;
}


static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
{
    struct map_info *map = (struct map_info *)mtd->priv;

    map->copy_from(map, buf, from, len);
    *retlen = len;
    return 0;
}

static int mapram_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
{
    struct map_info *map = (struct map_info *)mtd->priv;

    map->copy_to(map, to, buf, len);
    *retlen = len;
    return 0;
}

static int mapram_erase (struct mtd_info *mtd, struct erase_info *instr)
{
    /* Yeah, it's inefficient. Who cares? It's faster than a _real_
       flash erase. */
    struct map_info *map = (struct map_info *)mtd->priv;
    unsigned long i;

    for (i=0; i<instr->len; i++)
        map->write8(map, 0xFF, instr->addr + i);

    if (instr->callback)
        instr->callback(instr);

    return 0;
}

static void mapram_nop(struct mtd_info *mtd)
{
    /* Nothing to see here */
}

int __init map_ram_init(void)
{
    register_mtd_chip_driver(&mapram_chipdrv);
    return 0;
}

static void __exit map_ram_exit(void)
{
    unregister_mtd_chip_driver(&mapram_chipdrv);
}

module_init(map_ram_init);
module_exit(map_ram_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
MODULE_DESCRIPTION("MTD chip driver for RAM chips");

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