1 ;; -----------------------------------------------------------------------
3 ;; Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
4 ;; Copyright 2009 Intel Corporation; author: H. Peter Anvin
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ;; Boston MA 02111-1307, USA; either version 2 of the License, or
10 ;; (at your option) any later version; incorporated herein by reference.
12 ;; -----------------------------------------------------------------------
17 ;; 32-bit bcopy routine for real mode
21 ; 32-bit bcopy routine for real mode
23 ; We enter protected mode, set up a flat 32-bit environment, run rep movsd
24 ; and then exit. IMPORTANT: This code assumes cs == 0.
26 ; This code is probably excessively anal-retentive in its handling of
27 ; segments, but this stuff is painful enough as it is without having to rely
28 ; on everything happening "as it ought to."
36 ; 32-bit copy, overlap safe
39 ; ESI - source pointer (-1 means do bzero rather than bcopy)
40 ; EDI - target pointer
44 ; ESI - first byte after source (garbage if ESI == -1 on entry)
45 ; EDI - first byte after target
54 ; shuffle_and_boot_raw:
55 ; The new version of shuffle and boot.
57 ; ESI -> Pointer to list of (dst, src, len) pairs(*)
58 ; EDI -> Pointer to safe area for list + shuffler
59 ; (must not overlap this code nor the RM stack)
60 ; ECX -> Byte count of list area (for initial copy)
62 ; If src == -1: then the memory pointed to by (dst, len) is bzeroed;
63 ; this is handled inside the bcopy routine.
65 ; If len == 0: this marks the end of the list; dst indicates
66 ; the entry point and src the mode (0 = pm, 1 = rm)
68 ; (*) dst, src, and len are four bytes each
75 ; The 32-bit copy and shuffle code is "special", so it is in its own file
77 %include "bcopyxx.inc"