%'********************************************************************* %' %' TITLE: CTABLE.MAC %' %' DATE: 10 August, 1982 %' %' ABSTRACT: This module contains the following macro definitions %' which provide iRMX/86 system configuration: %' %' SAB( start_base, end_base, type ) %' %' JOB( dir_sz, pool_min, pool_max, max_obj, max_tasks, %' max_job_priority, e_h_start_addr, e_h_mode, %' job_flags, init_task_priority, init_task_entry, %' data_seg_addr, init_task_stack, stack_size, %' task_flags) %' %' OSX( 80130_address, offchip_address, extended_system ) %' %' SYSTEM( nucleus_entry, rod_size, min_transfer_size, %' debugger, e_h_provided, e_h_mode ) %' %'********************************************************************* $genonly $NOLIST %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' UTILITY MACROS %' %' Define the utility macros used by system configuration macros %' in this module: %' %' TRIM -- cleans up blanks from the input parameter. %' ARG -- gets the next comma delimited parameter trimmed of %' spaces. %' POINTER -- gets an argument in the form of an address. %' HEX_IT -- adds a leading 0 and an ending H to the input %' parameter if not already present. %' ABS -- returns the absolute value of a hex number. %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' TRIM(a) -- returns the input parameter trimmed of leading and %' trailing blanks. %' %*DEFINE(trim(a)) LOCAL x y (%MATCH( x y)(%a)%x) %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' ARG -- gets the next comma-delimited arg from variable named %' tail, stripped, and trimmed. %' %*DEFINE(arg) LOCAL a (%MATCH(a,tail)(%tail)%TRIM(%a)) %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' HEX_IT(hex_what) %' -- forces argument to hex, adds leading zero and trailing %' "H" if necessary. HEX_IT does not clean up (trim) the %' input parameter. %' %*DEFINE(hex_it(hex_what)) LOCAL last_char (%' %DEFINE(last_char)(%SUBSTR(%hex_what,%len(%hex_what),1))%' %if( %NES(%SUBSTR(%hex_what,1,1),%(0)) )then(%(0))FI%' %hex_what%' %if( %NES(%last_char,%(h)) AND%' %' '%NES(%last_char,%(H)) )then(%(H))FI%' )%' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' POINTER -- gets an argument that must be an address. %' %*DEFINE(POINTER)(%MATCH(base_part:offset_part)(%arg)%' %hex_it(%offset_part),%hex_it(%base_part)) %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' END UTILITY MACROS %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' Define the System_Address_Block structure. %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUBLIC sab_list_ptr, number_sabs SAB struc dw ? ; start_addr dw ? ; end_addr dw ? ; type SAB ends %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' Define the User_job descriptor structures. %' User_Job structure is used only by the JOB macro. %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; USER_JOB struc dw ? ; dir_size dw ? ; pool_min dw ? ; pool_max dw ? ; max_objects dw ? ; max_tasks db ? ; max_job_priority dw ? ; exception_handler_entry dw ? ; ditto db ? ; exception_handler_mode dw ? ; job_flags db ? ; task_priority dw ? ; task_entry dw ? ; ditto dw ? ; data_seg dw ? ; stack_ptr dw ? ; ditto dw ? ; stack_size dw ? ; task_flags USER_JOB ends %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' Define the exception handler info structures. %' %' E_H_I is used in conjunction with the U_J structure to define the %' data and place a pointer to it into the U_J struc. %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; E_H_I struc dd ? ;-- The e_h pointer db 1 ;-- its mode E_H_I ends %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' Define groups and segments used here. %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; cgroup group code, SAB_Descriptors, U_J_Descriptors dgroup group data assume cs: cgroup code segment byte public 'code' ;ROM code code ends data segment byte public 'data' ;RAM data data ends SAB_Descriptors segment word public 'code' ; ROM data SAB_list label near SAB_Descriptors ends U_J_Descriptors segment word public 'code' ; ROM data U_J_list label near U_J_Descriptors ends %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' SAB: MACRO %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' Set number of SABs to zero initially. %SET(n_SABs,0)%' %' u equ 0 ;-- untyped %' %*DEFINE(SAB(arglist))(%DEFINE(tail)(%arglist)%' %' %' Increment number of SABs each time this macro is invoked. %SET(n_SABs,%n_SABs+1)%' %' SAB_descriptors segment SAB< %hex_it(%arg), ; start_base & %hex_it(%arg), ; end_base & %arg ; type & > SAB_descriptors ends %' )%' End of the SAB macro %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' JOB: MACRO %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' Set number of JOBs initially to zero. %SET(n_jobs,0)%' %' %*DEFINE(JOB(arglist))(%DEFINE(tail)(%arglist)%' %' %' Increment number of JOBs each time this macro is invoked. %SET(n_jobs,%n_jobs+1)%' %' %' Output job number and info. ;*** JOB #%n_jobs ***; %' U_J_descriptors segment User_Job< %arg, ; dir_sz & %arg, ; pool_min & %arg, ; pool_max & %arg, ; max_obj & %arg, ; max_tasks & %arg, ; max_job_priority & %pointer, ; e_h_entry & %arg, ; e_h_mode & %arg, ; job_flags & %arg, ; task_priority & %pointer, ; task_entry & %hex_it(%arg), ; d_seg & %pointer, ; stk_ptr & %arg, ; stk_size & %arg ; task_flags & > U_J_descriptors ends $eject )%' end of the JOB macro %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' OSX: MACRO %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' define _80130_system as FALSE for now. %SET(_80130_system,0)%' %' %*DEFINE(OSX(onchip_par,offchip_par,ext_par))%' (%' %' ;----------------------------; ;------- OSP SUPPORT --------; ;----------------------------; ; %if(%EQS(%SUBSTR(%trim(%ext_par),1,1),Y) OR %' %' '%EQS(%SUBSTR(%trim(%ext_par),1,1),y)) then(%' ;-- EXTENDED OSP SYSTEM ) else(%' ;-- OSP SYSTEM(UNEXTENDED) )FI%' ; %' %'PUT TRUE INTO _80130_system BOOLEAN. %' %SET(_80130_system,-1)%' %' %'GET 80130 COMPONENT BASE ADDRESS. %' %SET(nuc_ptr,%hex_it(%trim(%onchip_par)))%' ;-- PHYSICAL ADDRESSES: ;-- OSF (COMPONENT) = ;-- %nuc_ptr:0H%' %' %' the macro assembler chokes if one of these variables overflows. We %' must break the word into byte size chunks. %SET(nuc_hi,(%nuc_ptr / 0100h))%' %SET(nuc_lo,(%nuc_ptr MOD 0100h))%' %' %' if contiguous 80130 system, calculate support code base address. %' %if(%EQS(%SUBSTR(%trim(%offchip_par),1,1),Y) OR%' %' '%EQS(%SUBSTR(%trim(%offchip_par),1,1),y)) then(%' %SET(off_hi,(%nuc_hi + 4))%' %SET(saved_hi,%off_hi)%' %SET(off_lo,%nuc_lo)%' %' allow for wrap around the mega-byte. %if(%off_hi GT 0ffh) then(%' %SET(off_hi,(%off_hi - 0100h)))fi%' %SET(off_ptr,((%off_hi * 0100h) + %off_lo))) else(%' %' %' else get user supplied support code base address. %' %SET(off_ptr,%hex_it(%trim(%offchip_par)))%' %SET(off_hi,(%off_ptr / 0100h))%' %SET(saved_hi,%off_hi)%' %SET(off_lo,(%off_ptr MOD 0100h)))fi%' ;-- OSF SUPPORT CODE = ;-- %off_ptr:0H ;%' %' %' now calculate the offset of nbegin for the general case. %' %SET(nuc_offset,(%saved_hi + 6) - %nuc_hi)%' %' insure positive number with shifts. %SET(nuc_offset,(((%nuc_offset) SHL 1) SHR 1))%' %SET(nuc_offset,((%nuc_offset * 0100h) + (%off_lo - %nuc_lo)) * 010h)%' %' %' calculate the base address of nbegin. %' %SET(nuc_ptr,(((%nuc_ptr - 0600H)SHL 1)SHR 1))%' %' )%' end of the OSX macro %' %' $eject %' %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %' SYSTEM: MACRO %' %';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %' %*DEFINE(SYSTEM(nuc_ptr_par,rod_size,incr_size,debug_par,e_h_par,e_h_mode))%' LOCAL fill_char (%' %' %if(NOT(%_80130_system)) then(%' %SET(nuc_ptr,%hex_it(%trim(%nuc_ptr_par)))%' %SET(nuc_offset,0H))FI%' %' %' %' ;----------------------------; ;-- System-Wide Parameters --; ;----------------------------; ; ;-- NUCLEUS START ADDRESS (nbegin) = %nuc_ptr:%nuc_offset ; ;-- ROD size = %rod_size ; ;-- Memory increment size = %incr_size %' %' %define(debug)(%trim(%debug_par))%' %if(%eqs(%debug,a) OR %eqs(%debug,A))then(%' ; ;-- DEBUGGER ACTIVE ;-- FILL_CHAR = 0C7H %define(fill_char)(0C7h)%' )else(%' ; ;-- NO DEBUGGER CONFIGURED ; ;-- FILL_CHAR = 00H %define(fill_char)(0)%' )fi%' %' %' %define(e_h)(%trim(%e_h_par))%' %if(%eqs(%e_h,Y) OR %eqs(%e_h,y))then(%' ; ;-- A system exception handler is being provided. ;-- It must be named RQSYSEX and linked to the Root-Job. %' do not declare far extrns inside code segment extrn RQSYSEX: far code segment SYSEH E_H_I< RQSYSEX, %e_h_mode > code ends )else%' (%if(%eqs(%e_h,D) OR %eqs(%e_h,d))then(%' ; ;-- The Debugger is to be used as the system exception handler. code segment extrn RQDEBUGGEREX: far SYSEH E_H_I< RQDEBUGGEREX, %e_h_mode > code ends )else(%' ; ;-- No System Exception Handler provided. ;-- The default exception handler will be used. code segment SYSEH E_H_I< 0, %e_h_mode > code ends )fi)fi%' %' %' ;----------------------------; ;-- End tables --; ;----------------------------; ; ;-- # of SAB blocks = %n_SABs ; ;-- # of JOBs = %n_jobs ; $save nolist code segment assume cs: cgroup extrn interror: near extrn roottask: near code ends %' %' %' %*define(SAB(parms))(%0) %*define(JOB(parms))(%0) code segment assume cs: cgroup ptr_type struc offst dw ? sg dw ? ptr_type ends nuc_init_entry ptr_type<%nuc_offset, %nuc_ptr> public nuc_init_entry number_sabs dw %n_sabs sab_list_ptr dd cgroup:sab_list $restore CODEDATA: DB %fill_char ; stack fill character DB %n_jobs-1 ; # of jobs - 1 DD cgroup:u_j_list ; job list pointer DD cgroup:interror ; faulty int routine DW %incr_size ; minimum transfer size DW %n_sabs ; # of SAB's DD cgroup:sab_list ; SAB list pointer DW 0 ; root task flags DW 200H ; root task stack size DD 0 ; nuc allocates stack DW dgroup ; root task data seg DD cgroup:roottask ; root task code DB 0 ; root task priority DB ? ; empty byte DW 2 ; root job flags DD cgroup:syseh ; system exc handler DB 0 ; max system priority DB ? ; empty byte DW 0FFFFH ; max system tasks DW 0FFFFH ; max system objects DW 0FFFFH ; max system pool size DW 0 ; min system pool size DW 0 ; system param object $NOLIST DW %rod_size ; root object dir size DW 028H ; paragraphs of public data DW 001H ; paragraphs of deletion object DW 001H ; paragraphs of delay list root DW 001H ; paragraphs of ready list root DW 010H ; paragraphs of kernel stack DW 020H ; paragraphs of idle task stack DW 008H ; number of internal regions $LIST ; ; SIZES OF DESCRIPTORS AND RELATED DATA AREAS (SIZES IN 16 BYTE PAGES) ; ; OBJECT DIRECTORY ENTRIES ARE 16 BYTES EACH ENTRY ; COMPOSITE ENTRIES ARE 16 BYTES FOR EVERY 8 COMPONENTS ; MAILBOX FAST QUEUE ENTRIES ARE 16 BYTES FOR EVERY 4 ENTRIES ; DW 005H ; task$size DW 006H ; ndp$save$area$size DW 004H ; job$size -- NO OBJECT DIRECTORY DW 003H ; composite$size -- INCLUDES ROOM FOR 8 COMPONENTS DW 002H ; extension$size DW 002H ; mbx$size -- INCLUDES ROOM FOR 4 FAST QUEUE ENTRIES DW 001H ; ref_obj_size DW 002H ; semaphore$size DW 002H ; region$size DW 002H ; pool$header$size DW 002H ; incr$header$size DW 001H ; seg$header$size PUBLIC CODEDATA %' CODE ENDS ; ; INITIAL OS FREE SPACE USAGE = 760H BYTES ; + (THE NUMBER OF ROD ENTRIES * 10H) ; )%' end of SYSTEM macro definition. %' $LIST