3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; version 2 of the License.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <psl1ght/lv2/net.h>
21 #include <lv1_hvcall.h>
22 #include <lv2_syscall.h>
23 #include <udp_printf.h>
25 #define VFLASH_DEV_ID 0x100000000000001ull
26 #define VFLASH_REGION_START_SECTOR 0x80000ull
27 #define VFLASH_REGION_SECTOR_COUNT 0x5000000ull /* 40GB for my beloved Linux */
28 #define VFLASH_REGION_LAID 0x1070000002000001ull
33 int main(int argc
, char **argv
)
43 PRINTF("%s:%d: start\n", __func__
, __LINE__
);
47 result
= lv2_storage_open(VFLASH_DEV_ID
, &dev_handle
);
49 PRINTF("%s:%d: lv2_storage_open failed (0x%08x)\n", __func__
, __LINE__
, result
);
53 result
= lv2_storage_create_region(dev_handle
, VFLASH_REGION_START_SECTOR
, VFLASH_REGION_SECTOR_COUNT
,
54 0, VFLASH_REGION_LAID
, ®ion_id
);
56 PRINTF("%s:%d: lv2_storage_create_region failed (0x%08x)\n", __func__
, __LINE__
, result
);
60 PRINTF("%s:%d: region_id (%d)\n", __func__
, __LINE__
, region_id
);
62 PRINTF("%s:%d: end\n", __func__
, __LINE__
);
66 result
= lv2_storage_close(dev_handle
);
68 PRINTF("%s:%d: lv2_storage_close failed (0x%08x)\n", __func__
, __LINE__
, result
);