[asterisk-commits] mmichelson: branch mmichelson/res_timing_timerfd r154965 - in /team/mmichelso...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 5 23:13:55 CST 2008


Author: mmichelson
Date: Wed Nov  5 23:13:54 2008
New Revision: 154965

URL: http://svn.digium.com/view/asterisk?view=rev&rev=154965
Log:
This checkin passes the "it compiles" test. Next, I'll
actually try, you know, plugging in a phone and testing
it for real. Pretty novel, I know. I'm pretty cool like
that though. The ladies all agree. Except for Candy. 
She's a you-know-what though.


Modified:
    team/mmichelson/res_timing_timerfd/main/ast_expr2.c
    team/mmichelson/res_timing_timerfd/main/ast_expr2.h
    team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c

Modified: team/mmichelson/res_timing_timerfd/main/ast_expr2.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/res_timing_timerfd/main/ast_expr2.c?view=diff&rev=154965&r1=154964&r2=154965
==============================================================================
--- team/mmichelson/res_timing_timerfd/main/ast_expr2.c (original)
+++ team/mmichelson/res_timing_timerfd/main/ast_expr2.c Wed Nov  5 23:13:54 2008
@@ -128,7 +128,7 @@
 
 
 /* Copy the first part of user declarations.  */
-#line 1 "ast_expr2.y"
+#line 1 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 
 /* Written by Pace Willisson (pace at blitz.com) 
  * and placed in the public domain.
@@ -485,13 +485,13 @@
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 342 "ast_expr2.y"
+#line 344 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 {
 	struct val *val;
 	struct expr_node *arglist;
 }
 /* Line 187 of yacc.c.  */
-#line 493 "ast_expr2.c"
+#line 495 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
@@ -513,13 +513,13 @@
 
 
 /* Copy the second part of user declarations.  */
-#line 347 "ast_expr2.y"
+#line 349 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 
 extern int		ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
 
 
 /* Line 216 of yacc.c.  */
-#line 521 "ast_expr2.c"
+#line 523 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 
 #ifdef short
 # undef short
@@ -816,9 +816,9 @@
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   371,   371,   379,   386,   387,   396,   402,   403,   407,
-     411,   415,   419,   423,   427,   431,   435,   439,   443,   447,
-     451,   455,   459,   463,   467,   471,   475,   480
+       0,   373,   373,   381,   388,   389,   398,   404,   405,   409,
+     413,   417,   421,   425,   429,   433,   437,   441,   445,   449,
+     453,   457,   461,   465,   469,   473,   477,   482
 };
 #endif
 
@@ -1471,119 +1471,119 @@
   switch (yytype)
     {
       case 4: /* "TOK_COLONCOLON" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1475 "ast_expr2.c"
+#line 1477 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 5: /* "TOK_COND" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1480 "ast_expr2.c"
+#line 1482 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 6: /* "TOK_OR" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1485 "ast_expr2.c"
+#line 1487 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 7: /* "TOK_AND" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1490 "ast_expr2.c"
+#line 1492 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 8: /* "TOK_NE" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1495 "ast_expr2.c"
+#line 1497 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 9: /* "TOK_LE" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1500 "ast_expr2.c"
+#line 1502 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 10: /* "TOK_GE" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1505 "ast_expr2.c"
+#line 1507 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 11: /* "TOK_LT" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1510 "ast_expr2.c"
+#line 1512 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 12: /* "TOK_GT" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1515 "ast_expr2.c"
+#line 1517 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 13: /* "TOK_EQ" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1520 "ast_expr2.c"
+#line 1522 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 14: /* "TOK_MINUS" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1525 "ast_expr2.c"
+#line 1527 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 15: /* "TOK_PLUS" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1530 "ast_expr2.c"
+#line 1532 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 16: /* "TOK_MOD" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1535 "ast_expr2.c"
+#line 1537 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 17: /* "TOK_DIV" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1540 "ast_expr2.c"
+#line 1542 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 18: /* "TOK_MULT" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1545 "ast_expr2.c"
+#line 1547 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 19: /* "TOK_COMPL" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1550 "ast_expr2.c"
+#line 1552 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 20: /* "TOK_TILDETILDE" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1555 "ast_expr2.c"
+#line 1557 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 21: /* "TOK_EQTILDE" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1560 "ast_expr2.c"
+#line 1562 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 22: /* "TOK_COLON" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1565 "ast_expr2.c"
+#line 1567 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 23: /* "TOK_LP" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1570 "ast_expr2.c"
+#line 1572 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 24: /* "TOK_RP" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1575 "ast_expr2.c"
+#line 1577 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 25: /* "TOKEN" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1580 "ast_expr2.c"
+#line 1582 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
       case 29: /* "expr" */
-#line 365 "ast_expr2.y"
+#line 367 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 	{  free_value((yyvaluep->val)); };
-#line 1585 "ast_expr2.c"
+#line 1587 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
 	break;
 
       default:
@@ -1906,7 +1906,7 @@
   switch (yyn)
     {
         case 2:
-#line 371 "ast_expr2.y"
+#line 373 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
               ((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type;
               if( (yyvsp[(1) - (1)].val)->type == AST_EXPR_number )
@@ -1918,7 +1918,7 @@
     break;
 
   case 3:
-#line 379 "ast_expr2.y"
+#line 381 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     {/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
               ((struct parse_io *)parseio)->val->type = AST_EXPR_string;
 			  ((struct parse_io *)parseio)->val->u.s = strdup(""); 
@@ -1926,12 +1926,12 @@
     break;
 
   case 4:
-#line 386 "ast_expr2.y"
+#line 388 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.arglist) = alloc_expr_node(AST_EXPR_NODE_VAL); (yyval.arglist)->val = (yyvsp[(1) - (1)].val);;}
     break;
 
   case 5:
-#line 387 "ast_expr2.y"
+#line 389 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     {struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
                                  struct expr_node *t;
 								 DESTROY((yyvsp[(2) - (3)].val));
@@ -1941,7 +1941,7 @@
     break;
 
   case 6:
-#line 396 "ast_expr2.y"
+#line 398 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_func((yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].arglist), ((struct parse_io *)parseio)->chan);
 		                            DESTROY((yyvsp[(2) - (4)].val));
 									DESTROY((yyvsp[(4) - (4)].val));
@@ -1951,12 +1951,12 @@
     break;
 
   case 7:
-#line 402 "ast_expr2.y"
+#line 404 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     {(yyval.val) = (yyvsp[(1) - (1)].val);;}
     break;
 
   case 8:
-#line 403 "ast_expr2.y"
+#line 405 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = (yyvsp[(2) - (3)].val);
 	                       (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
 						   (yyloc).first_line=0; (yyloc).last_line=0;
@@ -1964,7 +1964,7 @@
     break;
 
   case 9:
-#line 407 "ast_expr2.y"
+#line 409 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
 						DESTROY((yyvsp[(2) - (3)].val));	
                          (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -1972,7 +1972,7 @@
     break;
 
   case 10:
-#line 411 "ast_expr2.y"
+#line 413 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                      (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -1980,7 +1980,7 @@
     break;
 
   case 11:
-#line 415 "ast_expr2.y"
+#line 417 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                     (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -1988,7 +1988,7 @@
     break;
 
   case 12:
-#line 419 "ast_expr2.y"
+#line 421 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
 						DESTROY((yyvsp[(2) - (3)].val));	
                          (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
@@ -1996,7 +1996,7 @@
     break;
 
   case 13:
-#line 423 "ast_expr2.y"
+#line 425 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                     (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2004,7 +2004,7 @@
     break;
 
   case 14:
-#line 427 "ast_expr2.y"
+#line 429 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                      (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2012,7 +2012,7 @@
     break;
 
   case 15:
-#line 431 "ast_expr2.y"
+#line 433 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                      (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2020,7 +2020,7 @@
     break;
 
   case 16:
-#line 435 "ast_expr2.y"
+#line 437 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                      (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2028,7 +2028,7 @@
     break;
 
   case 17:
-#line 439 "ast_expr2.y"
+#line 441 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                       (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2036,7 +2036,7 @@
     break;
 
   case 18:
-#line 443 "ast_expr2.y"
+#line 445 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                        (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2044,7 +2044,7 @@
     break;
 
   case 19:
-#line 447 "ast_expr2.y"
+#line 449 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_negate ((yyvsp[(2) - (2)].val)); 
 						DESTROY((yyvsp[(1) - (2)].val));	
 	                        (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column; 
@@ -2052,7 +2052,7 @@
     break;
 
   case 20:
-#line 451 "ast_expr2.y"
+#line 453 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_compl ((yyvsp[(2) - (2)].val)); 
 						DESTROY((yyvsp[(1) - (2)].val));	
 	                        (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column; 
@@ -2060,7 +2060,7 @@
     break;
 
   case 21:
-#line 455 "ast_expr2.y"
+#line 457 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                       (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2068,7 +2068,7 @@
     break;
 
   case 22:
-#line 459 "ast_expr2.y"
+#line 461 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                      (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2076,7 +2076,7 @@
     break;
 
   case 23:
-#line 463 "ast_expr2.y"
+#line 465 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                      (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2084,7 +2084,7 @@
     break;
 
   case 24:
-#line 467 "ast_expr2.y"
+#line 469 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                        (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2092,7 +2092,7 @@
     break;
 
   case 25:
-#line 471 "ast_expr2.y"
+#line 473 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                        (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2100,7 +2100,7 @@
     break;
 
   case 26:
-#line 475 "ast_expr2.y"
+#line 477 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val)); 
 						DESTROY((yyvsp[(2) - (5)].val));	
 						DESTROY((yyvsp[(4) - (5)].val));	
@@ -2109,7 +2109,7 @@
     break;
 
   case 27:
-#line 480 "ast_expr2.y"
+#line 482 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
     { (yyval.val) = op_tildetilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val)); 
 						DESTROY((yyvsp[(2) - (3)].val));	
 	                        (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column; 
@@ -2118,7 +2118,7 @@
 
 
 /* Line 1267 of yacc.c.  */
-#line 2120 "ast_expr2.c"
+#line 2122 "/usr/src/res_timing_timerfd/main/ast_expr2.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -2338,7 +2338,7 @@
 }
 
 
-#line 486 "ast_expr2.y"
+#line 488 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 
 
 static struct expr_node *alloc_expr_node(enum node_type nt)

Modified: team/mmichelson/res_timing_timerfd/main/ast_expr2.h
URL: http://svn.digium.com/view/asterisk/team/mmichelson/res_timing_timerfd/main/ast_expr2.h?view=diff&rev=154965&r1=154964&r2=154965
==============================================================================
--- team/mmichelson/res_timing_timerfd/main/ast_expr2.h (original)
+++ team/mmichelson/res_timing_timerfd/main/ast_expr2.h Wed Nov  5 23:13:54 2008
@@ -94,13 +94,13 @@
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
 typedef union YYSTYPE
-#line 342 "ast_expr2.y"
+#line 344 "/usr/src/res_timing_timerfd/main/ast_expr2.y"
 {
 	struct val *val;
 	struct expr_node *arglist;
 }
 /* Line 1489 of yacc.c.  */
-#line 104 "ast_expr2.h"
+#line 104 "/usr/src/res_timing_timerfd/main/ast_expr2.h"
 	YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1

Modified: team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c?view=diff&rev=154965&r1=154964&r2=154965
==============================================================================
--- team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c (original)
+++ team/mmichelson/res_timing_timerfd/res/res_timing_timerfd.c Wed Nov  5 23:13:54 2008
@@ -22,6 +22,18 @@
  *
  * \brief timerfd timing interface 
  */
+
+#include "asterisk.h"
+
+#include <sys/timerfd.h>
+
+#include "asterisk/module.h"
+#include "asterisk/astobj2.h"
+#include "asterisk/timing.h"
+#include "asterisk/logger.h"
+#include "asterisk/utils.h"
+#include "asterisk/time.h"
+
 static void *timing_funcs_handle;
 
 static int timerfd_timer_open(void);
@@ -44,44 +56,209 @@
 	.timer_get_max_rate = timerfd_timer_get_max_rate,
 };
 
+static struct ao2_container *timerfd_timers;
+
+#define TIMERFD_TIMER_BUCKETS 563
+
+struct timerfd_timer {
+	int handle;
+	struct itimerspec saved_timer;
+	unsigned int is_continuous:1;
+};
+
+static int timerfd_timer_hash(const void *obj, const int flags)
+{
+	const struct timerfd_timer *timer = obj;
+
+	return timer->handle;
+}
+
+static int timerfd_timer_cmp(void *obj, void *args, int flags)
+{
+	struct timerfd_timer *timer1 = obj, *timer2 = args;
+	return timer1->handle == timer2->handle ? CMP_MATCH | CMP_STOP : 0;
+}
+
+static void timer_destroy(void *obj)
+{
+	struct timerfd_timer *timer = obj;
+	close(timer->handle);
+}
+
 static int timerfd_timer_open(void)
 {
+	struct timerfd_timer *timer;
+	int handle;
+
+	if (!(timer = ao2_alloc(sizeof(*timer), timer_destroy))) {
+		ast_log(LOG_ERROR, "Could not allocate memory for timerfd_timer structure\n");
+		return -1;
+	}
+	if ((handle = timerfd_create(CLOCK_MONOTONIC, 0)) < 0) {
+		ast_log(LOG_ERROR, "Failed to create timerfd timer: %s\n", strerror(errno));
+		ao2_ref(timer, -1);
+		return -1;
+	}
+
+	ao2_link(timerfd_timers, timer);
+	/* Get rid of the reference from the allocation */
+	ao2_ref(timer, -1);
+	return handle;
 }
 
 static void timerfd_timer_close(int handle)
 {
+	struct timerfd_timer *our_timer, find_helper = {
+		.handle = handle,
+	};
+
+	if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) {
+		ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
+		return;
+	}
+
+	ao2_unlink(timerfd_timers, our_timer);
+	ao2_ref(our_timer, -1);
 }
 
 static int timerfd_timer_set_rate(int handle, unsigned int rate)
 {
+	struct itimerspec itspec;
+	itspec.it_value.tv_sec = 0;
+	itspec.it_value.tv_nsec = (long) (1000000000 / rate);
+	itspec.it_interval.tv_sec = itspec.it_value.tv_sec;
+	itspec.it_interval.tv_nsec = itspec.it_value.tv_nsec;
+
+	return timerfd_settime(handle, 0, &itspec, NULL);
 }
 
 static void timerfd_timer_ack(int handle, unsigned int quantity)
 {
+	uint64_t expirations;
+	int read_result = 0;
+
+	do {
+		read_result = read(handle, &expirations, sizeof(expirations));
+		if (read_result == -1) {
+			if (errno == EINTR) {
+				continue;
+			} else {
+				ast_log(LOG_ERROR, "Read error: %s\n", strerror(errno));
+				break;
+			}
+		}
+	} while (read_result != sizeof(expirations));
+
+	if (expirations != quantity) {
+		ast_log(LOG_WARNING, "Expected to acknowledge %u ticks but got %llu instead\n", quantity, expirations);
+	}
 }
 
 static int timerfd_timer_enable_continuous(int handle)
 {
+	int res;
+	struct itimerspec continuous_timer;
+	struct timerfd_timer *our_timer, find_helper = {
+		.handle = handle,
+	};
+
+	if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) {
+		ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
+		return -1;
+	}
+
+	if (our_timer->is_continuous) {
+		/*It's already in continous mode, no need to do
+		 * anything further
+		 */
+		ao2_ref(our_timer, -1);
+		return 0;
+	}
+
+	memset(&continuous_timer, 0, sizeof(continuous_timer));
+	continuous_timer.it_value.tv_nsec = 1;
+	
+	res = timerfd_settime(handle, 0, &continuous_timer, &our_timer->saved_timer);
+	our_timer->is_continuous = 1;
+	ao2_ref(our_timer, -1);
+	return res;
 }
 
 static int timerfd_timer_disable_continuous(int handle)
 {
+	int res;
+	struct timerfd_timer *our_timer, find_helper = {
+		.handle = handle,
+	};
+
+	if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) {
+		ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
+		return -1;
+	}
+
+	if(!our_timer->is_continuous) {
+		/* No reason to do anything if we're not
+		 * in continuous mode
+		 */
+		ao2_ref(our_timer, -1);
+		return 0;
+	}
+	
+	res = timerfd_settime(handle, 0, &our_timer->saved_timer, NULL);
+	our_timer->is_continuous = 0;
+	memset(&our_timer->saved_timer, 0, sizeof(our_timer->saved_timer));
+	ao2_ref(our_timer, -1);
+	return res;
 }
 
 static enum ast_timing_event timerfd_timer_get_event(int handle)
 {
+	enum ast_timing_event res;
+	struct timerfd_timer *our_timer, find_helper = {
+		.handle = handle,
+	};
+
+	if (!(our_timer = ao2_find(timerfd_timers, &find_helper, OBJ_POINTER))) {
+		ast_log(LOG_ERROR, "Couldn't find timer with handle %d\n", handle);
+		return -1;
+	} 
+
+	if (our_timer->is_continuous) {
+		res = AST_TIMING_EVENT_CONTINUOUS;
+	} else {
+		res = AST_TIMING_EVENT_EXPIRED;
+	}
+
+	ao2_ref(our_timer, -1);
+	return res;
 }
 
 static unsigned int timerfd_timer_get_max_rate(int handle)
 {
+	return 1000;
 }
 
 static int load_module(void)
 {
+	if (!(timerfd_timers = ao2_container_alloc(TIMERFD_TIMER_BUCKETS, timerfd_timer_hash, timerfd_timer_cmp))) {
+		return AST_MODULE_LOAD_DECLINE;
+	}
+	
+	if (!(timing_funcs_handle = ast_install_timing_functions(&timerfd_timing_functions))) {
+		ao2_ref(timerfd_timers, -1);
+		return AST_MODULE_LOAD_DECLINE;
+	}
+
+	return AST_MODULE_LOAD_SUCCESS;
 }
 
 static int unload_module(void)
 {
+	/* ast_uninstall_timing_functions(timing_funcs_handle); */
+
+	/* This module can not currently be unloaded.  No use count handling is being done. */
+
+	return -1;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Timerfd Timing Interface");




More information about the asterisk-commits mailing list