[ug-bosug] hi.. one more doubt..

Vivek Joshi vbjoshi08 at gmail.com
Thu Aug 16 18:40:31 PDT 2007


It supports sparc and x86 architecture ... you have to define such asm
code for both
... Here's a fragment from prof.h,

<snip>

#if defined(__sparc)
     61 #define	MARK(K)	{\
     62 		asm("	.reserve	."#K"., 4, \".bss\", 4"); \
     63 		asm("M."#K":"); \
     64 		asm("	sethi	%hi(."#K".), %o0"); \
     65 		asm("	call	_mcount"); \
     66 		asm("	or	%o0, %lo(."#K".), %o0"); \
     67 		}
     68 #endif
     69
     70 #else	/* __STDC__ */
     71
     72 #if defined(__i386)
     73 #define	MARK(K)	{\
     74 		asm("	.data"); \
     75 		asm("	.align 4"); \
     76 		asm(".K.:"); \
     77 		asm("	.long 0"); \
     78 		asm("	.text"); \
     79 		asm("M.K:"); \
     80 		asm("	movl	$.K., %edx"); \
     81 		asm("	call _mcount"); \
     82 		}
     83 #endif

</snip>


HTH
Vivek



On 8/17/07, KishoreKumar Bairi <prf.kishorekumar at gmail.com> wrote:
> ok. agreed that 90% of kernel code is written in C
> but rest 10% in Assembely Language. right??
> so.. my doubt is.. ASM is different for each kind of processor.
> so, for which microprocessor do they write??
> or do they write the same code for all the processors.
> and since we have only one version of kernel for any kind of processor.
> so is it that the kernel contains asm instructions for all the available
> processors in market till date.
>
> --
> KishoreKumar Bairi
> IIT KHARAGPUR,
> West Bengal 721302.
> _______________________________________________
> ug-bosug mailing list
> List-Unsubscribe:
> mailto:ug-bosug-unsubscribe at opensolaris.org
> List-Owner: mailto:ug-bosug-owner at opensolaris.org
> List-Archives:
> http://www.opensolaris.org/jive/forum.jspa?forumID=54
>


-- 
http://vivekjoshi.livejournal.com


More information about the ug-bosug mailing list