eCos Reference Manual
Prev |  | Next

# mfill

## Name

mfill -- Fill RAM with a specified pattern

## Synopsis

mfill {-b `location`} {-l `length`} {-p `value`} [-1 | -2 | -4]

## Arguments

Name | Type | Description | Default
--- | --- | --- | ---
-b `location` | Memory address | Location in memory for start of data. | none
-l `length` | Number | Length of data | none
-p `pattern` | Number | Data value to fill with | 0
-1 |  | Access one byte (8 bits) at a time. Only the least significant 8 bits of the pattern will be used. | -4
-2 |  | Access two bytes (16 bits) at a time. Only the least significant 16 bits of the pattern will be used. | -4
-4 |  | Access one word (32 bits) at a time. | -4

## Description

Fills a range of memory with the given pattern.

## Examples

Fill a buffer with zeros.

    RedBoot> x -b 0x100000 -l 0x20
    00100000: 00 3E 00 06 00 06 00 06  00 00 00 00 00 00 00 00  |.>..............|
    00100010: 00 00 00 78 00 70 00 60  00 60 00 60 00 60 00 60  |...x.p.`.`.`.`.`|
    RedBoot> mfill -b 0x100000 -l 0x20
    RedBoot> x -b 0x100000 -l 0x20
    00100000: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    00100010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Fill a buffer with a pattern.

    RedBoot> mfill -b 0x100000 -l 0x20 -p 0xDEADFACE
    RedBoot> x -b 0x100000 -l 0x20
    00100000: CE FA AD DE CE FA AD DE  CE FA AD DE CE FA AD DE  |................|
    00100010: CE FA AD DE CE FA AD DE  CE FA AD DE CE FA AD DE  |................|

Prev | Home | Next
mcmp | Up | ping