Linux Kernel
3.7.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
arch
tile
gxio
trio.c
Go to the documentation of this file.
1
/*
2
* Copyright 2012 Tilera Corporation. All Rights Reserved.
3
*
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation, version 2.
7
*
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11
* NON INFRINGEMENT. See the GNU General Public License for
12
* more details.
13
*/
14
15
/*
16
* Implementation of trio gxio calls.
17
*/
18
19
#include <linux/errno.h>
20
#include <
linux/io.h
>
21
#include <linux/module.h>
22
23
#include <
gxio/trio.h
>
24
#include <
gxio/iorpc_globals.h
>
25
#include <
gxio/iorpc_trio.h
>
26
#include <
gxio/kiorpc.h
>
27
28
int
gxio_trio_init
(
gxio_trio_context_t
*
context
,
unsigned
int
trio_index)
29
{
30
char
file
[32];
31
int
fd
;
32
33
snprintf
(file,
sizeof
(file),
"trio/%d/iorpc"
, trio_index);
34
fd =
hv_dev_open
((
HV_VirtAddr
) file, 0);
35
if
(fd < 0) {
36
context->
fd
= -1;
37
38
if
(fd >=
GXIO_ERR_MIN
&& fd <=
GXIO_ERR_MAX
)
39
return
fd
;
40
else
41
return
-
ENODEV
;
42
}
43
44
context->
fd
=
fd
;
45
46
return
0;
47
}
48
49
EXPORT_SYMBOL_GPL
(
gxio_trio_init
);
Generated on Thu Jan 10 2013 13:18:56 for Linux Kernel by
1.8.2