Hi,
in the linux initialization, inside setup_arch, I see ld_mmu_srmmu() (I'm
working on SPARC architecture, SRMMU is Sparc Reference MMU)
and it comprises many macro calls starting with BTFIXUP... The first two lines
look like this
BTFIXUPSET_SIMM13(pgdir_shift, SRMMU_PGDIR_SHIFT); // ___ss_pgdir_shift
<-- "first line"
BTFIXUPSET_SETHI(pgdir_size, SRMMU_PGDIR_SIZE); // ___hs_pgdir_size
...
The macro in the first line BTFIXUPSET_SIMM13 is expanded to
#define BTFIXUPSET_SIMM13(__name, __val
do {
___ss_##__name[0] |= 1;
___ss_##__name[1] = (unsigned)__val;
} while (0)
So the first line just becomes
___ss_pgdir_shift[0] |= 1;
___ss_pgdir_shift[1] = (unsigned)SRMMU_PGDIR_SHIFT;
I looked up __ss_pgdir_shift, and found it's in arch/sparc/boot/btfix.S,
___ss_pgdir_shift:
.word 0x73000000,0,68
.word
_stext+0x000148c8,0,_stext+0x00014c94,0,_stext+0x00015348,0,_stext+0x00016310,0,_stext+0x000163c8,0,_stext+0x00016fb4,0,_stext+0x00017508,0,_stext+0x0007c31c,0,_stext+0x0007c9b0,0,_stext+0x0007da94,0,_stext+0x0007e310,0,_stext+0x0007edbc,0,_stext+0x0007f058,0,_stext+0x0007f234,0,_stext+0x0007f950,0,_stext+0x0007fbb4,0,_stext+0x00080408,0,_stext+0x00084540,0,_stext+0x00084c30,0,_stext+0x00085a60,0,_stext+0x00086598,0,_stext+0x00087b40,0,_stext+0x00087ce4,0,_stext+0x00088c54,0,_stext+0x00089f58,0,_stext+0x0008d748,0,_stext+0x003d08f4,0,__init_begin+0x0000659c,0,__init_begin+0x00007ac8,0,__init_begin+0x00008088,0,__init_begin+0x00008360,0,__init_begin+0x00008720,0,__init_begin+0x00008908,0,__init_begin+0x00008bf8,0
I think this assembly code was built before the compilation of ld_mmu_srmmu.
(this BTFIXUP thing sounds like related to what is called pre-link, I saw it on
the web) and This ld_mmu_srmmu function seems to setup general sparc functions
and values into those for specific sparc sub-architectures.
(replacing genearal things with more specific things)
So the first line is setting bit 0 of 0x73000000 and overwriting
SRMMU_PGIDR_SHIFT (=2^24) at the next word. and there is a number 68 and it is
followed by 68 words. I can see it looks like setting up a page directory table
with certain length.
But how has this assembly been built during pre-link? Is there any good
reference I can read? And Where and how are this values and functions used?
Could somebody give me any answer?
Sorry for many hasty questions.
Best regards,
Chan
_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies