Thomas Gleixner | d691005 | 2019-05-22 09:51:29 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
H. Peter Anvin | 7a734e7 | 2009-04-01 18:08:28 -0700 | [diff] [blame] | 2 | /* ----------------------------------------------------------------------- |
| 3 | * |
| 4 | * Copyright 2009 Intel Corporation; author H. Peter Anvin |
| 5 | * |
H. Peter Anvin | 7a734e7 | 2009-04-01 18:08:28 -0700 | [diff] [blame] | 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" |
Vivek Goyal | c041b5a | 2014-03-18 15:26:37 -0400 | [diff] [blame] | 17 | #include "string.h" |
H. Peter Anvin | 7a734e7 | 2009-04-01 18:08:28 -0700 | [diff] [blame] | 18 | |
| 19 | void initregs(struct biosregs *reg) |
| 20 | { |
Jordan Borgner | 0e96f31 | 2018-10-28 12:58:28 +0000 | [diff] [blame] | 21 | memset(reg, 0, sizeof(*reg)); |
H. Peter Anvin | 7a734e7 | 2009-04-01 18:08:28 -0700 | [diff] [blame] | 22 | reg->eflags |= X86_EFLAGS_CF; |
| 23 | reg->ds = ds(); |
| 24 | reg->es = ds(); |
| 25 | reg->fs = fs(); |
| 26 | reg->gs = gs(); |
| 27 | } |