mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Apply touchups to last PR
Compilers like GCC require comments on lines like `#endif rdmsr`. Since the rdmsr macro was only being used in arch_prctl(), I've localized the macro, and I'm considering deleting arch_prctl() too, since there isn't any way to have mem segments unfortunately across operating systems ;_; The remaining changed lines are due to clang-format which runs on auto.
This commit is contained in:
parent
888cfa74d7
commit
3384a5a48c
6 changed files with 159 additions and 135 deletions
|
@ -40,6 +40,22 @@
|
|||
* operating systems.
|
||||
*/
|
||||
|
||||
#define rdmsr(msr) \
|
||||
({ \
|
||||
uint32_t lo, hi; \
|
||||
asm volatile("rdmsr" : "=a"(lo), "=d"(hi) : "c"(msr)); \
|
||||
(uint64_t) hi << 32 | lo; \
|
||||
})
|
||||
|
||||
#define wrmsr(msr, val) \
|
||||
do { \
|
||||
uint64_t val_ = (val); \
|
||||
asm volatile("wrmsr" \
|
||||
: /* no outputs */ \
|
||||
: "c"(msr), "a"((uint32_t)val_), \
|
||||
"d"((uint32_t)(val_ >> 32))); \
|
||||
} while (0)
|
||||
|
||||
int sys_arch_prctl(int, int64_t) hidden;
|
||||
|
||||
static inline int arch_prctl_fsgsbase(int code, int64_t addr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue