^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /* -----------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright 2009 Intel Corporation; author H. Peter Anvin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * ----------------------------------------------------------------------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Simple helper function for initializing a register set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Note that this sets EFLAGS_CF in the input register set; this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * makes it easier to catch functions which do nothing but don't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * explicitly set CF.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include "boot.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include "string.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) void initregs(struct biosregs *reg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) memset(reg, 0, sizeof(*reg));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) reg->eflags |= X86_EFLAGS_CF;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) reg->ds = ds();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) reg->es = ds();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) reg->fs = fs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) reg->gs = gs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) }