mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 08:23:17 +00:00
This patch defines CPUINFO_PROC for s390 and implements get_cpuid(). Reviewed-by: Cornelia Huck <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: Alexander Yarygin <[email protected]> Acked-by: Christian Borntraeger <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Cornelia Huck <[email protected]> Cc: David Ahern <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/87ioneo7qh.wl%[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
29 lines
601 B
C
29 lines
601 B
C
/*
|
|
* Implementation of get_cpuid().
|
|
*
|
|
* Copyright 2014 IBM Corp.
|
|
* Author(s): Alexander Yarygin <[email protected]>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License (version 2 only)
|
|
* as published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include "../../util/header.h"
|
|
|
|
int get_cpuid(char *buffer, size_t sz)
|
|
{
|
|
const char *cpuid = "IBM/S390";
|
|
|
|
if (strlen(cpuid) + 1 > sz)
|
|
return -1;
|
|
|
|
strcpy(buffer, cpuid);
|
|
return 0;
|
|
}
|