* termios.cc (setspeed): New function.
(cfsetospeed): Use setspeed to set speed. (cfsetispeed): Use setspeed to set speed. * autoload.cc: Add load statement for UuidCreate, and UuidCreateSequential. * cpuid.h: New file. * cygwin.din: Export gethostid. * fhandler_proc.cc (cpuid): Move to cpuid.h. (can_set_flag): Move to cpuid.h. * syscalls.cc (gethostid): New function. * version.h: Bump DLL minor version number to 83.
This commit is contained in:
35
winsup/cygwin/cpuid.h
Normal file
35
winsup/cygwin/cpuid.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef CPUID_H
|
||||
#define CPUID_H
|
||||
|
||||
extern inline void
|
||||
cpuid (unsigned *a, unsigned *b, unsigned *c, unsigned *d, unsigned in)
|
||||
{
|
||||
asm ("cpuid"
|
||||
: "=a" (*a),
|
||||
"=b" (*b),
|
||||
"=c" (*c),
|
||||
"=d" (*d)
|
||||
: "a" (in));
|
||||
}
|
||||
|
||||
extern inline bool
|
||||
can_set_flag (unsigned flag)
|
||||
{
|
||||
unsigned r1, r2;
|
||||
asm("pushfl\n"
|
||||
"popl %0\n"
|
||||
"movl %0, %1\n"
|
||||
"xorl %2, %0\n"
|
||||
"pushl %0\n"
|
||||
"popfl\n"
|
||||
"pushfl\n"
|
||||
"popl %0\n"
|
||||
"pushl %1\n"
|
||||
"popfl\n"
|
||||
: "=&r" (r1), "=&r" (r2)
|
||||
: "ir" (flag)
|
||||
);
|
||||
return ((r1 ^ r2) & flag) != 0;
|
||||
}
|
||||
|
||||
#endif // !CPUID_H
|
Reference in New Issue
Block a user