fw_cfg.c (deabea6e88f7c4c3c12a36ee30051c6209561165) | fw_cfg.c (b34f2fd17e4276ac0a75f8d72485a0236a740954) |
---|---|
1/* 2 * QEMU Firmware configuration device emulation 3 * 4 * Copyright (c) 2008 Gleb Natapov 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 727 unchanged lines hidden (view full) --- 736} 737 738void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, void *data, size_t len) 739{ 740 trace_fw_cfg_add_bytes(key, trace_key_name(key), len); 741 fw_cfg_add_bytes_callback(s, key, NULL, NULL, NULL, data, len, true); 742} 743 | 1/* 2 * QEMU Firmware configuration device emulation 3 * 4 * Copyright (c) 2008 Gleb Natapov 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 727 unchanged lines hidden (view full) --- 736} 737 738void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, void *data, size_t len) 739{ 740 trace_fw_cfg_add_bytes(key, trace_key_name(key), len); 741 fw_cfg_add_bytes_callback(s, key, NULL, NULL, NULL, data, len, true); 742} 743 |
744void *fw_cfg_read_bytes_ptr(FWCfgState *s, uint16_t key) 745{ 746 int arch = !!(key & FW_CFG_ARCH_LOCAL); 747 748 key &= FW_CFG_ENTRY_MASK; 749 assert(key < fw_cfg_max_entry(s)); 750 return s->entries[arch][key].data; 751} 752 | |
753void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value) 754{ 755 size_t sz = strlen(value) + 1; 756 757 trace_fw_cfg_add_string(key, trace_key_name(key), value); 758 fw_cfg_add_bytes(s, key, g_memdup(value, sz), sz); 759} 760 --- 666 unchanged lines hidden --- | 744void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value) 745{ 746 size_t sz = strlen(value) + 1; 747 748 trace_fw_cfg_add_string(key, trace_key_name(key), value); 749 fw_cfg_add_bytes(s, key, g_memdup(value, sz), sz); 750} 751 --- 666 unchanged lines hidden --- |