Loading...
1/* -----------------------------------------------------------------------
2 *
3 * Copyright 2009 Intel Corporation; author H. Peter Anvin
4 *
5 * This file is part of the Linux kernel, and is made available under
6 * the terms of the GNU General Public License version 2 or (at your
7 * option) any later version; incorporated herein by reference.
8 *
9 * ----------------------------------------------------------------------- */
10
11/*
12 * Simple helper function for initializing a register set.
13 *
14 * Note that this sets EFLAGS_CF in the input register set; this
15 * makes it easier to catch functions which do nothing but don't
16 * explicitly set CF.
17 */
18
19#include "boot.h"
20#include "string.h"
21
22void initregs(struct biosregs *reg)
23{
24 memset(reg, 0, sizeof *reg);
25 reg->eflags |= X86_EFLAGS_CF;
26 reg->ds = ds();
27 reg->es = ds();
28 reg->fs = fs();
29 reg->gs = gs();
30}
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* -----------------------------------------------------------------------
3 *
4 * Copyright 2009 Intel Corporation; author H. Peter Anvin
5 *
6 * ----------------------------------------------------------------------- */
7
8/*
9 * Simple helper function for initializing a register set.
10 *
11 * Note that this sets EFLAGS_CF in the input register set; this
12 * makes it easier to catch functions which do nothing but don't
13 * explicitly set CF.
14 */
15
16#include "boot.h"
17#include "string.h"
18
19void initregs(struct biosregs *reg)
20{
21 memset(reg, 0, sizeof(*reg));
22 reg->eflags |= X86_EFLAGS_CF;
23 reg->ds = ds();
24 reg->es = ds();
25 reg->fs = fs();
26 reg->gs = gs();
27}