FreeBSD/sys/boot/arm/at91/libat91/tag_list.c
/*
 * .KB_C_FN_DEFINITION_START
 * void InitTagList(char*, void *)
 *  This global function populates a linux-boot style tag list from the
 * string passed in the pointer at the location specified.
 * .KB_C_FN_DEFINITION_END
 */
.KB_C_FN_DEFINITION_START
void InitTagList(char*, void *)
This global function populates a linux-boot style tag list from the
string passed in the pointer at the location specified.
. KB_C_FN_DEFINITION_START void InitTagList ( char * void * ) This global function populates a linux - boot style tag list from the string passed in the pointer at the location specified .
void InitTagList(char *parms, void *output) {
	char *src, *dst;
	struct tag *tagList = (struct tag*)output;
	tagList->hdr.size  = tag_size(tag_core);
	tagList->hdr.tag   = ATAG_CORE;
	tagList->u.core.flags    = 1;
	tagList->u.core.pagesize = PAGE_SIZE;
	tagList->u.core.rootdev  = 0xff;
	tagList = tag_next(tagList);
	tagList->hdr.size  = tag_size(tag_mem32);
	tagList->hdr.tag   = ATAG_MEM;
	tagList->u.mem.size  = MEM_SIZE;
	tagList->u.mem.start = PHYS_OFFSET;
	tagList = tag_next(tagList);
	tagList->hdr.size  = tag_size(tag_cmdline);
	tagList->hdr.tag   = ATAG_CMDLINE;
	src = parms;
	dst = tagList->u.cmdline.cmdline;
	while (*src) {
		*dst++ = *src++;
	}
	*dst = 0;
	tagList->hdr.size += ((unsigned)(src - parms) + 1) / sizeof(unsigned);
	tagList = tag_next(tagList);
	tagList->hdr.size  = 0;
	tagList->hdr.tag   = ATAG_NONE;
}
void InitTagList ( char * parms , void * output ) { char * src , * dst ; struct tag * tagList = ( struct tag * ) output ; tagList -> hdr . size = tag_size ( tag_core ) ; tagList -> hdr . tag = ATAG_CORE ; tagList -> u . core . flags = 1 ; tagList -> u . core . pagesize = PAGE_SIZE ; tagList -> u . core . rootdev = 0xff ; tagList = tag_next ( tagList ) ; tagList -> hdr . size = tag_size ( tag_mem32 ) ; tagList -> hdr . tag = ATAG_MEM ; tagList -> u . mem . size = MEM_SIZE ; tagList -> u . mem . start = PHYS_OFFSET ; tagList = tag_next ( tagList ) ; tagList -> hdr . size = tag_size ( tag_cmdline ) ; tagList -> hdr . tag = ATAG_CMDLINE ; src = parms ; dst = tagList -> u . cmdline . cmdline ; while ( * src ) { * dst ++ = * src ++ ; } * dst = 0 ; tagList -> hdr . size += ( ( unsigned ) ( src - parms ) + 1 ) / sizeof ( unsigned ) ; tagList = tag_next ( tagList ) ; tagList -> hdr . size = 0 ; tagList -> hdr . tag = ATAG_NONE ; }
.KB_C_FN_DEFINITION_START
 void InitTagList(char*, void *)
  This global function populates a linux-boot style tag list from the
 string passed in the pointer at the location specified.
. KB_C_FN_DEFINITION_START void InitTagList ( char * void * ) This global function populates a linux - boot style tag list from the string passed in the pointer at the location specified .