\hypertarget{tpm__isa_8c_source}{}\doxysection{tpm\+\_\+isa.\+c}
\label{tpm__isa_8c_source}\index{dev/tpm/tpm\_isa.c@{dev/tpm/tpm\_isa.c}}
\mbox{\hyperlink{tpm__isa_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2008, 2009 Michael Shalayeff}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00003}00003 \textcolor{comment}{ * Copyright (c) 2009, 2010 Hans-\/Joerg Hoexer}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00004}00004 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00006}00006 \textcolor{comment}{ * Permission to use, copy, modify, and distribute this software for any}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00007}00007 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00008}00008 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00009}00009 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00010}00010 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00011}00011 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00012}00012 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00013}00013 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00014}00014 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00015}00015 \textcolor{comment}{ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00016}00016 \textcolor{comment}{ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00017}00017 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00018}00018 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00019}00019 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00020}\mbox{\hyperlink{tpm__isa_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00020}} \mbox{\hyperlink{tpm__isa_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00021}00021 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00022}00022 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00023}00023 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00024}00024 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00025}00025 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00026}00026 \textcolor{preprocessor}{\#include <sys/proc.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00028}00028 \textcolor{preprocessor}{\#ifdef \_\_FreeBSD\_\_}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/uio.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <machine/resource.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <machine/md\_var.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <isa/isareg.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <isa/isavar.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00042}00042 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/device.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <machine/cpu.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <machine/intr.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <machine/conf.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <dev/isa/isareg.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <dev/isa/isavar.h>}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00052}00052 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00053}00053 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{tpmvar_8h}{tpmvar.h}}"{}}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00055}00055 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00056}\mbox{\hyperlink{tpm__isa_8c_a79563e956cc10791b244829522683bf6}{00056}} \mbox{\hyperlink{tpm__isa_8c_a79563e956cc10791b244829522683bf6}{tpm\_isa\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00057}00057 \{}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00058}00058         bus\_space\_tag\_t iot;}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00059}00059         bus\_space\_handle\_t ioh;}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00060}00060         \textcolor{keyword}{struct }resource *mem\_res;}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00061}00061         \textcolor{keywordtype}{int} rv, mem\_rid;}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00063}00063         mem\_rid = 0;}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00064}00064         mem\_res = bus\_alloc\_resource\_any(dev, SYS\_RES\_MEMORY, \&mem\_rid,}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00065}00065             RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00066}00066         \textcolor{keywordflow}{if} (mem\_res == NULL)}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00067}00067                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00068}00068         iot = rman\_get\_bustag(mem\_res);}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00069}00069         ioh = rman\_get\_bushandle(mem\_res);}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00071}00071         \textcolor{keywordflow}{if} ((rv = \mbox{\hyperlink{tpm_8c_a4b86e8a826f6ccc197a1f5cf55ad8b99}{tpm\_tis12\_probe}}(iot, ioh)))}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00072}00072                 device\_set\_desc(dev, \textcolor{stringliteral}{"{}Trusted Platform Module"{}});}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00074}00074         bus\_release\_resource(dev, SYS\_RES\_MEMORY, mem\_rid, mem\_res);}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00075}00075         \textcolor{keywordflow}{return} rv ? 0 : ENXIO;}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00076}00076 \}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00078}\mbox{\hyperlink{tpm__isa_8c_ac839c159a1ed1bbcb3a4d320b0d6f91d}{00078}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{tpm__isa_8c_ac839c159a1ed1bbcb3a4d320b0d6f91d}{tpm\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00079}00079 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00080}00080         DEVMETHOD(device\_identify,      tpm\_identify),}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00081}00081 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00082}00082         DEVMETHOD(device\_probe,         \mbox{\hyperlink{tpm__isa_8c_a79563e956cc10791b244829522683bf6}{tpm\_isa\_probe}}),}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00083}00083         DEVMETHOD(device\_attach,        \mbox{\hyperlink{tpm_8c_af74c6c7359d4bfe99c945b8c5ef66f15}{tpm\_attach}}),}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00084}00084         DEVMETHOD(device\_detach,        \mbox{\hyperlink{tpm_8c_ad8e9c02d274829ebfa9698f44bc6bd1a}{tpm\_detach}}),}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00085}00085         DEVMETHOD(device\_suspend,       \mbox{\hyperlink{tpm_8c_a5d61f5ec4b1381af889a3bccf83bb912}{tpm\_suspend}}),}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00086}00086         DEVMETHOD(device\_resume,        \mbox{\hyperlink{tpm_8c_a55114c7121d37e91ef19a686db72f8d2}{tpm\_resume}}),}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00087}00087         \{ 0, 0 \}}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00088}00088 \};}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00090}\mbox{\hyperlink{tpm__isa_8c_a48573c1b31f05436eadf9974c1bab0fc}{00090}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{tpm__isa_8c_a48573c1b31f05436eadf9974c1bab0fc}{tpm\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00091}00091         \textcolor{stringliteral}{"{}tpm"{}}, \mbox{\hyperlink{tpm__isa_8c_ac839c159a1ed1bbcb3a4d320b0d6f91d}{tpm\_methods}}, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structtpm__softc}{tpm\_softc}}),}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00092}00092 \};}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00094}\mbox{\hyperlink{tpm__isa_8c_ae943870040b1581de80b03465f283f02}{00094}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{tpm__isa_8c_ae943870040b1581de80b03465f283f02}{tpm\_devclass}};}
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{tpm__isa_8c_source_l00096}\mbox{\hyperlink{tpm__isa_8c_a615ecd42b8ee7ac53038620e05bb23f4}{00096}} \mbox{\hyperlink{tpm__isa_8c_a615ecd42b8ee7ac53038620e05bb23f4}{DRIVER\_MODULE}}(tpm, isa, \mbox{\hyperlink{tpm__isa_8c_a48573c1b31f05436eadf9974c1bab0fc}{tpm\_driver}}, \mbox{\hyperlink{tpm__isa_8c_ae943870040b1581de80b03465f283f02}{tpm\_devclass}}, 0, 0);}

\end{DoxyCode}
