summaryrefslogtreecommitdiffstats
path: root/tests/migration/s390x/a-b-bios.c
blob: a0327cd153b68de29dda5ff5f77f0c035c704cb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * S390 guest code used in migration tests
 *
 * Copyright 2018 Thomas Huth, Red Hat Inc.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 */

#define LOADPARM_LEN 8  /* Needed for sclp.h */

#include <libc.h>
#include <s390-ccw.h>
#include <sclp.h>

char stack[0x8000] __attribute__((aligned(4096)));

#define START_ADDRESS  (1024 * 1024)
#define END_ADDRESS    (100 * 1024 * 1024)

void main(void)
{
    unsigned long addr;

    sclp_setup();
    sclp_print("A");

    while (1) {
        for (addr = START_ADDRESS; addr < END_ADDRESS; addr += 4096) {
            *(volatile char *)addr += 1;  /* Change pages */
        }
        sclp_print("B");
    }
}