-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also, * move the autogenerated code in a different crate named `arch_gen` * x86_64 code code inside `arch` and `arch_gen` is labeled as such Signed-off-by: Diana Popa <dpopa@amazon.com>
- Loading branch information
Showing
23 changed files
with
276 additions
and
237 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
extern crate byteorder; | ||
extern crate kvm_wrapper; | ||
extern crate libc; | ||
|
||
extern crate arch_gen; | ||
extern crate kvm; | ||
extern crate memory_model; | ||
extern crate sys_util; | ||
|
||
use std::result; | ||
|
||
#[derive(Debug, PartialEq)] | ||
pub enum Error { | ||
/// The zero page extends past the end of guest_mem. | ||
ZeroPagePastRamEnd, | ||
/// Error writing the zero page of guest memory. | ||
ZeroPageSetup, | ||
#[cfg(target_arch = "x86_64")] | ||
/// X86_64 specific error triggered during system configuration. | ||
X86_64Setup(x86_64::Error), | ||
} | ||
pub type Result<T> = result::Result<T, Error>; | ||
|
||
// 1MB. We don't put anything above here except the kernel itself. | ||
pub const HIMEM_START: usize = 0x100000; | ||
|
||
#[cfg(target_arch = "x86_64")] | ||
pub mod x86_64; | ||
impl From<x86_64::Error> for Error { | ||
fn from(e: x86_64::Error) -> Error { | ||
Error::X86_64Setup(e) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the THIRD-PARTY file. | ||
|
||
/// Magic addresses externally used to lay out x86_64 VMs. | ||
|
||
/// Initial stack for the boot CPU. | ||
pub const BOOT_STACK_START: usize = 0x8000; | ||
pub const BOOT_STACK_POINTER: usize = 0x8ff0; | ||
|
||
/// Kernel command line start address. | ||
pub const CMDLINE_START: usize = 0x20000; | ||
/// Kernel command line start address maximum size. | ||
pub const CMDLINE_MAX_SIZE: usize = 0x10000; | ||
|
||
/// The 'zero page', a.k.a linux kernel bootparams. | ||
pub const ZERO_PAGE_START: usize = 0x7000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.