summaryrefslogtreecommitdiff
path: root/regress/sys/kern/stackpivot/pivot.h
blob: 4f13a45bacf7b9e7e506e22f2b3eac0d89b94d62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#ifndef REGRESS_PIVOT_H
#define REGRESS_PIVOT_H

static void pivot(size_t *newstack) {
#if defined(__amd64__)
    asm("mov %0, %%rsp; retq;" ::"r"(newstack));
#elif defined(__i386__)
    asm("mov %0, %%esp; retl;" ::"r"(newstack));
#endif
}

#endif