1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (c) 1995 Michael Chastain (mec@duracef.shout.net), 22 July 1995.
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, write to the Free
22 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
25 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
26 .\" all rights reserved.
27 .\" Translated 1997-02-23, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
28 .\" Updated & Modified 2005-02-24, Yuichi SATO <ysato444@yahoo.co.jp>
29 .\" Updated 2007-06-18, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.57
32 .\"WORD: local descriptor table ¥í¡¼¥«¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë
33 .\"WORD: processer ¥×¥í¥»¥Ã¥µ
34 .\"WORD: entry ¥¨¥ó¥È¥ê
36 .TH MODIFY_LDT 2 2007-06-01 "Linux" "Linux Programmer's Manual"
38 modify_ldt \- ldt ¤òÀßÄê¤Þ¤¿¤Ï¼èÆÀ¤¹¤ë
41 .B #include <sys/types.h>
43 .BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" );
47 ¤Ï¥×¥í¥»¥¹¤Î¥í¡¼¥«¥ë¡¦¥Ç¥£¥¹¥¯¥ê¥×¥¿¡¦¥Æ¡¼¥Ö¥ë (local descriptor table; ldt)
49 ldt ¤Ï i386 ¥×¥í¥»¥Ã¥µ¤Ç»ÈÍѤµ¤ì¤ë¥×¥í¥»¥¹¤´¤È¤Î¥á¥â¥ê´ÉÍý¥Æ¡¼¥Ö¥ë¤Ç¤¢¤ë¡£
50 ¤³¤Î¥Æ¡¼¥Ö¥ë¤Ë´Ø¤·¤Æ¤Î¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï Intel 386 processor handbook ¤ò
58 ¤¬»Ø¤·¤Æ¤¤¤ë¥á¥â¥ê¤ËÆɤ߹þ¤à¡£
59 Æɤ߹þ¤à¥Ð¥¤¥È¿ô¤Ï¼ÂºÝ¤Î ldt ¤Î¥µ¥¤¥º¤«
66 ¤Ï ldt ¥¨¥ó¥È¥ê¤Î°ì¤Ä¤òÊѹ¹¤¹¤ë¡£
72 ¤Ï¤³¤Î¹½Â¤ÂΤÎÂ礤µ¤ËÅù¤·¤¯¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
74 .\" FIXME ? say something about func == 2 ans func == 0x11?
75 .\" In Linux 2.4, func == 2 returned "the default ldt"
76 .\" In Linux 2.6, func == 2 is a nop, returning a zeroed out structure.
77 .\" Linux 2.4 and 2.6 implement an operation for func == 0x11
80 ¹½Â¤ÂÎ¤Ï \fI<asm/ldt.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
85 unsigned int entry_number;
86 unsigned long base_addr;
88 unsigned int seg_32bit:1;
89 unsigned int contents:2;
90 unsigned int read_exec_only:1;
91 unsigned int limit_in_pages:1;
92 unsigned int seg_not_present:1;
93 unsigned int useable:1;
98 Linux 2.4 °ÊÁ°¤Ç¤Ï¡¢¤³¤Î¹½Â¤ÂΤÏ
102 .\" ldt ¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Ë¸ÇͤΤâ¤Î¤Ç¤¢¤ë¡£
103 .\" ¾¤Î¥×¥í¥»¥¹¤ä¥«¡¼¥Í¥ë¤Î¥¢¥É¥ì¥¹¶õ´Ö¤ò´Þ¤à¤è¤¦¤Ë ldt ¤òÊѹ¹¤·¤è¤¦¤¹¤ë¤È¡¢
104 .\" ¥×¥í¥»¥¹¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤Î¥á¥â¥ê¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤·¤¿¤È¤¤Ë¡¢
105 .\" ¥»¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó°ãÈ¿ (segmentation violation) ¤Ë¤Ê¤ë¡£
106 .\" ¥á¥â¥êÊݸî¤Ï¥Ú¡¼¥¸¥ó¥°¥ì¥¤¥ä¤Ç¼Â»Ü¤µ¤ì¤ë¡£
110 ¤Ï (Æɤ߹þ¤ß¤Î¾ì¹ç¤Ï) ¼ÂºÝ¤ËÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¡¢
111 ¤Þ¤¿¤Ï (½ñ¤¹þ¤ß¤Î¾ì¹ç¤Ï) 0 ¤òÊÖ¤¹¡£
116 ¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËÀßÄꤹ¤ë¡£
121 ¤¬¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
132 ¹½Â¤ÂΤΥµ¥¤¥º¤ÈÅù¤·¤¯¤Ê¤¤¤«¡¢
134 ¤¬ 1 ¤Ç¿·¤·¤¤ ldt ¥¨¥ó¥È¥ê¤¬Ìµ¸ú¤ÊÃͤǤ¢¤ë¡£
138 ¤¬ 0 ¤Ç¤â 1 ¤Ç¤â¤Ê¤¤¡£
140 ¤³¤Î¥³¡¼¥ë¤Ï Linux ÆÃͤǤ¢¤ê¡¢°Ü¿¢¤ò°Õ¿Þ¤·¤¿¥×¥í¥°¥é¥à¤Ç¤Ï
143 glibc ¤Ï¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£
145 ¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£