23 #include <cyg/hal/hal_arch.h>
24 #include <cyg/kernel/kapi.h>
26 #include <cyg/power/power.h>
29 #include <cyg/io/pci.h>
34 #define RANDOM_BUFSIZE 256
40 cyg_handle_t hThread = 0;
41 cyg_uint16 threadID = 0;
43 cyg_pci_device_id pciDeviceID;
46 PowerController *powerControllerInfo;
48 int itemsAdded = 0, iterationCount;
54 for( iterationCount = 0;
55 cyg_thread_get_next( &hThread, &threadID ) && \
59 cyg_thread_info threadInfo;
61 if( !cyg_thread_get_info( hThread, threadID, &threadInfo ) )
63 addRandomData( randomState, &threadInfo,
sizeof( cyg_thread_info ) );
72 for( powerControllerInfo = &( __POWER__[ 0 ] ), iterationCount = 0;
73 powerControllerInfo != &( __POWER_END__ ) && \
74 iterationCount < FAILSAFE_ITERATIONS_MED;
75 powerControllerInfo++, iterationCount++ )
77 const PowerMode power_get_controller_mode( powerControllerInfo );
85 if( cyg_pci_find_next( CYG_PCI_NULL_DEVID, &pciDeviceID ) )
90 cyg_pci_device pciDeviceInfo;
92 cyg_pci_get_device_info( pciDeviceID, &pciDeviceInfo );
94 addRandomData( randomState, &pciDeviceInfo,
95 sizeof( cyg_pci_device ) );
98 while( cyg_pci_find_next( pciDeviceID, &pciDeviceID ) && \
99 iterationCount++ < FAILSAFE_ITERATIONS_MED );
123 endRandomData( randomState, ( itemsAdded > 5 ) ? 20 : 0 );
130 cyg_uint32 clockTicks;
134 hal_clock_read( &clockTicks );
136 endRandomData( randomState, 1 );