HPET API
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
* HPET API [#be6692a3]
[[HPET API 日本語ページ>HPET API - 日本語版]]
Here shows HPET driver API. Using man page like format wi...
- "SYNOPSIS" shows with preferred, or fixed value argument.
- "PRECONDITION" shows conditions that application should...
- "RETURN VALUE" and "ERROR" shows only HPET driver speci...
- "KERNEL CONFIGURATION and PARAMETER" shows some conditi...
- "KERNEL SOURCE" shows related kernel source code.
** Features [#w04c2733]
HPET driver provides following features.
- [[Allocate HPET timer.>#td026212]]
- [[Get timer information.>#pdce19e5]]
- [[Set interrupt frequency.>#bd9cfaa7]]
- [[Enable>#m7832c4e]]/[[disable>#y3465016]] hardware imp...
- [[Enable>#ma83f3b9]]/[[disable>#rcb4bb60]] timer interr...
- Event to poll()/select() waiter at timer interrupt. See...
- Send signal at timer interrupt.Using fcntl() features. ...
- [[Read and clear interrupted count.>#x52e9d21]]
- [[mmap HPET register on memory address space>#g68651f3]...
To know more details [[refer to HPET specification>https:...
** Example [#nd179a17]
To know HPET driver &ogfileone(/drivers/char/hpet.c); API...
** Device path [#cc1eca9f]
Most linux distributions enable HPET driver and prepare a...
** Open device [#cc1eca9f]
To use HPET device, open /dev/hpet with file mode O_RDONL...
** Header files [#g51b6a6f]
To use HPET device from user space (Linux Application), i...
#pre(soft){{
&span(ConsoleOut){#define _GNU_SOURCE};
&span(ConsoleOut){#include <features.h>};
&span(ConsoleOut){#include <sys/types.h>};
&span(ConsoleOut){#include <sys/stat.h>};
&span(ConsoleOut){#include <sys/ioctl.h>};
&span(ConsoleOut){#include <unistd.h>};
&span(ConsoleOut){#include <fcntl.h>};
&span(ConsoleOut){#include <linux/hpet.h>};
}}
If you wish to use poll(), include optional header file a...
#pre(soft){{
&span(ConsoleOut){#include <poll.h>};
}}
If you wish to use select(), include optional header file...
#pre(soft){{
&span(ConsoleOut){#include <sys/time.h>};
&span(ConsoleOut){#include <sys/select.h>};
}}
If you wish to use signal(), include optional header file...
#pre(soft){{
&span(ConsoleOut){#include <signal.h>};
}}
If you wish to use mmap(), include optional header file a...
#pre(soft){{
&span(ConsoleOut){#include <sys/mman.h>};
}}
If you wish to handle error, include optional header file...
#pre(soft){{
&span(ConsoleOut){#include <string.h>}; /* strerror() */
&span(ConsoleOut){#include <errno.h>}; /* errno, Exxx ma...
}}
** HPET driver's ioctl API [#ycda765a]
In this section shows HPET driver ioctl() API. HPET drive...
|ioctl request number|description|h
|HPET_INFO|Get Information&br;int ioctl(int fd, HPET_INFO...
|HPET_IRQFREQ|Set Interrupt Frequency in Hz&br;int ioctl(...
|HPET_EPI|Enable hardware periodic interrupt&br;int ioctl...
|HPET_DPI|Disable hardware periodic interrupt&br;int ioct...
|HPET_IE_ON|Interrupt On&br;int ioctl(int fd, HPET_IE_ON);|
|HPET_IE_OFF|Interrupt Off&br;int ioctl(int fd, HPET_IE_O...
Here shows HPET driver specific behaviors. To see basic f...
*** HPET_INFO - Get Information [#pdce19e5]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){struct hpet_info {};
&span(ConsoleOut){ unsigned long hi_ireqfreq; /* Period ...
&span(ConsoleOut){ unsigned long hi_flags; /* Informa...
&span(ConsoleOut){ unsigned short hi_hpet; /* HPET de...
&span(ConsoleOut){ unsigned short hi_timer; /* Timer n...
&span(ConsoleOut){};};
&span(ConsoleOut){int ioctl(int fd, HPET_INFO, /* out */ ...
}}
- ''DESCRIPTION''&br;
Get the timer information assigned to file descriptor fd....
|member|description|h
|hi_ireqfreq|Interrupt frequency in Hz.|
|hi_flags|Timer capability. The value will be as follows,...
|hi_hpet|HPET device number on platform. It satisfies (hi...
|hi_timer|Timer number in HPET device. It satisfies (hi_t...
- ''RETURN VALUE''
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''EFAULT:'' info points an inaccessible memory area.
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_INFO,HPET_INFO,hpet.c);
*** HPET_IRQFREQ - Set Interrupt Frequency in Hz [#bd9cfa...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_IRQFREQ, unsigne...
}}
- ''PRECONDITION''&br;
-- Disabling timer interrupt, HPET_IE_OFF.
- ''DESCRIPTION''&br;
Set interrupt frequency to timer assigned to file descrip...
Don't update frequency while enabling interrupt.
- ''RETURN''&br;
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EACCESS'' Process doesn't have capability &ogdefs(CA...
-- ''EINVAL:'' Frequency is zero.
- ''FILES''&br;
-- /proc/sys/dev/hpet/max-user-freq
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_IRQFREQ,HPET_IRQFREQ,hpet.c);, &ogdefs(hpet_...
*** HPET_EPI - Enable hardware periodic interrupt [#m7832...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_EPI);};
}}
- ''PRECONDITION''&br;
-- Disabling timer interrupt, HPET_IE_OFF.
- ''DESCRIPTION''&br;
Enable hardware implemented periodic interrupt at the tim...
- ''RETURN VALUE''&br;
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''ENXIO:'' The timer's hardware assigned to file descr...
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_EPI,HPET_EPI,hpet.c);
*** HPET_DPI - Disable hardware periodic interrupt [#y346...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_DPI);};
}}
- ''PRECONDITION''&br;
-- Disabling timer interrupt, HPET_IE_OFF.
- ''DESCRIPTION''&br;
Disable hardware implemented periodic interrupt at the ti...
When using HPET timer with HPET_DPI (disabling hardware p...
- ''RETURN VALUE''&br;
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''ENXIO:'' The timer's hardware assigned to file descr...
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_DPI,HPET_DPI,hpet.c);, &ogdefs(hpet_interrup...
*** HPET_IE_ON - Interrupt On [#ma83f3b9]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_IE_ON);};
}}
- ''PRECONDITION''&br;
-- Set interrupt frequency by HPET_IRQFREQ.
-- Enable or disable hardware implemented periodic interr...
- ''DESCRIPTION''&br;
Enable timer interrupt assigned to file descriptor fd. Wh...
- ''RETURN VALUE''
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''EIO:'' It occurs one of following conditions.
--- Invalid interrupt frequency.
--- Interrupt frequency has not been set.
--- Can't request IRQ handler. It may chipset or BIOS bug.
-- ''EBUSY''
--- Already enabled interrupt.
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_IE_ON,HPET_IE_ON,hpet.c);, &ogdefs(hpet_inte...
*** HPET_IE_OFF - Interrupt Off[#rcb4bb60]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_IE_OFF);};
}}
- ''DESCRIPTION''&br;
Disable timer interrupt assigned to file descriptor fd.
- ''RETURN VALUE''
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_IE_OFF,HPET_IE_OFF,hpet.c);
** File System and Memory Mapping API related to HPET [#x...
In this section shows File System and Memory Mapping API ...
HPET specific behavior. To see file system specific basic...
*** open HPET timer [#td026212]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int open(const char *hpet_path, /* open...
}}
- ''DESCRIPTION''&br;
Open a unused HPET timer. On most linux distributions, hp...
- ''RETURN VALUE''
-- ''return_value >= 0:'' File descriptor assigned HPET t...
-- ''-1:'' Error.
- ''ERROR (HPET device specific)''
-- ''EINVAL:'' Open mode contains write mode.
-- ''EBUSY:'' There is no unised HPET timer, or all HPET ...
- ''FILES''
-- /dev/hpet
- ''KERNEL SOURCE''
-- &ogdefs(hpet_open());
*** close HPET timer [#q45d3eac]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int close(int fd);};
}}
- ''DESCRIPTION''&br;
Close the HPET timer assigned to file descriptor fd. Rele...
-- Disable interrupt from the timer.
-- Disable hardware implemented periodic interrupt.
-- Free IRQ handler.
- ''KERNEL SOURCE''
-- &ogdefs(hpet_release());
*** read and clear interrupted count [#x52e9d21]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int read(int fd, unsigned long *buf, /*...
}}
- ''DESCRIPTION''&br;
Read and clear interrupt count. The count value is stored...
-- If open HPET timer with O_NONBLOCK file status flag, r...
--- If interrupt has been occurred during from previous r...
--- If interrupt has not been occurred during from previ...
-- If open HPET timer without O_NONBLOCK file status flag...
--- If interrupt has been occurred during from previous r...
--- If interrupt has not been occurred during from previ...
- ''RETURN VALUE''
-- ''sizeof(unsigned long):'' Success read.
-- ''-1:'' Error.
- ''ERROR (HPET device specific)''
-- ''EIO:'' Interrupt frequency has not been set.
-- ''EFAULT:'' buf doesn't points accessible address space.
-- ''EINVAL:'' size is less than sizeof(unsigned long).
-- ''EAGAIN:'' Interrupt hasn't been occurred during form...
-- ''EINTR:'' Caught signal.
- ''KERNEL SOURCE''&br;
&ogdefs(hpet_read());
*** mmap HPET register on memory address space [#g68651f3]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){void *mmap(void *addr, size_t length, i...
&span(ConsoleOut){int munmap(void *addr, size_t length);};
}}
- ''DESCRIPTION''&br;
mmap() and munmap() HPET registers which has the timer as...
Valid length range is [ 0x1 .. page size (equal to syscon...
offset should be zero.
- ''RETURN VALUE ''
-- ''return_value != MAP_FAILED:'' Returned pointer point...
-- ''MAP_FAILED:'' Can't map HPET register.
- ''ERROR (HPET device specific)''
-- ''EACCESS:'' Not enabled mmap feature. Kernel was buil...
-- ''ENOSYS:''
--- Kernel doesn't have HPET mmap function. Kernel was bu...
--- HPET hardware implementation issue, HPET registers is...
- ''KERNEL CONFIGURATION and PARAMETER''&br;
To use HPET mmap feature, satisfy following two conditions.
-- Build kernel with CONFIG_HPET_MMAP=y.
-- Add "hpet_mmap=1" to kernel parameter, if distributor ...
- ''SEE ALSO''
-- [[HPET specification>https://www.intel.com/content/dam...
- ''KERNEL SOURCE''&br;
&ogdefs(hpet_mmap());
*** F_GETOWN - Get file descriptor owner[#sb3baf92]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_GETOWN);};
}}
- ''DESCRIPTION''&br;
Get owner assigned to file descriptor fd.
- ''RETURN VALUE''&br;
-- ''0:'' no owner, it doesn't send signal.
-- ''return_value > 0:'' process id number.
-- ''return_value < 0:'' Negative process group number. B...
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETOWN,F_GETOWN,fcntl.c);
*** F_GETOWN_EX - Get file descriptor owner with extended...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){struct f_owner_ex {};
&span(ConsoleOut){ int type; /* F_OWNER_PID, F_OWNER_...
&span(ConsoleOut){ pid_t pid; /* process id, process ...
&span(ConsoleOut){}};
&span(ConsoleOut){int fcntl(int fd, F_GETOWN_EX, /* out *...
}}
- ''DESCRIPTION''&br;
Get owner assigned to file descriptor fd. fcntl() F_GETOW...
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETOWN_EX,F_GETOWN_EX,fcntl.c);
*** F_SETOWN - Set file descriptor owner [#u578f126]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_SETOWN, int owner);};
}}
- ''DESCRIPTION''&br;
Set owner to file descriptor fd. owner is process id, or ...
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETOWN,F_SETOWN,fcntl.c);
*** F_SETOWN_EX - Set file descriptor owner with extended...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){struct f_owner_ex {};
&span(ConsoleOut){ int type; /* F_OWNER_PID, F_OWNER_...
&span(ConsoleOut){ pid_t pid; /* process id, process ...
&span(ConsoleOut){}};
&span(ConsoleOut){int fcntl(int fd, F_GETOWN_EX, /* in */...
}}
- ''DESCRIPTION''&br;
Set one of process id, process group id, or thread id to ...
When the timer assigned to fd interrupts a processor and ...
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETOWN_EX,F_SETOWN_EX,fcntl.c);
*** F_GETFL - Get file status flags [#yc1882fd]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_GETFL);};
}}
- ''DESCRIPTION''&br;
Use this function to set or clear O_ASYNC flag to file de...
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETFL,F_GETFL,fcntl.c);
*** F_SETFL - Set file status flags [#g6b699cd]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_SETFL, int flags);};
}}
- ''DESCRIPTION''&br;
To send signal on timer interrupt, let flags be ORed with...
#code(c){{
{ int flags;
flags = fcntl(fd, F_GETFL);
if (flags < 0) {
/* error handling. */
}
flags |= O_ASYNC;
if (fcntl(fd, F_SETFL, flags) != 0) {
/* error handling. */
}
}
}}
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETFL,F_SETFL,fcntl.c);, &ogdefs(setfl());, #de...
*** F_GETSIG - Get signal number will be sent[#zfddc3a9]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_GETSIG);};
}}
- ''DESCRIPTION''&br;
Get the signal number will be sent on timer interrupt.
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETSIG,F_GETSIG,fcntl.c);
*** F_SETSIG - Set signal number will be sent[#ub0566d7]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_SETSIG, int signal)...
}}
- ''DESCRIPTION''&br;
Set the signal number will be sent on timer interrupt.
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETSIG,F_SETSIG,fcntl.c);, &ogdefs(send_sigio());
終了行:
* HPET API [#be6692a3]
[[HPET API 日本語ページ>HPET API - 日本語版]]
Here shows HPET driver API. Using man page like format wi...
- "SYNOPSIS" shows with preferred, or fixed value argument.
- "PRECONDITION" shows conditions that application should...
- "RETURN VALUE" and "ERROR" shows only HPET driver speci...
- "KERNEL CONFIGURATION and PARAMETER" shows some conditi...
- "KERNEL SOURCE" shows related kernel source code.
** Features [#w04c2733]
HPET driver provides following features.
- [[Allocate HPET timer.>#td026212]]
- [[Get timer information.>#pdce19e5]]
- [[Set interrupt frequency.>#bd9cfaa7]]
- [[Enable>#m7832c4e]]/[[disable>#y3465016]] hardware imp...
- [[Enable>#ma83f3b9]]/[[disable>#rcb4bb60]] timer interr...
- Event to poll()/select() waiter at timer interrupt. See...
- Send signal at timer interrupt.Using fcntl() features. ...
- [[Read and clear interrupted count.>#x52e9d21]]
- [[mmap HPET register on memory address space>#g68651f3]...
To know more details [[refer to HPET specification>https:...
** Example [#nd179a17]
To know HPET driver &ogfileone(/drivers/char/hpet.c); API...
** Device path [#cc1eca9f]
Most linux distributions enable HPET driver and prepare a...
** Open device [#cc1eca9f]
To use HPET device, open /dev/hpet with file mode O_RDONL...
** Header files [#g51b6a6f]
To use HPET device from user space (Linux Application), i...
#pre(soft){{
&span(ConsoleOut){#define _GNU_SOURCE};
&span(ConsoleOut){#include <features.h>};
&span(ConsoleOut){#include <sys/types.h>};
&span(ConsoleOut){#include <sys/stat.h>};
&span(ConsoleOut){#include <sys/ioctl.h>};
&span(ConsoleOut){#include <unistd.h>};
&span(ConsoleOut){#include <fcntl.h>};
&span(ConsoleOut){#include <linux/hpet.h>};
}}
If you wish to use poll(), include optional header file a...
#pre(soft){{
&span(ConsoleOut){#include <poll.h>};
}}
If you wish to use select(), include optional header file...
#pre(soft){{
&span(ConsoleOut){#include <sys/time.h>};
&span(ConsoleOut){#include <sys/select.h>};
}}
If you wish to use signal(), include optional header file...
#pre(soft){{
&span(ConsoleOut){#include <signal.h>};
}}
If you wish to use mmap(), include optional header file a...
#pre(soft){{
&span(ConsoleOut){#include <sys/mman.h>};
}}
If you wish to handle error, include optional header file...
#pre(soft){{
&span(ConsoleOut){#include <string.h>}; /* strerror() */
&span(ConsoleOut){#include <errno.h>}; /* errno, Exxx ma...
}}
** HPET driver's ioctl API [#ycda765a]
In this section shows HPET driver ioctl() API. HPET drive...
|ioctl request number|description|h
|HPET_INFO|Get Information&br;int ioctl(int fd, HPET_INFO...
|HPET_IRQFREQ|Set Interrupt Frequency in Hz&br;int ioctl(...
|HPET_EPI|Enable hardware periodic interrupt&br;int ioctl...
|HPET_DPI|Disable hardware periodic interrupt&br;int ioct...
|HPET_IE_ON|Interrupt On&br;int ioctl(int fd, HPET_IE_ON);|
|HPET_IE_OFF|Interrupt Off&br;int ioctl(int fd, HPET_IE_O...
Here shows HPET driver specific behaviors. To see basic f...
*** HPET_INFO - Get Information [#pdce19e5]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){struct hpet_info {};
&span(ConsoleOut){ unsigned long hi_ireqfreq; /* Period ...
&span(ConsoleOut){ unsigned long hi_flags; /* Informa...
&span(ConsoleOut){ unsigned short hi_hpet; /* HPET de...
&span(ConsoleOut){ unsigned short hi_timer; /* Timer n...
&span(ConsoleOut){};};
&span(ConsoleOut){int ioctl(int fd, HPET_INFO, /* out */ ...
}}
- ''DESCRIPTION''&br;
Get the timer information assigned to file descriptor fd....
|member|description|h
|hi_ireqfreq|Interrupt frequency in Hz.|
|hi_flags|Timer capability. The value will be as follows,...
|hi_hpet|HPET device number on platform. It satisfies (hi...
|hi_timer|Timer number in HPET device. It satisfies (hi_t...
- ''RETURN VALUE''
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''EFAULT:'' info points an inaccessible memory area.
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_INFO,HPET_INFO,hpet.c);
*** HPET_IRQFREQ - Set Interrupt Frequency in Hz [#bd9cfa...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_IRQFREQ, unsigne...
}}
- ''PRECONDITION''&br;
-- Disabling timer interrupt, HPET_IE_OFF.
- ''DESCRIPTION''&br;
Set interrupt frequency to timer assigned to file descrip...
Don't update frequency while enabling interrupt.
- ''RETURN''&br;
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EACCESS'' Process doesn't have capability &ogdefs(CA...
-- ''EINVAL:'' Frequency is zero.
- ''FILES''&br;
-- /proc/sys/dev/hpet/max-user-freq
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_IRQFREQ,HPET_IRQFREQ,hpet.c);, &ogdefs(hpet_...
*** HPET_EPI - Enable hardware periodic interrupt [#m7832...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_EPI);};
}}
- ''PRECONDITION''&br;
-- Disabling timer interrupt, HPET_IE_OFF.
- ''DESCRIPTION''&br;
Enable hardware implemented periodic interrupt at the tim...
- ''RETURN VALUE''&br;
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''ENXIO:'' The timer's hardware assigned to file descr...
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_EPI,HPET_EPI,hpet.c);
*** HPET_DPI - Disable hardware periodic interrupt [#y346...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_DPI);};
}}
- ''PRECONDITION''&br;
-- Disabling timer interrupt, HPET_IE_OFF.
- ''DESCRIPTION''&br;
Disable hardware implemented periodic interrupt at the ti...
When using HPET timer with HPET_DPI (disabling hardware p...
- ''RETURN VALUE''&br;
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''ENXIO:'' The timer's hardware assigned to file descr...
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_DPI,HPET_DPI,hpet.c);, &ogdefs(hpet_interrup...
*** HPET_IE_ON - Interrupt On [#ma83f3b9]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_IE_ON);};
}}
- ''PRECONDITION''&br;
-- Set interrupt frequency by HPET_IRQFREQ.
-- Enable or disable hardware implemented periodic interr...
- ''DESCRIPTION''&br;
Enable timer interrupt assigned to file descriptor fd. Wh...
- ''RETURN VALUE''
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
-- ''EIO:'' It occurs one of following conditions.
--- Invalid interrupt frequency.
--- Interrupt frequency has not been set.
--- Can't request IRQ handler. It may chipset or BIOS bug.
-- ''EBUSY''
--- Already enabled interrupt.
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_IE_ON,HPET_IE_ON,hpet.c);, &ogdefs(hpet_inte...
*** HPET_IE_OFF - Interrupt Off[#rcb4bb60]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int ioctl(int fd, HPET_IE_OFF);};
}}
- ''DESCRIPTION''&br;
Disable timer interrupt assigned to file descriptor fd.
- ''RETURN VALUE''
-- ''0:'' Success
-- ''-1:'' Error
- ''ERRORS''
-- ''EBADF:'' Invalid file descriptor fd.
- ''KERNEL SOURCE''&br;
&ogrefs(HPET_IE_OFF,HPET_IE_OFF,hpet.c);
** File System and Memory Mapping API related to HPET [#x...
In this section shows File System and Memory Mapping API ...
HPET specific behavior. To see file system specific basic...
*** open HPET timer [#td026212]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int open(const char *hpet_path, /* open...
}}
- ''DESCRIPTION''&br;
Open a unused HPET timer. On most linux distributions, hp...
- ''RETURN VALUE''
-- ''return_value >= 0:'' File descriptor assigned HPET t...
-- ''-1:'' Error.
- ''ERROR (HPET device specific)''
-- ''EINVAL:'' Open mode contains write mode.
-- ''EBUSY:'' There is no unised HPET timer, or all HPET ...
- ''FILES''
-- /dev/hpet
- ''KERNEL SOURCE''
-- &ogdefs(hpet_open());
*** close HPET timer [#q45d3eac]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int close(int fd);};
}}
- ''DESCRIPTION''&br;
Close the HPET timer assigned to file descriptor fd. Rele...
-- Disable interrupt from the timer.
-- Disable hardware implemented periodic interrupt.
-- Free IRQ handler.
- ''KERNEL SOURCE''
-- &ogdefs(hpet_release());
*** read and clear interrupted count [#x52e9d21]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int read(int fd, unsigned long *buf, /*...
}}
- ''DESCRIPTION''&br;
Read and clear interrupt count. The count value is stored...
-- If open HPET timer with O_NONBLOCK file status flag, r...
--- If interrupt has been occurred during from previous r...
--- If interrupt has not been occurred during from previ...
-- If open HPET timer without O_NONBLOCK file status flag...
--- If interrupt has been occurred during from previous r...
--- If interrupt has not been occurred during from previ...
- ''RETURN VALUE''
-- ''sizeof(unsigned long):'' Success read.
-- ''-1:'' Error.
- ''ERROR (HPET device specific)''
-- ''EIO:'' Interrupt frequency has not been set.
-- ''EFAULT:'' buf doesn't points accessible address space.
-- ''EINVAL:'' size is less than sizeof(unsigned long).
-- ''EAGAIN:'' Interrupt hasn't been occurred during form...
-- ''EINTR:'' Caught signal.
- ''KERNEL SOURCE''&br;
&ogdefs(hpet_read());
*** mmap HPET register on memory address space [#g68651f3]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){void *mmap(void *addr, size_t length, i...
&span(ConsoleOut){int munmap(void *addr, size_t length);};
}}
- ''DESCRIPTION''&br;
mmap() and munmap() HPET registers which has the timer as...
Valid length range is [ 0x1 .. page size (equal to syscon...
offset should be zero.
- ''RETURN VALUE ''
-- ''return_value != MAP_FAILED:'' Returned pointer point...
-- ''MAP_FAILED:'' Can't map HPET register.
- ''ERROR (HPET device specific)''
-- ''EACCESS:'' Not enabled mmap feature. Kernel was buil...
-- ''ENOSYS:''
--- Kernel doesn't have HPET mmap function. Kernel was bu...
--- HPET hardware implementation issue, HPET registers is...
- ''KERNEL CONFIGURATION and PARAMETER''&br;
To use HPET mmap feature, satisfy following two conditions.
-- Build kernel with CONFIG_HPET_MMAP=y.
-- Add "hpet_mmap=1" to kernel parameter, if distributor ...
- ''SEE ALSO''
-- [[HPET specification>https://www.intel.com/content/dam...
- ''KERNEL SOURCE''&br;
&ogdefs(hpet_mmap());
*** F_GETOWN - Get file descriptor owner[#sb3baf92]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_GETOWN);};
}}
- ''DESCRIPTION''&br;
Get owner assigned to file descriptor fd.
- ''RETURN VALUE''&br;
-- ''0:'' no owner, it doesn't send signal.
-- ''return_value > 0:'' process id number.
-- ''return_value < 0:'' Negative process group number. B...
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETOWN,F_GETOWN,fcntl.c);
*** F_GETOWN_EX - Get file descriptor owner with extended...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){struct f_owner_ex {};
&span(ConsoleOut){ int type; /* F_OWNER_PID, F_OWNER_...
&span(ConsoleOut){ pid_t pid; /* process id, process ...
&span(ConsoleOut){}};
&span(ConsoleOut){int fcntl(int fd, F_GETOWN_EX, /* out *...
}}
- ''DESCRIPTION''&br;
Get owner assigned to file descriptor fd. fcntl() F_GETOW...
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETOWN_EX,F_GETOWN_EX,fcntl.c);
*** F_SETOWN - Set file descriptor owner [#u578f126]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_SETOWN, int owner);};
}}
- ''DESCRIPTION''&br;
Set owner to file descriptor fd. owner is process id, or ...
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETOWN,F_SETOWN,fcntl.c);
*** F_SETOWN_EX - Set file descriptor owner with extended...
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){struct f_owner_ex {};
&span(ConsoleOut){ int type; /* F_OWNER_PID, F_OWNER_...
&span(ConsoleOut){ pid_t pid; /* process id, process ...
&span(ConsoleOut){}};
&span(ConsoleOut){int fcntl(int fd, F_GETOWN_EX, /* in */...
}}
- ''DESCRIPTION''&br;
Set one of process id, process group id, or thread id to ...
When the timer assigned to fd interrupts a processor and ...
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETOWN_EX,F_SETOWN_EX,fcntl.c);
*** F_GETFL - Get file status flags [#yc1882fd]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_GETFL);};
}}
- ''DESCRIPTION''&br;
Use this function to set or clear O_ASYNC flag to file de...
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETFL,F_GETFL,fcntl.c);
*** F_SETFL - Set file status flags [#g6b699cd]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_SETFL, int flags);};
}}
- ''DESCRIPTION''&br;
To send signal on timer interrupt, let flags be ORed with...
#code(c){{
{ int flags;
flags = fcntl(fd, F_GETFL);
if (flags < 0) {
/* error handling. */
}
flags |= O_ASYNC;
if (fcntl(fd, F_SETFL, flags) != 0) {
/* error handling. */
}
}
}}
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETFL,F_SETFL,fcntl.c);, &ogdefs(setfl());, #de...
*** F_GETSIG - Get signal number will be sent[#zfddc3a9]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_GETSIG);};
}}
- ''DESCRIPTION''&br;
Get the signal number will be sent on timer interrupt.
- ''KERNEL SOURCE''&br;
&ogrefs(F_GETSIG,F_GETSIG,fcntl.c);
*** F_SETSIG - Set signal number will be sent[#ub0566d7]
- ''SYNOPSIS''
#pre(soft){{
&span(ConsoleOut){int fcntl(int fd, F_SETSIG, int signal)...
}}
- ''DESCRIPTION''&br;
Set the signal number will be sent on timer interrupt.
- ''KERNEL SOURCE''&br;
&ogrefs(F_SETSIG,F_SETSIG,fcntl.c);, &ogdefs(send_sigio());
ページ名: