amd64: Add bsp_reset

Add a temporary implementation of bsp_reset using the keyboard
controller until the ACPI method can be implemented
This commit is contained in:
Matheus Pecoraro
2024-06-03 15:45:29 -03:00
committed by Kinsey Moore
parent 1d997f3338
commit ad24b764d6
3 changed files with 39 additions and 2 deletions

View File

@@ -0,0 +1,37 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (C) 2024 Matheus Pecoraro
*
* 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
*/
#include <bsp/bootcard.h>
#define KEYBOARD_CONTROLLER_PORT 0x64
#define PULSE_RESET_LINE 0xFE
/* TODO: Update this method once APICA is implemented */
void bsp_reset(void)
{
outport_byte(KEYBOARD_CONTROLLER_PORT, PULSE_RESET_LINE);
}

View File

@@ -45,7 +45,6 @@ source:
- bsps/shared/dev/serial/console-termios.c
- bsps/shared/irq/irq-default-handler.c
- bsps/shared/start/bspfatal-default.c
- bsps/shared/start/bspreset-empty.c
- bsps/shared/start/gettargethash-default.c
- bsps/shared/start/sbrk.c
- bsps/x86_64/amd64/clock/clock.c
@@ -54,5 +53,6 @@ source:
- bsps/x86_64/amd64/interrupts/isr_handler.S
- bsps/x86_64/amd64/interrupts/pic.c
- bsps/x86_64/amd64/start/bspstart.c
- bsps/x86_64/amd64/start/bspreset.c
- bsps/x86_64/amd64/start/page.c
type: build

View File

@@ -65,7 +65,6 @@ source:
- bsps/shared/dev/serial/console-termios.c
- bsps/shared/irq/irq-default-handler.c
- bsps/shared/start/bspfatal-default.c
- bsps/shared/start/bspreset-empty.c
- bsps/shared/start/gettargethash-default.c
- bsps/shared/start/sbrk.c
- bsps/x86_64/amd64/clock/eficlock.c
@@ -78,6 +77,7 @@ source:
- bsps/x86_64/amd64/interrupts/isr_handler.S
- bsps/x86_64/amd64/interrupts/pic.c
- bsps/x86_64/amd64/start/bspstart.c
- bsps/x86_64/amd64/start/bspreset.c
- bsps/x86_64/amd64/start/multiboot2.c
- bsps/x86_64/amd64/start/efimem.c
- bsps/x86_64/amd64/start/page.c