Merge tag 'x86_fpu_for_6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux-block.git] / arch / x86 / boot / regs.c
CommitLineData
d6910058 1// SPDX-License-Identifier: GPL-2.0-or-later
7a734e7d
PA
2/* -----------------------------------------------------------------------
3 *
4 * Copyright 2009 Intel Corporation; author H. Peter Anvin
5 *
7a734e7d
PA
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"
c041b5ad 17#include "string.h"
7a734e7d
PA
18
19void initregs(struct biosregs *reg)
20{
0e96f31e 21 memset(reg, 0, sizeof(*reg));
7a734e7d
PA
22 reg->eflags |= X86_EFLAGS_CF;
23 reg->ds = ds();
24 reg->es = ds();
25 reg->fs = fs();
26 reg->gs = gs();
27}