2010-10-12 02:54:03 Problem when I open a device (supervisor resource)
Usama Shakeel (PAKISTAN)
Message: 94419
Hello,
I get the message shown at last when I open a device with the following code.
serialDev = open(deviceName, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (serialDev <= 0 )
{
printf("ERROR : Device Not Attached \n");
exit(-1);
}
fcntl(serialDev, F_SETFL, 0);
printf("\nAfter Device Open:%d",(int)serialDev);
xget1(serialDev, &tio, &tiosfd);
cfsetspeed(&tio, speed);
if (xset1(serialDev, &tio, deviceName))
goto done;
Kindly let me know what I am doing wrong..??
Regards
Usama Bin Shakeel
After Device Open:Illegal use of supervisor resource
- Attempted to use a Supervisor register or instruction from User mode.
Supervisor resources are registers and instructions that are reserved
for Supervisor use: Supervisor only registers, all MMRs, and Supervisor
only instructions.
Deferred Exception context
CURRENT PROCESS:
COMM=rec PID=328
CPU = 0
TEXT = 0x03560040-0x03563c00 DATA = 0x03563c20-0x03565308
BSS = 0x03565308-0x03565590 USER-STACK = 0x03566f8c
return address: [0x035641be]; contents of:
0x03564190: 5656 5656 5656 5656 5656 5656 5656 5656
0x035641a0: 5656 5656 5656 5656 5656 5656 5656 5656
0x035641b0: 5656 5656 5656 5656 5656 5656 5656 [0033]
0x035641c0: 40f8 0356 4204 0356 07b8 0356 5248 0356
ADSP-BF532-0.6 400(MHz CCLK) 100(MHz SCLK) (mpu off)
Linux version 2.6.28.10-ADI-2009R1.1
Built with gcc version 4.1.2 (ADI svn)
SEQUENCER STATUS: Not tainted
SEQSTAT: 0006002e IPEND: 0030 SYSCFG: 0006
EXCAUSE : 0x2e
interrupts disabled
physical IVG5 asserted : <0xffa08c20> { _evt_ivhw + 0x0 }
RETE: <0x00000000> /* Maybe null pointer? */
RETN: <0x03570000> /* kernel dynamic memory */
RETX: <0x00000480> /* Maybe fixed code section */
RETS: <0x0356200c> [ rec + 0x1fcc ]
PC : <0x035641be> [ rec + 0x41be ]
DCPLB_FAULT_ADDR: <0x0356404c> [ rec + 0x404c ]
ICPLB_FAULT_ADDR: <0x035641be> [ rec + 0x41be ]
PROCESSOR STATE:
R0 : ffffffff R1 : ffffffff R2 : ffffffff R3 : ffffffff
R4 : ffffffff R5 : 00000000 R6 : 00000000 R7 : ffffffff
P0 : 00000020 P1 : 035640a8 P2 : 035640f8 P3 : 00000000
P4 : 00000000 P5 : 03562d7f FP : 03564068 SP : 0356ff24
LB0: 03562d69 LT0: 03562d5c LC0: 00000000
LB1: 0356280d LT1: 035627c6 LC1: 00000001
B0 : 00000000 L0 : 00000000 M0 : 00000000 I0 : 03563c78
B1 : 00000000 L1 : 00000000 M1 : 00000000 I1 : 03540004
B2 : 00000000 L2 : 00000000 M2 : 00000000 I2 : 00000000
B3 : 00000000 L3 : 00000000 M3 : 00000000 I3 : 00000000
A0.w: 00000000 A0.x: 00000000 A1.w: 00000000 A1.x: 00000000
USP : 03564050 ASTAT: 02002022
Hardware Trace:
0 Target : <0x00004c28> { _trap_c + 0x0 }
Source : <0xffa0867e> { _exception_to_level5 + 0xae }
1 Target : <0xffa085d0> { _exception_to_level5 + 0x0 }
Source : <0xffa0848c> { _bfin_return_from_exception + 0x18 }
2 Target : <0xffa08474> { _bfin_return_from_exception + 0x0 }
Source : <0xffa08528> { _ex_trap_c + 0x6c }
3 Target : <0xffa084bc> { _ex_trap_c + 0x0 }
Source : <0xffa0874a> { _trap + 0x5a }
4 Target : <0xffa086f0> { _trap + 0x0 }
Source : <0x035641bc> [ rec + 0x41bc ] 0x5656
5 Target : <0x03564064> [ rec + 0x4064 ]
Source : <0x0356404c> [ rec + 0x404c ] JUMP.S
6 Target : <0x03562d7a> [ rec + 0x2d3a ]
Source : <0x03562d70> [ rec + 0x2d30 ] RTS
7 Target : <0x03562d54> [ rec + 0x2d14 ]
Source : <0x03562d76> [ rec + 0x2d36 ] CALL pcrel
8 Target : <0x03562d74> [ rec + 0x2d34 ]
Source : <0x03562008> [ rec + 0x1fc8 ] CALL pcrel
9 Target : <0x03562000> [ rec + 0x1fc0 ]
Source : <0x0356202a> [ rec + 0x1fea ] IF CC JUMP
10 Target : <0x03562016> [ rec + 0x1fd6 ]
Source : <0x03562d70> [ rec + 0x2d30 ] RTS
11 Target : <0x03562d54> [ rec + 0x2d14 ]
Source : <0x03562012> [ rec + 0x1fd2 ] CALL pcrel
12 Target : <0x0356200c> [ rec + 0x1fcc ]
Source : <0x03562d7e> [ rec + 0x2d3e ] 0x5510
13 Target : <0x03562d7a> [ rec + 0x2d3a ]
Source : <0x03562d70> [ rec + 0x2d30 ] RTS
14 Target : <0x03562d54> [ rec + 0x2d14 ]
Source : <0x03562d76> [ rec + 0x2d36 ] CALL pcrel
15 Target : <0x03562d74> [ rec + 0x2d34 ]
Source : <0x03562008> [ rec + 0x1fc8 ] CALL pcrel
Userspace Stack
Stack info:
SP: [0x03564050] <0x03564050> [ rec + 0x4050 ]
Memory from 0x03564050 to 03565000
03564050:[55555555] 55555555 55555555 55555555 55555555 55555555 55555555 55555555
03564070: 55555555 55555555 55555555 55555555 55555555 55555555 55555555 55555555
03564090: 55555555 55555555 55555555 56565656 56565656 56565656 56565656 56565656
035640b0: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
035640d0: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
035640f0: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
03564110: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
03564130: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
03564150: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
03564170: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
03564190: 56565656 56565656 56565656 56565656 56565656 56565656 56565656 56565656
035641b0: 56565656 56565656 56565656 00335656 035640f8 03564204 <035607b8> 03565248
035641d0: 03565304 03566f90 00000000 00000002 03563c68 0356423c 03565248 00000096
035641f0: 00000005 000000c8 00000006 0000012c 00000007 03564230 <0356066e> 03563c20
03564210: 00000000 03565568 03563be0 00000001 0000000a 00000960 03564244 0356423c
03564230: 03566f38 <0356027e> 0000000d 00000003 00000000 7665642f 7974742f 30425355
03564250: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564270: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564290: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035642b0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035642d0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035642f0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564310: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564330: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564350: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564370: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564390: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035643b0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035643d0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035643f0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564410: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564430: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564450: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564470: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564490: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035644b0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035644d0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035644f0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564510: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564530: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564550: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564570: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564590: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035645b0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035645d0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035645f0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564610: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564630: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564650: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564670: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564690: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035646b0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035646d0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
035646f0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564710: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
03564730: 00000000 00000000 00000000 20657461 6f6d656d 50007972 696d7265 6f697373
03564750: 6564206e 6465696e 64614200 64646120 73736572 6f6c4200 64206b63 63697665
03564770: 65722065 72697571 44006465 63697665 726f2065 73657220 6372756f 75622065
03564790: 46007973 20656c69 73697865 49007374 6c61766e 63206469 73736f72 7665642d
035647b0: 20656369 6b6e696c 206f4e00 68637573 76656420 00656369 20746f4e 69642061
035647d0: 74636572 0079726f 61207349 72696420 6f746365 49007972 6c61766e 61206469
035647f0: 6d756772 00746e65 206f6f54 796e616d 65706f20 6966206e 2073656c 73206e69
03564810: 65747379 6f54006d 616d206f 6f20796e 206e6570 656c6966 6e490073 72707061
03564830: 6972706f 20657461 74636f69 6f66206c 65642072 65636976 78655400 69662074
03564850: 6220656c 00797375 656c6946 6f6f7420 72616c20 4e006567 7073206f 20656361
03564870: 7466656c 206e6f20 69766564 49006563 67656c6c 73206c61 006b6565 64616552
03564890: 6c6e6f2d 69662079 7320656c 65747379 6f54006d 616d206f 6c20796e 736b6e69
035648b0: 6f724200 206e656b 65706970 6d754e00 63697265 61206c61 6d756772 20746e65
035648d0: 2074756f 6420666f 69616d6f 754e006e 6972656d 206c6163 75736572 6f20746c
035648f0: 6f207475 61722066 0065676e 6f736552 65637275 61656420 636f6c64 7661206b
03564910: 6564696f 69460064 6e20656c 20656d61 206f6f74 676e6f6c 206f4e00 6b636f6c
03564930: 76612073 616c6961 00656c62 636e7546 6e6f6974 746f6e20 706d6920 656d656c
03564950: 6465746e 72694400 6f746365 6e207972 6520746f 7974706d 6f6f5400 6e616d20
03564970: 656c2079 736c6576 20666f20 626d7973 63696c6f 6e696c20 0000736b 6d206f4e
03564990: 61737365 6f206567 65642066 65726973 79742064 49006570 746e6564 65696669
035649b0: 65722072 65766f6d 68430064 656e6e61 756e206c 7265626d 74756f20 20666f20
035649d0: 676e6172 654c0065 206c6576 6f6e2032 79732074 7268636e 7a696e6f 4c006465
035649f0: 6c657665 68203320 65746c61 654c0064 206c6576 65722033 00746573 6b6e694c
03564a10: 6d756e20 20726562 2074756f 7220666f 65676e61 6f725000 6f636f74 7264206c
03564a30: 72657669 746f6e20 74746120 65686361 6f4e0064 49534320 72747320 75746375
03564a50: 61206572 6c696176 656c6261 76654c00 32206c65 6c616820 00646574 61766e49
03564a70: 2064696c 68637865 65676e61 766e4900 64696c61 71657220 74736575 73656420
03564a90: 70697263 00726f74 68637845 65676e61 6c756620 6f4e006c 6f6e6120 49006564
03564ab0: 6c61766e 72206469 65757165 63207473 0065646f 61766e49 2064696c 746f6c73
03564ad0: 61420000 6f662064 6620746e 20656c69 6d726f66 44007461 63697665 6f6e2065
03564af0: 20612074 65727473 4e006d61 6164206f 61206174 6c696176 656c6261 6d695400
03564b10: 65207265 72697078 4f006465 6f207475 74732066 6d616572 65722073 72756f73
03564b30: 00736563 6863614d 20656e69 6e207369 6f20746f 6874206e 656e2065 726f7774
03564b50: 6150006b 67616b63 6f6e2065 6e692074 6c617473 0064656c 656a624f 69207463
03564b70: 65722073 65746f6d 6e694c00 6168206b 65622073 73206e65 72657665 41006465
03564b90: 72657664 65736974 72726520 5300726f 756f6d72 6520746e 726f7272 6d6f4300
03564bb0: 696e756d 69746163 65206e6f 726f7272 206e6f20 646e6573 6f725000 6f636f74
03564bd0: 7265206c <00726f72> 746c754d 706f6869 74746120 74706d65 52006465 73205346
03564bf0: 69636570 20636966 6f727265 61420072 656d2064 67617373 61560065 2065756c
03564c10: 206f6f74 6772616c 6f662065 65642072 656e6966 61642064 74206174 00657079
03564c30: 656d614e 746f6e20 696e7520 20657571 6e206e6f 6f777465 46006b72 20656c69
03564c50: 63736564 74706972 6920726f 6162206e 74732064 00657461 6f6d6552 61206574
03564c70: 65726464 63207373 676e6168 43006465 6e206e61 6120746f 73656363 20612073
03564c90: 6465656e 73206465 65726168 696c2064 72617262 63410079 73736563 20676e69
03564cb0: 6f632061 70757272 20646574 72616873 6c206465 61726269 2e007972 2062696c
03564cd0: 74636573 206e6f69 61206e69 74756f2e 726f6320 74707572 41006465 6d657474
03564cf0: 6e697470 6f742067 6e696c20 6e69206b 6f6f7420 6e616d20 68732079 64657261
03564d10: 62696c20 69726172 43007365 6f6e6e61 78652074 61206365 61687320 20646572
03564d30: 7262696c 20797261 65726964 796c7463 766e4900 64696c61 20726f20 6f636e69
03564d50: 656c706d 6d206574 69746c75 65747962 20726f20 65646977 61686320 74636172
03564d70: 49007265 7265746e 74707572 73206465 65747379 6163206d 73206c6c 6c756f68
03564d90: 65622064 73657220 74726174 53006465 61657274 7020736d 20657069 6f727265
03564db0: 6f540072 616d206f 7520796e 73726573 636f5300 2074656b 7265706f 6f697461
03564dd0: 6e6f206e 6e6f6e20 636f732d 0074656b 74736544 74616e69 206e6f69 72646461
03564df0: 20737365 75716572 64657269 73654d00 65676173 6f6f7420 6e6f6c20 72500067
03564e10: 636f746f 77206c6f 676e6f72 70797420 6f662065 6f732072 74656b63 6f725000
03564e30: 6f636f74 6f6e206c 76612074 616c6961 00656c62 746f7250 6c6f636f 746f6e20
03564e50: 70757320 74726f70 53006465 656b636f 79742074 6e206570 7320746f 6f707075
03564e70: 64657472 65704f00 69746172 6e206e6f 7320746f 6f707075 64657472 6f725000
03564e90: 6f636f74 6166206c 796c696d 746f6e20 70757320 74726f70 41006465 65726464
03564eb0: 66207373 6c696d61 6f6e2079 75732074 726f7070 20646574 70207962 6f746f72
03564ed0: 006c6f63 72646441 20737365 65726c61 20796461 75206e69 43006573 6f6e6e61
03564ef0: 73612074 6e676973 71657220 74736575 61206465 65726464 4e007373 6f777465
03564f10: 69206b72 6f642073 4e006e77 6f777465 69206b72 6e752073 63616572 6c626168
03564f30: 654e0065 726f7774 7264206b 6570706f 6f632064 63656e6e 6e6f6974 206e6f20
03564f50: 65736572 6f530074 61777466 63206572 65737561 6f632064 63656e6e 6e6f6974
03564f70: 6f626120 43007472 656e6e6f 6f697463 6572206e 20746573 70207962 00726565
03564f90: 62206f4e 65666675 70732072 20656361 69617661 6c62616c 72540065 70736e61
03564fb0: 2074726f 70646e65 746e696f 20736920 65726c61 20796461 6e6e6f63 65746365
03564fd0: 72540064 70736e61 2074726f 70646e65 746e696f 20736920 20746f6e 6e6e6f63
03564ff0: 65746365 61430064 746f6e6e 6e657320
Return addresses in stack:
address : <0x035607b8> [ rec + 0x778 ]
address : <0x0356066e> [ rec + 0x62e ]
address : <0x0356027e> [ rec + 0x23e ]
address : <0x00726f72> /* kernel dynamic memory */
QuoteReplyEditDelete
2010-10-12 09:50:59 Re: Problem when I open a device (supervisor resource)
Mike Frysinger (UNITED STATES)
Message: 94433
verify you arent blowing your stack:
docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:debugging_applications#stack_checking
QuoteReplyEditDelete
2010-10-14 06:29:13 Re: Problem when I open a device (supervisor resource)
Usama Shakeel (PAKISTAN)
Message: 94511
Thanx Mike it seems it resolved the problem..