From 16f504a9dca3fe3b70568f67b7d41241ae485288 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:49:04 +0200 Subject: Adding upstream version 7.0.6-dfsg. Signed-off-by: Daniel Baumann --- src/VBox/Devices/Network/DevEEPROM.h | 151 +++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 src/VBox/Devices/Network/DevEEPROM.h (limited to 'src/VBox/Devices/Network/DevEEPROM.h') diff --git a/src/VBox/Devices/Network/DevEEPROM.h b/src/VBox/Devices/Network/DevEEPROM.h new file mode 100644 index 00000000..b413330c --- /dev/null +++ b/src/VBox/Devices/Network/DevEEPROM.h @@ -0,0 +1,151 @@ +/* $Id: DevEEPROM.h $ */ +/** @file + * DevEEPROM - Microwire-compatible 64x16-bit 93C46 EEPROM Emulation, Header. + */ + +/* + * Copyright (C) 2007-2022 Oracle and/or its affiliates. + * + * This file is part of VirtualBox base platform packages, as + * available from https://www.virtualbox.org. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, in version 3 of the + * License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#ifndef VBOX_INCLUDED_SRC_Network_DevEEPROM_h +#define VBOX_INCLUDED_SRC_Network_DevEEPROM_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#include + +/** The current Saved state version. */ +#define EEPROM93C46_SAVEDSTATE_VERSION 1 + +/** + * 93C46-compatible EEPROM device emulation. + * + * @remarks This class is intended to be used in device + * emulation which imposes some restrictions if the + * device supports GC execution. This is why it is a + * plain-old-data structure. + */ +struct EEPROM93C46 +{ + /** General definitions */ + enum { + /** Size of EEPROM in words */ + SIZE = 64, + /** Number of bits per word */ + WORD_SIZE = 16, + /** Number of address bits */ + ADDR_SIZE = 6, + /** Number of bits in opcode */ + OPCODE_SIZE = 2, + /** The most significant bit mask in data word */ + DATA_MSB = 1<<(WORD_SIZE-1), + /** Address mask */ + ADDR_MASK = (1<