diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/openbios/arch/unix/blk.c | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/openbios/arch/unix/blk.c')
-rw-r--r-- | qemu/roms/openbios/arch/unix/blk.c | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/qemu/roms/openbios/arch/unix/blk.c b/qemu/roms/openbios/arch/unix/blk.c deleted file mode 100644 index d0f5c6a42..000000000 --- a/qemu/roms/openbios/arch/unix/blk.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * <arch/unix/blk.c> - * - * block device emulation for unix hosts - * - * Copyright (C) 2004 Stefan Reinauer <stepan@openbios.org> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 - * - */ - -#include "config.h" -#include "libopenbios/bindings.h" -#include "blk.h" - -typedef struct { - int unit; - int channel; -} blk_data_t; - - -DECLARE_NODE( blk, INSTALL_OPEN, sizeof(blk_data_t), "+/unix/block/disk" ); - -static void -blk_open( blk_data_t *pb ) -{ - phandle_t ph; - - fword("my-unit"); - - pb->unit = POP(); - pb->channel = 0; /* FIXME */ - - selfword("open-deblocker"); - - /* interpose disk-label */ - ph = find_dev("/packages/disk-label"); - fword("my-args"); - PUSH_ph( ph ); - fword("interpose"); - - /* printk("osi-blk: open %d\n", pb->unit ); */ - - PUSH( -1 ); -} - -static void -blk_close( __attribute__((unused)) blk_data_t *pb ) -{ - selfword("close-deblocker"); -} - - -/* ( buf blk nblks -- actual ) */ -static void -blk_read_blocks( blk_data_t *pb ) -{ - cell i, n = POP(); - cell blk = POP(); - char *dest = (char*)POP(); - - // printk("blk_read_blocks %x block=%d n=%d\n", (ucell)dest, blk, n ); - - for( i=0; i<n; ) { - char buf[4096]; - ucell m = MIN( n-i, sizeof(buf)/512 ); - - if( read_from_disk(pb->channel, pb->unit, blk+i, (ucell)buf, m*512) < 0 ) { - printk("read_from_disk: error\n"); - RET(0); - } - memcpy( dest, buf, m * 512 ); - i += m; - dest += m * 512; - } - PUSH( n ); -} - -/* ( -- bs ) */ -static void -blk_block_size( __attribute__((unused)) blk_data_t *pb ) -{ - PUSH( 512 ); -} - -/* ( -- maxbytes ) */ -static void -blk_max_transfer( __attribute__((unused)) blk_data_t *pb ) -{ - PUSH( 1024*1024 ); -} - -static void -blk_initialize( __attribute__((unused)) blk_data_t *pb ) -{ - fword("is-deblocker"); -} - - -NODE_METHODS( blk ) = { - { NULL, blk_initialize }, - { "open", blk_open }, - { "close", blk_close }, - { "read-blocks", blk_read_blocks }, - { "block-size", blk_block_size }, - { "max-transfer", blk_max_transfer}, -}; - -void -blk_init( void ) -{ - REGISTER_NODE( blk ); -} |