raspberry-pi-os icon indicating copy to clipboard operation
raspberry-pi-os copied to clipboard

Put non-primary cores to sleep instead of endless loop

Open Benjoyo opened this issue 6 years ago • 3 comments

I just finished lesson01 and was wondering if the proc_hang endless loop that all non-primary cores go into wouldn't put 100% load on these three cores?

I was looking into the ARM documentation trying to find an instruction that basically disables a core and found wfe (wait for event) which will completely disable the clock for that core until an interrupt occurs. I think that is a bit nicer than a loop.

So I suggest:

proc_hang: 
	wfe
	b 	proc_hang

Benjoyo avatar May 08 '19 16:05 Benjoyo

Thanks, @Benjoyo ! This makes sense. I'll update the code.

s-matyukevich avatar May 08 '19 16:05 s-matyukevich

@s-matyukevich btw thank you so much for this amazing resource, it's simple enough to understand everything and functional enough to motivate - and everything is explained in much more detail than elsewhere. I hope there will be more lessons in the future, keep it up :)

Benjoyo avatar May 08 '19 18:05 Benjoyo

Thanks, @Benjoyo ! I made a big pause but recently I resumed the work, so hopefully, I'll be able to finish lesson 7 soon.

s-matyukevich avatar May 10 '19 01:05 s-matyukevich