Skip to content
This repository was archived by the owner on Jun 17, 2022. It is now read-only.

Commit 5f05699

Browse files
committed
Add x64 support
1 parent 3bb6e1d commit 5f05699

File tree

8 files changed

+655
-5
lines changed

8 files changed

+655
-5
lines changed

Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ choice
1111
config TARGET_I386
1212
bool "x86"
1313

14-
config TARGET_X86
14+
config TARGET_X64
1515
bool "x64"
1616

1717
endchoice

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ CFLAGS += $(call cc-option, -fno-stack-protector,)
125125

126126
LIBS := $(LIBPAYLOAD) $(LIBGCC)
127127

128-
SUBDIRS-y += archlib core lib plat dev
128+
SUBDIRS-y += archlib/$(ARCHDIR-y) core lib plat dev
129129

130130
$(foreach subdir,$(SUBDIRS-y),$(eval include $(subdir)/Makefile.inc))
131131

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1717
#
1818

19-
include archlib/x86/Makefile.inc
20-
19+
TARGETS-y += archlib/x86_64/archlib.o archlib/x86_64/regacces.o
20+
TARGETS-y += archlib/x86_64/archsup.S.o archlib/x86_64/ioport.S.o

archlib/x86_64/archlib.c

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*++
2+
3+
Copyright (c) 2014 Minoca Corp.
4+
5+
This file is licensed under the terms of the GNU General Public License
6+
version 3. Alternative licensing terms are available. Contact
7+
info@minocacorp.com for details. See the LICENSE file at the root of this
8+
project for complete licensing information.
9+
10+
Module Name:
11+
12+
archlib.c
13+
14+
Abstract:
15+
16+
This module implements the UEFI architecture support library C routines.
17+
18+
Author:
19+
20+
Evan Green 27-Mar-2014
21+
22+
Environment:
23+
24+
Firmware
25+
26+
--*/
27+
28+
//
29+
// ------------------------------------------------------------------- Includes
30+
//
31+
32+
#include "ueficore.h"
33+
34+
//
35+
// ---------------------------------------------------------------- Definitions
36+
//
37+
38+
//
39+
// ------------------------------------------------------ Data Type Definitions
40+
//
41+
42+
//
43+
// ----------------------------------------------- Internal Function Prototypes
44+
//
45+
46+
//
47+
// -------------------------------------------------------------------- Globals
48+
//
49+
50+
//
51+
// ------------------------------------------------------------------ Functions
52+
//
53+
54+
VOID
55+
EfiCoreInvalidateInstructionCacheRange (
56+
VOID *Address,
57+
UINTN Length
58+
)
59+
60+
/*++
61+
62+
Routine Description:
63+
64+
This routine invalidates a region of memory in the instruction cache.
65+
66+
Arguments:
67+
68+
Address - Supplies the address to invalidate. If translation is enabled,
69+
this is a virtual address.
70+
71+
Length - Supplies the number of bytes in the region to invalidate.
72+
73+
Return Value:
74+
75+
None.
76+
77+
--*/
78+
79+
{
80+
81+
return;
82+
}
83+
84+
//
85+
// --------------------------------------------------------- Internal Functions
86+
//
87+

archlib/x86_64/archsup.S

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*++
2+
3+
Copyright (c) 2017 Minoca Corp.
4+
5+
This file is licensed under the terms of the GNU General Public License
6+
version 3. Alternative licensing terms are available. Contact
7+
info@minocacorp.com for details. See the LICENSE file at the root of this
8+
project for complete licensing information.
9+
10+
Module Name:
11+
12+
archsup.S
13+
14+
Abstract:
15+
16+
This module implements x64 architecture specific support routines.
17+
18+
Author:
19+
20+
Evan Green 11-Aug-2017
21+
22+
Environment:
23+
24+
Firmware
25+
26+
--*/
27+
28+
//
29+
// ------------------------------------------------------------------ Includes
30+
//
31+
32+
#include <minoca/kernel/x64.inc>
33+
34+
//
35+
// ---------------------------------------------------------------------- Code
36+
//
37+
38+
ASSEMBLY_FILE_HEADER
39+
40+
//
41+
// VOID
42+
// EfiMemoryBarrier (
43+
// VOID
44+
// )
45+
//
46+
47+
/*++
48+
49+
Routine Description:
50+
51+
This routine provides a full memory barrier, ensuring that all memory
52+
accesses occurring before this function complete before any memory accesses
53+
after this function start.
54+
55+
Arguments:
56+
57+
None.
58+
59+
Return Value:
60+
61+
None.
62+
63+
--*/
64+
65+
FUNCTION(EfiMemoryBarrier)
66+
lock orq $0, (%rsp)
67+
retq
68+
69+
END_FUNCTION(EfiMemoryBarrier)
70+
71+
//
72+
// --------------------------------------------------------- Internal Functions
73+
//
74+

0 commit comments

Comments
 (0)