proc64_id.c revision d0b3732ef62009fce45050a2ccf11501fe0c36cd
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2008, Intel Corporation.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "proc64_id.h"
/*
* Intel cpuid eax=4 Cache Types
*/
#define NULL_CACHE 0x0
#define DATA_CACHE 0x1
#define INSTRUCTION_CACHE 0x2
#define UNIFIED_CACHE 0x3
struct cpuid_values {
};
extern void __amd64id(void);
/*
* get_intel_cache_info()
* Get cpu cache sizes for optimized 64-bit libc functions mem* and str*.
* Find the sizes of the 1st, 2nd and largest level caches.
*/
static void
get_intel_cache_info(void)
{
int cache_level;
int largest_cache_level = 0;
int cache_index = 0;
int cache_type;
uint_t l1_cache_size = 0;
uint_t l2_cache_size = 0;
struct cpuid_values cpuid_info;
while (1) {
if (cache_type == NULL_CACHE) {
/*
* No more caches.
*/
break;
}
cache_index += 1;
if (cache_type == INSTRUCTION_CACHE) {
/*
* Don't care for memops
*/
continue;
}
if (cache_level == 1) {
}
if (cache_level == 2) {
}
if (cache_level > largest_cache_level) {
}
}
}
/*
* proc64_id()
* Determine cache and SSE level to use for memops and strops specific to
* processor type.
*/
void
__proc64id(void)
{
struct cpuid_values cpuid_info;
__libc_get_cpuid(0, &cpuid_info, 0);
/*
* Check for AuthenticAMD
*/
__amd64id();
return;
}
/*
* Check for GenuineIntel
*/
/*
* Not Intel - use defaults.
*/
return;
}
/*
* Genuine Intel
*/
/*
* Look for CPUID function 4 support - Deterministic Cache Parameters.
* Otherwise use default cache sizes.
*/
/*
* Check what SSE versions are supported.
*/
use_sse |= USE_SSE4_2;
}
use_sse |= USE_SSE4_1;
}
}
}
}
} else {
}
}