Yes, I saw this.
When I test It in Linux, I used a dual core computer. But the snippet
returns "8" number.
Now I know the reason ;)
2018-06-15 19:25 GMT+02:00 Richard Braun :
> On Fri, Jun 15, 2018 at 07:18:55PM +0200, Richard Braun wrote:
> > On Fri, Jun 15, 2018 at 06:27:21PM +0200, Almudena
On Fri, Jun 15, 2018 at 07:18:55PM +0200, Richard Braun wrote:
> On Fri, Jun 15, 2018 at 06:27:21PM +0200, Almudena Garcia wrote:
> > I'm trying to define the cpu_number() in multiprocessor.
> >
> > To do this, I tried to use CPUID assembly x86 instruction, to get the CPU
> > SMP number.
> > The f
On Fri, Jun 15, 2018 at 06:27:21PM +0200, Almudena Garcia wrote:
> I'm trying to define the cpu_number() in multiprocessor.
>
> To do this, I tried to use CPUID assembly x86 instruction, to get the CPU
> SMP number.
> The function, in C, is this:
>
> static inline char smp_processor_id(void) {
>
I'm trying to define the cpu_number() in multiprocessor.
To do this, I tried to use CPUID assembly x86 instruction, to get the CPU
SMP number.
The function, in C, is this:
static inline char smp_processor_id(void) {
char apic_id = 0;
asm("mov $1, %%eax\n\t"
"cpuid\n\t"
"mov %%bh, %0\n\t"