From 37c9acba0ade7f90bb39b100212d4ff755f30658 Mon Sep 17 00:00:00 2001 From: Jan Stoess Date: Wed, 2 Jun 2010 04:49:04 +0200 Subject: [PATCH] Remove simics platform. --- kernel/src/platform/simics/82093.h | 161 ---------------------- kernel/src/platform/simics/8259.h | 164 ----------------------- kernel/src/platform/simics/Makeconf | 38 ------ kernel/src/platform/simics/acpi.h | 66 ---------- kernel/src/platform/simics/mps.h | 176 ------------------------- kernel/src/platform/simics/nmi.h | 64 --------- kernel/src/platform/simics/rtc.h | 100 -------------- kernel/src/platform/simics/startup32.S | 69 ---------- 8 files changed, 838 deletions(-) delete mode 100644 kernel/src/platform/simics/82093.h delete mode 100644 kernel/src/platform/simics/8259.h delete mode 100644 kernel/src/platform/simics/Makeconf delete mode 100755 kernel/src/platform/simics/acpi.h delete mode 100644 kernel/src/platform/simics/mps.h delete mode 100644 kernel/src/platform/simics/nmi.h delete mode 100644 kernel/src/platform/simics/rtc.h delete mode 100644 kernel/src/platform/simics/startup32.S diff --git a/kernel/src/platform/simics/82093.h b/kernel/src/platform/simics/82093.h deleted file mode 100644 index cb8373ad..00000000 --- a/kernel/src/platform/simics/82093.h +++ /dev/null @@ -1,161 +0,0 @@ -/********************************************************************* - * - * Copyright (C) 2002-2004, Karlsruhe University - * - * File path: platform/pc99/82093.h - * Description: Driver for IO-APIC 82093 - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: 82093.h,v 1.4 2006/10/19 22:57:36 ud3 Exp $ - * - ********************************************************************/ -#ifndef __PLATFORM__PC99__82093_H__ -#define __PLATFORM__PC99__82093_H__ - -// the 82093 supports 24 IRQ lines -#define I82093_NUM_IRQS 24 - -typedef union { - struct { - u32_t version : 8; - u32_t : 8; - u32_t max_lvt : 8; - u32_t reserved0 : 8; - } __attribute__((packed)) ver; - u32_t raw; -} ioapic_version_t; - -class ioapic_redir_t { -public: - word_t vector : 8; - word_t delivery_mode : 3; - word_t dest_mode : 1; - word_t delivery_status : 1; - word_t polarity : 1; - word_t irr : 1; - word_t trigger_mode : 1; - word_t mask : 1; - word_t : 15; - union { - struct { - word_t : 24; - word_t physical_dest : 4; - word_t : 4; - } __attribute__((packed)) physical; - - struct { - word_t : 24; - word_t logical_dest : 8; - } __attribute__((packed)) logical; - } dest; - -public: - void set_fixed_hwirq(u32_t vector, bool low_active, - bool level_triggered, bool masked, - u32_t apicid) - { - this->vector = vector; - this->delivery_mode = 0; // fixed - this->dest_mode = 0; // physical mode - this->polarity = low_active ? 1 : 0; - this->trigger_mode = level_triggered ? 1 : 0; - this->mask = masked ? 1 : 0; - this->dest.physical.physical_dest = apicid; - } - void set_phys_dest(u32_t apicid) - { this->dest.physical.physical_dest = apicid; } - u32_t get_phys_dest() - { return this->dest.physical.physical_dest; } - - void mask_irq() { mask = 1; } - void unmask_irq() { mask = 0; } - bool is_masked_irq() - {return (mask == 1); } - bool is_edge_triggered() - { return this->trigger_mode == 0; } -} __attribute__((packed)); - - -class i82093_t { - /* IOAPIC register ids */ - enum regno_t { - IOAPIC_ID =0x00, - IOAPIC_VER =0x01, - IOAPIC_ARBID =0x02, - IOAPIC_REDIR0 =0x10 - }; - - -private: - u32_t get(u32_t reg) - { - *(__volatile__ u32_t*) this = reg; - return *(__volatile__ u32_t*)(((word_t) this) + 0x10); - - } - - void set(u32_t reg, u32_t val) - { - *(__volatile__ u32_t*) this = reg; - *(__volatile__ u32_t*)(((word_t) this) + 0x10) = val; - } - - u32_t reread() - { - return *(__volatile__ u32_t*)(((word_t) this) + 0x10); - } - -public: - u8_t id() { return get(IOAPIC_ID) >> 24; }; - ioapic_version_t version() { - return (ioapic_version_t) { raw : get(IOAPIC_VER) }; - } - /* VU: masking an IRQ on the IOAPIC only becomes active after - * performing a read on the data register. Therefore, when an IRQ - * is masked we always perform the read assuming that masking/ - * unmasking is the operation performed most frequently */ - void set_redir_entry(word_t idx, ioapic_redir_t redir) - { - ASSERT(idx < 24); - set(0x11 + (idx * 2), *((u32_t*)(&redir) + 1)); - set(0x10 + (idx * 2), *((u32_t*)(&redir) + 0)); - if (redir.mask) reread(); - } - void set_redir_entry_low(word_t idx, ioapic_redir_t redir) - { - ASSERT(idx < 24); - set(0x10 + (idx * 2), *(u32_t*)&redir); - if (redir.mask) reread(); - } - - ioapic_redir_t get_redir_entry(word_t idx) - { - ASSERT(idx < 24); - ioapic_redir_t redir; - (*((u32_t*)(&redir) + 1)) = get(0x11 + (idx * 2)); - (*((u32_t*)(&redir) + 0)) = get(0x10 + (idx * 2)); - return redir; - } -}; - -#endif /* !__PLATFORM__PC99__82093_H__ */ diff --git a/kernel/src/platform/simics/8259.h b/kernel/src/platform/simics/8259.h deleted file mode 100644 index f3a375ca..00000000 --- a/kernel/src/platform/simics/8259.h +++ /dev/null @@ -1,164 +0,0 @@ -/********************************************************************* - * - * Copyright (C) 2002-2004, 2007, Karlsruhe University - * - * File path: platform/simics/8259.h - * Description: Driver for i8259 Programmable Interrupt Controller - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: 8259.h,v 1.5 2006/10/19 22:57:36 ud3 Exp $ - * - ********************************************************************/ -#ifndef __PLATFORM__PC99__8259_H__ -#define __PLATFORM__PC99__8259_H__ - -#include INC_ARCH(ioport.h) /* for in_u8/out_u8 */ - -/** - * Driver for i8259 PIC - * @param base the base address of the registers - * - * The template parameter BASE enables compile-time resolution of the - * PIC's control register addresses. - * - * Note: - * Depending on whether CONFIG_X86_INKERNEL_PIC is defined or not - * objects will cache the mask register or not. Thus it is not wise - * to blindly instanciate them all over the place because the cached - * state would not be shared. Making the cached state static - * wouldn't work either because there are two PICs in a - * PC99. Intended use is a single object per PIC. - * - * Assumptions: - * - BASE can be passed as port to in_u8/out_u8 - * - The PIC's A0=0 register is located at BASE - * - The PIC's A0=1 register is located at BASE+1 - * - PICs in unbuffered cascade mode - * - * Uses: - * - out_u8, in_u8 - */ - -template class i8259_pic_t { - private: - - u8_t mask_cache; - public: - - /** - * Unmask interrupt - * @param irq interrupt line to unmask - */ - void unmask(word_t irq) - { - u8_t mask_cache = in_u8(base+1); - mask_cache &= ~(1 << (irq)); - out_u8(base+1, mask_cache); - } - - /** - * Mask interrupt - * @param irq interrupt line to mask - */ - void mask(word_t irq) - { - u8_t mask_cache = in_u8(base+1); - mask_cache |= (1 << (irq)); - out_u8(base+1, mask_cache); - } - - /** - * Send specific EOI - * @param irq interrupt line to ack - */ - void ack(word_t irq) - { - out_u8(base, 0x60 + irq); - } - - /** - * Send specific EOI - * @param irq interrupt line to ack - */ - bool is_masked(word_t irq) - { - return (mask_cache & (1 << irq)); - } - - - /** - * initialize PIC - * @param vector_base 8086-style vector number base - * @param slave_info slave mask for master or slave id for slave - * - * Initializes the PIC in 8086-mode: - * - not special-fully-nested mode - * - reporting vectors VECTOR_BASE...VECTOR_BASE+7 - * - all inputs masked - */ - void init(u8_t vector_base, u8_t slave_info) - { - mask_cache = 0xFF; - /* - ICW1: - 0x10 | NEED_ICW4 | CASCADE_MODE | EDGE_TRIGGERED - */ - out_u8(base, 0x11); - - /* - ICW2: - - 8086 mode irq vector base - PIN0->IRQ(base), ..., PIN7->IRQ(base+7) - */ - out_u8(base+1, vector_base); - - /* - ICW3: - - master: slave list - Set bits mark input PIN as connected to a slave - - slave: slave id - This PIC is connected to the master's pin SLAVE_ID - - Note: The caller knows whether its a master or not - - the handling is the same. - */ - out_u8(base+1, slave_info); - - /* - ICW4: - 8086_MODE | NORMAL_EOI | NONBUFFERED_MODE | NOT_SFN_MODE - */ - out_u8(base+1, 0x01); /* mode - *NOT* fully nested */ - - /* - OCW1: - - set initial mask - */ - out_u8(base+1, mask_cache); - - //out_u8(base, 0x20); - - } -}; - -#endif /* !__PLATFORM__PC99__8259_H__ */ diff --git a/kernel/src/platform/simics/Makeconf b/kernel/src/platform/simics/Makeconf deleted file mode 100644 index efadc649..00000000 --- a/kernel/src/platform/simics/Makeconf +++ /dev/null @@ -1,38 +0,0 @@ -###################################################################### -## -## Copyright (C) 2010, Karlsruhe University -## -## File path: platform/simics/Makeconf -## Description: Generic linkser script for x86. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## -## $Id$ -## -###################################################################### -SOURCES += $(addprefix src/platform/simics/, startup32.S) - -ifeq ("$(CONFIG_IOAPIC)","y") -SOURCES += src/platform/generic/intctrl-apic.cc -else -SOURCES += src/platform/generic/intctrl-pic.cc -endif diff --git a/kernel/src/platform/simics/acpi.h b/kernel/src/platform/simics/acpi.h deleted file mode 100755 index cec7d9d5..00000000 --- a/kernel/src/platform/simics/acpi.h +++ /dev/null @@ -1,66 +0,0 @@ -/********************************************************************* - * - * Copyright (C) 2003, Karlsruhe University - * - * File path: platform/pc99/acpi.h - * Description: ACPI support code for IA-PCs (PC99) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: acpi.h,v 1.1 2004/03/01 19:48:24 stoess Exp $ - * - ********************************************************************/ -#ifndef __PLATFORM__PC99__ACPI_H__ -#define __PLATFORM__PC99__ACPI_H__ - -#include - -/* ACPI 2.0 Specification, 5.2.4.1 - Finding the RSDP on IA-PC Systems */ - -#define ACPI20_PC99_RSDP_START 0x0e0000 -#define ACPI20_PC99_RSDP_END 0x100000 - -INLINE acpi_rsdp_t* acpi_rsdp_t::locate() -{ - /** @todo checksum, check version */ - for (addr_t p = (addr_t)ACPI20_PC99_RSDP_START; - p < (addr_t)ACPI20_PC99_RSDP_END; - p = addr_offset(p, 16)) - { - acpi_rsdp_t* r = (acpi_rsdp_t*) p; - if (r->sig[0] == 'R' && - r->sig[1] == 'S' && - r->sig[2] == 'D' && - r->sig[3] == ' ' && - r->sig[4] == 'P' && - r->sig[5] == 'T' && - r->sig[6] == 'R' && - r->sig[7] == ' ') - return r; - }; - /* not found */ - return NULL; -}; - - -#endif /* !__PLATFORM__PC99__ACPI_H__ */ diff --git a/kernel/src/platform/simics/mps.h b/kernel/src/platform/simics/mps.h deleted file mode 100644 index 12f5c5c6..00000000 --- a/kernel/src/platform/simics/mps.h +++ /dev/null @@ -1,176 +0,0 @@ -/********************************************************************* - * - * Copyright (C) 2002, Karlsruhe University - * - * File path: platform/pc99/mps.h - * Description: Intel multiprocessor specification - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: mps.h,v 1.2 2003/09/24 19:05:00 skoglund Exp $ - * - ********************************************************************/ -#ifndef __PLATFORM__PC99__MPS_H__ -#define __PLATFORM__PC99__MPS_H__ - -enum mps_bustype_t { - MP_BUS_UNKNOWN = 0, - MP_BUS_ISA = 1, - MP_BUS_EISA = 2, - MP_BUS_PCI = 3, - MP_BUS_MCA = 4 -}; - - -class mps_mpc_processor_t -{ -public: - u8_t type; - u8_t apicid; - u8_t apicver; - u8_t cpuflag; - u32_t cpufeature; - u32_t featureflag; - u32_t reserved[2]; - -public: - bool is_available() - { return cpuflag & 1; } - bool is_boot_cpu() - { return cpuflag & 2; } -}; - -class mps_mpc_bus_t -{ -public: - - u8_t type; - u8_t busid; - u8_t bustype[6] __attribute__((packed)); - -public: - mps_bustype_t get_bustype() - { - if ((bustype[0] == 'I') && - (bustype[1] == 'S') && - (bustype[2] == 'A')) - return MPS_BUS_ISA; - return MPS_BUS_UNKNOWN; - } -}; - -class mps_mpc_ioapic_t -{ -public: - u8_t type; - u8_t apicid; - u8_t apicver; - u8_t flags; - addr_t addr; - -public: - bool is_usable() - { return flags & 1; } -}; - -class mps_mpc_intsrc_t -{ -public: - enum irqtype_t { - INT = 0, - NMI = 1, - SMI = 2, - ExtINT = 3 - }; - u8_t type; - u8_t irqtype; - u16_t irqflags; - u8_t srcbus; - u8_t srcbusirq; - u8_t dstapic; - u8_t dstirq; - -public: - irqtype_t get_irqtype() - { return (irqtype_t)irqtype; } -}; - - -class mps_mp_config_table_t -{ -public: - enum entrytype_t - { - processor = 0, - bus = 1, - ioapic = 2, - intsrc = 3, - lintsrc = 4 - }; - - u32_t signature; - u32_t length; - u8_t spec; - u8_t checksum; - char oem[8]; - char productid[12]; - addr_t oemptr; - u32_t oemsize; - u32_t entries; - u32_t lapic; - u32_t reserved; - -public: - bool is_valid() - { return signature == ('P'|('C'<<8)|('M'<<16)|('P'<<24)); } -}; - -class mps_mp_floating_t -{ -public: - u32_t signature; - mps_mp_config_table_t * config_table; - u8_t length; - u8_t specification; - u8_t checksum; - u8_t feature[5]; - -public: - static mps_mp_floating_t * scan(addr_t start, addr_t end); - bool is_valid() - { return signature == (('_'<<24)|('P'<<16)|('M'<<8)|'_'); } -}; - -static inline mps_mp_floating_t * mps_mp_floating_t::scan(addr_t start, addr_t end) -{ - start = addr_mask(start, ~0xf); - while (start < end) - { - if (((mps_mp_floating_t*)start)->is_valid()) - return (mps_mp_floating_t*)start; - start = addr_offset(start, 0x10); - } - return NULL; -} - - -#endif /* !__PLATFORM__PC99__MPS_H__ */ diff --git a/kernel/src/platform/simics/nmi.h b/kernel/src/platform/simics/nmi.h deleted file mode 100644 index 2fb35126..00000000 --- a/kernel/src/platform/simics/nmi.h +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************* - * - * Copyright (C) 2002-2003, 2007, Karlsruhe University - * - * File path: platform/simics/nmi.h - * Description: Driver for NMI masking hardware - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: nmi.h,v 1.4 2006/10/19 22:57:36 ud3 Exp $ - * - ********************************************************************/ -#ifndef __PLATFORM__SIMICS__NMI_H__ -#define __PLATFORM__SIMICS__NMI_H__ - -#include INC_ARCH(ioport.h) /* for in_u8/out_u8 */ -#include INC_PLAT(rtc.h) /* for rtc_t */ - -class nmi_t { -public: - static void mask() - { - /* disable NMI with read from rtc port < 0x80 */ - rtc_t<0x70>().read(0); - - /* clear and disable IOCHK and PCI SERR# */ - out_u8(0x61, (in_u8(0x61) & 0x03) | 0x0c); - }; - static void unmask() - { - /* clear and disable IOCHK and PCI SERR# */ - out_u8(0x61, (in_u8(0x61) & 0x03) | 0x0c); - - /* waste some time */ - for (int i = 10000000; i--; ) __asm__ (""); - - /* enable IOCHK and PCI SERR# */ - out_u8(0x61, in_u8(0x61) & 0x03); - - /* enable NMI with read from rtc port < 0x80 */ - rtc_t<0x70>().read(0); - }; -}; - -#endif /* !__PLATFORM__SIMICS__NMI_H__ */ diff --git a/kernel/src/platform/simics/rtc.h b/kernel/src/platform/simics/rtc.h deleted file mode 100644 index efa843d9..00000000 --- a/kernel/src/platform/simics/rtc.h +++ /dev/null @@ -1,100 +0,0 @@ -/********************************************************************* - * - * Copyright (C) 2002-2003, 2007, Karlsruhe University - * - * File path: platform/simics/rtc.h - * Description: driver for Real Time Clock - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: rtc.h,v 1.3 2003/09/24 19:05:00 skoglund Exp $ - * - ********************************************************************/ - -#ifndef __PLATFORM__SIMICS__RTC_H__ -#define __PLATFORM__SIMICS__RTC_H__ - -#include INC_ARCH(ioport.h) /* for in_u8/out_u8 */ - - -/** - * Driver for Real Time Clock - * @param base the base address of the control registers - * - * The template parameter BASE enables compile-time resolution of the - * RTC's control register addresses. - * - * Assumptions: - * - BASE can be passed as port to in_u8/out_u8 - * - The RTC's data register is located at BASE+1 - * - * Uses: - * - out_u8, in_u8 - */ - -template class rtc_t { -public: - - /** - * Read RTC register - * @param reg register to read - * - * @returns the content of RTC register REG. - */ - static u8_t read(const u8_t reg) { - /* select register */ - out_u8(base, reg); - /* read value */ - return in_u8(base+1); - }; - - /** - * Write RTC register - * @param reg register to write - * @param val value to be written - * - * Sets the content of RTC register REG to VAL. - */ - static void write(const u8_t reg, const u8_t val) { - out_u8(base, reg); - out_u8(base+1, val); - }; -}; - -/** - * Waits for a 1 second tick of the realtime clock - */ -INLINE void wait_for_second_tick() -{ - rtc_t<0x70> rtc; - - // wait that update bit is off - while (rtc.read(0x0a) & 0x80); - - // read second value - word_t secstart = rtc.read(0); - - // now wait until seconds change - while (secstart == rtc.read(0)); -} - -#endif /* !__PLATFORM__SIMICS__RTC_H__ */ diff --git a/kernel/src/platform/simics/startup32.S b/kernel/src/platform/simics/startup32.S deleted file mode 100644 index c9296430..00000000 --- a/kernel/src/platform/simics/startup32.S +++ /dev/null @@ -1,69 +0,0 @@ -/********************************************************************* - * - * Copyright (C) 2002-2004, Karlsruhe University - * - * File path: platform/simics/startup32.S - * Description: startup file for pc99 platform - * initializes segments, invokes init_paging and - * startup_system - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $Id: startup32.S,v 1.4 2006/10/19 22:57:40 ud3 Exp $ - * - ********************************************************************/ - -.section .init - - -.globl start -.align 4 -start: - /* Save the multiboot info structure pointer (ebx) to physical - address of kernel_arg. We assume that the kernel IS multibooted. - This value is later on passed to the root task */ - /* UD: Actually, we should save the mbi flags as well - just for the - case where we AREN'T multibooted. */ - cli /* disable int's */ - cld /* clear direction flag */ - mov %ds, %ax - mov %ax, %es - mov %ax, %fs - mov %ax, %gs - mov %ax, %ss - - /* load temporary stack pointer */ - lea _mini_stack-4, %esp - /* set up paging */ - call init_paging - nop - - .align 4 - .space 1024 -_mini_stack: - .align 4 - .section .mb_header -_mb_header: - .long 0x1BADB002 /* magic */ - .long 0x00000000 /* flags */ - .long - 0x00000000 - 0x1BADB002 /* check */ -