function libtest_pal_get_full_logical_processor_set

From liblfds.org
Jump to navigation Jump to search

Source Files

└───test_and_benchmark
    └───libtest
        ├───inc
        │   └───libtest
        │           libtest_porting_abstraction_layer.h
        └───src
            └───libtest_porting_abstraction_layer
                    libtest_porting_abstraction_layer_get_full_logical_processor_set.c

Opaque Structures

struct lfds710_list_asu_state;
struct libshared_memory_state;

Prototype

void libtest_pal_get_full_logical_processor_set( struct lfds710_list_asu_state *list_of_logical_processors,
                                                 struct libshared_memory_state *ms );

Parameters

struct lfds710_list_asu_state *list_of_logical_processors

A pointer to an uninitialized struct lfds710_list_asu_state, which will be used to store the list of logical processors.

struct libshared_memory_state *ms

A pointer to an initialized and populated struct libshared_memory_state, which will be used by this function for allocations. The function is not NUMA aware, and for every allocation, simply uses the largest memory block present in the memory state.

Return Value

No return value.

Helper Functions

void libtest_misc_pal_helper_add_logical_processor_to_list_of_logical_processors( struct lfds710_list_asu_state *list_of_logical_processors,
                                                                                  struct libshared_memory_state *ms,
                                                                                  lfds710_pal_uint_t logical_processor_number,
                                                                                  lfds710_pal_uint_t windows_processor_group_number );

Example

void libtest_pal_get_full_logical_processor_set( struct lfds710_list_asu_state *list_of_logical_processors,
                                                 struct libshared_memory_state *ms )
{
  CCHAR
    loop;
 
  LFDS710_PAL_ASSERT( list_of_logical_processors != NULL );
  LFDS710_PAL_ASSERT( ms != NULL );

  for( loop = 0 ; loop < KeNumberProcessors ; loop++ )
    libtest_misc_pal_helper_add_logical_processor_to_list_of_logical_processors( &list_of_logical_processors, ms, loop, 0 );

  return;
}

Notes

This function populates the list list_of_logical_processors with elements of struct libtest_logical_processor, where each element describes one of the logical processors in the system. There is no ordering requirement; simply ensure every logical processor has one element in the list. TO do so the caller simply calls libtest_misc_pal_helper_add_logical_processor_to_list_of_logical_processors, passing list_of_logical_processors and ms, and then a logical processor number (and, for Windows 7 and above, the processor group number of that logical processor, where if this value is unavailable or meaingless, pass in 0 (zero)).

See Also