module          max_number_in_system
------          --------------------
cpuset              3


    system_attribute    values
    ----------------    ------
    condition           offline, out_of_sync, correctable, online,\
			integrating, split

    user_attribute      values
    --------------      ------
    location            NULL, c0, c1, c2
    type                0013, 0014, 0015, 0016, 0017,       0019, 0020, \
			0021, 0022, 0023,       0091, 0092, 0093, 0094, \
			0095,       0097, 0098, 0099, 0100, 0101,       \
			0103, 0104, 0105, 0106, 0107, 0120, 0121,	\
			0186, 0187, 0188, 0189, 0190, 0191, 0192, 0193, \
			0194, 0195, 0196, 0197, 0198, 0199, 0200, 0201, \
			0202, 0203, 0204, 0205, 0206, 0207, 0208, 0209, \
			0210, \
			0242, 0243, \
			0248, 0249, 0250, 0251, 0252, 0253, 0254, \
			0255, 0256, 0257, 0258, 0259, 0260, 0261, 0262, \
			0263, 0264, 0265, 0266, 0267, 0268, 0269, 0270, \
			0271, 0272, 0292, 0293, 0294, 0295, 0296, 0297, \
			0298, 0299, 0300, 0301, 0328, 0329, \
			0338, 0339, 0340, 0341, 0342, 0343
    revision            A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, \
			Q, R, S, T, U, V, W, X, Y, Z, ZZ
    req_condition       offline, online
    fault_acknowledged  no, yes
    pri_cpu_resource_percent 30, 40, 50, 60, 70, 80, 90, 100
    pri_stoppage_time_msecs 100, 250, 500, 1000, infinite
    pri_timeout_seconds    infinite, 240, 600, 1200, 1800, 2400 3600
    pri_start_time	now, 0000, 0100, 0200, 0300, 0400, 0500, 0600, 0700, \
			0800, 0900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, \
			1700, 1800, 1900, 2000, 2100, 2200, 2300
    auto_pri_interval   30, 60, 90
    auto_pri_bucket     2
    description         "cpuset"
    alias		string

    state               function
    -----               --------
    not_here            if (location == NULL)
    split               if (condition == split)
    offline             if (condition == offline && req_condition == offline)
    should_be_on        if (condition == offline && req_condition == online)
    online              if (condition == online && req_condition == online)
    should_be_off       if (condition != offline && condition != integrating \
                            && req_condition == offline)
    out_of_sync         if (condition == out_of_sync && req_condition == online)
    correctable         if (condition == correctable && req_condition == online)
    integrating         if (condition == integrating)

    transition      response
    ----------      --------
    offline -> should_be_on \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/slotctl acp set acptimeout$number delay=long ; \
	if /etc/cms/bin/right_module $name $location $type$revision ; \
	then \
	    if /bin/grep "^$type" /etc/cms/simplex_modules>/dev/null 2>&1 \
		&& /etc/cms/bin/ftctl -d /dev/FTcpuset:ctl status $location \
		    2>/dev/null | /bin/grep '\<insignificant\>' \
		    >/dev/null 2>&1 ; \
	    then \
		echo "The Fault Tolerant use of simplex cpuset" \
		    "$type is not supported" | /usr/bin/tee /dev/console ; \
	    else \
		if /bin/grep "^$type$revision" /etc/cms/noiodma_cpusets>/dev/null 2>&1 ; \
		then \
		    /etc/cms/bin/ftctl -d /dev/FTbus:ctl set io_dma off ; \
		fi ; \
		/etc/cms/bin/poweron $location ; \
		sleep 3; \
		/etc/cms/bin/pri -P $pri_cpu_resource_percent \
		    -D $pri_start_time -S $pri_stoppage_time_msecs \
		    -T $pri_timeout_seconds $location \
		    `/etc/cms/bin/moduleinfo -s -l $location` ; \
		/etc/cms/bin/mba setall ; \
	    fi ; \
        else \
            echo "$name $number condition offline <R3000d>module of required type/revision not present" >/dev/FTlog:cms; \
	fi ;

    split -> should_be_on \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/slotctl acp set acptimeout$number delay=long ; \
	if /etc/cms/bin/right_module $name $location $type$revision ; \
	then \
	    if /bin/grep "^$type" /etc/cms/simplex_modules>/dev/null 2>&1 ; \
	    then \
		echo "The Fault Tolerant use of simplex cpuset" \
		    "$type is not supported" | /usr/bin/tee /dev/console ; \
	    else \
		if /bin/grep "^$type$revision" /etc/cms/noiodma_cpusets>/dev/null 2>&1 ; \
		then \
		    /etc/cms/bin/ftctl -d /dev/FTbus:ctl set io_dma off ; \
		fi ; \
		/etc/cms/bin/poweron $location ; \
		sleep 3; \
		/etc/cms/bin/pri -P $pri_cpu_resource_percent \
		    -D $pri_start_time -S $pri_stoppage_time_msecs \
		    $pri_timeout_seconds $location \
		    `/etc/cms/bin/moduleinfo -s -l $location` ; \
		/etc/cms/bin/mba setall ; \
	    fi ; \
        else \
            echo "$name $number condition offline <R3000d>module of required type/revision not present" >/dev/FTlog:cms; \
	fi ;

    integrating -> online \
	/etc/cms/bin/sysconfig -m $name -n $number \
	  -a fault_acknowledged -v no; \
	/etc/cms/bin/slotctl $location set chgme off ; \
	/etc/cms/bin/slotctl acp set acptimeout$number delay=short ;

    should_be_on -> online \
	/etc/cms/bin/sysconfig -m $name -n $number \
	  -a fault_acknowledged -v no ; \
	/etc/cms/bin/slotctl $location set chgme off ; \
	/etc/cms/bin/slotctl acp set acptimeout$number delay=short ;

    integrating -> should_be_off \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/slotctl $location set power off ;

    online -> should_be_off \
	echo "$name $number condition offline <R103000a>configuration request" >/dev/FTlog:cms ; \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/slotctl $location set power off ;

    should_be_off -> out_of_sync \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/readcpulog $location > /dev/FTlog:status; \
	/etc/cms/bin/slotctl $location set power off ; \
	if /bin/grep "^$type" /etc/cms/simplex_modules>/dev/null 2>&1 ; \
	then \
	    echo "The Fault Tolerant use of simplex cpuset" \
		"$type is not supported" | /usr/bin/tee /dev/console ; \
	else \
	    sleep 3; \
	    /etc/cms/bin/poweron $location ; \
	    sleep 3; \
	    /etc/cms/bin/pri -P $pri_cpu_resource_percent \
		-D $pri_start_time	\
		-S $pri_stoppage_time_msecs -T $pri_timeout_seconds $location \
		`/etc/cms/bin/moduleinfo -s -l $location` ; \
	    /etc/cms/bin/mba setall ; \
	fi ;

    online -> out_of_sync \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/readcpulog $location > /dev/FTlog:status; \
	/etc/cms/bin/slotctl $location set power off ; \
	if /bin/grep "^$type" /etc/cms/simplex_modules>/dev/null 2>&1 ; \
	then \
	    echo "The Fault Tolerant use of simplex cpuset" \
		"$type is not supported" | /usr/bin/tee /dev/console ; \
	else \
	    sleep 3; \
	    /etc/cms/bin/poweron $location ; \
	    sleep 3; \
	    /etc/cms/bin/pri -P $pri_cpu_resource_percent \
		-D $pri_start_time	\
		-S $pri_stoppage_time_msecs -T $pri_timeout_seconds $location \
		`/etc/cms/bin/moduleinfo -s -l $location` ; \
	    /etc/cms/bin/mba setall ; \
	fi ;


    online -> correctable \
        /etc/cms/bin/slotctl $location set chgme on ; \
        /etc/cms/bin/readcpulog $location > /dev/FTlog:status; \
        /etc/cms/bin/slotctl $location set power off ; \
	if /bin/grep "^$type" /etc/cms/simplex_modules>/dev/null 2>&1 ; \
	then \
	    echo "The Fault Tolerant use of simplex cpuset" \
		"$type is not supported" | /usr/bin/tee /dev/console ; \
	else \
            sleep 3 ; \
            /etc/cms/bin/poweron $location ; \
            sleep 3 ; \
            /etc/cms/bin/autopri -a `/etc/cms/bin/moduleinfo -l $location | \
                        grep name | awk 'BEGIN {FS=":"}{print $$2}'` \
                        $number `/etc/cms/bin/moduleinfo -s -l $location` \
                        `date "+%Y/%m/%d"` `date "+%T"` \
			$auto_pri_interval $auto_pri_bucket ; \
            if [ $$? -eq 0 ] ; \
            then \
		/etc/cms/bin/pri -P $pri_cpu_resource_percent \
                    -D $pri_start_time -S $pri_stoppage_time_msecs \
                    -T $pri_timeout_seconds $location \
        	    `/etc/cms/bin/moduleinfo -s -l $location` ; \
		/etc/cms/bin/mba setall ; \
            fi ; \
	fi ;
 
    online -> should_be_on \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/moduleinfo -e failure -l $location ; \
	/etc/cms/bin/readcpulog $location > /dev/FTlog:status ; \
	/etc/cms/bin/slotctl $location set power off ; \
	/etc/cms/bin/phonehome $name $number $location $laststate $state ;

    should_be_off -> offline \
	/etc/cms/bin/slotctl $location set chgme off ; \
	/etc/cms/bin/slotctl $location set power off ;

    integrating -> should_be_on \
	/etc/cms/bin/slotctl $location set chgme on ; \
	/etc/cms/bin/moduleinfo -e failure -l $location ; \
	/etc/cms/bin/readcpulog $location > /dev/FTlog:status ; \
	/etc/cms/bin/slotctl $location set power off ; \
	/etc/cms/bin/slotctl acp set acptimeout$number delay=short ; \
	/etc/cms/bin/phonehome $name $number $location $laststate $state ;

    integrating -> offline \
	/etc/cms/bin/slotctl $location set chgme off ; \
	/etc/cms/bin/slotctl $location set power off ;

