2 ; foo_ are watcom functions, _foo are djgpp functions
13 jnc read_cpuid_nocheck
21 jnc read_cpuid_nocheck
25 ; determine if cpuid is available. avail: cf=0, not avail: cf=1
29 mov edx, eax ; keep a copy of the original eflags in edx
41 ; enter with the cpuid_info structure pointer in eax
48 push eax ; save the original struct pointer
50 mov edi, eax ; struct pointer -> edi
61 mov [esp], eax ; current index
64 mov [edi], eax ; maxidx
65 ; clamp to the size of our cpuid_info structure
70 mov [esp + 4], eax ; maximum index
72 mov [edi + 4], ebx ; vendor name
90 ; try to retrieve the brand string (avail on P4 or newer)
94 jz .done ; no extended cpuid functions
96 jb .done ; no brand string available
98 ; brand string available
99 mov esi, esp ; save esp to esi
100 mov esp, [esp + 8] ; esp <- original struct pointer
101 add esp, 32+48 ; offset to end of brandstr
120 mov esp, esi ; done restore esp