static bool WriteCOMGroup( group_entry *group, signed long chop ) /***************************************************************/ /* write the data for group to the loadfile */ /* returns TRUE if the file should be repositioned */ { unsigned long loc; signed long diff; section *sect; bool repos; outfilelist *finfo; repos = FALSE; sect = group->section; CurrSect = sect; finfo = sect->outfile; loc = SUB_ADDR( group->grp_addr, sect->sect_addr ) + sect->u.file_loc; diff = loc - finfo->file_loc; if( diff > 0 ) { PadLoad( diff ); } else if( diff != 0 ) { SeekLoad( loc ); repos = TRUE; } DEBUG((DBG_LOADDOS, "group %a section %d to %l in %s", &group->grp_addr, sect->ovl_num, loc, finfo->fname )); COMAmountWritten = 0; Ring2Lookup( group->leaders, DoCOMGroup, &chop ); loc += COMAmountWritten; if( loc > finfo->file_loc ) { finfo->file_loc = loc; } return( repos ); }
static bool WriteCOMGroup( group_entry *group, soffset chop ) /***********************************************************/ /* write the data for group to the loadfile */ /* returns true if the file should be repositioned */ { unsigned long file_loc; section *sect; bool repos; outfilelist *finfo; repos = false; sect = group->section; CurrSect = sect; finfo = sect->outfile; file_loc = GROUP_FILE_LOC( group ); if( file_loc > finfo->file_loc ) { PadLoad( file_loc - finfo->file_loc ); } else if( file_loc < finfo->file_loc ) { SeekLoad( file_loc ); repos = true; } DEBUG((DBG_LOADDOS, "group %a section %d to %l in %s", &group->grp_addr, sect->ovl_num, file_loc, finfo->fname )); COMAmountWritten = 0; Ring2Lookup( group->leaders, DoCOMGroup, &chop ); file_loc += COMAmountWritten; if( file_loc > finfo->file_loc ) { finfo->file_loc = file_loc; } return( repos ); }
static void SetQNXGroupFlags( void ) /**********************************/ // This goes through the groups, setting the flag word to be compatible with // the flag words that are specified in the segments. { group_entry * group; for( group = Groups; group != NULL; group = group->next_group ) { if( group->segflags & SEG_DATA ) { group->u.qnxflags = QNX_READ_ONLY; // 1 } else { group->u.qnxflags = QNX_EXEC_ONLY; // 3 } Ring2Lookup( group->leaders, CheckQNXGrpFlag, group ); } }
static unsigned WriteGroups( perm_write_info *info ) /**************************************************/ { group_entry *group; unsigned num; unsigned_32 count; num = 0; for( group = Groups; group != NULL; group = group->next_group ) { if( !group->isautogrp && group->leaders != NULL ) { num++; count = Ring2Count( group->leaders ); BufWritePermFile( info, &count, sizeof(unsigned_32) ); group->sym->name = GetString( info, group->sym->name ); BufWritePermFile( info, &group->sym->name, sizeof(unsigned_32) ); Ring2Lookup( group->leaders, WriteLeaderName, info ); } } return( num ); }