blob: c3be85205a6599402d4343c8c2554bb9722a5e54 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
7#ifndef __UM_PROCESSOR_X86_64_H
8#define __UM_PROCESSOR_X86_64_H
9
Linus Torvalds1da177e2005-04-16 15:20:36 -070010struct arch_thread {
Bodo Stroesserc5784552005-05-05 16:15:31 -070011 unsigned long debugregs[8];
12 int debugregs_seq;
Jeff Dikef3555592007-02-10 01:44:29 -080013 unsigned long fs;
Bodo Stroesserc5784552005-05-05 16:15:31 -070014 struct faultinfo faultinfo;
Linus Torvalds1da177e2005-04-16 15:20:36 -070015};
16
Bodo Stroesserc5784552005-05-05 16:15:31 -070017#define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
Jeff Dike5aaf5f72008-02-08 04:22:10 -080018 .debugregs_seq = 0, \
Jeff Dikef3555592007-02-10 01:44:29 -080019 .fs = 0, \
20 .faultinfo = { 0, 0, 0 } }
Bodo Stroesserc5784552005-05-05 16:15:31 -070021
Richard Weinberger9d1ee8c2013-09-23 17:38:01 +020022#define STACKSLOTS_PER_LINE 4
23
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080024static inline void arch_flush_thread(struct arch_thread *thread)
25{
26}
27
28static inline void arch_copy_thread(struct arch_thread *from,
29 struct arch_thread *to)
30{
Jeff Dike5aaf5f72008-02-08 04:22:10 -080031 to->fs = from->fs;
Paolo 'Blaisorblade' Giarrussoaa6758d2006-03-31 02:30:22 -080032}
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034#define current_text_addr() \
35 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
36
Richard Weinberger9d1ee8c2013-09-23 17:38:01 +020037#define current_sp() ({ void *sp; __asm__("movq %%rsp, %0" : "=r" (sp) : ); sp; })
38#define current_bp() ({ unsigned long bp; __asm__("movq %%rbp, %0" : "=r" (bp) : ); bp; })
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040#endif