aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/lib/java/util/Collections$EmptySet.class
blob: a1a88ebf79b92dbabeab9021a47b19b3a8dd76ec (plain)
ofshex dumpascii
0000 ca fe ba be 00 00 00 31 00 50 07 00 02 01 00 1e 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c 6c 65 63 .......1.P......java/util/Collec
0020 74 69 6f 6e 73 24 45 6d 70 74 79 53 65 74 07 00 04 01 00 15 6a 61 76 61 2f 75 74 69 6c 2f 41 62 tions$EmptySet......java/util/Ab
0040 73 74 72 61 63 74 53 65 74 07 00 06 01 00 14 6a 61 76 61 2f 69 6f 2f 53 65 72 69 61 6c 69 7a 61 stractSet......java/io/Serializa
0060 62 6c 65 01 00 10 73 65 72 69 61 6c 56 65 72 73 69 6f 6e 55 49 44 01 00 01 4a 01 00 0d 43 6f 6e ble...serialVersionUID...J...Con
0080 73 74 61 6e 74 56 61 6c 75 65 05 15 f5 72 1d b4 03 cb 28 01 00 06 3c 69 6e 69 74 3e 01 00 03 28 stantValue...r....(...<init>...(
00a0 29 56 01 00 04 43 6f 64 65 0a 00 03 00 10 0c 00 0c 00 0d 01 00 0f 4c 69 6e 65 4e 75 6d 62 65 72 )V...Code.............LineNumber
00c0 54 61 62 6c 65 01 00 12 4c 6f 63 61 6c 56 61 72 69 61 62 6c 65 54 61 62 6c 65 01 00 04 74 68 69 Table...LocalVariableTable...thi
00e0 73 01 00 20 4c 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c 6c 65 63 74 69 6f 6e 73 24 45 6d 70 74 79 s...Ljava/util/Collections$Empty
0100 53 65 74 3b 01 00 16 4c 6f 63 61 6c 56 61 72 69 61 62 6c 65 54 79 70 65 54 61 62 6c 65 01 00 25 Set;...LocalVariableTypeTable..%
0120 4c 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c 6c 65 63 74 69 6f 6e 73 24 45 6d 70 74 79 53 65 74 3c Ljava/util/Collections$EmptySet<
0140 54 54 3b 3e 3b 01 00 04 73 69 7a 65 01 00 03 28 29 49 01 00 08 69 74 65 72 61 74 6f 72 01 00 16 TT;>;...size...()I...iterator...
0160 28 29 4c 6a 61 76 61 2f 75 74 69 6c 2f 49 74 65 72 61 74 6f 72 3b 01 00 09 53 69 67 6e 61 74 75 ()Ljava/util/Iterator;...Signatu
0180 72 65 01 00 1b 28 29 4c 6a 61 76 61 2f 75 74 69 6c 2f 49 74 65 72 61 74 6f 72 3c 54 54 3b 3e 3b re...()Ljava/util/Iterator<TT;>;
01a0 09 00 1e 00 20 07 00 1f 01 00 15 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c 6c 65 63 74 69 6f 6e 73 ...........java/util/Collections
01c0 0c 00 21 00 22 01 00 0a 45 4d 50 54 59 5f 4c 49 53 54 01 00 10 4c 6a 61 76 61 2f 75 74 69 6c 2f ..!."...EMPTY_LIST...Ljava/util/
01e0 4c 69 73 74 3b 0b 00 24 00 26 07 00 25 01 00 0e 6a 61 76 61 2f 75 74 69 6c 2f 4c 69 73 74 0c 00 List;..$.&..%...java/util/List..
0200 19 00 1a 01 00 08 63 6f 6e 74 61 69 6e 73 01 00 15 28 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a ......contains...(Ljava/lang/Obj
0220 65 63 74 3b 29 5a 01 00 01 6f 01 00 12 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 74 3b 01 ect;)Z...o...Ljava/lang/Object;.
0240 00 0b 63 6f 6e 74 61 69 6e 73 41 6c 6c 01 00 19 28 4c 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c 6c ..containsAll...(Ljava/util/Coll
0260 65 63 74 69 6f 6e 3b 29 5a 01 00 1c 28 4c 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c 6c 65 63 74 69 ection;)Z...(Ljava/util/Collecti
0280 6f 6e 3c 2a 3e 3b 29 5a 0b 00 2f 00 31 07 00 30 01 00 14 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c on<*>;)Z../.1..0...java/util/Col
02a0 6c 65 63 74 69 6f 6e 0c 00 32 00 33 01 00 07 69 73 45 6d 70 74 79 01 00 03 28 29 5a 01 00 01 63 lection..2.3...isEmpty...()Z...c
02c0 01 00 16 4c 6a 61 76 61 2f 75 74 69 6c 2f 43 6f 6c 6c 65 63 74 69 6f 6e 3b 01 00 19 4c 6a 61 76 ...Ljava/util/Collection;...Ljav
02e0 61 2f 75 74 69 6c 2f 43 6f 6c 6c 65 63 74 69 6f 6e 3c 2a 3e 3b 01 00 06 65 71 75 61 6c 73 07 00 a/util/Collection<*>;...equals..
0300 39 01 00 0d 6a 61 76 61 2f 75 74 69 6c 2f 53 65 74 0b 00 38 00 31 01 00 08 68 61 73 68 43 6f 64 9...java/util/Set..8.1...hashCod
0320 65 01 00 06 72 65 6d 6f 76 65 01 00 09 72 65 6d 6f 76 65 41 6c 6c 01 00 09 72 65 74 61 69 6e 41 e...remove...removeAll...retainA
0340 6c 6c 01 00 07 74 6f 41 72 72 61 79 01 00 15 28 29 5b 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a ll...toArray...()[Ljava/lang/Obj
0360 65 63 74 3b 07 00 42 01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 74 01 00 28 28 5b 4c ect;..B...java/lang/Object..(([L
0380 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 74 3b 29 5b 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 java/lang/Object;)[Ljava/lang/Ob
03a0 6a 65 63 74 3b 01 00 20 3c 45 3a 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 74 3b 3e 28 5b ject;...<E:Ljava/lang/Object;>([
03c0 54 45 3b 29 5b 54 45 3b 01 00 01 61 01 00 13 5b 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 TE;)[TE;...a...[Ljava/lang/Objec
03e0 74 3b 01 00 08 74 6f 53 74 72 69 6e 67 01 00 14 28 29 4c 6a 61 76 61 2f 6c 61 6e 67 2f 53 74 72 t;...toString...()Ljava/lang/Str
0400 69 6e 67 3b 08 00 4a 01 00 02 5b 5d 01 00 0a 53 6f 75 72 63 65 46 69 6c 65 01 00 10 43 6f 6c 6c ing;..J...[]...SourceFile...Coll
0420 65 63 74 69 6f 6e 73 2e 6a 61 76 61 01 00 48 3c 54 3a 4c 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a ections.java..H<T:Ljava/lang/Obj
0440 65 63 74 3b 3e 4c 6a 61 76 61 2f 75 74 69 6c 2f 41 62 73 74 72 61 63 74 53 65 74 3c 54 54 3b 3e ect;>Ljava/util/AbstractSet<TT;>
0460 3b 4c 6a 61 76 61 2f 69 6f 2f 53 65 72 69 61 6c 69 7a 61 62 6c 65 3b 01 00 0c 49 6e 6e 65 72 43 ;Ljava/io/Serializable;...InnerC
0480 6c 61 73 73 65 73 01 00 08 45 6d 70 74 79 53 65 74 00 30 00 01 00 03 00 01 00 05 00 01 00 1a 00 lasses...EmptySet.0.............
04a0 07 00 08 00 01 00 09 00 00 00 02 00 0a 00 0d 00 00 00 0c 00 0d 00 01 00 0e 00 00 00 45 00 01 00 ............................E...
04c0 01 00 00 00 05 2a b7 00 0f b1 00 00 00 03 00 11 00 00 00 0a 00 02 00 00 00 92 00 04 00 94 00 12 .....*..........................
04e0 00 00 00 0c 00 01 00 00 00 05 00 13 00 14 00 00 00 15 00 00 00 0c 00 01 00 00 00 05 00 13 00 16 ................................
0500 00 00 00 01 00 17 00 18 00 01 00 0e 00 00 00 3e 00 01 00 01 00 00 00 02 03 ac 00 00 00 03 00 11 ...............>................
0520 00 00 00 06 00 01 00 00 00 9c 00 12 00 00 00 0c 00 01 00 00 00 02 00 13 00 14 00 00 00 15 00 00 ................................
0540 00 0c 00 01 00 00 00 02 00 13 00 16 00 00 00 01 00 19 00 1a 00 02 00 1b 00 00 00 02 00 1c 00 0e ................................
0560 00 00 00 45 00 01 00 01 00 00 00 09 b2 00 1d b9 00 23 01 00 b0 00 00 00 03 00 11 00 00 00 06 00 ...E.............#..............
0580 01 00 00 00 a6 00 12 00 00 00 0c 00 01 00 00 00 09 00 13 00 14 00 00 00 15 00 00 00 0c 00 01 00 ................................
05a0 00 00 09 00 13 00 16 00 00 00 01 00 27 00 28 00 01 00 0e 00 00 00 48 00 01 00 02 00 00 00 02 03 ............'.(.......H.........
05c0 ac 00 00 00 03 00 11 00 00 00 06 00 01 00 00 00 b2 00 12 00 00 00 16 00 02 00 00 00 02 00 13 00 ................................
05e0 14 00 00 00 00 00 02 00 29 00 2a 00 01 00 15 00 00 00 0c 00 01 00 00 00 02 00 13 00 16 00 00 00 ........).*.....................
0600 01 00 2b 00 2c 00 02 00 1b 00 00 00 02 00 2d 00 0e 00 00 00 57 00 01 00 02 00 00 00 07 2b b9 00 ..+.,.........-.....W........+..
0620 2e 01 00 ac 00 00 00 03 00 11 00 00 00 06 00 01 00 00 00 bd 00 12 00 00 00 16 00 02 00 00 00 07 ................................
0640 00 13 00 14 00 00 00 00 00 07 00 34 00 35 00 01 00 15 00 00 00 16 00 02 00 00 00 07 00 13 00 16 ...........4.5..................
0660 00 00 00 00 00 07 00 34 00 36 00 01 00 01 00 37 00 28 00 01 00 0e 00 00 00 5d 00 01 00 02 00 00 .......4.6.....7.(.......]......
0680 00 17 2b c1 00 38 99 00 11 2b c0 00 38 b9 00 3a 01 00 99 00 05 04 ac 03 ac 00 00 00 03 00 11 00 ..+..8...+..8..:................
06a0 00 00 06 00 01 00 00 00 c7 00 12 00 00 00 16 00 02 00 00 00 17 00 13 00 14 00 00 00 00 00 17 00 ................................
06c0 29 00 2a 00 01 00 15 00 00 00 0c 00 01 00 00 00 17 00 13 00 16 00 00 00 01 00 3b 00 18 00 01 00 ).*.......................;.....
06e0 0e 00 00 00 3e 00 01 00 01 00 00 00 02 03 ac 00 00 00 03 00 11 00 00 00 06 00 01 00 00 00 d0 00 ....>...........................
0700 12 00 00 00 0c 00 01 00 00 00 02 00 13 00 14 00 00 00 15 00 00 00 0c 00 01 00 00 00 02 00 13 00 ................................
0720 16 00 00 00 01 00 3c 00 28 00 01 00 0e 00 00 00 48 00 01 00 02 00 00 00 02 03 ac 00 00 00 03 00 ......<.(.......H...............
0740 11 00 00 00 06 00 01 00 00 00 da 00 12 00 00 00 16 00 02 00 00 00 02 00 13 00 14 00 00 00 00 00 ................................
0760 02 00 29 00 2a 00 01 00 15 00 00 00 0c 00 01 00 00 00 02 00 13 00 16 00 00 00 01 00 3d 00 2c 00 ..).*.......................=.,.
0780 02 00 1b 00 00 00 02 00 2d 00 0e 00 00 00 52 00 01 00 02 00 00 00 02 03 ac 00 00 00 03 00 11 00 ........-.....R.................
07a0 00 00 06 00 01 00 00 00 e5 00 12 00 00 00 16 00 02 00 00 00 02 00 13 00 14 00 00 00 00 00 02 00 ................................
07c0 34 00 35 00 01 00 15 00 00 00 16 00 02 00 00 00 02 00 13 00 16 00 00 00 00 00 02 00 34 00 36 00 4.5.........................4.6.
07e0 01 00 01 00 3e 00 2c 00 02 00 1b 00 00 00 02 00 2d 00 0e 00 00 00 52 00 01 00 02 00 00 00 02 03 ....>.,.........-.....R.........
0800 ac 00 00 00 03 00 11 00 00 00 06 00 01 00 00 00 f0 00 12 00 00 00 16 00 02 00 00 00 02 00 13 00 ................................
0820 14 00 00 00 00 00 02 00 34 00 35 00 01 00 15 00 00 00 16 00 02 00 00 00 02 00 13 00 16 00 00 00 ........4.5.....................
0840 00 00 02 00 34 00 36 00 01 00 01 00 3f 00 40 00 01 00 0e 00 00 00 41 00 01 00 01 00 00 00 05 03 ....4.6.....?.@.......A.........
0860 bd 00 41 b0 00 00 00 03 00 11 00 00 00 06 00 01 00 00 00 f9 00 12 00 00 00 0c 00 01 00 00 00 05 ..A.............................
0880 00 13 00 14 00 00 00 15 00 00 00 0c 00 01 00 00 00 05 00 13 00 16 00 00 00 01 00 3f 00 43 00 02 ...........................?.C..
08a0 00 1b 00 00 00 02 00 44 00 0e 00 00 00 59 00 03 00 02 00 00 00 0b 2b be 9e 00 07 2b 03 01 53 2b .......D.....Y........+....+..S+
08c0 b0 00 00 00 03 00 11 00 00 00 0e 00 03 00 00 01 04 00 05 01 05 00 09 01 06 00 12 00 00 00 16 00 ................................
08e0 02 00 00 00 0b 00 13 00 14 00 00 00 00 00 0b 00 45 00 46 00 01 00 15 00 00 00 0c 00 01 00 00 00 ................E.F.............
0900 0b 00 13 00 16 00 00 00 01 00 47 00 48 00 01 00 0e 00 00 00 3f 00 01 00 01 00 00 00 03 12 49 b0 ..........G.H.......?.........I.
0920 00 00 00 03 00 11 00 00 00 06 00 01 00 00 01 10 00 12 00 00 00 0c 00 01 00 00 00 03 00 13 00 14 ................................
0940 00 00 00 15 00 00 00 0c 00 01 00 00 00 03 00 13 00 16 00 00 00 03 00 4b 00 00 00 02 00 4c 00 1b .......................K.....L..
0960 00 00 00 02 00 4d 00 4e 00 00 00 0a 00 01 00 01 00 1e 00 4f 00 1a .....M.N...........O..
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540
/******************************************************************************
 * memory.h
 *
 * Memory reservation and information.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
 */

#ifndef __XEN_PUBLIC_MEMORY_H__
#define __XEN_PUBLIC_MEMORY_H__

FILE_LICENCE ( MIT );

#include "xen.h"

/*
 * Increase or decrease the specified domain's memory reservation. Returns the
 * number of extents successfully allocated or freed.
 * arg == addr of struct xen_memory_reservation.
 */
#define XENMEM_increase_reservation 0
#define XENMEM_decrease_reservation 1
#define XENMEM_populate_physmap     6

#if __XEN_INTERFACE_VERSION__ >= 0x00030209
/*
 * Maximum # bits addressable by the user of the allocated region (e.g., I/O
 * devices often have a 32-bit limitation even in 64-bit systems). If zero
 * then the user has no addressing restriction. This field is not used by
 * XENMEM_decrease_reservation.
 */
#define XENMEMF_address_bits(x)     (x)
#define XENMEMF_get_address_bits(x) ((x) & 0xffu)
/* NUMA node to allocate from. */
#define XENMEMF_node(x)     (((x) + 1) << 8)
#define XENMEMF_get_node(x) ((((x) >> 8) - 1) & 0xffu)
/* Flag to populate physmap with populate-on-demand entries */
#define XENMEMF_populate_on_demand (1<<16)
/* Flag to request allocation only from the node specified */
#define XENMEMF_exact_node_request  (1<<17)
#define XENMEMF_exact_node(n) (XENMEMF_node(n) | XENMEMF_exact_node_request)
#endif

struct xen_memory_reservation {

    /*
     * XENMEM_increase_reservation:
     *   OUT: MFN (*not* GMFN) bases of extents that were allocated
     * XENMEM_decrease_reservation:
     *   IN:  GMFN bases of extents to free
     * XENMEM_populate_physmap:
     *   IN:  GPFN bases of extents to populate with memory
     *   OUT: GMFN bases of extents that were allocated
     *   (NB. This command also updates the mach_to_phys translation table)
     * XENMEM_claim_pages:
     *   IN: must be zero
     */
    XEN_GUEST_HANDLE(xen_pfn_t) extent_start;

    /* Number of extents, and size/alignment of each (2^extent_order pages). */
    xen_ulong_t    nr_extents;
    unsigned int   extent_order;

#if __XEN_INTERFACE_VERSION__ >= 0x00030209
    /* XENMEMF flags. */
    unsigned int   mem_flags;
#else
    unsigned int   address_bits;
#endif

    /*
     * Domain whose reservation is being changed.
     * Unprivileged domains can specify only DOMID_SELF.
     */
    domid_t        domid;
};
typedef struct xen_memory_reservation xen_memory_reservation_t;
DEFINE_XEN_GUEST_HANDLE(xen_memory_reservation_t);

/*
 * An atomic exchange of memory pages. If return code is zero then
 * @out.extent_list provides GMFNs of the newly-allocated memory.
 * Returns zero on complete success, otherwise a negative error code.
 * On complete success then always @nr_exchanged == @in.nr_extents.
 * On partial success @nr_exchanged indicates how much work was done.
 */
#define XENMEM_exchange             11
struct xen_memory_exchange {
    /*
     * [IN] Details of memory extents to be exchanged (GMFN bases).
     * Note that @in.address_bits is ignored and unused.
     */
    struct xen_memory_reservation in;

    /*
     * [IN/OUT] Details of new memory extents.
     * We require that:
     *  1. @in.domid == @out.domid
     *  2. @in.nr_extents  << @in.extent_order ==
     *     @out.nr_extents << @out.extent_order
     *  3. @in.extent_start and @out.extent_start lists must not overlap
     *  4. @out.extent_start lists GPFN bases to be populated
     *  5. @out.extent_start is overwritten with allocated GMFN bases
     */
    struct xen_memory_reservation out;

    /*
     * [OUT] Number of input extents that were successfully exchanged:
     *  1. The first @nr_exchanged input extents were successfully
     *     deallocated.
     *  2. The corresponding first entries in the output extent list correctly
     *     indicate the GMFNs that were successfully exchanged.
     *  3. All other input and output extents are untouched.
     *  4. If not all input exents are exchanged then the return code of this
     *     command will be non-zero.
     *  5. THIS FIELD MUST BE INITIALISED TO ZERO BY THE CALLER!
     */
    xen_ulong_t nr_exchanged;
};
typedef struct xen_memory_exchange xen_memory_exchange_t;
DEFINE_XEN_GUEST_HANDLE(xen_memory_exchange_t);

/*
 * Returns the maximum machine frame number of mapped RAM in this system.
 * This command always succeeds (it never returns an error code).
 * arg == NULL.
 */
#define XENMEM_maximum_ram_page     2

/*
 * Returns the current or maximum memory reservation, in pages, of the
 * specified domain (may be DOMID_SELF). Returns -ve errcode on failure.
 * arg == addr of domid_t.
 */
#define XENMEM_current_reservation  3
#define XENMEM_maximum_reservation  4

/*
 * Returns the maximum GPFN in use by the guest, or -ve errcode on failure.
 */
#define XENMEM_maximum_gpfn         14

/*
 * Returns a list of MFN bases of 2MB extents comprising the machine_to_phys
 * mapping table. Architectures which do not have a m2p table do not implement
 * this command.
 * arg == addr of xen_machphys_mfn_list_t.
 */
#define XENMEM_machphys_mfn_list    5
struct xen_machphys_mfn_list {
    /*
     * Size of the 'extent_start' array. Fewer entries will be filled if the
     * machphys table is smaller than max_extents * 2MB.
     */
    unsigned int max_extents;

    /*
     * Pointer to buffer to fill with list of extent starts. If there are
     * any large discontiguities in the machine address space, 2MB gaps in
     * the machphys table will be represented by an MFN base of zero.
     */
    XEN_GUEST_HANDLE(xen_pfn_t) extent_start;

    /*
     * Number of extents written to the above array. This will be smaller
     * than 'max_extents' if the machphys table is smaller than max_e * 2MB.
     */
    unsigned int nr_extents;
};
typedef struct xen_machphys_mfn_list xen_machphys_mfn_list_t;
DEFINE_XEN_GUEST_HANDLE(xen_machphys_mfn_list_t);

/*
 * For a compat caller, this is identical to XENMEM_machphys_mfn_list.
 *
 * For a non compat caller, this functions similarly to
 * XENMEM_machphys_mfn_list, but returns the mfns making up the compatibility
 * m2p table.
 */
#define XENMEM_machphys_compat_mfn_list     25

/*
 * Returns the location in virtual address space of the machine_to_phys
 * mapping table. Architectures which do not have a m2p table, or which do not
 * map it by default into guest address space, do not implement this command.
 * arg == addr of xen_machphys_mapping_t.
 */
#define XENMEM_machphys_mapping     12
struct xen_machphys_mapping {
    xen_ulong_t v_start, v_end; /* Start and end virtual addresses.   */
    xen_ulong_t max_mfn;        /* Maximum MFN that can be looked up. */
};
typedef struct xen_machphys_mapping xen_machphys_mapping_t;
DEFINE_XEN_GUEST_HANDLE(xen_machphys_mapping_t);

/* Source mapping space. */
/* ` enum phys_map_space { */
#define XENMAPSPACE_shared_info  0 /* shared info page */
#define XENMAPSPACE_grant_table  1 /* grant table page */
#define XENMAPSPACE_gmfn         2 /* GMFN */
#define XENMAPSPACE_gmfn_range   3 /* GMFN range, XENMEM_add_to_physmap only. */
#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom,
                                    * XENMEM_add_to_physmap_batch only. */
/* ` } */

/*
 * Sets the GPFN at which a particular page appears in the specified guest's
 * pseudophysical address space.
 * arg == addr of xen_add_to_physmap_t.
 */
#define XENMEM_add_to_physmap      7
struct xen_add_to_physmap {
    /* Which domain to change the mapping for. */
    domid_t domid;

    /* Number of pages to go through for gmfn_range */
    uint16_t    size;

    unsigned int space; /* => enum phys_map_space */

#define XENMAPIDX_grant_table_status 0x80000000

    /* Index into space being mapped. */
    xen_ulong_t idx;

    /* GPFN in domid where the source mapping page should appear. */
    xen_pfn_t     gpfn;
};
typedef struct xen_add_to_physmap xen_add_to_physmap_t;
DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);

/* A batched version of add_to_physmap. */
#define XENMEM_add_to_physmap_batch 23
struct xen_add_to_physmap_batch {
    /* IN */
    /* Which domain to change the mapping for. */
    domid_t domid;
    uint16_t space; /* => enum phys_map_space */

    /* Number of pages to go through */
    uint16_t size;
    domid_t foreign_domid; /* IFF gmfn_foreign */

    /* Indexes into space being mapped. */
    XEN_GUEST_HANDLE(xen_ulong_t) idxs;

    /* GPFN in domid where the source mapping page should appear. */
    XEN_GUEST_HANDLE(xen_pfn_t) gpfns;

    /* OUT */

    /* Per index error code. */
    XEN_GUEST_HANDLE(int) errs;
};
typedef struct xen_add_to_physmap_batch xen_add_to_physmap_batch_t;
DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_batch_t);

#if __XEN_INTERFACE_VERSION__ < 0x00040400
#define XENMEM_add_to_physmap_range XENMEM_add_to_physmap_batch
#define xen_add_to_physmap_range xen_add_to_physmap_batch
typedef struct xen_add_to_physmap_batch xen_add_to_physmap_range_t;
DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_range_t);
#endif

/*
 * Unmaps the page appearing at a particular GPFN from the specified guest's
 * pseudophysical address space.
 * arg == addr of xen_remove_from_physmap_t.
 */
#define XENMEM_remove_from_physmap      15
struct xen_remove_from_physmap {
    /* Which domain to change the mapping for. */
    domid_t domid;

    /* GPFN of the current mapping of the page. */
    xen_pfn_t     gpfn;
};
typedef struct xen_remove_from_physmap xen_remove_from_physmap_t;
DEFINE_XEN_GUEST_HANDLE(xen_remove_from_physmap_t);

/*** REMOVED ***/
/*#define XENMEM_translate_gpfn_list  8*/

/*
 * Returns the pseudo-physical memory map as it was when the domain
 * was started (specified by XENMEM_set_memory_map).
 * arg == addr of xen_memory_map_t.
 */
#define XENMEM_memory_map           9
struct xen_memory_map {
    /*
     * On call the number of entries which can be stored in buffer. On
     * return the number of entries which have been stored in
     * buffer.
     */
    unsigned int nr_entries;

    /*
     * Entries in the buffer are in the same format as returned by the
     * BIOS INT 0x15 EAX=0xE820 call.
     */
    XEN_GUEST_HANDLE(void) buffer;
};
typedef struct xen_memory_map xen_memory_map_t;
DEFINE_XEN_GUEST_HANDLE(xen_memory_map_t);

/*
 * Returns the real physical memory map. Passes the same structure as
 * XENMEM_memory_map.
 * arg == addr of xen_memory_map_t.
 */
#define XENMEM_machine_memory_map   10

/*
 * Set the pseudo-physical memory map of a domain, as returned by
 * XENMEM_memory_map.
 * arg == addr of xen_foreign_memory_map_t.
 */
#define XENMEM_set_memory_map       13
struct xen_foreign_memory_map {
    domid_t domid;
    struct xen_memory_map map;
};
typedef struct xen_foreign_memory_map xen_foreign_memory_map_t;
DEFINE_XEN_GUEST_HANDLE(xen_foreign_memory_map_t);

#define XENMEM_set_pod_target       16
#define XENMEM_get_pod_target       17
struct xen_pod_target {
    /* IN */
    uint64_t target_pages;
    /* OUT */
    uint64_t tot_pages;
    uint64_t pod_cache_pages;
    uint64_t pod_entries;
    /* IN */
    domid_t domid;
};
typedef struct xen_pod_target xen_pod_target_t;

#if defined(__XEN__) || defined(__XEN_TOOLS__)

#ifndef uint64_aligned_t
#define uint64_aligned_t uint64_t
#endif

/*
 * Get the number of MFNs saved through memory sharing.
 * The call never fails.
 */
#define XENMEM_get_sharing_freed_pages    18
#define XENMEM_get_sharing_shared_pages   19

#define XENMEM_paging_op                    20
#define XENMEM_paging_op_nominate           0
#define XENMEM_paging_op_evict              1
#define XENMEM_paging_op_prep               2

struct xen_mem_event_op {
    uint8_t     op;         /* XENMEM_*_op_* */
    domid_t     domain;


    /* PAGING_PREP IN: buffer to immediately fill page in */
    uint64_aligned_t    buffer;
    /* Other OPs */
    uint64_aligned_t    gfn;           /* IN:  gfn of page being operated on */
};
typedef struct xen_mem_event_op xen_mem_event_op_t;
DEFINE_XEN_GUEST_HANDLE(xen_mem_event_op_t);

#define XENMEM_access_op                    21
#define XENMEM_access_op_resume             0
#define XENMEM_access_op_set_access         1
#define XENMEM_access_op_get_access         2

typedef enum {
    XENMEM_access_n,
    XENMEM_access_r,
    XENMEM_access_w,
    XENMEM_access_rw,
    XENMEM_access_x,
    XENMEM_access_rx,
    XENMEM_access_wx,
    XENMEM_access_rwx,
    /*
     * Page starts off as r-x, but automatically
     * change to r-w on a write
     */
    XENMEM_access_rx2rw,
    /*
     * Log access: starts off as n, automatically
     * goes to rwx, generating an event without
     * pausing the vcpu
     */
    XENMEM_access_n2rwx,
    /* Take the domain default */
    XENMEM_access_default
} xenmem_access_t;

struct xen_mem_access_op {
    /* XENMEM_access_op_* */
    uint8_t op;
    /* xenmem_access_t */
    uint8_t access;
    domid_t domid;
    /*
     * Number of pages for set op
     * Ignored on setting default access and other ops
     */
    uint32_t nr;
    /*
     * First pfn for set op
     * pfn for get op
     * ~0ull is used to set and get the default access for pages
     */
    uint64_aligned_t pfn;
};
typedef struct xen_mem_access_op xen_mem_access_op_t;
DEFINE_XEN_GUEST_HANDLE(xen_mem_access_op_t);

#define XENMEM_sharing_op                   22
#define XENMEM_sharing_op_nominate_gfn      0
#define XENMEM_sharing_op_nominate_gref     1
#define XENMEM_sharing_op_share             2
#define XENMEM_sharing_op_resume            3
#define XENMEM_sharing_op_debug_gfn         4
#define XENMEM_sharing_op_debug_mfn         5
#define XENMEM_sharing_op_debug_gref        6
#define XENMEM_sharing_op_add_physmap       7
#define XENMEM_sharing_op_audit             8

#define XENMEM_SHARING_OP_S_HANDLE_INVALID  (-10)
#define XENMEM_SHARING_OP_C_HANDLE_INVALID  (-9)

/* The following allows sharing of grant refs. This is useful
 * for sharing utilities sitting as "filters" in IO backends
 * (e.g. memshr + blktap(2)). The IO backend is only exposed
 * to grant references, and this allows sharing of the grefs */
#define XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG   (1ULL << 62)

#define XENMEM_SHARING_OP_FIELD_MAKE_GREF(field, val)  \
    (field) = (XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG | val)
#define XENMEM_SHARING_OP_FIELD_IS_GREF(field)         \
    ((field) & XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG)
#define XENMEM_SHARING_OP_FIELD_GET_GREF(field)        \
    ((field) & (~XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG))

struct xen_mem_sharing_op {
    uint8_t     op;     /* XENMEM_sharing_op_* */
    domid_t     domain;

    union {
        struct mem_sharing_op_nominate {  /* OP_NOMINATE_xxx           */
            union {
                uint64_aligned_t gfn;     /* IN: gfn to nominate       */
                uint32_t      grant_ref;  /* IN: grant ref to nominate */
            } u;
            uint64_aligned_t  handle;     /* OUT: the handle           */
        } nominate;
        struct mem_sharing_op_share {     /* OP_SHARE/ADD_PHYSMAP */
            uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
            uint64_aligned_t source_handle; /* IN: handle to the source page */
            uint64_aligned_t client_gfn;    /* IN: the client gfn */
            uint64_aligned_t client_handle; /* IN: handle to the client page */
            domid_t  client_domain; /* IN: the client domain id */
        } share;
        struct mem_sharing_op_debug {     /* OP_DEBUG_xxx */
            union {
                uint64_aligned_t gfn;      /* IN: gfn to debug          */
                uint64_aligned_t mfn;      /* IN: mfn to debug          */
                uint32_t gref;     /* IN: gref to debug         */
            } u;
        } debug;
    } u;
};
typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);

/*
 * Attempt to stake a claim for a domain on a quantity of pages
 * of system RAM, but _not_ assign specific pageframes.  Only
 * arithmetic is performed so the hypercall is very fast and need
 * not be preemptible, thus sidestepping time-of-check-time-of-use
 * races for memory allocation.  Returns 0 if the hypervisor page
 * allocator has atomically and successfully claimed the requested
 * number of pages, else non-zero.
 *
 * Any domain may have only one active claim.  When sufficient memory
 * has been allocated to resolve the claim, the claim silently expires.
 * Claiming zero pages effectively resets any outstanding claim and
 * is always successful.
 *
 * Note that a valid claim may be staked even after memory has been
 * allocated for a domain.  In this case, the claim is not incremental,
 * i.e. if the domain's tot_pages is 3, and a claim is staked for 10,
 * only 7 additional pages are claimed.
 *
 * Caller must be privileged or the hypercall fails.
 */
#define XENMEM_claim_pages                  24

/*
 * XENMEM_claim_pages flags - the are no flags at this time.
 * The zero value is appropiate.
 */

#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */

/* Next available subop number is 26 */

#endif /* __XEN_PUBLIC_MEMORY_H__ */

/*
 * Local variables:
 * mode: C
 * c-file-style: "BSD"
 * c-basic-offset: 4
 * tab-width: 4
 * indent-tabs-mode: nil
 * End:
 */