Release 4.11 arch/m68k/emu/natfeat.c
/*
* natfeat.c - ARAnyM hardware support via Native Features (natfeats)
*
* Copyright (c) 2005 Petr Stehlik of ARAnyM dev team
*
* Reworked for Linux by Roman Zippel <zippel@linux-m68k.org>
*
* This software may be used and distributed according to the terms of
* the GNU General Public License (GPL), incorporated herein by reference.
*/
#include <linux/init.h>
#include <linux/types.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/io.h>
#include <asm/machdep.h>
#include <asm/natfeat.h>
extern long nf_get_id_phys(unsigned long feature_name);
asm("\n"
" .global nf_get_id_phys,nf_call\n"
"nf_get_id_phys:\n"
" .short 0x7300\n"
" rts\n"
"nf_call:\n"
" .short 0x7301\n"
" rts\n"
"1: moveq.l #0,%d0\n"
" rts\n"
" .section __ex_table,\"a\"\n"
" .long nf_get_id_phys,1b\n"
" .long nf_call,1b\n"
" .previous");
EXPORT_SYMBOL_GPL(nf_call);
long nf_get_id(const char *feature_name)
{
/* feature_name may be in vmalloc()ed memory, so make a copy */
char name_copy[32];
size_t n;
n = strlcpy(name_copy, feature_name, sizeof(name_copy));
if (n >= sizeof(name_copy))
return 0;
return nf_get_id_phys(virt_to_phys(name_copy));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Geert Uytterhoeven | 55 | 100.00% | 2 | 100.00% |
Total | 55 | 100.00% | 2 | 100.00% |
EXPORT_SYMBOL_GPL(nf_get_id);
void nfprint(const char *fmt, ...)
{
static char buf[256];
va_list ap;
int n;
va_start(ap, fmt);
n = vsnprintf(buf, 256, fmt, ap);
nf_call(nf_get_id("NF_STDERR"), virt_to_phys(buf));
va_end(ap);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Petr Stehlik | 60 | 95.24% | 1 | 50.00% |
Geert Uytterhoeven | 3 | 4.76% | 1 | 50.00% |
Total | 63 | 100.00% | 2 | 100.00% |
static void nf_poweroff(void)
{
long id = nf_get_id("NF_SHUTDOWN");
if (id)
nf_call(id);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Petr Stehlik | 25 | 100.00% | 1 | 100.00% |
Total | 25 | 100.00% | 1 | 100.00% |
void __init nf_init(void)
{
unsigned long id, version;
char buf[256];
id = nf_get_id("NF_VERSION");
if (!id)
return;
version = nf_call(id);
id = nf_get_id("NF_NAME");
if (!id)
return;
nf_call(id, virt_to_phys(buf), 256);
buf[255] = 0;
pr_info("NatFeats found (%s, %lu.%lu)\n", buf, version >> 16,
version & 0xffff);
mach_power_off = nf_poweroff;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Petr Stehlik | 87 | 95.60% | 1 | 33.33% |
Geert Uytterhoeven | 4 | 4.40% | 2 | 66.67% |
Total | 91 | 100.00% | 3 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Petr Stehlik | 205 | 72.70% | 1 | 25.00% |
Geert Uytterhoeven | 77 | 27.30% | 3 | 75.00% |
Total | 282 | 100.00% | 4 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.