4 ! Home page of code is: http://smartmontools.sourceforge.net
6 ! Copyright (C) 2003-8 SAWADA Keiji <smartmontools-support@lists.sourceforge.net>
8 ! This program is free software; you can redistribute it and/or modify
9 ! it under the terms of the GNU General Public License as published by
10 ! the Free Software Foundation; either version 2 of the License, or
11 ! (at your option) any later version.
13 ! This program is distributed in the hope that it will be useful, but
14 ! WITHOUT ANY WARRANTY; without even the implied warranty of
15 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ! General Public License for more details.
18 ! You should have received a copy of the GNU General Public License
19 ! along with this program; if not, write to the Free Software
20 ! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 ! --------------------------------------------------------
24 ! direct access routines to ATA device under Solaris/SPARC
25 ! --------------------------------------------------------
30 ! In Solaris, programmer can pass SCSI command to target device directly
31 ! by using USCSI ioctl or using "scg" generic SCSI driver. But, such
32 ! method does not exist for ATA devices.
34 ! However, I can access Solaris kernel source because I am subscriber of
35 ! Source Foundation Program of Solaris. So, I can find method of
36 ! accessing ATA device directly. The method is to pack command in
37 ! undocumented structure and issue ioctl that appears only in kernel
38 ! source. Yes, that is the same way in using USCSI interface.
40 ! But, I met difficulty in disclosing this technique. I have signed NDA
41 ! with Sun that inhibits me not to violate their intellectual property.
43 ! Fortunately, Sun allows licensees to publish "Interfaces" if:
45 ! (1) he/she treats Solaris code as confidential
47 ! (2) and he/she doesn't incorporate Sun's code into his/her code
49 ! (3) and disclose enough information to use "Interface" to everyone.
51 ! So, I publish that technique in assembly code or object code because:
53 ! (1) I believe Sun's intellectural property is not invaded because I
54 ! didn't reveal any struct member and ioctl to non-licensee.
56 ! (2) no piece of kernel source is included in this code.
58 ! (3) And finally, I publish enough information below in order to use
61 ! For last reason, please don't remove "Calling Interface" section from
68 ! Name of function/macro presents corresponding S.M.A.R.T. command.
70 ! Parameters are described below.
74 ! File descriptor of ATA device. Device would be
77 ! Device should be raw device serviced by "dada" driver. ATAPI
78 ! CD-ROM/R/RW, DVD-ROM, and so on are not allowed because they are
79 ! serviced by "sd" driver. On x86 Solaris, "cmdk" driver services
80 ! them, this routines doesn't work.
83 ! Select sector for service. For example, this indicates log sector
84 ! number for smart_read_log() function. Probably you need to read
85 ! ATA specification for this parameter.
88 ! Data going to be read/written. It don't have to be word aligned,
89 ! But data shall points valid user memory space.
91 ! This is very tiny routines, but if you feel this insufficient, please
95 ! <card_captor@users.sourceforge.net>
96 .file "solaris-ata-in.c"
100 .asciz "$Id: os_solaris_ata.s,v 1.6 2008/03/04 22:09:47 ballen4705 Exp $"
101 .global os_solaris_ata_s_cvsid
104 .type os_solaris_ata_s_cvsid, #object
105 .size os_solaris_ata_s_cvsid, 4
106 os_solaris_ata_s_cvsid:
110 .type ata_cmd, #function
208 .size ata_cmd, .-ata_cmd
211 .type ata_identify, #function
252 .size ata_identify, .-ata_identify
254 .global ata_pidentify
255 .type ata_pidentify, #function
296 .size ata_pidentify, .-ata_pidentify
298 .global smart_read_data
299 .type smart_read_data, #function
312 sethi %hi(12733440), %g1
341 .size smart_read_data, .-smart_read_data
343 .global smart_read_thresholds
344 .type smart_read_thresholds, #function
346 smart_read_thresholds:
357 sethi %hi(12733440), %g1
386 .size smart_read_thresholds, .-smart_read_thresholds
388 .global smart_auto_save
389 .type smart_auto_save, #function
401 sethi %hi(12733440), %g1
424 .size smart_auto_save, .-smart_auto_save
426 .global smart_immediate_offline
427 .type smart_immediate_offline, #function
429 smart_immediate_offline:
437 sethi %hi(12733440), %g1
466 .size smart_immediate_offline, .-smart_immediate_offline
468 .global smart_read_log
469 .type smart_read_log, #function
481 sethi %hi(12733440), %g1
511 .size smart_read_log, .-smart_read_log
514 .type smart_enable, #function
525 sethi %hi(12733440), %g1
548 .size smart_enable, .-smart_enable
550 .global smart_disable
551 .type smart_disable, #function
562 sethi %hi(12733440), %g1
585 .size smart_disable, .-smart_disable
588 .type smart_status, #function
599 sethi %hi(12733440), %g1
622 .size smart_status, .-smart_status
624 .global smart_status_check
625 .type smart_status_check, #function
636 sethi %hi(12733440), %g1
658 .size smart_status_check, .-smart_status_check
660 .global smart_auto_offline
661 .type smart_auto_offline, #function
673 sethi %hi(12733440), %g1
696 .size smart_auto_offline, .-smart_auto_offline
697 .ident "GCC: (GNU) 3.4.2"