creating a C function with a given size in the text segment
问题 I'm programming an embedded powerpc 32 system with a 32 kbyte 8-way set associative L2 instruction cache. To avoid cache thrashing we align functions in a way such that the text of a set of functions called at a high frequency (think interrupt code) ends up in separate cache sets. We do this by inserting dummy functions as needed, e.g. void high_freq1(void) { ... } void dummy(void) { __asm__(/* Silly opcodes to fill ~100 to ~1000 bytes of text segment */); } void high_freq2(void) { ... } This